ripple 0.3.126 → 0.3.128

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 (41) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/package.json +2 -2
  3. package/src/jsx-runtime.d.ts +1128 -967
  4. package/src/runtime/internal/client/blocks.js +20 -24
  5. package/src/runtime/internal/client/constants.js +5 -5
  6. package/src/runtime/internal/client/expression.js +142 -101
  7. package/src/runtime/internal/client/for.js +217 -145
  8. package/src/runtime/internal/client/index.js +5 -1
  9. package/src/runtime/internal/client/operations.js +24 -10
  10. package/src/runtime/internal/client/render.js +22 -3
  11. package/src/runtime/internal/client/runtime.js +246 -182
  12. package/src/runtime/internal/client/selector.js +74 -0
  13. package/src/runtime/internal/client/types.d.ts +11 -0
  14. package/src/runtime/internal/server/index.js +2 -0
  15. package/tests/client/basic/basic.reactivity.test.tsrx +33 -0
  16. package/tests/client/for-selector.test.tsrx +221 -0
  17. package/tests/hydration/compiled/client/basic.js +44 -44
  18. package/tests/hydration/compiled/client/composite.js +3 -3
  19. package/tests/hydration/compiled/client/events.js +56 -29
  20. package/tests/hydration/compiled/client/for.js +76 -70
  21. package/tests/hydration/compiled/client/head.js +11 -8
  22. package/tests/hydration/compiled/client/hmr.js +4 -4
  23. package/tests/hydration/compiled/client/html-in-template.js +3 -3
  24. package/tests/hydration/compiled/client/html.js +141 -141
  25. package/tests/hydration/compiled/client/if-children.js +29 -29
  26. package/tests/hydration/compiled/client/if-fragment-controlflow.js +16 -16
  27. package/tests/hydration/compiled/client/if.js +10 -10
  28. package/tests/hydration/compiled/client/mixed-control-flow.js +26 -22
  29. package/tests/hydration/compiled/client/nested-control-flow.js +114 -92
  30. package/tests/hydration/compiled/client/portal.js +8 -8
  31. package/tests/hydration/compiled/client/reactivity.js +38 -15
  32. package/tests/hydration/compiled/client/streaming.js +16 -16
  33. package/tests/hydration/compiled/client/switch.js +4 -4
  34. package/tests/hydration/compiled/client/track-async-serialization.js +18 -18
  35. package/tests/hydration/compiled/client/try.js +8 -8
  36. package/tests/hydration/compiled/server/events.js +5 -53
  37. package/tests/hydration/compiled/server/for.js +2 -18
  38. package/tests/hydration/compiled/server/head.js +1 -9
  39. package/tests/hydration/compiled/server/html.js +1 -9
  40. package/tests/hydration/compiled/server/reactivity.js +2 -34
  41. package/tests/utils/jsx-runtime-types.test.js +106 -0
@@ -17,8 +17,8 @@ export function SimplePortal() {
17
17
  var div = root();
18
18
 
19
19
  {
20
- var h1 = _$_.child(div);
21
- var node = _$_.sibling(h1);
20
+ var h1 = _$_.hydrating ? _$_.hydrate_child() : div.firstChild;
21
+ var node = _$_.hydrating ? _$_.hydrate_sibling() : h1.nextSibling;
22
22
 
23
23
  _$_.render_component(Portal, node, {
24
24
  get target() {
@@ -45,11 +45,11 @@ export function ConditionalPortal() {
45
45
  var div_2 = root_2();
46
46
 
47
47
  {
48
- var button = _$_.child(div_2);
48
+ var button = _$_.hydrating ? _$_.hydrate_child() : div_2.firstChild;
49
49
 
50
50
  button.__click = () => _$_.set(lazy, !lazy.value);
51
51
 
52
- var node_1 = _$_.sibling(button);
52
+ var node_1 = _$_.hydrating ? _$_.hydrate_sibling() : button.nextSibling;
53
53
 
54
54
  {
55
55
  var consequent = (__anchor) => {
@@ -83,8 +83,8 @@ export function PortalWithMainContent() {
83
83
  var div_4 = root_4();
84
84
 
85
85
  {
86
- var div_5 = _$_.child(div_4);
87
- var node_2 = _$_.sibling(div_5);
86
+ var div_5 = _$_.hydrating ? _$_.hydrate_child() : div_4.firstChild;
87
+ var node_2 = _$_.hydrating ? _$_.hydrate_sibling() : div_5.nextSibling;
88
88
 
89
89
  _$_.render_component(Portal, node_2, {
90
90
  get target() {
@@ -110,11 +110,11 @@ export function NestedContentWithPortal() {
110
110
  var div_7 = root_6();
111
111
 
112
112
  {
113
- var div_8 = _$_.child(div_7);
113
+ var div_8 = _$_.hydrating ? _$_.hydrate_child() : div_7.firstChild;
114
114
 
115
115
  _$_.pop(div_8);
116
116
 
117
- var node_3 = _$_.sibling(div_8);
117
+ var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : div_8.nextSibling;
118
118
 
119
119
  _$_.render_component(Portal, node_3, {
120
120
  get target() {
@@ -15,12 +15,15 @@ export function TrackedState() {
15
15
  var div = root();
16
16
 
17
17
  {
18
- var expression = _$_.child(div);
18
+ var expression = _$_.hydrating ? _$_.hydrate_child(true) : div.firstChild;
19
19
 
20
- _$_.expression(expression, () => lazy.value);
21
20
  _$_.pop(div);
22
21
  }
23
22
 
23
+ _$_.render(() => {
24
+ _$_.set_text(expression, lazy.value);
25
+ });
26
+
24
27
  _$_.append(__anchor, div);
25
28
  });
26
29
  }
@@ -31,10 +34,10 @@ export function CounterWithInitial(props) {
31
34
  var div_1 = root_1();
32
35
 
33
36
  {
34
- var span = _$_.child(div_1);
37
+ var span = _$_.hydrating ? _$_.hydrate_child() : div_1.firstChild;
35
38
 
36
39
  {
37
- var expression_1 = _$_.child(span);
40
+ var expression_1 = _$_.hydrating ? _$_.hydrate_child() : span.firstChild;
38
41
 
39
42
  _$_.expression(expression_1, () => lazy_1.value);
40
43
  _$_.pop(span);
@@ -59,7 +62,7 @@ export function ComputedValues() {
59
62
  var div_2 = root_2();
60
63
 
61
64
  {
62
- var expression_2 = _$_.child(div_2);
65
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : div_2.firstChild;
63
66
 
64
67
  _$_.expression(expression_2, sum);
65
68
  _$_.pop(div_2);
@@ -77,34 +80,54 @@ export function MultipleTracked() {
77
80
  var div_3 = root_3();
78
81
 
79
82
  {
80
- var div_4 = _$_.child(div_3);
83
+ var div_4 = _$_.hydrating ? _$_.hydrate_child() : div_3.firstChild;
81
84
 
82
85
  {
83
- var expression_3 = _$_.child(div_4);
86
+ var expression_3 = _$_.hydrating ? _$_.hydrate_child(true) : div_4.firstChild;
84
87
 
85
- _$_.expression(expression_3, () => lazy_4.value);
86
88
  _$_.pop(div_4);
87
89
  }
88
90
 
89
- var div_5 = _$_.sibling(div_4);
91
+ var div_5 = _$_.hydrating ? _$_.hydrate_sibling() : div_4.nextSibling;
90
92
 
91
93
  {
92
- var expression_4 = _$_.child(div_5);
94
+ var expression_4 = _$_.hydrating ? _$_.hydrate_child(true) : div_5.firstChild;
93
95
 
94
- _$_.expression(expression_4, () => lazy_5.value);
95
96
  _$_.pop(div_5);
96
97
  }
97
98
 
98
- var div_6 = _$_.sibling(div_5);
99
+ var div_6 = _$_.hydrating ? _$_.hydrate_sibling() : div_5.nextSibling;
99
100
 
100
101
  {
101
- var expression_5 = _$_.child(div_6);
102
+ var expression_5 = _$_.hydrating ? _$_.hydrate_child(true) : div_6.firstChild;
102
103
 
103
- _$_.expression(expression_5, () => lazy_6.value);
104
104
  _$_.pop(div_6);
105
105
  }
106
106
  }
107
107
 
108
+ _$_.render(
109
+ (__prev) => {
110
+ var __a = lazy_4.value;
111
+
112
+ if (__prev.a !== __a) {
113
+ _$_.set_text(expression_3, __prev.a = __a);
114
+ }
115
+
116
+ var __b = lazy_5.value;
117
+
118
+ if (__prev.b !== __b) {
119
+ _$_.set_text(expression_4, __prev.b = __b);
120
+ }
121
+
122
+ var __c = lazy_6.value;
123
+
124
+ if (__prev.c !== __c) {
125
+ _$_.set_text(expression_5, __prev.c = __c);
126
+ }
127
+ },
128
+ { a: ' ', b: ' ', c: ' ' }
129
+ );
130
+
108
131
  _$_.append(__anchor, div_3);
109
132
  });
110
133
  }
@@ -117,7 +140,7 @@ export function DerivedState() {
117
140
  var div_7 = root_4();
118
141
 
119
142
  {
120
- var expression_6 = _$_.child(div_7);
143
+ var expression_6 = _$_.hydrating ? _$_.hydrate_child() : div_7.firstChild;
121
144
 
122
145
  _$_.expression(expression_6, fullName);
123
146
  _$_.pop(div_7);
@@ -65,15 +65,15 @@ function BasicContent() {
65
65
  var div = root();
66
66
 
67
67
  {
68
- var span = _$_.child(div);
68
+ var span = _$_.hydrating ? _$_.hydrate_child() : div.firstChild;
69
69
 
70
70
  {
71
- var expression = _$_.child(span, true);
71
+ var expression = _$_.hydrating ? _$_.hydrate_child(true) : span.firstChild;
72
72
 
73
73
  _$_.pop(span);
74
74
  }
75
75
 
76
- var button = _$_.sibling(span);
76
+ var button = _$_.hydrating ? _$_.hydrate_sibling() : span.nextSibling;
77
77
 
78
78
  button.__click = () => _$_.update(lazy_1);
79
79
  }
@@ -94,7 +94,7 @@ export function StreamPending() {
94
94
  _$_.expression(node_2, () => _$_.tsrx_element((__anchor, __block) => {
95
95
  var fragment_1 = root_2();
96
96
  var span_1 = _$_.first_child_frag(fragment_1);
97
- var node = _$_.sibling(span_1);
97
+ var node = _$_.hydrating ? _$_.hydrate_sibling() : span_1.nextSibling;
98
98
 
99
99
  _$_.try(
100
100
  node,
@@ -126,7 +126,7 @@ function CatchOnlyContent() {
126
126
  var p_1 = root_5();
127
127
 
128
128
  {
129
- var expression_1 = _$_.child(p_1);
129
+ var expression_1 = _$_.hydrating ? _$_.hydrate_child() : p_1.firstChild;
130
130
 
131
131
  _$_.expression(expression_1, () => lazy_2.value);
132
132
  _$_.pop(p_1);
@@ -144,7 +144,7 @@ export function StreamCatchOnly() {
144
144
  _$_.expression(node_4, () => _$_.tsrx_element((__anchor, __block) => {
145
145
  var fragment_4 = root_7();
146
146
  var span_2 = _$_.first_child_frag(fragment_4);
147
- var node_3 = _$_.sibling(span_2);
147
+ var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : span_2.nextSibling;
148
148
 
149
149
  _$_.try(
150
150
  node_3,
@@ -155,7 +155,7 @@ export function StreamCatchOnly() {
155
155
  var em = root_8();
156
156
 
157
157
  {
158
- var expression_2 = _$_.child(em);
158
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : em.firstChild;
159
159
 
160
160
  _$_.expression(expression_2, () => e.message);
161
161
  _$_.pop(em);
@@ -178,7 +178,7 @@ function RejectContent() {
178
178
  var p_2 = root_9();
179
179
 
180
180
  {
181
- var expression_3 = _$_.child(p_2);
181
+ var expression_3 = _$_.hydrating ? _$_.hydrate_child() : p_2.firstChild;
182
182
 
183
183
  _$_.expression(expression_3, () => lazy_3.value);
184
184
  _$_.pop(p_2);
@@ -199,7 +199,7 @@ export function StreamRejects() {
199
199
  var em_1 = root_10();
200
200
 
201
201
  {
202
- var expression_4 = _$_.child(em_1);
202
+ var expression_4 = _$_.hydrating ? _$_.hydrate_child() : em_1.firstChild;
203
203
 
204
204
  _$_.expression(expression_4, () => e.message);
205
205
  _$_.pop(em_1);
@@ -223,7 +223,7 @@ function NoCatchContent() {
223
223
  var p_4 = root_12();
224
224
 
225
225
  {
226
- var expression_5 = _$_.child(p_4);
226
+ var expression_5 = _$_.hydrating ? _$_.hydrate_child() : p_4.firstChild;
227
227
 
228
228
  _$_.expression(expression_5, () => lazy_4.value);
229
229
  _$_.pop(p_4);
@@ -258,7 +258,7 @@ export function RootCatch({ error, reset }) {
258
258
  _$_.event('Click', section, reset);
259
259
 
260
260
  {
261
- var expression_6 = _$_.child(section);
261
+ var expression_6 = _$_.hydrating ? _$_.hydrate_child() : section.firstChild;
262
262
 
263
263
  _$_.expression(expression_6, () => error.message);
264
264
  _$_.pop(section);
@@ -288,7 +288,7 @@ function HeadContent() {
288
288
  var p_7 = root_17();
289
289
 
290
290
  {
291
- var expression_7 = _$_.child(p_7);
291
+ var expression_7 = _$_.hydrating ? _$_.hydrate_child() : p_7.firstChild;
292
292
 
293
293
  _$_.expression(expression_7, () => lazy_5.value);
294
294
  _$_.pop(p_7);
@@ -341,7 +341,7 @@ export function StreamRootDirect() {
341
341
  var p_9 = root_19();
342
342
 
343
343
  {
344
- var expression_8 = _$_.child(p_9);
344
+ var expression_8 = _$_.hydrating ? _$_.hydrate_child() : p_9.firstChild;
345
345
 
346
346
  _$_.expression(expression_8, () => lazy_6.value);
347
347
  _$_.pop(p_9);
@@ -357,7 +357,7 @@ function OuterContent() {
357
357
  var p_10 = root_20();
358
358
 
359
359
  {
360
- var expression_9 = _$_.child(p_10);
360
+ var expression_9 = _$_.hydrating ? _$_.hydrate_child() : p_10.firstChild;
361
361
 
362
362
  _$_.expression(expression_9, () => lazy_7.value);
363
363
  _$_.pop(p_10);
@@ -373,7 +373,7 @@ function InnerContent() {
373
373
  var p_11 = root_21();
374
374
 
375
375
  {
376
- var expression_10 = _$_.child(p_11);
376
+ var expression_10 = _$_.hydrating ? _$_.hydrate_child() : p_11.firstChild;
377
377
 
378
378
  _$_.expression(expression_10, () => lazy_8.value);
379
379
  _$_.pop(p_11);
@@ -393,7 +393,7 @@ export function StreamNested() {
393
393
 
394
394
  _$_.render_component(OuterContent, node_6, {});
395
395
 
396
- var node_7 = _$_.sibling(node_6);
396
+ var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : node_6.nextSibling;
397
397
 
398
398
  _$_.try(
399
399
  node_7,
@@ -91,7 +91,7 @@ export function SwitchReactive() {
91
91
  if (lazy.value === 'a') _$_.set(lazy, 'b'); else if (lazy.value === 'b') _$_.set(lazy, 'c'); else _$_.set(lazy, 'a');
92
92
  };
93
93
 
94
- var node = _$_.sibling(button);
94
+ var node = _$_.hydrating ? _$_.hydrate_sibling() : button.nextSibling;
95
95
 
96
96
  {
97
97
  var switch_case_0_1 = (__anchor) => {
@@ -193,7 +193,7 @@ export function SwitchNumericLevels() {
193
193
  if (lazy_1.value === 1) _$_.set(lazy_1, 2); else if (lazy_1.value === 2) _$_.set(lazy_1, 3); else _$_.set(lazy_1, 1);
194
194
  };
195
195
 
196
- var node_2 = _$_.sibling(button_1);
196
+ var node_2 = _$_.hydrating ? _$_.hydrate_sibling() : button_1.nextSibling;
197
197
 
198
198
  {
199
199
  var switch_case_0_3 = (__anchor) => {
@@ -254,7 +254,7 @@ export function SwitchBlockScoped() {
254
254
  if (lazy_2.value === 1) _$_.set(lazy_2, 2); else if (lazy_2.value === 2) _$_.set(lazy_2, 3); else _$_.set(lazy_2, 1);
255
255
  };
256
256
 
257
- var node_4 = _$_.sibling(button_2);
257
+ var node_4 = _$_.hydrating ? _$_.hydrate_sibling() : button_2.nextSibling;
258
258
 
259
259
  {
260
260
  var switch_case_0_4 = (__anchor) => {
@@ -315,7 +315,7 @@ export function SwitchNoBreak() {
315
315
  if (lazy_3.value === 1) _$_.set(lazy_3, 2); else if (lazy_3.value === 2) _$_.set(lazy_3, 3); else _$_.set(lazy_3, 1);
316
316
  };
317
317
 
318
- var node_6 = _$_.sibling(button_3);
318
+ var node_6 = _$_.hydrating ? _$_.hydrate_sibling() : button_3.nextSibling;
319
319
 
320
320
  {
321
321
  var switch_case_0_5 = (__anchor) => {
@@ -36,7 +36,7 @@ function ServerCallResult({ count }) {
36
36
  var p = root();
37
37
 
38
38
  {
39
- var expression = _$_.child(p);
39
+ var expression = _$_.hydrating ? _$_.hydrate_child() : p.firstChild;
40
40
 
41
41
  _$_.expression(expression, () => lazy.value);
42
42
  _$_.pop(p);
@@ -60,7 +60,7 @@ export function AsyncWithServerCall() {
60
60
  _$_.update(lazy_1);
61
61
  };
62
62
 
63
- var node = _$_.sibling(button);
63
+ var node = _$_.hydrating ? _$_.hydrate_sibling() : button.nextSibling;
64
64
 
65
65
  _$_.try(
66
66
  node,
@@ -95,7 +95,7 @@ export function AsyncSimpleValue() {
95
95
  var p_2 = root_4();
96
96
 
97
97
  {
98
- var expression_1 = _$_.child(p_2);
98
+ var expression_1 = _$_.hydrating ? _$_.hydrate_child() : p_2.firstChild;
99
99
 
100
100
  _$_.expression(expression_1, () => lazy_2.value);
101
101
  _$_.pop(p_2);
@@ -123,7 +123,7 @@ export function AsyncNumericValue() {
123
123
  var span = root_6();
124
124
 
125
125
  {
126
- var expression_2 = _$_.child(span);
126
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : span.firstChild;
127
127
 
128
128
  _$_.expression(expression_2, () => lazy_3.value);
129
129
  _$_.pop(span);
@@ -151,19 +151,19 @@ export function AsyncObjectValue() {
151
151
  var div = root_8();
152
152
 
153
153
  {
154
- var span_2 = _$_.child(div);
154
+ var span_2 = _$_.hydrating ? _$_.hydrate_child() : div.firstChild;
155
155
 
156
156
  {
157
- var expression_3 = _$_.child(span_2);
157
+ var expression_3 = _$_.hydrating ? _$_.hydrate_child() : span_2.firstChild;
158
158
 
159
159
  _$_.expression(expression_3, () => lazy_4.value.name);
160
160
  _$_.pop(span_2);
161
161
  }
162
162
 
163
- var span_3 = _$_.sibling(span_2);
163
+ var span_3 = _$_.hydrating ? _$_.hydrate_sibling() : span_2.nextSibling;
164
164
 
165
165
  {
166
- var expression_4 = _$_.child(span_3);
166
+ var expression_4 = _$_.hydrating ? _$_.hydrate_child() : span_3.firstChild;
167
167
 
168
168
  _$_.expression(expression_4, () => lazy_4.value.age);
169
169
  _$_.pop(span_3);
@@ -193,19 +193,19 @@ export function AsyncMultipleValues() {
193
193
  var div_2 = root_10();
194
194
 
195
195
  {
196
- var span_4 = _$_.child(div_2);
196
+ var span_4 = _$_.hydrating ? _$_.hydrate_child() : div_2.firstChild;
197
197
 
198
198
  {
199
- var expression_5 = _$_.child(span_4);
199
+ var expression_5 = _$_.hydrating ? _$_.hydrate_child() : span_4.firstChild;
200
200
 
201
201
  _$_.expression(expression_5, () => lazy_5.value);
202
202
  _$_.pop(span_4);
203
203
  }
204
204
 
205
- var span_5 = _$_.sibling(span_4);
205
+ var span_5 = _$_.hydrating ? _$_.hydrate_sibling() : span_4.nextSibling;
206
206
 
207
207
  {
208
- var expression_6 = _$_.child(span_5);
208
+ var expression_6 = _$_.hydrating ? _$_.hydrate_child() : span_5.firstChild;
209
209
 
210
210
  _$_.expression(expression_6, () => lazy_6.value);
211
211
  _$_.pop(span_5);
@@ -234,7 +234,7 @@ export function AsyncWithCatch() {
234
234
  var p_4 = root_12();
235
235
 
236
236
  {
237
- var expression_7 = _$_.child(p_4);
237
+ var expression_7 = _$_.hydrating ? _$_.hydrate_child() : p_4.firstChild;
238
238
 
239
239
  _$_.expression(expression_7, () => lazy_7.value);
240
240
  _$_.pop(p_4);
@@ -246,7 +246,7 @@ export function AsyncWithCatch() {
246
246
  var p_5 = root_13();
247
247
 
248
248
  {
249
- var expression_8 = _$_.child(p_5);
249
+ var expression_8 = _$_.hydrating ? _$_.hydrate_child() : p_5.firstChild;
250
250
 
251
251
  _$_.expression(expression_8, () => e.message);
252
252
  _$_.pop(p_5);
@@ -273,7 +273,7 @@ export function ChildWithError() {
273
273
  var p_7 = root_15();
274
274
 
275
275
  {
276
- var expression_9 = _$_.child(p_7);
276
+ var expression_9 = _$_.hydrating ? _$_.hydrate_child() : p_7.firstChild;
277
277
 
278
278
  _$_.expression(expression_9, () => lazy_8.value);
279
279
  _$_.pop(p_7);
@@ -303,7 +303,7 @@ export function ParentWithCatch() {
303
303
  var p_9 = root_17();
304
304
 
305
305
  {
306
- var expression_10 = _$_.child(p_9);
306
+ var expression_10 = _$_.hydrating ? _$_.hydrate_child() : p_9.firstChild;
307
307
 
308
308
  _$_.expression(expression_10, () => e.message);
309
309
  _$_.pop(p_9);
@@ -323,7 +323,7 @@ function ReactiveDependencyResult({ count }) {
323
323
  var p_10 = root_18();
324
324
 
325
325
  {
326
- var expression_11 = _$_.child(p_10);
326
+ var expression_11 = _$_.hydrating ? _$_.hydrate_child() : p_10.firstChild;
327
327
 
328
328
  _$_.expression(expression_11, () => lazy_9.value);
329
329
  _$_.pop(p_10);
@@ -347,7 +347,7 @@ export function AsyncWithReactiveDependency() {
347
347
  _$_.update(lazy_10);
348
348
  };
349
349
 
350
- var node_2 = _$_.sibling(button_1);
350
+ var node_2 = _$_.hydrating ? _$_.hydrate_sibling() : button_1.nextSibling;
351
351
 
352
352
  _$_.try(
353
353
  node_2,
@@ -29,16 +29,16 @@ export function RootCatch({ error, reset }) {
29
29
  var section = root_1();
30
30
 
31
31
  {
32
- var p_1 = _$_.child(section);
32
+ var p_1 = _$_.hydrating ? _$_.hydrate_child() : section.firstChild;
33
33
 
34
34
  {
35
- var expression = _$_.child(p_1);
35
+ var expression = _$_.hydrating ? _$_.hydrate_child() : p_1.firstChild;
36
36
 
37
37
  _$_.expression(expression, () => error.message);
38
38
  _$_.pop(p_1);
39
39
  }
40
40
 
41
- var button = _$_.sibling(p_1);
41
+ var button = _$_.hydrating ? _$_.hydrate_sibling() : p_1.nextSibling;
42
42
 
43
43
  _$_.event('Click', button, reset);
44
44
  }
@@ -63,7 +63,7 @@ export function RootAsyncDirect() {
63
63
  var p_2 = root_3();
64
64
 
65
65
  {
66
- var expression_1 = _$_.child(p_2);
66
+ var expression_1 = _$_.hydrating ? _$_.hydrate_child() : p_2.firstChild;
67
67
 
68
68
  _$_.expression(expression_1, () => lazy.value);
69
69
  _$_.pop(p_2);
@@ -79,7 +79,7 @@ export function RootAsyncRejects() {
79
79
  var p_3 = root_4();
80
80
 
81
81
  {
82
- var expression_2 = _$_.child(p_3);
82
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : p_3.firstChild;
83
83
 
84
84
  _$_.expression(expression_2, () => lazy_1.value);
85
85
  _$_.pop(p_3);
@@ -120,7 +120,7 @@ function AsyncList() {
120
120
  var li = root_7();
121
121
 
122
122
  {
123
- var expression_3 = _$_.child(li);
123
+ var expression_3 = _$_.hydrating ? _$_.hydrate_child() : li.firstChild;
124
124
 
125
125
  _$_.expression(expression_3, () => item);
126
126
  _$_.pop(li);
@@ -146,7 +146,7 @@ export function AsyncTryWithLeadingSibling() {
146
146
  _$_.expression(node_1, () => _$_.tsrx_element((__anchor, __block) => {
147
147
  var fragment_2 = root_9();
148
148
  var div = _$_.first_child_frag(fragment_2);
149
- var node = _$_.sibling(div);
149
+ var node = _$_.hydrating ? _$_.hydrate_sibling() : div.nextSibling;
150
150
 
151
151
  _$_.try(
152
152
  node,
@@ -174,7 +174,7 @@ function AsyncContent() {
174
174
  var div_2 = root_11();
175
175
 
176
176
  {
177
- var expression_4 = _$_.child(div_2);
177
+ var expression_4 = _$_.hydrating ? _$_.hydrate_child() : div_2.firstChild;
178
178
 
179
179
  _$_.expression(expression_4, () => lazy_3.value);
180
180
  _$_.pop(div_2);
@@ -10,15 +10,7 @@ export function ClickCounter() {
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(lazy.value);
19
- }
20
-
21
- __out += '</span></div>';
13
+ __out += '<div><button class="increment">Increment</button><span class="count">' + _$_.escape(lazy.value) + '</span></div>';
22
14
  _$_.output_push(__out);
23
15
  });
24
16
  });
@@ -31,15 +23,7 @@ export function IncrementDecrement() {
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(lazy_1.value);
40
- }
41
-
42
- __out += '</span><button class="increment">+</button></div>';
26
+ __out += '<div><button class="decrement">-</button><span class="count">' + _$_.escape(lazy_1.value) + '</span><button class="increment">+</button></div>';
43
27
  _$_.output_push(__out);
44
28
  });
45
29
  });
@@ -53,23 +37,7 @@ export function MultipleEvents() {
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(lazy_2.value);
62
- }
63
-
64
- __out += '</span><span class="hovers">';
65
-
66
- {
67
- _$_.output_push(__out);
68
- __out = '';
69
- _$_.render_expression(lazy_3.value);
70
- }
71
-
72
- __out += '</span></div>';
40
+ __out += '<div><button class="target">Target</button><span class="clicks">' + _$_.escape(lazy_2.value) + '</span><span class="hovers">' + _$_.escape(lazy_3.value) + '</span></div>';
73
41
  _$_.output_push(__out);
74
42
  });
75
43
  });
@@ -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(lazy_4.value);
97
- }
98
-
99
- __out += '</span><span class="action">';
59
+ __out += '<div><button class="btn">Click</button><span class="count">' + _$_.escape(lazy_4.value) + '</span><span class="action">';
100
60
 
101
61
  {
102
62
  _$_.output_push(__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(lazy_7.value);
169
- }
170
-
171
- __out += '</span></div>';
123
+ __out += '<span class="count">' + _$_.escape(lazy_7.value) + '</span></div>';
172
124
  _$_.output_push(__out);
173
125
  });
174
126
  });
@@ -240,15 +240,7 @@ export function EmptyForLoop() {
240
240
  __out += '<div class="container"><!--[-->';
241
241
 
242
242
  for (const item of items) {
243
- __out += '<span>';
244
-
245
- {
246
- _$_.output_push(__out);
247
- __out = '';
248
- _$_.render_expression(item);
249
- }
250
-
251
- __out += '</span>';
243
+ __out += '<span>' + _$_.escape(item) + '</span>';
252
244
  }
253
245
 
254
246
  __out += '<!--]--></div>';
@@ -427,15 +419,7 @@ export function ForLoopEmptyToPopulated() {
427
419
  __out += '<button class="populate">Populate</button><ul class="list"><!--[-->';
428
420
 
429
421
  for (const item of lazy_8.value) {
430
- __out += '<li>';
431
-
432
- {
433
- _$_.output_push(__out);
434
- __out = '';
435
- _$_.render_expression(item);
436
- }
437
-
438
- __out += '</li>';
422
+ __out += '<li>' + _$_.escape(item) + '</li>';
439
423
  }
440
424
 
441
425
  __out += '<!--]--></ul>';
@@ -178,15 +178,7 @@ export function ComputedTitle() {
178
178
  _$_.regular_block(() => {
179
179
  let __out = '';
180
180
 
181
- __out += '<div><span>';
182
-
183
- {
184
- _$_.output_push(__out);
185
- __out = '';
186
- _$_.render_expression(lazy_5.value);
187
- }
188
-
189
- __out += '</span></div>';
181
+ __out += '<div><span>' + _$_.escape(lazy_5.value) + '</span></div>';
190
182
  _$_.output_push(__out);
191
183
  __out = '';
192
184
  _$_.set_output_target('head');
@@ -711,15 +711,7 @@ function ForList({ items }) {
711
711
  __out += '<!--[-->';
712
712
 
713
713
  for (const item of items) {
714
- __out += '<span class="for-item">';
715
-
716
- {
717
- _$_.output_push(__out);
718
- __out = '';
719
- _$_.render_expression(item);
720
- }
721
-
722
- __out += '</span>';
714
+ __out += '<span class="for-item">' + _$_.escape(item) + '</span>';
723
715
  }
724
716
 
725
717
  __out += '<!--]-->';