Skip to content

Commit

Permalink
feature #2302 [Turbo] Add generic <Turbo:Stream> component (seb-jean)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

[Turbo] Add generic `<Turbo:Stream>` component

| 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
<twig:Turbo:Stream action="turbo_frame_reload" targets="#count-post" />
```

The rendering is:

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

Commits
-------

f0ab499 [Turbo] Add generic `<Turbo:Stream>` component
  • Loading branch information
Kocal committed Oct 30, 2024
2 parents fffd7c8 + f0ab499 commit 4577fe3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Turbo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.22.0

- Add `<twig:Turbo:Stream>` component

## 2.21.0

- Add `Helper/TurboStream::append()` et al. methods
Expand Down
3 changes: 3 additions & 0 deletions src/Turbo/templates/components/Stream.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% props action -%}

<turbo-stream action="{{ action }}" {{- attributes }}></turbo-stream>

0 comments on commit 4577fe3

Please sign in to comment.