devise icon indicating copy to clipboard operation
devise copied to clipboard

turbo_stream fix bugs for rails 7 and above apps

Open Salanoid opened this issue 3 years ago • 4 comments

I tried to fix this two issues: https://github.com/heartcombo/devise/issues/5448, https://github.com/heartcombo/devise/issues/5446.

Salanoid avatar Feb 09 '22 19:02 Salanoid

@carlosantoniodasilva Would be great to get this or something similar merged

clemensg avatar Mar 17 '22 14:03 clemensg

PR #5340 looks like it aims for a deeper integration into devise than what is proposed in this pull request.

Besides this, using turbo is also valid in a rails 6.1 context. So just checking for "> Rails 7" would exclude some valid use cases

tmaier avatar Mar 27 '22 19:03 tmaier

@tmaier Would something along the lines of a class_option boolean on the generator allow for less surprising behavior than checking for a Rails version?

  class_option :turbo, type: :boolean, default: false

That way somebody who wants Turbo could run rails generate devise:install --turbo to get Turbo behavior generated irrespective of Rails version.

You could make the default true for 5.x, but keep behavior as-is unless somebody specifically requests generation with Turbo in 4.x.

msducheminjr avatar Jun 21 '22 20:06 msducheminjr

I am not sure what's the right approach in the context of devise.

I think I would have checked, if Turbo is defined with defined?(::Turbo)

Ref. https://github.com/hotwired/turbo-rails/blob/main/lib/turbo-rails.rb

tmaier avatar Jun 21 '22 22:06 tmaier

PR #5340 looks like it aims for a deeper integration into devise than what is proposed in this pull request.

Besides this, using turbo is also valid in a rails 6.1 context. So just checking for "> Rails 7" would exclude some valid use cases

Perhaps Devise should just be versioned with incremental support for Rails 6 dropped, in favor of a cleaner implementation for Rails 7+?

shaunbruno avatar Sep 27 '22 22:09 shaunbruno

Forgive me for chiming in on this, but I am getting confused by the different issues.

Is there a canonical (at at least blessed) way to get Devise and Rails 7 playing nicely together?

evdevdev avatar Nov 07 '22 15:11 evdevdev

The main branch should contain all that's necessary for fully working with Turbo now, based on the changes here and a few others. A new version will be released soon, but feel free to test it out from the main branch in the meantime, and report back on any issues. Thanks.

carlosantoniodasilva avatar Feb 09 '23 21:02 carlosantoniodasilva