Stimulus and other *front-end frameworks not documented in rails

I really love StimulusJS but I had it took me a bit of time to integrate it with rails. There’s no section for stimulus and rails in the docs yet there droves of people using this beautiful library. Regardless of the fact that it is an independent JS library, it is the de facto way to add some sprinkles of JS and therefore it should be somewhere in the official docs IMO.

I have also had times where I thought a front end framework like Vue or Svelte would do the trick for me e.g. Svelte comes with transitions baked in and a sprinkle of Svelte in a rails app could come in handy. In some cases, I can even write fewer lines of code than I would if I would opt for Stimulus controllers. I thinks Rails should provide some useful documentation of how to play around with other frameworks.

1 Like

Webpacker has a configuration option to set up Stimulus somewhere. There’s an effort to clean up the JS documentation in

1 Like

I’ve enjoyed playing with Svelte in my Rails app. I pass arguments from the Rails view to the Svelte component with a svelte_component helper as shown below. Might be helpful to have this kind of thing documented or even having a gem for it.

https://github.com/rails/webpacker/issues/2266#issuecomment-623156059