ripple 0.4.1 → 0.4.3

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 (96) hide show
  1. package/CHANGELOG.md +162 -0
  2. package/package.json +9 -3
  3. package/src/constants.js +4 -0
  4. package/src/jsx-runtime.d.ts +2 -1
  5. package/src/runtime/array.js +15 -9
  6. package/src/runtime/index-client.js +25 -7
  7. package/src/runtime/index-server.js +1 -0
  8. package/src/runtime/internal/client/attributes.js +313 -0
  9. package/src/runtime/internal/client/blocks.js +4 -14
  10. package/src/runtime/internal/client/component.js +2 -5
  11. package/src/runtime/internal/client/composite.js +14 -6
  12. package/src/runtime/internal/client/constants.js +12 -6
  13. package/src/runtime/internal/client/context.js +3 -2
  14. package/src/runtime/internal/client/css.js +11 -26
  15. package/src/runtime/internal/client/errors.js +188 -0
  16. package/src/runtime/internal/client/events.js +79 -34
  17. package/src/runtime/internal/client/expression.js +21 -116
  18. package/src/runtime/internal/client/for.js +272 -222
  19. package/src/runtime/internal/client/head.js +4 -3
  20. package/src/runtime/internal/client/html.js +5 -3
  21. package/src/runtime/internal/client/hydrate.js +484 -0
  22. package/src/runtime/internal/client/hydration-enabled.js +7 -0
  23. package/src/runtime/internal/client/hydration.js +16 -97
  24. package/src/runtime/internal/client/if.js +13 -9
  25. package/src/runtime/internal/client/index.js +16 -8
  26. package/src/runtime/internal/client/operations.js +12 -9
  27. package/src/runtime/internal/client/portal.js +3 -2
  28. package/src/runtime/internal/client/render.js +75 -321
  29. package/src/runtime/internal/client/root-boundary-enabled.js +7 -0
  30. package/src/runtime/internal/client/runtime.js +129 -362
  31. package/src/runtime/internal/client/template-ns.js +47 -0
  32. package/src/runtime/internal/client/template.js +63 -140
  33. package/src/runtime/internal/client/track-async.js +356 -0
  34. package/src/runtime/internal/client/try.js +133 -319
  35. package/src/runtime/internal/client/types.d.ts +48 -24
  36. package/src/runtime/internal/server/index.js +38 -33
  37. package/src/runtime/internal/server/prerender.js +27 -0
  38. package/src/server/index.js +1 -0
  39. package/src/utils/class-name.js +28 -0
  40. package/tests/client/basic/basic.errors.test.tsrx +3 -3
  41. package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +0 -2
  42. package/tests/client/compiler/compiler.basic.test.tsrx +4 -4
  43. package/tests/client/compiler/compiler.tracked-access.test.tsrx +3 -3
  44. package/tests/client/composite/composite.props.test.tsrx +10 -10
  45. package/tests/client/derived-release.test.tsrx +3 -3
  46. package/tests/client/for-item.test.tsrx +443 -0
  47. package/tests/client/for-selector.test.tsrx +95 -0
  48. package/tests/hydration/compiled/client/basic.js +97 -123
  49. package/tests/hydration/compiled/client/composite.js +5 -5
  50. package/tests/hydration/compiled/client/events.js +84 -79
  51. package/tests/hydration/compiled/client/for.js +229 -233
  52. package/tests/hydration/compiled/client/fragment-cursor.js +781 -481
  53. package/tests/hydration/compiled/client/head.js +23 -26
  54. package/tests/hydration/compiled/client/hmr.js +4 -4
  55. package/tests/hydration/compiled/client/html-in-template.js +5 -5
  56. package/tests/hydration/compiled/client/html.js +174 -208
  57. package/tests/hydration/compiled/client/if-children.js +71 -70
  58. package/tests/hydration/compiled/client/if-fragment-controlflow.js +46 -46
  59. package/tests/hydration/compiled/client/if.js +26 -26
  60. package/tests/hydration/compiled/client/mixed-control-flow.js +63 -105
  61. package/tests/hydration/compiled/client/nested-control-flow.js +170 -390
  62. package/tests/hydration/compiled/client/portal.js +10 -10
  63. package/tests/hydration/compiled/client/reactivity.js +36 -50
  64. package/tests/hydration/compiled/client/return.js +2 -2
  65. package/tests/hydration/compiled/client/streaming.js +34 -40
  66. package/tests/hydration/compiled/client/switch.js +25 -25
  67. package/tests/hydration/compiled/client/track-async-serialization.js +41 -41
  68. package/tests/hydration/compiled/client/try.js +15 -15
  69. package/tests/hydration/compiled/client/typed-text.js +8 -19
  70. package/tests/hydration/compiled/server/basic.js +6 -6
  71. package/tests/hydration/compiled/server/events.js +13 -61
  72. package/tests/hydration/compiled/server/for.js +23 -31
  73. package/tests/hydration/compiled/server/fragment-cursor.js +214 -366
  74. package/tests/hydration/compiled/server/head.js +6 -6
  75. package/tests/hydration/compiled/server/hmr.js +1 -1
  76. package/tests/hydration/compiled/server/html.js +1 -1
  77. package/tests/hydration/compiled/server/if-children.js +9 -9
  78. package/tests/hydration/compiled/server/if.js +5 -5
  79. package/tests/hydration/compiled/server/mixed-control-flow.js +4 -4
  80. package/tests/hydration/compiled/server/portal.js +1 -1
  81. package/tests/hydration/compiled/server/reactivity.js +9 -9
  82. package/tests/hydration/compiled/server/streaming.js +9 -9
  83. package/tests/hydration/compiled/server/switch.js +4 -4
  84. package/tests/hydration/compiled/server/track-async-serialization.js +16 -16
  85. package/tests/hydration/compiled/server/try.js +4 -4
  86. package/tests/hydration/compiled/server/typed-text.js +1 -1
  87. package/tests/hydration/components/fragment-cursor.tsrx +60 -0
  88. package/tests/hydration/components/track-async-serialization.tsrx +2 -2
  89. package/tests/hydration/fragment-cursor.test.js +34 -1
  90. package/tests/hydration/track-async-serialization.test.js +1 -1
  91. package/tests/server/basic.components.test.tsrx +3 -3
  92. package/tests/server/basic.test.tsrx +23 -0
  93. package/tests/server/track-async-serialization.test.tsrx +6 -6
  94. package/tests/utils/tracked-types.test.js +3 -3
  95. package/types/index.d.ts +8 -8
  96. package/types/server.d.ts +17 -0
@@ -1,10 +1,10 @@
1
1
  // @ts-nocheck
2
2
  import * as _$_ from 'ripple/internal/client';
3
3
 
4
- var root = _$_.template(`<p class="result"> </p>`, 0);
4
+ var root = _$_.template(`<p class=result> `);
5
5
 
6
6
  function MoneyResult_render(__anchor, __block, { count }) {
7
- const money = _$_.track_async(() => _$_.with_scope(__block, () => doubleMoney(new Money(count.value, 'USD'))), __block, '2e21cbe9');
7
+ const money = _$_.track_async(() => _$_.with_scope(__block, () => doubleMoney(new Money(count.value, 'USD'))), __block, 'csssmh');
8
8
  var p = root();
9
9
 
10
10
  {
@@ -19,12 +19,12 @@ function MoneyResult_render(__anchor, __block, { count }) {
19
19
 
20
20
  MoneyResult[_$_.$r] = MoneyResult_render;
21
21
 
22
- var root_3 = _$_.template(`<p class="loading">loading...</p>`, 0);
23
- var root_2 = _$_.template(`<button class="increment">increment</button><!>`, 1, 2);
22
+ var root_3 = _$_.template(`<p class=loading>loading...`);
23
+ var root_2 = _$_.template(`<button class=increment>increment</button><!>`, 1, 2);
24
24
  var root_1 = _$_.template(`<!>`, 1, 1);
25
25
 
26
26
  function AsyncCustomType_render(__anchor, __block) {
27
- const count = _$_.track(6, __block, 'f0c2b41e');
27
+ const count = _$_.track(6, __block, '1usw1lq');
28
28
  var fragment = root_1();
29
29
  var node_1 = _$_.first_child_frag(fragment);
30
30
 
@@ -59,10 +59,10 @@ function AsyncCustomType_render(__anchor, __block) {
59
59
 
60
60
  AsyncCustomType[_$_.$r] = AsyncCustomType_render;
61
61
 
62
- var root_4 = _$_.template(`<p class="result"> </p>`, 0);
62
+ var root_4 = _$_.template(`<p class=result> `);
63
63
 
64
64
  function ServerCallResult_render(__anchor, __block, { count }) {
65
- const data = _$_.track_async(() => _$_.with_scope(__block, () => formatValue(count.value)), __block, '4e502c38');
65
+ const data = _$_.track_async(() => _$_.with_scope(__block, () => formatValue(count.value)), __block, 'lq8y0o');
66
66
  var p_2 = root_4();
67
67
 
68
68
  {
@@ -77,12 +77,12 @@ function ServerCallResult_render(__anchor, __block, { count }) {
77
77
 
78
78
  ServerCallResult[_$_.$r] = ServerCallResult_render;
79
79
 
80
- var root_7 = _$_.template(`<p class="loading">loading...</p>`, 0);
81
- var root_6 = _$_.template(`<button class="increment">increment</button><!>`, 1, 2);
80
+ var root_7 = _$_.template(`<p class=loading>loading...`);
81
+ var root_6 = _$_.template(`<button class=increment>increment</button><!>`, 1, 2);
82
82
  var root_5 = _$_.template(`<!>`, 1, 1);
83
83
 
84
84
  function AsyncWithServerCall_render(__anchor, __block) {
85
- const count = _$_.track(0, __block, '14891754');
85
+ const count = _$_.track(0, __block, '5p4g2c');
86
86
  var fragment_2 = root_5();
87
87
  var node_3 = _$_.first_child_frag(fragment_2);
88
88
 
@@ -117,14 +117,14 @@ function AsyncWithServerCall_render(__anchor, __block) {
117
117
 
118
118
  AsyncWithServerCall[_$_.$r] = AsyncWithServerCall_render;
119
119
 
120
- var root_8 = _$_.template(`<p class="result"> </p>`, 0);
121
- var root_9 = _$_.template(`<p class="loading">loading...</p>`, 0);
120
+ var root_8 = _$_.template(`<p class=result> `);
121
+ var root_9 = _$_.template(`<p class=loading>loading...`);
122
122
 
123
123
  function AsyncSimpleValue_render(__anchor, __block) {
124
124
  _$_.try(
125
125
  __anchor,
126
126
  (__anchor) => {
127
- const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('hydrated value')), __block, 'f325448a');
127
+ const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('hydrated value')), __block, '1vgpoju');
128
128
  var p_4 = root_8();
129
129
 
130
130
  {
@@ -148,14 +148,14 @@ function AsyncSimpleValue_render(__anchor, __block) {
148
148
 
149
149
  AsyncSimpleValue[_$_.$r] = AsyncSimpleValue_render;
150
150
 
151
- var root_10 = _$_.template(`<span class="count"> </span>`, 0);
152
- var root_11 = _$_.template(`<span class="pending">...</span>`, 0);
151
+ var root_10 = _$_.template(`<span class=count> `);
152
+ var root_11 = _$_.template(`<span class=pending>...`);
153
153
 
154
154
  function AsyncNumericValue_render(__anchor, __block) {
155
155
  _$_.try(
156
156
  __anchor,
157
157
  (__anchor) => {
158
- const count = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(42)), __block, 'ab8199a0');
158
+ const count = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(42)), __block, '1bl4m1s');
159
159
  var span = root_10();
160
160
 
161
161
  {
@@ -179,14 +179,14 @@ function AsyncNumericValue_render(__anchor, __block) {
179
179
 
180
180
  AsyncNumericValue[_$_.$r] = AsyncNumericValue_render;
181
181
 
182
- var root_12 = _$_.template(`<div class="user"><span class="name"> </span><span class="age"> </span></div>`, 0);
183
- var root_13 = _$_.template(`<div class="loading">loading user...</div>`, 0);
182
+ var root_12 = _$_.template(`<div class=user><span class=name> </span><span class=age> `);
183
+ var root_13 = _$_.template(`<div class=loading>loading user...`);
184
184
 
185
185
  function AsyncObjectValue_render(__anchor, __block) {
186
186
  _$_.try(
187
187
  __anchor,
188
188
  (__anchor) => {
189
- const user = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve({ name: 'Alice', age: 30 })), __block, 'fb7ad40b');
189
+ const user = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve({ name: 'Alice', age: 30 })), __block, '1xrym8b');
190
190
  var div = root_12();
191
191
 
192
192
  {
@@ -223,15 +223,15 @@ function AsyncObjectValue_render(__anchor, __block) {
223
223
 
224
224
  AsyncObjectValue[_$_.$r] = AsyncObjectValue_render;
225
225
 
226
- var root_14 = _$_.template(`<div class="multi"><span class="first"> </span><span class="second"> </span></div>`, 0);
227
- var root_15 = _$_.template(`<div class="loading">loading...</div>`, 0);
226
+ var root_14 = _$_.template(`<div class=multi><span class=first> </span><span class=second> `);
227
+ var root_15 = _$_.template(`<div class=loading>loading...`);
228
228
 
229
229
  function AsyncMultipleValues_render(__anchor, __block) {
230
230
  _$_.try(
231
231
  __anchor,
232
232
  (__anchor) => {
233
- const first = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('alpha')), __block, '99982de5');
234
- const second = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('beta')), __block, '1dea4c85');
233
+ const first = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('alpha')), __block, '16m7mxx');
234
+ const second = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('beta')), __block, '8atc3p');
235
235
  var div_2 = root_14();
236
236
 
237
237
  {
@@ -268,15 +268,15 @@ function AsyncMultipleValues_render(__anchor, __block) {
268
268
 
269
269
  AsyncMultipleValues[_$_.$r] = AsyncMultipleValues_render;
270
270
 
271
- var root_16 = _$_.template(`<p class="result"> </p>`, 0);
272
- var root_17 = _$_.template(`<p class="error"> </p>`, 0);
273
- var root_18 = _$_.template(`<p class="loading">loading...</p>`, 0);
271
+ var root_16 = _$_.template(`<p class=result> `);
272
+ var root_17 = _$_.template(`<p class=error> `);
273
+ var root_18 = _$_.template(`<p class=loading>loading...`);
274
274
 
275
275
  function AsyncWithCatch_render(__anchor, __block) {
276
276
  _$_.try(
277
277
  __anchor,
278
278
  (__anchor) => {
279
- const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('fetch failed'))), __block, 'c9d12acf');
279
+ const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('fetch failed'))), __block, '1jzw72n');
280
280
  var p_6 = root_16();
281
281
 
282
282
  {
@@ -311,14 +311,14 @@ function AsyncWithCatch_render(__anchor, __block) {
311
311
 
312
312
  AsyncWithCatch[_$_.$r] = AsyncWithCatch_render;
313
313
 
314
- var root_19 = _$_.template(`<p class="result"> </p>`, 0);
315
- var root_20 = _$_.template(`<p class="pending">loading...</p>`, 0);
314
+ var root_19 = _$_.template(`<p class=result> `);
315
+ var root_20 = _$_.template(`<p class=pending>loading...`);
316
316
 
317
317
  function ChildWithError_render(__anchor, __block) {
318
318
  _$_.try(
319
319
  __anchor,
320
320
  (__anchor) => {
321
- const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('child error'))), __block, 'cdd1adb8');
321
+ const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('child error'))), __block, '1l3vago');
322
322
  var p_9 = root_19();
323
323
 
324
324
  {
@@ -342,7 +342,7 @@ function ChildWithError_render(__anchor, __block) {
342
342
 
343
343
  ChildWithError[_$_.$r] = ChildWithError_render;
344
344
 
345
- var root_21 = _$_.template(`<p class="parent-error"> </p>`, 0);
345
+ var root_21 = _$_.template(`<p class=parent-error> `);
346
346
 
347
347
  function ParentWithCatch_render(__anchor, __block) {
348
348
  _$_.try(
@@ -369,10 +369,10 @@ function ParentWithCatch_render(__anchor, __block) {
369
369
 
370
370
  ParentWithCatch[_$_.$r] = ParentWithCatch_render;
371
371
 
372
- var root_22 = _$_.template(`<p class="result"> </p>`, 0);
372
+ var root_22 = _$_.template(`<p class=result> `);
373
373
 
374
374
  function ReactiveDependencyResult_render(__anchor, __block, { count }) {
375
- const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(`count-${count.value}`)), __block, '18c43c3a');
375
+ const data = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(`count-${count.value}`)), __block, '6vdwe2');
376
376
  var p_12 = root_22();
377
377
 
378
378
  {
@@ -387,12 +387,12 @@ function ReactiveDependencyResult_render(__anchor, __block, { count }) {
387
387
 
388
388
  ReactiveDependencyResult[_$_.$r] = ReactiveDependencyResult_render;
389
389
 
390
- var root_25 = _$_.template(`<p class="loading">loading...</p>`, 0);
391
- var root_24 = _$_.template(`<button class="increment">increment</button><!>`, 1, 2);
390
+ var root_25 = _$_.template(`<p class=loading>loading...`);
391
+ var root_24 = _$_.template(`<button class=increment>increment</button><!>`, 1, 2);
392
392
  var root_23 = _$_.template(`<!>`, 1, 1);
393
393
 
394
394
  function AsyncWithReactiveDependency_render(__anchor, __block) {
395
- const count = _$_.track(0, __block, 'd5dcc1d3');
395
+ const count = _$_.track(0, __block, '1nc7lqr');
396
396
  var fragment_4 = root_23();
397
397
  var node_5 = _$_.first_child_frag(fragment_4);
398
398
 
@@ -427,12 +427,12 @@ function AsyncWithReactiveDependency_render(__anchor, __block) {
427
427
 
428
428
  AsyncWithReactiveDependency[_$_.$r] = AsyncWithReactiveDependency_render;
429
429
 
430
- var root_28 = _$_.template(`<p class="loading">loading...</p>`, 0);
431
- var root_27 = _$_.template(`<button class="increment">increment</button><!>`, 1, 2);
430
+ var root_28 = _$_.template(`<p class=loading>loading...`);
431
+ var root_27 = _$_.template(`<button class=increment>increment</button><!>`, 1, 2);
432
432
  var root_26 = _$_.template(`<!>`, 1, 1);
433
433
 
434
434
  function AsyncWithReadOnlyDependency_render(__anchor, __block) {
435
- const count = _$_.track(0, __block, '75a97b64');
435
+ const count = _$_.track(0, __block, 'wnak4k');
436
436
  var fragment_6 = root_26();
437
437
  var node_7 = _$_.first_child_frag(fragment_6);
438
438
 
@@ -449,7 +449,7 @@ function AsyncWithReadOnlyDependency_render(__anchor, __block) {
449
449
  _$_.try(
450
450
  node_6,
451
451
  (__anchor) => {
452
- _$_.render_component(ReactiveDependencyResult, __anchor, { count: _$_.with_scope(__block, () => count.readOnly()) });
452
+ _$_.render_component(ReactiveDependencyResult, __anchor, { count: _$_.track_read_only(count, __block) });
453
453
  },
454
454
  null,
455
455
  (__anchor) => {
@@ -467,7 +467,7 @@ function AsyncWithReadOnlyDependency_render(__anchor, __block) {
467
467
 
468
468
  AsyncWithReadOnlyDependency[_$_.$r] = AsyncWithReadOnlyDependency_render;
469
469
 
470
- import { track, trackAsync } from 'ripple';
470
+ import { track, trackAsync, trackReadOnly } from 'ripple';
471
471
  import { Money } from '../fixtures/money.js';
472
472
 
473
473
  export const transport = {
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import * as _$_ from 'ripple/internal/client';
3
3
 
4
- var root = _$_.template(`<p class="root-pending">root loading...</p>`, 0);
4
+ var root = _$_.template(`<p class=root-pending>root loading...`);
5
5
 
6
6
  function RootPending_render(__anchor, __block) {
7
7
  var p = root();
@@ -11,7 +11,7 @@ function RootPending_render(__anchor, __block) {
11
11
 
12
12
  RootPending[_$_.$r] = RootPending_render;
13
13
 
14
- var root_1 = _$_.template(`<section class="root-catch"><p class="root-error"> </p><button class="root-reset">retry</button></section>`, 0);
14
+ var root_1 = _$_.template(`<section class=root-catch><p class=root-error> </p><button class=root-reset>retry`);
15
15
 
16
16
  function RootCatch_render(__anchor, __block, { error, reset }) {
17
17
  var section = root_1();
@@ -36,7 +36,7 @@ function RootCatch_render(__anchor, __block, { error, reset }) {
36
36
 
37
37
  RootCatch[_$_.$r] = RootCatch_render;
38
38
 
39
- var root_2 = _$_.template(`<p>should not render</p>`, 0);
39
+ var root_2 = _$_.template(`<p>should not render`);
40
40
 
41
41
  function RootThrows_render(__anchor, __block) {
42
42
  throw _$_.with_scope(__block, () => new Error('root exploded'));
@@ -48,10 +48,10 @@ function RootThrows_render(__anchor, __block) {
48
48
 
49
49
  RootThrows[_$_.$r] = RootThrows_render;
50
50
 
51
- var root_3 = _$_.template(`<p class="root-async-value"> </p>`, 0);
51
+ var root_3 = _$_.template(`<p class=root-async-value> `);
52
52
 
53
53
  function RootAsyncDirect_render(__anchor, __block) {
54
- const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('root async value')), __block, 'd6bf9e33');
54
+ const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('root async value')), __block, '1nl29mb');
55
55
  var p_3 = root_3();
56
56
 
57
57
  {
@@ -66,10 +66,10 @@ function RootAsyncDirect_render(__anchor, __block) {
66
66
 
67
67
  RootAsyncDirect[_$_.$r] = RootAsyncDirect_render;
68
68
 
69
- var root_4 = _$_.template(`<p class="root-async-value"> </p>`, 0);
69
+ var root_4 = _$_.template(`<p class=root-async-value> `);
70
70
 
71
71
  function RootAsyncRejects_render(__anchor, __block) {
72
- const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('root async failed'))), __block, 'd2fe7b64');
72
+ const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.reject(new Error('root async failed'))), __block, '1mjk6zo');
73
73
  var p_4 = root_4();
74
74
 
75
75
  {
@@ -84,7 +84,7 @@ function RootAsyncRejects_render(__anchor, __block) {
84
84
 
85
85
  RootAsyncRejects[_$_.$r] = RootAsyncRejects_render;
86
86
 
87
- var root_5 = _$_.template(`<p class="loading">loading...</p>`, 0);
87
+ var root_5 = _$_.template(`<p class=loading>loading...`);
88
88
 
89
89
  function AsyncListInTryPending_render(__anchor, __block) {
90
90
  _$_.try(
@@ -104,11 +104,11 @@ function AsyncListInTryPending_render(__anchor, __block) {
104
104
 
105
105
  AsyncListInTryPending[_$_.$r] = AsyncListInTryPending_render;
106
106
 
107
- var root_7 = _$_.template(`<li> </li>`, 0);
108
- var root_6 = _$_.template(`<ul class="items"></ul>`, 0);
107
+ var root_7 = _$_.template(`<li> `);
108
+ var root_6 = _$_.template(`<ul class=items>`);
109
109
 
110
110
  function AsyncList_render(__anchor, __block) {
111
- const items = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(['alpha', 'beta', 'gamma'])), __block, 'b3d31627');
111
+ const items = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve(['alpha', 'beta', 'gamma'])), __block, '1dw7tpj');
112
112
  var ul = root_6();
113
113
 
114
114
  {
@@ -138,8 +138,8 @@ function AsyncList_render(__anchor, __block) {
138
138
 
139
139
  AsyncList[_$_.$r] = AsyncList_render;
140
140
 
141
- var root_10 = _$_.template(`<div class="loading">loading async content</div>`, 0);
142
- var root_9 = _$_.template(`<div class="before">before</div><!>`, 1, 2);
141
+ var root_10 = _$_.template(`<div class=loading>loading async content`);
142
+ var root_9 = _$_.template(`<div class=before>before</div><!>`, 1, 2);
143
143
  var root_8 = _$_.template(`<!>`, 1, 1);
144
144
 
145
145
  function AsyncTryWithLeadingSibling_render(__anchor, __block) {
@@ -172,10 +172,10 @@ function AsyncTryWithLeadingSibling_render(__anchor, __block) {
172
172
 
173
173
  AsyncTryWithLeadingSibling[_$_.$r] = AsyncTryWithLeadingSibling_render;
174
174
 
175
- var root_11 = _$_.template(`<div class="resolved"> </div>`, 0);
175
+ var root_11 = _$_.template(`<div class=resolved> `);
176
176
 
177
177
  function AsyncContent_render(__anchor, __block) {
178
- const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('ready')), __block, '15ea8758');
178
+ const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('ready')), __block, '62wwns');
179
179
  var div_2 = root_11();
180
180
 
181
181
  {
@@ -1,26 +1,27 @@
1
1
  // @ts-nocheck
2
2
  import * as _$_ from 'ripple/internal/client';
3
3
 
4
- var root_1 = _$_.template(`<div class="typed-run"> <span>tail</span></div><p class="typed-number"> </p><button>update</button>`, 1, 3);
4
+ var root_1 = _$_.template(`<div class=typed-run> <span>tail</span></div><p class=typed-number></p><button>update`, 1, 3);
5
5
 
6
6
  function render(__prev) {
7
- var __a = 'value: ' + (__prev._row.value.label + String(__prev._row.value.count ?? ''));
7
+ var __a = 'value: ' + (__prev._a.value.label + String(__prev._a.value.count ?? ''));
8
8
 
9
9
  if (__prev.a !== __a) {
10
- _$_.set_text(__prev._expression, __prev.a = __a);
10
+ _$_.set_text(__prev._b, __prev.a = __a);
11
11
  }
12
12
 
13
- var __b = (0, __prev._row.value.count);
13
+ var __b = (0, __prev._a.value.count);
14
14
 
15
15
  if (__prev.b !== __b) {
16
- _$_.set_text(__prev._expression_1, __prev.b = __b);
16
+ _$_.set_text_content(__prev._c, __b, __prev.b);
17
+ __prev.b = __b;
17
18
  }
18
19
  }
19
20
 
20
21
  var root = _$_.template(`<!>`, 1, 1);
21
22
 
22
23
  function TypedText_render(__anchor, __block) {
23
- const row = _$_.track({ label: '<first>', count: 2 }, __block, '9bf2304a');
24
+ const row = _$_.track({ label: '<first>', count: 2 }, __block, '179p9ai');
24
25
  var fragment = root();
25
26
  var node = _$_.first_child_frag(fragment);
26
27
 
@@ -35,25 +36,13 @@ function TypedText_render(__anchor, __block) {
35
36
  }
36
37
 
37
38
  var p = _$_.hydrating ? _$_.hydrate_sibling() : div.nextSibling;
38
-
39
- {
40
- var expression_1 = _$_.hydrating ? _$_.hydrate_text() : p.firstChild;
41
- }
42
-
43
39
  var button = _$_.hydrating ? _$_.hydrate_sibling() : p.nextSibling;
44
40
 
45
41
  button.__click = () => {
46
42
  row.value = { label: '&next', count: 3n };
47
43
  };
48
44
 
49
- _$_.render(render, {
50
- a: ' ',
51
- b: ' ',
52
- _row: row,
53
- _expression: expression,
54
- _expression_1: expression_1
55
- });
56
-
45
+ _$_.render(render, { a: ' ', b: '', _a: row, _b: expression, _c: p });
57
46
  _$_.append(__anchor, fragment_1);
58
47
  }));
59
48
 
@@ -474,7 +474,7 @@ export function DynamicArrayFromCall() {
474
474
 
475
475
  export function DynamicArrayFromTrack() {
476
476
  return _$_.tsrx_element(() => {
477
- const items = _$_.track(['start:', ['one', 2], true, null, false, ':end'], 'b5de6402');
477
+ const items = _$_.track(['start:', ['one', 2], true, null, false, ':end'], '1egmw3m');
478
478
 
479
479
  _$_.regular_block(() => {
480
480
  let __out = '';
@@ -673,7 +673,7 @@ function TypedTextProp({ children }) {
673
673
 
674
674
  export function TextPropWithToggle() {
675
675
  return _$_.tsrx_element(() => {
676
- const show = _$_.track(false, '1ba81c3b');
676
+ const show = _$_.track(false, '7o96bf');
677
677
 
678
678
  _$_.regular_block(() => {
679
679
  let __out = '';
@@ -686,7 +686,7 @@ export function TextPropWithToggle() {
686
686
 
687
687
  const args = [
688
688
  {
689
- children: _$_.normalize_children(_$_.track(() => show.value ? 'hello' : '', '649e2af0'))
689
+ children: _$_.normalize_children(_$_.track(() => show.value ? 'hello' : '', 'rx1khc'))
690
690
  }
691
691
  ];
692
692
 
@@ -703,7 +703,7 @@ export function TextPropWithToggle() {
703
703
 
704
704
  export function TypedTextPropWithToggle() {
705
705
  return _$_.tsrx_element(() => {
706
- const show = _$_.track(false, 'ba719d47');
706
+ const show = _$_.track(false, '1fqc2fb');
707
707
 
708
708
  _$_.regular_block(() => {
709
709
  let __out = '';
@@ -716,7 +716,7 @@ export function TypedTextPropWithToggle() {
716
716
 
717
717
  const args = [
718
718
  {
719
- children: _$_.normalize_children(_$_.track(() => show.value ? 'hello' : '', '6fb091f9'))
719
+ children: _$_.normalize_children(_$_.track(() => show.value ? 'hello' : '', 'uzmy9l'))
720
720
  }
721
721
  ];
722
722
 
@@ -1067,7 +1067,7 @@ export function FragmentLeadsWithPrimitiveCall() {
1067
1067
 
1068
1068
  export function PrimitiveTextCalls() {
1069
1069
  return _$_.tsrx_element(() => {
1070
- const count = _$_.track(2, 'eea72017');
1070
+ const count = _$_.track(2, '1u7u49j');
1071
1071
 
1072
1072
  _$_.regular_block(() => {
1073
1073
  let __out = '';
@@ -5,20 +5,12 @@ import { track } from 'ripple/server';
5
5
 
6
6
  export function ClickCounter() {
7
7
  return _$_.tsrx_element(() => {
8
- const count = _$_.track(0, 'a070e3a7');
8
+ const count = _$_.track(0, '18illt3');
9
9
 
10
10
  _$_.regular_block(() => {
11
11
  let __out = '';
12
12
 
13
- __out += '<div><button class="increment">Increment</button><span class="count">';
14
-
15
- {
16
- _$_.output_push(__out);
17
- __out = '';
18
- _$_.render_expression(count.value);
19
- }
20
-
21
- __out += '</span></div>';
13
+ __out += '<div><button class="increment">Increment</button><span class="count">' + _$_.escape(count.value) + '</span></div>';
22
14
  _$_.output_push(__out);
23
15
  });
24
16
  });
@@ -26,20 +18,12 @@ export function ClickCounter() {
26
18
 
27
19
  export function IncrementDecrement() {
28
20
  return _$_.tsrx_element(() => {
29
- const count = _$_.track(0, '87fcabdd');
21
+ const count = _$_.track(0, '11qc3q5');
30
22
 
31
23
  _$_.regular_block(() => {
32
24
  let __out = '';
33
25
 
34
- __out += '<div><button class="decrement">-</button><span class="count">';
35
-
36
- {
37
- _$_.output_push(__out);
38
- __out = '';
39
- _$_.render_expression(count.value);
40
- }
41
-
42
- __out += '</span><button class="increment">+</button></div>';
26
+ __out += '<div><button class="decrement">-</button><span class="count">' + _$_.escape(count.value) + '</span><button class="increment">+</button></div>';
43
27
  _$_.output_push(__out);
44
28
  });
45
29
  });
@@ -47,29 +31,13 @@ export function IncrementDecrement() {
47
31
 
48
32
  export function MultipleEvents() {
49
33
  return _$_.tsrx_element(() => {
50
- const clicks = _$_.track(0, '41b9f0b0');
51
- const hovers = _$_.track(0, '72789f75');
34
+ const clicks = _$_.track(0, 'i8ishc');
35
+ const hovers = _$_.track(0, 'vrf59x');
52
36
 
53
37
  _$_.regular_block(() => {
54
38
  let __out = '';
55
39
 
56
- __out += '<div><button class="target">Target</button><span class="clicks">';
57
-
58
- {
59
- _$_.output_push(__out);
60
- __out = '';
61
- _$_.render_expression(clicks.value);
62
- }
63
-
64
- __out += '</span><span class="hovers">';
65
-
66
- {
67
- _$_.output_push(__out);
68
- __out = '';
69
- _$_.render_expression(hovers.value);
70
- }
71
-
72
- __out += '</span></div>';
40
+ __out += '<div><button class="target">Target</button><span class="clicks">' + _$_.escape(clicks.value) + '</span><span class="hovers">' + _$_.escape(hovers.value) + '</span></div>';
73
41
  _$_.output_push(__out);
74
42
  });
75
43
  });
@@ -77,8 +45,8 @@ export function MultipleEvents() {
77
45
 
78
46
  export function MultiStateUpdate() {
79
47
  return _$_.tsrx_element(() => {
80
- const count = _$_.track(0, '5a375160');
81
- const lastAction = _$_.track('none', '3ceeb88c');
48
+ const count = _$_.track(0, 'p155r4');
49
+ const lastAction = _$_.track('none', 'gwmyks');
82
50
 
83
51
  const handleClick = () => {
84
52
  count.value++;
@@ -88,15 +56,7 @@ export function MultiStateUpdate() {
88
56
  _$_.regular_block(() => {
89
57
  let __out = '';
90
58
 
91
- __out += '<div><button class="btn">Click</button><span class="count">';
92
-
93
- {
94
- _$_.output_push(__out);
95
- __out = '';
96
- _$_.render_expression(count.value);
97
- }
98
-
99
- __out += '</span><span class="action">';
59
+ __out += '<div><button class="btn">Click</button><span class="count">' + _$_.escape(count.value) + '</span><span class="action">';
100
60
 
101
61
  {
102
62
  _$_.output_push(__out);
@@ -112,7 +72,7 @@ export function MultiStateUpdate() {
112
72
 
113
73
  export function ToggleButton() {
114
74
  return _$_.tsrx_element(() => {
115
- const isOn = _$_.track(false, 'be823ec7');
75
+ const isOn = _$_.track(false, '1guxsxz');
116
76
 
117
77
  _$_.regular_block(() => {
118
78
  let __out = '';
@@ -136,7 +96,7 @@ export function ChildButton(props) {
136
96
 
137
97
  export function ParentWithChildButton() {
138
98
  return _$_.tsrx_element(() => {
139
- const count = _$_.track(0, 'dcc2e0f9');
99
+ const count = _$_.track(0, '1p94et5');
140
100
 
141
101
  _$_.regular_block(() => {
142
102
  let __out = '';
@@ -160,15 +120,7 @@ export function ParentWithChildButton() {
160
120
  _$_.render_component(comp, ...args);
161
121
  }
162
122
 
163
- __out += '<span class="count">';
164
-
165
- {
166
- _$_.output_push(__out);
167
- __out = '';
168
- _$_.render_expression(count.value);
169
- }
170
-
171
- __out += '</span></div>';
123
+ __out += '<span class="count">' + _$_.escape(count.value) + '</span></div>';
172
124
  _$_.output_push(__out);
173
125
  });
174
126
  });