-
Notifications
You must be signed in to change notification settings - Fork 436
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
Disabling Drive keeps Frames default behaviour #648
Conversation
hotwired#196 introduced the ability to disable Drive by default. An unintentional side-effect was that it also disabled Frame by default. Every Frame needed the data-turbo attribute to be enabled: `<turbo-frame data-turbo="true">`. This makes it so that `Turbo.session.drive = false` only affects Drive. On top of the logic change, we rename the Session methods to remove the Drive vocabulary.
f793915
to
af53df2
Compare
Yes, that was definitely unintentional. I thought that since frames are opt-in already (in the sense that you have to explicitly use the This change makes a lot of sense to me, because it essentially says that if you've inserted a |
…le()` The Pull Request hotwired#648 refactored the function name of `session.elementDriveEnabled()` to `session.elementIsNavigatable()`. This Pull Request fixes an old function reference which kept the library from building successfully.
Breaking change in our codebase, but we'll add |
This broke something for me too. @gregschmit could you please humour me and explain how:
Thinking out loud here, I kind of get your point, but in this way there is not easy one switch to disabled Drive application wide. Do we need that one switch, hmm.. Not sure. Maybe we need a flag to disable Drive + Frames? Just raising a flag here. |
Closes #670 Re-use the existing `2xx` and `3xx` behavior for a response to handle error responses. When the frame is missing from the page (likely for error pages like `404`), dispatch a `turbo:frame-missing` event. Alongside that behavior, yield the [Response][] instance and a `Turbo.visit`-like callback that can transform the `Response` instance into a `Visit`. It also accepts all the arguments that the `Turbo.visit` call normally does. When the event is not canceled, treat the `Response` as a Visit. When the event **is** canceled, let the listener handle it. [Response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
#196 introduced the ability to disable Drive by default. An unintentional side-effect was that it also disabled Frame by default. Every Frame needed the data-turbo attribute to be enabled:
<turbo-frame data-turbo="true">
. This makes it so thatTurbo.session.drive = false
only affects Drive.On top of the logic change, we rename the Session methods to remove the Drive vocabulary.
@gregschmit Ping as the author of #196. Am I right to assume that this was an un unintentional side-effect?