ripple 0.2.216 → 0.3.1
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 +52 -0
- package/package.json +16 -7
- package/src/compiler/errors.js +1 -1
- package/src/compiler/identifier-utils.js +2 -0
- package/src/compiler/index.d.ts +2 -6
- package/src/compiler/phases/1-parse/index.js +171 -233
- package/src/compiler/phases/2-analyze/index.js +192 -16
- package/src/compiler/phases/2-analyze/prune.js +2 -2
- package/src/compiler/phases/3-transform/client/index.js +308 -91
- package/src/compiler/phases/3-transform/segments.js +43 -15
- package/src/compiler/phases/3-transform/server/index.js +71 -21
- package/src/compiler/scope.js +31 -12
- package/src/compiler/source-map-utils.js +4 -6
- package/src/compiler/types/acorn.d.ts +11 -0
- package/src/compiler/types/estree-jsx.d.ts +11 -0
- package/src/compiler/types/estree.d.ts +11 -0
- package/src/compiler/types/import.d.ts +32 -18
- package/src/compiler/types/index.d.ts +75 -23
- package/src/compiler/types/parse.d.ts +7 -10
- package/src/compiler/utils.js +48 -0
- package/src/runtime/array.js +53 -22
- package/src/runtime/date.js +15 -5
- package/src/runtime/index-client.js +41 -7
- package/src/runtime/index-server.js +7 -7
- package/src/runtime/internal/client/bindings.js +2 -2
- package/src/runtime/internal/client/blocks.js +40 -1
- package/src/runtime/internal/client/context.js +8 -0
- package/src/runtime/internal/client/for.js +3 -3
- package/src/runtime/internal/client/index.js +27 -5
- package/src/runtime/internal/client/render.js +20 -8
- package/src/runtime/internal/client/runtime.js +9 -7
- package/src/runtime/internal/client/try.js +15 -22
- package/src/runtime/internal/client/utils.js +1 -1
- package/src/runtime/internal/server/context.js +8 -0
- package/src/runtime/internal/server/index.js +99 -6
- package/src/runtime/map.js +7 -7
- package/src/runtime/media-query.js +10 -1
- package/src/runtime/object.js +6 -6
- package/src/runtime/proxy.js +6 -6
- package/src/runtime/set.js +11 -11
- package/src/runtime/url-search-params.js +13 -2
- package/src/runtime/url.js +15 -5
- package/src/utils/builders.js +13 -3
- package/tests/client/array/array.copy-within.test.ripple +11 -11
- package/tests/client/array/array.derived.test.ripple +42 -42
- package/tests/client/array/array.iteration.test.ripple +12 -12
- package/tests/client/array/array.mutations.test.ripple +25 -25
- package/tests/client/array/array.static.test.ripple +103 -106
- package/tests/client/array/array.to-methods.test.ripple +8 -8
- package/tests/client/async-suspend.test.ripple +94 -0
- package/tests/client/basic/basic.attributes.test.ripple +31 -31
- package/tests/client/basic/basic.collections.test.ripple +7 -7
- package/tests/client/basic/basic.components.test.ripple +48 -10
- package/tests/client/basic/basic.errors.test.ripple +46 -31
- package/tests/client/basic/basic.events.test.ripple +11 -11
- package/tests/client/basic/basic.get-set.test.ripple +18 -18
- package/tests/client/basic/basic.reactivity.test.ripple +47 -42
- package/tests/client/basic/basic.rendering.test.ripple +7 -7
- package/tests/client/basic/basic.utilities.test.ripple +4 -4
- package/tests/client/boundaries.test.ripple +7 -7
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.ripple.snap +2 -2
- package/tests/client/compiler/compiler.assignments.test.ripple +21 -21
- package/tests/client/compiler/compiler.basic.test.ripple +223 -82
- package/tests/client/compiler/compiler.tracked-access.test.ripple +8 -9
- package/tests/client/composite/composite.dynamic-components.test.ripple +8 -8
- package/tests/client/composite/composite.generics.test.ripple +4 -4
- package/tests/client/composite/composite.props.test.ripple +9 -9
- package/tests/client/composite/composite.reactivity.test.ripple +32 -26
- package/tests/client/composite/composite.render.test.ripple +13 -4
- package/tests/client/computed-properties.test.ripple +3 -3
- package/tests/client/context.test.ripple +3 -3
- package/tests/client/css/global-additional-cases.test.ripple +4 -4
- package/tests/client/css/style-identifier.test.ripple +49 -41
- package/tests/client/date.test.ripple +40 -40
- package/tests/client/dynamic-elements.test.ripple +165 -30
- package/tests/client/events.test.ripple +25 -25
- package/tests/client/for.test.ripple +76 -8
- package/tests/client/function-overload.test.ripple +0 -1
- package/tests/client/head.test.ripple +7 -7
- package/tests/client/html.test.ripple +2 -2
- package/tests/client/input-value.test.ripple +174 -176
- package/tests/client/map.test.ripple +21 -21
- package/tests/client/media-query.test.ripple +4 -4
- package/tests/client/object.test.ripple +12 -12
- package/tests/client/portal.test.ripple +4 -4
- package/tests/client/ref.test.ripple +5 -5
- package/tests/client/return.test.ripple +17 -17
- package/tests/client/set.test.ripple +16 -16
- package/tests/client/svg.test.ripple +6 -7
- package/tests/client/switch.test.ripple +10 -10
- package/tests/client/tracked-expression.test.ripple +1 -3
- package/tests/client/try.test.ripple +33 -4
- package/tests/client/url/url.derived.test.ripple +10 -9
- package/tests/client/url/url.parsing.test.ripple +10 -10
- package/tests/client/url/url.partial-removal.test.ripple +10 -10
- package/tests/client/url/url.reactivity.test.ripple +17 -17
- package/tests/client/url/url.serialization.test.ripple +4 -4
- package/tests/client/url-search-params/url-search-params.derived.test.ripple +11 -10
- package/tests/client/url-search-params/url-search-params.initialization.test.ripple +5 -7
- package/tests/client/url-search-params/url-search-params.iteration.test.ripple +13 -13
- package/tests/client/url-search-params/url-search-params.mutation.test.ripple +19 -19
- package/tests/client/url-search-params/url-search-params.retrieval.test.ripple +17 -17
- package/tests/client/url-search-params/url-search-params.serialization.test.ripple +5 -5
- package/tests/client/url-search-params/url-search-params.tracked-url.test.ripple +5 -5
- package/tests/hydration/compiled/client/events.js +8 -11
- package/tests/hydration/compiled/client/for.js +20 -23
- package/tests/hydration/compiled/client/head.js +17 -19
- package/tests/hydration/compiled/client/hmr.js +1 -3
- package/tests/hydration/compiled/client/html.js +1 -15
- package/tests/hydration/compiled/client/if-children.js +7 -9
- package/tests/hydration/compiled/client/if.js +5 -7
- package/tests/hydration/compiled/client/mixed-control-flow.js +3 -5
- package/tests/hydration/compiled/client/portal.js +1 -1
- package/tests/hydration/compiled/client/reactivity.js +9 -11
- package/tests/hydration/compiled/client/return.js +11 -13
- package/tests/hydration/compiled/client/switch.js +4 -6
- package/tests/hydration/compiled/server/basic.js +0 -1
- package/tests/hydration/compiled/server/composite.js +0 -3
- package/tests/hydration/compiled/server/events.js +8 -12
- package/tests/hydration/compiled/server/for.js +20 -23
- package/tests/hydration/compiled/server/head.js +17 -19
- package/tests/hydration/compiled/server/hmr.js +1 -4
- package/tests/hydration/compiled/server/html.js +1 -35
- package/tests/hydration/compiled/server/if-children.js +7 -11
- package/tests/hydration/compiled/server/if.js +5 -7
- package/tests/hydration/compiled/server/mixed-control-flow.js +3 -5
- package/tests/hydration/compiled/server/portal.js +1 -9
- package/tests/hydration/compiled/server/reactivity.js +9 -11
- package/tests/hydration/compiled/server/return.js +11 -13
- package/tests/hydration/compiled/server/switch.js +4 -6
- package/tests/hydration/components/events.ripple +8 -9
- package/tests/hydration/components/for.ripple +20 -21
- package/tests/hydration/components/head.ripple +6 -8
- package/tests/hydration/components/hmr.ripple +1 -2
- package/tests/hydration/components/html.ripple +1 -3
- package/tests/hydration/components/if-children.ripple +7 -8
- package/tests/hydration/components/if.ripple +5 -6
- package/tests/hydration/components/mixed-control-flow.ripple +4 -6
- package/tests/hydration/components/portal.ripple +1 -1
- package/tests/hydration/components/reactivity.ripple +9 -10
- package/tests/hydration/components/return.ripple +11 -12
- package/tests/hydration/components/switch.ripple +6 -8
- package/tests/server/await.test.ripple +2 -2
- package/tests/server/basic.attributes.test.ripple +19 -21
- package/tests/server/basic.components.test.ripple +13 -7
- package/tests/server/basic.test.ripple +20 -21
- package/tests/server/compiler.test.ripple +5 -5
- package/tests/server/composite.props.test.ripple +6 -7
- package/tests/server/composite.test.ripple +4 -4
- package/tests/server/context.test.ripple +1 -3
- package/tests/server/dynamic-elements.test.ripple +24 -24
- package/tests/server/head.test.ripple +5 -7
- package/tests/server/style-identifier.test.ripple +16 -17
- package/types/index.d.ts +266 -62
- package/types/server.d.ts +6 -6
|
@@ -88,8 +88,6 @@ var root_83 = _$_.template(`<div class="layout"><template id="page-data"></templ
|
|
|
88
88
|
var root_85 = _$_.template(`<div class="doc-content"><!></div>`, 0);
|
|
89
89
|
var root_84 = _$_.template(`<!>`, 1, 1);
|
|
90
90
|
|
|
91
|
-
import { track } from 'ripple';
|
|
92
|
-
|
|
93
91
|
export function StaticHtml(__anchor, _, __block) {
|
|
94
92
|
_$_.push_component();
|
|
95
93
|
|
|
@@ -614,7 +612,6 @@ export function HtmlWithServerData(__anchor, _, __block) {
|
|
|
614
612
|
{
|
|
615
613
|
editPath: "docs/introduction.md",
|
|
616
614
|
nextLink: { href: '/docs/quick-start', text: 'Quick Start' },
|
|
617
|
-
|
|
618
615
|
toc: [
|
|
619
616
|
{ href: '#intro', text: 'Introduction' },
|
|
620
617
|
{ href: '#features', text: 'Features' }
|
|
@@ -836,7 +833,6 @@ export function HtmlAfterSwitchInChildren(__anchor, _, __block) {
|
|
|
836
833
|
node_36,
|
|
837
834
|
{
|
|
838
835
|
level: 1,
|
|
839
|
-
|
|
840
836
|
children(__anchor, _, __block) {
|
|
841
837
|
_$_.push_component();
|
|
842
838
|
|
|
@@ -930,7 +926,7 @@ function NavItem(__anchor, __props, __block) {
|
|
|
930
926
|
function SidebarSection(__anchor, __props, __block) {
|
|
931
927
|
_$_.push_component();
|
|
932
928
|
|
|
933
|
-
let expanded = track(true, void 0, void 0, __block);
|
|
929
|
+
let expanded = _$_.track(true, void 0, void 0, __block);
|
|
934
930
|
var section_2 = root_38();
|
|
935
931
|
|
|
936
932
|
{
|
|
@@ -1002,7 +998,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1002
998
|
node_41,
|
|
1003
999
|
{
|
|
1004
1000
|
title: "Getting Started",
|
|
1005
|
-
|
|
1006
1001
|
children(__anchor, _, __block) {
|
|
1007
1002
|
_$_.push_component();
|
|
1008
1003
|
|
|
@@ -1014,7 +1009,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1014
1009
|
{
|
|
1015
1010
|
href: "/intro",
|
|
1016
1011
|
text: "Introduction",
|
|
1017
|
-
|
|
1018
1012
|
get active() {
|
|
1019
1013
|
return __props.currentPath === '/intro';
|
|
1020
1014
|
}
|
|
@@ -1029,7 +1023,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1029
1023
|
{
|
|
1030
1024
|
href: "/start",
|
|
1031
1025
|
text: "Quick Start",
|
|
1032
|
-
|
|
1033
1026
|
get active() {
|
|
1034
1027
|
return __props.currentPath === '/start';
|
|
1035
1028
|
}
|
|
@@ -1056,7 +1049,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1056
1049
|
node_44,
|
|
1057
1050
|
{
|
|
1058
1051
|
title: "Guide",
|
|
1059
|
-
|
|
1060
1052
|
children(__anchor, _, __block) {
|
|
1061
1053
|
_$_.push_component();
|
|
1062
1054
|
|
|
@@ -1068,7 +1060,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1068
1060
|
{
|
|
1069
1061
|
href: "/guide/app",
|
|
1070
1062
|
text: "Application",
|
|
1071
|
-
|
|
1072
1063
|
get active() {
|
|
1073
1064
|
return __props.currentPath === '/guide/app';
|
|
1074
1065
|
}
|
|
@@ -1083,7 +1074,6 @@ function SideNav(__anchor, __props, __block) {
|
|
|
1083
1074
|
{
|
|
1084
1075
|
href: "/guide/syntax",
|
|
1085
1076
|
text: "Syntax",
|
|
1086
|
-
|
|
1087
1077
|
get active() {
|
|
1088
1078
|
return __props.currentPath === '/guide/syntax';
|
|
1089
1079
|
}
|
|
@@ -1556,7 +1546,6 @@ export function DocsLayoutWithData(__anchor, _, __block) {
|
|
|
1556
1546
|
{
|
|
1557
1547
|
editPath: "docs/styling.md",
|
|
1558
1548
|
nextLink: { href: '/next', text: 'Next' },
|
|
1559
|
-
|
|
1560
1549
|
children(__anchor, _, __block) {
|
|
1561
1550
|
_$_.push_component();
|
|
1562
1551
|
|
|
@@ -1887,7 +1876,6 @@ export function DocsLayoutExactWithData(__anchor, _, __block) {
|
|
|
1887
1876
|
editPath: "docs/guide/styling.md",
|
|
1888
1877
|
prevLink: { href: '/prev', text: 'Previous' },
|
|
1889
1878
|
nextLink: { href: '/next', text: 'Next' },
|
|
1890
|
-
|
|
1891
1879
|
toc: [
|
|
1892
1880
|
{ href: '#intro', text: 'Introduction' },
|
|
1893
1881
|
{ href: '#usage', text: 'Usage' }
|
|
@@ -1937,7 +1925,6 @@ export function DocsLayoutExactWithoutData(__anchor, _, __block) {
|
|
|
1937
1925
|
prevLink,
|
|
1938
1926
|
nextLink,
|
|
1939
1927
|
toc,
|
|
1940
|
-
|
|
1941
1928
|
children(__anchor, _, __block) {
|
|
1942
1929
|
_$_.push_component();
|
|
1943
1930
|
|
|
@@ -2037,7 +2024,6 @@ export function NestedTemplateInLayout(__anchor, _, __block) {
|
|
|
2037
2024
|
node_89,
|
|
2038
2025
|
{
|
|
2039
2026
|
data: doc,
|
|
2040
|
-
|
|
2041
2027
|
children(__anchor, _, __block) {
|
|
2042
2028
|
_$_.push_component();
|
|
2043
2029
|
|
|
@@ -22,12 +22,10 @@ var root_15 = _$_.template(`<div class="tabs"><div class="tab-list"><button clas
|
|
|
22
22
|
var root_18 = _$_.template(`<div class="container"><ul class="list"><li class="item"> </li><li class="item">Another item</li></ul><h2 class="heading">Static Heading</h2><p class="para">Static paragraph</p></div><button class="inc">Increment</button>`, 1, 2);
|
|
23
23
|
var root_19 = _$_.template(`<div class="wrapper"><ul class="features"><li><strong>Feature One</strong>: Description of feature one with <code>code</code> reference</li><li><strong>Feature Two</strong>: Another feature description</li><li><strong>Feature Three</strong>: Third feature</li></ul><h2 class="section-heading">Section Heading</h2><p class="section-content">Static paragraph with <a href="/link">a link</a> and more text.</p></div>`, 0);
|
|
24
24
|
|
|
25
|
-
import { track } from 'ripple';
|
|
26
|
-
|
|
27
25
|
export function IfWithChildren(__anchor, __props, __block) {
|
|
28
26
|
_$_.push_component();
|
|
29
27
|
|
|
30
|
-
let expanded = track(true, void 0, void 0, __block);
|
|
28
|
+
let expanded = _$_.track(true, void 0, void 0, __block);
|
|
31
29
|
var div_1 = root();
|
|
32
30
|
|
|
33
31
|
{
|
|
@@ -116,7 +114,7 @@ export function TestIfWithChildren(__anchor, _, __block) {
|
|
|
116
114
|
export function IfWithStaticChildren(__anchor, _, __block) {
|
|
117
115
|
_$_.push_component();
|
|
118
116
|
|
|
119
|
-
let expanded = track(true, void 0, void 0, __block);
|
|
117
|
+
let expanded = _$_.track(true, void 0, void 0, __block);
|
|
120
118
|
var div_5 = root_5();
|
|
121
119
|
|
|
122
120
|
{
|
|
@@ -148,7 +146,7 @@ export function IfWithStaticChildren(__anchor, _, __block) {
|
|
|
148
146
|
export function IfWithSiblingsAndChildren(__anchor, __props, __block) {
|
|
149
147
|
_$_.push_component();
|
|
150
148
|
|
|
151
|
-
let expanded = track(true, void 0, void 0, __block);
|
|
149
|
+
let expanded = _$_.track(true, void 0, void 0, __block);
|
|
152
150
|
var section_1 = root_7();
|
|
153
151
|
|
|
154
152
|
{
|
|
@@ -219,7 +217,7 @@ export function TestIfWithSiblingsAndChildren(__anchor, _, __block) {
|
|
|
219
217
|
export function ElementWithChildrenThenIf(__anchor, _, __block) {
|
|
220
218
|
_$_.push_component();
|
|
221
219
|
|
|
222
|
-
let show = track(true, void 0, void 0, __block);
|
|
220
|
+
let show = _$_.track(true, void 0, void 0, __block);
|
|
223
221
|
var fragment_4 = root_11();
|
|
224
222
|
var div_11 = _$_.first_child_frag(fragment_4);
|
|
225
223
|
|
|
@@ -256,7 +254,7 @@ export function ElementWithChildrenThenIf(__anchor, _, __block) {
|
|
|
256
254
|
export function DeepNestingThenIf(__anchor, _, __block) {
|
|
257
255
|
_$_.push_component();
|
|
258
256
|
|
|
259
|
-
let visible = track(true, void 0, void 0, __block);
|
|
257
|
+
let visible = _$_.track(true, void 0, void 0, __block);
|
|
260
258
|
var fragment_5 = root_13();
|
|
261
259
|
var section_2 = _$_.first_child_frag(fragment_5);
|
|
262
260
|
|
|
@@ -293,7 +291,7 @@ export function DeepNestingThenIf(__anchor, _, __block) {
|
|
|
293
291
|
export function DomElementChildrenThenSibling(__anchor, _, __block) {
|
|
294
292
|
_$_.push_component();
|
|
295
293
|
|
|
296
|
-
let activeTab = track('code', void 0, void 0, __block);
|
|
294
|
+
let activeTab = _$_.track('code', void 0, void 0, __block);
|
|
297
295
|
var div_13 = root_15();
|
|
298
296
|
|
|
299
297
|
{
|
|
@@ -362,7 +360,7 @@ export function DomElementChildrenThenSibling(__anchor, _, __block) {
|
|
|
362
360
|
export function DomChildrenThenStaticSiblings(__anchor, _, __block) {
|
|
363
361
|
_$_.push_component();
|
|
364
362
|
|
|
365
|
-
let count = track(0, void 0, void 0, __block);
|
|
363
|
+
let count = _$_.track(0, void 0, void 0, __block);
|
|
366
364
|
var fragment_6 = root_18();
|
|
367
365
|
var div_17 = _$_.first_child_frag(fragment_6);
|
|
368
366
|
|
|
@@ -22,8 +22,6 @@ var root_19 = _$_.template(`<div class="state">Error occurred</div>`, 0);
|
|
|
22
22
|
var root_17 = _$_.template(`<!>`, 1, 1);
|
|
23
23
|
var root_15 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button><!></div>`, 0);
|
|
24
24
|
|
|
25
|
-
import { track } from 'ripple';
|
|
26
|
-
|
|
27
25
|
export function IfTruthy(__anchor, _, __block) {
|
|
28
26
|
_$_.push_component();
|
|
29
27
|
|
|
@@ -102,7 +100,7 @@ export function IfElse(__anchor, _, __block) {
|
|
|
102
100
|
export function ReactiveIf(__anchor, _, __block) {
|
|
103
101
|
_$_.push_component();
|
|
104
102
|
|
|
105
|
-
let show = track(true, void 0, void 0, __block);
|
|
103
|
+
let show = _$_.track(true, void 0, void 0, __block);
|
|
106
104
|
var fragment_3 = root_7();
|
|
107
105
|
var button_1 = _$_.first_child_frag(fragment_3);
|
|
108
106
|
|
|
@@ -131,7 +129,7 @@ export function ReactiveIf(__anchor, _, __block) {
|
|
|
131
129
|
export function ReactiveIfElse(__anchor, _, __block) {
|
|
132
130
|
_$_.push_component();
|
|
133
131
|
|
|
134
|
-
let isOn = track(false, void 0, void 0, __block);
|
|
132
|
+
let isOn = _$_.track(false, void 0, void 0, __block);
|
|
135
133
|
var fragment_4 = root_9();
|
|
136
134
|
var button_2 = _$_.first_child_frag(fragment_4);
|
|
137
135
|
|
|
@@ -166,8 +164,8 @@ export function ReactiveIfElse(__anchor, _, __block) {
|
|
|
166
164
|
export function NestedIf(__anchor, _, __block) {
|
|
167
165
|
_$_.push_component();
|
|
168
166
|
|
|
169
|
-
let outer = track(true, void 0, void 0, __block);
|
|
170
|
-
let inner = track(true, void 0, void 0, __block);
|
|
167
|
+
let outer = _$_.track(true, void 0, void 0, __block);
|
|
168
|
+
let inner = _$_.track(true, void 0, void 0, __block);
|
|
171
169
|
var fragment_5 = root_12();
|
|
172
170
|
var button_3 = _$_.first_child_frag(fragment_5);
|
|
173
171
|
|
|
@@ -221,7 +219,7 @@ export function NestedIf(__anchor, _, __block) {
|
|
|
221
219
|
export function IfElseIfChain(__anchor, _, __block) {
|
|
222
220
|
_$_.push_component();
|
|
223
221
|
|
|
224
|
-
let status = track('loading', void 0, void 0, __block);
|
|
222
|
+
let status = _$_.track('loading', void 0, void 0, __block);
|
|
225
223
|
var div_9 = root_15();
|
|
226
224
|
|
|
227
225
|
{
|
|
@@ -28,8 +28,6 @@ var root_19 = _$_.template(`<!>`, 1, 1);
|
|
|
28
28
|
var root_18 = _$_.template(`<div class="before">before</div><!>`, 1, 2);
|
|
29
29
|
var root_25 = _$_.template(`<div class="resolved-row"> </div>`, 0);
|
|
30
30
|
|
|
31
|
-
import { track } from 'ripple';
|
|
32
|
-
|
|
33
31
|
export function MixedControlFlowStatic(__anchor, _, __block) {
|
|
34
32
|
_$_.push_component();
|
|
35
33
|
|
|
@@ -196,9 +194,9 @@ export function MixedControlFlowStatic(__anchor, _, __block) {
|
|
|
196
194
|
export function MixedControlFlowReactive(__anchor, _, __block) {
|
|
197
195
|
_$_.push_component();
|
|
198
196
|
|
|
199
|
-
let show = track(true, void 0, void 0, __block);
|
|
200
|
-
let mode = track('a', void 0, void 0, __block);
|
|
201
|
-
let items = track([{ id: 1, label: 'One' }, { id: 2, label: 'Two' }], void 0, void 0, __block);
|
|
197
|
+
let show = _$_.track(true, void 0, void 0, __block);
|
|
198
|
+
let mode = _$_.track('a', void 0, void 0, __block);
|
|
199
|
+
let items = _$_.track([{ id: 1, label: 'One' }, { id: 2, label: 'Two' }], void 0, void 0, __block);
|
|
202
200
|
var fragment_4 = root_9();
|
|
203
201
|
var button_1 = _$_.first_child_frag(fragment_4);
|
|
204
202
|
|
|
@@ -8,12 +8,10 @@ var root_3 = _$_.template(`<div class="sum"> </div>`, 0);
|
|
|
8
8
|
var root_4 = _$_.template(`<div class="x"> </div><div class="y"> </div><div class="z"> </div>`, 1, 3);
|
|
9
9
|
var root_5 = _$_.template(`<div class="name"> </div>`, 0);
|
|
10
10
|
|
|
11
|
-
import { track } from 'ripple';
|
|
12
|
-
|
|
13
11
|
export function TrackedState(__anchor, _, __block) {
|
|
14
12
|
_$_.push_component();
|
|
15
13
|
|
|
16
|
-
let count = track(0, void 0, void 0, __block);
|
|
14
|
+
let count = _$_.track(0, void 0, void 0, __block);
|
|
17
15
|
var div_1 = root();
|
|
18
16
|
|
|
19
17
|
{
|
|
@@ -33,7 +31,7 @@ export function TrackedState(__anchor, _, __block) {
|
|
|
33
31
|
export function CounterWithInitial(__anchor, props, __block) {
|
|
34
32
|
_$_.push_component();
|
|
35
33
|
|
|
36
|
-
let count = track(props.initial, void 0, void 0, __block);
|
|
34
|
+
let count = _$_.track(props.initial, void 0, void 0, __block);
|
|
37
35
|
var div_2 = root_1();
|
|
38
36
|
|
|
39
37
|
{
|
|
@@ -68,8 +66,8 @@ export function CounterWrapper(__anchor, _, __block) {
|
|
|
68
66
|
export function ComputedValues(__anchor, _, __block) {
|
|
69
67
|
_$_.push_component();
|
|
70
68
|
|
|
71
|
-
let a = track(2, void 0, void 0, __block);
|
|
72
|
-
let b = track(3, void 0, void 0, __block);
|
|
69
|
+
let a = _$_.track(2, void 0, void 0, __block);
|
|
70
|
+
let b = _$_.track(3, void 0, void 0, __block);
|
|
73
71
|
const sum = () => _$_.get(a) + _$_.get(b);
|
|
74
72
|
var div_3 = root_3();
|
|
75
73
|
|
|
@@ -90,9 +88,9 @@ export function ComputedValues(__anchor, _, __block) {
|
|
|
90
88
|
export function MultipleTracked(__anchor, _, __block) {
|
|
91
89
|
_$_.push_component();
|
|
92
90
|
|
|
93
|
-
let x = track(10, void 0, void 0, __block);
|
|
94
|
-
let y = track(20, void 0, void 0, __block);
|
|
95
|
-
let z = track(30, void 0, void 0, __block);
|
|
91
|
+
let x = _$_.track(10, void 0, void 0, __block);
|
|
92
|
+
let y = _$_.track(20, void 0, void 0, __block);
|
|
93
|
+
let z = _$_.track(30, void 0, void 0, __block);
|
|
96
94
|
var fragment_1 = root_4();
|
|
97
95
|
var div_4 = _$_.first_child_frag(fragment_1);
|
|
98
96
|
|
|
@@ -150,8 +148,8 @@ export function MultipleTracked(__anchor, _, __block) {
|
|
|
150
148
|
export function DerivedState(__anchor, _, __block) {
|
|
151
149
|
_$_.push_component();
|
|
152
150
|
|
|
153
|
-
let firstName = track('John', void 0, void 0, __block);
|
|
154
|
-
let lastName = track('Doe', void 0, void 0, __block);
|
|
151
|
+
let firstName = _$_.track('John', void 0, void 0, __block);
|
|
152
|
+
let lastName = _$_.track('Doe', void 0, void 0, __block);
|
|
155
153
|
const fullName = () => `${_$_.get(firstName)} ${_$_.get(lastName)}`;
|
|
156
154
|
var div_7 = root_5();
|
|
157
155
|
|
|
@@ -130,8 +130,6 @@ var root_121 = _$_.template(`<div class="middle">middle</div><section class="nes
|
|
|
130
130
|
var root_127 = _$_.template(`<div class="root-1">root-1</div><div class="root-2">root-2</div><div class="root-3">root-3</div><div class="root-4">root-4</div>`, 1, 4);
|
|
131
131
|
var root_119 = _$_.template(`<button class="toggle-c1">Toggle C1</button><button class="toggle-c2">Toggle C2</button><button class="toggle-c3">Toggle C3</button><button class="toggle-c4">Toggle C4</button><div class="top">top</div><!><!><!>`, 1, 8);
|
|
132
132
|
|
|
133
|
-
import { track } from 'ripple';
|
|
134
|
-
|
|
135
133
|
export function DirectReturn(__anchor, _, __block) {
|
|
136
134
|
_$_.push_component();
|
|
137
135
|
|
|
@@ -1170,7 +1168,7 @@ export function ReactiveReturnTrueToFalse(__anchor, _, __block) {
|
|
|
1170
1168
|
_$_.push_component();
|
|
1171
1169
|
|
|
1172
1170
|
var __r_28 = _$_.tracked(false);
|
|
1173
|
-
let condition = track(true, void 0, void 0, __block);
|
|
1171
|
+
let condition = _$_.track(true, void 0, void 0, __block);
|
|
1174
1172
|
var fragment_59 = root_77();
|
|
1175
1173
|
var button_1 = _$_.first_child_frag(fragment_59);
|
|
1176
1174
|
|
|
@@ -1215,7 +1213,7 @@ export function ReactiveReturnFalseToTrue(__anchor, _, __block) {
|
|
|
1215
1213
|
_$_.push_component();
|
|
1216
1214
|
|
|
1217
1215
|
var __r_29 = _$_.tracked(false);
|
|
1218
|
-
let condition = track(false, void 0, void 0, __block);
|
|
1216
|
+
let condition = _$_.track(false, void 0, void 0, __block);
|
|
1219
1217
|
var fragment_61 = root_80();
|
|
1220
1218
|
var button_2 = _$_.first_child_frag(fragment_61);
|
|
1221
1219
|
|
|
@@ -1261,7 +1259,7 @@ export function ReactiveNestedReturn(__anchor, _, __block) {
|
|
|
1261
1259
|
|
|
1262
1260
|
var __r_30 = _$_.tracked(false);
|
|
1263
1261
|
let a = true;
|
|
1264
|
-
let b = track(true, void 0, void 0, __block);
|
|
1262
|
+
let b = _$_.track(true, void 0, void 0, __block);
|
|
1265
1263
|
var fragment_63 = root_83();
|
|
1266
1264
|
var button_3 = _$_.first_child_frag(fragment_63);
|
|
1267
1265
|
|
|
@@ -1576,7 +1574,7 @@ export function ReactiveSiblingReturns(__anchor, _, __block) {
|
|
|
1576
1574
|
|
|
1577
1575
|
var __r_39 = _$_.tracked(false);
|
|
1578
1576
|
var __r_38 = _$_.tracked(false);
|
|
1579
|
-
let mode = track('first', void 0, void 0, __block);
|
|
1577
|
+
let mode = _$_.track('first', void 0, void 0, __block);
|
|
1580
1578
|
var fragment_82 = root_105();
|
|
1581
1579
|
var button_4 = _$_.first_child_frag(fragment_82);
|
|
1582
1580
|
|
|
@@ -1655,8 +1653,8 @@ export function ReactiveOuterInnerReturns(__anchor, _, __block) {
|
|
|
1655
1653
|
_$_.push_component();
|
|
1656
1654
|
|
|
1657
1655
|
var __r_40 = _$_.tracked(false);
|
|
1658
|
-
let a = track(true, void 0, void 0, __block);
|
|
1659
|
-
let b = track(true, void 0, void 0, __block);
|
|
1656
|
+
let a = _$_.track(true, void 0, void 0, __block);
|
|
1657
|
+
let b = _$_.track(true, void 0, void 0, __block);
|
|
1660
1658
|
var fragment_86 = root_110();
|
|
1661
1659
|
var button_5 = _$_.first_child_frag(fragment_86);
|
|
1662
1660
|
|
|
@@ -1734,7 +1732,7 @@ export function ReactiveElseIfReturns(__anchor, _, __block) {
|
|
|
1734
1732
|
|
|
1735
1733
|
var __r_42 = _$_.tracked(false);
|
|
1736
1734
|
var __r_41 = _$_.tracked(false);
|
|
1737
|
-
let status = track(0, void 0, void 0, __block);
|
|
1735
|
+
let status = _$_.track(0, void 0, void 0, __block);
|
|
1738
1736
|
var fragment_89 = root_114();
|
|
1739
1737
|
var button_7 = _$_.first_child_frag(fragment_89);
|
|
1740
1738
|
|
|
@@ -1808,10 +1806,10 @@ export function ReactiveDeepNestedIndependentReturns(__anchor, _, __block) {
|
|
|
1808
1806
|
var __r_45 = _$_.tracked(false);
|
|
1809
1807
|
var __r_44 = _$_.tracked(false);
|
|
1810
1808
|
var __r_43 = _$_.tracked(false);
|
|
1811
|
-
let c1 = track(false, void 0, void 0, __block);
|
|
1812
|
-
let c2 = track(false, void 0, void 0, __block);
|
|
1813
|
-
let c3 = track(false, void 0, void 0, __block);
|
|
1814
|
-
let c4 = track(false, void 0, void 0, __block);
|
|
1809
|
+
let c1 = _$_.track(false, void 0, void 0, __block);
|
|
1810
|
+
let c2 = _$_.track(false, void 0, void 0, __block);
|
|
1811
|
+
let c3 = _$_.track(false, void 0, void 0, __block);
|
|
1812
|
+
let c4 = _$_.track(false, void 0, void 0, __block);
|
|
1815
1813
|
var fragment_94 = root_119();
|
|
1816
1814
|
var button_8 = _$_.first_child_frag(fragment_94);
|
|
1817
1815
|
|
|
@@ -25,8 +25,6 @@ var root_21 = _$_.template(`<div class="nobreak-2">NoBreak 2</div>`, 0);
|
|
|
25
25
|
var root_22 = _$_.template(`<div class="nobreak-3">NoBreak 3</div>`, 0);
|
|
26
26
|
var root_19 = _$_.template(`<button class="nobreak-toggle">Toggle</button><!>`, 1, 2);
|
|
27
27
|
|
|
28
|
-
import { track } from 'ripple';
|
|
29
|
-
|
|
30
28
|
export function SwitchStatic(__anchor, _, __block) {
|
|
31
29
|
_$_.push_component();
|
|
32
30
|
|
|
@@ -79,7 +77,7 @@ export function SwitchStatic(__anchor, _, __block) {
|
|
|
79
77
|
export function SwitchReactive(__anchor, _, __block) {
|
|
80
78
|
_$_.push_component();
|
|
81
79
|
|
|
82
|
-
let status = track('a', void 0, void 0, __block);
|
|
80
|
+
let status = _$_.track('a', void 0, void 0, __block);
|
|
83
81
|
var fragment_3 = root_4();
|
|
84
82
|
var button_1 = _$_.first_child_frag(fragment_3);
|
|
85
83
|
|
|
@@ -175,7 +173,7 @@ export function SwitchFallthrough(__anchor, _, __block) {
|
|
|
175
173
|
export function SwitchNumericLevels(__anchor, _, __block) {
|
|
176
174
|
_$_.push_component();
|
|
177
175
|
|
|
178
|
-
let level = track(1, void 0, void 0, __block);
|
|
176
|
+
let level = _$_.track(1, void 0, void 0, __block);
|
|
179
177
|
var fragment_8 = root_11();
|
|
180
178
|
var button_2 = _$_.first_child_frag(fragment_8);
|
|
181
179
|
|
|
@@ -230,7 +228,7 @@ export function SwitchNumericLevels(__anchor, _, __block) {
|
|
|
230
228
|
export function SwitchBlockScoped(__anchor, _, __block) {
|
|
231
229
|
_$_.push_component();
|
|
232
230
|
|
|
233
|
-
let level = track(1, void 0, void 0, __block);
|
|
231
|
+
let level = _$_.track(1, void 0, void 0, __block);
|
|
234
232
|
var fragment_12 = root_15();
|
|
235
233
|
var button_3 = _$_.first_child_frag(fragment_12);
|
|
236
234
|
|
|
@@ -285,7 +283,7 @@ export function SwitchBlockScoped(__anchor, _, __block) {
|
|
|
285
283
|
export function SwitchNoBreak(__anchor, _, __block) {
|
|
286
284
|
_$_.push_component();
|
|
287
285
|
|
|
288
|
-
let level = track(1, void 0, void 0, __block);
|
|
286
|
+
let level = _$_.track(1, void 0, void 0, __block);
|
|
289
287
|
var fragment_16 = root_19();
|
|
290
288
|
var button_4 = _$_.first_child_frag(fragment_16);
|
|
291
289
|
|
|
@@ -84,7 +84,6 @@ export function LayoutWithSingleChild(__output) {
|
|
|
84
84
|
|
|
85
85
|
const args = [
|
|
86
86
|
__output,
|
|
87
|
-
|
|
88
87
|
{
|
|
89
88
|
children: function children(__output) {
|
|
90
89
|
_$_.push_component();
|
|
@@ -115,7 +114,6 @@ export function LayoutWithMultipleChildren(__output) {
|
|
|
115
114
|
|
|
116
115
|
const args = [
|
|
117
116
|
__output,
|
|
118
|
-
|
|
119
117
|
{
|
|
120
118
|
children: function children(__output) {
|
|
121
119
|
_$_.push_component();
|
|
@@ -155,7 +153,6 @@ export function LayoutWithMultiRootChild(__output) {
|
|
|
155
153
|
|
|
156
154
|
const args = [
|
|
157
155
|
__output,
|
|
158
|
-
|
|
159
156
|
{
|
|
160
157
|
children: function children(__output) {
|
|
161
158
|
_$_.push_component();
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as _$_ from 'ripple/internal/server';
|
|
3
3
|
|
|
4
|
-
import { track } from 'ripple/server';
|
|
5
|
-
|
|
6
4
|
export function ClickCounter(__output) {
|
|
7
5
|
_$_.push_component();
|
|
8
6
|
|
|
9
|
-
let count = track(0);
|
|
7
|
+
let count = _$_.track(0);
|
|
10
8
|
|
|
11
9
|
__output.push('<div');
|
|
12
10
|
__output.push('>');
|
|
@@ -39,7 +37,7 @@ export function ClickCounter(__output) {
|
|
|
39
37
|
export function IncrementDecrement(__output) {
|
|
40
38
|
_$_.push_component();
|
|
41
39
|
|
|
42
|
-
let count = track(0);
|
|
40
|
+
let count = _$_.track(0);
|
|
43
41
|
|
|
44
42
|
__output.push('<div');
|
|
45
43
|
__output.push('>');
|
|
@@ -81,8 +79,8 @@ export function IncrementDecrement(__output) {
|
|
|
81
79
|
export function MultipleEvents(__output) {
|
|
82
80
|
_$_.push_component();
|
|
83
81
|
|
|
84
|
-
let clicks = track(0);
|
|
85
|
-
let hovers = track(0);
|
|
82
|
+
let clicks = _$_.track(0);
|
|
83
|
+
let hovers = _$_.track(0);
|
|
86
84
|
|
|
87
85
|
__output.push('<div');
|
|
88
86
|
__output.push('>');
|
|
@@ -124,8 +122,8 @@ export function MultipleEvents(__output) {
|
|
|
124
122
|
export function MultiStateUpdate(__output) {
|
|
125
123
|
_$_.push_component();
|
|
126
124
|
|
|
127
|
-
let count = track(0);
|
|
128
|
-
let lastAction = track('none');
|
|
125
|
+
let count = _$_.track(0);
|
|
126
|
+
let lastAction = _$_.track('none');
|
|
129
127
|
|
|
130
128
|
const handleClick = () => {
|
|
131
129
|
_$_.update(count);
|
|
@@ -172,7 +170,7 @@ export function MultiStateUpdate(__output) {
|
|
|
172
170
|
export function ToggleButton(__output) {
|
|
173
171
|
_$_.push_component();
|
|
174
172
|
|
|
175
|
-
let isOn = track(false);
|
|
173
|
+
let isOn = _$_.track(false);
|
|
176
174
|
|
|
177
175
|
__output.push('<div');
|
|
178
176
|
__output.push('>');
|
|
@@ -210,7 +208,7 @@ export function ChildButton(__output, props) {
|
|
|
210
208
|
export function ParentWithChildButton(__output) {
|
|
211
209
|
_$_.push_component();
|
|
212
210
|
|
|
213
|
-
let count = track(0);
|
|
211
|
+
let count = _$_.track(0);
|
|
214
212
|
|
|
215
213
|
__output.push('<div');
|
|
216
214
|
__output.push('>');
|
|
@@ -221,12 +219,10 @@ export function ParentWithChildButton(__output) {
|
|
|
221
219
|
|
|
222
220
|
const args = [
|
|
223
221
|
__output,
|
|
224
|
-
|
|
225
222
|
{
|
|
226
223
|
onClick: () => {
|
|
227
224
|
_$_.update(count);
|
|
228
225
|
},
|
|
229
|
-
|
|
230
226
|
label: "Click me"
|
|
231
227
|
}
|
|
232
228
|
];
|