Re:Mako – fast, production-grade web bundler based on Rust
by aaaaaaabbbbbb on Tuesday July 02, 2024 @02:44PM
(#40859353)
If you have a lot of files, the initial (dev server) page load times increases linearly with the number of files you have.
With a slow bundler, that tradeoff made sense, but with a fast bundler, it is suboptimal.
Also, typically the application is split into multiple smaller bundles, so only a slice of the application is rebundled on change.
Re:Mako – fast, production-grade web bundler based on Rust
by mikojan on Tuesday July 02, 2024 @02:40PM
(#40859314)
You need to use some kind of automation to fingerprint your files for optimal caching.
Where applicable there simply does not exist a better caching strategy than fingerprint plus Cache-Control: immutable
Re:Mako – fast, production-grade web bundler based on Rust
by mgaunard on Tuesday July 02, 2024 @04:03PM
(#40859960)
Well but I might have a hundred files, only one of which changed.
The 99 other ones are still in the browser cache and don't need to be re-(down)loaded.
If I bundle everything, then I have to scrap and reload everything, which is probably great for the final user, but not the developer actively modifying it.
Re:Mako – fast, production-grade web bundler based on Rust
by mikojan on Tuesday July 02, 2024 @06:03PM
(#40860847)
A bundler does not necessarily produce a single file. I have not tried Mako. But from the docs it appears to do code splitting just like the others.
Re:Mako – fast, production-grade web bundler based on Rust
by 8n4vidtmkvmk on Tuesday July 02, 2024 @08:06PM
(#40861635)
The best solution (as always) is a hybrid. You want to bundle up a bunch of the small files, and split usually along loading boundaries such as page navs.
For development, you don't need to "bundle" at all but you still need to transpile.
Re:Mako – fast, production-grade web bundler based on Rust
by chuckadams on Wednesday July 03, 2024 @01:26AM
(#40862966)
In a dev environment you can use the Vite dev server, which serves every module separately, compiles them on the fly as they’re requested, and hot-reloads them when they change. All at the granularity of single files. Bundling then only happens when building the final output.
What exactly is the point of a bundler in the rapid development cycle? If you want your web app to load up fast, it's better if you only need to redownload the parts that actually changed, so you're better off not bundling them.