Rails 7: How can I remove Turbo completely?

Viewed 1272

I have a Rails 7 application. After some development I see that Turbo (Hotwired) creates too many issues and I don't need it for this application.

Is there any way to remove Turbo completely from an existing Rails app?

What is the recommended way to remove it?

2 Answers

You need to remove gem "turbo-rails" from the Gemfile, run bundle install to update the dependencies. Also run

bin/importmap unpin @hotwired/turbo-rails
bin/importmap unpin @hotwired/stimulus
bin/importmap unpin @hotwired/stimulus-loading

and remove import "@hotwired/turbo-rails" from app/javascript/application.js

So far Turbo has just been a ball ache, I was planning on creating a rails 7 app for my startup and then slowly looking at adding Turbo functionality later. But I think I’ll just remove it as it’s causing issues with redirects, link_to etc

Related