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 = _$_.
|
|
4
|
+
var root = _$_.template_el('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, '
|
|
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 = _$_.
|
|
23
|
-
var root_2 = _$_.template(`<button class=
|
|
22
|
+
var root_3 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
62
|
+
var root_4 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
81
|
-
var root_6 = _$_.template(`<button class=
|
|
80
|
+
var root_7 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
121
|
-
var root_9 = _$_.
|
|
120
|
+
var root_8 = _$_.template_el('p', ['class', 'result'], ' ');
|
|
121
|
+
var root_9 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
152
|
-
var root_11 = _$_.
|
|
151
|
+
var root_10 = _$_.template_el('span', ['class', 'count'], ' ');
|
|
152
|
+
var root_11 = _$_.template_el('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, '
|
|
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=
|
|
183
|
-
var root_13 = _$_.
|
|
182
|
+
var root_12 = _$_.template(`<div class=user><span class=name> </span><span class=age> `);
|
|
183
|
+
var root_13 = _$_.template_el('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, '
|
|
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=
|
|
227
|
-
var root_15 = _$_.
|
|
226
|
+
var root_14 = _$_.template(`<div class=multi><span class=first> </span><span class=second> `);
|
|
227
|
+
var root_15 = _$_.template_el('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, '
|
|
234
|
-
const second = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('beta')), __block, '
|
|
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 = _$_.
|
|
272
|
-
var root_17 = _$_.
|
|
273
|
-
var root_18 = _$_.
|
|
271
|
+
var root_16 = _$_.template_el('p', ['class', 'result'], ' ');
|
|
272
|
+
var root_17 = _$_.template_el('p', ['class', 'error'], ' ');
|
|
273
|
+
var root_18 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
315
|
-
var root_20 = _$_.
|
|
314
|
+
var root_19 = _$_.template_el('p', ['class', 'result'], ' ');
|
|
315
|
+
var root_20 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
345
|
+
var root_21 = _$_.template_el('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 = _$_.
|
|
372
|
+
var root_22 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
391
|
-
var root_24 = _$_.template(`<button class=
|
|
390
|
+
var root_25 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
431
|
-
var root_27 = _$_.template(`<button class=
|
|
430
|
+
var root_28 = _$_.template_el('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, '
|
|
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: _$_.
|
|
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 = _$_.
|
|
4
|
+
var root = _$_.template_el('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=
|
|
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 = _$_.
|
|
39
|
+
var root_2 = _$_.template_el('p', null, '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 = _$_.
|
|
51
|
+
var root_3 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
69
|
+
var root_4 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
87
|
+
var root_5 = _$_.template_el('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 = _$_.
|
|
108
|
-
var root_6 = _$_.
|
|
107
|
+
var root_7 = _$_.template_el('li', null, ' ');
|
|
108
|
+
var root_6 = _$_.template_el('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, '
|
|
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 = _$_.
|
|
142
|
-
var root_9 = _$_.template(`<div class=
|
|
141
|
+
var root_10 = _$_.template_el('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 = _$_.
|
|
175
|
+
var root_11 = _$_.template_el('div', ['class', 'resolved'], ' ');
|
|
176
176
|
|
|
177
177
|
function AsyncContent_render(__anchor, __block) {
|
|
178
|
-
const value = _$_.track_async(() => _$_.with_scope(__block, () => Promise.resolve('ready')), __block, '
|
|
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,19 +1,20 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as _$_ from 'ripple/internal/client';
|
|
3
3
|
|
|
4
|
-
var root_1 = _$_.template(`<div class=
|
|
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
|
|
7
|
+
var __row_value = __prev._a.value;
|
|
8
|
+
var __a = 'value: ' + (__row_value.label + String(__row_value.count ?? ''));
|
|
8
9
|
|
|
9
10
|
if (__prev.a !== __a) {
|
|
10
|
-
_$_.set_text(__prev.
|
|
11
|
+
_$_.set_text(__prev._b, __prev.a = __a);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
var __b = (0,
|
|
14
|
+
var __b = (0, __row_value.count);
|
|
14
15
|
|
|
15
16
|
if (__prev.b !== __b) {
|
|
16
|
-
_$_.set_text_content(__prev.
|
|
17
|
+
_$_.set_text_content(__prev._c, __b, __prev.b);
|
|
17
18
|
__prev.b = __b;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -21,7 +22,7 @@ function render(__prev) {
|
|
|
21
22
|
var root = _$_.template(`<!>`, 1, 1);
|
|
22
23
|
|
|
23
24
|
function TypedText_render(__anchor, __block) {
|
|
24
|
-
const row = _$_.track({ label: '<first>', count: 2 }, __block, '
|
|
25
|
+
const row = _$_.track({ label: '<first>', count: 2 }, __block, '179p9ai');
|
|
25
26
|
var fragment = root();
|
|
26
27
|
var node = _$_.first_child_frag(fragment);
|
|
27
28
|
|
|
@@ -42,7 +43,7 @@ function TypedText_render(__anchor, __block) {
|
|
|
42
43
|
row.value = { label: '&next', count: 3n };
|
|
43
44
|
};
|
|
44
45
|
|
|
45
|
-
_$_.render(render, { a: ' ', b: '',
|
|
46
|
+
_$_.render(render, { a: ' ', b: '', _a: row, _b: expression, _c: p });
|
|
46
47
|
_$_.append(__anchor, fragment_1);
|
|
47
48
|
}));
|
|
48
49
|
|
|
@@ -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'], '
|
|
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, '
|
|
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' : '', '
|
|
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, '
|
|
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' : '', '
|
|
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, '
|
|
1070
|
+
const count = _$_.track(2, '1u7u49j');
|
|
1071
1071
|
|
|
1072
1072
|
_$_.regular_block(() => {
|
|
1073
1073
|
let __out = '';
|
|
@@ -5,7 +5,7 @@ import { track } from 'ripple/server';
|
|
|
5
5
|
|
|
6
6
|
export function ClickCounter() {
|
|
7
7
|
return _$_.tsrx_element(() => {
|
|
8
|
-
const count = _$_.track(0, '
|
|
8
|
+
const count = _$_.track(0, '18illt3');
|
|
9
9
|
|
|
10
10
|
_$_.regular_block(() => {
|
|
11
11
|
let __out = '';
|
|
@@ -18,7 +18,7 @@ export function ClickCounter() {
|
|
|
18
18
|
|
|
19
19
|
export function IncrementDecrement() {
|
|
20
20
|
return _$_.tsrx_element(() => {
|
|
21
|
-
const count = _$_.track(0, '
|
|
21
|
+
const count = _$_.track(0, '11qc3q5');
|
|
22
22
|
|
|
23
23
|
_$_.regular_block(() => {
|
|
24
24
|
let __out = '';
|
|
@@ -31,8 +31,8 @@ export function IncrementDecrement() {
|
|
|
31
31
|
|
|
32
32
|
export function MultipleEvents() {
|
|
33
33
|
return _$_.tsrx_element(() => {
|
|
34
|
-
const clicks = _$_.track(0, '
|
|
35
|
-
const hovers = _$_.track(0, '
|
|
34
|
+
const clicks = _$_.track(0, 'i8ishc');
|
|
35
|
+
const hovers = _$_.track(0, 'vrf59x');
|
|
36
36
|
|
|
37
37
|
_$_.regular_block(() => {
|
|
38
38
|
let __out = '';
|
|
@@ -45,8 +45,8 @@ export function MultipleEvents() {
|
|
|
45
45
|
|
|
46
46
|
export function MultiStateUpdate() {
|
|
47
47
|
return _$_.tsrx_element(() => {
|
|
48
|
-
const count = _$_.track(0, '
|
|
49
|
-
const lastAction = _$_.track('none', '
|
|
48
|
+
const count = _$_.track(0, 'p155r4');
|
|
49
|
+
const lastAction = _$_.track('none', 'gwmyks');
|
|
50
50
|
|
|
51
51
|
const handleClick = () => {
|
|
52
52
|
count.value++;
|
|
@@ -72,7 +72,7 @@ export function MultiStateUpdate() {
|
|
|
72
72
|
|
|
73
73
|
export function ToggleButton() {
|
|
74
74
|
return _$_.tsrx_element(() => {
|
|
75
|
-
const isOn = _$_.track(false, '
|
|
75
|
+
const isOn = _$_.track(false, '1guxsxz');
|
|
76
76
|
|
|
77
77
|
_$_.regular_block(() => {
|
|
78
78
|
let __out = '';
|
|
@@ -96,7 +96,7 @@ export function ChildButton(props) {
|
|
|
96
96
|
|
|
97
97
|
export function ParentWithChildButton() {
|
|
98
98
|
return _$_.tsrx_element(() => {
|
|
99
|
-
const count = _$_.track(0, '
|
|
99
|
+
const count = _$_.track(0, '1p94et5');
|
|
100
100
|
|
|
101
101
|
_$_.regular_block(() => {
|
|
102
102
|
let __out = '';
|