By Harvey Ico, backend engineer at Unifa
With the release of Rails 7, webpacker is now optional!? Meaning to say, if you install a new rails application, you will now have to specify that it includes webpacker too. This is how you do it:
rails new myproject -j webpacker
But why did rails decided to remove webpacker as default? Their explanation was:
This bridge is no longer needed for most people in most situations following the release of Rails 7. We now have three great default answers to JavaScript in 2021+, and thus we will no longer be evolving Webpacker in an official Rails capacity.
I was actually surprised myself. I've been using webpacker for 5 years and then now this.. I quite like the Watch feature of webpacker, whereas it compiles and reload your page immediately after saving. Overall, I think webpacker was quite the convenient tool. But yeah, changes are happening very fast specially on the Tech industry.
Now to Rails 7, it seems they are now using Import maps
as default.
So I decided to take a look, and try it myself.