If you have a lot of controllers, you may well want to lazy load them instead. This works well together with preloading in the import map when you have a modest number of controllers. The installer will amend your config/importmap.rb to configure this such that all controllers in app/javascript/controllers are pinned.īy default, your application will be setup to eager load all the controllers mentioned in your import map under "controllers". With an import-mapped application, controllers are automatically pinned and registered based on the file structure.
If you're using an import map, the Stimulus dependencies will be pinned to the versions of the library included with this gem. The installer will automatically detect whether you're using an import map or JavaScript bundler to manage your application's JavaScript.
Turbotax stimulus install#
But if you're on Rails 6, you can install it with the installer or manually: Installing with installer This gem is automatically configured for applications made with Rails 7+ (unless -skip-hotwire is passed to the generator). Make sure to install one of these first! Installation
It relies on either importmap-rails to make Stimulus available via ESM or a Node-capable Rails (like via jsbundling-rails) to include Stimulus in the bundle. Stimulus for Rails makes it easy to use this modest framework with both import-mapped and JavaScript-bundled apps.
Stimulus pairs beautifully with Turbo to provide a complete solution for fast, compelling applications with a minimal amount of effort. Instead, it’s designed to augment your HTML with just enough behavior to make it shine. It doesn’t seek to take over your entire front-end in fact, it’s not concerned with rendering HTML at all. Stimulus is a JavaScript framework with modest ambitions.