ripple 0.3.9 → 0.3.11
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 +43 -0
- package/package.json +2 -2
- package/src/compiler/errors.js +1 -1
- package/src/compiler/index.d.ts +3 -1
- package/src/compiler/phases/1-parse/index.js +195 -23
- package/src/compiler/phases/2-analyze/index.js +266 -108
- package/src/compiler/phases/2-analyze/prune.js +13 -5
- package/src/compiler/phases/3-transform/client/index.js +304 -80
- package/src/compiler/phases/3-transform/server/index.js +108 -43
- package/src/compiler/types/index.d.ts +28 -3
- package/src/compiler/types/parse.d.ts +3 -1
- package/src/compiler/utils.js +275 -1
- package/src/runtime/element.js +39 -0
- package/src/runtime/index-client.js +14 -4
- package/src/runtime/internal/client/composite.js +10 -6
- package/src/runtime/internal/client/expression.js +280 -0
- package/src/runtime/internal/client/index.js +4 -0
- package/src/runtime/internal/client/portal.js +12 -6
- package/src/runtime/internal/server/index.js +26 -1
- package/src/utils/builders.js +30 -0
- package/tests/client/basic/__snapshots__/basic.rendering.test.ripple.snap +1 -0
- package/tests/client/basic/basic.components.test.ripple +85 -87
- package/tests/client/basic/basic.errors.test.ripple +4 -8
- package/tests/client/basic/basic.rendering.test.ripple +27 -10
- package/tests/client/capture-error.js +12 -0
- package/tests/client/compiler/compiler.basic.test.ripple +76 -6
- package/tests/client/composite/composite.props.test.ripple +1 -3
- package/tests/client/composite/composite.render.test.ripple +91 -13
- package/tests/client/css/global-additional-cases.test.ripple +3 -3
- package/tests/client/return.test.ripple +101 -0
- package/tests/client/svg.test.ripple +4 -4
- package/tests/client/tsx.test.ripple +486 -0
- package/tests/hydration/basic.test.js +23 -0
- package/tests/hydration/compiled/client/basic.js +111 -75
- package/tests/hydration/compiled/client/composite.js +81 -46
- package/tests/hydration/compiled/client/events.js +18 -63
- package/tests/hydration/compiled/client/for.js +90 -183
- package/tests/hydration/compiled/client/head.js +10 -25
- package/tests/hydration/compiled/client/hmr.js +10 -13
- package/tests/hydration/compiled/client/html.js +251 -380
- package/tests/hydration/compiled/client/if-children.js +35 -45
- package/tests/hydration/compiled/client/if.js +2 -2
- package/tests/hydration/compiled/client/mixed-control-flow.js +24 -72
- package/tests/hydration/compiled/client/nested-control-flow.js +115 -391
- package/tests/hydration/compiled/client/portal.js +8 -20
- package/tests/hydration/compiled/client/reactivity.js +14 -47
- package/tests/hydration/compiled/client/return.js +2 -5
- package/tests/hydration/compiled/client/try.js +4 -4
- package/tests/hydration/compiled/server/basic.js +64 -31
- package/tests/hydration/compiled/server/composite.js +62 -29
- package/tests/hydration/compiled/server/hmr.js +24 -37
- package/tests/hydration/compiled/server/html.js +472 -611
- package/tests/hydration/compiled/server/if-children.js +77 -103
- package/tests/hydration/compiled/server/portal.js +8 -8
- package/tests/hydration/components/basic.ripple +15 -5
- package/tests/hydration/components/composite.ripple +13 -1
- package/tests/hydration/components/hmr.ripple +1 -3
- package/tests/hydration/components/html.ripple +13 -35
- package/tests/hydration/components/if-children.ripple +4 -8
- package/tests/hydration/composite.test.js +11 -0
- package/tests/server/basic.attributes.test.ripple +50 -0
- package/tests/server/basic.components.test.ripple +22 -28
- package/tests/server/basic.test.ripple +12 -0
- package/tests/server/compiler.test.ripple +25 -8
- package/tests/server/composite.props.test.ripple +1 -3
- package/tests/server/style-identifier.test.ripple +2 -4
- package/tests/utils/compiler-compat-config.test.js +38 -0
- package/tests/utils/vite-plugin-config.test.js +113 -0
- package/tsconfig.typecheck.json +2 -1
- package/types/index.d.ts +8 -11
|
@@ -27,16 +27,13 @@ export function ClickCounter(__anchor, _, __block) {
|
|
|
27
27
|
var span_1 = _$_.sibling(button_1);
|
|
28
28
|
|
|
29
29
|
{
|
|
30
|
-
var
|
|
30
|
+
var expression = _$_.child(span_1, true);
|
|
31
31
|
|
|
32
|
+
_$_.expression(expression, () => _$_.get(lazy));
|
|
32
33
|
_$_.pop(span_1);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
_$_.render(() => {
|
|
37
|
-
_$_.set_text(text, _$_.get(lazy));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
37
|
_$_.append(__anchor, div_1);
|
|
41
38
|
_$_.pop_component();
|
|
42
39
|
}
|
|
@@ -57,8 +54,9 @@ export function IncrementDecrement(__anchor, _, __block) {
|
|
|
57
54
|
var span_2 = _$_.sibling(button_2);
|
|
58
55
|
|
|
59
56
|
{
|
|
60
|
-
var
|
|
57
|
+
var expression_1 = _$_.child(span_2, true);
|
|
61
58
|
|
|
59
|
+
_$_.expression(expression_1, () => _$_.get(lazy_1));
|
|
62
60
|
_$_.pop(span_2);
|
|
63
61
|
}
|
|
64
62
|
|
|
@@ -69,10 +67,6 @@ export function IncrementDecrement(__anchor, _, __block) {
|
|
|
69
67
|
};
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
_$_.render(() => {
|
|
73
|
-
_$_.set_text(text_1, _$_.get(lazy_1));
|
|
74
|
-
});
|
|
75
|
-
|
|
76
70
|
_$_.append(__anchor, div_2);
|
|
77
71
|
_$_.pop_component();
|
|
78
72
|
}
|
|
@@ -98,37 +92,22 @@ export function MultipleEvents(__anchor, _, __block) {
|
|
|
98
92
|
var span_3 = _$_.sibling(button_4);
|
|
99
93
|
|
|
100
94
|
{
|
|
101
|
-
var
|
|
95
|
+
var expression_2 = _$_.child(span_3, true);
|
|
102
96
|
|
|
97
|
+
_$_.expression(expression_2, () => _$_.get(lazy_2));
|
|
103
98
|
_$_.pop(span_3);
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
var span_4 = _$_.sibling(span_3);
|
|
107
102
|
|
|
108
103
|
{
|
|
109
|
-
var
|
|
104
|
+
var expression_3 = _$_.child(span_4, true);
|
|
110
105
|
|
|
106
|
+
_$_.expression(expression_3, () => _$_.get(lazy_3));
|
|
111
107
|
_$_.pop(span_4);
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
110
|
|
|
115
|
-
_$_.render(
|
|
116
|
-
(__prev) => {
|
|
117
|
-
var __a = _$_.get(lazy_2);
|
|
118
|
-
|
|
119
|
-
if (__prev.a !== __a) {
|
|
120
|
-
_$_.set_text(text_2, __prev.a = __a);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
var __b = _$_.get(lazy_3);
|
|
124
|
-
|
|
125
|
-
if (__prev.b !== __b) {
|
|
126
|
-
_$_.set_text(text_3, __prev.b = __b);
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{ a: ' ', b: ' ' }
|
|
130
|
-
);
|
|
131
|
-
|
|
132
111
|
_$_.append(__anchor, div_3);
|
|
133
112
|
_$_.pop_component();
|
|
134
113
|
}
|
|
@@ -154,37 +133,22 @@ export function MultiStateUpdate(__anchor, _, __block) {
|
|
|
154
133
|
var span_5 = _$_.sibling(button_5);
|
|
155
134
|
|
|
156
135
|
{
|
|
157
|
-
var
|
|
136
|
+
var expression_4 = _$_.child(span_5, true);
|
|
158
137
|
|
|
138
|
+
_$_.expression(expression_4, () => _$_.get(lazy_4));
|
|
159
139
|
_$_.pop(span_5);
|
|
160
140
|
}
|
|
161
141
|
|
|
162
142
|
var span_6 = _$_.sibling(span_5);
|
|
163
143
|
|
|
164
144
|
{
|
|
165
|
-
var
|
|
145
|
+
var expression_5 = _$_.child(span_6, true);
|
|
166
146
|
|
|
147
|
+
_$_.expression(expression_5, () => _$_.get(lazy_5));
|
|
167
148
|
_$_.pop(span_6);
|
|
168
149
|
}
|
|
169
150
|
}
|
|
170
151
|
|
|
171
|
-
_$_.render(
|
|
172
|
-
(__prev) => {
|
|
173
|
-
var __a = _$_.get(lazy_4);
|
|
174
|
-
|
|
175
|
-
if (__prev.a !== __a) {
|
|
176
|
-
_$_.set_text(text_4, __prev.a = __a);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
var __b = _$_.get(lazy_5);
|
|
180
|
-
|
|
181
|
-
if (__prev.b !== __b) {
|
|
182
|
-
_$_.set_text(text_5, __prev.b = __b);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{ a: ' ', b: ' ' }
|
|
186
|
-
);
|
|
187
|
-
|
|
188
152
|
_$_.append(__anchor, div_4);
|
|
189
153
|
_$_.pop_component();
|
|
190
154
|
}
|
|
@@ -203,16 +167,13 @@ export function ToggleButton(__anchor, _, __block) {
|
|
|
203
167
|
};
|
|
204
168
|
|
|
205
169
|
{
|
|
206
|
-
var
|
|
170
|
+
var expression_6 = _$_.child(button_6, true);
|
|
207
171
|
|
|
172
|
+
_$_.expression(expression_6, () => _$_.get(lazy_6) ? 'ON' : 'OFF');
|
|
208
173
|
_$_.pop(button_6);
|
|
209
174
|
}
|
|
210
175
|
}
|
|
211
176
|
|
|
212
|
-
_$_.render(() => {
|
|
213
|
-
_$_.set_text(text_6, _$_.get(lazy_6) ? 'ON' : 'OFF');
|
|
214
|
-
});
|
|
215
|
-
|
|
216
177
|
_$_.append(__anchor, div_5);
|
|
217
178
|
_$_.pop_component();
|
|
218
179
|
}
|
|
@@ -225,15 +186,12 @@ export function ChildButton(__anchor, props, __block) {
|
|
|
225
186
|
_$_.render_event('Click', button_7, () => props.onClick);
|
|
226
187
|
|
|
227
188
|
{
|
|
228
|
-
var
|
|
189
|
+
var expression_7 = _$_.child(button_7, true);
|
|
229
190
|
|
|
191
|
+
_$_.expression(expression_7, () => props.label);
|
|
230
192
|
_$_.pop(button_7);
|
|
231
193
|
}
|
|
232
194
|
|
|
233
|
-
_$_.render(() => {
|
|
234
|
-
_$_.set_text(text_7, props.label);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
195
|
_$_.append(__anchor, button_7);
|
|
238
196
|
_$_.pop_component();
|
|
239
197
|
}
|
|
@@ -261,18 +219,15 @@ export function ParentWithChildButton(__anchor, _, __block) {
|
|
|
261
219
|
var span_7 = _$_.sibling(node);
|
|
262
220
|
|
|
263
221
|
{
|
|
264
|
-
var
|
|
222
|
+
var expression_8 = _$_.child(span_7, true);
|
|
265
223
|
|
|
224
|
+
_$_.expression(expression_8, () => _$_.get(lazy_7));
|
|
266
225
|
_$_.pop(span_7);
|
|
267
226
|
}
|
|
268
227
|
|
|
269
228
|
_$_.pop(div_6);
|
|
270
229
|
}
|
|
271
230
|
|
|
272
|
-
_$_.render(() => {
|
|
273
|
-
_$_.set_text(text_8, _$_.get(lazy_7));
|
|
274
|
-
});
|
|
275
|
-
|
|
276
231
|
_$_.append(__anchor, div_6);
|
|
277
232
|
_$_.pop_component();
|
|
278
233
|
}
|