Is Turbolinks a requirement for StimulusJS?

I apologize in advance if this might sound like a simple question to majority. As a newcomer, I’m having a hard time trying to find whether I must use Turbolinks if I want to use StimulusJS?

I’m working on a Rails 5.2 app and recently gutted out Turbolinks becuase I was having a hard time trying to get it to play nice with jQuery. Maybe I’m too old school and slow in adopting change…but the current state of documentation/examples that exist for Turbolinks didn’t cut it for me.

However, after following StimulusJS for the past few months, I do see the advantage to using it over writing a handful of jQuery named functions to handle basic user interaction with my pages. So, this is why I want to understand if I can learn and use StimulusJS without having to bang my head against Turbolinks? I wouldn’t mind a short answer like “yes” or “no” either. I also think it would be a good idea for the creators to mention this coupling/requirement on their website. Thank you.

You can definitely use Stimulus without Turbolinks.
The cherry on the pie is that if all of your JS is wrapped in Stimulus controllers, 99.9% of your Turbolinks issues are gone!

5 Likes