ripple 0.3.7 → 0.3.9
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 +14 -0
- package/package.json +2 -2
- package/src/compiler/phases/1-parse/index.js +48 -349
- package/src/compiler/phases/2-analyze/index.js +343 -52
- package/src/compiler/phases/3-transform/client/index.js +28 -160
- package/src/compiler/phases/3-transform/segments.js +0 -7
- package/src/compiler/phases/3-transform/server/index.js +31 -154
- package/src/compiler/types/acorn.d.ts +1 -1
- package/src/compiler/types/estree.d.ts +1 -1
- package/src/compiler/types/import.d.ts +0 -2
- package/src/compiler/types/index.d.ts +5 -17
- package/src/compiler/types/parse.d.ts +1 -17
- package/src/compiler/utils.js +53 -20
- package/src/runtime/index-client.js +2 -13
- package/src/runtime/index-server.js +2 -2
- package/src/runtime/internal/client/bindings.js +3 -1
- package/src/runtime/internal/client/composite.js +3 -2
- package/src/runtime/internal/client/events.js +1 -1
- package/src/runtime/internal/client/head.js +3 -4
- package/src/runtime/internal/client/index.js +0 -1
- package/src/runtime/internal/client/runtime.js +0 -52
- package/src/runtime/internal/server/index.js +31 -55
- package/tests/client/array/array.copy-within.test.ripple +12 -12
- package/tests/client/array/array.derived.test.ripple +46 -46
- package/tests/client/array/array.iteration.test.ripple +10 -10
- package/tests/client/array/array.mutations.test.ripple +20 -20
- package/tests/client/array/array.to-methods.test.ripple +6 -6
- package/tests/client/async-suspend.test.ripple +5 -5
- package/tests/client/basic/basic.attributes.test.ripple +81 -81
- package/tests/client/basic/basic.collections.test.ripple +9 -9
- package/tests/client/basic/basic.components.test.ripple +28 -28
- package/tests/client/basic/basic.errors.test.ripple +46 -18
- package/tests/client/basic/basic.events.test.ripple +37 -37
- package/tests/client/basic/basic.get-set.test.ripple +6 -6
- package/tests/client/basic/basic.reactivity.test.ripple +58 -203
- package/tests/client/basic/basic.rendering.test.ripple +19 -19
- package/tests/client/basic/basic.utilities.test.ripple +3 -3
- package/tests/client/boundaries.test.ripple +12 -12
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.ripple.snap +5 -5
- package/tests/client/compiler/compiler.assignments.test.ripple +19 -19
- package/tests/client/compiler/compiler.basic.test.ripple +46 -27
- package/tests/client/compiler/compiler.tracked-access.test.ripple +2 -2
- package/tests/client/composite/composite.dynamic-components.test.ripple +9 -9
- package/tests/client/composite/composite.props.test.ripple +14 -16
- package/tests/client/composite/composite.reactivity.test.ripple +69 -70
- package/tests/client/composite/composite.render.test.ripple +3 -3
- package/tests/client/computed-properties.test.ripple +4 -4
- package/tests/client/date.test.ripple +42 -42
- package/tests/client/dynamic-elements.test.ripple +44 -45
- package/tests/client/events.test.ripple +70 -70
- package/tests/client/for.test.ripple +25 -25
- package/tests/client/head.test.ripple +19 -19
- package/tests/client/html.test.ripple +3 -3
- package/tests/client/input-value.test.ripple +84 -84
- package/tests/client/lazy-destructuring.test.ripple +138 -26
- package/tests/client/map.test.ripple +16 -16
- package/tests/client/media-query.test.ripple +7 -7
- package/tests/client/portal.test.ripple +11 -11
- package/tests/client/ref.test.ripple +4 -4
- package/tests/client/return.test.ripple +52 -52
- package/tests/client/set.test.ripple +6 -6
- package/tests/client/svg.test.ripple +5 -5
- package/tests/client/switch.test.ripple +44 -44
- package/tests/client/try.test.ripple +5 -5
- package/tests/client/url/url.derived.test.ripple +6 -6
- package/tests/client/url-search-params/url-search-params.derived.test.ripple +8 -8
- package/tests/client/url-search-params/url-search-params.iteration.test.ripple +10 -10
- package/tests/client/url-search-params/url-search-params.mutation.test.ripple +10 -10
- package/tests/client/url-search-params/url-search-params.retrieval.test.ripple +18 -18
- package/tests/client/url-search-params/url-search-params.serialization.test.ripple +2 -2
- package/tests/hydration/compiled/client/events.js +25 -25
- package/tests/hydration/compiled/client/for.js +70 -66
- package/tests/hydration/compiled/client/head.js +25 -25
- package/tests/hydration/compiled/client/hmr.js +2 -2
- package/tests/hydration/compiled/client/html.js +3 -3
- package/tests/hydration/compiled/client/if-children.js +24 -24
- package/tests/hydration/compiled/client/if.js +18 -18
- package/tests/hydration/compiled/client/mixed-control-flow.js +9 -9
- package/tests/hydration/compiled/client/portal.js +3 -3
- package/tests/hydration/compiled/client/reactivity.js +16 -16
- package/tests/hydration/compiled/client/return.js +40 -40
- package/tests/hydration/compiled/client/switch.js +12 -12
- package/tests/hydration/compiled/server/events.js +19 -19
- package/tests/hydration/compiled/server/for.js +41 -41
- package/tests/hydration/compiled/server/head.js +26 -26
- package/tests/hydration/compiled/server/hmr.js +2 -2
- package/tests/hydration/compiled/server/html.js +2 -2
- package/tests/hydration/compiled/server/if-children.js +16 -16
- package/tests/hydration/compiled/server/if.js +11 -11
- package/tests/hydration/compiled/server/mixed-control-flow.js +6 -6
- package/tests/hydration/compiled/server/portal.js +2 -2
- package/tests/hydration/compiled/server/reactivity.js +16 -16
- package/tests/hydration/compiled/server/return.js +25 -25
- package/tests/hydration/compiled/server/switch.js +8 -8
- package/tests/hydration/components/events.ripple +25 -25
- package/tests/hydration/components/for.ripple +66 -66
- package/tests/hydration/components/head.ripple +16 -16
- package/tests/hydration/components/hmr.ripple +2 -2
- package/tests/hydration/components/html.ripple +3 -3
- package/tests/hydration/components/if-children.ripple +24 -24
- package/tests/hydration/components/if.ripple +18 -18
- package/tests/hydration/components/mixed-control-flow.ripple +9 -9
- package/tests/hydration/components/portal.ripple +3 -3
- package/tests/hydration/components/reactivity.ripple +16 -16
- package/tests/hydration/components/return.ripple +40 -40
- package/tests/hydration/components/switch.ripple +20 -20
- package/tests/server/await.test.ripple +3 -3
- package/tests/server/basic.attributes.test.ripple +34 -34
- package/tests/server/basic.components.test.ripple +10 -10
- package/tests/server/basic.test.ripple +38 -40
- package/tests/server/compiler.test.ripple +22 -0
- package/tests/server/composite.props.test.ripple +12 -14
- package/tests/server/dynamic-elements.test.ripple +15 -15
- package/tests/server/head.test.ripple +11 -11
- package/tests/server/lazy-destructuring.test.ripple +92 -13
- package/tsconfig.typecheck.json +4 -0
- package/types/index.d.ts +0 -19
- package/tests/client/__snapshots__/tracked-expression.test.ripple.snap +0 -34
- package/tests/client/tracked-expression.test.ripple +0 -26
|
@@ -1170,12 +1170,12 @@ export function ReactiveReturnTrueToFalse(__anchor, _, __block) {
|
|
|
1170
1170
|
_$_.push_component();
|
|
1171
1171
|
|
|
1172
1172
|
var __r_28 = _$_.tracked(false);
|
|
1173
|
-
let
|
|
1173
|
+
let lazy = _$_.track(true, void 0, void 0, __block);
|
|
1174
1174
|
var fragment_59 = root_77();
|
|
1175
1175
|
var button_1 = _$_.first_child_frag(fragment_59);
|
|
1176
1176
|
|
|
1177
1177
|
button_1.__click = () => {
|
|
1178
|
-
_$_.set(
|
|
1178
|
+
_$_.set(lazy, !_$_.get(lazy));
|
|
1179
1179
|
};
|
|
1180
1180
|
|
|
1181
1181
|
var node_51 = _$_.sibling(button_1);
|
|
@@ -1191,7 +1191,7 @@ export function ReactiveReturnTrueToFalse(__anchor, _, __block) {
|
|
|
1191
1191
|
_$_.if(node_51, (__render) => {
|
|
1192
1192
|
_$_.set(__r_28, false);
|
|
1193
1193
|
|
|
1194
|
-
if (_$_.get(
|
|
1194
|
+
if (_$_.get(lazy)) __render(consequent_30);
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
|
|
@@ -1215,12 +1215,12 @@ export function ReactiveReturnFalseToTrue(__anchor, _, __block) {
|
|
|
1215
1215
|
_$_.push_component();
|
|
1216
1216
|
|
|
1217
1217
|
var __r_29 = _$_.tracked(false);
|
|
1218
|
-
let
|
|
1218
|
+
let lazy_1 = _$_.track(false, void 0, void 0, __block);
|
|
1219
1219
|
var fragment_61 = root_80();
|
|
1220
1220
|
var button_2 = _$_.first_child_frag(fragment_61);
|
|
1221
1221
|
|
|
1222
1222
|
button_2.__click = () => {
|
|
1223
|
-
_$_.set(
|
|
1223
|
+
_$_.set(lazy_1, !_$_.get(lazy_1));
|
|
1224
1224
|
};
|
|
1225
1225
|
|
|
1226
1226
|
var node_53 = _$_.sibling(button_2);
|
|
@@ -1236,7 +1236,7 @@ export function ReactiveReturnFalseToTrue(__anchor, _, __block) {
|
|
|
1236
1236
|
_$_.if(node_53, (__render) => {
|
|
1237
1237
|
_$_.set(__r_29, false);
|
|
1238
1238
|
|
|
1239
|
-
if (_$_.get(
|
|
1239
|
+
if (_$_.get(lazy_1)) __render(consequent_31);
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
@@ -1261,12 +1261,12 @@ export function ReactiveNestedReturn(__anchor, _, __block) {
|
|
|
1261
1261
|
|
|
1262
1262
|
var __r_30 = _$_.tracked(false);
|
|
1263
1263
|
let a = true;
|
|
1264
|
-
let
|
|
1264
|
+
let lazy_2 = _$_.track(true, void 0, void 0, __block);
|
|
1265
1265
|
var fragment_63 = root_83();
|
|
1266
1266
|
var button_3 = _$_.first_child_frag(fragment_63);
|
|
1267
1267
|
|
|
1268
1268
|
button_3.__click = () => {
|
|
1269
|
-
_$_.set(
|
|
1269
|
+
_$_.set(lazy_2, !_$_.get(lazy_2));
|
|
1270
1270
|
};
|
|
1271
1271
|
|
|
1272
1272
|
var node_55 = _$_.sibling(button_3);
|
|
@@ -1288,7 +1288,7 @@ export function ReactiveNestedReturn(__anchor, _, __block) {
|
|
|
1288
1288
|
_$_.if(node_56, (__render) => {
|
|
1289
1289
|
_$_.set(__r_30, false);
|
|
1290
1290
|
|
|
1291
|
-
if (_$_.get(
|
|
1291
|
+
if (_$_.get(lazy_2)) __render(consequent_32);
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
1294
|
|
|
@@ -1576,17 +1576,17 @@ export function ReactiveSiblingReturns(__anchor, _, __block) {
|
|
|
1576
1576
|
|
|
1577
1577
|
var __r_39 = _$_.tracked(false);
|
|
1578
1578
|
var __r_38 = _$_.tracked(false);
|
|
1579
|
-
let
|
|
1579
|
+
let lazy_3 = _$_.track('first', void 0, void 0, __block);
|
|
1580
1580
|
var fragment_82 = root_105();
|
|
1581
1581
|
var button_4 = _$_.first_child_frag(fragment_82);
|
|
1582
1582
|
|
|
1583
1583
|
button_4.__click = () => {
|
|
1584
|
-
if (_$_.get(
|
|
1585
|
-
_$_.set(
|
|
1586
|
-
} else if (_$_.get(
|
|
1587
|
-
_$_.set(
|
|
1584
|
+
if (_$_.get(lazy_3) === 'first') {
|
|
1585
|
+
_$_.set(lazy_3, 'second');
|
|
1586
|
+
} else if (_$_.get(lazy_3) === 'second') {
|
|
1587
|
+
_$_.set(lazy_3, 'none');
|
|
1588
1588
|
} else {
|
|
1589
|
-
_$_.set(
|
|
1589
|
+
_$_.set(lazy_3, 'first');
|
|
1590
1590
|
}
|
|
1591
1591
|
};
|
|
1592
1592
|
|
|
@@ -1603,7 +1603,7 @@ export function ReactiveSiblingReturns(__anchor, _, __block) {
|
|
|
1603
1603
|
_$_.if(node_71, (__render) => {
|
|
1604
1604
|
_$_.set(__r_38, false);
|
|
1605
1605
|
|
|
1606
|
-
if (_$_.get(
|
|
1606
|
+
if (_$_.get(lazy_3) === 'first') __render(consequent_41);
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
@@ -1624,7 +1624,7 @@ export function ReactiveSiblingReturns(__anchor, _, __block) {
|
|
|
1624
1624
|
_$_.if(node_73, (__render) => {
|
|
1625
1625
|
_$_.set(__r_39, false);
|
|
1626
1626
|
|
|
1627
|
-
if (_$_.get(
|
|
1627
|
+
if (_$_.get(lazy_3) === 'second') __render(consequent_42);
|
|
1628
1628
|
});
|
|
1629
1629
|
}
|
|
1630
1630
|
|
|
@@ -1655,19 +1655,19 @@ export function ReactiveOuterInnerReturns(__anchor, _, __block) {
|
|
|
1655
1655
|
_$_.push_component();
|
|
1656
1656
|
|
|
1657
1657
|
var __r_40 = _$_.tracked(false);
|
|
1658
|
-
let
|
|
1659
|
-
let
|
|
1658
|
+
let lazy_4 = _$_.track(true, void 0, void 0, __block);
|
|
1659
|
+
let lazy_5 = _$_.track(true, void 0, void 0, __block);
|
|
1660
1660
|
var fragment_86 = root_110();
|
|
1661
1661
|
var button_5 = _$_.first_child_frag(fragment_86);
|
|
1662
1662
|
|
|
1663
1663
|
button_5.__click = () => {
|
|
1664
|
-
_$_.set(
|
|
1664
|
+
_$_.set(lazy_4, !_$_.get(lazy_4));
|
|
1665
1665
|
};
|
|
1666
1666
|
|
|
1667
1667
|
var button_6 = _$_.sibling(button_5);
|
|
1668
1668
|
|
|
1669
1669
|
button_6.__click = () => {
|
|
1670
|
-
_$_.set(
|
|
1670
|
+
_$_.set(lazy_5, !_$_.get(lazy_5));
|
|
1671
1671
|
};
|
|
1672
1672
|
|
|
1673
1673
|
var node_75 = _$_.sibling(button_6);
|
|
@@ -1689,7 +1689,7 @@ export function ReactiveOuterInnerReturns(__anchor, _, __block) {
|
|
|
1689
1689
|
_$_.if(node_76, (__render) => {
|
|
1690
1690
|
_$_.set(__r_40, false);
|
|
1691
1691
|
|
|
1692
|
-
if (_$_.get(
|
|
1692
|
+
if (_$_.get(lazy_5)) __render(consequent_43);
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
|
|
@@ -1699,7 +1699,7 @@ export function ReactiveOuterInnerReturns(__anchor, _, __block) {
|
|
|
1699
1699
|
_$_.if(node_75, (__render) => {
|
|
1700
1700
|
_$_.set(__r_40, false);
|
|
1701
1701
|
|
|
1702
|
-
if (_$_.get(
|
|
1702
|
+
if (_$_.get(lazy_4)) __render(consequent_44);
|
|
1703
1703
|
});
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
@@ -1715,7 +1715,7 @@ export function ReactiveOuterInnerReturns(__anchor, _, __block) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
|
|
1717
1717
|
_$_.render(() => {
|
|
1718
|
-
_$_.set_text(text, _$_.get(
|
|
1718
|
+
_$_.set_text(text, _$_.get(lazy_4) ? 'a-on rest' : 'a-off rest');
|
|
1719
1719
|
});
|
|
1720
1720
|
|
|
1721
1721
|
_$_.append(__anchor, div_39);
|
|
@@ -1734,12 +1734,12 @@ export function ReactiveElseIfReturns(__anchor, _, __block) {
|
|
|
1734
1734
|
|
|
1735
1735
|
var __r_42 = _$_.tracked(false);
|
|
1736
1736
|
var __r_41 = _$_.tracked(false);
|
|
1737
|
-
let
|
|
1737
|
+
let lazy_6 = _$_.track(0, void 0, void 0, __block);
|
|
1738
1738
|
var fragment_89 = root_114();
|
|
1739
1739
|
var button_7 = _$_.first_child_frag(fragment_89);
|
|
1740
1740
|
|
|
1741
1741
|
button_7.__click = () => {
|
|
1742
|
-
_$_.set(
|
|
1742
|
+
_$_.set(lazy_6, (_$_.get(lazy_6) + 1) % 3);
|
|
1743
1743
|
};
|
|
1744
1744
|
|
|
1745
1745
|
var node_78 = _$_.sibling(button_7);
|
|
@@ -1767,7 +1767,7 @@ export function ReactiveElseIfReturns(__anchor, _, __block) {
|
|
|
1767
1767
|
_$_.if(node_79, (__render) => {
|
|
1768
1768
|
_$_.set(__r_42, false);
|
|
1769
1769
|
|
|
1770
|
-
if (_$_.get(
|
|
1770
|
+
if (_$_.get(lazy_6) === 1) __render(consequent_46);
|
|
1771
1771
|
});
|
|
1772
1772
|
}
|
|
1773
1773
|
|
|
@@ -1780,7 +1780,7 @@ export function ReactiveElseIfReturns(__anchor, _, __block) {
|
|
|
1780
1780
|
_$_.set(__r_41, false);
|
|
1781
1781
|
_$_.set(__r_42, false);
|
|
1782
1782
|
|
|
1783
|
-
if (_$_.get(
|
|
1783
|
+
if (_$_.get(lazy_6) === 0) __render(consequent_45); else __render(alternate_8, false);
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
@@ -1808,33 +1808,33 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1808
1808
|
var __r_45 = _$_.tracked(false);
|
|
1809
1809
|
var __r_44 = _$_.tracked(false);
|
|
1810
1810
|
var __r_43 = _$_.tracked(false);
|
|
1811
|
-
let
|
|
1812
|
-
let
|
|
1813
|
-
let
|
|
1814
|
-
let
|
|
1811
|
+
let lazy_7 = _$_.track(false, void 0, void 0, __block);
|
|
1812
|
+
let lazy_8 = _$_.track(false, void 0, void 0, __block);
|
|
1813
|
+
let lazy_9 = _$_.track(false, void 0, void 0, __block);
|
|
1814
|
+
let lazy_10 = _$_.track(false, void 0, void 0, __block);
|
|
1815
1815
|
var fragment_94 = root_119();
|
|
1816
1816
|
var button_8 = _$_.first_child_frag(fragment_94);
|
|
1817
1817
|
|
|
1818
1818
|
button_8.__click = () => {
|
|
1819
|
-
_$_.set(
|
|
1819
|
+
_$_.set(lazy_7, !_$_.get(lazy_7));
|
|
1820
1820
|
};
|
|
1821
1821
|
|
|
1822
1822
|
var button_9 = _$_.sibling(button_8);
|
|
1823
1823
|
|
|
1824
1824
|
button_9.__click = () => {
|
|
1825
|
-
_$_.set(
|
|
1825
|
+
_$_.set(lazy_8, !_$_.get(lazy_8));
|
|
1826
1826
|
};
|
|
1827
1827
|
|
|
1828
1828
|
var button_10 = _$_.sibling(button_9);
|
|
1829
1829
|
|
|
1830
1830
|
button_10.__click = () => {
|
|
1831
|
-
_$_.set(
|
|
1831
|
+
_$_.set(lazy_9, !_$_.get(lazy_9));
|
|
1832
1832
|
};
|
|
1833
1833
|
|
|
1834
1834
|
var button_11 = _$_.sibling(button_10);
|
|
1835
1835
|
|
|
1836
1836
|
button_11.__click = () => {
|
|
1837
|
-
_$_.set(
|
|
1837
|
+
_$_.set(lazy_10, !_$_.get(lazy_10));
|
|
1838
1838
|
};
|
|
1839
1839
|
|
|
1840
1840
|
var div_40 = _$_.sibling(button_11);
|
|
@@ -1851,7 +1851,7 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1851
1851
|
_$_.if(node_81, (__render) => {
|
|
1852
1852
|
_$_.set(__r_43, false);
|
|
1853
1853
|
|
|
1854
|
-
if (_$_.get(
|
|
1854
|
+
if (_$_.get(lazy_7)) __render(consequent_47);
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
1857
|
|
|
@@ -1877,7 +1877,7 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1877
1877
|
_$_.if(node_83, (__render) => {
|
|
1878
1878
|
_$_.set(__r_44, false);
|
|
1879
1879
|
|
|
1880
|
-
if (_$_.get(
|
|
1880
|
+
if (_$_.get(lazy_8)) __render(consequent_48);
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
|
|
@@ -1903,7 +1903,7 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1903
1903
|
_$_.if(node_85, (__render) => {
|
|
1904
1904
|
_$_.set(__r_45, false);
|
|
1905
1905
|
|
|
1906
|
-
if (_$_.get(
|
|
1906
|
+
if (_$_.get(lazy_9)) __render(consequent_49);
|
|
1907
1907
|
});
|
|
1908
1908
|
}
|
|
1909
1909
|
|
|
@@ -1925,7 +1925,7 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1925
1925
|
_$_.if(node_87, (__render) => {
|
|
1926
1926
|
_$_.set(__r_46, false);
|
|
1927
1927
|
|
|
1928
|
-
if (_$_.get(
|
|
1928
|
+
if (_$_.get(lazy_10)) __render(consequent_50);
|
|
1929
1929
|
});
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
@@ -79,12 +79,12 @@ export function SwitchStatic(__anchor, _, __block) {
|
|
|
79
79
|
export function SwitchReactive(__anchor, _, __block) {
|
|
80
80
|
_$_.push_component();
|
|
81
81
|
|
|
82
|
-
let
|
|
82
|
+
let lazy = _$_.track('a', void 0, void 0, __block);
|
|
83
83
|
var fragment_3 = root_4();
|
|
84
84
|
var button_1 = _$_.first_child_frag(fragment_3);
|
|
85
85
|
|
|
86
86
|
button_1.__click = () => {
|
|
87
|
-
if (_$_.get(
|
|
87
|
+
if (_$_.get(lazy) === 'a') _$_.set(lazy, 'b'); else if (_$_.get(lazy) === 'b') _$_.set(lazy, 'c'); else _$_.set(lazy, 'a');
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
var node_1 = _$_.sibling(button_1);
|
|
@@ -111,7 +111,7 @@ export function SwitchReactive(__anchor, _, __block) {
|
|
|
111
111
|
_$_.switch(node_1, () => {
|
|
112
112
|
var result = [];
|
|
113
113
|
|
|
114
|
-
switch (_$_.get(
|
|
114
|
+
switch (_$_.get(lazy)) {
|
|
115
115
|
case 'a':
|
|
116
116
|
result.push(switch_case_0_1);
|
|
117
117
|
return result;
|
|
@@ -175,12 +175,12 @@ export function SwitchFallthrough(__anchor, _, __block) {
|
|
|
175
175
|
export function SwitchNumericLevels(__anchor, _, __block) {
|
|
176
176
|
_$_.push_component();
|
|
177
177
|
|
|
178
|
-
let
|
|
178
|
+
let lazy_1 = _$_.track(1, void 0, void 0, __block);
|
|
179
179
|
var fragment_8 = root_11();
|
|
180
180
|
var button_2 = _$_.first_child_frag(fragment_8);
|
|
181
181
|
|
|
182
182
|
button_2.__click = () => {
|
|
183
|
-
if (_$_.get(
|
|
183
|
+
if (_$_.get(lazy_1) === 1) _$_.set(lazy_1, 2); else if (_$_.get(lazy_1) === 2) _$_.set(lazy_1, 3); else _$_.set(lazy_1, 1);
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
var node_3 = _$_.sibling(button_2);
|
|
@@ -207,7 +207,7 @@ export function SwitchNumericLevels(__anchor, _, __block) {
|
|
|
207
207
|
_$_.switch(node_3, () => {
|
|
208
208
|
var result = [];
|
|
209
209
|
|
|
210
|
-
switch (_$_.get(
|
|
210
|
+
switch (_$_.get(lazy_1)) {
|
|
211
211
|
case 1:
|
|
212
212
|
result.push(switch_case_0_3);
|
|
213
213
|
return result;
|
|
@@ -230,12 +230,12 @@ export function SwitchNumericLevels(__anchor, _, __block) {
|
|
|
230
230
|
export function SwitchBlockScoped(__anchor, _, __block) {
|
|
231
231
|
_$_.push_component();
|
|
232
232
|
|
|
233
|
-
let
|
|
233
|
+
let lazy_2 = _$_.track(1, void 0, void 0, __block);
|
|
234
234
|
var fragment_12 = root_15();
|
|
235
235
|
var button_3 = _$_.first_child_frag(fragment_12);
|
|
236
236
|
|
|
237
237
|
button_3.__click = () => {
|
|
238
|
-
if (_$_.get(
|
|
238
|
+
if (_$_.get(lazy_2) === 1) _$_.set(lazy_2, 2); else if (_$_.get(lazy_2) === 2) _$_.set(lazy_2, 3); else _$_.set(lazy_2, 1);
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
var node_4 = _$_.sibling(button_3);
|
|
@@ -262,7 +262,7 @@ export function SwitchBlockScoped(__anchor, _, __block) {
|
|
|
262
262
|
_$_.switch(node_4, () => {
|
|
263
263
|
var result = [];
|
|
264
264
|
|
|
265
|
-
switch (_$_.get(
|
|
265
|
+
switch (_$_.get(lazy_2)) {
|
|
266
266
|
case 1:
|
|
267
267
|
result.push(switch_case_0_4);
|
|
268
268
|
return result;
|
|
@@ -285,12 +285,12 @@ export function SwitchBlockScoped(__anchor, _, __block) {
|
|
|
285
285
|
export function SwitchNoBreak(__anchor, _, __block) {
|
|
286
286
|
_$_.push_component();
|
|
287
287
|
|
|
288
|
-
let
|
|
288
|
+
let lazy_3 = _$_.track(1, void 0, void 0, __block);
|
|
289
289
|
var fragment_16 = root_19();
|
|
290
290
|
var button_4 = _$_.first_child_frag(fragment_16);
|
|
291
291
|
|
|
292
292
|
button_4.__click = () => {
|
|
293
|
-
if (_$_.get(
|
|
293
|
+
if (_$_.get(lazy_3) === 1) _$_.set(lazy_3, 2); else if (_$_.get(lazy_3) === 2) _$_.set(lazy_3, 3); else _$_.set(lazy_3, 1);
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
var node_5 = _$_.sibling(button_4);
|
|
@@ -317,7 +317,7 @@ export function SwitchNoBreak(__anchor, _, __block) {
|
|
|
317
317
|
_$_.switch(node_5, () => {
|
|
318
318
|
var result = [];
|
|
319
319
|
|
|
320
|
-
switch (_$_.get(
|
|
320
|
+
switch (_$_.get(lazy_3)) {
|
|
321
321
|
case 1:
|
|
322
322
|
result.push(switch_case_0_5);
|
|
323
323
|
|
|
@@ -6,7 +6,7 @@ import { track } from 'ripple/server';
|
|
|
6
6
|
export function ClickCounter(__output) {
|
|
7
7
|
_$_.push_component();
|
|
8
8
|
|
|
9
|
-
let
|
|
9
|
+
let lazy = _$_.track(0);
|
|
10
10
|
|
|
11
11
|
__output.push('<div');
|
|
12
12
|
__output.push('>');
|
|
@@ -26,7 +26,7 @@ export function ClickCounter(__output) {
|
|
|
26
26
|
__output.push('>');
|
|
27
27
|
|
|
28
28
|
{
|
|
29
|
-
__output.push(_$_.escape(_$_.get(
|
|
29
|
+
__output.push(_$_.escape(_$_.get(lazy)));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
__output.push('</span>');
|
|
@@ -39,7 +39,7 @@ export function ClickCounter(__output) {
|
|
|
39
39
|
export function IncrementDecrement(__output) {
|
|
40
40
|
_$_.push_component();
|
|
41
41
|
|
|
42
|
-
let
|
|
42
|
+
let lazy_1 = _$_.track(0);
|
|
43
43
|
|
|
44
44
|
__output.push('<div');
|
|
45
45
|
__output.push('>');
|
|
@@ -59,7 +59,7 @@ export function IncrementDecrement(__output) {
|
|
|
59
59
|
__output.push('>');
|
|
60
60
|
|
|
61
61
|
{
|
|
62
|
-
__output.push(_$_.escape(_$_.get(
|
|
62
|
+
__output.push(_$_.escape(_$_.get(lazy_1)));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
__output.push('</span>');
|
|
@@ -81,8 +81,8 @@ export function IncrementDecrement(__output) {
|
|
|
81
81
|
export function MultipleEvents(__output) {
|
|
82
82
|
_$_.push_component();
|
|
83
83
|
|
|
84
|
-
let
|
|
85
|
-
let
|
|
84
|
+
let lazy_2 = _$_.track(0);
|
|
85
|
+
let lazy_3 = _$_.track(0);
|
|
86
86
|
|
|
87
87
|
__output.push('<div');
|
|
88
88
|
__output.push('>');
|
|
@@ -102,7 +102,7 @@ export function MultipleEvents(__output) {
|
|
|
102
102
|
__output.push('>');
|
|
103
103
|
|
|
104
104
|
{
|
|
105
|
-
__output.push(_$_.escape(_$_.get(
|
|
105
|
+
__output.push(_$_.escape(_$_.get(lazy_2)));
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
__output.push('</span>');
|
|
@@ -111,7 +111,7 @@ export function MultipleEvents(__output) {
|
|
|
111
111
|
__output.push('>');
|
|
112
112
|
|
|
113
113
|
{
|
|
114
|
-
__output.push(_$_.escape(_$_.get(
|
|
114
|
+
__output.push(_$_.escape(_$_.get(lazy_3)));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
__output.push('</span>');
|
|
@@ -124,12 +124,12 @@ export function MultipleEvents(__output) {
|
|
|
124
124
|
export function MultiStateUpdate(__output) {
|
|
125
125
|
_$_.push_component();
|
|
126
126
|
|
|
127
|
-
let
|
|
128
|
-
let
|
|
127
|
+
let lazy_4 = _$_.track(0);
|
|
128
|
+
let lazy_5 = _$_.track('none');
|
|
129
129
|
|
|
130
130
|
const handleClick = () => {
|
|
131
|
-
_$_.update(
|
|
132
|
-
_$_.set(
|
|
131
|
+
_$_.update(lazy_4);
|
|
132
|
+
_$_.set(lazy_5, 'increment');
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
__output.push('<div');
|
|
@@ -150,7 +150,7 @@ export function MultiStateUpdate(__output) {
|
|
|
150
150
|
__output.push('>');
|
|
151
151
|
|
|
152
152
|
{
|
|
153
|
-
__output.push(_$_.escape(_$_.get(
|
|
153
|
+
__output.push(_$_.escape(_$_.get(lazy_4)));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
__output.push('</span>');
|
|
@@ -159,7 +159,7 @@ export function MultiStateUpdate(__output) {
|
|
|
159
159
|
__output.push('>');
|
|
160
160
|
|
|
161
161
|
{
|
|
162
|
-
__output.push(_$_.escape(_$_.get(
|
|
162
|
+
__output.push(_$_.escape(_$_.get(lazy_5)));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
__output.push('</span>');
|
|
@@ -172,7 +172,7 @@ export function MultiStateUpdate(__output) {
|
|
|
172
172
|
export function ToggleButton(__output) {
|
|
173
173
|
_$_.push_component();
|
|
174
174
|
|
|
175
|
-
let
|
|
175
|
+
let lazy_6 = _$_.track(false);
|
|
176
176
|
|
|
177
177
|
__output.push('<div');
|
|
178
178
|
__output.push('>');
|
|
@@ -183,7 +183,7 @@ export function ToggleButton(__output) {
|
|
|
183
183
|
__output.push('>');
|
|
184
184
|
|
|
185
185
|
{
|
|
186
|
-
__output.push(_$_.escape(_$_.get(
|
|
186
|
+
__output.push(_$_.escape(_$_.get(lazy_6) ? 'ON' : 'OFF'));
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
__output.push('</button>');
|
|
@@ -210,7 +210,7 @@ export function ChildButton(__output, props) {
|
|
|
210
210
|
export function ParentWithChildButton(__output) {
|
|
211
211
|
_$_.push_component();
|
|
212
212
|
|
|
213
|
-
let
|
|
213
|
+
let lazy_7 = _$_.track(0);
|
|
214
214
|
|
|
215
215
|
__output.push('<div');
|
|
216
216
|
__output.push('>');
|
|
@@ -223,7 +223,7 @@ export function ParentWithChildButton(__output) {
|
|
|
223
223
|
__output,
|
|
224
224
|
{
|
|
225
225
|
onClick: () => {
|
|
226
|
-
_$_.update(
|
|
226
|
+
_$_.update(lazy_7);
|
|
227
227
|
},
|
|
228
228
|
label: "Click me"
|
|
229
229
|
}
|
|
@@ -237,7 +237,7 @@ export function ParentWithChildButton(__output) {
|
|
|
237
237
|
__output.push('>');
|
|
238
238
|
|
|
239
239
|
{
|
|
240
|
-
__output.push(_$_.escape(_$_.get(
|
|
240
|
+
__output.push(_$_.escape(_$_.get(lazy_7)));
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
__output.push('</span>');
|