In rails 7, there are many new ways to handle Javascript: webpack, rollup, esbuild and importmap.
Using _index.js.haml used to be a way to build dynamic javascript files at run time, pulling some data from the backend and changing the content of the javascript file depending the circumstances.
Such “on the fly” javavascript update can not work with Rails 7 since all the javascript is now frozen when you deploy the application.