4 ms·
One major benefit is that for any given page in your application, you probably don't need the entire bundle. This is not really true for SPA's, but I hope that
by treve 8y ago
One major benefit is that for any given page in your application, you probably don't need the entire bundle.
This is not really true for SPA's, but I hope that's a trend that will eventually sizzle out again except for specialized cases.
Just grabbing what you need can have significant benefits. I agree with the latency problem though, it would be nice to have a HTTP/2 or HTTP/3 server that has a basic understanding of the JS dependency tree and preemptively push the entire tree.
- plausibilities 8y agoHere's the problem I'm struggling with: 1. Typically, you only ever care about minimizing bundle size in cases where latency is consistently questionable 2. In those cases, whatever UI you're supporting is likely then not meant for latency-sensitive operations, and thus the overall workflow tends to have low state complexity 3. Just how much actual value is added in those scenarios by having the ESM workflow specifically in conjunction with importable NPM modules? I'm sure you can think up some contrived use cases but I'm just not seeing any particularly compelling ones.
- s_y_n_t_a_x 8y agoNo it's not just latency. In fact, that's not even the most important factor. On mobile devices if the script is too large, it will freeze while parsing.
- infinite8s 8y ago> This is not really true for SPA's, but I hope that's a trend that will eventually sizzle out again except for specialized cases. I suspect we'll see the opposite, with people building desktop type applications and deploying through the browser (especially with the growth of wasm)
- Can_Not 8y agonuxtjs and webpack4 are actually automatically bundling dependencies so that libraries are automatically included only on pages that use them.