Skip to content
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

Implement streams Targeting Multiple Elements #86

Merged
merged 1 commit into from
Aug 20, 2022

Conversation

timvdalen
Copy link
Contributor

This PR adds support to Turbo Streams Targeting Multiple Elements, by adding the option to the response macros and all underlying Blade components.

https://turbo.hotwired.dev/reference/streams#targeting-multiple-elements

We realize that this is an impactful PR, and we don't expect it to be merged without change or further discussion.
Please view this PR as the start of a conversation around the topic.

We have tried to balance staying compatible with the syntax from the Turbo handbook (so no separate <turbo-stream> component with targets= support) with not making any breaking changes to the API of this package, but we have had to make a few hard choices along the way. In particular, it was not possible to not make any breaking changes to the Stream component constructor without breaking compatibility with Turbo itself.

@tonysm
Copy link
Collaborator

tonysm commented Aug 19, 2022

@timvdalen Thanks! I really like the work you've done here. I'll take a stab at the things you left a comment.

@tonysm tonysm marked this pull request as ready for review August 20, 2022 21:02
@tonysm tonysm merged commit f47d7e0 into hotwired-laravel:main Aug 20, 2022
@tonysm tonysm mentioned this pull request Aug 20, 2022
@tonysm
Copy link
Collaborator

tonysm commented Aug 20, 2022

Hey @timvdalen I've made some tweaks here, and I also took the time to include the new *All() methods based on the Rails gem (appendAll, prependAll, etc.)

@tonysm tonysm mentioned this pull request Aug 20, 2022
@timvdalen
Copy link
Contributor Author

Awesome, that was quick! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants