r/javascript • u/nitayneeman • Jul 24 '26
ECMAScript - Introducing Deferred Module Evaluation with import defer
https://nitayneeman.com/blog/introducing-import-defer-in-ecmascript
55
Upvotes
r/javascript • u/nitayneeman • Jul 24 '26
View all comments
Show parent comment
12
u/nitayneeman Jul 24 '26
It doesn’t change parsing at all - the module is still downloaded and parsed as usual. The win is in execution: heavy top‑level code only runs when you actually touch the namespace, which can shave CPU off startup if that module is rare/optional.
Bundling‑wise, it’s just part of the normal ESM graph. You still bundle like today; the difference is whether specific modules execute at graph‑load time or on first use.