With Rails 7 coming out soon, it's a good time to look at what it could take to upgrade our existing applications to esbuild. In this episode, we start with a Rails 6 application and begin the upgrade process by removing Webpacker and switching over to esbuild.
In this episode, we create a chat application using Rails 7, esbuild (JS Bundling), CSS Bundling, Hotwire, and Action Text. We also dive into some issues around CSS Bundling and Action Text.
Use esbuild to bundle your JavaScript, then deliver it via the asset pipeline in Rails. This gem provides an installer to get you going with esbuild in a new Rails application.
Import maps let you import JavaScript modules using logical names that map to versioned/digested files – directly from the browser. This will be a default in the upcoming Rails 7.