3 ms·
A huge fraction of sites today are already bundled, just poorly. WebBundles solves the problem that devs are already working around with tools. HTML, JavaScrip
by spankalee 6y ago
A huge fraction of sites today are already bundled, just poorly. WebBundles solves the problem that devs are already working around with tools.
HTML, JavaScript, CSS and images are not natively bundleable. So tools like Webpack and Rollup dramatically transform the files to be able to bundle them. JavaScript is recompiled into a single file so that it's impossible to cache the individual files, and many features like dynamic import, asset fetches, and import.meta.url are partially broken.
CSS is concatenated, against breaking caching and preventing the use of individual files in separate CSS scopes.
WebBundles actually bundles the real files that would have been sent unbundled, and it works with any file/response type. WebBundles have much better compressibility than the unbundled files. So it's is both a better HTTP/2 push, and a better version of what sites are doing with tools.
And since WebBundles work with the existing request/response pipeline, the files are individually fed into the network cache (and blockers, btw), which makes it possible to build delta bundles that only include updated files. This gives you the best of both worlds of bundled and unbundled serving.
- yencabulator 6y ago> JavaScript is recompiled into a single file That world has largely moved to "chunks", where there are multiple bundles loaded on-demand, based on e.g. user navigating to a less-used part of the web app. Going to a single file as a WebBundle would be downgrade in features. Replacing those JS transforming kludges with a reasonable file format sounds useful, though, and allows combining JS+CSS+images in a new way. It does sound awfully lot like HTTP Push, which as far as I know is largely unused because the idea that the server knows what the client wants hasn't really proven true.
- spankalee 6y agoWhy would WebBundles be a downgrade? If you currently serve multiple Rollup bundles, you can instead serve multiple WebBundles.
- yencabulator 6y agoSee what I quoted and was replying to.