DHH recently announced that Rails 7 will not use Webpacker by default. This is a big departure that every Rails developer should have on their radar.
The main takeaways from this video (and the corresponding blog post) are:
- ES6 can be used natively now–no more transpiling!
- HTTP2 removes the penalties for serving lots of small asset files instead of individual (large) concatenated and minified asset files
- Import maps are supported by a few browsers and can be added to the rest with a small shim
The big caveat, though, is that existing projects that are already mired in the current way of doing things will have a hard time converting to the new hotness and may have to stick with Webpacker. I’ll be interested to see if the Rails team develops some sort of migration path to help old apps leave Webpacker behind. For new projects or existing apps that are light on JS, though, using this ES6/HTTP2/import maps method should be pretty straight-forward.
I am very excited about this, and I wholeheartedly agree with DHH that “we’re way overdue [for] a correction back to simplicity for the frontend.”
Loved the article? Hated it? Didn’t even read it?
We’d love to hear from you.