-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Added support for @hotwired/turbo. #1374
Conversation
if (context.ReactOnRails) { | ||
return context.ReactOnRails.option('turbo') === true; | ||
} | ||
} |
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.
Is a configuration better than detection?
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.
No, I also would prefer a detection if possible. But as I noticed Turbo will be included only as module (for webpack(er)) in contrast to Turbolinks, which will inject itself to the global window.
So I don't know a way to inspect the global environment to detect if the Turbo module is used somewhere in the application.. if you have a hint for me, we can adjust that of course.
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.
Try require within a try block.
I can get you a cod snippet if needed.
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.
The problem with detection logic like that is that it would only detect if turbo is being bundled through webpacker
even though turbo supports sprockets
as well.
@pgruener Let me know if I should take over your PR or if you have an ETA. I'd like to ship it in the next release. |
@justin808 Thanks for your message. You can of course take over, as I didn't get time yet to go on with your suggestion (even if it should only take a few minutes). My best ETA would be around the coming weekend, but I'd really appreciate it to be shipped soon. |
@pgruener Say 👋 when you get to the Slack. Next weekend would be fine. I've got a ton of other pending tasks. I really appreciate the help! |
@pgruener Any update? |
@Judahmeek can you review also? |
@pgruener can you see if you can fix the CI issues? |
We need some short docs on this. Maybe we should update this page: https://github.com/shakacode/react_on_rails/blob/9ef6b326213480d0022db42710e5517cad0317bc/docs/rails/turbolinks.md ? or is turbo different enough that we should create a new doc page? |
This change is