Skip to content

[Turbo] Add generic <Turbo:Stream> component#2302

Merged
Kocal merged 1 commit into
symfony:2.xfrom
seb-jean:2.x
Oct 30, 2024
Merged

[Turbo] Add generic <Turbo:Stream> component#2302
Kocal merged 1 commit into
symfony:2.xfrom
seb-jean:2.x

Conversation

@seb-jean
Copy link
Copy Markdown
Contributor

@seb-jean seb-jean commented Oct 25, 2024

Q A
Bug fix? no
New feature? yes
Issues #2298 (comment)
License MIT

I added a generic Turbo Stream component. To use it, you can do this:

<twig:Turbo:Stream action="turbo_frame_reload" targets="#count-post" />

The rendering is:

<turbo-stream action="turbo_frame_reload" targets="#count-post"></turbo-stream>

@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels Oct 25, 2024
@seb-jean seb-jean changed the title Generic <Turbo:Stream> component [Turbo] Generic <Turbo:Stream> component Oct 25, 2024
@seb-jean seb-jean changed the title [Turbo] Generic <Turbo:Stream> component [Turbo] Add generic <Turbo:Stream> component Oct 25, 2024
Copy link
Copy Markdown
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

Can you also update the CHANGELOG here please? Thanks

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Oct 26, 2024
@Kocal Kocal added the Turbo label Oct 26, 2024
@smnandre
Copy link
Copy Markdown
Member

Is there any advantage here (apart from the syntax) ?

Because

<turbo-frame foo bar>foo bar</turbo-frame>

and

<twig:Turbo:Frame foo bar>
foo bar
</twig:Turbo:Frame>

have a real difference in term of performance.

But i get the target to cover all bases of turbo with one syntax.

Thinking outloud here.. not sure what to do.

I wonder if we should not make a search/replace here, instead of calling an embedding component 🤷
But then, it would be difficult to explain the differences in scope

@seb-jean
Copy link
Copy Markdown
Contributor Author

Can you also update the CHANGELOG here please? Thanks

Done

@seb-jean
Copy link
Copy Markdown
Contributor Author

Is there any advantage here (apart from the syntax) ?

Because

<turbo-frame foo bar>foo bar</turbo-frame>

and

<twig:Turbo:Frame foo bar>
foo bar
</twig:Turbo:Frame>

have a real difference in term of performance.

But i get the target to cover all bases of turbo with one syntax.

Thinking outloud here.. not sure what to do.

I wonder if we should not make a search/replace here, instead of calling an embedding component 🤷 But then, it would be difficult to explain the differences in scope

This comment is rather related to this PR I think no?: #2303

@Kocal
Copy link
Copy Markdown
Member

Kocal commented Oct 30, 2024

Thank you @seb-jean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Reviewed Has been reviewed by a maintainer Turbo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants