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
|
@@ -4,10 +4,10 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
4
4
|
it('handles keys method with reactivity', () => {
|
|
5
5
|
component URLTest() {
|
|
6
6
|
const params = RippleURLSearchParams('foo=bar&baz=qux');
|
|
7
|
-
let keys = track(() => Array.from(params.keys()));
|
|
7
|
+
let &[keys] = track(() => Array.from(params.keys()));
|
|
8
8
|
|
|
9
9
|
<button onClick={() => params.append('new', 'value')}>{'add param'}</button>
|
|
10
|
-
<pre>{JSON.stringify(
|
|
10
|
+
<pre>{JSON.stringify(keys)}</pre>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
render(URLTest);
|
|
@@ -27,10 +27,10 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
27
27
|
it('handles values method with reactivity', () => {
|
|
28
28
|
component URLTest() {
|
|
29
29
|
const params = RippleURLSearchParams('foo=bar&baz=qux');
|
|
30
|
-
let values = track(() => Array.from(params.values()));
|
|
30
|
+
let &[values] = track(() => Array.from(params.values()));
|
|
31
31
|
|
|
32
32
|
<button onClick={() => params.set('foo', 'updated')}>{'update foo'}</button>
|
|
33
|
-
<pre>{JSON.stringify(
|
|
33
|
+
<pre>{JSON.stringify(values)}</pre>
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
render(URLTest);
|
|
@@ -50,10 +50,10 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
50
50
|
it('handles entries method with reactivity', () => {
|
|
51
51
|
component URLTest() {
|
|
52
52
|
const params = RippleURLSearchParams('foo=bar&baz=qux');
|
|
53
|
-
let entries = track(() => Array.from(params.entries()));
|
|
53
|
+
let &[entries] = track(() => Array.from(params.entries()));
|
|
54
54
|
|
|
55
55
|
<button onClick={() => params.append('new', 'value')}>{'add param'}</button>
|
|
56
|
-
<pre>{JSON.stringify(
|
|
56
|
+
<pre>{JSON.stringify(entries)}</pre>
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
render(URLTest);
|
|
@@ -75,10 +75,10 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
75
75
|
it('handles Symbol.iterator with reactivity', () => {
|
|
76
76
|
component URLTest() {
|
|
77
77
|
const params = RippleURLSearchParams('foo=bar&baz=qux');
|
|
78
|
-
let entries = track(() => Array.from(params));
|
|
78
|
+
let &[entries] = track(() => Array.from(params));
|
|
79
79
|
|
|
80
80
|
<button onClick={() => params.delete('foo')}>{'delete foo'}</button>
|
|
81
|
-
<pre>{JSON.stringify(
|
|
81
|
+
<pre>{JSON.stringify(entries)}</pre>
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
render(URLTest);
|
|
@@ -126,7 +126,7 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
126
126
|
it('handles forEach iteration', () => {
|
|
127
127
|
component URLTest() {
|
|
128
128
|
const params = RippleURLSearchParams('a=1&b=2&c=3');
|
|
129
|
-
let sum = track(() => {
|
|
129
|
+
let &[sum] = track(() => {
|
|
130
130
|
let total = 0;
|
|
131
131
|
// Access the params reactively through entries
|
|
132
132
|
for (const [key, value] of params.entries()) {
|
|
@@ -136,7 +136,7 @@ describe('RippleURLSearchParams > iteration', () => {
|
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
<button onClick={() => params.append('d', '4')}>{'add d=4'}</button>
|
|
139
|
-
<pre>{
|
|
139
|
+
<pre>{sum}</pre>
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
render(URLTest);
|
|
@@ -29,11 +29,11 @@ describe('RippleURLSearchParams > mutation', () => {
|
|
|
29
29
|
it('handles append with multiple values for same key', () => {
|
|
30
30
|
component URLTest() {
|
|
31
31
|
const params = RippleURLSearchParams('foo=bar');
|
|
32
|
-
let allFoo = track(() => params.getAll('foo'));
|
|
32
|
+
let &[allFoo] = track(() => params.getAll('foo'));
|
|
33
33
|
|
|
34
34
|
<button onClick={() => params.append('foo', 'baz')}>{'append foo'}</button>
|
|
35
35
|
<pre>{params.toString()}</pre>
|
|
36
|
-
<pre>{JSON.stringify(
|
|
36
|
+
<pre>{JSON.stringify(allFoo)}</pre>
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
render(URLTest);
|
|
@@ -108,11 +108,11 @@ describe('RippleURLSearchParams > mutation', () => {
|
|
|
108
108
|
it('handles delete when key does not exist', () => {
|
|
109
109
|
component URLTest() {
|
|
110
110
|
const params = RippleURLSearchParams('foo=bar');
|
|
111
|
-
let reactiveSize = track(() => params.size);
|
|
111
|
+
let &[reactiveSize] = track(() => params.size);
|
|
112
112
|
|
|
113
113
|
<button onClick={() => params.delete('nonexistent')}>{'delete nonexistent'}</button>
|
|
114
114
|
<pre>{params.toString()}</pre>
|
|
115
|
-
<pre>{
|
|
115
|
+
<pre>{reactiveSize}</pre>
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
render(URLTest);
|
|
@@ -168,11 +168,11 @@ describe('RippleURLSearchParams > mutation', () => {
|
|
|
168
168
|
it('handles set with multiple existing values', () => {
|
|
169
169
|
component URLTest() {
|
|
170
170
|
const params = RippleURLSearchParams('foo=bar&foo=baz&foo=qux');
|
|
171
|
-
let allFoo = track(() => params.getAll('foo'));
|
|
171
|
+
let &[allFoo] = track(() => params.getAll('foo'));
|
|
172
172
|
|
|
173
173
|
<button onClick={() => params.set('foo', 'single')}>{'set foo'}</button>
|
|
174
174
|
<pre>{params.toString()}</pre>
|
|
175
|
-
<pre>{JSON.stringify(
|
|
175
|
+
<pre>{JSON.stringify(allFoo)}</pre>
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
render(URLTest);
|
|
@@ -194,10 +194,10 @@ describe('RippleURLSearchParams > mutation', () => {
|
|
|
194
194
|
it('handles set when value is the same', () => {
|
|
195
195
|
component URLTest() {
|
|
196
196
|
const params = RippleURLSearchParams('foo=bar');
|
|
197
|
-
let reactiveString = track(() => params.toString());
|
|
197
|
+
let &[reactiveString] = track(() => params.toString());
|
|
198
198
|
|
|
199
199
|
<button onClick={() => params.set('foo', 'bar')}>{'set same value'}</button>
|
|
200
|
-
<pre>{
|
|
200
|
+
<pre>{reactiveString}</pre>
|
|
201
201
|
<pre>{params.size}</pre>
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -312,12 +312,12 @@ describe('RippleURLSearchParams > mutation', () => {
|
|
|
312
312
|
it('handles duplicate keys with different values', () => {
|
|
313
313
|
component URLTest() {
|
|
314
314
|
const params = RippleURLSearchParams();
|
|
315
|
-
let tags = track(() => params.getAll('tag'));
|
|
315
|
+
let &[tags] = track(() => params.getAll('tag'));
|
|
316
316
|
|
|
317
317
|
<button onClick={() => params.append('tag', 'javascript')}>{'add js'}</button>
|
|
318
318
|
<button onClick={() => params.append('tag', 'typescript')}>{'add ts'}</button>
|
|
319
319
|
<button onClick={() => params.append('tag', 'ripple')}>{'add ripple'}</button>
|
|
320
|
-
<pre>{JSON.stringify(
|
|
320
|
+
<pre>{JSON.stringify(tags)}</pre>
|
|
321
321
|
<pre>{params.size}</pre>
|
|
322
322
|
}
|
|
323
323
|
|
|
@@ -4,12 +4,12 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
4
4
|
it('handles get operation with reactivity', () => {
|
|
5
5
|
component URLTest() {
|
|
6
6
|
const params = RippleURLSearchParams('foo=bar&baz=qux');
|
|
7
|
-
let foo = track(() => params.get('foo'));
|
|
8
|
-
let baz = track(() => params.get('baz'));
|
|
7
|
+
let &[foo] = track(() => params.get('foo'));
|
|
8
|
+
let &[baz] = track(() => params.get('baz'));
|
|
9
9
|
|
|
10
10
|
<button onClick={() => params.set('foo', 'updated')}>{'update foo'}</button>
|
|
11
|
-
<pre>{
|
|
12
|
-
<pre>{
|
|
11
|
+
<pre>{foo}</pre>
|
|
12
|
+
<pre>{baz}</pre>
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
render(URLTest);
|
|
@@ -31,9 +31,9 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
31
31
|
it('handles get for nonexistent key', () => {
|
|
32
32
|
component URLTest() {
|
|
33
33
|
const params = RippleURLSearchParams('foo=bar');
|
|
34
|
-
let nonexistent = track(() => params.get('nonexistent'));
|
|
34
|
+
let &[nonexistent] = track(() => params.get('nonexistent'));
|
|
35
35
|
|
|
36
|
-
<pre>{String(
|
|
36
|
+
<pre>{String(nonexistent)}</pre>
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
render(URLTest);
|
|
@@ -44,10 +44,10 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
44
44
|
it('handles getAll operation with reactivity', () => {
|
|
45
45
|
component URLTest() {
|
|
46
46
|
const params = RippleURLSearchParams('foo=bar&foo=baz');
|
|
47
|
-
let allFoo = track(() => params.getAll('foo'));
|
|
47
|
+
let &[allFoo] = track(() => params.getAll('foo'));
|
|
48
48
|
|
|
49
49
|
<button onClick={() => params.append('foo', 'qux')}>{'append foo'}</button>
|
|
50
|
-
<pre>{JSON.stringify(
|
|
50
|
+
<pre>{JSON.stringify(allFoo)}</pre>
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
render(URLTest);
|
|
@@ -67,13 +67,13 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
67
67
|
it('handles has operation with reactivity', () => {
|
|
68
68
|
component URLTest() {
|
|
69
69
|
const params = RippleURLSearchParams('foo=bar');
|
|
70
|
-
let hasFoo = track(() => params.has('foo'));
|
|
71
|
-
let hasBaz = track(() => params.has('baz'));
|
|
70
|
+
let &[hasFoo] = track(() => params.has('foo'));
|
|
71
|
+
let &[hasBaz] = track(() => params.has('baz'));
|
|
72
72
|
|
|
73
73
|
<button onClick={() => params.append('baz', 'qux')}>{'add baz'}</button>
|
|
74
74
|
<button onClick={() => params.delete('foo')}>{'delete foo'}</button>
|
|
75
|
-
<pre>{
|
|
76
|
-
<pre>{
|
|
75
|
+
<pre>{hasFoo.toString()}</pre>
|
|
76
|
+
<pre>{hasBaz.toString()}</pre>
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
render(URLTest);
|
|
@@ -103,12 +103,12 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
103
103
|
it('handles has with specific value', () => {
|
|
104
104
|
component URLTest() {
|
|
105
105
|
const params = RippleURLSearchParams('foo=bar&foo=baz');
|
|
106
|
-
let hasBarValue = track(() => params.has('foo', 'bar'));
|
|
107
|
-
let hasQuxValue = track(() => params.has('foo', 'qux'));
|
|
106
|
+
let &[hasBarValue] = track(() => params.has('foo', 'bar'));
|
|
107
|
+
let &[hasQuxValue] = track(() => params.has('foo', 'qux'));
|
|
108
108
|
|
|
109
109
|
<button onClick={() => params.append('foo', 'qux')}>{'add qux'}</button>
|
|
110
|
-
<pre>{
|
|
111
|
-
<pre>{
|
|
110
|
+
<pre>{hasBarValue.toString()}</pre>
|
|
111
|
+
<pre>{hasQuxValue.toString()}</pre>
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
render(URLTest);
|
|
@@ -130,11 +130,11 @@ describe('RippleURLSearchParams > retrieval', () => {
|
|
|
130
130
|
it('handles size property with reactivity', () => {
|
|
131
131
|
component URLTest() {
|
|
132
132
|
const params = RippleURLSearchParams('foo=bar');
|
|
133
|
-
let size = track(() => params.size);
|
|
133
|
+
let &[size] = track(() => params.size);
|
|
134
134
|
|
|
135
135
|
<button onClick={() => params.append('baz', 'qux')}>{'add'}</button>
|
|
136
136
|
<button onClick={() => params.delete('foo')}>{'delete'}</button>
|
|
137
|
-
<pre>{
|
|
137
|
+
<pre>{size}</pre>
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
render(URLTest);
|
|
@@ -4,10 +4,10 @@ describe('RippleURLSearchParams > serialization', () => {
|
|
|
4
4
|
it('handles toString method with reactivity', () => {
|
|
5
5
|
component URLTest() {
|
|
6
6
|
const params = RippleURLSearchParams('foo=bar');
|
|
7
|
-
let string = track(() => params.toString());
|
|
7
|
+
let &[string] = track(() => params.toString());
|
|
8
8
|
|
|
9
9
|
<button onClick={() => params.append('baz', 'qux')}>{'add'}</button>
|
|
10
|
-
<pre>{
|
|
10
|
+
<pre>{string}</pre>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
render(URLTest);
|
|
@@ -14,14 +14,14 @@ import { track } from 'ripple';
|
|
|
14
14
|
export function ClickCounter(__anchor, _, __block) {
|
|
15
15
|
_$_.push_component();
|
|
16
16
|
|
|
17
|
-
let
|
|
17
|
+
let lazy = _$_.track(0, void 0, void 0, __block);
|
|
18
18
|
var div_1 = root();
|
|
19
19
|
|
|
20
20
|
{
|
|
21
21
|
var button_1 = _$_.child(div_1);
|
|
22
22
|
|
|
23
23
|
button_1.__click = () => {
|
|
24
|
-
_$_.update(
|
|
24
|
+
_$_.update(lazy);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
var span_1 = _$_.sibling(button_1);
|
|
@@ -34,7 +34,7 @@ export function ClickCounter(__anchor, _, __block) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
_$_.render(() => {
|
|
37
|
-
_$_.set_text(text, _$_.get(
|
|
37
|
+
_$_.set_text(text, _$_.get(lazy));
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
_$_.append(__anchor, div_1);
|
|
@@ -44,14 +44,14 @@ export function ClickCounter(__anchor, _, __block) {
|
|
|
44
44
|
export function IncrementDecrement(__anchor, _, __block) {
|
|
45
45
|
_$_.push_component();
|
|
46
46
|
|
|
47
|
-
let
|
|
47
|
+
let lazy_1 = _$_.track(0, void 0, void 0, __block);
|
|
48
48
|
var div_2 = root_1();
|
|
49
49
|
|
|
50
50
|
{
|
|
51
51
|
var button_2 = _$_.child(div_2);
|
|
52
52
|
|
|
53
53
|
button_2.__click = () => {
|
|
54
|
-
_$_.update(
|
|
54
|
+
_$_.update(lazy_1, -1);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var span_2 = _$_.sibling(button_2);
|
|
@@ -65,12 +65,12 @@ export function IncrementDecrement(__anchor, _, __block) {
|
|
|
65
65
|
var button_3 = _$_.sibling(span_2);
|
|
66
66
|
|
|
67
67
|
button_3.__click = () => {
|
|
68
|
-
_$_.update(
|
|
68
|
+
_$_.update(lazy_1);
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
_$_.render(() => {
|
|
73
|
-
_$_.set_text(text_1, _$_.get(
|
|
73
|
+
_$_.set_text(text_1, _$_.get(lazy_1));
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
_$_.append(__anchor, div_2);
|
|
@@ -80,19 +80,19 @@ export function IncrementDecrement(__anchor, _, __block) {
|
|
|
80
80
|
export function MultipleEvents(__anchor, _, __block) {
|
|
81
81
|
_$_.push_component();
|
|
82
82
|
|
|
83
|
-
let
|
|
84
|
-
let
|
|
83
|
+
let lazy_2 = _$_.track(0, void 0, void 0, __block);
|
|
84
|
+
let lazy_3 = _$_.track(0, void 0, void 0, __block);
|
|
85
85
|
var div_3 = root_2();
|
|
86
86
|
|
|
87
87
|
{
|
|
88
88
|
var button_4 = _$_.child(div_3);
|
|
89
89
|
|
|
90
90
|
button_4.__click = () => {
|
|
91
|
-
_$_.update(
|
|
91
|
+
_$_.update(lazy_2);
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
_$_.event('MouseEnter', button_4, () => {
|
|
95
|
-
_$_.update(
|
|
95
|
+
_$_.update(lazy_3);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
var span_3 = _$_.sibling(button_4);
|
|
@@ -114,13 +114,13 @@ export function MultipleEvents(__anchor, _, __block) {
|
|
|
114
114
|
|
|
115
115
|
_$_.render(
|
|
116
116
|
(__prev) => {
|
|
117
|
-
var __a = _$_.get(
|
|
117
|
+
var __a = _$_.get(lazy_2);
|
|
118
118
|
|
|
119
119
|
if (__prev.a !== __a) {
|
|
120
120
|
_$_.set_text(text_2, __prev.a = __a);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
var __b = _$_.get(
|
|
123
|
+
var __b = _$_.get(lazy_3);
|
|
124
124
|
|
|
125
125
|
if (__prev.b !== __b) {
|
|
126
126
|
_$_.set_text(text_3, __prev.b = __b);
|
|
@@ -136,12 +136,12 @@ export function MultipleEvents(__anchor, _, __block) {
|
|
|
136
136
|
export function MultiStateUpdate(__anchor, _, __block) {
|
|
137
137
|
_$_.push_component();
|
|
138
138
|
|
|
139
|
-
let
|
|
140
|
-
let
|
|
139
|
+
let lazy_4 = _$_.track(0, void 0, void 0, __block);
|
|
140
|
+
let lazy_5 = _$_.track('none', void 0, void 0, __block);
|
|
141
141
|
|
|
142
142
|
const handleClick = () => {
|
|
143
|
-
_$_.update(
|
|
144
|
-
_$_.set(
|
|
143
|
+
_$_.update(lazy_4);
|
|
144
|
+
_$_.set(lazy_5, 'increment');
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
var div_4 = root_3();
|
|
@@ -170,13 +170,13 @@ export function MultiStateUpdate(__anchor, _, __block) {
|
|
|
170
170
|
|
|
171
171
|
_$_.render(
|
|
172
172
|
(__prev) => {
|
|
173
|
-
var __a = _$_.get(
|
|
173
|
+
var __a = _$_.get(lazy_4);
|
|
174
174
|
|
|
175
175
|
if (__prev.a !== __a) {
|
|
176
176
|
_$_.set_text(text_4, __prev.a = __a);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
var __b = _$_.get(
|
|
179
|
+
var __b = _$_.get(lazy_5);
|
|
180
180
|
|
|
181
181
|
if (__prev.b !== __b) {
|
|
182
182
|
_$_.set_text(text_5, __prev.b = __b);
|
|
@@ -192,14 +192,14 @@ export function MultiStateUpdate(__anchor, _, __block) {
|
|
|
192
192
|
export function ToggleButton(__anchor, _, __block) {
|
|
193
193
|
_$_.push_component();
|
|
194
194
|
|
|
195
|
-
let
|
|
195
|
+
let lazy_6 = _$_.track(false, void 0, void 0, __block);
|
|
196
196
|
var div_5 = root_4();
|
|
197
197
|
|
|
198
198
|
{
|
|
199
199
|
var button_6 = _$_.child(div_5);
|
|
200
200
|
|
|
201
201
|
button_6.__click = () => {
|
|
202
|
-
_$_.set(
|
|
202
|
+
_$_.set(lazy_6, !_$_.get(lazy_6));
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
{
|
|
@@ -210,7 +210,7 @@ export function ToggleButton(__anchor, _, __block) {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
_$_.render(() => {
|
|
213
|
-
_$_.set_text(text_6, _$_.get(
|
|
213
|
+
_$_.set_text(text_6, _$_.get(lazy_6) ? 'ON' : 'OFF');
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
_$_.append(__anchor, div_5);
|
|
@@ -241,7 +241,7 @@ export function ChildButton(__anchor, props, __block) {
|
|
|
241
241
|
export function ParentWithChildButton(__anchor, _, __block) {
|
|
242
242
|
_$_.push_component();
|
|
243
243
|
|
|
244
|
-
let
|
|
244
|
+
let lazy_7 = _$_.track(0, void 0, void 0, __block);
|
|
245
245
|
var div_6 = root_6();
|
|
246
246
|
|
|
247
247
|
{
|
|
@@ -251,7 +251,7 @@ export function ParentWithChildButton(__anchor, _, __block) {
|
|
|
251
251
|
node,
|
|
252
252
|
{
|
|
253
253
|
onClick: () => {
|
|
254
|
-
_$_.update(
|
|
254
|
+
_$_.update(lazy_7);
|
|
255
255
|
},
|
|
256
256
|
label: "Click me"
|
|
257
257
|
},
|
|
@@ -270,7 +270,7 @@ export function ParentWithChildButton(__anchor, _, __block) {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
_$_.render(() => {
|
|
273
|
-
_$_.set_text(text_8, _$_.get(
|
|
273
|
+
_$_.set_text(text_8, _$_.get(lazy_7));
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
_$_.append(__anchor, div_6);
|