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.
Files changed (70) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +2 -2
  3. package/src/compiler/errors.js +1 -1
  4. package/src/compiler/index.d.ts +3 -1
  5. package/src/compiler/phases/1-parse/index.js +195 -23
  6. package/src/compiler/phases/2-analyze/index.js +266 -108
  7. package/src/compiler/phases/2-analyze/prune.js +13 -5
  8. package/src/compiler/phases/3-transform/client/index.js +304 -80
  9. package/src/compiler/phases/3-transform/server/index.js +108 -43
  10. package/src/compiler/types/index.d.ts +28 -3
  11. package/src/compiler/types/parse.d.ts +3 -1
  12. package/src/compiler/utils.js +275 -1
  13. package/src/runtime/element.js +39 -0
  14. package/src/runtime/index-client.js +14 -4
  15. package/src/runtime/internal/client/composite.js +10 -6
  16. package/src/runtime/internal/client/expression.js +280 -0
  17. package/src/runtime/internal/client/index.js +4 -0
  18. package/src/runtime/internal/client/portal.js +12 -6
  19. package/src/runtime/internal/server/index.js +26 -1
  20. package/src/utils/builders.js +30 -0
  21. package/tests/client/basic/__snapshots__/basic.rendering.test.ripple.snap +1 -0
  22. package/tests/client/basic/basic.components.test.ripple +85 -87
  23. package/tests/client/basic/basic.errors.test.ripple +4 -8
  24. package/tests/client/basic/basic.rendering.test.ripple +27 -10
  25. package/tests/client/capture-error.js +12 -0
  26. package/tests/client/compiler/compiler.basic.test.ripple +76 -6
  27. package/tests/client/composite/composite.props.test.ripple +1 -3
  28. package/tests/client/composite/composite.render.test.ripple +91 -13
  29. package/tests/client/css/global-additional-cases.test.ripple +3 -3
  30. package/tests/client/return.test.ripple +101 -0
  31. package/tests/client/svg.test.ripple +4 -4
  32. package/tests/client/tsx.test.ripple +486 -0
  33. package/tests/hydration/basic.test.js +23 -0
  34. package/tests/hydration/compiled/client/basic.js +111 -75
  35. package/tests/hydration/compiled/client/composite.js +81 -46
  36. package/tests/hydration/compiled/client/events.js +18 -63
  37. package/tests/hydration/compiled/client/for.js +90 -183
  38. package/tests/hydration/compiled/client/head.js +10 -25
  39. package/tests/hydration/compiled/client/hmr.js +10 -13
  40. package/tests/hydration/compiled/client/html.js +251 -380
  41. package/tests/hydration/compiled/client/if-children.js +35 -45
  42. package/tests/hydration/compiled/client/if.js +2 -2
  43. package/tests/hydration/compiled/client/mixed-control-flow.js +24 -72
  44. package/tests/hydration/compiled/client/nested-control-flow.js +115 -391
  45. package/tests/hydration/compiled/client/portal.js +8 -20
  46. package/tests/hydration/compiled/client/reactivity.js +14 -47
  47. package/tests/hydration/compiled/client/return.js +2 -5
  48. package/tests/hydration/compiled/client/try.js +4 -4
  49. package/tests/hydration/compiled/server/basic.js +64 -31
  50. package/tests/hydration/compiled/server/composite.js +62 -29
  51. package/tests/hydration/compiled/server/hmr.js +24 -37
  52. package/tests/hydration/compiled/server/html.js +472 -611
  53. package/tests/hydration/compiled/server/if-children.js +77 -103
  54. package/tests/hydration/compiled/server/portal.js +8 -8
  55. package/tests/hydration/components/basic.ripple +15 -5
  56. package/tests/hydration/components/composite.ripple +13 -1
  57. package/tests/hydration/components/hmr.ripple +1 -3
  58. package/tests/hydration/components/html.ripple +13 -35
  59. package/tests/hydration/components/if-children.ripple +4 -8
  60. package/tests/hydration/composite.test.js +11 -0
  61. package/tests/server/basic.attributes.test.ripple +50 -0
  62. package/tests/server/basic.components.test.ripple +22 -28
  63. package/tests/server/basic.test.ripple +12 -0
  64. package/tests/server/compiler.test.ripple +25 -8
  65. package/tests/server/composite.props.test.ripple +1 -3
  66. package/tests/server/style-identifier.test.ripple +2 -4
  67. package/tests/utils/compiler-compat-config.test.js +38 -0
  68. package/tests/utils/vite-plugin-config.test.js +113 -0
  69. package/tsconfig.typecheck.json +2 -1
  70. package/types/index.d.ts +8 -11
@@ -19,9 +19,9 @@ export function Layout(__anchor, { children }, __block) {
19
19
  var main_1 = _$_.sibling(nav_1);
20
20
 
21
21
  {
22
- var node = _$_.child(main_1);
22
+ var expression = _$_.child(main_1);
23
23
 
24
- children(node, {}, _$_.active_block);
24
+ _$_.expression(expression, () => children);
25
25
  _$_.pop(main_1);
26
26
  }
27
27
  }
@@ -37,7 +37,7 @@ export function Content(__anchor, _, __block) {
37
37
  var div_2 = root_1();
38
38
 
39
39
  {
40
- var node_1 = _$_.child(div_2);
40
+ var node = _$_.child(div_2);
41
41
 
42
42
  {
43
43
  var consequent = (__anchor) => {
@@ -46,7 +46,7 @@ export function Content(__anchor, _, __block) {
46
46
  _$_.append(__anchor, p_1);
47
47
  };
48
48
 
49
- _$_.if(node_1, (__render) => {
49
+ _$_.if(node, (__render) => {
50
50
  if (_$_.get(lazy)) __render(consequent);
51
51
  });
52
52
  }
@@ -62,21 +62,18 @@ export function LayoutWithContent(__anchor, _, __block) {
62
62
  _$_.push_component();
63
63
 
64
64
  var fragment = root_3();
65
- var node_2 = _$_.first_child_frag(fragment);
65
+ var node_1 = _$_.first_child_frag(fragment);
66
66
 
67
67
  Layout(
68
- node_2,
68
+ node_1,
69
69
  {
70
- children(__anchor, _, __block) {
71
- _$_.push_component();
72
-
70
+ children: _$_.ripple_element(function render_children(__anchor, __block) {
73
71
  var fragment_1 = root_4();
74
- var node_3 = _$_.first_child_frag(fragment_1);
72
+ var node_2 = _$_.first_child_frag(fragment_1);
75
73
 
76
- Content(node_3, {}, _$_.active_block);
74
+ Content(node_2, {}, _$_.active_block);
77
75
  _$_.append(__anchor, fragment_1);
78
- _$_.pop_component();
79
- }
76
+ })
80
77
  },
81
78
  _$_.active_block
82
79
  );