ripple 0.3.17 → 0.3.19

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 (154) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +2 -2
  3. package/src/runtime/element.js +11 -11
  4. package/src/runtime/internal/client/composite.js +2 -2
  5. package/src/runtime/internal/client/expression.js +5 -5
  6. package/src/runtime/internal/client/index.js +1 -1
  7. package/src/runtime/internal/client/portal.js +4 -4
  8. package/src/runtime/internal/server/index.js +4 -4
  9. package/tests/client/__snapshots__/computed-properties.test.tsrx.snap +49 -0
  10. package/tests/client/__snapshots__/for.test.tsrx.snap +319 -0
  11. package/tests/client/__snapshots__/html.test.tsrx.snap +40 -0
  12. package/tests/client/basic/__snapshots__/basic.attributes.test.tsrx.snap +60 -0
  13. package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +59 -0
  14. package/tests/client/basic/{basic.components.test.rsrx → basic.components.test.tsrx} +51 -1
  15. package/tests/client/basic/{basic.errors.test.rsrx → basic.errors.test.tsrx} +12 -12
  16. package/tests/client/basic/{basic.styling.test.rsrx → basic.styling.test.tsrx} +1 -1
  17. package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +12 -0
  18. package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +46 -0
  19. package/tests/client/compiler/{compiler.assignments.test.rsrx → compiler.assignments.test.tsrx} +2 -2
  20. package/tests/client/compiler/{compiler.attributes.test.rsrx → compiler.attributes.test.tsrx} +4 -4
  21. package/tests/client/compiler/{compiler.basic.test.rsrx → compiler.basic.test.tsrx} +44 -30
  22. package/tests/client/compiler/{compiler.tracked-access.test.rsrx → compiler.tracked-access.test.tsrx} +16 -16
  23. package/tests/client/compiler/{compiler.try-in-function.test.rsrx → compiler.try-in-function.test.tsrx} +8 -8
  24. package/tests/client/compiler/{compiler.typescript.test.rsrx → compiler.typescript.test.tsrx} +4 -4
  25. package/tests/client/composite/__snapshots__/composite.render.test.tsrx.snap +37 -0
  26. package/tests/client/css/{global-additional-cases.test.rsrx → global-additional-cases.test.tsrx} +27 -27
  27. package/tests/client/css/{global-advanced-selectors.test.rsrx → global-advanced-selectors.test.tsrx} +8 -8
  28. package/tests/client/css/{global-at-rules.test.rsrx → global-at-rules.test.tsrx} +5 -5
  29. package/tests/client/css/{global-basic.test.rsrx → global-basic.test.tsrx} +7 -7
  30. package/tests/client/css/{global-classes-ids.test.rsrx → global-classes-ids.test.tsrx} +7 -7
  31. package/tests/client/css/{global-combinators.test.rsrx → global-combinators.test.tsrx} +5 -5
  32. package/tests/client/css/{global-complex-nesting.test.rsrx → global-complex-nesting.test.tsrx} +7 -7
  33. package/tests/client/css/{global-edge-cases.test.rsrx → global-edge-cases.test.tsrx} +9 -9
  34. package/tests/client/css/{global-keyframes.test.rsrx → global-keyframes.test.tsrx} +5 -5
  35. package/tests/client/css/{global-nested.test.rsrx → global-nested.test.tsrx} +5 -5
  36. package/tests/client/css/{global-pseudo.test.rsrx → global-pseudo.test.tsrx} +6 -6
  37. package/tests/client/css/{global-scoping.test.rsrx → global-scoping.test.tsrx} +10 -10
  38. package/tests/client/css/{style-identifier.test.rsrx → style-identifier.test.tsrx} +12 -16
  39. package/tests/client/{function-overload.test.rsrx → function-overload.test.tsrx} +1 -1
  40. package/tests/client/{return.test.rsrx → return.test.tsrx} +16 -18
  41. package/tests/hydration/build-components.js +2 -4
  42. package/tests/hydration/compiled/client/basic.js +1 -1
  43. package/tests/hydration/compiled/client/composite.js +4 -4
  44. package/tests/hydration/compiled/client/head.js +11 -11
  45. package/tests/hydration/compiled/client/hmr.js +1 -1
  46. package/tests/hydration/compiled/client/html.js +19 -19
  47. package/tests/hydration/compiled/client/if-children.js +2 -2
  48. package/tests/hydration/compiled/client/portal.js +4 -4
  49. package/tests/hydration/compiled/server/basic.js +1 -1
  50. package/tests/hydration/compiled/server/composite.js +4 -4
  51. package/tests/hydration/compiled/server/head.js +11 -11
  52. package/tests/hydration/compiled/server/hmr.js +1 -1
  53. package/tests/hydration/compiled/server/html.js +19 -19
  54. package/tests/hydration/compiled/server/if-children.js +2 -2
  55. package/tests/hydration/compiled/server/portal.js +4 -4
  56. package/tests/hydration/components/{html-in-template.rsrx → html-in-template.tsrx} +1 -1
  57. package/tests/server/__snapshots__/compiler.test.tsrx.snap +95 -0
  58. package/tests/server/{basic.components.test.rsrx → basic.components.test.tsrx} +48 -0
  59. package/tests/server/{compiler.test.rsrx → compiler.test.tsrx} +17 -17
  60. package/tests/server/{html-nesting-validation.test.rsrx → html-nesting-validation.test.tsrx} +38 -38
  61. package/tests/server/{style-identifier.test.rsrx → style-identifier.test.tsrx} +1 -1
  62. package/tests/utils/compiler-compat-config.test.js +3 -3
  63. package/tests/utils/vite-plugin-config.test.js +1 -1
  64. package/tests/utils/vite-plugin-hmr.test.js +7 -7
  65. package/tsconfig.json +0 -4
  66. package/types/index.d.ts +6 -4
  67. /package/tests/client/{_etc.test.rsrx → _etc.test.tsrx} +0 -0
  68. /package/tests/client/array/{array.copy-within.test.rsrx → array.copy-within.test.tsrx} +0 -0
  69. /package/tests/client/array/{array.derived.test.rsrx → array.derived.test.tsrx} +0 -0
  70. /package/tests/client/array/{array.iteration.test.rsrx → array.iteration.test.tsrx} +0 -0
  71. /package/tests/client/array/{array.mutations.test.rsrx → array.mutations.test.tsrx} +0 -0
  72. /package/tests/client/array/{array.static.test.rsrx → array.static.test.tsrx} +0 -0
  73. /package/tests/client/array/{array.to-methods.test.rsrx → array.to-methods.test.tsrx} +0 -0
  74. /package/tests/client/{async-suspend.test.rsrx → async-suspend.test.tsrx} +0 -0
  75. /package/tests/client/basic/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
  76. /package/tests/client/basic/{basic.collections.test.rsrx → basic.collections.test.tsrx} +0 -0
  77. /package/tests/client/basic/{basic.events.test.rsrx → basic.events.test.tsrx} +0 -0
  78. /package/tests/client/basic/{basic.get-set.test.rsrx → basic.get-set.test.tsrx} +0 -0
  79. /package/tests/client/basic/{basic.hmr.test.rsrx → basic.hmr.test.tsrx} +0 -0
  80. /package/tests/client/basic/{basic.reactivity.test.rsrx → basic.reactivity.test.tsrx} +0 -0
  81. /package/tests/client/basic/{basic.rendering.test.rsrx → basic.rendering.test.tsrx} +0 -0
  82. /package/tests/client/basic/{basic.utilities.test.rsrx → basic.utilities.test.tsrx} +0 -0
  83. /package/tests/client/{boundaries.test.rsrx → boundaries.test.tsrx} +0 -0
  84. /package/tests/client/compiler/{compiler.regex.test.rsrx → compiler.regex.test.tsrx} +0 -0
  85. /package/tests/client/composite/{composite.dynamic-components.test.rsrx → composite.dynamic-components.test.tsrx} +0 -0
  86. /package/tests/client/composite/{composite.generics.test.rsrx → composite.generics.test.tsrx} +0 -0
  87. /package/tests/client/composite/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
  88. /package/tests/client/composite/{composite.reactivity.test.rsrx → composite.reactivity.test.tsrx} +0 -0
  89. /package/tests/client/composite/{composite.render.test.rsrx → composite.render.test.tsrx} +0 -0
  90. /package/tests/client/{computed-properties.test.rsrx → computed-properties.test.tsrx} +0 -0
  91. /package/tests/client/{context.test.rsrx → context.test.tsrx} +0 -0
  92. /package/tests/client/{date.test.rsrx → date.test.tsrx} +0 -0
  93. /package/tests/client/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
  94. /package/tests/client/{events.test.rsrx → events.test.tsrx} +0 -0
  95. /package/tests/client/{for.test.rsrx → for.test.tsrx} +0 -0
  96. /package/tests/client/{function-overload-import.rsrx → function-overload-import.tsrx} +0 -0
  97. /package/tests/client/{head.test.rsrx → head.test.tsrx} +0 -0
  98. /package/tests/client/{html.test.rsrx → html.test.tsrx} +0 -0
  99. /package/tests/client/{input-value.test.rsrx → input-value.test.tsrx} +0 -0
  100. /package/tests/client/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
  101. /package/tests/client/{map.test.rsrx → map.test.tsrx} +0 -0
  102. /package/tests/client/{media-query.test.rsrx → media-query.test.tsrx} +0 -0
  103. /package/tests/client/{object.test.rsrx → object.test.tsrx} +0 -0
  104. /package/tests/client/{portal.test.rsrx → portal.test.tsrx} +0 -0
  105. /package/tests/client/{ref.test.rsrx → ref.test.tsrx} +0 -0
  106. /package/tests/client/{set.test.rsrx → set.test.tsrx} +0 -0
  107. /package/tests/client/{svg.test.rsrx → svg.test.tsrx} +0 -0
  108. /package/tests/client/{switch.test.rsrx → switch.test.tsrx} +0 -0
  109. /package/tests/client/{try.test.rsrx → try.test.tsrx} +0 -0
  110. /package/tests/client/{tsx.test.rsrx → tsx.test.tsrx} +0 -0
  111. /package/tests/client/{typescript-generics.test.rsrx → typescript-generics.test.tsrx} +0 -0
  112. /package/tests/client/url/{url.derived.test.rsrx → url.derived.test.tsrx} +0 -0
  113. /package/tests/client/url/{url.parsing.test.rsrx → url.parsing.test.tsrx} +0 -0
  114. /package/tests/client/url/{url.partial-removal.test.rsrx → url.partial-removal.test.tsrx} +0 -0
  115. /package/tests/client/url/{url.reactivity.test.rsrx → url.reactivity.test.tsrx} +0 -0
  116. /package/tests/client/url/{url.serialization.test.rsrx → url.serialization.test.tsrx} +0 -0
  117. /package/tests/client/url-search-params/{url-search-params.derived.test.rsrx → url-search-params.derived.test.tsrx} +0 -0
  118. /package/tests/client/url-search-params/{url-search-params.initialization.test.rsrx → url-search-params.initialization.test.tsrx} +0 -0
  119. /package/tests/client/url-search-params/{url-search-params.iteration.test.rsrx → url-search-params.iteration.test.tsrx} +0 -0
  120. /package/tests/client/url-search-params/{url-search-params.mutation.test.rsrx → url-search-params.mutation.test.tsrx} +0 -0
  121. /package/tests/client/url-search-params/{url-search-params.retrieval.test.rsrx → url-search-params.retrieval.test.tsrx} +0 -0
  122. /package/tests/client/url-search-params/{url-search-params.serialization.test.rsrx → url-search-params.serialization.test.tsrx} +0 -0
  123. /package/tests/client/url-search-params/{url-search-params.tracked-url.test.rsrx → url-search-params.tracked-url.test.tsrx} +0 -0
  124. /package/tests/hydration/components/{basic.rsrx → basic.tsrx} +0 -0
  125. /package/tests/hydration/components/{composite.rsrx → composite.tsrx} +0 -0
  126. /package/tests/hydration/components/{events.rsrx → events.tsrx} +0 -0
  127. /package/tests/hydration/components/{for.rsrx → for.tsrx} +0 -0
  128. /package/tests/hydration/components/{head.rsrx → head.tsrx} +0 -0
  129. /package/tests/hydration/components/{hmr.rsrx → hmr.tsrx} +0 -0
  130. /package/tests/hydration/components/{html.rsrx → html.tsrx} +0 -0
  131. /package/tests/hydration/components/{if-children.rsrx → if-children.tsrx} +0 -0
  132. /package/tests/hydration/components/{if.rsrx → if.tsrx} +0 -0
  133. /package/tests/hydration/components/{mixed-control-flow.rsrx → mixed-control-flow.tsrx} +0 -0
  134. /package/tests/hydration/components/{nested-control-flow.rsrx → nested-control-flow.tsrx} +0 -0
  135. /package/tests/hydration/components/{portal.rsrx → portal.tsrx} +0 -0
  136. /package/tests/hydration/components/{reactivity.rsrx → reactivity.tsrx} +0 -0
  137. /package/tests/hydration/components/{return.rsrx → return.tsrx} +0 -0
  138. /package/tests/hydration/components/{switch.rsrx → switch.tsrx} +0 -0
  139. /package/tests/hydration/components/{try.rsrx → try.tsrx} +0 -0
  140. /package/tests/server/{await.test.rsrx → await.test.tsrx} +0 -0
  141. /package/tests/server/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
  142. /package/tests/server/{basic.test.rsrx → basic.test.tsrx} +0 -0
  143. /package/tests/server/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
  144. /package/tests/server/{composite.test.rsrx → composite.test.tsrx} +0 -0
  145. /package/tests/server/{context.test.rsrx → context.test.tsrx} +0 -0
  146. /package/tests/server/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
  147. /package/tests/server/{for.test.rsrx → for.test.tsrx} +0 -0
  148. /package/tests/server/{head.test.rsrx → head.test.tsrx} +0 -0
  149. /package/tests/server/{if.test.rsrx → if.test.tsrx} +0 -0
  150. /package/tests/server/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
  151. /package/tests/server/{return.test.rsrx → return.test.tsrx} +0 -0
  152. /package/tests/server/{streaming-ssr.test.rsrx → streaming-ssr.test.tsrx} +0 -0
  153. /package/tests/server/{switch.test.rsrx → switch.test.tsrx} +0 -0
  154. /package/tests/server/{try.test.rsrx → try.test.tsrx} +0 -0
@@ -189,7 +189,7 @@ export function HtmlInChildren() {
189
189
 
190
190
  const args = [
191
191
  {
192
- children: _$_.ripple_element(function render_children() {
192
+ children: _$_.tsrx_element(function render_children() {
193
193
  _$_.push_component();
194
194
  _$_.output_push('<div');
195
195
  _$_.output_push(' class="vp-doc"');
@@ -227,7 +227,7 @@ export function HtmlInChildrenWithSiblings() {
227
227
 
228
228
  const args = [
229
229
  {
230
- children: _$_.ripple_element(function render_children() {
230
+ children: _$_.tsrx_element(function render_children() {
231
231
  _$_.push_component();
232
232
  _$_.output_push('<h1');
233
233
  _$_.output_push('>');
@@ -274,7 +274,7 @@ export function MultipleHtmlInChildren() {
274
274
 
275
275
  const args = [
276
276
  {
277
- children: _$_.ripple_element(function render_children() {
277
+ children: _$_.tsrx_element(function render_children() {
278
278
  _$_.push_component();
279
279
  _$_.output_push('<div');
280
280
  _$_.output_push(' class="doc"');
@@ -364,7 +364,7 @@ export function HtmlWithCommentsInChildren() {
364
364
 
365
365
  const args = [
366
366
  {
367
- children: _$_.ripple_element(function render_children() {
367
+ children: _$_.tsrx_element(function render_children() {
368
368
  _$_.push_component();
369
369
  _$_.output_push('<div');
370
370
  _$_.output_push(' class="vp-doc"');
@@ -570,7 +570,7 @@ export function HtmlWithServerData() {
570
570
  { href: '#features', text: 'Features' }
571
571
  ],
572
572
 
573
- children: _$_.ripple_element(function render_children() {
573
+ children: _$_.tsrx_element(function render_children() {
574
574
  _$_.push_component();
575
575
  _$_.output_push('<div');
576
576
  _$_.output_push(' class="vp-doc"');
@@ -608,7 +608,7 @@ export function HtmlWithClientDefaults() {
608
608
 
609
609
  const args = [
610
610
  {
611
- children: _$_.ripple_element(function render_children() {
611
+ children: _$_.tsrx_element(function render_children() {
612
612
  _$_.push_component();
613
613
  _$_.output_push('<div');
614
614
  _$_.output_push(' class="vp-doc"');
@@ -646,7 +646,7 @@ export function HtmlWithUndefinedContent() {
646
646
 
647
647
  const args = [
648
648
  {
649
- children: _$_.ripple_element(function render_children() {
649
+ children: _$_.tsrx_element(function render_children() {
650
650
  _$_.push_component();
651
651
  _$_.output_push('<div');
652
652
  _$_.output_push(' class="vp-doc"');
@@ -797,7 +797,7 @@ export function HtmlAfterSwitchInChildren() {
797
797
 
798
798
  const args = [
799
799
  {
800
- children: _$_.ripple_element(function render_children() {
800
+ children: _$_.tsrx_element(function render_children() {
801
801
  _$_.push_component();
802
802
 
803
803
  {
@@ -806,7 +806,7 @@ export function HtmlAfterSwitchInChildren() {
806
806
  const args = [
807
807
  {
808
808
  level: 1,
809
- children: _$_.ripple_element(function render_children() {
809
+ children: _$_.tsrx_element(function render_children() {
810
810
  _$_.push_component();
811
811
  _$_.output_push('Title');
812
812
  _$_.pop_component();
@@ -986,7 +986,7 @@ function SideNav({ currentPath }) {
986
986
  const args = [
987
987
  {
988
988
  title: "Getting Started",
989
- children: _$_.ripple_element(function render_children() {
989
+ children: _$_.tsrx_element(function render_children() {
990
990
  _$_.push_component();
991
991
 
992
992
  {
@@ -1038,7 +1038,7 @@ function SideNav({ currentPath }) {
1038
1038
  const args = [
1039
1039
  {
1040
1040
  title: "Guide",
1041
- children: _$_.ripple_element(function render_children() {
1041
+ children: _$_.tsrx_element(function render_children() {
1042
1042
  _$_.push_component();
1043
1043
 
1044
1044
  {
@@ -1281,7 +1281,7 @@ export function ArticleWithChildrenThenSibling() {
1281
1281
 
1282
1282
  const args = [
1283
1283
  {
1284
- children: _$_.ripple_element(function render_children() {
1284
+ children: _$_.tsrx_element(function render_children() {
1285
1285
  _$_.push_component();
1286
1286
  _$_.output_push('<h1');
1287
1287
  _$_.output_push('>');
@@ -1384,7 +1384,7 @@ export function ArticleWithHtmlChildThenSibling() {
1384
1384
 
1385
1385
  const args = [
1386
1386
  {
1387
- children: _$_.ripple_element(function render_children() {
1387
+ children: _$_.tsrx_element(function render_children() {
1388
1388
  _$_.push_component();
1389
1389
  _$_.output_push('<div');
1390
1390
  _$_.output_push(' class="doc-content"');
@@ -1519,7 +1519,7 @@ export function InlineArticleWithHtmlChild() {
1519
1519
 
1520
1520
  const args = [
1521
1521
  {
1522
- children: _$_.ripple_element(function render_children() {
1522
+ children: _$_.tsrx_element(function render_children() {
1523
1523
  _$_.push_component();
1524
1524
  _$_.output_push('<div');
1525
1525
  _$_.output_push(' class="doc-content"');
@@ -1753,7 +1753,7 @@ export function DocsLayoutWithData() {
1753
1753
  {
1754
1754
  editPath: "docs/styling.md",
1755
1755
  nextLink: { href: '/next', text: 'Next' },
1756
- children: _$_.ripple_element(function render_children() {
1756
+ children: _$_.tsrx_element(function render_children() {
1757
1757
  _$_.push_component();
1758
1758
  _$_.output_push('<div');
1759
1759
  _$_.output_push(' class="doc-content"');
@@ -1791,7 +1791,7 @@ export function DocsLayoutWithoutData() {
1791
1791
 
1792
1792
  const args = [
1793
1793
  {
1794
- children: _$_.ripple_element(function render_children() {
1794
+ children: _$_.tsrx_element(function render_children() {
1795
1795
  _$_.push_component();
1796
1796
  _$_.output_push('<div');
1797
1797
  _$_.output_push(' class="doc-content"');
@@ -2073,7 +2073,7 @@ export function DocsLayoutExactWithData() {
2073
2073
  { href: '#usage', text: 'Usage' }
2074
2074
  ],
2075
2075
 
2076
- children: _$_.ripple_element(function render_children() {
2076
+ children: _$_.tsrx_element(function render_children() {
2077
2077
  _$_.push_component();
2078
2078
  _$_.output_push('<div');
2079
2079
  _$_.output_push(' class="doc-content"');
@@ -2119,7 +2119,7 @@ export function DocsLayoutExactWithoutData() {
2119
2119
  prevLink,
2120
2120
  nextLink,
2121
2121
  toc,
2122
- children: _$_.ripple_element(function render_children() {
2122
+ children: _$_.tsrx_element(function render_children() {
2123
2123
  _$_.push_component();
2124
2124
  _$_.output_push('<div');
2125
2125
  _$_.output_push(' class="doc-content"');
@@ -2285,7 +2285,7 @@ export function NestedTemplateInLayout() {
2285
2285
  const args = [
2286
2286
  {
2287
2287
  data: doc,
2288
- children: _$_.ripple_element(function render_children() {
2288
+ children: _$_.tsrx_element(function render_children() {
2289
2289
  _$_.push_component();
2290
2290
  _$_.output_push('<div');
2291
2291
  _$_.output_push(' class="doc-content"');
@@ -74,7 +74,7 @@ export function TestIfWithChildren() {
74
74
 
75
75
  const args = [
76
76
  {
77
- children: _$_.ripple_element(function render_children() {
77
+ children: _$_.tsrx_element(function render_children() {
78
78
  _$_.push_component();
79
79
 
80
80
  {
@@ -250,7 +250,7 @@ export function TestIfWithSiblingsAndChildren() {
250
250
 
251
251
  const args = [
252
252
  {
253
- children: _$_.ripple_element(function render_children() {
253
+ children: _$_.tsrx_element(function render_children() {
254
254
  _$_.push_component();
255
255
 
256
256
  {
@@ -27,7 +27,7 @@ export function SimplePortal() {
27
27
  const args = [
28
28
  {
29
29
  target: typeof document !== 'undefined' ? document.body : null,
30
- children: _$_.ripple_element(function render_children() {
30
+ children: _$_.tsrx_element(function render_children() {
31
31
  _$_.push_component();
32
32
  _$_.output_push('<div');
33
33
  _$_.output_push(' class="portal-content"');
@@ -84,7 +84,7 @@ export function ConditionalPortal() {
84
84
  const args = [
85
85
  {
86
86
  target: typeof document !== 'undefined' ? document.body : null,
87
- children: _$_.ripple_element(function render_children() {
87
+ children: _$_.tsrx_element(function render_children() {
88
88
  _$_.push_component();
89
89
  _$_.output_push('<div');
90
90
  _$_.output_push(' class="portal-content"');
@@ -139,7 +139,7 @@ export function PortalWithMainContent() {
139
139
  const args = [
140
140
  {
141
141
  target: typeof document !== 'undefined' ? document.body : null,
142
- children: _$_.ripple_element(function render_children() {
142
+ children: _$_.tsrx_element(function render_children() {
143
143
  _$_.push_component();
144
144
  _$_.output_push('<div');
145
145
  _$_.output_push(' class="portal-content"');
@@ -209,7 +209,7 @@ export function NestedContentWithPortal() {
209
209
  const args = [
210
210
  {
211
211
  target: typeof document !== 'undefined' ? document.body : null,
212
- children: _$_.ripple_element(function render_children() {
212
+ children: _$_.tsrx_element(function render_children() {
213
213
  _$_.push_component();
214
214
  _$_.output_push('<div');
215
215
  _$_.output_push(' class="portal-content"');
@@ -1,5 +1,5 @@
1
1
  // Test case for hydration error with {html} inside template elements
2
- // Reproduces issue from website-new/src/pages/docs/comparison.ripple
2
+ // Reproduces issue from website-new/src/pages/docs/comparison.tsrx
3
3
 
4
4
  export component SimpleTemplateHtml() {
5
5
  const data = 'test data';
@@ -0,0 +1,95 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`compiler server block tests > compiles server block with with only supported types 1`] = `
4
+ "import * as _$_ from 'ripple/internal/server';
5
+
6
+ export const _$_server_$_ = (() => {
7
+ var _$_server_$_ = {};
8
+
9
+ function something() {
10
+ return 'unexported function';
11
+ }
12
+
13
+ _$_server_$_.fetchUser = async function fetchUser(id) {
14
+ const response = await fetch(\`/api/user/\${id}\`);
15
+ const data = await response.json();
16
+
17
+ return data;
18
+ };
19
+
20
+ const fetchUserAlias = fetchUser;
21
+ const AliasForFetchUserAlias = fetchUserAlias;
22
+
23
+ {
24
+ _$_server_$_.AnotherAlias = AliasForFetchUserAlias;
25
+ }
26
+
27
+ {
28
+ _$_server_$_.func = function test() {
29
+ return 'test';
30
+ };
31
+ }
32
+
33
+ {
34
+ _$_server_$_.func2 = function () {
35
+ return 'test';
36
+ };
37
+ }
38
+
39
+ {
40
+ _$_server_$_.func3 = () => {
41
+ return 'test';
42
+ };
43
+ }
44
+
45
+ {
46
+ _$_server_$_.fetchUserAlias = fetchUserAlias;
47
+ _$_server_$_.AliasForFetchUserAlias = AliasForFetchUserAlias;
48
+ }
49
+
50
+ return _$_server_$_;
51
+ })();"
52
+ `;
53
+
54
+ exports[`compiler typescript tests > compiles TSInstantiationExpression 1`] = `
55
+ "import * as _$_ from 'ripple/internal/server';
56
+
57
+ function makeBox(value) {
58
+ return { value };
59
+ }
60
+
61
+ const makeStringBox = (makeBox);
62
+ const stringBox = makeStringBox('abc');
63
+ const ErrorMap = (Map);
64
+ const errorMap = new ErrorMap();"
65
+ `;
66
+
67
+ exports[`compiler typescript tests > removes class TypeScript syntax from JS output 1`] = `
68
+ "import * as _$_ from 'ripple/internal/server';
69
+
70
+ class PrintEvent {
71
+ text;
72
+
73
+ constructor(text) {
74
+ this.text = text;
75
+ }
76
+ }"
77
+ `;
78
+
79
+ exports[`compiler typescript tests > removes class extends type arguments from JS output 1`] = `
80
+ "import * as _$_ from 'ripple/internal/server';
81
+
82
+ class StringMap extends Map {
83
+ constructor() {
84
+ super();
85
+ }
86
+ }"
87
+ `;
88
+
89
+ exports[`compiler typescript tests > removes type assertions from function parameters and leaves default values 1`] = `
90
+ "import * as _$_ from 'ripple/internal/server';
91
+
92
+ function getString(e = 'test') {
93
+ return e;
94
+ }"
95
+ `;
@@ -349,4 +349,52 @@ describe('basic server > components & composition', () => {
349
349
  const { document } = parseHtml(body);
350
350
  expect(document.querySelector('.card').textContent).toBe('explicit');
351
351
  });
352
+
353
+ it('renders components declared inside composite element children', async () => {
354
+ component Wrapper(props: PropsWithChildren<{}>) {
355
+ <div class="wrapper">{props.children}</div>
356
+ }
357
+
358
+ component App() {
359
+ <Wrapper>
360
+ component Inner() {
361
+ <span class="inner">{'inner content'}</span>
362
+ }
363
+
364
+ <Inner />
365
+ </Wrapper>
366
+ }
367
+
368
+ const { body } = await render(App);
369
+ const { document } = parseHtml(body);
370
+ expect(document.querySelector('.wrapper .inner').textContent).toBe('inner content');
371
+ });
372
+
373
+ it('renders nested components declared inside composite children with prop passing', async () => {
374
+ component Wrapper(props: PropsWithChildren<{}>) {
375
+ <div class="wrapper">{props.children}</div>
376
+ }
377
+
378
+ component App() {
379
+ <Wrapper>
380
+ component Z() {
381
+ <div class="z">{'I am Z'}</div>
382
+ }
383
+
384
+ component Child(&{ Z }: { Z: Component }) {
385
+ <div class="child">
386
+ {'Child Component: '}
387
+ <Z />
388
+ </div>
389
+ }
390
+
391
+ <Child {Z} />
392
+ </Wrapper>
393
+ }
394
+
395
+ const { body } = await render(App);
396
+ const { document } = parseHtml(body);
397
+ expect(document.querySelector('.wrapper .child').textContent).toBe('Child Component: I am Z');
398
+ expect(document.querySelector('.wrapper .z').textContent).toBe('I am Z');
399
+ });
352
400
  });
@@ -8,7 +8,7 @@ const stringBox = makeStringBox('abc');
8
8
  const ErrorMap = Map<string, Error>;
9
9
  const errorMap = new ErrorMap();`;
10
10
 
11
- const result = compile(source, 'test.ripple', { mode: 'server' });
11
+ const result = compile(source, 'test.tsrx', { mode: 'server' });
12
12
 
13
13
  expect(result.js.code).toMatchSnapshot();
14
14
  });
@@ -19,7 +19,7 @@ function getString(e: string = 'test') {
19
19
  return e;
20
20
  }`;
21
21
 
22
- const result = compile(source, 'test.ripple', { mode: 'server' });
22
+ const result = compile(source, 'test.tsrx', { mode: 'server' });
23
23
 
24
24
  expect(result.js.code).toMatchSnapshot();
25
25
  });
@@ -35,7 +35,7 @@ class PrintEvent implements BaseEvent {
35
35
  }
36
36
  }`;
37
37
 
38
- const result = compile(source, 'test.ripple', { mode: 'server' });
38
+ const result = compile(source, 'test.tsrx', { mode: 'server' });
39
39
 
40
40
  expect(result.js.code).not.toContain('implements');
41
41
  expect(result.js.code).toMatchSnapshot();
@@ -48,7 +48,7 @@ class PrintEvent implements BaseEvent {
48
48
  }
49
49
  }`;
50
50
 
51
- const result = compile(source, 'test.ripple', { mode: 'server' });
51
+ const result = compile(source, 'test.tsrx', { mode: 'server' });
52
52
 
53
53
  expect(result.js.code).not.toContain('Map<string, string>');
54
54
  expect(result.js.code).toContain('class StringMap extends Map');
@@ -61,7 +61,7 @@ export component Layout({ children }) {
61
61
  <div>{children}</div>
62
62
  }`;
63
63
 
64
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).not.toThrow();
64
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).not.toThrow();
65
65
  });
66
66
 
67
67
  it('throws error for interpolating props.children as text in SSR mode', () => {
@@ -70,7 +70,7 @@ export component Layout(props) {
70
70
  <div>{props.children}</div>
71
71
  }`;
72
72
 
73
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).not.toThrow();
73
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).not.toThrow();
74
74
  });
75
75
 
76
76
  it('throws error for calling children as a function in SSR mode', () => {
@@ -79,7 +79,7 @@ export component Layout({ children }) {
79
79
  {children()}
80
80
  }`;
81
81
 
82
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrow(
82
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrow(
83
83
  '`children` cannot be called like a regular function. Render it with `{children}` or `{props.children}` instead.',
84
84
  );
85
85
  });
@@ -90,7 +90,7 @@ export component Layout(props) {
90
90
  {props.children()}
91
91
  }`;
92
92
 
93
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrow(
93
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrow(
94
94
  '`children` cannot be called like a regular function. Render it with `{children}` or `{props.children}` instead.',
95
95
  );
96
96
  });
@@ -110,11 +110,11 @@ export component App() {
110
110
  }
111
111
  `;
112
112
 
113
- const result = compile(source, 'test.ripple', { mode: 'server' }).js.code;
113
+ const result = compile(source, 'test.tsrx', { mode: 'server' }).js.code;
114
114
 
115
115
  // Template children should take precedence - explicit children prop should be removed
116
116
  expect((result.match(/children:/g) || []).length).toBe(1);
117
- expect(result).toContain('children: _$_.ripple_element(');
117
+ expect(result).toContain('children: _$_.tsrx_element(');
118
118
  });
119
119
  });
120
120
 
@@ -153,7 +153,7 @@ describe('compiler server block tests', () => {
153
153
  export { fetchUserAlias, AliasForFetchUserAlias };
154
154
  }`;
155
155
 
156
- const result = compile(source, 'test.ripple', { mode: 'server' });
156
+ const result = compile(source, 'test.tsrx', { mode: 'server' });
157
157
  expect(result.js.code).toMatchSnapshot();
158
158
  });
159
159
 
@@ -165,7 +165,7 @@ describe('compiler server block tests', () => {
165
165
  export const { fn1, fn2 } = obj;
166
166
  }`;
167
167
 
168
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrowError();
168
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrowError();
169
169
  });
170
170
 
171
171
  it('throws error for unsupported exported array pattern in server block', () => {
@@ -176,7 +176,7 @@ describe('compiler server block tests', () => {
176
176
  export const [fnarr1, fnarr2] = arr;
177
177
  }`;
178
178
 
179
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrowError();
179
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrowError();
180
180
  });
181
181
 
182
182
  it('throws error for unsupported exported member expression via object in server block', () => {
@@ -187,7 +187,7 @@ describe('compiler server block tests', () => {
187
187
  export const objProp = obj.fn1;
188
188
  }`;
189
189
 
190
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrowError();
190
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrowError();
191
191
  });
192
192
 
193
193
  it('throws error for unsupported exported member expression via array in server block', () => {
@@ -198,7 +198,7 @@ describe('compiler server block tests', () => {
198
198
  export const arrIndex0 = arr[0];
199
199
  }`;
200
200
 
201
- expect(() => compile(source, 'test.ripple', { mode: 'server' })).toThrowError();
201
+ expect(() => compile(source, 'test.tsrx', { mode: 'server' })).toThrowError();
202
202
  });
203
203
 
204
204
  it('wraps children in normalize_children for explicit children prop passed to component', () => {
@@ -214,7 +214,7 @@ export component App() {
214
214
  }
215
215
  `;
216
216
 
217
- const result = compile(source, 'test.ripple', { mode: 'server' }).js.code;
217
+ const result = compile(source, 'test.tsrx', { mode: 'server' }).js.code;
218
218
 
219
219
  expect(result).toContain('_$_.normalize_children(');
220
220
  });
@@ -232,7 +232,7 @@ export component App() {
232
232
  }
233
233
  `;
234
234
 
235
- const result = compile(source, 'test.ripple', { mode: 'server' }).js.code;
235
+ const result = compile(source, 'test.tsrx', { mode: 'server' }).js.code;
236
236
 
237
237
  expect(result).toContain('...props');
238
238
  });