File tree 15 files changed +73
-50
lines changed
templates/components/Stream
15 files changed +73
-50
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 2.20.0
4
+
5
+ - Add ` <twig:Turbo:Stream:*> ` components
6
+
3
7
## 2.19.0
4
8
5
9
- Fix Doctrine proxies are not Broadcasted #3139
Original file line number Diff line number Diff line change 52
52
"symfony/property-access" : " ^5.4|^6.0|^7.0" ,
53
53
"symfony/security-core" : " ^5.4|^6.0|^7.0" ,
54
54
"symfony/stopwatch" : " ^5.4|^6.0|^7.0" ,
55
+ "symfony/ux-twig-component" : " ^2.0" ,
55
56
"symfony/twig-bundle" : " ^5.4|^6.0|^7.0" ,
56
57
"symfony/web-profiler-bundle" : " ^5.4|^6.0|^7.0" ,
57
58
"symfony/webpack-encore-bundle" : " ^2.1.1" ,
Original file line number Diff line number Diff line change
1
+ {% props target -%}
2
+
3
+ <turbo -stream action =" after" targets =" {{ target }}" {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target -%}
2
+
3
+ <turbo -stream action =" append" targets =" {{ target }}" {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target -%}
2
+
3
+ <turbo -stream action =" before" targets =" {{ target }}" {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target -%}
2
+
3
+ <turbo -stream action =" prepend" targets =" {{ target }}" {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props requestId = null -%}
2
+
3
+ <turbo -stream action =" refresh" {% if requestId is not null %} request-id =" {{ requestId }}" {% endif %} {{ attributes }}></turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target -%}
2
+
3
+ <turbo -stream action =" remove" targets =" {{ target }}" {{ attributes }}></turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target , morph = false -%}
2
+
3
+ <turbo -stream action =" replace" targets =" {{ target }}" {% if morph %} method =" morph" {% endif %} {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change
1
+ {% props target , morph = false -%}
2
+
3
+ <turbo -stream action =" update" targets =" {{ target }}" {% if morph %} method =" morph" {% endif %} {{ attributes }}>
4
+ <template >{% block content %}{% endblock %}</template >
5
+ </turbo -stream >
Original file line number Diff line number Diff line change 1
1
{% block create %}
2
- <turbo -stream action =" append" target =" artists" >
3
- <template >
4
- <div id =" {{ ' artist_' ~ id }}" ><a href =" {{ path(' artist' , {id : id }) }}" >{{ entity .name }} (#{{ id }})</a ></div >
5
- </template >
6
- </turbo -stream >
2
+ <twig:Turbo:Stream:Append target =" #artists" >
3
+ <div id =" {{ ' artist_' ~ id }}" ><a href =" {{ path(' artist' , {id : id }) }}" >{{ entity .name }} (#{{ id }})</a ></div >
4
+ </twig:Turbo:Stream:Append >
7
5
{% endblock %}
8
6
9
7
{% block update %}
10
- <turbo -stream action =" update" target =" artist_{{ id }}" >
11
- <template >
12
- {{ entity .name }} (#{{ id }}, updated)
13
- </template >
14
- </turbo -stream >
8
+ <twig:Turbo:Stream:Update target =" #artist_{{ id }}" >
9
+ {{ entity .name }} (#{{ id }}, updated)
10
+ </twig:Turbo:Stream:Update >
15
11
{% endblock %}
16
12
17
13
{% block remove %}
18
- <turbo -stream action = " remove " target =" artist_{{ id }}" ></turbo -stream >
14
+ <twig:Turbo:Stream:Remove target =" # artist_{{ id }}" ></twig:Turbo:Stream:Remove >
19
15
{% endblock %}
Original file line number Diff line number Diff line change 1
1
{% block create %}
2
- <turbo -stream action =" append" target =" books" >
3
- <template >
4
- <div id =" {{ ' book_' ~ id }}" >{{ entity .title }} (#{{ id }})</div >
5
- </template >
6
- </turbo -stream >
2
+ <twig:Turbo:Stream:Append target =" #books" >
3
+ <div id =" {{ ' book_' ~ id }}" >{{ entity .title }} (#{{ id }})</div >
4
+ </twig:Turbo:Stream:Append >
7
5
{% endblock %}
8
6
9
7
{% block update %}
10
- <turbo -stream action =" update" target =" book_{{ id }}" >
11
- <template >
12
- {{ entity .title }} (#{{ id }}, updated)
13
- </template >
14
- </turbo -stream >
8
+ <twig:Turbo:Stream:Update target =" #book_{{ id }}" >
9
+ {{ entity .title }} (#{{ id }}, updated)
10
+ </twig:Turbo:Stream:Update >
15
11
{% endblock %}
16
12
17
13
{% block remove %}
18
- <turbo -stream action = " remove " target =" book_{{ id }}" ></turbo -stream >
14
+ <twig:Turbo:Stream:Remove target =" # book_{{ id }}" ></twig:Turbo:Stream:Remove >
19
15
{% endblock %}
Original file line number Diff line number Diff line change 1
1
{% block create %}
2
- <turbo -stream action =" append" target =" songs" >
3
- <template >
4
- <div id =" {{ ' song_' ~ id }}" >{{ entity .title }} (#{{ id }}){% if entity .artist %} by {{ entity .artist .name }} (#{{ entity .artist .id }}){% endif %}</div >
5
- </template >
6
- </turbo -stream >
2
+ <twig:Turbo:Stream:Append target =" #songs" >
3
+ <div id =" {{ ' song_' ~ id }}" >{{ entity .title }} (#{{ id }}){% if entity .artist %} by {{ entity .artist .name }} (#{{ entity .artist .id }}){% endif %}</div >
4
+ </twig:Turbo:Stream:Append >
7
5
{% endblock %}
8
6
9
7
{% block update %}
10
- <turbo -stream action =" update" target =" song_{{ id }}" >
11
- <template >
12
- {{ entity .title }} (#{{ id }}, updated)
13
- </template >
14
- </turbo -stream >
8
+ <twig:Turbo:Stream:Update target =" #song_{{ id }}" >
9
+ {{ entity .title }} (#{{ id }}, updated)
10
+ </twig:Turbo:Stream:Update >
15
11
{% endblock %}
16
12
17
13
{% block remove %}
18
- <turbo -stream action = " remove " target =" song_{{ id }}" ></turbo -stream >
14
+ <twig:Turbo:Stream:Remove target =" # song_{{ id }}" ></twig:Turbo:Stream:Remove >
19
15
{% endblock %}
Original file line number Diff line number Diff line change 1
- <turbo -stream action =" append" target =" messages" >
2
- <template >
3
- <div >{{ message }}</div >
4
- </template >
5
- </turbo -stream >
1
+ <twig:Turbo:Stream:Append target =" #messages" >
2
+ <div >{{ message }}</div >
3
+ </twig:Turbo:Stream:Append >
Original file line number Diff line number Diff line change 1
- <turbo -stream action =" replace" target =" form" >
2
- <template >
3
- <div id =" form" >
4
- This div replaces the existing element with the DOM ID "form".
5
- </div >
6
- </template >
7
- </turbo -stream >
1
+ <twig:Turbo:Stream:Replace target =" #form" >
2
+ <div id =" form" >
3
+ This div replaces the existing element with the DOM ID "form".
4
+ </div >
5
+ </twig:Turbo:Stream:Replace >
8
6
9
- <turbo -stream action =" append" target =" another_block" >
10
- <template >
11
- <div >Appended!</div >
12
- </template >
13
- </turbo -stream >
7
+ <twig:Turbo:Stream:Append target =" #another_block" >
8
+ <div >Appended!</div >
9
+ </twig:Turbo:Stream:Append >
You can’t perform that action at this time.
0 commit comments