ripple 0.4.2 → 0.4.4
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.
- package/CHANGELOG.md +164 -0
- package/package.json +10 -4
- package/src/constants.js +6 -0
- package/src/jsx-runtime.d.ts +2 -1
- package/src/runtime/array.js +15 -9
- package/src/runtime/index-client.js +25 -7
- package/src/runtime/index-server.js +1 -0
- package/src/runtime/internal/client/attributes.js +439 -0
- package/src/runtime/internal/client/blocks.js +20 -20
- package/src/runtime/internal/client/component.js +2 -5
- package/src/runtime/internal/client/composite.js +295 -95
- package/src/runtime/internal/client/constants.js +14 -6
- package/src/runtime/internal/client/context.js +3 -2
- package/src/runtime/internal/client/css.js +11 -26
- package/src/runtime/internal/client/errors.js +188 -0
- package/src/runtime/internal/client/events.js +79 -34
- package/src/runtime/internal/client/expression.js +25 -120
- package/src/runtime/internal/client/for.js +113 -262
- package/src/runtime/internal/client/head.js +4 -3
- package/src/runtime/internal/client/html.js +5 -3
- package/src/runtime/internal/client/hydrate.js +484 -0
- package/src/runtime/internal/client/hydration-enabled.js +7 -0
- package/src/runtime/internal/client/hydration.js +16 -81
- package/src/runtime/internal/client/if.js +69 -10
- package/src/runtime/internal/client/index.js +18 -10
- package/src/runtime/internal/client/operations.js +11 -7
- package/src/runtime/internal/client/portal.js +3 -2
- package/src/runtime/internal/client/render.js +42 -325
- package/src/runtime/internal/client/root-boundary-enabled.js +7 -0
- package/src/runtime/internal/client/runtime.js +157 -371
- package/src/runtime/internal/client/template-ns.js +88 -0
- package/src/runtime/internal/client/template.js +118 -139
- package/src/runtime/internal/client/track-async.js +356 -0
- package/src/runtime/internal/client/try.js +133 -319
- package/src/runtime/internal/client/types.d.ts +48 -24
- package/src/runtime/internal/server/index.js +31 -29
- package/src/runtime/internal/server/prerender.js +27 -0
- package/src/server/index.js +1 -0
- package/src/utils/class-name.js +28 -0
- package/tests/client/basic/basic.errors.test.tsrx +3 -3
- package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +0 -2
- package/tests/client/compiler/compiler.basic.test.tsrx +2 -2
- package/tests/client/compiler/compiler.tracked-access.test.tsrx +3 -3
- package/tests/client/composite/composite.dynamic-components.test.tsrx +40 -0
- package/tests/client/composite/composite.props.test.tsrx +10 -10
- package/tests/client/css/scoped-styles.test.tsrx +3 -1
- package/tests/client/derived-release.test.tsrx +3 -3
- package/tests/client/for-item.test.tsrx +39 -0
- package/tests/client/for-selector.test.tsrx +95 -0
- package/tests/client/svg.test.tsrx +273 -1
- package/tests/hydration/compiled/client/basic.js +88 -87
- package/tests/hydration/compiled/client/composite.js +15 -6
- package/tests/hydration/compiled/client/events.js +40 -48
- package/tests/hydration/compiled/client/for.js +191 -199
- package/tests/hydration/compiled/client/fragment-cursor.js +633 -334
- package/tests/hydration/compiled/client/head.js +22 -22
- package/tests/hydration/compiled/client/hmr.js +14 -5
- package/tests/hydration/compiled/client/html-in-template.js +5 -5
- package/tests/hydration/compiled/client/html.js +195 -177
- package/tests/hydration/compiled/client/if-children.js +136 -63
- package/tests/hydration/compiled/client/if-fragment-controlflow.js +63 -43
- package/tests/hydration/compiled/client/if.js +78 -30
- package/tests/hydration/compiled/client/mixed-control-flow.js +90 -72
- package/tests/hydration/compiled/client/nested-control-flow.js +266 -307
- package/tests/hydration/compiled/client/portal.js +20 -11
- package/tests/hydration/compiled/client/reactivity.js +29 -29
- package/tests/hydration/compiled/client/return.js +2 -2
- package/tests/hydration/compiled/client/streaming.js +33 -35
- package/tests/hydration/compiled/client/switch.js +25 -25
- package/tests/hydration/compiled/client/track-async-serialization.js +41 -41
- package/tests/hydration/compiled/client/try.js +15 -15
- package/tests/hydration/compiled/client/typed-text.js +8 -7
- package/tests/hydration/compiled/server/basic.js +6 -6
- package/tests/hydration/compiled/server/events.js +8 -8
- package/tests/hydration/compiled/server/for.js +22 -22
- package/tests/hydration/compiled/server/fragment-cursor.js +188 -52
- package/tests/hydration/compiled/server/head.js +6 -6
- package/tests/hydration/compiled/server/hmr.js +1 -1
- package/tests/hydration/compiled/server/html.js +1 -1
- package/tests/hydration/compiled/server/if-children.js +9 -9
- package/tests/hydration/compiled/server/if.js +5 -5
- package/tests/hydration/compiled/server/mixed-control-flow.js +4 -4
- package/tests/hydration/compiled/server/portal.js +1 -1
- package/tests/hydration/compiled/server/reactivity.js +9 -9
- package/tests/hydration/compiled/server/streaming.js +9 -9
- package/tests/hydration/compiled/server/switch.js +4 -4
- package/tests/hydration/compiled/server/track-async-serialization.js +16 -16
- package/tests/hydration/compiled/server/try.js +4 -4
- package/tests/hydration/compiled/server/typed-text.js +1 -1
- package/tests/hydration/components/fragment-cursor.tsrx +60 -0
- package/tests/hydration/components/track-async-serialization.tsrx +2 -2
- package/tests/hydration/fragment-cursor.test.js +34 -1
- package/tests/hydration/track-async-serialization.test.js +1 -1
- package/tests/server/basic.components.test.tsrx +3 -3
- package/tests/server/track-async-serialization.test.tsrx +6 -6
- package/tests/utils/tracked-types.test.js +3 -3
- package/types/index.d.ts +8 -8
- 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_2 = _$_.
|
|
5
|
-
var root_1 = _$_.template(`<!><span class=
|
|
4
|
+
var root_2 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
5
|
+
var root_1 = _$_.template(`<!><span class=after>after`, 1, 2);
|
|
6
6
|
|
|
7
|
-
function consequent(__anchor, { hasLoaded, muzes }) {
|
|
7
|
+
function consequent(__anchor, { a: hasLoaded, b: muzes }) {
|
|
8
8
|
var fragment = root_1();
|
|
9
9
|
var node_1 = _$_.first_child_frag(fragment);
|
|
10
10
|
|
|
@@ -31,11 +31,11 @@ function consequent(__anchor, { hasLoaded, muzes }) {
|
|
|
31
31
|
_$_.append(__anchor, fragment);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function if_1({ hasLoaded, muzes }) {
|
|
34
|
+
function if_1({ a: hasLoaded, b: muzes }) {
|
|
35
35
|
if (hasLoaded) return consequent;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
var root = _$_.template(`<div class=
|
|
38
|
+
var root = _$_.template(`<div class=feed-c><!>`);
|
|
39
39
|
|
|
40
40
|
function IfFragmentForElement_render(__anchor, __block) {
|
|
41
41
|
const muzes = [{ muzeId: 'b' }, { muzeId: 'c' }];
|
|
@@ -45,7 +45,7 @@ function IfFragmentForElement_render(__anchor, __block) {
|
|
|
45
45
|
{
|
|
46
46
|
var node = _$_.hydrating ? _$_.hydrate_child() : div.firstChild;
|
|
47
47
|
|
|
48
|
-
_$_.if(node, if_1, false, { hasLoaded, muzes });
|
|
48
|
+
_$_.if(node, if_1, false, { a: hasLoaded, b: muzes });
|
|
49
49
|
_$_.hydrating && _$_.pop(div);
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -54,8 +54,8 @@ function IfFragmentForElement_render(__anchor, __block) {
|
|
|
54
54
|
|
|
55
55
|
IfFragmentForElement[_$_.$r] = IfFragmentForElement_render;
|
|
56
56
|
|
|
57
|
-
var root_5 = _$_.
|
|
58
|
-
var root_6 = _$_.
|
|
57
|
+
var root_5 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
58
|
+
var root_6 = _$_.template_el('span', ['class', 'has-items'], 'has items');
|
|
59
59
|
|
|
60
60
|
function consequent_1(__anchor, muzes) {
|
|
61
61
|
var span = root_6();
|
|
@@ -67,7 +67,7 @@ function if_2(muzes) {
|
|
|
67
67
|
if (muzes.length > 0) return consequent_1;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
var root_7 = _$_.
|
|
70
|
+
var root_7 = _$_.template_el('span', ['class', 'empty'], 'empty');
|
|
71
71
|
|
|
72
72
|
function consequent_2(__anchor, muzes) {
|
|
73
73
|
var span_1 = root_7();
|
|
@@ -81,7 +81,21 @@ function if_3(muzes) {
|
|
|
81
81
|
|
|
82
82
|
var root_4 = _$_.template(`<!><!><!>`, 1, 3);
|
|
83
83
|
|
|
84
|
-
function
|
|
84
|
+
function render(__prev) {
|
|
85
|
+
var __a = if_2(__prev._a);
|
|
86
|
+
|
|
87
|
+
if (__prev.a !== __a) {
|
|
88
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var __b = if_3(__prev._a);
|
|
92
|
+
|
|
93
|
+
if (__prev.b !== __b) {
|
|
94
|
+
_$_.if_update(__prev._c, __prev.b = __b);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function consequent_3(__anchor, { a: hasLoaded, b: muzes }) {
|
|
85
99
|
var fragment_1 = root_4();
|
|
86
100
|
var node_3 = _$_.first_child_frag(fragment_1);
|
|
87
101
|
|
|
@@ -105,20 +119,26 @@ function consequent_3(__anchor, { hasLoaded, muzes }) {
|
|
|
105
119
|
);
|
|
106
120
|
|
|
107
121
|
var node_4 = _$_.hydrating ? _$_.hydrate_sibling() : node_3.nextSibling;
|
|
108
|
-
|
|
109
|
-
_$_.if(node_4, if_2, false, muzes);
|
|
110
|
-
|
|
122
|
+
var ifs = _$_.if_static(node_4, if_2, 0, muzes);
|
|
111
123
|
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() : node_4.nextSibling;
|
|
124
|
+
var ifs_1 = _$_.if_static(node_5, if_3, 0, muzes);
|
|
125
|
+
|
|
126
|
+
_$_.render(render, {
|
|
127
|
+
a: _$_.UNINITIALIZED,
|
|
128
|
+
b: _$_.UNINITIALIZED,
|
|
129
|
+
_a: muzes,
|
|
130
|
+
_b: ifs,
|
|
131
|
+
_c: ifs_1
|
|
132
|
+
});
|
|
112
133
|
|
|
113
|
-
_$_.if(node_5, if_3, false, muzes);
|
|
114
134
|
_$_.append(__anchor, fragment_1);
|
|
115
135
|
}
|
|
116
136
|
|
|
117
|
-
function if_4({ hasLoaded, muzes }) {
|
|
137
|
+
function if_4({ a: hasLoaded, b: muzes }) {
|
|
118
138
|
if (hasLoaded) return consequent_3;
|
|
119
139
|
}
|
|
120
140
|
|
|
121
|
-
var root_3 = _$_.template(`<div class=
|
|
141
|
+
var root_3 = _$_.template(`<div class=feed><!>`);
|
|
122
142
|
|
|
123
143
|
function IfFragmentForIfIf_render(__anchor, __block) {
|
|
124
144
|
const muzes = [{ muzeId: 'b' }, { muzeId: 'c' }];
|
|
@@ -128,7 +148,7 @@ function IfFragmentForIfIf_render(__anchor, __block) {
|
|
|
128
148
|
{
|
|
129
149
|
var node_2 = _$_.hydrating ? _$_.hydrate_child() : div_1.firstChild;
|
|
130
150
|
|
|
131
|
-
_$_.if(node_2, if_4, false, { hasLoaded, muzes });
|
|
151
|
+
_$_.if(node_2, if_4, false, { a: hasLoaded, b: muzes });
|
|
132
152
|
_$_.hydrating && _$_.pop(div_1);
|
|
133
153
|
}
|
|
134
154
|
|
|
@@ -137,7 +157,7 @@ function IfFragmentForIfIf_render(__anchor, __block) {
|
|
|
137
157
|
|
|
138
158
|
IfFragmentForIfIf[_$_.$r] = IfFragmentForIfIf_render;
|
|
139
159
|
|
|
140
|
-
var root_9 = _$_.template(`<p class=
|
|
160
|
+
var root_9 = _$_.template(`<p class=muze>b</p><p class=muze>c`, 1, 2);
|
|
141
161
|
|
|
142
162
|
function consequent_4(__anchor, hasLoaded) {
|
|
143
163
|
var fragment_2 = root_9();
|
|
@@ -150,7 +170,7 @@ function if_5(hasLoaded) {
|
|
|
150
170
|
if (hasLoaded) return consequent_4;
|
|
151
171
|
}
|
|
152
172
|
|
|
153
|
-
var root_8 = _$_.template(`<div class=
|
|
173
|
+
var root_8 = _$_.template(`<div class=feed-b><!>`);
|
|
154
174
|
|
|
155
175
|
function IfFragmentElements_render(__anchor, __block) {
|
|
156
176
|
const hasLoaded = true;
|
|
@@ -168,8 +188,8 @@ function IfFragmentElements_render(__anchor, __block) {
|
|
|
168
188
|
|
|
169
189
|
IfFragmentElements[_$_.$r] = IfFragmentElements_render;
|
|
170
190
|
|
|
171
|
-
var root_12 = _$_.
|
|
172
|
-
var root_11 = _$_.template(`<!><span class=
|
|
191
|
+
var root_12 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
192
|
+
var root_11 = _$_.template(`<!><span class=after>after`, 1, 2);
|
|
173
193
|
var root_10 = _$_.template(`<!>`, 1, 1);
|
|
174
194
|
|
|
175
195
|
function ComponentBodyFragmentControlFlow_render(__anchor, __block) {
|
|
@@ -209,8 +229,8 @@ function ComponentBodyFragmentControlFlow_render(__anchor, __block) {
|
|
|
209
229
|
|
|
210
230
|
ComponentBodyFragmentControlFlow[_$_.$r] = ComponentBodyFragmentControlFlow_render;
|
|
211
231
|
|
|
212
|
-
var root_14 = _$_.
|
|
213
|
-
var root_15 = _$_.template(`<!><span class=
|
|
232
|
+
var root_14 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
233
|
+
var root_15 = _$_.template(`<!><span class=after>after`, 1, 2);
|
|
214
234
|
var root_13 = _$_.template(`<!>`, 1, 1);
|
|
215
235
|
|
|
216
236
|
function ComponentBodyCodeBlockControlFlow_render(__anchor, __block) {
|
|
@@ -254,10 +274,10 @@ function ComponentBodyCodeBlockControlFlow_render(__anchor, __block) {
|
|
|
254
274
|
|
|
255
275
|
ComponentBodyCodeBlockControlFlow[_$_.$r] = ComponentBodyCodeBlockControlFlow_render;
|
|
256
276
|
|
|
257
|
-
var root_17 = _$_.
|
|
258
|
-
var root_18 = _$_.template(`<!><span class=
|
|
277
|
+
var root_17 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
278
|
+
var root_18 = _$_.template(`<!><span class=after>after`, 1, 2);
|
|
259
279
|
|
|
260
|
-
function consequent_5(__anchor, { hasLoaded, muzes }) {
|
|
280
|
+
function consequent_5(__anchor, { a: hasLoaded, b: muzes }) {
|
|
261
281
|
var fragment_7 = root_18();
|
|
262
282
|
var expression_6 = _$_.first_child_frag(fragment_7);
|
|
263
283
|
|
|
@@ -288,11 +308,11 @@ function consequent_5(__anchor, { hasLoaded, muzes }) {
|
|
|
288
308
|
_$_.append(__anchor, fragment_7);
|
|
289
309
|
}
|
|
290
310
|
|
|
291
|
-
function if_6({ hasLoaded, muzes }) {
|
|
311
|
+
function if_6({ a: hasLoaded, b: muzes }) {
|
|
292
312
|
if (hasLoaded) return consequent_5;
|
|
293
313
|
}
|
|
294
314
|
|
|
295
|
-
var root_16 = _$_.template(`<div class=
|
|
315
|
+
var root_16 = _$_.template(`<div class=feed-f><!>`);
|
|
296
316
|
|
|
297
317
|
function IfCodeBlockControlFlow_render(__anchor, __block) {
|
|
298
318
|
const muzes = [{ muzeId: 'b' }, { muzeId: 'c' }];
|
|
@@ -302,7 +322,7 @@ function IfCodeBlockControlFlow_render(__anchor, __block) {
|
|
|
302
322
|
{
|
|
303
323
|
var node_10 = _$_.hydrating ? _$_.hydrate_child() : div_3.firstChild;
|
|
304
324
|
|
|
305
|
-
_$_.if(node_10, if_6, false, { hasLoaded, muzes });
|
|
325
|
+
_$_.if(node_10, if_6, false, { a: hasLoaded, b: muzes });
|
|
306
326
|
_$_.hydrating && _$_.pop(div_3);
|
|
307
327
|
}
|
|
308
328
|
|
|
@@ -311,17 +331,17 @@ function IfCodeBlockControlFlow_render(__anchor, __block) {
|
|
|
311
331
|
|
|
312
332
|
IfCodeBlockControlFlow[_$_.$r] = IfCodeBlockControlFlow_render;
|
|
313
333
|
|
|
314
|
-
var root_20 = _$_.
|
|
315
|
-
var root_22 = _$_.
|
|
316
|
-
var root_21 = _$_.template(`<!><span class=
|
|
334
|
+
var root_20 = _$_.template_el('span', ['class', 'loading'], 'loading');
|
|
335
|
+
var root_22 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
336
|
+
var root_21 = _$_.template(`<!><span class=after>after`, 1, 2);
|
|
317
337
|
|
|
318
|
-
function consequent_6(__anchor, { hasLoaded, muzes }) {
|
|
338
|
+
function consequent_6(__anchor, { a: hasLoaded, b: muzes }) {
|
|
319
339
|
var span_2 = root_20();
|
|
320
340
|
|
|
321
341
|
_$_.append(__anchor, span_2);
|
|
322
342
|
}
|
|
323
343
|
|
|
324
|
-
function alternate(__anchor, { hasLoaded, muzes }) {
|
|
344
|
+
function alternate(__anchor, { a: hasLoaded, b: muzes }) {
|
|
325
345
|
var fragment_8 = root_21();
|
|
326
346
|
var node_12 = _$_.first_child_frag(fragment_8);
|
|
327
347
|
|
|
@@ -348,11 +368,11 @@ function alternate(__anchor, { hasLoaded, muzes }) {
|
|
|
348
368
|
_$_.append(__anchor, fragment_8);
|
|
349
369
|
}
|
|
350
370
|
|
|
351
|
-
function if_7({ hasLoaded, muzes }) {
|
|
371
|
+
function if_7({ a: hasLoaded, b: muzes }) {
|
|
352
372
|
if (hasLoaded) return consequent_6; else return alternate;
|
|
353
373
|
}
|
|
354
374
|
|
|
355
|
-
var root_19 = _$_.template(`<div class=
|
|
375
|
+
var root_19 = _$_.template(`<div class=feed-d><!>`);
|
|
356
376
|
|
|
357
377
|
function IfElseFragment_render(__anchor, __block) {
|
|
358
378
|
const muzes = [{ muzeId: 'b' }, { muzeId: 'c' }];
|
|
@@ -362,7 +382,7 @@ function IfElseFragment_render(__anchor, __block) {
|
|
|
362
382
|
{
|
|
363
383
|
var node_11 = _$_.hydrating ? _$_.hydrate_child() : div_4.firstChild;
|
|
364
384
|
|
|
365
|
-
_$_.if(node_11, if_7, false, { hasLoaded, muzes });
|
|
385
|
+
_$_.if(node_11, if_7, false, { a: hasLoaded, b: muzes });
|
|
366
386
|
_$_.hydrating && _$_.pop(div_4);
|
|
367
387
|
}
|
|
368
388
|
|
|
@@ -371,10 +391,10 @@ function IfElseFragment_render(__anchor, __block) {
|
|
|
371
391
|
|
|
372
392
|
IfElseFragment[_$_.$r] = IfElseFragment_render;
|
|
373
393
|
|
|
374
|
-
var root_25 = _$_.
|
|
375
|
-
var root_24 = _$_.template(`<section
|
|
394
|
+
var root_25 = _$_.template_el('p', ['class', 'muze'], ' ');
|
|
395
|
+
var root_24 = _$_.template(`<section><span class=after>after`);
|
|
376
396
|
|
|
377
|
-
function consequent_7(__anchor, { hasLoaded, muzes }) {
|
|
397
|
+
function consequent_7(__anchor, { a: hasLoaded, b: muzes }) {
|
|
378
398
|
var section = root_24();
|
|
379
399
|
|
|
380
400
|
{
|
|
@@ -405,11 +425,11 @@ function consequent_7(__anchor, { hasLoaded, muzes }) {
|
|
|
405
425
|
_$_.append(__anchor, section);
|
|
406
426
|
}
|
|
407
427
|
|
|
408
|
-
function if_8({ hasLoaded, muzes }) {
|
|
428
|
+
function if_8({ a: hasLoaded, b: muzes }) {
|
|
409
429
|
if (hasLoaded) return consequent_7;
|
|
410
430
|
}
|
|
411
431
|
|
|
412
|
-
var root_23 = _$_.template(`<div class=
|
|
432
|
+
var root_23 = _$_.template(`<div class=feed-e><!>`);
|
|
413
433
|
|
|
414
434
|
function IfDivFragment_render(__anchor, __block) {
|
|
415
435
|
const muzes = [{ muzeId: 'b' }, { muzeId: 'c' }];
|
|
@@ -419,7 +439,7 @@ function IfDivFragment_render(__anchor, __block) {
|
|
|
419
439
|
{
|
|
420
440
|
var node_13 = _$_.hydrating ? _$_.hydrate_child() : div_5.firstChild;
|
|
421
441
|
|
|
422
|
-
_$_.if(node_13, if_8, false, { hasLoaded, muzes });
|
|
442
|
+
_$_.if(node_13, if_8, false, { a: hasLoaded, b: muzes });
|
|
423
443
|
_$_.hydrating && _$_.pop(div_5);
|
|
424
444
|
}
|
|
425
445
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as _$_ from 'ripple/internal/client';
|
|
3
3
|
|
|
4
|
-
var root = _$_.
|
|
4
|
+
var root = _$_.template_el('div', ['class', 'shown'], 'Visible');
|
|
5
5
|
|
|
6
6
|
function consequent(__anchor, show) {
|
|
7
7
|
var div = root();
|
|
@@ -21,7 +21,7 @@ function IfTruthy_render(__anchor, __block) {
|
|
|
21
21
|
|
|
22
22
|
IfTruthy[_$_.$r] = IfTruthy_render;
|
|
23
23
|
|
|
24
|
-
var root_1 = _$_.
|
|
24
|
+
var root_1 = _$_.template_el('div', ['class', 'shown'], 'Visible');
|
|
25
25
|
|
|
26
26
|
function consequent_1(__anchor, show) {
|
|
27
27
|
var div_1 = root_1();
|
|
@@ -41,8 +41,8 @@ function IfFalsy_render(__anchor, __block) {
|
|
|
41
41
|
|
|
42
42
|
IfFalsy[_$_.$r] = IfFalsy_render;
|
|
43
43
|
|
|
44
|
-
var root_2 = _$_.
|
|
45
|
-
var root_3 = _$_.
|
|
44
|
+
var root_2 = _$_.template_el('div', ['class', 'logged-in'], 'Welcome back!');
|
|
45
|
+
var root_3 = _$_.template_el('div', ['class', 'logged-out'], 'Please log in');
|
|
46
46
|
|
|
47
47
|
function consequent_2(__anchor, isLoggedIn) {
|
|
48
48
|
var div_2 = root_2();
|
|
@@ -68,7 +68,7 @@ function IfElse_render(__anchor, __block) {
|
|
|
68
68
|
|
|
69
69
|
IfElse[_$_.$r] = IfElse_render;
|
|
70
70
|
|
|
71
|
-
var root_6 = _$_.
|
|
71
|
+
var root_6 = _$_.template_el('div', ['class', 'content'], 'Content visible');
|
|
72
72
|
|
|
73
73
|
function consequent_3(__anchor, show) {
|
|
74
74
|
var div_4 = root_6();
|
|
@@ -80,11 +80,20 @@ function if_4(show) {
|
|
|
80
80
|
if (show.value) return consequent_3;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
var root_5 = _$_.template(`<button class=
|
|
83
|
+
var root_5 = _$_.template(`<button class=toggle>Toggle</button><!>`, 1, 2);
|
|
84
|
+
|
|
85
|
+
function render(__prev) {
|
|
86
|
+
var __a = if_4(__prev._a);
|
|
87
|
+
|
|
88
|
+
if (__prev.a !== __a) {
|
|
89
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
84
93
|
var root_4 = _$_.template(`<!>`, 1, 1);
|
|
85
94
|
|
|
86
95
|
function ReactiveIf_render(__anchor, __block) {
|
|
87
|
-
const show = _$_.track(true, __block, '
|
|
96
|
+
const show = _$_.track(true, __block, '740m40');
|
|
88
97
|
var fragment = root_4();
|
|
89
98
|
var node_1 = _$_.first_child_frag(fragment);
|
|
90
99
|
|
|
@@ -97,8 +106,9 @@ function ReactiveIf_render(__anchor, __block) {
|
|
|
97
106
|
};
|
|
98
107
|
|
|
99
108
|
var node = _$_.hydrating ? _$_.hydrate_sibling() : button.nextSibling;
|
|
109
|
+
var ifs = _$_.if_static(node, if_4, 0, show);
|
|
100
110
|
|
|
101
|
-
_$_.
|
|
111
|
+
_$_.render(render, { a: _$_.UNINITIALIZED, _a: show, _b: ifs });
|
|
102
112
|
_$_.append(__anchor, fragment_1);
|
|
103
113
|
}));
|
|
104
114
|
|
|
@@ -107,8 +117,8 @@ function ReactiveIf_render(__anchor, __block) {
|
|
|
107
117
|
|
|
108
118
|
ReactiveIf[_$_.$r] = ReactiveIf_render;
|
|
109
119
|
|
|
110
|
-
var root_9 = _$_.
|
|
111
|
-
var root_10 = _$_.
|
|
120
|
+
var root_9 = _$_.template_el('div', ['class', 'on'], 'ON');
|
|
121
|
+
var root_10 = _$_.template_el('div', ['class', 'off'], 'OFF');
|
|
112
122
|
|
|
113
123
|
function consequent_4(__anchor, isOn) {
|
|
114
124
|
var div_5 = root_9();
|
|
@@ -126,11 +136,20 @@ function if_5(isOn) {
|
|
|
126
136
|
if (isOn.value) return consequent_4; else return alternate_1;
|
|
127
137
|
}
|
|
128
138
|
|
|
129
|
-
var root_8 = _$_.template(`<button class=
|
|
139
|
+
var root_8 = _$_.template(`<button class=toggle>Toggle</button><!>`, 1, 2);
|
|
140
|
+
|
|
141
|
+
function render_1(__prev) {
|
|
142
|
+
var __a = if_5(__prev._a);
|
|
143
|
+
|
|
144
|
+
if (__prev.a !== __a) {
|
|
145
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
130
149
|
var root_7 = _$_.template(`<!>`, 1, 1);
|
|
131
150
|
|
|
132
151
|
function ReactiveIfElse_render(__anchor, __block) {
|
|
133
|
-
const isOn = _$_.track(false, __block, '
|
|
152
|
+
const isOn = _$_.track(false, __block, 'i26m2h');
|
|
134
153
|
var fragment_2 = root_7();
|
|
135
154
|
var node_3 = _$_.first_child_frag(fragment_2);
|
|
136
155
|
|
|
@@ -143,8 +162,9 @@ function ReactiveIfElse_render(__anchor, __block) {
|
|
|
143
162
|
};
|
|
144
163
|
|
|
145
164
|
var node_2 = _$_.hydrating ? _$_.hydrate_sibling() : button_1.nextSibling;
|
|
165
|
+
var ifs_1 = _$_.if_static(node_2, if_5, 0, isOn);
|
|
146
166
|
|
|
147
|
-
_$_.
|
|
167
|
+
_$_.render(render_1, { a: _$_.UNINITIALIZED, _a: isOn, _b: ifs_1 });
|
|
148
168
|
_$_.append(__anchor, fragment_3);
|
|
149
169
|
}));
|
|
150
170
|
|
|
@@ -153,7 +173,7 @@ function ReactiveIfElse_render(__anchor, __block) {
|
|
|
153
173
|
|
|
154
174
|
ReactiveIfElse[_$_.$r] = ReactiveIfElse_render;
|
|
155
175
|
|
|
156
|
-
var root_14 = _$_.
|
|
176
|
+
var root_14 = _$_.template_el('span', ['class', 'inner-content'], 'Inner');
|
|
157
177
|
|
|
158
178
|
function consequent_5(__anchor, inner) {
|
|
159
179
|
var span = root_14();
|
|
@@ -165,32 +185,50 @@ function if_6(inner) {
|
|
|
165
185
|
if (inner.value) return consequent_5;
|
|
166
186
|
}
|
|
167
187
|
|
|
168
|
-
var root_13 = _$_.
|
|
188
|
+
var root_13 = _$_.template_el('div', ['class', 'outer-content'], 'Outer');
|
|
189
|
+
|
|
190
|
+
function render_2(__prev) {
|
|
191
|
+
var __a = if_6(__prev._a);
|
|
169
192
|
|
|
170
|
-
|
|
193
|
+
if (__prev.a !== __a) {
|
|
194
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function consequent_6(__anchor, { a: outer, b: inner }) {
|
|
171
199
|
var div_7 = root_13();
|
|
172
200
|
|
|
173
201
|
{
|
|
174
202
|
var expression = _$_.hydrating ? _$_.hydrate_child() : div_7.firstChild;
|
|
175
|
-
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_7);
|
|
203
|
+
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_7, true);
|
|
204
|
+
var ifs_2 = _$_.if_static(node_5, if_6, 0, inner);
|
|
176
205
|
|
|
177
|
-
_$_.if(node_5, if_6, false, inner);
|
|
178
206
|
_$_.hydrating && _$_.pop(div_7);
|
|
179
207
|
}
|
|
180
208
|
|
|
209
|
+
_$_.render(render_2, { a: _$_.UNINITIALIZED, _a: inner, _b: ifs_2 });
|
|
181
210
|
_$_.append(__anchor, div_7);
|
|
182
211
|
}
|
|
183
212
|
|
|
184
|
-
function if_7({ outer, inner }) {
|
|
213
|
+
function if_7({ a: outer, b: inner }) {
|
|
185
214
|
if (outer.value) return consequent_6;
|
|
186
215
|
}
|
|
187
216
|
|
|
188
|
-
var root_12 = _$_.template(`<button class=
|
|
217
|
+
var root_12 = _$_.template(`<button class=outer-toggle>Outer</button><button class=inner-toggle>Inner</button><!>`, 1, 3);
|
|
218
|
+
|
|
219
|
+
function render_3(__prev) {
|
|
220
|
+
var __a = if_7({ a: __prev._a, b: __prev._b });
|
|
221
|
+
|
|
222
|
+
if (__prev.a !== __a) {
|
|
223
|
+
_$_.if_update(__prev._c, __prev.a = __a);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
189
227
|
var root_11 = _$_.template(`<!>`, 1, 1);
|
|
190
228
|
|
|
191
229
|
function NestedIf_render(__anchor, __block) {
|
|
192
|
-
const outer = _$_.track(true, __block, '
|
|
193
|
-
const inner = _$_.track(true, __block, '
|
|
230
|
+
const outer = _$_.track(true, __block, 'xggelb');
|
|
231
|
+
const inner = _$_.track(true, __block, '1v6cfmu');
|
|
194
232
|
var fragment_4 = root_11();
|
|
195
233
|
var node_6 = _$_.first_child_frag(fragment_4);
|
|
196
234
|
|
|
@@ -209,8 +247,9 @@ function NestedIf_render(__anchor, __block) {
|
|
|
209
247
|
};
|
|
210
248
|
|
|
211
249
|
var node_4 = _$_.hydrating ? _$_.hydrate_sibling() : button_3.nextSibling;
|
|
250
|
+
var ifs_3 = _$_.if_static(node_4, if_7, 0, { a: outer, b: inner });
|
|
212
251
|
|
|
213
|
-
_$_.
|
|
252
|
+
_$_.render(render_3, { a: _$_.UNINITIALIZED, _a: outer, _b: inner, _c: ifs_3 });
|
|
214
253
|
_$_.append(__anchor, fragment_5);
|
|
215
254
|
}));
|
|
216
255
|
|
|
@@ -219,9 +258,9 @@ function NestedIf_render(__anchor, __block) {
|
|
|
219
258
|
|
|
220
259
|
NestedIf[_$_.$r] = NestedIf_render;
|
|
221
260
|
|
|
222
|
-
var root_16 = _$_.
|
|
223
|
-
var root_17 = _$_.
|
|
224
|
-
var root_18 = _$_.
|
|
261
|
+
var root_16 = _$_.template_el('div', ['class', 'state'], 'Loading...');
|
|
262
|
+
var root_17 = _$_.template_el('div', ['class', 'state'], 'Success!');
|
|
263
|
+
var root_18 = _$_.template_el('div', ['class', 'state'], 'Error occurred');
|
|
225
264
|
|
|
226
265
|
function consequent_7(__anchor, status) {
|
|
227
266
|
var div_9 = root_16();
|
|
@@ -245,10 +284,18 @@ function if_8(status) {
|
|
|
245
284
|
if (status.value === 'loading') return consequent_7; else if (status.value === 'success') return consequent_8; else return alternate_2;
|
|
246
285
|
}
|
|
247
286
|
|
|
248
|
-
var root_15 = _$_.template(`<div><button class=
|
|
287
|
+
var root_15 = _$_.template(`<div><button class=success>Success</button><button class=error>Error</button><button class=loading>Loading`);
|
|
288
|
+
|
|
289
|
+
function render_4(__prev) {
|
|
290
|
+
var __a = if_8(__prev._a);
|
|
291
|
+
|
|
292
|
+
if (__prev.a !== __a) {
|
|
293
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
249
296
|
|
|
250
297
|
function IfElseIfChain_render(__anchor, __block) {
|
|
251
|
-
const status = _$_.track('loading', __block, '
|
|
298
|
+
const status = _$_.track('loading', __block, 'l79qh6');
|
|
252
299
|
var div_8 = root_15();
|
|
253
300
|
|
|
254
301
|
{
|
|
@@ -270,12 +317,13 @@ function IfElseIfChain_render(__anchor, __block) {
|
|
|
270
317
|
status.value = 'loading';
|
|
271
318
|
};
|
|
272
319
|
|
|
273
|
-
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_8);
|
|
320
|
+
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_8, true);
|
|
321
|
+
var ifs_4 = _$_.if_static(node_7, if_8, 0, status);
|
|
274
322
|
|
|
275
|
-
_$_.if(node_7, if_8, false, status);
|
|
276
323
|
_$_.hydrating && _$_.pop(div_8);
|
|
277
324
|
}
|
|
278
325
|
|
|
326
|
+
_$_.render(render_4, { a: _$_.UNINITIALIZED, _a: status, _b: ifs_4 });
|
|
279
327
|
_$_.append(__anchor, div_8);
|
|
280
328
|
}
|
|
281
329
|
|