I’ve extracted the importmap functionality from the stimulus-rails gem and created a new general-purpose importmap-rails gem. This gem will form the basis for allowing modern JavaScript apps to be built with Rails 7.0 without Webpack by default. You can read more about the specifics for importmap-rails here: GitHub - rails/importmap-rails: Use ESM with importmap to manage modern JavaScript in Rails without transpiling or bundling.
I’ve released a new version of the stimulus-rails gem as version 0.3.0 without the prototype importmap mechanics, but that instead relies on what’s been made available by importmap-rails. This is a breaking change. You will need to install importmap-rails, then reference @hotwired/stimulus-autoloader via the importmap to continue, if you’re upgrading from a previous version and use the asset pipeline.
I’ve also released a new version of the turbo-rails gem as version 0.7.0 where the asset pipeline installer assumes that importmap-rails is available. No changes if you’re using this together with Webpacker.
Enjoy!