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

[Turbo] Make the Broadcast attribute repeatable #387

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jul 6, 2022

Q A
Bug fix? no
New feature? yes
Tickets n/a
License MIT

Allow the Broadcast attribute to be used many times.
This is convenient to update different pages (ex: the list and the detail page) containing the same data but rendered differently.

Ex:

#[Broadcast(topics: '@="product-detail-" ~ entity.id', template: 'product-detail.stream.html.twig']
#[Broadcast(topics: '@="product-list-" ~ entity.id', template: 'product-list.stream.html.twig']
class Product
{
    public string $id;
}

@@ -2,7 +2,8 @@

## 2.2

- The topics defined in the Broadcast attribute now support expression language when prefixed with `@=`.
- The topics defined in the `Broadcast` attribute now support expression language when prefixed with `@=`.
- The `Broadcast` attribute can now be repeated, this is convenient to render several Turbo Streams Twig templates for the same change
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor - but this will be for 2.3

@robinbrisa
Copy link
Contributor

Gave it a try and it works just fine, thank you Kévin!
Cheers

@weaverryan weaverryan force-pushed the ux/feat/repeatable-attribute branch from 5f5abb0 to 298229e Compare July 8, 2022 14:55
@weaverryan
Copy link
Member

Thank you Kévin!

@weaverryan weaverryan merged commit 53b99fb into symfony:2.x Jul 8, 2022
weaverryan added a commit that referenced this pull request Jul 8, 2022
…erryan)

This PR was merged into the 2.x branch.

Discussion
----------

[Turbo] Moving repeatable Broadcast changelog to 2.3

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Tickets       | None
| License       | MIT

CHANGELOG tweak needed for #387

Commits
-------

6defd83 [Turbo] Moving repeatable Broadcast changelog to 2.3
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.

None yet

3 participants