ripple 0.3.65 → 0.3.66
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 +37 -0
- package/package.json +3 -3
- package/src/jsx-runtime.d.ts +17 -3
- package/src/runtime/index-client.js +47 -8
- package/src/runtime/index-server.js +0 -2
- package/src/runtime/internal/client/index.js +5 -0
- package/src/runtime/internal/client/runtime.js +111 -11
- package/src/runtime/internal/client/types.d.ts +5 -0
- package/src/runtime/internal/server/blocks.js +1 -0
- package/src/runtime/internal/server/index.js +175 -20
- package/src/utils/errors.js +13 -0
- package/tests/client/async-suspend.test.tsrx +2 -2
- package/tests/client/basic/basic.get-set.test.tsrx +26 -26
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +1 -1
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +1 -1
- package/tests/client/compiler/compiler.assignments.test.tsrx +80 -0
- package/tests/client/compiler/compiler.tracked-access.test.tsrx +52 -8
- package/tests/client/compiler/compiler.typescript.test.tsrx +23 -0
- package/tests/client/lazy-array.test.tsrx +34 -0
- package/tests/client/lazy-destructuring.test.tsrx +79 -8
- package/tests/client/tracked-index-access.test.tsrx +113 -0
- package/tests/hydration/compiled/client/basic.js +2 -2
- package/tests/hydration/compiled/client/events.js +9 -9
- package/tests/hydration/compiled/client/for.js +50 -54
- package/tests/hydration/compiled/client/head.js +9 -9
- package/tests/hydration/compiled/client/hmr.js +1 -1
- package/tests/hydration/compiled/client/html.js +2 -2
- package/tests/hydration/compiled/client/if-children.js +14 -14
- package/tests/hydration/compiled/client/if.js +10 -10
- package/tests/hydration/compiled/client/mixed-control-flow.js +7 -7
- package/tests/hydration/compiled/client/portal.js +2 -2
- package/tests/hydration/compiled/client/reactivity.js +7 -7
- package/tests/hydration/compiled/client/return.js +37 -37
- package/tests/hydration/compiled/client/switch.js +8 -8
- package/tests/hydration/compiled/client/track-async-serialization.js +12 -12
- package/tests/hydration/compiled/client/try.js +116 -33
- package/tests/hydration/compiled/server/basic.js +2 -2
- package/tests/hydration/compiled/server/events.js +8 -8
- package/tests/hydration/compiled/server/for.js +21 -21
- package/tests/hydration/compiled/server/head.js +10 -10
- 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 +6 -6
- 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 +7 -7
- package/tests/hydration/compiled/server/return.js +14 -14
- package/tests/hydration/compiled/server/switch.js +4 -4
- package/tests/hydration/compiled/server/track-async-serialization.js +12 -12
- package/tests/hydration/compiled/server/try.js +116 -4
- package/tests/hydration/components/try.tsrx +26 -0
- package/tests/hydration/try.test.js +100 -1
- package/tests/server/await.test.tsrx +1 -1
- package/tests/server/compiler.test.tsrx +109 -0
- package/tests/server/lazy-destructuring.test.tsrx +62 -0
- package/tests/server/tracked-index-access.test.tsrx +76 -0
- package/tests/setup-hydration.js +31 -0
- package/types/index.d.ts +11 -9
- package/types/server.d.ts +2 -1
|
@@ -941,7 +941,7 @@ function SidebarSection({ title, children }) {
|
|
|
941
941
|
_$_.output_push('</div>');
|
|
942
942
|
_$_.output_push('<!--[-->');
|
|
943
943
|
|
|
944
|
-
if (
|
|
944
|
+
if (lazy.value) {
|
|
945
945
|
_$_.output_push('<div');
|
|
946
946
|
_$_.output_push(' class="section-items"');
|
|
947
947
|
_$_.output_push('>');
|
|
@@ -26,7 +26,7 @@ export function IfWithChildren({ children }) {
|
|
|
26
26
|
_$_.output_push('</div>');
|
|
27
27
|
_$_.output_push('<!--[-->');
|
|
28
28
|
|
|
29
|
-
if (
|
|
29
|
+
if (lazy.value) {
|
|
30
30
|
_$_.output_push('<div');
|
|
31
31
|
_$_.output_push(' class="content"');
|
|
32
32
|
_$_.output_push('>');
|
|
@@ -126,7 +126,7 @@ export function IfWithStaticChildren() {
|
|
|
126
126
|
_$_.output_push('</div>');
|
|
127
127
|
_$_.output_push('<!--[-->');
|
|
128
128
|
|
|
129
|
-
if (
|
|
129
|
+
if (lazy_1.value) {
|
|
130
130
|
_$_.output_push('<div');
|
|
131
131
|
_$_.output_push(' class="content"');
|
|
132
132
|
_$_.output_push('>');
|
|
@@ -220,7 +220,7 @@ export function IfWithSiblingsAndChildren({ children }) {
|
|
|
220
220
|
_$_.output_push('</div>');
|
|
221
221
|
_$_.output_push('<!--[-->');
|
|
222
222
|
|
|
223
|
-
if (
|
|
223
|
+
if (lazy_2.value) {
|
|
224
224
|
_$_.output_push('<div');
|
|
225
225
|
_$_.output_push(' class="items"');
|
|
226
226
|
_$_.output_push('>');
|
|
@@ -317,7 +317,7 @@ export function ElementWithChildrenThenIf() {
|
|
|
317
317
|
_$_.output_push('</div>');
|
|
318
318
|
_$_.output_push('<!--[-->');
|
|
319
319
|
|
|
320
|
-
if (
|
|
320
|
+
if (lazy_3.value) {
|
|
321
321
|
_$_.output_push('<div');
|
|
322
322
|
_$_.output_push(' class="conditional"');
|
|
323
323
|
_$_.output_push('>');
|
|
@@ -403,7 +403,7 @@ export function DeepNestingThenIf() {
|
|
|
403
403
|
_$_.output_push('</article>');
|
|
404
404
|
_$_.output_push('<!--[-->');
|
|
405
405
|
|
|
406
|
-
if (
|
|
406
|
+
if (lazy_4.value) {
|
|
407
407
|
_$_.output_push('<footer');
|
|
408
408
|
_$_.output_push(' class="footer"');
|
|
409
409
|
_$_.output_push('>');
|
|
@@ -453,7 +453,7 @@ export function DomElementChildrenThenSibling() {
|
|
|
453
453
|
|
|
454
454
|
{
|
|
455
455
|
_$_.output_push('<button');
|
|
456
|
-
_$_.output_push(_$_.attr('aria-selected',
|
|
456
|
+
_$_.output_push(_$_.attr('aria-selected', lazy_5.value === 'code' ? 'true' : 'false', false));
|
|
457
457
|
_$_.output_push(' class="tab"');
|
|
458
458
|
_$_.output_push('>');
|
|
459
459
|
|
|
@@ -463,7 +463,7 @@ export function DomElementChildrenThenSibling() {
|
|
|
463
463
|
|
|
464
464
|
_$_.output_push('</button>');
|
|
465
465
|
_$_.output_push('<button');
|
|
466
|
-
_$_.output_push(_$_.attr('aria-selected',
|
|
466
|
+
_$_.output_push(_$_.attr('aria-selected', lazy_5.value === 'preview' ? 'true' : 'false', false));
|
|
467
467
|
_$_.output_push(' class="tab"');
|
|
468
468
|
_$_.output_push('>');
|
|
469
469
|
|
|
@@ -482,7 +482,7 @@ export function DomElementChildrenThenSibling() {
|
|
|
482
482
|
{
|
|
483
483
|
_$_.output_push('<!--[-->');
|
|
484
484
|
|
|
485
|
-
if (
|
|
485
|
+
if (lazy_5.value === 'code') {
|
|
486
486
|
_$_.output_push('<pre');
|
|
487
487
|
_$_.output_push(' class="code"');
|
|
488
488
|
_$_.output_push('>');
|
|
@@ -537,7 +537,7 @@ export function DomChildrenThenStaticSiblings() {
|
|
|
537
537
|
_$_.output_push('>');
|
|
538
538
|
|
|
539
539
|
{
|
|
540
|
-
_$_.output_push(_$_.escape('Item count: ' + String(
|
|
540
|
+
_$_.output_push(_$_.escape('Item count: ' + String(lazy_6.value)));
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
_$_.output_push('</li>');
|
|
@@ -111,7 +111,7 @@ export function ReactiveIf() {
|
|
|
111
111
|
_$_.regular_block(() => {
|
|
112
112
|
_$_.output_push('<!--[-->');
|
|
113
113
|
|
|
114
|
-
if (
|
|
114
|
+
if (lazy.value) {
|
|
115
115
|
_$_.output_push('<div');
|
|
116
116
|
_$_.output_push(' class="content"');
|
|
117
117
|
_$_.output_push('>');
|
|
@@ -149,7 +149,7 @@ export function ReactiveIfElse() {
|
|
|
149
149
|
_$_.regular_block(() => {
|
|
150
150
|
_$_.output_push('<!--[-->');
|
|
151
151
|
|
|
152
|
-
if (
|
|
152
|
+
if (lazy_1.value) {
|
|
153
153
|
_$_.output_push('<div');
|
|
154
154
|
_$_.output_push(' class="on"');
|
|
155
155
|
_$_.output_push('>');
|
|
@@ -210,7 +210,7 @@ export function NestedIf() {
|
|
|
210
210
|
_$_.regular_block(() => {
|
|
211
211
|
_$_.output_push('<!--[-->');
|
|
212
212
|
|
|
213
|
-
if (
|
|
213
|
+
if (lazy_2.value) {
|
|
214
214
|
_$_.output_push('<div');
|
|
215
215
|
_$_.output_push(' class="outer-content"');
|
|
216
216
|
_$_.output_push('>');
|
|
@@ -219,7 +219,7 @@ export function NestedIf() {
|
|
|
219
219
|
_$_.output_push('Outer');
|
|
220
220
|
_$_.output_push('<!--[-->');
|
|
221
221
|
|
|
222
|
-
if (
|
|
222
|
+
if (lazy_3.value) {
|
|
223
223
|
_$_.output_push('<span');
|
|
224
224
|
_$_.output_push(' class="inner-content"');
|
|
225
225
|
_$_.output_push('>');
|
|
@@ -282,7 +282,7 @@ export function IfElseIfChain() {
|
|
|
282
282
|
_$_.output_push('</button>');
|
|
283
283
|
_$_.output_push('<!--[-->');
|
|
284
284
|
|
|
285
|
-
if (
|
|
285
|
+
if (lazy_4.value === 'loading') {
|
|
286
286
|
_$_.output_push('<div');
|
|
287
287
|
_$_.output_push(' class="state"');
|
|
288
288
|
_$_.output_push('>');
|
|
@@ -295,7 +295,7 @@ export function IfElseIfChain() {
|
|
|
295
295
|
} else {
|
|
296
296
|
_$_.output_push('<!--[-->');
|
|
297
297
|
|
|
298
|
-
if (
|
|
298
|
+
if (lazy_4.value === 'success') {
|
|
299
299
|
_$_.output_push('<div');
|
|
300
300
|
_$_.output_push(' class="state"');
|
|
301
301
|
_$_.output_push('>');
|
|
@@ -152,7 +152,7 @@ export function MixedControlFlowReactive() {
|
|
|
152
152
|
_$_.regular_block(() => {
|
|
153
153
|
_$_.output_push('<!--[-->');
|
|
154
154
|
|
|
155
|
-
if (
|
|
155
|
+
if (lazy.value) {
|
|
156
156
|
_$_.output_push('<div');
|
|
157
157
|
_$_.output_push(' class="mixed-reactive-list"');
|
|
158
158
|
_$_.output_push('>');
|
|
@@ -160,10 +160,10 @@ export function MixedControlFlowReactive() {
|
|
|
160
160
|
{
|
|
161
161
|
_$_.output_push('<!--[-->');
|
|
162
162
|
|
|
163
|
-
for (const item of
|
|
163
|
+
for (const item of lazy_2.value) {
|
|
164
164
|
_$_.output_push('<!--[-->');
|
|
165
165
|
|
|
166
|
-
switch (
|
|
166
|
+
switch (lazy_1.value) {
|
|
167
167
|
case 'a':
|
|
168
168
|
_$_.try_block(
|
|
169
169
|
() => {
|
|
@@ -335,7 +335,7 @@ function AsyncRow({ label }) {
|
|
|
335
335
|
_$_.output_push('>');
|
|
336
336
|
|
|
337
337
|
{
|
|
338
|
-
_$_.output_push(_$_.escape(
|
|
338
|
+
_$_.output_push(_$_.escape(lazy_3.value));
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
_$_.output_push('</div>');
|
|
@@ -14,7 +14,7 @@ export function TrackedState() {
|
|
|
14
14
|
_$_.output_push('>');
|
|
15
15
|
|
|
16
16
|
{
|
|
17
|
-
_$_.output_push(_$_.escape(
|
|
17
|
+
_$_.output_push(_$_.escape(lazy.value));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
_$_.output_push('</div>');
|
|
@@ -38,7 +38,7 @@ export function CounterWithInitial(props) {
|
|
|
38
38
|
_$_.output_push('>');
|
|
39
39
|
|
|
40
40
|
{
|
|
41
|
-
_$_.output_push(_$_.escape(
|
|
41
|
+
_$_.output_push(_$_.escape(lazy_1.value));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
_$_.output_push('</span>');
|
|
@@ -70,7 +70,7 @@ export function ComputedValues() {
|
|
|
70
70
|
|
|
71
71
|
let lazy_2 = _$_.track(2, 'b78281db');
|
|
72
72
|
let lazy_3 = _$_.track(3, 'a0cf6c6d');
|
|
73
|
-
const sum = () =>
|
|
73
|
+
const sum = () => lazy_2.value + lazy_3.value;
|
|
74
74
|
|
|
75
75
|
_$_.regular_block(() => {
|
|
76
76
|
_$_.output_push('<div');
|
|
@@ -100,7 +100,7 @@ export function MultipleTracked() {
|
|
|
100
100
|
_$_.output_push('>');
|
|
101
101
|
|
|
102
102
|
{
|
|
103
|
-
_$_.output_push(_$_.escape(
|
|
103
|
+
_$_.output_push(_$_.escape(lazy_4.value));
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
_$_.output_push('</div>');
|
|
@@ -112,7 +112,7 @@ export function MultipleTracked() {
|
|
|
112
112
|
_$_.output_push('>');
|
|
113
113
|
|
|
114
114
|
{
|
|
115
|
-
_$_.output_push(_$_.escape(
|
|
115
|
+
_$_.output_push(_$_.escape(lazy_5.value));
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
_$_.output_push('</div>');
|
|
@@ -124,7 +124,7 @@ export function MultipleTracked() {
|
|
|
124
124
|
_$_.output_push('>');
|
|
125
125
|
|
|
126
126
|
{
|
|
127
|
-
_$_.output_push(_$_.escape(
|
|
127
|
+
_$_.output_push(_$_.escape(lazy_6.value));
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
_$_.output_push('</div>');
|
|
@@ -138,7 +138,7 @@ export function DerivedState() {
|
|
|
138
138
|
|
|
139
139
|
let lazy_7 = _$_.track('John', '6015eeca');
|
|
140
140
|
let lazy_8 = _$_.track('Doe', '4fa9a20e');
|
|
141
|
-
const fullName = () => `${
|
|
141
|
+
const fullName = () => `${lazy_7.value} ${lazy_8.value}`;
|
|
142
142
|
|
|
143
143
|
_$_.regular_block(() => {
|
|
144
144
|
_$_.output_push('<div');
|
|
@@ -1172,7 +1172,7 @@ export function ReactiveReturnTrueToFalse() {
|
|
|
1172
1172
|
_$_.regular_block(() => {
|
|
1173
1173
|
_$_.output_push('<!--[-->');
|
|
1174
1174
|
|
|
1175
|
-
if (
|
|
1175
|
+
if (lazy.value) {
|
|
1176
1176
|
_$_.output_push('<div');
|
|
1177
1177
|
_$_.output_push(' class="guard"');
|
|
1178
1178
|
_$_.output_push('>');
|
|
@@ -1230,7 +1230,7 @@ export function ReactiveReturnFalseToTrue() {
|
|
|
1230
1230
|
_$_.regular_block(() => {
|
|
1231
1231
|
_$_.output_push('<!--[-->');
|
|
1232
1232
|
|
|
1233
|
-
if (
|
|
1233
|
+
if (lazy_1.value) {
|
|
1234
1234
|
_$_.output_push('<div');
|
|
1235
1235
|
_$_.output_push(' class="guard"');
|
|
1236
1236
|
_$_.output_push('>');
|
|
@@ -1301,7 +1301,7 @@ export function ReactiveNestedReturn() {
|
|
|
1301
1301
|
_$_.output_push('</div>');
|
|
1302
1302
|
_$_.output_push('<!--[-->');
|
|
1303
1303
|
|
|
1304
|
-
if (
|
|
1304
|
+
if (lazy_2.value) {
|
|
1305
1305
|
_$_.output_push('<div');
|
|
1306
1306
|
_$_.output_push(' class="b"');
|
|
1307
1307
|
_$_.output_push('>');
|
|
@@ -1717,7 +1717,7 @@ export function ReactiveSiblingReturns() {
|
|
|
1717
1717
|
_$_.regular_block(() => {
|
|
1718
1718
|
_$_.output_push('<!--[-->');
|
|
1719
1719
|
|
|
1720
|
-
if (
|
|
1720
|
+
if (lazy_3.value === 'first') {
|
|
1721
1721
|
_$_.output_push('<div');
|
|
1722
1722
|
_$_.output_push(' class="first"');
|
|
1723
1723
|
_$_.output_push('>');
|
|
@@ -1739,7 +1739,7 @@ export function ReactiveSiblingReturns() {
|
|
|
1739
1739
|
if (!__r_38) {
|
|
1740
1740
|
_$_.output_push('<!--[-->');
|
|
1741
1741
|
|
|
1742
|
-
if (
|
|
1742
|
+
if (lazy_3.value === 'second') {
|
|
1743
1743
|
_$_.output_push('<div');
|
|
1744
1744
|
_$_.output_push(' class="second"');
|
|
1745
1745
|
_$_.output_push('>');
|
|
@@ -1813,7 +1813,7 @@ export function ReactiveOuterInnerReturns() {
|
|
|
1813
1813
|
_$_.regular_block(() => {
|
|
1814
1814
|
_$_.output_push('<!--[-->');
|
|
1815
1815
|
|
|
1816
|
-
if (
|
|
1816
|
+
if (lazy_4.value) {
|
|
1817
1817
|
_$_.output_push('<div');
|
|
1818
1818
|
_$_.output_push(' class="a"');
|
|
1819
1819
|
_$_.output_push('>');
|
|
@@ -1825,7 +1825,7 @@ export function ReactiveOuterInnerReturns() {
|
|
|
1825
1825
|
_$_.output_push('</div>');
|
|
1826
1826
|
_$_.output_push('<!--[-->');
|
|
1827
1827
|
|
|
1828
|
-
if (
|
|
1828
|
+
if (lazy_5.value) {
|
|
1829
1829
|
_$_.output_push('<div');
|
|
1830
1830
|
_$_.output_push(' class="b"');
|
|
1831
1831
|
_$_.output_push('>');
|
|
@@ -1853,7 +1853,7 @@ export function ReactiveOuterInnerReturns() {
|
|
|
1853
1853
|
_$_.output_push('>');
|
|
1854
1854
|
|
|
1855
1855
|
{
|
|
1856
|
-
_$_.output_push(_$_.escape(
|
|
1856
|
+
_$_.output_push(_$_.escape(lazy_4.value ? 'a-on rest' : 'a-off rest'));
|
|
1857
1857
|
}
|
|
1858
1858
|
|
|
1859
1859
|
_$_.output_push('</div>');
|
|
@@ -1887,7 +1887,7 @@ export function ReactiveElseIfReturns() {
|
|
|
1887
1887
|
_$_.regular_block(() => {
|
|
1888
1888
|
_$_.output_push('<!--[-->');
|
|
1889
1889
|
|
|
1890
|
-
if (
|
|
1890
|
+
if (lazy_6.value === 0) {
|
|
1891
1891
|
_$_.output_push('<div');
|
|
1892
1892
|
_$_.output_push(' class="zero"');
|
|
1893
1893
|
_$_.output_push('>');
|
|
@@ -1901,7 +1901,7 @@ export function ReactiveElseIfReturns() {
|
|
|
1901
1901
|
} else {
|
|
1902
1902
|
_$_.output_push('<!--[-->');
|
|
1903
1903
|
|
|
1904
|
-
if (
|
|
1904
|
+
if (lazy_6.value === 1) {
|
|
1905
1905
|
_$_.output_push('<div');
|
|
1906
1906
|
_$_.output_push(' class="one"');
|
|
1907
1907
|
_$_.output_push('>');
|
|
@@ -2025,7 +2025,7 @@ export function ReactiveDeepNestedIndependentReturns() {
|
|
|
2025
2025
|
_$_.regular_block(() => {
|
|
2026
2026
|
_$_.output_push('<!--[-->');
|
|
2027
2027
|
|
|
2028
|
-
if (
|
|
2028
|
+
if (lazy_7.value) {
|
|
2029
2029
|
_$_.output_push('<div');
|
|
2030
2030
|
_$_.output_push(' class="hit-1"');
|
|
2031
2031
|
_$_.output_push('>');
|
|
@@ -2070,7 +2070,7 @@ export function ReactiveDeepNestedIndependentReturns() {
|
|
|
2070
2070
|
_$_.output_push('</div>');
|
|
2071
2071
|
_$_.output_push('<!--[-->');
|
|
2072
2072
|
|
|
2073
|
-
if (
|
|
2073
|
+
if (lazy_8.value) {
|
|
2074
2074
|
_$_.output_push('<div');
|
|
2075
2075
|
_$_.output_push(' class="hit-2"');
|
|
2076
2076
|
_$_.output_push('>');
|
|
@@ -2112,7 +2112,7 @@ export function ReactiveDeepNestedIndependentReturns() {
|
|
|
2112
2112
|
_$_.output_push('</div>');
|
|
2113
2113
|
_$_.output_push('<!--[-->');
|
|
2114
2114
|
|
|
2115
|
-
if (
|
|
2115
|
+
if (lazy_9.value) {
|
|
2116
2116
|
_$_.output_push('<div');
|
|
2117
2117
|
_$_.output_push(' class="hit-3"');
|
|
2118
2118
|
_$_.output_push('>');
|
|
@@ -2140,7 +2140,7 @@ export function ReactiveDeepNestedIndependentReturns() {
|
|
|
2140
2140
|
_$_.output_push('</div>');
|
|
2141
2141
|
_$_.output_push('<!--[-->');
|
|
2142
2142
|
|
|
2143
|
-
if (
|
|
2143
|
+
if (lazy_10.value) {
|
|
2144
2144
|
_$_.output_push('<div');
|
|
2145
2145
|
_$_.output_push(' class="hit-4"');
|
|
2146
2146
|
_$_.output_push('>');
|
|
@@ -68,7 +68,7 @@ export function SwitchReactive() {
|
|
|
68
68
|
_$_.regular_block(() => {
|
|
69
69
|
_$_.output_push('<!--[-->');
|
|
70
70
|
|
|
71
|
-
switch (
|
|
71
|
+
switch (lazy.value) {
|
|
72
72
|
case 'a':
|
|
73
73
|
_$_.output_push('<div');
|
|
74
74
|
_$_.output_push(' class="case-a"');
|
|
@@ -162,7 +162,7 @@ export function SwitchNumericLevels() {
|
|
|
162
162
|
_$_.regular_block(() => {
|
|
163
163
|
_$_.output_push('<!--[-->');
|
|
164
164
|
|
|
165
|
-
switch (
|
|
165
|
+
switch (lazy_1.value) {
|
|
166
166
|
case 1:
|
|
167
167
|
_$_.output_push('<div');
|
|
168
168
|
_$_.output_push(' class="level-1"');
|
|
@@ -220,7 +220,7 @@ export function SwitchBlockScoped() {
|
|
|
220
220
|
_$_.regular_block(() => {
|
|
221
221
|
_$_.output_push('<!--[-->');
|
|
222
222
|
|
|
223
|
-
switch (
|
|
223
|
+
switch (lazy_2.value) {
|
|
224
224
|
case 1:
|
|
225
225
|
_$_.output_push('<div');
|
|
226
226
|
_$_.output_push(' class="block-1"');
|
|
@@ -278,7 +278,7 @@ export function SwitchNoBreak() {
|
|
|
278
278
|
_$_.regular_block(() => {
|
|
279
279
|
_$_.output_push('<!--[-->');
|
|
280
280
|
|
|
281
|
-
switch (
|
|
281
|
+
switch (lazy_3.value) {
|
|
282
282
|
case 1:
|
|
283
283
|
_$_.output_push('<div');
|
|
284
284
|
_$_.output_push(' class="nobreak-1"');
|
|
@@ -38,7 +38,7 @@ export function AsyncWithServerCall() {
|
|
|
38
38
|
() => {
|
|
39
39
|
_$_.output_push('<!--[-->');
|
|
40
40
|
|
|
41
|
-
let lazy_1 = _$_.track_async(() => formatValue(
|
|
41
|
+
let lazy_1 = _$_.track_async(() => formatValue(lazy.value), 'f0c2b41e');
|
|
42
42
|
|
|
43
43
|
_$_.regular_block(() => {
|
|
44
44
|
_$_.output_push('<p');
|
|
@@ -46,7 +46,7 @@ export function AsyncWithServerCall() {
|
|
|
46
46
|
_$_.output_push('>');
|
|
47
47
|
|
|
48
48
|
{
|
|
49
|
-
_$_.output_push(_$_.escape(
|
|
49
|
+
_$_.output_push(_$_.escape(lazy_1.value));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
_$_.output_push('</p>');
|
|
@@ -92,7 +92,7 @@ export function AsyncSimpleValue() {
|
|
|
92
92
|
_$_.output_push('>');
|
|
93
93
|
|
|
94
94
|
{
|
|
95
|
-
_$_.output_push(_$_.escape(
|
|
95
|
+
_$_.output_push(_$_.escape(lazy_2.value));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
_$_.output_push('</p>');
|
|
@@ -138,7 +138,7 @@ export function AsyncNumericValue() {
|
|
|
138
138
|
_$_.output_push('>');
|
|
139
139
|
|
|
140
140
|
{
|
|
141
|
-
_$_.output_push(_$_.escape(
|
|
141
|
+
_$_.output_push(_$_.escape(lazy_3.value));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
_$_.output_push('</span>');
|
|
@@ -189,7 +189,7 @@ export function AsyncObjectValue() {
|
|
|
189
189
|
_$_.output_push('>');
|
|
190
190
|
|
|
191
191
|
{
|
|
192
|
-
_$_.output_push(_$_.escape(
|
|
192
|
+
_$_.output_push(_$_.escape(lazy_4.value.name));
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
_$_.output_push('</span>');
|
|
@@ -198,7 +198,7 @@ export function AsyncObjectValue() {
|
|
|
198
198
|
_$_.output_push('>');
|
|
199
199
|
|
|
200
200
|
{
|
|
201
|
-
_$_.output_push(_$_.escape(
|
|
201
|
+
_$_.output_push(_$_.escape(lazy_4.value.age));
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
_$_.output_push('</span>');
|
|
@@ -253,7 +253,7 @@ export function AsyncMultipleValues() {
|
|
|
253
253
|
_$_.output_push('>');
|
|
254
254
|
|
|
255
255
|
{
|
|
256
|
-
_$_.output_push(_$_.escape(
|
|
256
|
+
_$_.output_push(_$_.escape(lazy_5.value));
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
_$_.output_push('</span>');
|
|
@@ -262,7 +262,7 @@ export function AsyncMultipleValues() {
|
|
|
262
262
|
_$_.output_push('>');
|
|
263
263
|
|
|
264
264
|
{
|
|
265
|
-
_$_.output_push(_$_.escape(
|
|
265
|
+
_$_.output_push(_$_.escape(lazy_6.value));
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
_$_.output_push('</span>');
|
|
@@ -311,7 +311,7 @@ export function AsyncWithCatch() {
|
|
|
311
311
|
_$_.output_push('>');
|
|
312
312
|
|
|
313
313
|
{
|
|
314
|
-
_$_.output_push(_$_.escape(
|
|
314
|
+
_$_.output_push(_$_.escape(lazy_7.value));
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
_$_.output_push('</p>');
|
|
@@ -373,7 +373,7 @@ export function ChildWithError() {
|
|
|
373
373
|
_$_.output_push('>');
|
|
374
374
|
|
|
375
375
|
{
|
|
376
|
-
_$_.output_push(_$_.escape(
|
|
376
|
+
_$_.output_push(_$_.escape(lazy_8.value));
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
_$_.output_push('</p>');
|
|
@@ -466,7 +466,7 @@ export function AsyncWithReactiveDependency() {
|
|
|
466
466
|
() => {
|
|
467
467
|
_$_.output_push('<!--[-->');
|
|
468
468
|
|
|
469
|
-
let lazy_10 = _$_.track_async(() => Promise.resolve(`count-${
|
|
469
|
+
let lazy_10 = _$_.track_async(() => Promise.resolve(`count-${lazy_9.value}`), 'cdd1adb8');
|
|
470
470
|
|
|
471
471
|
_$_.regular_block(() => {
|
|
472
472
|
_$_.output_push('<p');
|
|
@@ -474,7 +474,7 @@ export function AsyncWithReactiveDependency() {
|
|
|
474
474
|
_$_.output_push('>');
|
|
475
475
|
|
|
476
476
|
{
|
|
477
|
-
_$_.output_push(_$_.escape(
|
|
477
|
+
_$_.output_push(_$_.escape(lazy_10.value));
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
_$_.output_push('</p>');
|
|
@@ -3,6 +3,118 @@ import * as _$_ from 'ripple/internal/server';
|
|
|
3
3
|
|
|
4
4
|
import { trackAsync } from 'ripple/server';
|
|
5
5
|
|
|
6
|
+
export function RootPending() {
|
|
7
|
+
_$_.push_component();
|
|
8
|
+
|
|
9
|
+
_$_.regular_block(() => {
|
|
10
|
+
_$_.output_push('<p');
|
|
11
|
+
_$_.output_push(' class="root-pending"');
|
|
12
|
+
_$_.output_push('>');
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
_$_.output_push('root loading...');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_$_.output_push('</p>');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
_$_.pop_component();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function RootCatch({ error, reset }) {
|
|
25
|
+
_$_.push_component();
|
|
26
|
+
|
|
27
|
+
_$_.regular_block(() => {
|
|
28
|
+
_$_.output_push('<section');
|
|
29
|
+
_$_.output_push(' class="root-catch"');
|
|
30
|
+
_$_.output_push('>');
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
_$_.output_push('<p');
|
|
34
|
+
_$_.output_push(' class="root-error"');
|
|
35
|
+
_$_.output_push('>');
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
_$_.output_push(_$_.escape(error.message));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_$_.output_push('</p>');
|
|
42
|
+
_$_.output_push('<button');
|
|
43
|
+
_$_.output_push(' class="root-reset"');
|
|
44
|
+
_$_.output_push('>');
|
|
45
|
+
|
|
46
|
+
{
|
|
47
|
+
_$_.output_push('retry');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_$_.output_push('</button>');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
_$_.output_push('</section>');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
_$_.pop_component();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function RootThrows() {
|
|
60
|
+
_$_.push_component();
|
|
61
|
+
|
|
62
|
+
throw new Error('root exploded');
|
|
63
|
+
|
|
64
|
+
_$_.regular_block(() => {
|
|
65
|
+
_$_.output_push('<p');
|
|
66
|
+
_$_.output_push('>');
|
|
67
|
+
|
|
68
|
+
{
|
|
69
|
+
_$_.output_push('should not render');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
_$_.output_push('</p>');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
_$_.pop_component();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function RootAsyncDirect() {
|
|
79
|
+
_$_.push_component();
|
|
80
|
+
|
|
81
|
+
let lazy = _$_.track_async(() => Promise.resolve('root async value'), 'd6bf9e33');
|
|
82
|
+
|
|
83
|
+
_$_.regular_block(() => {
|
|
84
|
+
_$_.output_push('<p');
|
|
85
|
+
_$_.output_push(' class="root-async-value"');
|
|
86
|
+
_$_.output_push('>');
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
_$_.output_push(_$_.escape(lazy.value));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
_$_.output_push('</p>');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
_$_.pop_component();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function RootAsyncRejects() {
|
|
99
|
+
_$_.push_component();
|
|
100
|
+
|
|
101
|
+
let lazy_1 = _$_.track_async(() => Promise.reject(new Error('root async failed')), 'd2fe7b64');
|
|
102
|
+
|
|
103
|
+
_$_.regular_block(() => {
|
|
104
|
+
_$_.output_push('<p');
|
|
105
|
+
_$_.output_push(' class="root-async-value"');
|
|
106
|
+
_$_.output_push('>');
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
_$_.output_push(_$_.escape(lazy_1.value));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_$_.output_push('</p>');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
_$_.pop_component();
|
|
116
|
+
}
|
|
117
|
+
|
|
6
118
|
export function AsyncListInTryPending() {
|
|
7
119
|
_$_.push_component();
|
|
8
120
|
|
|
@@ -47,7 +159,7 @@ export function AsyncListInTryPending() {
|
|
|
47
159
|
function AsyncList() {
|
|
48
160
|
_$_.push_component();
|
|
49
161
|
|
|
50
|
-
let
|
|
162
|
+
let lazy_2 = _$_.track_async(() => Promise.resolve(['alpha', 'beta', 'gamma']), 'b3d31627');
|
|
51
163
|
|
|
52
164
|
_$_.regular_block(() => {
|
|
53
165
|
_$_.output_push('<ul');
|
|
@@ -57,7 +169,7 @@ function AsyncList() {
|
|
|
57
169
|
{
|
|
58
170
|
_$_.output_push('<!--[-->');
|
|
59
171
|
|
|
60
|
-
for (let item of
|
|
172
|
+
for (let item of lazy_2.value) {
|
|
61
173
|
_$_.output_push('<li');
|
|
62
174
|
_$_.output_push('>');
|
|
63
175
|
|
|
@@ -133,7 +245,7 @@ export function AsyncTryWithLeadingSibling() {
|
|
|
133
245
|
function AsyncContent() {
|
|
134
246
|
_$_.push_component();
|
|
135
247
|
|
|
136
|
-
let
|
|
248
|
+
let lazy_3 = _$_.track_async(() => Promise.resolve('ready'), '15ea8758');
|
|
137
249
|
|
|
138
250
|
_$_.regular_block(() => {
|
|
139
251
|
_$_.output_push('<div');
|
|
@@ -141,7 +253,7 @@ function AsyncContent() {
|
|
|
141
253
|
_$_.output_push('>');
|
|
142
254
|
|
|
143
255
|
{
|
|
144
|
-
_$_.output_push(_$_.escape(
|
|
256
|
+
_$_.output_push(_$_.escape(lazy_3.value));
|
|
145
257
|
}
|
|
146
258
|
|
|
147
259
|
_$_.output_push('</div>');
|