ripple 0.3.84 → 0.3.85

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