With the general availability of native ES modules and HTTP/2 in modern browsers, some developers are advocating for a unbundled approach for shipping

Why do we still need bundlers? ​

submited by
Style Pass
2024-12-26 05:30:04

With the general availability of native ES modules and HTTP/2 in modern browsers, some developers are advocating for a unbundled approach for shipping web applications, even in production. While this approach works for smaller applications, in our opinion bundling is still very much necessary if you are shipping anything non-trivial and care about performance (which translates to better user experience).

Even in a polished unbundled deployment model, a build step is still often unavoidable. Take Rails 8's default import-map-based approach for example: all JavaScript assets still go through a build step in order to fingerprint the assets and generate the import map and modulepreload directives. It's just handled via importmap-rails and Propshaft instead of a JavaScript bundler.

Going with unbundled means locking yourself out of a big part of the JS ecosystem and giving up on many possible performance optimizations that could benefit your end users.

Leave a Comment