-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't convert
data-turbo-stream
links to forms (#647)
The initial implementation of the `data-turbo-stream` attribute worked by treating requests with that attribute as form submissions (which would usually be `GET` form submissions, unless a different method type was indicated). This allowed us to include the `data-turbo-stream` logic in `FormSubmission`, which was responsible for properly setting the `Accept` header. However, there are some downsides to submitting the requests as form submissions. For example, a `GET` form submission does not include the search portion of the URL. Additionally, servers are free to respond to `data-turbo-stream` requests with plain HTML responses, and in that case we don't want Turbo's handling of the response to differ from what it would have been if the `data-turbo-stream` attribute wasn't present. This commit takes a different approach. In this version, elements that have `data-turbo-stream` continue to be processed by the same object that they would otherwise, whether that's a `FormSubmission`, a `Visit` or a `FrameController`. However each of these objects is now aware of the `data-turbo-stream` attribute, and each will include the Turbo Stream MIME type when appropriate. This minimizes the impact of `data-turbo-stream` so that the only effect it has is on the inclusion of that MIME type.
- Loading branch information
1 parent
d2443b6
commit bbd8053
Showing
10 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters