-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Turbolinks legacy module #1650
Turbolinks legacy module #1650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! Really glad to see that you were able to move all the turbolinks stuff into the same module. My concern is that I just know people will miss that they need to include the module. I think I'd prefer that we still include the turbolinks module for this next release. The new turbo module, though, would just override the special_ajax_redirect
method (or whatever it might be renamed to) and have an empty method for set_turbolinks_location_header_from_session
so that if the turbo module and turbolinks module are present, the turbo one takes precedent. And I think it would probably be best to switch to including the turbo module in generated projects (so in LuckyCli) instead of the Lucky::Action
so that this situation can be solved outside of updating lucky directly in the future. Make sense?
It makes perfect sense : the "double-overriding" was the missing piece of the puzzle for a non-breaking change path. Thank you :-) |
…Action by default
I pushed the discussed changes and I renamed the module back to Ready for (final ?) review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR got tiny! Nice work 🎉
Follow-up / Replace #1648
Following various discussions about the fate of Turbolinks support in Lucky, this PR extract Turbolinks specific code that was hardcoded in
redirectable.cr
to a single module fileturbolinks_action_support.cr
.This module can be included into a
Lucky::Action
to regain Turbolinks support.This is a necessary step for Lucky to be able to support alternatives (like Turbo Drive for example) without monkeypatching
redirectable.cr
Right now, in the current state of this PR, an existing Lucky project needs to include
Lucky::TurboLinksActionSupport
into every related action or into an "umbrella" action to keep Turbolinks support like this spec example :I'm open to more elegant / efficient refactoring / naming / ... changes.
Checklist
crystal tool format spec src
./script/setup
./script/test