ripple 0.3.68 → 0.3.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/package.json +3 -3
  3. package/src/jsx-runtime.d.ts +2 -2
  4. package/src/runtime/element.js +1 -1
  5. package/src/runtime/index-client.js +11 -11
  6. package/src/runtime/index-server.js +7 -4
  7. package/src/runtime/internal/client/bindings.js +1 -1
  8. package/src/runtime/internal/client/blocks.js +13 -4
  9. package/src/runtime/internal/client/component.js +55 -0
  10. package/src/runtime/internal/client/composite.js +4 -2
  11. package/src/runtime/internal/client/expression.js +65 -7
  12. package/src/runtime/internal/client/hmr.js +54 -43
  13. package/src/runtime/internal/client/index.js +5 -1
  14. package/src/runtime/internal/client/portal.js +70 -69
  15. package/src/runtime/internal/client/render.js +3 -0
  16. package/src/runtime/internal/server/index.js +92 -8
  17. package/tests/client/__snapshots__/html.test.tsrx.snap +3 -3
  18. package/tests/client/array/array.copy-within.test.tsrx +33 -31
  19. package/tests/client/array/array.derived.test.tsrx +186 -169
  20. package/tests/client/array/array.iteration.test.tsrx +40 -37
  21. package/tests/client/array/array.mutations.test.tsrx +113 -101
  22. package/tests/client/array/array.static.test.tsrx +119 -101
  23. package/tests/client/array/array.to-methods.test.tsrx +24 -21
  24. package/tests/client/async-suspend.test.tsrx +247 -246
  25. package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +0 -1
  26. package/tests/client/basic/basic.attributes.test.tsrx +428 -423
  27. package/tests/client/basic/basic.collections.test.tsrx +109 -102
  28. package/tests/client/basic/basic.components.test.tsrx +323 -205
  29. package/tests/client/basic/basic.errors.test.tsrx +91 -91
  30. package/tests/client/basic/basic.events.test.tsrx +114 -115
  31. package/tests/client/basic/basic.get-set.test.tsrx +97 -87
  32. package/tests/client/basic/basic.hmr.test.tsrx +19 -16
  33. package/tests/client/basic/basic.reactivity.test.tsrx +199 -191
  34. package/tests/client/basic/basic.rendering.test.tsrx +272 -182
  35. package/tests/client/basic/basic.styling.test.tsrx +23 -22
  36. package/tests/client/basic/basic.utilities.test.tsrx +10 -8
  37. package/tests/client/boundaries.test.tsrx +26 -26
  38. package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +5 -5
  39. package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +5 -5
  40. package/tests/client/compiler/compiler.assignments.test.tsrx +77 -81
  41. package/tests/client/compiler/compiler.attributes.test.tsrx +15 -15
  42. package/tests/client/compiler/compiler.basic.test.tsrx +322 -314
  43. package/tests/client/compiler/compiler.regex.test.tsrx +44 -47
  44. package/tests/client/compiler/compiler.tracked-access.test.tsrx +38 -38
  45. package/tests/client/compiler/compiler.try-in-function.test.tsrx +16 -16
  46. package/tests/client/compiler/compiler.typescript.test.tsrx +2 -2
  47. package/tests/client/composite/composite.dynamic-components.test.tsrx +47 -48
  48. package/tests/client/composite/composite.generics.test.tsrx +168 -192
  49. package/tests/client/composite/composite.props.test.tsrx +97 -81
  50. package/tests/client/composite/composite.reactivity.test.tsrx +177 -147
  51. package/tests/client/composite/composite.render.test.tsrx +122 -105
  52. package/tests/client/computed-properties.test.tsrx +28 -28
  53. package/tests/client/context.test.tsrx +21 -21
  54. package/tests/client/css/global-additional-cases.test.tsrx +58 -58
  55. package/tests/client/css/global-advanced-selectors.test.tsrx +16 -16
  56. package/tests/client/css/global-at-rules.test.tsrx +10 -10
  57. package/tests/client/css/global-basic.test.tsrx +14 -14
  58. package/tests/client/css/global-classes-ids.test.tsrx +14 -14
  59. package/tests/client/css/global-combinators.test.tsrx +10 -10
  60. package/tests/client/css/global-complex-nesting.test.tsrx +14 -14
  61. package/tests/client/css/global-edge-cases.test.tsrx +18 -18
  62. package/tests/client/css/global-keyframes.test.tsrx +12 -12
  63. package/tests/client/css/global-nested.test.tsrx +10 -10
  64. package/tests/client/css/global-pseudo.test.tsrx +12 -12
  65. package/tests/client/css/global-scoping.test.tsrx +20 -20
  66. package/tests/client/css/style-identifier.test.tsrx +126 -259
  67. package/tests/client/date.test.tsrx +146 -133
  68. package/tests/client/dynamic-elements.test.tsrx +398 -365
  69. package/tests/client/events.test.tsrx +292 -290
  70. package/tests/client/for.test.tsrx +156 -153
  71. package/tests/client/head.test.tsrx +105 -96
  72. package/tests/client/html.test.tsrx +122 -26
  73. package/tests/client/input-value.test.tsrx +1361 -1314
  74. package/tests/client/lazy-array.test.tsrx +16 -13
  75. package/tests/client/lazy-destructuring.test.tsrx +257 -213
  76. package/tests/client/map.test.tsrx +65 -60
  77. package/tests/client/media-query.test.tsrx +22 -20
  78. package/tests/client/object.test.tsrx +87 -81
  79. package/tests/client/portal.test.tsrx +57 -51
  80. package/tests/client/ref.test.tsrx +233 -202
  81. package/tests/client/return.test.tsrx +71 -2560
  82. package/tests/client/set.test.tsrx +54 -45
  83. package/tests/client/svg.test.tsrx +216 -186
  84. package/tests/client/switch.test.tsrx +194 -193
  85. package/tests/client/track-async-hydration.test.tsrx +18 -14
  86. package/tests/client/tracked-index-access.test.tsrx +28 -18
  87. package/tests/client/try.test.tsrx +675 -548
  88. package/tests/client/tsx.test.tsrx +373 -311
  89. package/tests/client/typescript-generics.test.tsrx +145 -145
  90. package/tests/client/url/url.derived.test.tsrx +33 -28
  91. package/tests/client/url/url.parsing.test.tsrx +61 -51
  92. package/tests/client/url/url.partial-removal.test.tsrx +56 -48
  93. package/tests/client/url/url.reactivity.test.tsrx +142 -125
  94. package/tests/client/url/url.serialization.test.tsrx +13 -11
  95. package/tests/client/url-search-params/url-search-params.derived.test.tsrx +34 -29
  96. package/tests/client/url-search-params/url-search-params.initialization.test.tsrx +25 -21
  97. package/tests/client/url-search-params/url-search-params.iteration.test.tsrx +50 -45
  98. package/tests/client/url-search-params/url-search-params.mutation.test.tsrx +111 -99
  99. package/tests/client/url-search-params/url-search-params.retrieval.test.tsrx +49 -43
  100. package/tests/client/url-search-params/url-search-params.serialization.test.tsrx +14 -12
  101. package/tests/client/url-search-params/url-search-params.tracked-url.test.tsrx +16 -14
  102. package/tests/hydration/basic.test.js +3 -3
  103. package/tests/hydration/compiled/client/basic.js +586 -651
  104. package/tests/hydration/compiled/client/composite.js +79 -104
  105. package/tests/hydration/compiled/client/events.js +140 -148
  106. package/tests/hydration/compiled/client/for.js +1005 -1018
  107. package/tests/hydration/compiled/client/head.js +124 -134
  108. package/tests/hydration/compiled/client/hmr.js +41 -48
  109. package/tests/hydration/compiled/client/html-in-template.js +38 -41
  110. package/tests/hydration/compiled/client/html.js +970 -1314
  111. package/tests/hydration/compiled/client/if-children.js +234 -249
  112. package/tests/hydration/compiled/client/if.js +182 -189
  113. package/tests/hydration/compiled/client/mixed-control-flow.js +347 -303
  114. package/tests/hydration/compiled/client/nested-control-flow.js +1084 -832
  115. package/tests/hydration/compiled/client/portal.js +65 -85
  116. package/tests/hydration/compiled/client/reactivity.js +84 -90
  117. package/tests/hydration/compiled/client/return.js +38 -1939
  118. package/tests/hydration/compiled/client/switch.js +218 -224
  119. package/tests/hydration/compiled/client/track-async-serialization.js +250 -259
  120. package/tests/hydration/compiled/client/try.js +123 -132
  121. package/tests/hydration/compiled/server/basic.js +773 -831
  122. package/tests/hydration/compiled/server/composite.js +166 -191
  123. package/tests/hydration/compiled/server/events.js +170 -184
  124. package/tests/hydration/compiled/server/for.js +851 -909
  125. package/tests/hydration/compiled/server/head.js +206 -216
  126. package/tests/hydration/compiled/server/hmr.js +64 -72
  127. package/tests/hydration/compiled/server/html-in-template.js +42 -76
  128. package/tests/hydration/compiled/server/html.js +1362 -1667
  129. package/tests/hydration/compiled/server/if-children.js +419 -445
  130. package/tests/hydration/compiled/server/if.js +194 -208
  131. package/tests/hydration/compiled/server/mixed-control-flow.js +249 -257
  132. package/tests/hydration/compiled/server/nested-control-flow.js +491 -515
  133. package/tests/hydration/compiled/server/portal.js +152 -160
  134. package/tests/hydration/compiled/server/reactivity.js +94 -106
  135. package/tests/hydration/compiled/server/return.js +28 -2172
  136. package/tests/hydration/compiled/server/switch.js +274 -286
  137. package/tests/hydration/compiled/server/track-async-serialization.js +340 -358
  138. package/tests/hydration/compiled/server/try.js +167 -185
  139. package/tests/hydration/components/basic.tsrx +320 -272
  140. package/tests/hydration/components/composite.tsrx +44 -32
  141. package/tests/hydration/components/events.tsrx +101 -91
  142. package/tests/hydration/components/for.tsrx +510 -452
  143. package/tests/hydration/components/head.tsrx +87 -80
  144. package/tests/hydration/components/hmr.tsrx +22 -17
  145. package/tests/hydration/components/html-in-template.tsrx +22 -17
  146. package/tests/hydration/components/html.tsrx +525 -443
  147. package/tests/hydration/components/if-children.tsrx +158 -148
  148. package/tests/hydration/components/if.tsrx +109 -95
  149. package/tests/hydration/components/mixed-control-flow.tsrx +100 -96
  150. package/tests/hydration/components/nested-control-flow.tsrx +215 -203
  151. package/tests/hydration/components/portal.tsrx +41 -34
  152. package/tests/hydration/components/reactivity.tsrx +37 -27
  153. package/tests/hydration/components/return.tsrx +12 -556
  154. package/tests/hydration/components/switch.tsrx +120 -114
  155. package/tests/hydration/components/track-async-serialization.tsrx +107 -91
  156. package/tests/hydration/components/try.tsrx +55 -40
  157. package/tests/hydration/html.test.js +4 -4
  158. package/tests/hydration/return.test.js +13 -532
  159. package/tests/server/await.test.tsrx +3 -3
  160. package/tests/server/basic.attributes.test.tsrx +264 -195
  161. package/tests/server/basic.components.test.tsrx +296 -169
  162. package/tests/server/basic.test.tsrx +300 -198
  163. package/tests/server/compiler.test.tsrx +62 -60
  164. package/tests/server/composite.props.test.tsrx +77 -63
  165. package/tests/server/composite.test.tsrx +168 -192
  166. package/tests/server/context.test.tsrx +18 -12
  167. package/tests/server/dynamic-elements.test.tsrx +197 -180
  168. package/tests/server/for.test.tsrx +85 -78
  169. package/tests/server/head.test.tsrx +50 -43
  170. package/tests/server/html-nesting-validation.test.tsrx +8 -8
  171. package/tests/server/if.test.tsrx +57 -51
  172. package/tests/server/lazy-destructuring.test.tsrx +366 -294
  173. package/tests/server/return.test.tsrx +76 -1355
  174. package/tests/server/streaming-ssr.test.tsrx +4 -75
  175. package/tests/server/style-identifier.test.tsrx +169 -131
  176. package/tests/server/switch.test.tsrx +91 -85
  177. package/tests/server/track-async-serialization.test.tsrx +105 -85
  178. package/tests/server/try.test.tsrx +374 -280
  179. package/tests/utils/compiler-compat-config.test.js +2 -2
  180. package/tests/utils/runtime-imports.test.js +10 -0
  181. package/types/index.d.ts +8 -0
  182. package/tests/client/__snapshots__/html.test.rsrx.snap +0 -40
@@ -4,325 +4,314 @@ import * as _$_ from 'ripple/internal/server';
4
4
  import { track } from 'ripple/server';
5
5
 
6
6
  export function StaticText() {
7
- _$_.push_component();
8
-
9
- _$_.regular_block(() => {
10
- _$_.output_push('<div');
11
- _$_.output_push('>');
7
+ return _$_.tsrx_element(() => {
8
+ _$_.regular_block(() => {
9
+ _$_.output_push('<div');
10
+ _$_.output_push('>');
12
11
 
13
- {
14
- _$_.output_push('Hello World');
15
- }
12
+ {
13
+ _$_.output_push('Hello World');
14
+ }
16
15
 
17
- _$_.output_push('</div>');
16
+ _$_.output_push('</div>');
17
+ });
18
18
  });
19
-
20
- _$_.pop_component();
21
19
  }
22
20
 
23
21
  export function MultipleElements() {
24
- _$_.push_component();
25
-
26
- _$_.regular_block(() => {
27
- _$_.output_push('<h1');
28
- _$_.output_push('>');
22
+ return _$_.tsrx_element(() => {
23
+ _$_.regular_block(() => {
24
+ _$_.output_push('<h1');
25
+ _$_.output_push('>');
29
26
 
30
- {
31
- _$_.output_push('Title');
32
- }
27
+ {
28
+ _$_.output_push('Title');
29
+ }
33
30
 
34
- _$_.output_push('</h1>');
35
- });
31
+ _$_.output_push('</h1>');
32
+ });
36
33
 
37
- _$_.regular_block(() => {
38
- _$_.output_push('<p');
39
- _$_.output_push('>');
34
+ _$_.regular_block(() => {
35
+ _$_.output_push('<p');
36
+ _$_.output_push('>');
40
37
 
41
- {
42
- _$_.output_push('Paragraph text');
43
- }
38
+ {
39
+ _$_.output_push('Paragraph text');
40
+ }
44
41
 
45
- _$_.output_push('</p>');
46
- });
42
+ _$_.output_push('</p>');
43
+ });
47
44
 
48
- _$_.regular_block(() => {
49
- _$_.output_push('<span');
50
- _$_.output_push('>');
45
+ _$_.regular_block(() => {
46
+ _$_.output_push('<span');
47
+ _$_.output_push('>');
51
48
 
52
- {
53
- _$_.output_push('Span text');
54
- }
49
+ {
50
+ _$_.output_push('Span text');
51
+ }
55
52
 
56
- _$_.output_push('</span>');
53
+ _$_.output_push('</span>');
54
+ });
57
55
  });
58
-
59
- _$_.pop_component();
60
56
  }
61
57
 
62
58
  export function NestedElements() {
63
- _$_.push_component();
64
-
65
- _$_.regular_block(() => {
66
- _$_.output_push('<div');
67
- _$_.output_push(' class="outer"');
68
- _$_.output_push('>');
69
-
70
- {
59
+ return _$_.tsrx_element(() => {
60
+ _$_.regular_block(() => {
71
61
  _$_.output_push('<div');
72
- _$_.output_push(' class="inner"');
62
+ _$_.output_push(' class="outer"');
73
63
  _$_.output_push('>');
74
64
 
75
65
  {
76
- _$_.output_push('<span');
66
+ _$_.output_push('<div');
67
+ _$_.output_push(' class="inner"');
77
68
  _$_.output_push('>');
78
69
 
79
70
  {
80
- _$_.output_push('Nested content');
71
+ _$_.output_push('<span');
72
+ _$_.output_push('>');
73
+
74
+ {
75
+ _$_.output_push('Nested content');
76
+ }
77
+
78
+ _$_.output_push('</span>');
81
79
  }
82
80
 
83
- _$_.output_push('</span>');
81
+ _$_.output_push('</div>');
84
82
  }
85
83
 
86
84
  _$_.output_push('</div>');
87
- }
88
-
89
- _$_.output_push('</div>');
85
+ });
90
86
  });
91
-
92
- _$_.pop_component();
93
87
  }
94
88
 
95
89
  export function WithAttributes() {
96
- _$_.push_component();
97
-
98
- _$_.regular_block(() => {
99
- _$_.output_push('<input');
100
- _$_.output_push(' type="text"');
101
- _$_.output_push(' placeholder="Enter text"');
102
- _$_.output_push(' disabled');
103
- _$_.output_push(' />');
104
- });
90
+ return _$_.tsrx_element(() => {
91
+ _$_.regular_block(() => {
92
+ _$_.output_push('<input');
93
+ _$_.output_push(' type="text"');
94
+ _$_.output_push(' placeholder="Enter text"');
95
+ _$_.output_push(' disabled');
96
+ _$_.output_push(' />');
97
+ });
105
98
 
106
- _$_.regular_block(() => {
107
- _$_.output_push('<a');
108
- _$_.output_push(' href="/link"');
109
- _$_.output_push(' target="_blank"');
110
- _$_.output_push('>');
99
+ _$_.regular_block(() => {
100
+ _$_.output_push('<a');
101
+ _$_.output_push(' href="/link"');
102
+ _$_.output_push(' target="_blank"');
103
+ _$_.output_push('>');
111
104
 
112
- {
113
- _$_.output_push('Link');
114
- }
105
+ {
106
+ _$_.output_push('Link');
107
+ }
115
108
 
116
- _$_.output_push('</a>');
109
+ _$_.output_push('</a>');
110
+ });
117
111
  });
118
-
119
- _$_.pop_component();
120
112
  }
121
113
 
122
114
  export function ChildComponent() {
123
- _$_.push_component();
124
-
125
- _$_.regular_block(() => {
126
- _$_.output_push('<span');
127
- _$_.output_push(' class="child"');
128
- _$_.output_push('>');
115
+ return _$_.tsrx_element(() => {
116
+ _$_.regular_block(() => {
117
+ _$_.output_push('<span');
118
+ _$_.output_push(' class="child"');
119
+ _$_.output_push('>');
129
120
 
130
- {
131
- _$_.output_push('Child content');
132
- }
121
+ {
122
+ _$_.output_push('Child content');
123
+ }
133
124
 
134
- _$_.output_push('</span>');
125
+ _$_.output_push('</span>');
126
+ });
135
127
  });
136
-
137
- _$_.pop_component();
138
128
  }
139
129
 
140
130
  export function ParentWithChild() {
141
- _$_.push_component();
142
-
143
- _$_.regular_block(() => {
144
- _$_.output_push('<div');
145
- _$_.output_push(' class="parent"');
146
- _$_.output_push('>');
131
+ return _$_.tsrx_element(() => {
132
+ _$_.regular_block(() => {
133
+ _$_.output_push('<div');
134
+ _$_.output_push(' class="parent"');
135
+ _$_.output_push('>');
147
136
 
148
- {
149
137
  {
150
- const comp = ChildComponent;
151
- const args = [{}];
138
+ {
139
+ const comp = ChildComponent;
140
+ const args = [{}];
152
141
 
153
- comp(...args);
142
+ _$_.render_component(comp, ...args);
143
+ }
154
144
  }
155
- }
156
145
 
157
- _$_.output_push('</div>');
146
+ _$_.output_push('</div>');
147
+ });
158
148
  });
159
-
160
- _$_.pop_component();
161
149
  }
162
150
 
163
151
  export function FirstSibling() {
164
- _$_.push_component();
165
-
166
- _$_.regular_block(() => {
167
- _$_.output_push('<div');
168
- _$_.output_push(' class="first"');
169
- _$_.output_push('>');
152
+ return _$_.tsrx_element(() => {
153
+ _$_.regular_block(() => {
154
+ _$_.output_push('<div');
155
+ _$_.output_push(' class="first"');
156
+ _$_.output_push('>');
170
157
 
171
- {
172
- _$_.output_push('First');
173
- }
158
+ {
159
+ _$_.output_push('First');
160
+ }
174
161
 
175
- _$_.output_push('</div>');
162
+ _$_.output_push('</div>');
163
+ });
176
164
  });
177
-
178
- _$_.pop_component();
179
165
  }
180
166
 
181
167
  export function SecondSibling() {
182
- _$_.push_component();
183
-
184
- _$_.regular_block(() => {
185
- _$_.output_push('<div');
186
- _$_.output_push(' class="second"');
187
- _$_.output_push('>');
168
+ return _$_.tsrx_element(() => {
169
+ _$_.regular_block(() => {
170
+ _$_.output_push('<div');
171
+ _$_.output_push(' class="second"');
172
+ _$_.output_push('>');
188
173
 
189
- {
190
- _$_.output_push('Second');
191
- }
174
+ {
175
+ _$_.output_push('Second');
176
+ }
192
177
 
193
- _$_.output_push('</div>');
178
+ _$_.output_push('</div>');
179
+ });
194
180
  });
195
-
196
- _$_.pop_component();
197
181
  }
198
182
 
199
183
  export function SiblingComponents() {
200
- _$_.push_component();
201
-
202
- _$_.regular_block(() => {
203
- {
204
- const comp = FirstSibling;
205
- const args = [{}];
184
+ return _$_.tsrx_element(() => {
185
+ _$_.regular_block(() => {
186
+ {
187
+ const comp = FirstSibling;
188
+ const args = [{}];
206
189
 
207
- comp(...args);
208
- }
209
- });
190
+ _$_.render_component(comp, ...args);
191
+ }
192
+ });
210
193
 
211
- _$_.regular_block(() => {
212
- {
213
- const comp = SecondSibling;
214
- const args = [{}];
194
+ _$_.regular_block(() => {
195
+ {
196
+ const comp = SecondSibling;
197
+ const args = [{}];
215
198
 
216
- comp(...args);
217
- }
199
+ _$_.render_component(comp, ...args);
200
+ }
201
+ });
218
202
  });
219
-
220
- _$_.pop_component();
221
203
  }
222
204
 
223
205
  export function Greeting(props) {
224
- _$_.push_component();
225
-
226
- _$_.regular_block(() => {
227
- _$_.output_push('<div');
228
- _$_.output_push('>');
206
+ return _$_.tsrx_element(() => {
207
+ _$_.regular_block(() => {
208
+ _$_.output_push('<div');
209
+ _$_.output_push('>');
229
210
 
230
- {
231
- _$_.output_push(_$_.escape('Hello ' + String(props.name)));
232
- }
211
+ {
212
+ _$_.output_push(_$_.escape('Hello ' + String(props.name)));
213
+ }
233
214
 
234
- _$_.output_push('</div>');
215
+ _$_.output_push('</div>');
216
+ });
235
217
  });
236
-
237
- _$_.pop_component();
238
218
  }
239
219
 
240
220
  export function WithGreeting() {
241
- _$_.push_component();
242
-
243
- _$_.regular_block(() => {
244
- {
245
- const comp = Greeting;
246
- const args = [{ name: "World" }];
221
+ return _$_.tsrx_element(() => {
222
+ _$_.regular_block(() => {
223
+ {
224
+ const comp = Greeting;
225
+ const args = [{ name: "World" }];
247
226
 
248
- comp(...args);
249
- }
227
+ _$_.render_component(comp, ...args);
228
+ }
229
+ });
250
230
  });
251
-
252
- _$_.pop_component();
253
231
  }
254
232
 
255
233
  export function ExpressionContent() {
256
- _$_.push_component();
234
+ return _$_.tsrx_element(() => {
235
+ const value = 42;
236
+ const label = 'computed';
237
+
238
+ _$_.regular_block(() => {
239
+ _$_.output_push('<div');
240
+ _$_.output_push('>');
241
+
242
+ {
243
+ _$_.output_push(_$_.escape(value));
244
+ }
257
245
 
258
- const value = 42;
259
- const label = 'computed';
246
+ _$_.output_push('</div>');
247
+ });
260
248
 
261
- _$_.regular_block(() => {
262
- _$_.output_push('<div');
263
- _$_.output_push('>');
249
+ _$_.regular_block(() => {
250
+ _$_.output_push('<span');
251
+ _$_.output_push('>');
264
252
 
265
- {
266
- _$_.output_push(_$_.escape(value));
267
- }
253
+ {
254
+ _$_.output_push(_$_.escape(label.toUpperCase()));
255
+ }
268
256
 
269
- _$_.output_push('</div>');
257
+ _$_.output_push('</span>');
258
+ });
270
259
  });
260
+ }
271
261
 
272
- _$_.regular_block(() => {
273
- _$_.output_push('<span');
274
- _$_.output_push('>');
262
+ function NestedHelperItem({ item }) {
263
+ return _$_.tsrx_element(() => {
264
+ _$_.regular_block(() => {
265
+ _$_.output_push('<div');
266
+ _$_.output_push(' class="helper-item"');
267
+ _$_.output_push('>');
275
268
 
276
- {
277
- _$_.output_push(_$_.escape(label.toUpperCase()));
278
- }
269
+ {
270
+ _$_.output_push(_$_.escape(item));
271
+ }
279
272
 
280
- _$_.output_push('</span>');
273
+ _$_.output_push('</div>');
274
+ });
281
275
  });
282
-
283
- _$_.pop_component();
284
276
  }
285
277
 
286
- function makeNestedTsxTsrxFragment(label) {
287
- return _$_.tsrx_element(function render_children() {
288
- _$_.output_push('<span');
289
- _$_.output_push(' class="label"');
290
- _$_.output_push('>');
278
+ function NestedTsxTsrxFragment({ label }) {
279
+ return _$_.tsrx_element(() => {
280
+ _$_.regular_block(() => {
281
+ _$_.output_push('<span');
282
+ _$_.output_push(' class="label"');
283
+ _$_.output_push('>');
284
+
285
+ {
286
+ _$_.output_push(_$_.escape(label));
287
+ }
291
288
 
292
- {
293
- _$_.output_push(_$_.escape(label));
294
- }
289
+ _$_.output_push('</span>');
290
+ });
295
291
 
296
- _$_.output_push('</span>');
292
+ _$_.regular_block(() => {
293
+ _$_.output_push('<!--[-->');
297
294
 
298
- const test = _$_.tsrx_element(function render_children() {
299
- _$_.render_expression([1, 2, 3, 4].map((item) => _$_.tsrx_element(function render_children() {
295
+ for (const item of [1, 2, 3, 4]) {
300
296
  {
301
- _$_.render_expression(_$_.tsrx_element(function render_children() {
302
- _$_.output_push('<div');
303
- _$_.output_push(' class="helper-item"');
304
- _$_.output_push('>');
305
-
306
- {
307
- _$_.output_push(_$_.escape(item));
308
- }
297
+ const comp = NestedHelperItem;
298
+ const args = [{ item }];
309
299
 
310
- _$_.output_push('</div>');
311
- }));
300
+ _$_.render_component(comp, ...args);
312
301
  }
313
- })));
314
- });
302
+ }
315
303
 
316
- _$_.render_expression(test);
304
+ _$_.output_push('<!--]-->');
305
+ });
317
306
  });
318
307
  }
319
308
 
320
309
  export function NestedTsxTsrxExpressionValues() {
321
- _$_.push_component();
310
+ return _$_.tsrx_element(() => {
311
+ _$_.regular_block(() => {
312
+ _$_.output_push('<!--[-->');
322
313
 
323
- _$_.regular_block(() => {
324
- _$_.render_expression(_$_.tsrx_element(function render_children() {
325
- _$_.render_expression([1, 2, 3].map((item) => _$_.tsrx_element(function render_children() {
314
+ for (const item of [1, 2, 3]) {
326
315
  _$_.output_push('<div');
327
316
  _$_.output_push(' class="app-item"');
328
317
  _$_.output_push('>');
@@ -332,254 +321,249 @@ export function NestedTsxTsrxExpressionValues() {
332
321
  }
333
322
 
334
323
  _$_.output_push('</div>');
335
- })));
336
- }));
337
- });
338
-
339
- _$_.regular_block(() => {
340
- _$_.render_expression(makeNestedTsxTsrxFragment('from helper'));
341
- });
342
-
343
- _$_.pop_component();
344
- }
324
+ }
345
325
 
346
- export function MixedTsrxCollectionText() {
347
- _$_.push_component();
326
+ _$_.output_push('<!--]-->');
327
+ });
348
328
 
349
- const content = _$_.tsrx_element(function render_children() {
350
329
  _$_.regular_block(() => {
351
- _$_.render_expression([
352
- 'alpha ',
353
- _$_.tsrx_element(function render_children() {
354
- _$_.output_push('<strong');
355
- _$_.output_push(' class="middle"');
356
- _$_.output_push('>');
330
+ {
331
+ const comp = NestedTsxTsrxFragment;
332
+ const args = [{ label: "from helper" }];
357
333
 
358
- {
359
- _$_.output_push('beta');
360
- }
334
+ _$_.render_component(comp, ...args);
335
+ }
336
+ });
337
+ });
338
+ }
361
339
 
362
- _$_.output_push('</strong>');
363
- }),
364
- ' gamma ',
365
- [
366
- 'delta ',
367
- _$_.tsrx_element(function render_children() {
368
- _$_.output_push('<em');
369
- _$_.output_push(' class="tail"');
340
+ export function MixedTsrxCollectionText() {
341
+ return _$_.tsrx_element(() => {
342
+ const content = _$_.tsrx_element(() => {
343
+ _$_.regular_block(() => {
344
+ _$_.render_expression([
345
+ 'alpha ',
346
+ _$_.tsrx_element(() => {
347
+ _$_.output_push('<strong');
348
+ _$_.output_push(' class="middle"');
370
349
  _$_.output_push('>');
371
350
 
372
351
  {
373
- _$_.output_push('epsilon');
352
+ _$_.output_push('beta');
374
353
  }
375
354
 
376
- _$_.output_push('</em>');
355
+ _$_.output_push('</strong>');
377
356
  }),
378
- ' zeta'
379
- ]
380
- ]);
357
+ ' gamma ',
358
+ [
359
+ 'delta ',
360
+ _$_.tsrx_element(() => {
361
+ _$_.output_push('<em');
362
+ _$_.output_push(' class="tail"');
363
+ _$_.output_push('>');
364
+
365
+ {
366
+ _$_.output_push('epsilon');
367
+ }
368
+
369
+ _$_.output_push('</em>');
370
+ }),
371
+ ' zeta'
372
+ ]
373
+ ]);
374
+ });
381
375
  });
382
- });
383
376
 
384
- _$_.regular_block(() => {
385
- _$_.output_push('<div');
386
- _$_.output_push(' class="mixed-collection"');
387
- _$_.output_push('>');
377
+ _$_.regular_block(() => {
378
+ _$_.output_push('<div');
379
+ _$_.output_push(' class="mixed-collection"');
380
+ _$_.output_push('>');
388
381
 
389
- {
390
- _$_.render_expression(content);
391
- }
382
+ {
383
+ _$_.render_expression(content);
384
+ }
392
385
 
393
- _$_.output_push('</div>');
386
+ _$_.output_push('</div>');
387
+ });
394
388
  });
395
-
396
- _$_.pop_component();
397
389
  }
398
390
 
399
391
  export function MixedTsrxCollectionSplitServerText() {
400
- _$_.push_component();
401
-
402
- const content = _$_.tsrx_element(function render_children() {
403
- _$_.regular_block(() => {
404
- _$_.render_expression([
405
- 'alpha ',
406
- _$_.tsrx_element(function render_children() {
407
- _$_.output_push('<strong');
408
- _$_.output_push(' class="middle"');
409
- _$_.output_push('>');
410
-
411
- {
412
- _$_.output_push('beta');
413
- }
414
-
415
- _$_.output_push('</strong>');
416
- }),
417
- ' gamma ',
418
- [
419
- 'delta ',
420
- _$_.tsrx_element(function render_children() {
421
- _$_.output_push('<em');
422
- _$_.output_push(' class="tail"');
392
+ return _$_.tsrx_element(() => {
393
+ const content = _$_.tsrx_element(() => {
394
+ _$_.regular_block(() => {
395
+ _$_.render_expression([
396
+ 'alpha ',
397
+ _$_.tsrx_element(() => {
398
+ _$_.output_push('<strong');
399
+ _$_.output_push(' class="middle"');
423
400
  _$_.output_push('>');
424
401
 
425
402
  {
426
- _$_.output_push('epsilon');
403
+ _$_.output_push('beta');
427
404
  }
428
405
 
429
- _$_.output_push('</em>');
406
+ _$_.output_push('</strong>');
430
407
  }),
431
- ' zeta'
432
- ]
433
- ]);
408
+ ' gamma ',
409
+ [
410
+ 'delta ',
411
+ _$_.tsrx_element(() => {
412
+ _$_.output_push('<em');
413
+ _$_.output_push(' class="tail"');
414
+ _$_.output_push('>');
415
+
416
+ {
417
+ _$_.output_push('epsilon');
418
+ }
419
+
420
+ _$_.output_push('</em>');
421
+ }),
422
+ ' zeta'
423
+ ]
424
+ ]);
425
+ });
434
426
  });
435
- });
436
427
 
437
- _$_.regular_block(() => {
438
- _$_.output_push('<div');
439
- _$_.output_push(' class="mixed-collection-split"');
440
- _$_.output_push('>');
428
+ _$_.regular_block(() => {
429
+ _$_.output_push('<div');
430
+ _$_.output_push(' class="mixed-collection-split"');
431
+ _$_.output_push('>');
441
432
 
442
- {
443
- _$_.render_expression(content);
444
- }
433
+ {
434
+ _$_.render_expression(content);
435
+ }
445
436
 
446
- _$_.output_push('</div>');
437
+ _$_.output_push('</div>');
438
+ });
447
439
  });
448
-
449
- _$_.pop_component();
450
440
  }
451
441
 
452
442
  export function MixedTsrxCollectionSplitClientText() {
453
- _$_.push_component();
454
-
455
- const content = _$_.tsrx_element(function render_children() {
456
- _$_.regular_block(() => {
457
- _$_.render_expression([
458
- 'alpha ',
459
- _$_.tsrx_element(function render_children() {
460
- _$_.output_push('<strong');
461
- _$_.output_push(' class="middle"');
462
- _$_.output_push('>');
463
-
464
- {
465
- _$_.output_push('beta');
466
- }
467
-
468
- _$_.output_push('</strong>');
469
- }),
470
- ' gamma ',
471
- [
472
- 'changed ',
473
- _$_.tsrx_element(function render_children() {
474
- _$_.output_push('<em');
475
- _$_.output_push(' class="tail"');
443
+ return _$_.tsrx_element(() => {
444
+ const content = _$_.tsrx_element(() => {
445
+ _$_.regular_block(() => {
446
+ _$_.render_expression([
447
+ 'alpha ',
448
+ _$_.tsrx_element(() => {
449
+ _$_.output_push('<strong');
450
+ _$_.output_push(' class="middle"');
476
451
  _$_.output_push('>');
477
452
 
478
453
  {
479
- _$_.output_push('epsilon');
454
+ _$_.output_push('beta');
480
455
  }
481
456
 
482
- _$_.output_push('</em>');
457
+ _$_.output_push('</strong>');
483
458
  }),
484
- ' zeta'
485
- ]
486
- ]);
459
+ ' gamma ',
460
+ [
461
+ 'changed ',
462
+ _$_.tsrx_element(() => {
463
+ _$_.output_push('<em');
464
+ _$_.output_push(' class="tail"');
465
+ _$_.output_push('>');
466
+
467
+ {
468
+ _$_.output_push('epsilon');
469
+ }
470
+
471
+ _$_.output_push('</em>');
472
+ }),
473
+ ' zeta'
474
+ ]
475
+ ]);
476
+ });
487
477
  });
488
- });
489
478
 
490
- _$_.regular_block(() => {
491
- _$_.output_push('<div');
492
- _$_.output_push(' class="mixed-collection-split"');
493
- _$_.output_push('>');
479
+ _$_.regular_block(() => {
480
+ _$_.output_push('<div');
481
+ _$_.output_push(' class="mixed-collection-split"');
482
+ _$_.output_push('>');
494
483
 
495
- {
496
- _$_.render_expression(content);
497
- }
484
+ {
485
+ _$_.render_expression(content);
486
+ }
498
487
 
499
- _$_.output_push('</div>');
488
+ _$_.output_push('</div>');
489
+ });
500
490
  });
501
-
502
- _$_.pop_component();
503
491
  }
504
492
 
505
493
  export function MixedTsrxCollectionPrimitiveServerText() {
506
- _$_.push_component();
507
-
508
- const content = _$_.tsrx_element(function render_children() {
509
- _$_.regular_block(() => {
510
- _$_.render_expression([
511
- 'count: ',
512
- 1,
513
- ' / ',
514
- true,
515
- _$_.tsrx_element(function render_children() {
516
- _$_.output_push('<span');
517
- _$_.output_push(' class="primitive-tail"');
518
- _$_.output_push('>');
494
+ return _$_.tsrx_element(() => {
495
+ const content = _$_.tsrx_element(() => {
496
+ _$_.regular_block(() => {
497
+ _$_.render_expression([
498
+ 'count: ',
499
+ 1,
500
+ ' / ',
501
+ true,
502
+ _$_.tsrx_element(() => {
503
+ _$_.output_push('<span');
504
+ _$_.output_push(' class="primitive-tail"');
505
+ _$_.output_push('>');
519
506
 
520
- {
521
- _$_.output_push(' ok');
522
- }
507
+ {
508
+ _$_.output_push(' ok');
509
+ }
523
510
 
524
- _$_.output_push('</span>');
525
- })
526
- ]);
511
+ _$_.output_push('</span>');
512
+ })
513
+ ]);
514
+ });
527
515
  });
528
- });
529
516
 
530
- _$_.regular_block(() => {
531
- _$_.output_push('<div');
532
- _$_.output_push(' class="mixed-collection-primitive"');
533
- _$_.output_push('>');
517
+ _$_.regular_block(() => {
518
+ _$_.output_push('<div');
519
+ _$_.output_push(' class="mixed-collection-primitive"');
520
+ _$_.output_push('>');
534
521
 
535
- {
536
- _$_.render_expression(content);
537
- }
522
+ {
523
+ _$_.render_expression(content);
524
+ }
538
525
 
539
- _$_.output_push('</div>');
526
+ _$_.output_push('</div>');
527
+ });
540
528
  });
541
-
542
- _$_.pop_component();
543
529
  }
544
530
 
545
531
  export function MixedTsrxCollectionPrimitiveClientText() {
546
- _$_.push_component();
547
-
548
- const content = _$_.tsrx_element(function render_children() {
549
- _$_.regular_block(() => {
550
- _$_.render_expression([
551
- 'count: ',
552
- 2,
553
- ' / ',
554
- false,
555
- _$_.tsrx_element(function render_children() {
556
- _$_.output_push('<span');
557
- _$_.output_push(' class="primitive-tail"');
558
- _$_.output_push('>');
532
+ return _$_.tsrx_element(() => {
533
+ const content = _$_.tsrx_element(() => {
534
+ _$_.regular_block(() => {
535
+ _$_.render_expression([
536
+ 'count: ',
537
+ 2,
538
+ ' / ',
539
+ false,
540
+ _$_.tsrx_element(() => {
541
+ _$_.output_push('<span');
542
+ _$_.output_push(' class="primitive-tail"');
543
+ _$_.output_push('>');
559
544
 
560
- {
561
- _$_.output_push(' ok');
562
- }
545
+ {
546
+ _$_.output_push(' ok');
547
+ }
563
548
 
564
- _$_.output_push('</span>');
565
- })
566
- ]);
549
+ _$_.output_push('</span>');
550
+ })
551
+ ]);
552
+ });
567
553
  });
568
- });
569
554
 
570
- _$_.regular_block(() => {
571
- _$_.output_push('<div');
572
- _$_.output_push(' class="mixed-collection-primitive"');
573
- _$_.output_push('>');
555
+ _$_.regular_block(() => {
556
+ _$_.output_push('<div');
557
+ _$_.output_push(' class="mixed-collection-primitive"');
558
+ _$_.output_push('>');
574
559
 
575
- {
576
- _$_.render_expression(content);
577
- }
560
+ {
561
+ _$_.render_expression(content);
562
+ }
578
563
 
579
- _$_.output_push('</div>');
564
+ _$_.output_push('</div>');
565
+ });
580
566
  });
581
-
582
- _$_.pop_component();
583
567
  }
584
568
 
585
569
  function createPrimitiveItems() {
@@ -587,184 +571,172 @@ function createPrimitiveItems() {
587
571
  }
588
572
 
589
573
  export function DynamicArrayFromCall() {
590
- _$_.push_component();
591
-
592
- const items = createPrimitiveItems();
574
+ return _$_.tsrx_element(() => {
575
+ const items = createPrimitiveItems();
593
576
 
594
- _$_.regular_block(() => {
595
- _$_.output_push('<div');
596
- _$_.output_push(' class="dynamic-array-call"');
597
- _$_.output_push('>');
577
+ _$_.regular_block(() => {
578
+ _$_.output_push('<div');
579
+ _$_.output_push(' class="dynamic-array-call"');
580
+ _$_.output_push('>');
598
581
 
599
- {
600
- _$_.render_expression(items);
601
- }
582
+ {
583
+ _$_.render_expression(items);
584
+ }
602
585
 
603
- _$_.output_push('</div>');
586
+ _$_.output_push('</div>');
587
+ });
604
588
  });
605
-
606
- _$_.pop_component();
607
589
  }
608
590
 
609
591
  export function DynamicArrayFromTrack() {
610
- _$_.push_component();
611
-
612
- let lazy = _$_.track(['start:', ['one', 2], true, null, false, ':end'], 'b5de6402');
592
+ return _$_.tsrx_element(() => {
593
+ let lazy = _$_.track(['start:', ['one', 2], true, null, false, ':end'], 'b5de6402');
613
594
 
614
- _$_.regular_block(() => {
615
- _$_.output_push('<div');
616
- _$_.output_push(' class="dynamic-array-track"');
617
- _$_.output_push('>');
595
+ _$_.regular_block(() => {
596
+ _$_.output_push('<div');
597
+ _$_.output_push(' class="dynamic-array-track"');
598
+ _$_.output_push('>');
618
599
 
619
- {
620
- _$_.render_expression(lazy.value);
621
- }
600
+ {
601
+ _$_.render_expression(lazy.value);
602
+ }
622
603
 
623
- _$_.output_push('</div>');
604
+ _$_.output_push('</div>');
605
+ });
624
606
  });
625
-
626
- _$_.pop_component();
627
607
  }
628
608
 
629
609
  export function DynamicArrayFromConditional() {
630
- _$_.push_component();
631
-
632
- const condition = true;
610
+ return _$_.tsrx_element(() => {
611
+ const condition = true;
633
612
 
634
- const items = condition
635
- ? ['start:', ['one', 2], true, null, false, ':end']
636
- : ['fallback'];
613
+ const items = condition
614
+ ? ['start:', ['one', 2], true, null, false, ':end']
615
+ : ['fallback'];
637
616
 
638
- _$_.regular_block(() => {
639
- _$_.output_push('<div');
640
- _$_.output_push(' class="dynamic-array-conditional"');
641
- _$_.output_push('>');
617
+ _$_.regular_block(() => {
618
+ _$_.output_push('<div');
619
+ _$_.output_push(' class="dynamic-array-conditional"');
620
+ _$_.output_push('>');
642
621
 
643
- {
644
- _$_.render_expression(items);
645
- }
622
+ {
623
+ _$_.render_expression(items);
624
+ }
646
625
 
647
- _$_.output_push('</div>');
626
+ _$_.output_push('</div>');
627
+ });
648
628
  });
649
-
650
- _$_.pop_component();
651
629
  }
652
630
 
653
631
  export function DynamicArrayFromLogical() {
654
- _$_.push_component();
655
-
656
- const condition = true;
657
- const items = condition && ['start:', ['one', 2], true, null, false, ':end'];
632
+ return _$_.tsrx_element(() => {
633
+ const condition = true;
634
+ const items = condition && ['start:', ['one', 2], true, null, false, ':end'];
658
635
 
659
- _$_.regular_block(() => {
660
- _$_.output_push('<div');
661
- _$_.output_push(' class="dynamic-array-logical"');
662
- _$_.output_push('>');
636
+ _$_.regular_block(() => {
637
+ _$_.output_push('<div');
638
+ _$_.output_push(' class="dynamic-array-logical"');
639
+ _$_.output_push('>');
663
640
 
664
- {
665
- _$_.render_expression(items);
666
- }
641
+ {
642
+ _$_.render_expression(items);
643
+ }
667
644
 
668
- _$_.output_push('</div>');
645
+ _$_.output_push('</div>');
646
+ });
669
647
  });
670
-
671
- _$_.pop_component();
672
648
  }
673
649
 
674
650
  export function NestedTsrxInsideTopLevelTsxExpression() {
675
- _$_.push_component();
676
-
677
- const content = _$_.tsrx_element(function render_children() {
678
- _$_.regular_block(() => {
679
- _$_.output_push('<section');
680
- _$_.output_push(' class="outer"');
681
- _$_.output_push('>');
651
+ return _$_.tsrx_element(() => {
652
+ const content = _$_.tsrx_element(() => {
653
+ _$_.regular_block(() => {
654
+ _$_.output_push('<section');
655
+ _$_.output_push(' class="outer"');
656
+ _$_.output_push('>');
682
657
 
683
- {
684
- _$_.render_expression(_$_.tsrx_element(function render_children() {
685
- _$_.output_push('<div');
686
- _$_.output_push(' class="inner"');
687
- _$_.output_push('>');
658
+ {
659
+ _$_.render_expression(_$_.tsrx_element(() => {
660
+ _$_.output_push('<div');
661
+ _$_.output_push(' class="inner"');
662
+ _$_.output_push('>');
688
663
 
689
- {
690
- _$_.output_push('from tsrx');
691
- }
664
+ {
665
+ _$_.output_push('from tsrx');
666
+ }
692
667
 
693
- _$_.output_push('</div>');
694
- }));
695
- }
668
+ _$_.output_push('</div>');
669
+ }));
670
+ }
696
671
 
697
- _$_.output_push('</section>');
672
+ _$_.output_push('</section>');
673
+ });
698
674
  });
699
- });
700
675
 
701
- _$_.regular_block(() => {
702
- _$_.render_expression(content);
676
+ _$_.regular_block(() => {
677
+ _$_.render_expression(content);
678
+ });
703
679
  });
704
-
705
- _$_.pop_component();
706
680
  }
707
681
 
708
682
  export function NestedTsrxElementsInsideTopLevelTsxValue() {
709
- _$_.push_component();
710
-
711
- const content = _$_.tsrx_element(function render_children() {
712
- _$_.regular_block(() => {
713
- _$_.output_push('<div');
714
- _$_.output_push(' class="wrapper"');
715
- _$_.output_push('>');
716
-
717
- {
718
- _$_.render_expression(_$_.tsrx_element(function render_children() {
719
- _$_.output_push('<section');
720
- _$_.output_push(' class="native"');
721
- _$_.output_push('>');
683
+ return _$_.tsrx_element(() => {
684
+ const content = _$_.tsrx_element(() => {
685
+ _$_.regular_block(() => {
686
+ _$_.output_push('<div');
687
+ _$_.output_push(' class="wrapper"');
688
+ _$_.output_push('>');
722
689
 
723
- {
724
- _$_.output_push('<span');
725
- _$_.output_push(' class="nested-tsrx"');
690
+ {
691
+ _$_.render_expression(_$_.tsrx_element(() => {
692
+ _$_.output_push('<section');
693
+ _$_.output_push(' class="native"');
726
694
  _$_.output_push('>');
727
695
 
728
696
  {
729
- _$_.output_push('inside nested tsrx');
730
- }
697
+ _$_.output_push('<span');
698
+ _$_.output_push(' class="nested-tsrx"');
699
+ _$_.output_push('>');
731
700
 
732
- _$_.output_push('</span>');
733
- }
701
+ {
702
+ _$_.output_push('inside nested tsrx');
703
+ }
734
704
 
735
- _$_.output_push('</section>');
736
- }));
737
- }
705
+ _$_.output_push('</span>');
706
+ }
738
707
 
739
- _$_.output_push('</div>');
708
+ _$_.output_push('</section>');
709
+ }));
710
+ }
711
+
712
+ _$_.output_push('</div>');
713
+ });
740
714
  });
741
- });
742
715
 
743
- _$_.regular_block(() => {
744
- _$_.render_expression(content);
716
+ _$_.regular_block(() => {
717
+ _$_.render_expression(content);
718
+ });
745
719
  });
746
-
747
- _$_.pop_component();
748
720
  }
749
721
 
750
- export function TsxDeclaredInsideNestedTsrxFromTopLevelTsx() {
751
- _$_.push_component();
752
-
753
- const content = _$_.tsrx_element(function render_children() {
754
- _$_.regular_block(() => {
755
- _$_.render_expression(_$_.tsrx_element(function render_children() {
756
- const nested = _$_.tsrx_element(function render_children() {
757
- _$_.output_push('<span');
758
- _$_.output_push(' class="nested-tsx"');
759
- _$_.output_push('>');
722
+ export function TsxDeclaredBeforeTopLevelTsx() {
723
+ return _$_.tsrx_element(() => {
724
+ const nested = _$_.tsrx_element(() => {
725
+ _$_.regular_block(() => {
726
+ _$_.output_push('<span');
727
+ _$_.output_push(' class="nested-tsx"');
728
+ _$_.output_push('>');
760
729
 
761
- {
762
- _$_.output_push('inside nested tsx');
763
- }
730
+ {
731
+ _$_.output_push('inside nested tsx');
732
+ }
764
733
 
765
- _$_.output_push('</span>');
766
- });
734
+ _$_.output_push('</span>');
735
+ });
736
+ });
767
737
 
738
+ const content = _$_.tsrx_element(() => {
739
+ _$_.regular_block(() => {
768
740
  _$_.output_push('<div');
769
741
  _$_.output_push(' class="native"');
770
742
  _$_.output_push('>');
@@ -774,463 +746,433 @@ export function TsxDeclaredInsideNestedTsrxFromTopLevelTsx() {
774
746
  }
775
747
 
776
748
  _$_.output_push('</div>');
777
- }));
749
+ });
778
750
  });
779
- });
780
751
 
781
- _$_.regular_block(() => {
782
- _$_.render_expression(content);
752
+ _$_.regular_block(() => {
753
+ _$_.render_expression(content);
754
+ });
783
755
  });
784
-
785
- _$_.pop_component();
786
756
  }
787
757
 
788
758
  function TextProp(__props) {
789
- _$_.push_component();
790
-
791
- _$_.regular_block(() => {
792
- _$_.output_push('<div');
793
- _$_.output_push(' class="text-prop"');
794
- _$_.output_push('>');
759
+ return _$_.tsrx_element(() => {
760
+ _$_.regular_block(() => {
761
+ _$_.output_push('<div');
762
+ _$_.output_push(' class="text-prop"');
763
+ _$_.output_push('>');
795
764
 
796
- {
797
- _$_.render_expression(__props.children);
798
- }
765
+ {
766
+ _$_.render_expression(__props.children);
767
+ }
799
768
 
800
- _$_.output_push('</div>');
769
+ _$_.output_push('</div>');
770
+ });
801
771
  });
802
-
803
- _$_.pop_component();
804
772
  }
805
773
 
806
774
  export function TextPropWithToggle() {
807
- _$_.push_component();
775
+ return _$_.tsrx_element(() => {
776
+ let lazy_1 = _$_.track(false, '1ba81c3b');
808
777
 
809
- let lazy_1 = _$_.track(false, '1ba81c3b');
810
-
811
- _$_.regular_block(() => {
812
- {
813
- const comp = TextProp;
778
+ _$_.regular_block(() => {
779
+ {
780
+ const comp = TextProp;
814
781
 
815
- const args = [
816
- {
817
- children: _$_.normalize_children(lazy_1.value ? 'hello' : '')
818
- }
819
- ];
782
+ const args = [
783
+ {
784
+ children: _$_.normalize_children(lazy_1.value ? 'hello' : '')
785
+ }
786
+ ];
820
787
 
821
- comp(...args);
822
- }
823
- });
788
+ _$_.render_component(comp, ...args);
789
+ }
790
+ });
824
791
 
825
- _$_.regular_block(() => {
826
- _$_.output_push('<button');
827
- _$_.output_push(' class="show-text"');
828
- _$_.output_push('>');
792
+ _$_.regular_block(() => {
793
+ _$_.output_push('<button');
794
+ _$_.output_push(' class="show-text"');
795
+ _$_.output_push('>');
829
796
 
830
- {
831
- _$_.output_push('Show');
832
- }
797
+ {
798
+ _$_.output_push('Show');
799
+ }
833
800
 
834
- _$_.output_push('</button>');
801
+ _$_.output_push('</button>');
802
+ });
835
803
  });
836
-
837
- _$_.pop_component();
838
804
  }
839
805
 
840
806
  function StaticHeader() {
841
- _$_.push_component();
842
-
843
- _$_.regular_block(() => {
844
- _$_.output_push('<h1');
845
- _$_.output_push(' class="sr-only"');
846
- _$_.output_push('>');
807
+ return _$_.tsrx_element(() => {
808
+ _$_.regular_block(() => {
809
+ _$_.output_push('<h1');
810
+ _$_.output_push(' class="sr-only"');
811
+ _$_.output_push('>');
847
812
 
848
- {
849
- _$_.output_push('heading');
850
- }
813
+ {
814
+ _$_.output_push('heading');
815
+ }
851
816
 
852
- _$_.output_push('</h1>');
853
- });
817
+ _$_.output_push('</h1>');
818
+ });
854
819
 
855
- _$_.regular_block(() => {
856
- _$_.output_push('<p');
857
- _$_.output_push(' class="subtitle"');
858
- _$_.output_push('>');
820
+ _$_.regular_block(() => {
821
+ _$_.output_push('<p');
822
+ _$_.output_push(' class="subtitle"');
823
+ _$_.output_push('>');
859
824
 
860
- {
861
- _$_.output_push('first paragraph');
862
- }
825
+ {
826
+ _$_.output_push('first paragraph');
827
+ }
863
828
 
864
- _$_.output_push('</p>');
865
- });
829
+ _$_.output_push('</p>');
830
+ });
866
831
 
867
- _$_.regular_block(() => {
868
- _$_.output_push('<p');
869
- _$_.output_push(' class="subtitle"');
870
- _$_.output_push('>');
832
+ _$_.regular_block(() => {
833
+ _$_.output_push('<p');
834
+ _$_.output_push(' class="subtitle"');
835
+ _$_.output_push('>');
871
836
 
872
- {
873
- _$_.output_push('second paragraph');
874
- }
837
+ {
838
+ _$_.output_push('second paragraph');
839
+ }
875
840
 
876
- _$_.output_push('</p>');
841
+ _$_.output_push('</p>');
842
+ });
877
843
  });
878
-
879
- _$_.pop_component();
880
844
  }
881
845
 
882
846
  export function StaticChildWithSiblings() {
883
- _$_.push_component();
884
-
885
- const foo = 'bar';
847
+ return _$_.tsrx_element(() => {
848
+ const foo = 'bar';
886
849
 
887
- _$_.regular_block(() => {
888
- {
889
- const comp = StaticHeader;
890
- const args = [{}];
850
+ _$_.regular_block(() => {
851
+ {
852
+ const comp = StaticHeader;
853
+ const args = [{}];
891
854
 
892
- comp(...args);
893
- }
894
- });
855
+ _$_.render_component(comp, ...args);
856
+ }
857
+ });
895
858
 
896
- _$_.regular_block(() => {
897
- _$_.output_push('<span');
898
- _$_.output_push(' class="sibling1"');
899
- _$_.output_push('>');
859
+ _$_.regular_block(() => {
860
+ _$_.output_push('<span');
861
+ _$_.output_push(' class="sibling1"');
862
+ _$_.output_push('>');
900
863
 
901
- {
902
- _$_.output_push(_$_.escape(foo));
903
- }
864
+ {
865
+ _$_.output_push(_$_.escape(foo));
866
+ }
904
867
 
905
- _$_.output_push('</span>');
906
- });
868
+ _$_.output_push('</span>');
869
+ });
907
870
 
908
- _$_.regular_block(() => {
909
- _$_.output_push('<span');
910
- _$_.output_push(' class="sibling2"');
911
- _$_.output_push('>');
871
+ _$_.regular_block(() => {
872
+ _$_.output_push('<span');
873
+ _$_.output_push(' class="sibling2"');
874
+ _$_.output_push('>');
912
875
 
913
- {
914
- _$_.output_push(_$_.escape(foo));
915
- }
876
+ {
877
+ _$_.output_push(_$_.escape(foo));
878
+ }
916
879
 
917
- _$_.output_push('</span>');
880
+ _$_.output_push('</span>');
881
+ });
918
882
  });
919
-
920
- _$_.pop_component();
921
883
  }
922
884
 
923
885
  function Header() {
924
- _$_.push_component();
925
-
926
- _$_.regular_block(() => {
927
- _$_.output_push('<h1');
928
- _$_.output_push(' class="sr-only"');
929
- _$_.output_push('>');
886
+ return _$_.tsrx_element(() => {
887
+ _$_.regular_block(() => {
888
+ _$_.output_push('<h1');
889
+ _$_.output_push(' class="sr-only"');
890
+ _$_.output_push('>');
930
891
 
931
- {
932
- _$_.output_push('Ripple');
933
- }
892
+ {
893
+ _$_.output_push('Ripple');
894
+ }
934
895
 
935
- _$_.output_push('</h1>');
936
- });
896
+ _$_.output_push('</h1>');
897
+ });
937
898
 
938
- _$_.regular_block(() => {
939
- _$_.output_push('<img');
940
- _$_.output_push(' src="/images/logo.png"');
941
- _$_.output_push(' alt="Logo"');
942
- _$_.output_push(' class="logo"');
943
- _$_.output_push(' />');
944
- });
899
+ _$_.regular_block(() => {
900
+ _$_.output_push('<img');
901
+ _$_.output_push(' src="/images/logo.png"');
902
+ _$_.output_push(' alt="Logo"');
903
+ _$_.output_push(' class="logo"');
904
+ _$_.output_push(' />');
905
+ });
945
906
 
946
- _$_.regular_block(() => {
947
- _$_.output_push('<p');
948
- _$_.output_push(' class="subtitle"');
949
- _$_.output_push('>');
907
+ _$_.regular_block(() => {
908
+ _$_.output_push('<p');
909
+ _$_.output_push(' class="subtitle"');
910
+ _$_.output_push('>');
950
911
 
951
- {
952
- _$_.output_push('the elegant TypeScript UI framework');
953
- }
912
+ {
913
+ _$_.output_push('the elegant TypeScript UI framework');
914
+ }
954
915
 
955
- _$_.output_push('</p>');
916
+ _$_.output_push('</p>');
917
+ });
956
918
  });
957
-
958
- _$_.pop_component();
959
919
  }
960
920
 
961
921
  function Actions({ playgroundVisible = false }) {
962
- _$_.push_component();
963
-
964
- _$_.regular_block(() => {
965
- _$_.output_push('<div');
966
- _$_.output_push(' class="social-links"');
967
- _$_.output_push('>');
968
-
969
- {
970
- _$_.output_push('<a');
971
- _$_.output_push(' href="https://github.com"');
972
- _$_.output_push(' class="github-link"');
973
- _$_.output_push('>');
974
-
975
- {
976
- _$_.output_push('GitHub');
977
- }
978
-
979
- _$_.output_push('</a>');
980
- _$_.output_push('<a');
981
- _$_.output_push(' href="https://discord.com"');
982
- _$_.output_push(' class="discord-link"');
922
+ return _$_.tsrx_element(() => {
923
+ _$_.regular_block(() => {
924
+ _$_.output_push('<div');
925
+ _$_.output_push(' class="social-links"');
983
926
  _$_.output_push('>');
984
927
 
985
928
  {
986
- _$_.output_push('Discord');
987
- }
929
+ _$_.output_push('<a');
930
+ _$_.output_push(' href="https://github.com"');
931
+ _$_.output_push(' class="github-link"');
932
+ _$_.output_push('>');
988
933
 
989
- _$_.output_push('</a>');
990
- _$_.output_push('<!--[-->');
934
+ {
935
+ _$_.output_push('GitHub');
936
+ }
991
937
 
992
- if (playgroundVisible) {
938
+ _$_.output_push('</a>');
993
939
  _$_.output_push('<a');
994
- _$_.output_push(' href="/playground"');
995
- _$_.output_push(' class="playground-link"');
940
+ _$_.output_push(' href="https://discord.com"');
941
+ _$_.output_push(' class="discord-link"');
996
942
  _$_.output_push('>');
997
943
 
998
944
  {
999
- _$_.output_push('Playground');
945
+ _$_.output_push('Discord');
1000
946
  }
1001
947
 
1002
948
  _$_.output_push('</a>');
1003
- }
949
+ _$_.output_push('<!--[-->');
1004
950
 
1005
- _$_.output_push('<!--]-->');
1006
- }
951
+ if (playgroundVisible) {
952
+ _$_.output_push('<a');
953
+ _$_.output_push(' href="/playground"');
954
+ _$_.output_push(' class="playground-link"');
955
+ _$_.output_push('>');
1007
956
 
1008
- _$_.output_push('</div>');
1009
- });
957
+ {
958
+ _$_.output_push('Playground');
959
+ }
1010
960
 
1011
- _$_.pop_component();
1012
- }
961
+ _$_.output_push('</a>');
962
+ }
1013
963
 
1014
- function Layout({ children }) {
1015
- _$_.push_component();
964
+ _$_.output_push('<!--]-->');
965
+ }
1016
966
 
1017
- _$_.regular_block(() => {
1018
- _$_.output_push('<main');
1019
- _$_.output_push('>');
967
+ _$_.output_push('</div>');
968
+ });
969
+ });
970
+ }
1020
971
 
1021
- {
1022
- _$_.output_push('<div');
1023
- _$_.output_push(' class="container"');
972
+ function Layout({ children }) {
973
+ return _$_.tsrx_element(() => {
974
+ _$_.regular_block(() => {
975
+ _$_.output_push('<main');
1024
976
  _$_.output_push('>');
1025
977
 
1026
978
  {
1027
- _$_.render_expression(children);
1028
- }
979
+ _$_.output_push('<div');
980
+ _$_.output_push(' class="container"');
981
+ _$_.output_push('>');
1029
982
 
1030
- _$_.output_push('</div>');
1031
- }
983
+ {
984
+ _$_.render_expression(children);
985
+ }
1032
986
 
1033
- _$_.output_push('</main>');
1034
- });
987
+ _$_.output_push('</div>');
988
+ }
1035
989
 
1036
- _$_.pop_component();
990
+ _$_.output_push('</main>');
991
+ });
992
+ });
1037
993
  }
1038
994
 
1039
995
  function Content() {
1040
- _$_.push_component();
1041
-
1042
- _$_.regular_block(() => {
1043
- _$_.output_push('<div');
1044
- _$_.output_push(' class="content"');
1045
- _$_.output_push('>');
1046
-
1047
- {
1048
- _$_.output_push('<p');
996
+ return _$_.tsrx_element(() => {
997
+ _$_.regular_block(() => {
998
+ _$_.output_push('<div');
999
+ _$_.output_push(' class="content"');
1049
1000
  _$_.output_push('>');
1050
1001
 
1051
1002
  {
1052
- _$_.output_push('Some content here');
1053
- }
1003
+ _$_.output_push('<p');
1004
+ _$_.output_push('>');
1054
1005
 
1055
- _$_.output_push('</p>');
1056
- }
1006
+ {
1007
+ _$_.output_push('Some content here');
1008
+ }
1057
1009
 
1058
- _$_.output_push('</div>');
1059
- });
1010
+ _$_.output_push('</p>');
1011
+ }
1060
1012
 
1061
- _$_.pop_component();
1013
+ _$_.output_push('</div>');
1014
+ });
1015
+ });
1062
1016
  }
1063
1017
 
1064
1018
  export function WebsiteIndex() {
1065
- _$_.push_component();
1066
-
1067
- _$_.regular_block(() => {
1068
- {
1069
- const comp = Layout;
1070
-
1071
- const args = [
1072
- {
1073
- children: _$_.tsrx_element(function render_children() {
1074
- _$_.push_component();
1075
-
1076
- {
1077
- const comp = Header;
1078
- const args = [{}];
1019
+ return _$_.tsrx_element(() => {
1020
+ _$_.regular_block(() => {
1021
+ {
1022
+ const comp = Layout;
1079
1023
 
1080
- comp(...args);
1081
- }
1024
+ const args = [
1025
+ {
1026
+ children: _$_.tsrx_element(() => {
1027
+ return _$_.tsrx_element(() => {
1028
+ {
1029
+ const comp = Header;
1030
+ const args = [{}];
1082
1031
 
1083
- {
1084
- const comp = Actions;
1085
- const args = [{ playgroundVisible: true }];
1032
+ _$_.render_component(comp, ...args);
1033
+ }
1086
1034
 
1087
- comp(...args);
1088
- }
1035
+ {
1036
+ const comp = Actions;
1037
+ const args = [{ playgroundVisible: true }];
1089
1038
 
1090
- {
1091
- const comp = Content;
1092
- const args = [{}];
1039
+ _$_.render_component(comp, ...args);
1040
+ }
1093
1041
 
1094
- comp(...args);
1095
- }
1042
+ {
1043
+ const comp = Content;
1044
+ const args = [{}];
1096
1045
 
1097
- {
1098
- const comp = Actions;
1099
- const args = [{ playgroundVisible: false }];
1046
+ _$_.render_component(comp, ...args);
1047
+ }
1100
1048
 
1101
- comp(...args);
1102
- }
1049
+ {
1050
+ const comp = Actions;
1051
+ const args = [{ playgroundVisible: false }];
1103
1052
 
1104
- _$_.pop_component();
1105
- })
1106
- }
1107
- ];
1053
+ _$_.render_component(comp, ...args);
1054
+ }
1055
+ });
1056
+ })
1057
+ }
1058
+ ];
1108
1059
 
1109
- comp(...args);
1110
- }
1060
+ _$_.render_component(comp, ...args);
1061
+ }
1062
+ });
1111
1063
  });
1112
-
1113
- _$_.pop_component();
1114
1064
  }
1115
1065
 
1116
1066
  function LastChild() {
1117
- _$_.push_component();
1118
-
1119
- _$_.regular_block(() => {
1120
- _$_.output_push('<footer');
1121
- _$_.output_push(' class="last-child"');
1122
- _$_.output_push('>');
1067
+ return _$_.tsrx_element(() => {
1068
+ _$_.regular_block(() => {
1069
+ _$_.output_push('<footer');
1070
+ _$_.output_push(' class="last-child"');
1071
+ _$_.output_push('>');
1123
1072
 
1124
- {
1125
- _$_.output_push('I am the last child');
1126
- }
1073
+ {
1074
+ _$_.output_push('I am the last child');
1075
+ }
1127
1076
 
1128
- _$_.output_push('</footer>');
1077
+ _$_.output_push('</footer>');
1078
+ });
1129
1079
  });
1130
-
1131
- _$_.pop_component();
1132
1080
  }
1133
1081
 
1134
1082
  export function ComponentAsLastSibling() {
1135
- _$_.push_component();
1136
-
1137
- _$_.regular_block(() => {
1138
- _$_.output_push('<div');
1139
- _$_.output_push(' class="wrapper"');
1140
- _$_.output_push('>');
1141
-
1142
- {
1143
- _$_.output_push('<h1');
1083
+ return _$_.tsrx_element(() => {
1084
+ _$_.regular_block(() => {
1085
+ _$_.output_push('<div');
1086
+ _$_.output_push(' class="wrapper"');
1144
1087
  _$_.output_push('>');
1145
1088
 
1146
1089
  {
1147
- _$_.output_push('Header');
1148
- }
1090
+ _$_.output_push('<h1');
1091
+ _$_.output_push('>');
1149
1092
 
1150
- _$_.output_push('</h1>');
1151
- _$_.output_push('<p');
1152
- _$_.output_push('>');
1093
+ {
1094
+ _$_.output_push('Header');
1095
+ }
1153
1096
 
1154
- {
1155
- _$_.output_push('Some content');
1156
- }
1097
+ _$_.output_push('</h1>');
1098
+ _$_.output_push('<p');
1099
+ _$_.output_push('>');
1157
1100
 
1158
- _$_.output_push('</p>');
1101
+ {
1102
+ _$_.output_push('Some content');
1103
+ }
1159
1104
 
1160
- {
1161
- const comp = LastChild;
1162
- const args = [{}];
1105
+ _$_.output_push('</p>');
1106
+
1107
+ {
1108
+ const comp = LastChild;
1109
+ const args = [{}];
1163
1110
 
1164
- comp(...args);
1111
+ _$_.render_component(comp, ...args);
1112
+ }
1165
1113
  }
1166
- }
1167
1114
 
1168
- _$_.output_push('</div>');
1115
+ _$_.output_push('</div>');
1116
+ });
1169
1117
  });
1170
-
1171
- _$_.pop_component();
1172
1118
  }
1173
1119
 
1174
1120
  function InnerContent() {
1175
- _$_.push_component();
1176
-
1177
- _$_.regular_block(() => {
1178
- _$_.output_push('<div');
1179
- _$_.output_push(' class="inner"');
1180
- _$_.output_push('>');
1181
-
1182
- {
1183
- _$_.output_push('<span');
1121
+ return _$_.tsrx_element(() => {
1122
+ _$_.regular_block(() => {
1123
+ _$_.output_push('<div');
1124
+ _$_.output_push(' class="inner"');
1184
1125
  _$_.output_push('>');
1185
1126
 
1186
1127
  {
1187
- _$_.output_push('Inner text');
1188
- }
1128
+ _$_.output_push('<span');
1129
+ _$_.output_push('>');
1189
1130
 
1190
- _$_.output_push('</span>');
1131
+ {
1132
+ _$_.output_push('Inner text');
1133
+ }
1191
1134
 
1192
- {
1193
- const comp = LastChild;
1194
- const args = [{}];
1135
+ _$_.output_push('</span>');
1136
+
1137
+ {
1138
+ const comp = LastChild;
1139
+ const args = [{}];
1195
1140
 
1196
- comp(...args);
1141
+ _$_.render_component(comp, ...args);
1142
+ }
1197
1143
  }
1198
- }
1199
1144
 
1200
- _$_.output_push('</div>');
1145
+ _$_.output_push('</div>');
1146
+ });
1201
1147
  });
1202
-
1203
- _$_.pop_component();
1204
1148
  }
1205
1149
 
1206
1150
  export function NestedComponentAsLastSibling() {
1207
- _$_.push_component();
1208
-
1209
- _$_.regular_block(() => {
1210
- _$_.output_push('<section');
1211
- _$_.output_push(' class="outer"');
1212
- _$_.output_push('>');
1213
-
1214
- {
1215
- _$_.output_push('<h2');
1151
+ return _$_.tsrx_element(() => {
1152
+ _$_.regular_block(() => {
1153
+ _$_.output_push('<section');
1154
+ _$_.output_push(' class="outer"');
1216
1155
  _$_.output_push('>');
1217
1156
 
1218
1157
  {
1219
- _$_.output_push('Section title');
1220
- }
1158
+ _$_.output_push('<h2');
1159
+ _$_.output_push('>');
1221
1160
 
1222
- _$_.output_push('</h2>');
1161
+ {
1162
+ _$_.output_push('Section title');
1163
+ }
1223
1164
 
1224
- {
1225
- const comp = InnerContent;
1226
- const args = [{}];
1165
+ _$_.output_push('</h2>');
1227
1166
 
1228
- comp(...args);
1167
+ {
1168
+ const comp = InnerContent;
1169
+ const args = [{}];
1170
+
1171
+ _$_.render_component(comp, ...args);
1172
+ }
1229
1173
  }
1230
- }
1231
1174
 
1232
- _$_.output_push('</section>');
1175
+ _$_.output_push('</section>');
1176
+ });
1233
1177
  });
1234
-
1235
- _$_.pop_component();
1236
1178
  }