The default for Rails 7 is import maps for Javascript and Tailwind for CSS. With these choices you won’t need to worry node, yarn or bundlers like esbuild or webpack.
If you have specific needs for JS, like transpiling to ES5, or you want to use many NPM packages, you will replace import maps with jsbundling-rails. This gem provides integration between Rails and a js bundler of your choice: webpack, esbuild or rollbar.
If you want to create your own CSS lib from scratch (maybe your UX team has defined a design system for your app), you will replace tailwind with cssbundling-rails. This gem provides integration between Rails and a css bundler of your choice: postscss, sass, etc.
Finally, if you do switch to jsbundling-rails or cssbundling-rails you will need either Sprockets or Propshaft. Sprockets will still be supported, but Propshaft is the way forward.
Just a caveat, it seems propshaft isn’t yet a Rails default (it is used by rails new when passing -a propshaft). It is still version 0.x and its README states:
Ah, yes that’s true. It’s alpha and, as far as I know, only deployed in two production apps: Basecamp’s and mine. So it’s feature set is currently limited to what these two apps required.
That side, inside that feature set, it works well. My app has 11 CSS entrypoints, 6 JS entrypoints and over 3000 image assets. It uses jsbundlinh and cssbundling. Migration took 2 hours and we had no problems so far.
I’m using JSBundling and ESbuild for my Rails 7 projects. It offers me more controls over importmap, which I like the idea but I think need to be more mature before I decide to jump into it.