Moving to ImportMaps-Rails from Webpacker

Hi Guys,
In Rails 7, Webpacker, UJS, and Turbolinks are replaced with Hotwire and Stimulus. Webpacker is no longer actively developed. When we examine the ComputeStacks project, we see that the asset pipeline is mostly used. There are several ES6-requiring javascript libraries. Major browsers now support ES6. In other words, libraries like React can be used without babel. Complex projects may still need advanced bundlers like webpack. But for this project removing webpacker seems to be best. I opened a new branch and deleted the webpacker and integrated ImportMaps-rails. Nothing broke in the project. It looks like we can easily transition. ImportMap-rails allows downloading javascript libraries in the vendor folder or importing them via CDN as before. You can get rid of huge node_modules folder. It feels like a Bower bundler from the old days. I also tried ESBuild but I think compiling ES6 to old javascript is no longer needed. I also gave a try with Hotwire Turbo, it makes pages load faster and it feels like a single page application. With Hotwire Turbo, nothing broke in the project. I’m thinking of working on this a little more and sending PR. I’m curious about any thoughts. Thanks.

Hi Mehmet,

Yes, I agree with your general assessment. The use of web packer is simply due to the age of the app, and I was waiting until we developed a new UI before migrating off of it.

If you would like to migrate off of web packer and make the changes you suggested, I will review your PR. However, it might be worthwhile to combine this with a refresh of the UI.