Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow turbo-rails to be excluded from new applications with the --ignore-action-cable flag? #51768

Open
dbelling opened this issue May 8, 2024 · 2 comments

Comments

@dbelling
Copy link

dbelling commented May 8, 2024

Steps to reproduce

$ rails g new app
$ bundle install
$ rails turbo:install
$ rails c
$ irb(main):005> Turbo::StreamsChannel.signed_stream_name('foo')
(irb):5:in `<main>': uninitialized constant ActionCable (NameError)

class Turbo::StreamsChannel < ActionCable::Channel::Base
                                                  ^^^^^^

Expected behavior

I'm not sure if this is a bit of a yak shave, but - in light of the intrinsic dependency that the Hotwire Turbo ecosystem has on ActionCable and the current workaround required, does it make to control the inclusion/exclusion of these libraries with this flag as well?

Actual behavior

I was attempting to reproduce the behavior reported in thoughtbot/administrate#2548, and realized that ActionCable is a soft dependency for the turbo-rails library. The Gemfile generator (at present) does not recognize the --ignore-action-cable flag when adding turbo-rails and stimulus-rails to the Gemfile.

System configuration

Rails version: 7.1.3.2

Ruby version: 3.2.2

@skipkayhil
Copy link
Member

If I understand correctly, a new release of turbo-rails would resolve this right? I'm not sure there's anything to change here for Rails itself

@jeromedalbert
Copy link

jeromedalbert commented May 18, 2024

Now that Rails 8 alpha includes Turbo by default, this issue is becoming more apparent. I submitted a similar issue #51860 where the Rails app cannot boot in production if action cable is skipped. I don't know what the best solution would be, but I have mentioned @dbelling's suggestion as one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants