ripple 0.2.208 → 0.2.211
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 +57 -0
- package/README.md +2 -1
- package/package.json +2 -6
- package/shims/rollup-estree-types.d.ts +1 -1
- package/src/compiler/index.d.ts +1 -0
- package/src/compiler/index.js +7 -1
- package/src/compiler/phases/1-parse/index.js +24 -7
- package/src/compiler/phases/2-analyze/css-analyze.js +100 -104
- package/src/compiler/phases/2-analyze/index.js +215 -2
- package/src/compiler/phases/3-transform/client/index.js +388 -50
- package/src/compiler/phases/3-transform/segments.js +123 -39
- package/src/compiler/phases/3-transform/server/index.js +266 -13
- package/src/compiler/types/index.d.ts +15 -3
- package/src/compiler/utils.js +1 -15
- package/src/constants.js +0 -2
- package/src/helpers.d.ts +4 -0
- package/src/html-tree-validation.js +211 -0
- package/src/jsx-runtime.d.ts +260 -259
- package/src/jsx-runtime.js +12 -12
- package/src/runtime/array.js +17 -17
- package/src/runtime/create-subscriber.js +1 -1
- package/src/runtime/index-client.js +1 -5
- package/src/runtime/index-server.js +15 -0
- package/src/runtime/internal/client/compat.js +3 -3
- package/src/runtime/internal/client/composite.js +6 -1
- package/src/runtime/internal/client/head.js +50 -4
- package/src/runtime/internal/client/html.js +73 -12
- package/src/runtime/internal/client/hydration.js +12 -0
- package/src/runtime/internal/client/index.js +1 -1
- package/src/runtime/internal/client/portal.js +54 -29
- package/src/runtime/internal/client/rpc.js +3 -1
- package/src/runtime/internal/client/switch.js +5 -0
- package/src/runtime/internal/client/template.js +119 -12
- package/src/runtime/internal/client/try.js +1 -0
- package/src/runtime/internal/server/index.js +113 -1
- package/src/runtime/internal/server/rpc.js +4 -4
- package/src/runtime/map.js +2 -2
- package/src/runtime/object.js +6 -6
- package/src/runtime/proxy.js +12 -11
- package/src/runtime/reactive-value.js +9 -1
- package/src/runtime/set.js +12 -7
- package/src/runtime/url-search-params.js +0 -1
- package/src/server/index.js +4 -0
- package/src/utils/hashing.js +15 -0
- package/src/utils/normalize_css_property_name.js +1 -1
- package/tests/client/array/array.mutations.test.ripple +8 -8
- package/tests/client/basic/basic.errors.test.ripple +28 -0
- package/tests/client/basic/basic.events.test.ripple +6 -3
- package/tests/client/basic/basic.utilities.test.ripple +1 -1
- package/tests/client/compiler/compiler.regex.test.ripple +10 -8
- package/tests/client/composite/composite.generics.test.ripple +5 -2
- package/tests/client/dynamic-elements.test.ripple +30 -1
- package/tests/client/function-overload-import.ripple +6 -7
- package/tests/client/html.test.ripple +0 -1
- package/tests/client/object.test.ripple +2 -2
- package/tests/client/portal.test.ripple +3 -3
- package/tests/client/return.test.ripple +2500 -0
- package/tests/client/try.test.ripple +69 -0
- package/tests/client/typescript-generics.test.ripple +1 -1
- package/tests/client/url/url.derived.test.ripple +1 -1
- package/tests/client/url/url.parsing.test.ripple +3 -3
- package/tests/client/url/url.partial-removal.test.ripple +7 -7
- package/tests/client/url/url.reactivity.test.ripple +15 -15
- package/tests/client/url/url.serialization.test.ripple +2 -2
- package/tests/hydration/basic.test.js +23 -0
- package/tests/hydration/build-components.js +10 -4
- package/tests/hydration/compiled/client/basic.js +165 -3
- package/tests/hydration/compiled/client/composite.js +139 -0
- package/tests/hydration/compiled/client/for.js +1140 -23
- package/tests/hydration/compiled/client/head.js +234 -0
- package/tests/hydration/compiled/client/html.js +135 -0
- package/tests/hydration/compiled/client/portal.js +172 -0
- package/tests/hydration/compiled/client/reactivity.js +3 -1
- package/tests/hydration/compiled/client/return.js +1976 -0
- package/tests/hydration/compiled/client/switch.js +162 -0
- package/tests/hydration/compiled/server/basic.js +249 -0
- package/tests/hydration/compiled/server/composite.js +176 -0
- package/tests/hydration/compiled/server/events.js +1 -1
- package/tests/hydration/compiled/server/for.js +891 -1
- package/tests/hydration/compiled/server/head.js +291 -0
- package/tests/hydration/compiled/server/html.js +133 -0
- package/tests/hydration/compiled/server/if.js +1 -1
- package/tests/hydration/compiled/server/portal.js +250 -0
- package/tests/hydration/compiled/server/reactivity.js +1 -1
- package/tests/hydration/compiled/server/return.js +1969 -0
- package/tests/hydration/compiled/server/switch.js +130 -0
- package/tests/hydration/components/basic.ripple +55 -0
- package/tests/hydration/components/composite.ripple +37 -0
- package/tests/hydration/components/for.ripple +403 -0
- package/tests/hydration/components/head.ripple +111 -0
- package/tests/hydration/components/html.ripple +38 -0
- package/tests/hydration/components/portal.ripple +49 -0
- package/tests/hydration/components/return.ripple +564 -0
- package/tests/hydration/components/switch.ripple +51 -0
- package/tests/hydration/composite.test.js +42 -0
- package/tests/hydration/for.test.js +363 -0
- package/tests/hydration/head.test.js +105 -0
- package/tests/hydration/html.test.js +46 -0
- package/tests/hydration/portal.test.js +71 -0
- package/tests/hydration/return.test.js +544 -0
- package/tests/hydration/switch.test.js +42 -0
- package/tests/server/basic.attributes.test.ripple +1 -1
- package/tests/server/compiler.test.ripple +22 -0
- package/tests/server/composite.test.ripple +5 -2
- package/tests/server/html-nesting-validation.test.ripple +237 -0
- package/tests/server/return.test.ripple +1379 -0
- package/tests/setup-hydration.js +6 -1
- package/tests/utils/escaping.test.js +3 -1
- package/tests/utils/normalize_css_property_name.test.js +0 -1
- package/tests/utils/patterns.test.js +6 -2
- package/tests/utils/sanitize_template_string.test.js +3 -2
- package/types/server.d.ts +16 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as _$_ from 'ripple/internal/client';
|
|
2
|
+
|
|
3
|
+
var root = _$_.template(`<div class="layout"><!></div>`, 0);
|
|
4
|
+
var root_1 = _$_.template(`<div class="single">single</div>`, 0);
|
|
5
|
+
var root_2 = _$_.template(`<h1>title</h1><p>description</p>`, 1);
|
|
6
|
+
var root_3 = _$_.template(`<!>`, 1);
|
|
7
|
+
var root_5 = _$_.template(`<!>`, 1);
|
|
8
|
+
var root_4 = _$_.template(`<!>`, 1);
|
|
9
|
+
var root_7 = _$_.template(`<!><div class="extra">extra</div>`, 1);
|
|
10
|
+
var root_6 = _$_.template(`<!>`, 1);
|
|
11
|
+
var root_9 = _$_.template(`<!>`, 1);
|
|
12
|
+
var root_8 = _$_.template(`<!>`, 1);
|
|
13
|
+
|
|
14
|
+
export function Layout(__anchor, __props, __block) {
|
|
15
|
+
_$_.push_component();
|
|
16
|
+
|
|
17
|
+
var div_1 = root();
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
var node = _$_.child(div_1);
|
|
21
|
+
|
|
22
|
+
_$_.composite(() => __props.children, node, {});
|
|
23
|
+
_$_.pop(div_1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_$_.append(__anchor, div_1);
|
|
27
|
+
_$_.pop_component();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function SingleChild(__anchor, _, __block) {
|
|
31
|
+
_$_.push_component();
|
|
32
|
+
|
|
33
|
+
var div_2 = root_1();
|
|
34
|
+
|
|
35
|
+
_$_.append(__anchor, div_2);
|
|
36
|
+
_$_.pop_component();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function MultiRootChild(__anchor, _, __block) {
|
|
40
|
+
_$_.push_component();
|
|
41
|
+
|
|
42
|
+
var fragment = root_2();
|
|
43
|
+
|
|
44
|
+
_$_.next();
|
|
45
|
+
_$_.append(__anchor, fragment, true);
|
|
46
|
+
_$_.pop_component();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function EmptyLayout(__anchor, _, __block) {
|
|
50
|
+
_$_.push_component();
|
|
51
|
+
|
|
52
|
+
var fragment_1 = root_3();
|
|
53
|
+
var node_1 = _$_.first_child_frag(fragment_1);
|
|
54
|
+
|
|
55
|
+
Layout(node_1, {}, _$_.active_block);
|
|
56
|
+
_$_.append(__anchor, fragment_1);
|
|
57
|
+
_$_.pop_component();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function LayoutWithSingleChild(__anchor, _, __block) {
|
|
61
|
+
_$_.push_component();
|
|
62
|
+
|
|
63
|
+
var fragment_2 = root_4();
|
|
64
|
+
var node_2 = _$_.first_child_frag(fragment_2);
|
|
65
|
+
|
|
66
|
+
Layout(
|
|
67
|
+
node_2,
|
|
68
|
+
{
|
|
69
|
+
children(__anchor, _, __block) {
|
|
70
|
+
_$_.push_component();
|
|
71
|
+
|
|
72
|
+
var fragment_3 = root_5();
|
|
73
|
+
var node_3 = _$_.first_child_frag(fragment_3);
|
|
74
|
+
|
|
75
|
+
SingleChild(node_3, {}, _$_.active_block);
|
|
76
|
+
_$_.append(__anchor, fragment_3);
|
|
77
|
+
_$_.pop_component();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
_$_.active_block
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
_$_.append(__anchor, fragment_2);
|
|
84
|
+
_$_.pop_component();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function LayoutWithMultipleChildren(__anchor, _, __block) {
|
|
88
|
+
_$_.push_component();
|
|
89
|
+
|
|
90
|
+
var fragment_4 = root_6();
|
|
91
|
+
var node_4 = _$_.first_child_frag(fragment_4);
|
|
92
|
+
|
|
93
|
+
Layout(
|
|
94
|
+
node_4,
|
|
95
|
+
{
|
|
96
|
+
children(__anchor, _, __block) {
|
|
97
|
+
_$_.push_component();
|
|
98
|
+
|
|
99
|
+
var fragment_5 = root_7();
|
|
100
|
+
var node_5 = _$_.first_child_frag(fragment_5);
|
|
101
|
+
|
|
102
|
+
SingleChild(node_5, {}, _$_.active_block);
|
|
103
|
+
_$_.append(__anchor, fragment_5);
|
|
104
|
+
_$_.pop_component();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
_$_.active_block
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
_$_.append(__anchor, fragment_4);
|
|
111
|
+
_$_.pop_component();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function LayoutWithMultiRootChild(__anchor, _, __block) {
|
|
115
|
+
_$_.push_component();
|
|
116
|
+
|
|
117
|
+
var fragment_6 = root_8();
|
|
118
|
+
var node_6 = _$_.first_child_frag(fragment_6);
|
|
119
|
+
|
|
120
|
+
Layout(
|
|
121
|
+
node_6,
|
|
122
|
+
{
|
|
123
|
+
children(__anchor, _, __block) {
|
|
124
|
+
_$_.push_component();
|
|
125
|
+
|
|
126
|
+
var fragment_7 = root_9();
|
|
127
|
+
var node_7 = _$_.first_child_frag(fragment_7);
|
|
128
|
+
|
|
129
|
+
MultiRootChild(node_7, {}, _$_.active_block);
|
|
130
|
+
_$_.append(__anchor, fragment_7);
|
|
131
|
+
_$_.pop_component();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
_$_.active_block
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
_$_.append(__anchor, fragment_6);
|
|
138
|
+
_$_.pop_component();
|
|
139
|
+
}
|