ripple 0.3.84 → 0.3.86

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 (59) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/package.json +3 -3
  3. package/src/constants.js +4 -0
  4. package/src/runtime/internal/client/blocks.js +53 -0
  5. package/src/runtime/internal/client/component.js +3 -3
  6. package/src/runtime/internal/client/constants.js +4 -0
  7. package/src/runtime/internal/client/for.js +87 -14
  8. package/src/runtime/internal/client/if.js +18 -2
  9. package/src/runtime/internal/client/index.js +1 -0
  10. package/src/runtime/internal/client/operations.js +25 -0
  11. package/src/runtime/internal/client/runtime.js +62 -10
  12. package/src/runtime/internal/client/switch.js +33 -5
  13. package/src/runtime/internal/client/template.js +10 -2
  14. package/src/runtime/internal/client/try.js +12 -2
  15. package/src/runtime/internal/client/types.d.ts +4 -0
  16. package/tests/client/__snapshots__/for.test.tsrx.snap +0 -2
  17. package/tests/client/compiler/compiler.basic.test.tsrx +5 -2
  18. package/tests/client/composite/__snapshots__/composite.render.test.tsrx.snap +0 -4
  19. package/tests/client/for-single-root-items.test.tsrx +130 -0
  20. package/tests/client/scoped-flush.test.tsrx +105 -0
  21. package/tests/hydration/compiled/client/basic.js +198 -214
  22. package/tests/hydration/compiled/client/composite.js +23 -72
  23. package/tests/hydration/compiled/client/for.js +66 -72
  24. package/tests/hydration/compiled/client/hmr.js +2 -13
  25. package/tests/hydration/compiled/client/html.js +619 -479
  26. package/tests/hydration/compiled/client/if-children.js +72 -84
  27. package/tests/hydration/compiled/client/if-fragment-controlflow.js +463 -0
  28. package/tests/hydration/compiled/client/if.js +87 -92
  29. package/tests/hydration/compiled/client/mixed-control-flow.js +120 -160
  30. package/tests/hydration/compiled/client/nested-control-flow.js +288 -360
  31. package/tests/hydration/compiled/client/portal.js +15 -21
  32. package/tests/hydration/compiled/client/reactivity.js +7 -12
  33. package/tests/hydration/compiled/client/switch.js +113 -115
  34. package/tests/hydration/compiled/client/track-async-serialization.js +71 -122
  35. package/tests/hydration/compiled/client/try.js +26 -41
  36. package/tests/hydration/compiled/server/basic.js +295 -556
  37. package/tests/hydration/compiled/server/composite.js +31 -50
  38. package/tests/hydration/compiled/server/events.js +37 -173
  39. package/tests/hydration/compiled/server/for.js +236 -847
  40. package/tests/hydration/compiled/server/head.js +110 -241
  41. package/tests/hydration/compiled/server/hmr.js +14 -41
  42. package/tests/hydration/compiled/server/html-in-template.js +14 -38
  43. package/tests/hydration/compiled/server/html.js +951 -1176
  44. package/tests/hydration/compiled/server/if-children.js +59 -493
  45. package/tests/hydration/compiled/server/if-fragment-controlflow.js +227 -0
  46. package/tests/hydration/compiled/server/if.js +57 -209
  47. package/tests/hydration/compiled/server/mixed-control-flow.js +144 -250
  48. package/tests/hydration/compiled/server/nested-control-flow.js +309 -559
  49. package/tests/hydration/compiled/server/portal.js +94 -156
  50. package/tests/hydration/compiled/server/reactivity.js +23 -65
  51. package/tests/hydration/compiled/server/return.js +6 -16
  52. package/tests/hydration/compiled/server/switch.js +91 -219
  53. package/tests/hydration/compiled/server/track-async-serialization.js +211 -256
  54. package/tests/hydration/compiled/server/try.js +67 -126
  55. package/tests/hydration/components/html.tsrx +75 -0
  56. package/tests/hydration/components/if-fragment-controlflow.tsrx +145 -0
  57. package/tests/hydration/html.test.js +50 -0
  58. package/tests/hydration/if-fragment-controlflow.test.js +95 -0
  59. 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('>');
20
+ let __out = '';
35
21
 
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
- }
47
-
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('>');
31
+ let __out = '';
60
32
 
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
- }
73
-
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('>');
98
-
99
- {
100
- _$_.output_push('Link');
101
- }
42
+ let __out = '';
102
43
 
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('>');
152
-
153
- {
154
- _$_.output_push('First');
155
- }
88
+ let __out = '';
156
89
 
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('>');
99
+ let __out = '';
168
100
 
169
- {
170
- _$_.output_push('Second');
171
- }
172
-
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('>');
132
+ let __out = '';
205
133
 
206
- {
207
- _$_.output_push(_$_.escape('Hello ' + String(props.name ?? '')));
208
- }
209
-
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('>');
159
+ let __out = '';
237
160
 
238
- {
239
- _$_.output_push(_$_.escape(value));
240
- }
241
-
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('>');
279
-
280
- {
281
- _$_.output_push(_$_.escape(label));
282
- }
189
+ let __out = '';
283
190
 
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('>');
308
-
309
- {
310
- _$_.output_push('<!--[-->');
213
+ let __out = '';
311
214
 
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('>');
254
+ let __out = '';
363
255
 
364
- {
365
- _$_.output_push('epsilon');
366
- }
367
-
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('>');
289
+ let __out = '';
400
290
 
401
- {
402
- _$_.output_push('beta');
403
- }
404
-
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('>');
414
-
415
- {
416
- _$_.output_push('epsilon');
417
- }
298
+ let __out = '';
418
299
 
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('>');
451
-
452
- {
453
- _$_.output_push('beta');
454
- }
333
+ let __out = '';
455
334
 
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('>');
342
+ let __out = '';
465
343
 
466
- {
467
- _$_.output_push('epsilon');
468
- }
469
-
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('>');
543
-
544
- {
545
- _$_.output_push(' ok');
546
- }
416
+ let __out = '';
547
417
 
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,30 +536,26 @@ 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('>');
539
+ let __out = '';
661
540
 
662
- {
663
- _$_.output_push('from tsrx');
664
- }
665
-
666
- _$_.output_push('</div>');
667
- }
668
-
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
 
673
546
  _$_.regular_block(() => {
547
+ let __out = '';
548
+
549
+ __out += '<!--[-->';
550
+
674
551
  {
552
+ _$_.output_push(__out);
553
+ __out = '';
675
554
  _$_.render_expression(content);
676
555
  }
556
+
557
+ __out += '<!--]-->';
558
+ _$_.output_push(__out);
677
559
  });
678
560
  });
679
561
  }
@@ -682,38 +564,26 @@ export function NestedTsrxElementsInsideTopLevelTsxValue() {
682
564
  return _$_.tsrx_element(() => {
683
565
  const content = _$_.tsrx_element(() => {
684
566
  _$_.regular_block(() => {
685
- _$_.output_push('<div');
686
- _$_.output_push(' class="wrapper"');
687
- _$_.output_push('>');
567
+ let __out = '';
688
568
 
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>');
569
+ __out += '<div class="wrapper"><section class="native"><span class="nested-tsrx">inside nested tsrx</span></section></div>';
570
+ _$_.output_push(__out);
710
571
  });
711
572
  });
712
573
 
713
574
  _$_.regular_block(() => {
575
+ let __out = '';
576
+
577
+ __out += '<!--[-->';
578
+
714
579
  {
580
+ _$_.output_push(__out);
581
+ __out = '';
715
582
  _$_.render_expression(content);
716
583
  }
584
+
585
+ __out += '<!--]-->';
586
+ _$_.output_push(__out);
717
587
  });
718
588
  });
719
589
  }
@@ -722,36 +592,43 @@ export function TsxDeclaredBeforeTopLevelTsx() {
722
592
  return _$_.tsrx_element(() => {
723
593
  const nested = _$_.tsrx_element(() => {
724
594
  _$_.regular_block(() => {
725
- _$_.output_push('<span');
726
- _$_.output_push(' class="nested-tsx"');
727
- _$_.output_push('>');
728
-
729
- {
730
- _$_.output_push('inside nested tsx');
731
- }
595
+ let __out = '';
732
596
 
733
- _$_.output_push('</span>');
597
+ __out += '<span class="nested-tsx">inside nested tsx</span>';
598
+ _$_.output_push(__out);
734
599
  });
735
600
  });
736
601
 
737
602
  const content = _$_.tsrx_element(() => {
738
603
  _$_.regular_block(() => {
739
- _$_.output_push('<div');
740
- _$_.output_push(' class="native"');
741
- _$_.output_push('>');
604
+ let __out = '';
605
+
606
+ __out += '<div class="native">';
742
607
 
743
608
  {
609
+ _$_.output_push(__out);
610
+ __out = '';
744
611
  _$_.render_expression(nested);
745
612
  }
746
613
 
747
- _$_.output_push('</div>');
614
+ __out += '</div>';
615
+ _$_.output_push(__out);
748
616
  });
749
617
  });
750
618
 
751
619
  _$_.regular_block(() => {
620
+ let __out = '';
621
+
622
+ __out += '<!--[-->';
623
+
752
624
  {
625
+ _$_.output_push(__out);
626
+ __out = '';
753
627
  _$_.render_expression(content);
754
628
  }
629
+
630
+ __out += '<!--]-->';
631
+ _$_.output_push(__out);
755
632
  });
756
633
  });
757
634
  }
@@ -759,15 +636,18 @@ export function TsxDeclaredBeforeTopLevelTsx() {
759
636
  function TextProp(__props) {
760
637
  return _$_.tsrx_element(() => {
761
638
  _$_.regular_block(() => {
762
- _$_.output_push('<div');
763
- _$_.output_push(' class="text-prop"');
764
- _$_.output_push('>');
639
+ let __out = '';
640
+
641
+ __out += '<div class="text-prop">';
765
642
 
766
643
  {
644
+ _$_.output_push(__out);
645
+ __out = '';
767
646
  _$_.render_expression(__props.children);
768
647
  }
769
648
 
770
- _$_.output_push('</div>');
649
+ __out += '</div>';
650
+ _$_.output_push(__out);
771
651
  });
772
652
  });
773
653
  }
@@ -777,29 +657,27 @@ export function TextPropWithToggle() {
777
657
  let lazy_1 = _$_.track(false, '1ba81c3b');
778
658
 
779
659
  _$_.regular_block(() => {
780
- {
781
- {
782
- const comp = TextProp;
783
-
784
- const args = [
785
- {
786
- children: _$_.normalize_children(lazy_1.value ? 'hello' : '')
787
- }
788
- ];
660
+ let __out = '';
789
661
 
790
- _$_.render_component(comp, ...args);
791
- }
662
+ {
663
+ const comp = TextProp;
792
664
 
793
- _$_.output_push('<button');
794
- _$_.output_push(' class="show-text"');
795
- _$_.output_push('>');
665
+ _$_.output_push(__out);
666
+ __out = '';
796
667
 
797
- {
798
- _$_.output_push('Show');
799
- }
668
+ const args = [
669
+ {
670
+ children: _$_.normalize_children(lazy_1.value ? 'hello' : '')
671
+ }
672
+ ];
800
673
 
801
- _$_.output_push('</button>');
674
+ _$_.output_push(__out);
675
+ __out = '';
676
+ _$_.render_component(comp, ...args);
802
677
  }
678
+
679
+ __out += '<button class="show-text">Show</button>';
680
+ _$_.output_push(__out);
803
681
  });
804
682
  });
805
683
  }
@@ -807,35 +685,10 @@ export function TextPropWithToggle() {
807
685
  function StaticHeader() {
808
686
  return _$_.tsrx_element(() => {
809
687
  _$_.regular_block(() => {
810
- {
811
- _$_.output_push('<h1');
812
- _$_.output_push(' class="sr-only"');
813
- _$_.output_push('>');
814
-
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
- }
688
+ let __out = '';
836
689
 
837
- _$_.output_push('</p>');
838
- }
690
+ __out += '<h1 class="sr-only">heading</h1><p class="subtitle">first paragraph</p><p class="subtitle">second paragraph</p>';
691
+ _$_.output_push(__out);
839
692
  });
840
693
  });
841
694
  }
@@ -845,33 +698,19 @@ export function StaticChildWithSiblings() {
845
698
  const foo = 'bar';
846
699
 
847
700
  _$_.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('>');
701
+ let __out = '';
859
702
 
860
- {
861
- _$_.output_push(_$_.escape(foo));
862
- }
863
-
864
- _$_.output_push('</span>');
865
- _$_.output_push('<span');
866
- _$_.output_push(' class="sibling2"');
867
- _$_.output_push('>');
868
-
869
- {
870
- _$_.output_push(_$_.escape(foo));
871
- }
703
+ {
704
+ const comp = StaticHeader;
705
+ const args = [{}];
872
706
 
873
- _$_.output_push('</span>');
707
+ _$_.output_push(__out);
708
+ __out = '';
709
+ _$_.render_component(comp, ...args);
874
710
  }
711
+
712
+ __out += '<span class="sibling1">' + _$_.escape(foo) + '</span><span class="sibling2">' + _$_.escape(foo) + '</span>';
713
+ _$_.output_push(__out);
875
714
  });
876
715
  });
877
716
  }
@@ -879,31 +718,10 @@ export function StaticChildWithSiblings() {
879
718
  function Header() {
880
719
  return _$_.tsrx_element(() => {
881
720
  _$_.regular_block(() => {
882
- {
883
- _$_.output_push('<h1');
884
- _$_.output_push(' class="sr-only"');
885
- _$_.output_push('>');
886
-
887
- {
888
- _$_.output_push('Ripple');
889
- }
721
+ let __out = '';
890
722
 
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
- }
723
+ __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>';
724
+ _$_.output_push(__out);
907
725
  });
908
726
  });
909
727
  }
@@ -911,49 +729,23 @@ function Header() {
911
729
  function Actions({ playgroundVisible = false }) {
912
730
  return _$_.tsrx_element(() => {
913
731
  _$_.regular_block(() => {
914
- _$_.output_push('<div');
915
- _$_.output_push(' class="social-links"');
916
- _$_.output_push('>');
732
+ let __out = '';
917
733
 
918
- {
919
- _$_.output_push('<a');
920
- _$_.output_push(' href="https://github.com"');
921
- _$_.output_push(' class="github-link"');
922
- _$_.output_push('>');
734
+ __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>';
735
+ _$_.output_push(__out);
736
+ __out = '';
923
737
 
924
- {
925
- _$_.output_push('GitHub');
926
- }
738
+ _$_.render_expression(playgroundVisible
739
+ ? _$_.tsrx_element(() => {
740
+ let __out = '';
927
741
 
928
- _$_.output_push('</a>');
929
- _$_.output_push('<a');
930
- _$_.output_push(' href="https://discord.com"');
931
- _$_.output_push(' class="discord-link"');
932
- _$_.output_push('>');
742
+ __out += '<a href="/playground" class="playground-link">Playground</a>';
743
+ _$_.output_push(__out);
744
+ })
745
+ : null);
933
746
 
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('>');
946
-
947
- {
948
- _$_.output_push('Playground');
949
- }
950
-
951
- _$_.output_push('</a>');
952
- })
953
- : null);
954
- }
955
-
956
- _$_.output_push('</div>');
747
+ __out += '</div>';
748
+ _$_.output_push(__out);
957
749
  });
958
750
  });
959
751
  }
@@ -961,22 +753,18 @@ function Actions({ playgroundVisible = false }) {
961
753
  function Layout({ children }) {
962
754
  return _$_.tsrx_element(() => {
963
755
  _$_.regular_block(() => {
964
- _$_.output_push('<main');
965
- _$_.output_push('>');
756
+ let __out = '';
966
757
 
967
- {
968
- _$_.output_push('<div');
969
- _$_.output_push(' class="container"');
970
- _$_.output_push('>');
971
-
972
- {
973
- _$_.render_expression(children);
974
- }
758
+ __out += '<main><div class="container">';
975
759
 
976
- _$_.output_push('</div>');
760
+ {
761
+ _$_.output_push(__out);
762
+ __out = '';
763
+ _$_.render_expression(children);
977
764
  }
978
765
 
979
- _$_.output_push('</main>');
766
+ __out += '</div></main>';
767
+ _$_.output_push(__out);
980
768
  });
981
769
  });
982
770
  }
@@ -984,22 +772,10 @@ function Layout({ children }) {
984
772
  function Content() {
985
773
  return _$_.tsrx_element(() => {
986
774
  _$_.regular_block(() => {
987
- _$_.output_push('<div');
988
- _$_.output_push(' class="content"');
989
- _$_.output_push('>');
990
-
991
- {
992
- _$_.output_push('<p');
993
- _$_.output_push('>');
775
+ let __out = '';
994
776
 
995
- {
996
- _$_.output_push('Some content here');
997
- }
998
-
999
- _$_.output_push('</p>');
1000
- }
1001
-
1002
- _$_.output_push('</div>');
777
+ __out += '<div class="content"><p>Some content here</p></div>';
778
+ _$_.output_push(__out);
1003
779
  });
1004
780
  });
1005
781
  }
@@ -1055,15 +831,10 @@ export function WebsiteIndex() {
1055
831
  function LastChild() {
1056
832
  return _$_.tsrx_element(() => {
1057
833
  _$_.regular_block(() => {
1058
- _$_.output_push('<footer');
1059
- _$_.output_push(' class="last-child"');
1060
- _$_.output_push('>');
1061
-
1062
- {
1063
- _$_.output_push('I am the last child');
1064
- }
834
+ let __out = '';
1065
835
 
1066
- _$_.output_push('</footer>');
836
+ __out += '<footer class="last-child">I am the last child</footer>';
837
+ _$_.output_push(__out);
1067
838
  });
1068
839
  });
1069
840
  }
@@ -1071,37 +842,21 @@ function LastChild() {
1071
842
  export function ComponentAsLastSibling() {
1072
843
  return _$_.tsrx_element(() => {
1073
844
  _$_.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
- }
845
+ let __out = '';
1093
846
 
1094
- _$_.output_push('</p>');
847
+ __out += '<div class="wrapper"><h1>Header</h1><p>Some content</p>';
1095
848
 
1096
- {
1097
- const comp = LastChild;
1098
- const args = [{}];
849
+ {
850
+ const comp = LastChild;
851
+ const args = [{}];
1099
852
 
1100
- _$_.render_component(comp, ...args);
1101
- }
853
+ _$_.output_push(__out);
854
+ __out = '';
855
+ _$_.render_component(comp, ...args);
1102
856
  }
1103
857
 
1104
- _$_.output_push('</div>');
858
+ __out += '</div>';
859
+ _$_.output_push(__out);
1105
860
  });
1106
861
  });
1107
862
  }
@@ -1109,29 +864,21 @@ export function ComponentAsLastSibling() {
1109
864
  function InnerContent() {
1110
865
  return _$_.tsrx_element(() => {
1111
866
  _$_.regular_block(() => {
1112
- _$_.output_push('<div');
1113
- _$_.output_push(' class="inner"');
1114
- _$_.output_push('>');
867
+ let __out = '';
1115
868
 
1116
- {
1117
- _$_.output_push('<span');
1118
- _$_.output_push('>');
1119
-
1120
- {
1121
- _$_.output_push('Inner text');
1122
- }
869
+ __out += '<div class="inner"><span>Inner text</span>';
1123
870
 
1124
- _$_.output_push('</span>');
1125
-
1126
- {
1127
- const comp = LastChild;
1128
- const args = [{}];
871
+ {
872
+ const comp = LastChild;
873
+ const args = [{}];
1129
874
 
1130
- _$_.render_component(comp, ...args);
1131
- }
875
+ _$_.output_push(__out);
876
+ __out = '';
877
+ _$_.render_component(comp, ...args);
1132
878
  }
1133
879
 
1134
- _$_.output_push('</div>');
880
+ __out += '</div>';
881
+ _$_.output_push(__out);
1135
882
  });
1136
883
  });
1137
884
  }
@@ -1139,29 +886,21 @@ function InnerContent() {
1139
886
  export function NestedComponentAsLastSibling() {
1140
887
  return _$_.tsrx_element(() => {
1141
888
  _$_.regular_block(() => {
1142
- _$_.output_push('<section');
1143
- _$_.output_push(' class="outer"');
1144
- _$_.output_push('>');
889
+ let __out = '';
1145
890
 
1146
- {
1147
- _$_.output_push('<h2');
1148
- _$_.output_push('>');
1149
-
1150
- {
1151
- _$_.output_push('Section title');
1152
- }
891
+ __out += '<section class="outer"><h2>Section title</h2>';
1153
892
 
1154
- _$_.output_push('</h2>');
1155
-
1156
- {
1157
- const comp = InnerContent;
1158
- const args = [{}];
893
+ {
894
+ const comp = InnerContent;
895
+ const args = [{}];
1159
896
 
1160
- _$_.render_component(comp, ...args);
1161
- }
897
+ _$_.output_push(__out);
898
+ __out = '';
899
+ _$_.render_component(comp, ...args);
1162
900
  }
1163
901
 
1164
- _$_.output_push('</section>');
902
+ __out += '</section>';
903
+ _$_.output_push(__out);
1165
904
  });
1166
905
  });
1167
906
  }