ripple 0.3.127 → 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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +2 -2
  3. package/src/runtime/internal/client/blocks.js +20 -24
  4. package/src/runtime/internal/client/constants.js +5 -5
  5. package/src/runtime/internal/client/expression.js +142 -101
  6. package/src/runtime/internal/client/for.js +217 -145
  7. package/src/runtime/internal/client/index.js +5 -1
  8. package/src/runtime/internal/client/operations.js +24 -10
  9. package/src/runtime/internal/client/render.js +22 -3
  10. package/src/runtime/internal/client/runtime.js +246 -182
  11. package/src/runtime/internal/client/selector.js +74 -0
  12. package/src/runtime/internal/client/types.d.ts +11 -0
  13. package/src/runtime/internal/server/index.js +2 -0
  14. package/tests/client/basic/basic.reactivity.test.tsrx +33 -0
  15. package/tests/client/for-selector.test.tsrx +221 -0
  16. package/tests/hydration/compiled/client/basic.js +44 -44
  17. package/tests/hydration/compiled/client/composite.js +3 -3
  18. package/tests/hydration/compiled/client/events.js +56 -29
  19. package/tests/hydration/compiled/client/for.js +76 -70
  20. package/tests/hydration/compiled/client/head.js +11 -8
  21. package/tests/hydration/compiled/client/hmr.js +4 -4
  22. package/tests/hydration/compiled/client/html-in-template.js +3 -3
  23. package/tests/hydration/compiled/client/html.js +141 -141
  24. package/tests/hydration/compiled/client/if-children.js +29 -29
  25. package/tests/hydration/compiled/client/if-fragment-controlflow.js +16 -16
  26. package/tests/hydration/compiled/client/if.js +10 -10
  27. package/tests/hydration/compiled/client/mixed-control-flow.js +26 -22
  28. package/tests/hydration/compiled/client/nested-control-flow.js +114 -92
  29. package/tests/hydration/compiled/client/portal.js +8 -8
  30. package/tests/hydration/compiled/client/reactivity.js +38 -15
  31. package/tests/hydration/compiled/client/streaming.js +16 -16
  32. package/tests/hydration/compiled/client/switch.js +4 -4
  33. package/tests/hydration/compiled/client/track-async-serialization.js +18 -18
  34. package/tests/hydration/compiled/client/try.js +8 -8
  35. package/tests/hydration/compiled/server/events.js +5 -53
  36. package/tests/hydration/compiled/server/for.js +2 -18
  37. package/tests/hydration/compiled/server/head.js +1 -9
  38. package/tests/hydration/compiled/server/html.js +1 -9
  39. package/tests/hydration/compiled/server/reactivity.js +2 -34
@@ -16,9 +16,16 @@ export type Component = {
16
16
  };
17
17
 
18
18
  export type Dependency = {
19
+ // clock of the tracked value when it was read
19
20
  c: number;
20
21
  t: Tracked | Derived;
22
+ // next dependency of the same reaction
21
23
  n: null | Dependency;
24
+ // the reaction that read the tracked value
25
+ r: Block | Derived;
26
+ // previous / next subscriber of the same tracked value
27
+ sp: null | Dependency;
28
+ sn: null | Dependency;
22
29
  };
23
30
 
24
31
  export type DeferredTrackedEntry = {
@@ -36,6 +43,8 @@ export type Block = {
36
43
  first: null | Block;
37
44
  f: number;
38
45
  fn: any;
46
+ // creation id; flushes run scheduled blocks in this order
47
+ i: number;
39
48
  last: null | Block;
40
49
  next: null | Block;
41
50
  p: null | Block;
@@ -100,6 +109,8 @@ declare global {
100
109
  value?: string;
101
110
  };
102
111
  __click?: () => void;
112
+ // last class value applied by set_class; null once removed
113
+ __className?: string | null;
103
114
  __ripple_block?: Block;
104
115
  }
105
116
 
@@ -1623,6 +1623,8 @@ export function attr(name, value, is_boolean = false) {
1623
1623
  ? get_styles(value)
1624
1624
  : String(normalized).trim()
1625
1625
  : value_to_escape;
1626
+ // An empty class attribute is omitted, matching the client.
1627
+ if (name === 'class' && value_to_escape === '') return '';
1626
1628
  const assignment = is_boolean ? '' : `="${escape(value_to_escape, true)}"`;
1627
1629
  return ` ${name}${assignment}`;
1628
1630
  }
@@ -367,6 +367,39 @@ describe('basic client > reactivity', () => {
367
367
  expect(state.finalValue).toBe(5);
368
368
  });
369
369
 
370
+ it('keeps other subscribers after a destroyed block writes shared state in its cleanup', () => {
371
+ function App() @{
372
+ let &[count] = track(0);
373
+ let &[show] = track(true);
374
+ <>
375
+ @if (show) {
376
+ effect(() => {
377
+ count;
378
+ return () => {
379
+ count = count + 1;
380
+ };
381
+ });
382
+ <span class="inner">{count}</span>
383
+ }
384
+ <span class="outer">{count}</span>
385
+ <button class="hide" onClick={() => (show = false)}>{'hide'}</button>
386
+ <button class="inc" onClick={() => (count = count + 1)}>{'inc'}</button>
387
+ </>
388
+ }
389
+
390
+ render(App);
391
+ flushSync();
392
+ expect(container.querySelector('.outer').textContent).toBe('0');
393
+
394
+ container.querySelector('.hide').click();
395
+ flushSync();
396
+ expect(container.querySelector('.outer').textContent).toBe('1');
397
+
398
+ container.querySelector('.inc').click();
399
+ flushSync();
400
+ expect(container.querySelector('.outer').textContent).toBe('2');
401
+ });
402
+
370
403
  it('returns the same tracked object if plain track is called with a tracked object', () => {
371
404
  function App() @{
372
405
  const t = track({ a: 1, b: 2, c: 3 });
@@ -0,0 +1,221 @@
1
+ import { flushSync, track, type Tracked } from 'ripple';
2
+
3
+ interface Row {
4
+ id: number;
5
+ group: string;
6
+ label: Tracked<string>;
7
+ }
8
+
9
+ type RowSpec = [id: number, group?: string];
10
+
11
+ interface Actions {
12
+ select(id: number | undefined): void;
13
+ setItems(rows: RowSpec[]): void;
14
+ setGroup(group: string | undefined): void;
15
+ relabel(index: number, label: string): void;
16
+ }
17
+
18
+ function selected_ids(): number[] {
19
+ return Array.from(container.querySelectorAll('li.selected')).map(
20
+ (el) => Number(el.getAttribute('data-id')),
21
+ );
22
+ }
23
+
24
+ function matched_ids(): string[] {
25
+ return Array.from(container.querySelectorAll('[data-group="match"]')).map(
26
+ (el) => el.getAttribute('data-id') ?? '',
27
+ );
28
+ }
29
+
30
+ function texts(): string[] {
31
+ return Array.from(container.querySelectorAll('li')).map((el) => el.textContent ?? '');
32
+ }
33
+
34
+ describe('@for selector comparisons', () => {
35
+ let actions: Actions;
36
+
37
+ function App() @{
38
+ const row = (id: number, group = 'a'): Row => ({ id, group, label: track(`row ${id}`) });
39
+
40
+ let &[items] = track<Row[]>([row(1), row(2), row(3)]);
41
+ let &[selected] = track<number | undefined>(undefined);
42
+ let &[group] = track<string | undefined>(undefined);
43
+
44
+ actions = {
45
+ select: (id) => {
46
+ selected = id;
47
+ },
48
+ setItems: (specs) => {
49
+ items = specs.map(([id, group]) => row(id, group));
50
+ },
51
+ setGroup: (next) => {
52
+ group = next;
53
+ },
54
+ relabel: (index, label) => {
55
+ items[index].label.value = label;
56
+ },
57
+ };
58
+
59
+ <ul>
60
+ @for (const item of items; key item.id) {
61
+ <li
62
+ data-id={item.id}
63
+ class={selected === item.id ? 'selected' : ''}
64
+ data-group={group === item.group ? 'match' : ''}
65
+ >
66
+ {selected !== item.id ? item.label.value : 'current'}
67
+ </li>
68
+ }
69
+ </ul>
70
+ }
71
+
72
+ it('moves the selection between rows', () => {
73
+ render(App);
74
+ expect(selected_ids()).toEqual([]);
75
+
76
+ actions.select(2);
77
+ flushSync();
78
+ expect(selected_ids()).toEqual([2]);
79
+ expect(texts()).toEqual(['row 1', 'current', 'row 3']);
80
+
81
+ actions.select(3);
82
+ flushSync();
83
+ expect(selected_ids()).toEqual([3]);
84
+ expect(texts()).toEqual(['row 1', 'row 2', 'current']);
85
+
86
+ actions.select(undefined);
87
+ flushSync();
88
+ expect(selected_ids()).toEqual([]);
89
+ expect(texts()).toEqual(['row 1', 'row 2', 'row 3']);
90
+ });
91
+
92
+ it('matches rows created after the selection was set', () => {
93
+ render(App);
94
+
95
+ actions.select(5);
96
+ flushSync();
97
+ expect(selected_ids()).toEqual([]);
98
+
99
+ actions.setItems([[1], [5]]);
100
+ flushSync();
101
+ expect(selected_ids()).toEqual([5]);
102
+
103
+ actions.setItems([[1]]);
104
+ flushSync();
105
+ expect(selected_ids()).toEqual([]);
106
+
107
+ actions.setItems([[1], [5]]);
108
+ flushSync();
109
+ expect(selected_ids()).toEqual([5]);
110
+ });
111
+
112
+ it('re-registers a row whose compared value changes', () => {
113
+ render(App);
114
+
115
+ actions.setItems([
116
+ [1, 'a'],
117
+ [2, 'b'],
118
+ ]);
119
+ actions.setGroup('b');
120
+ flushSync();
121
+ expect(matched_ids()).toEqual(['2']);
122
+
123
+ // Same keys, so the existing rows update in place with new groups.
124
+ actions.setItems([
125
+ [1, 'b'],
126
+ [2, 'a'],
127
+ ]);
128
+ flushSync();
129
+ expect(matched_ids()).toEqual(['1']);
130
+
131
+ actions.setGroup('a');
132
+ flushSync();
133
+ expect(matched_ids()).toEqual(['2']);
134
+ });
135
+
136
+ it('updates every row sharing the compared value', () => {
137
+ render(App);
138
+
139
+ actions.setItems([
140
+ [1, 'a'],
141
+ [2, 'b'],
142
+ [3, 'a'],
143
+ ]);
144
+ actions.setGroup('a');
145
+ flushSync();
146
+ expect(matched_ids()).toEqual(['1', '3']);
147
+
148
+ actions.setGroup('b');
149
+ flushSync();
150
+ expect(matched_ids()).toEqual(['2']);
151
+
152
+ actions.setGroup(undefined);
153
+ flushSync();
154
+ expect(matched_ids()).toEqual([]);
155
+ });
156
+
157
+ it('keeps the rest of the row expression reactive', () => {
158
+ render(App);
159
+
160
+ actions.select(1);
161
+ flushSync();
162
+ expect(texts()).toEqual(['current', 'row 2', 'row 3']);
163
+
164
+ actions.relabel(1, 'second');
165
+ flushSync();
166
+ expect(texts()).toEqual(['current', 'second', 'row 3']);
167
+ expect(selected_ids()).toEqual([1]);
168
+
169
+ actions.select(2);
170
+ flushSync();
171
+ expect(texts()).toEqual(['row 1', 'current', 'row 3']);
172
+ });
173
+ });
174
+
175
+ describe('keyed reconciliation with most items moving', () => {
176
+ it('keeps node identity and order when a large list is shuffled', () => {
177
+ let apply: (order: number[]) => void = () => {};
178
+
179
+ function App() @{
180
+ let &[items] = track(Array.from({ length: 300 }, (_, i) => i));
181
+ apply = (order) => {
182
+ items = order;
183
+ };
184
+ <ul>
185
+ @for (const item of items; key item) {
186
+ <li data-id={item}>{item}</li>
187
+ }
188
+ </ul>
189
+ }
190
+
191
+ render(App);
192
+ const before = new Map(Array.from(
193
+ container.querySelectorAll('li'),
194
+ (el) => [el.getAttribute('data-id'), el],
195
+ ));
196
+
197
+ // A permutation that moves nearly every item, plus a few new ones.
198
+ let seed = 7;
199
+ const next = () => (seed = (seed * 48271) % 2147483647) / 2147483647;
200
+ const order = Array.from({ length: 300 }, (_, i) => i);
201
+ for (let i = order.length - 1; i > 0; i--) {
202
+ const j = Math.floor(next() * (i + 1));
203
+ [order[i], order[j]] = [order[j], order[i]];
204
+ }
205
+ order.splice(10, 0, 1000);
206
+ order.splice(200, 0, 1001);
207
+
208
+ apply(order);
209
+ flushSync();
210
+
211
+ const after = Array.from(container.querySelectorAll('li'));
212
+ expect(after.map((el) => Number(el.getAttribute('data-id')))).toEqual(order);
213
+ for (const el of after) {
214
+ const id = el.getAttribute('data-id');
215
+ if (before.has(id)) {
216
+ expect(el).toBe(before.get(id));
217
+ }
218
+ }
219
+ expect(after.map((el) => el.textContent)).toEqual(order.map(String));
220
+ });
221
+ });
@@ -181,7 +181,7 @@ export function SiblingComponents() {
181
181
 
182
182
  _$_.render_component(FirstSibling, node_2, {});
183
183
 
184
- var node_3 = _$_.sibling(node_2);
184
+ var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : node_2.nextSibling;
185
185
 
186
186
  _$_.render_component(SecondSibling, node_3, {});
187
187
  _$_.append(__anchor, fragment_5);
@@ -196,7 +196,7 @@ export function Greeting(props) {
196
196
  var div_5 = root_12();
197
197
 
198
198
  {
199
- var expression = _$_.child(div_5, true);
199
+ var expression = _$_.hydrating ? _$_.hydrate_child(true) : div_5.firstChild;
200
200
 
201
201
  _$_.pop(div_5);
202
202
  }
@@ -227,16 +227,16 @@ export function ExpressionContent() {
227
227
  var div_6 = _$_.first_child_frag(fragment_7);
228
228
 
229
229
  {
230
- var expression_1 = _$_.child(div_6, true);
230
+ var expression_1 = _$_.hydrating ? _$_.hydrate_child(true) : div_6.firstChild;
231
231
 
232
232
  expression_1.nodeValue = value;
233
233
  _$_.pop(div_6);
234
234
  }
235
235
 
236
- var span_1 = _$_.sibling(div_6);
236
+ var span_1 = _$_.hydrating ? _$_.hydrate_sibling() : div_6.nextSibling;
237
237
 
238
238
  {
239
- var expression_2 = _$_.child(span_1);
239
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : span_1.firstChild;
240
240
 
241
241
  _$_.expression(expression_2, () => _$_.with_scope(__block, () => label.toUpperCase()));
242
242
  _$_.pop(span_1);
@@ -255,7 +255,7 @@ function NestedHelperItem({ item }) {
255
255
  var div_7 = root_15();
256
256
 
257
257
  {
258
- var expression_3 = _$_.child(div_7, true);
258
+ var expression_3 = _$_.hydrating ? _$_.hydrate_child(true) : div_7.firstChild;
259
259
 
260
260
  expression_3.nodeValue = item;
261
261
  _$_.pop(div_7);
@@ -275,13 +275,13 @@ function NestedTsxTsrxFragment({ label }) {
275
275
  var span_2 = _$_.first_child_frag(fragment_9);
276
276
 
277
277
  {
278
- var expression_4 = _$_.child(span_2, true);
278
+ var expression_4 = _$_.hydrating ? _$_.hydrate_child(true) : span_2.firstChild;
279
279
 
280
280
  expression_4.nodeValue = label;
281
281
  _$_.pop(span_2);
282
282
  }
283
283
 
284
- var node_6 = _$_.sibling(span_2);
284
+ var node_6 = _$_.hydrating ? _$_.hydrate_sibling() : span_2.nextSibling;
285
285
 
286
286
  _$_.for(
287
287
  node_6,
@@ -304,7 +304,7 @@ export function NestedTsxTsrxExpressionValues() {
304
304
  var div_8 = root_18();
305
305
 
306
306
  {
307
- var node_8 = _$_.child(div_8);
307
+ var node_8 = _$_.hydrating ? _$_.hydrate_child() : div_8.firstChild;
308
308
 
309
309
  _$_.for(
310
310
  node_8,
@@ -313,7 +313,7 @@ export function NestedTsxTsrxExpressionValues() {
313
313
  var div_9 = root_19();
314
314
 
315
315
  {
316
- var expression_5 = _$_.child(div_9);
316
+ var expression_5 = _$_.hydrating ? _$_.hydrate_child() : div_9.firstChild;
317
317
 
318
318
  _$_.expression(expression_5, () => item);
319
319
  _$_.pop(div_9);
@@ -324,7 +324,7 @@ export function NestedTsxTsrxExpressionValues() {
324
324
  0
325
325
  );
326
326
 
327
- var node_9 = _$_.sibling(node_8);
327
+ var node_9 = _$_.hydrating ? _$_.hydrate_sibling() : node_8.nextSibling;
328
328
 
329
329
  _$_.render_component(NestedTsxTsrxFragment, node_9, { label: "from helper" });
330
330
  _$_.pop(div_8);
@@ -365,7 +365,7 @@ export function MixedTsrxCollectionText() {
365
365
  var div_10 = root_23();
366
366
 
367
367
  {
368
- var expression_7 = _$_.child(div_10);
368
+ var expression_7 = _$_.hydrating ? _$_.hydrate_child() : div_10.firstChild;
369
369
 
370
370
  _$_.expression(expression_7, () => content);
371
371
  _$_.pop(div_10);
@@ -406,7 +406,7 @@ export function MixedTsrxCollectionSplitServerText() {
406
406
  var div_11 = root_27();
407
407
 
408
408
  {
409
- var expression_9 = _$_.child(div_11);
409
+ var expression_9 = _$_.hydrating ? _$_.hydrate_child() : div_11.firstChild;
410
410
 
411
411
  _$_.expression(expression_9, () => content);
412
412
  _$_.pop(div_11);
@@ -447,7 +447,7 @@ export function MixedTsrxCollectionSplitClientText() {
447
447
  var div_12 = root_31();
448
448
 
449
449
  {
450
- var expression_11 = _$_.child(div_12);
450
+ var expression_11 = _$_.hydrating ? _$_.hydrate_child() : div_12.firstChild;
451
451
 
452
452
  _$_.expression(expression_11, () => content);
453
453
  _$_.pop(div_12);
@@ -481,7 +481,7 @@ export function MixedTsrxCollectionPrimitiveServerText() {
481
481
  var div_13 = root_34();
482
482
 
483
483
  {
484
- var expression_13 = _$_.child(div_13);
484
+ var expression_13 = _$_.hydrating ? _$_.hydrate_child() : div_13.firstChild;
485
485
 
486
486
  _$_.expression(expression_13, () => content);
487
487
  _$_.pop(div_13);
@@ -515,7 +515,7 @@ export function MixedTsrxCollectionPrimitiveClientText() {
515
515
  var div_14 = root_37();
516
516
 
517
517
  {
518
- var expression_15 = _$_.child(div_14);
518
+ var expression_15 = _$_.hydrating ? _$_.hydrate_child() : div_14.firstChild;
519
519
 
520
520
  _$_.expression(expression_15, () => content);
521
521
  _$_.pop(div_14);
@@ -535,7 +535,7 @@ export function DynamicArrayFromCall() {
535
535
  var div_15 = root_38();
536
536
 
537
537
  {
538
- var expression_16 = _$_.child(div_15);
538
+ var expression_16 = _$_.hydrating ? _$_.hydrate_child() : div_15.firstChild;
539
539
 
540
540
  _$_.expression(expression_16, () => items);
541
541
  _$_.pop(div_15);
@@ -551,7 +551,7 @@ export function DynamicArrayFromTrack() {
551
551
  var div_16 = root_39();
552
552
 
553
553
  {
554
- var expression_17 = _$_.child(div_16);
554
+ var expression_17 = _$_.hydrating ? _$_.hydrate_child() : div_16.firstChild;
555
555
 
556
556
  _$_.expression(expression_17, () => lazy.value);
557
557
  _$_.pop(div_16);
@@ -572,7 +572,7 @@ export function DynamicArrayFromConditional() {
572
572
  var div_17 = root_40();
573
573
 
574
574
  {
575
- var expression_18 = _$_.child(div_17);
575
+ var expression_18 = _$_.hydrating ? _$_.hydrate_child() : div_17.firstChild;
576
576
 
577
577
  _$_.expression(expression_18, () => items);
578
578
  _$_.pop(div_17);
@@ -589,7 +589,7 @@ export function DynamicArrayFromLogical() {
589
589
  var div_18 = root_41();
590
590
 
591
591
  {
592
- var expression_19 = _$_.child(div_18);
592
+ var expression_19 = _$_.hydrating ? _$_.hydrate_child() : div_18.firstChild;
593
593
 
594
594
  _$_.expression(expression_19, () => items);
595
595
  _$_.pop(div_18);
@@ -657,7 +657,7 @@ export function TsxDeclaredBeforeTopLevelTsx() {
657
657
  var div_20 = root_49();
658
658
 
659
659
  {
660
- var expression_22 = _$_.child(div_20);
660
+ var expression_22 = _$_.hydrating ? _$_.hydrate_child() : div_20.firstChild;
661
661
 
662
662
  _$_.expression(expression_22, () => nested);
663
663
  _$_.pop(div_20);
@@ -686,7 +686,7 @@ function TextProp(__props) {
686
686
  var div_21 = root_52();
687
687
 
688
688
  {
689
- var expression_24 = _$_.child(div_21);
689
+ var expression_24 = _$_.hydrating ? _$_.hydrate_child() : div_21.firstChild;
690
690
 
691
691
  _$_.expression(expression_24, () => __props.children);
692
692
  _$_.pop(div_21);
@@ -712,7 +712,7 @@ export function TextPropWithToggle() {
712
712
  }
713
713
  });
714
714
 
715
- var button = _$_.sibling(node_13);
715
+ var button = _$_.hydrating ? _$_.hydrate_sibling() : node_13.nextSibling;
716
716
 
717
717
  button.__click = () => _$_.set(lazy_1, true);
718
718
  _$_.append(__anchor, fragment_22);
@@ -750,19 +750,19 @@ export function StaticChildWithSiblings() {
750
750
 
751
751
  _$_.render_component(StaticHeader, node_16, {});
752
752
 
753
- var span_6 = _$_.sibling(node_16);
753
+ var span_6 = _$_.hydrating ? _$_.hydrate_sibling() : node_16.nextSibling;
754
754
 
755
755
  {
756
- var expression_25 = _$_.child(span_6, true);
756
+ var expression_25 = _$_.hydrating ? _$_.hydrate_child(true) : span_6.firstChild;
757
757
 
758
758
  expression_25.nodeValue = foo;
759
759
  _$_.pop(span_6);
760
760
  }
761
761
 
762
- var span_7 = _$_.sibling(span_6);
762
+ var span_7 = _$_.hydrating ? _$_.hydrate_sibling() : span_6.nextSibling;
763
763
 
764
764
  {
765
- var expression_26 = _$_.child(span_7, true);
765
+ var expression_26 = _$_.hydrating ? _$_.hydrate_child(true) : span_7.firstChild;
766
766
 
767
767
  expression_26.nodeValue = foo;
768
768
  _$_.pop(span_7);
@@ -797,9 +797,9 @@ function Actions({ playgroundVisible = false }) {
797
797
  var div_22 = root_61();
798
798
 
799
799
  {
800
- var a_2 = _$_.child(div_22);
801
- var a_1 = _$_.sibling(a_2);
802
- var expression_27 = _$_.sibling(a_1);
800
+ var a_2 = _$_.hydrating ? _$_.hydrate_child() : div_22.firstChild;
801
+ var a_1 = _$_.hydrating ? _$_.hydrate_sibling() : a_2.nextSibling;
802
+ var expression_27 = _$_.hydrating ? _$_.hydrate_sibling() : a_1.nextSibling;
803
803
 
804
804
  _$_.expression(expression_27, () => playgroundVisible
805
805
  ? _$_.tsrx_element((__anchor, __block) => {
@@ -821,10 +821,10 @@ function Layout({ children }) {
821
821
  var main = root_63();
822
822
 
823
823
  {
824
- var div_23 = _$_.child(main);
824
+ var div_23 = _$_.hydrating ? _$_.hydrate_child() : main.firstChild;
825
825
 
826
826
  {
827
- var expression_28 = _$_.child(div_23);
827
+ var expression_28 = _$_.hydrating ? _$_.hydrate_child() : div_23.firstChild;
828
828
 
829
829
  _$_.expression(expression_28, () => children);
830
830
  _$_.pop(div_23);
@@ -852,15 +852,15 @@ export function WebsiteIndex() {
852
852
 
853
853
  _$_.render_component(Header, node_19, {});
854
854
 
855
- var node_20 = _$_.sibling(node_19);
855
+ var node_20 = _$_.hydrating ? _$_.hydrate_sibling() : node_19.nextSibling;
856
856
 
857
857
  _$_.render_component(Actions, node_20, { playgroundVisible: true });
858
858
 
859
- var node_21 = _$_.sibling(node_20);
859
+ var node_21 = _$_.hydrating ? _$_.hydrate_sibling() : node_20.nextSibling;
860
860
 
861
861
  _$_.render_component(Content, node_21, {});
862
862
 
863
- var node_22 = _$_.sibling(node_21);
863
+ var node_22 = _$_.hydrating ? _$_.hydrate_sibling() : node_21.nextSibling;
864
864
 
865
865
  _$_.render_component(Actions, node_22, { playgroundVisible: false });
866
866
  _$_.append(__anchor, fragment_29);
@@ -882,9 +882,9 @@ export function ComponentAsLastSibling() {
882
882
  var div_25 = root_67();
883
883
 
884
884
  {
885
- var h1 = _$_.child(div_25);
886
- var p = _$_.sibling(h1);
887
- var node_23 = _$_.sibling(p);
885
+ var h1 = _$_.hydrating ? _$_.hydrate_child() : div_25.firstChild;
886
+ var p = _$_.hydrating ? _$_.hydrate_sibling() : h1.nextSibling;
887
+ var node_23 = _$_.hydrating ? _$_.hydrate_sibling() : p.nextSibling;
888
888
 
889
889
  _$_.render_component(LastChild, node_23, {});
890
890
  _$_.pop(div_25);
@@ -899,8 +899,8 @@ function InnerContent() {
899
899
  var div_26 = root_68();
900
900
 
901
901
  {
902
- var span_8 = _$_.child(div_26);
903
- var node_24 = _$_.sibling(span_8);
902
+ var span_8 = _$_.hydrating ? _$_.hydrate_child() : div_26.firstChild;
903
+ var node_24 = _$_.hydrating ? _$_.hydrate_sibling() : span_8.nextSibling;
904
904
 
905
905
  _$_.render_component(LastChild, node_24, {});
906
906
  _$_.pop(div_26);
@@ -915,8 +915,8 @@ export function NestedComponentAsLastSibling() {
915
915
  var section_1 = root_69();
916
916
 
917
917
  {
918
- var h2 = _$_.child(section_1);
919
- var node_25 = _$_.sibling(h2);
918
+ var h2 = _$_.hydrating ? _$_.hydrate_child() : section_1.firstChild;
919
+ var node_25 = _$_.hydrating ? _$_.hydrate_sibling() : h2.nextSibling;
920
920
 
921
921
  _$_.render_component(InnerContent, node_25, {});
922
922
  _$_.pop(section_1);
@@ -935,7 +935,7 @@ export function TextTailExpression() {
935
935
  var div_27 = root_70();
936
936
 
937
937
  {
938
- var text = _$_.child(div_27, true);
938
+ var text = _$_.hydrating ? _$_.hydrate_child(true) : div_27.firstChild;
939
939
 
940
940
  _$_.pop(div_27);
941
941
  }
@@ -953,7 +953,7 @@ export function FragmentTailExpression() {
953
953
  var div_28 = root_71();
954
954
 
955
955
  {
956
- var expression_29 = _$_.child(div_28, true);
956
+ var expression_29 = _$_.hydrating ? _$_.hydrate_child(true) : div_28.firstChild;
957
957
 
958
958
  _$_.pop(div_28);
959
959
  }
@@ -15,7 +15,7 @@ export function Layout(__props) {
15
15
  var div = root();
16
16
 
17
17
  {
18
- var expression = _$_.child(div);
18
+ var expression = _$_.hydrating ? _$_.hydrate_child() : div.firstChild;
19
19
 
20
20
  _$_.expression(expression, () => __props.children);
21
21
  _$_.pop(div);
@@ -30,8 +30,8 @@ export function TextWrappedLayout(__props) {
30
30
  var div_1 = root_1();
31
31
 
32
32
  {
33
- var expression_2 = _$_.child(div_1);
34
- var expression_1 = _$_.sibling(expression_2);
33
+ var expression_2 = _$_.hydrating ? _$_.hydrate_child() : div_1.firstChild;
34
+ var expression_1 = _$_.hydrating ? _$_.hydrate_sibling() : expression_2.nextSibling;
35
35
 
36
36
  _$_.expression(expression_1, () => __props.children);
37
37
  _$_.pop(div_1);