ripple 0.3.9 → 0.3.10
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 +12 -0
- package/package.json +2 -2
- package/src/compiler/phases/1-parse/index.js +25 -15
- package/src/compiler/phases/2-analyze/index.js +35 -88
- package/src/compiler/phases/2-analyze/prune.js +13 -5
- package/src/compiler/phases/3-transform/client/index.js +188 -56
- package/src/compiler/phases/3-transform/server/index.js +62 -40
- package/src/compiler/types/index.d.ts +9 -1
- package/src/compiler/types/parse.d.ts +2 -0
- package/src/compiler/utils.js +101 -1
- package/src/runtime/element.js +39 -0
- package/src/runtime/internal/client/composite.js +10 -6
- package/src/runtime/internal/client/expression.js +218 -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/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 +23 -8
- 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 +45 -13
- package/tests/client/css/global-additional-cases.test.ripple +3 -3
- package/tests/client/svg.test.ripple +4 -4
- package/tests/hydration/basic.test.js +23 -0
- package/tests/hydration/compiled/client/basic.js +118 -66
- package/tests/hydration/compiled/client/composite.js +90 -37
- package/tests/hydration/compiled/client/events.js +18 -18
- package/tests/hydration/compiled/client/for.js +62 -62
- package/tests/hydration/compiled/client/head.js +10 -10
- package/tests/hydration/compiled/client/hmr.js +13 -10
- package/tests/hydration/compiled/client/html.js +274 -236
- package/tests/hydration/compiled/client/if-children.js +41 -35
- package/tests/hydration/compiled/client/if.js +2 -2
- package/tests/hydration/compiled/client/mixed-control-flow.js +12 -12
- package/tests/hydration/compiled/client/nested-control-flow.js +46 -46
- package/tests/hydration/compiled/client/portal.js +8 -8
- package/tests/hydration/compiled/client/reactivity.js +14 -14
- package/tests/hydration/compiled/client/return.js +2 -2
- 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/types/index.d.ts +9 -2
|
@@ -19,13 +19,16 @@ export function Layout(__anchor, { children }, __block) {
|
|
|
19
19
|
var main_1 = _$_.sibling(nav_1);
|
|
20
20
|
|
|
21
21
|
{
|
|
22
|
-
var
|
|
22
|
+
var expression = _$_.child(main_1);
|
|
23
23
|
|
|
24
|
-
children(node, {}, _$_.active_block);
|
|
25
24
|
_$_.pop(main_1);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
|
|
28
|
+
_$_.render(() => {
|
|
29
|
+
_$_.expression(expression, () => children);
|
|
30
|
+
});
|
|
31
|
+
|
|
29
32
|
_$_.append(__anchor, div_1);
|
|
30
33
|
_$_.pop_component();
|
|
31
34
|
}
|
|
@@ -37,7 +40,7 @@ export function Content(__anchor, _, __block) {
|
|
|
37
40
|
var div_2 = root_1();
|
|
38
41
|
|
|
39
42
|
{
|
|
40
|
-
var
|
|
43
|
+
var node = _$_.child(div_2);
|
|
41
44
|
|
|
42
45
|
{
|
|
43
46
|
var consequent = (__anchor) => {
|
|
@@ -46,7 +49,7 @@ export function Content(__anchor, _, __block) {
|
|
|
46
49
|
_$_.append(__anchor, p_1);
|
|
47
50
|
};
|
|
48
51
|
|
|
49
|
-
_$_.if(
|
|
52
|
+
_$_.if(node, (__render) => {
|
|
50
53
|
if (_$_.get(lazy)) __render(consequent);
|
|
51
54
|
});
|
|
52
55
|
}
|
|
@@ -62,21 +65,21 @@ export function LayoutWithContent(__anchor, _, __block) {
|
|
|
62
65
|
_$_.push_component();
|
|
63
66
|
|
|
64
67
|
var fragment = root_3();
|
|
65
|
-
var
|
|
68
|
+
var node_1 = _$_.first_child_frag(fragment);
|
|
66
69
|
|
|
67
70
|
Layout(
|
|
68
|
-
|
|
71
|
+
node_1,
|
|
69
72
|
{
|
|
70
|
-
children(__anchor, _, __block) {
|
|
73
|
+
children: _$_.ripple_element(function render_children(__anchor, _, __block) {
|
|
71
74
|
_$_.push_component();
|
|
72
75
|
|
|
73
76
|
var fragment_1 = root_4();
|
|
74
|
-
var
|
|
77
|
+
var node_2 = _$_.first_child_frag(fragment_1);
|
|
75
78
|
|
|
76
|
-
Content(
|
|
79
|
+
Content(node_2, {}, _$_.active_block);
|
|
77
80
|
_$_.append(__anchor, fragment_1);
|
|
78
81
|
_$_.pop_component();
|
|
79
|
-
}
|
|
82
|
+
})
|
|
80
83
|
},
|
|
81
84
|
_$_.active_block
|
|
82
85
|
);
|