ripple 0.3.17 → 0.3.18

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 +7 -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
@@ -9,7 +9,7 @@ import { track } from 'ripple';
9
9
  console.log(count.__v);
10
10
  }
11
11
  `;
12
- expect(() => compile(code, 'test.ripple')).toThrow(
12
+ expect(() => compile(code, 'test.tsrx')).toThrow(
13
13
  /Directly accessing internal property "__v" of a tracked object is not allowed/,
14
14
  );
15
15
  });
@@ -22,7 +22,7 @@ import { track } from 'ripple';
22
22
  console.log(myTracked.a);
23
23
  }
24
24
  `;
25
- expect(() => compile(code, 'test.ripple')).toThrow(
25
+ expect(() => compile(code, 'test.tsrx')).toThrow(
26
26
  /Directly accessing internal property "a" of a tracked object is not allowed/,
27
27
  );
28
28
  });
@@ -35,7 +35,7 @@ import { track } from 'ripple';
35
35
  console.log(myTracked.b);
36
36
  }
37
37
  `;
38
- expect(() => compile(code, 'test.ripple')).toThrow(
38
+ expect(() => compile(code, 'test.tsrx')).toThrow(
39
39
  /Directly accessing internal property "b" of a tracked object is not allowed/,
40
40
  );
41
41
  });
@@ -48,7 +48,7 @@ import { track } from 'ripple';
48
48
  console.log(myTracked.c);
49
49
  }
50
50
  `;
51
- expect(() => compile(code, 'test.ripple')).toThrow(
51
+ expect(() => compile(code, 'test.tsrx')).toThrow(
52
52
  /Directly accessing internal property "c" of a tracked object is not allowed/,
53
53
  );
54
54
  });
@@ -61,7 +61,7 @@ import { track } from 'ripple';
61
61
  console.log(myTracked.f);
62
62
  }
63
63
  `;
64
- expect(() => compile(code, 'test.ripple')).toThrow(
64
+ expect(() => compile(code, 'test.tsrx')).toThrow(
65
65
  /Directly accessing internal property "f" of a tracked object is not allowed/,
66
66
  );
67
67
  });
@@ -74,7 +74,7 @@ import { track } from 'ripple';
74
74
  console.log(count);
75
75
  }
76
76
  `;
77
- expect(() => compile(code, 'test.ripple')).not.toThrow();
77
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
78
78
  });
79
79
 
80
80
  it('should compile successfully with correct get() function access', () => {
@@ -85,7 +85,7 @@ import { get, track } from 'ripple';
85
85
  console.log(get(count));
86
86
  }
87
87
  `;
88
- expect(() => compile(code, 'test.ripple')).not.toThrow();
88
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
89
89
  });
90
90
 
91
91
  it('should not error on accessing __v of a non-tracked object', () => {
@@ -95,7 +95,7 @@ import { get, track } from 'ripple';
95
95
  console.log(obj.__v);
96
96
  }
97
97
  `;
98
- expect(() => compile(code, 'test.ripple')).not.toThrow();
98
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
99
99
  });
100
100
 
101
101
  it('should not error on accessing __v of a non-tracked object (member expression)', () => {
@@ -105,7 +105,7 @@ import { get, track } from 'ripple';
105
105
  console.log(data.value.__v);
106
106
  }
107
107
  `;
108
- expect(() => compile(code, 'test.ripple')).not.toThrow();
108
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
109
109
  });
110
110
 
111
111
  it(
@@ -118,7 +118,7 @@ import { get, track } from 'ripple';
118
118
  console.log(config.b);
119
119
  }
120
120
  `;
121
- expect(() => compile(code, 'test.ripple')).not.toThrow();
121
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
122
122
  },
123
123
  );
124
124
 
@@ -130,7 +130,7 @@ import { track } from 'ripple';
130
130
  console.log(count[0]);
131
131
  }
132
132
  `;
133
- expect(() => compile(code, 'test.ripple')).not.toThrow();
133
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
134
134
  });
135
135
 
136
136
  it('should allow indexed [1] access on a tracked object', () => {
@@ -141,7 +141,7 @@ import { track } from 'ripple';
141
141
  let raw = count[1];
142
142
  }
143
143
  `;
144
- expect(() => compile(code, 'test.ripple')).not.toThrow();
144
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
145
145
  });
146
146
 
147
147
  it('should allow [0] write on a tracked object', () => {
@@ -152,7 +152,7 @@ import { track } from 'ripple';
152
152
  count[0] = 5;
153
153
  }
154
154
  `;
155
- expect(() => compile(code, 'test.ripple')).not.toThrow();
155
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
156
156
  });
157
157
 
158
158
  it('should allow .value read access on a tracked object', () => {
@@ -163,7 +163,7 @@ import { track } from 'ripple';
163
163
  console.log(count.value);
164
164
  }
165
165
  `;
166
- expect(() => compile(code, 'test.ripple')).not.toThrow();
166
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
167
167
  });
168
168
 
169
169
  it('should allow .value assignment on a tracked object', () => {
@@ -174,7 +174,7 @@ import { track } from 'ripple';
174
174
  count.value = 5;
175
175
  }
176
176
  `;
177
- expect(() => compile(code, 'test.ripple')).not.toThrow();
177
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
178
178
  });
179
179
 
180
180
  it('should allow .length read access on a tracked object', () => {
@@ -185,6 +185,6 @@ import { track } from 'ripple';
185
185
  console.log(count.length);
186
186
  }
187
187
  `;
188
- expect(() => compile(code, 'test.ripple')).not.toThrow();
188
+ expect(() => compile(code, 'test.tsrx')).not.toThrow();
189
189
  });
190
190
  });
@@ -28,7 +28,7 @@ describe('compiler > Volar transform does not duplicate try blocks from function
28
28
  }
29
29
  <div onclick={doWork}>{"click"}</div>
30
30
  }`;
31
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
31
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
32
32
 
33
33
  expect(count_occurrences(result, 'try {')).toBe(1);
34
34
  expect(count_occurrences(result, 'catch')).toBe(1);
@@ -44,7 +44,7 @@ describe('compiler > Volar transform does not duplicate try blocks from function
44
44
  };
45
45
  <div onclick={doWork}>{"click"}</div>
46
46
  }`;
47
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
47
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
48
48
 
49
49
  expect(count_occurrences(result, 'try {')).toBe(1);
50
50
  expect(count_occurrences(result, 'await fetch')).toBe(1);
@@ -63,7 +63,7 @@ describe('compiler > Volar transform does not duplicate try blocks from function
63
63
  }
64
64
  <div onclick={save}>{"save"}</div>
65
65
  }`;
66
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
66
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
67
67
 
68
68
  expect(count_occurrences(result, 'try {')).toBe(1);
69
69
  expect(count_occurrences(result, 'catch')).toBe(1);
@@ -78,7 +78,7 @@ export component App() {
78
78
  } catch (e) {}
79
79
  <div>{"hi"}</div>
80
80
  }`;
81
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
81
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
82
82
 
83
83
  expect(count_occurrences(result, 'try {')).toBe(1);
84
84
  expect(count_occurrences(result, 'trackAsync(() => fetch(\'/api\'))')).toBe(1);
@@ -98,7 +98,7 @@ export component App() {
98
98
  }
99
99
  <div onclick={refresh}>{"click"}</div>
100
100
  }`;
101
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
101
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
102
102
 
103
103
  expect(count_occurrences(result, 'try {')).toBe(2);
104
104
  expect(count_occurrences(result, 'trackAsync(() => fetch(\'/init\'))')).toBe(1);
@@ -116,7 +116,7 @@ export component App() {
116
116
  }
117
117
  <div>{"hi"}</div>
118
118
  }`;
119
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
119
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
120
120
 
121
121
  expect(count_occurrences(result, 'try {')).toBe(1);
122
122
  expect(count_occurrences(result, 'await fetch')).toBe(1);
@@ -136,7 +136,7 @@ export component App() {
136
136
  }
137
137
  <div>{"hi"}</div>
138
138
  }`;
139
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
139
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
140
140
 
141
141
  expect(count_occurrences(result, 'try {')).toBe(2);
142
142
  expect(count_occurrences(result, 'await fetch')).toBe(2);
@@ -153,7 +153,7 @@ export component App() {
153
153
  };
154
154
  <div>{"hi"}</div>
155
155
  }`;
156
- const result = compile_to_volar_mappings(source, 'test.ripple').code;
156
+ const result = compile_to_volar_mappings(source, 'test.tsrx').code;
157
157
 
158
158
  expect(count_occurrences(result, 'try {')).toBe(1);
159
159
  expect(count_occurrences(result, 'await fetch')).toBe(1);
@@ -10,7 +10,7 @@ const stringBox = makeStringBox('abc');
10
10
  const ErrorMap = Map<string, Error>;
11
11
  const errorMap = new ErrorMap();`;
12
12
 
13
- const result = compile(source, 'test.ripple', { mode: 'client' });
13
+ const result = compile(source, 'test.tsrx', { mode: 'client' });
14
14
 
15
15
  expect(result.js.code).toMatchSnapshot();
16
16
  });
@@ -21,7 +21,7 @@ function getString(e: string = 'test') {
21
21
  return e;
22
22
  }`;
23
23
 
24
- const result = compile(source, 'test.ripple', { mode: 'client' });
24
+ const result = compile(source, 'test.tsrx', { mode: 'client' });
25
25
 
26
26
  expect(result.js.code).toMatchSnapshot();
27
27
  });
@@ -37,7 +37,7 @@ class PrintEvent implements BaseEvent {
37
37
  }
38
38
  }`;
39
39
 
40
- const result = compile(source, 'test.ripple', { mode: 'client' });
40
+ const result = compile(source, 'test.tsrx', { mode: 'client' });
41
41
 
42
42
  expect(result.js.code).not.toContain('implements');
43
43
  expect(result.js.code).toMatchSnapshot();
@@ -50,7 +50,7 @@ class PrintEvent implements BaseEvent {
50
50
  }
51
51
  }`;
52
52
 
53
- const result = compile(source, 'test.ripple', { mode: 'client' });
53
+ const result = compile(source, 'test.tsrx', { mode: 'client' });
54
54
 
55
55
  expect(result.js.code).not.toContain('Map<string, string>');
56
56
  expect(result.js.code).toContain('class StringMap extends Map');
@@ -0,0 +1,37 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`composite > render > correct handles passing through component props and children 1`] = `
4
+ <div>
5
+ <!---->
6
+ <div>
7
+ <div>
8
+ I am A
9
+ </div>
10
+ <!---->
11
+ <div>
12
+ other text
13
+ </div>
14
+ <!---->
15
+ <div>
16
+ I am B
17
+ </div>
18
+ <!---->
19
+ </div>
20
+ <!---->
21
+
22
+ </div>
23
+ `;
24
+
25
+ exports[`composite > render > render simple text as children 1`] = `
26
+ <div>
27
+ <!---->
28
+ <button
29
+ class="my-button"
30
+ >
31
+ Click Me
32
+ <!---->
33
+ </button>
34
+ <!---->
35
+
36
+ </div>
37
+ `;
@@ -13,7 +13,7 @@ export component Test() {
13
13
  }
14
14
  </style>
15
15
  }`;
16
- const { css } = compile(source, 'test.ripple');
16
+ const { css } = compile(source, 'test.tsrx');
17
17
 
18
18
  expect(css).toMatch(/div\.ripple-[a-z0-9]+\.x {/);
19
19
  });
@@ -31,7 +31,7 @@ export component Test() {
31
31
  }
32
32
  </style>
33
33
  }`;
34
- const { css } = compile(source, 'test.ripple');
34
+ const { css } = compile(source, 'test.tsrx');
35
35
 
36
36
  expect(css).toContain('&.x {');
37
37
  });
@@ -49,7 +49,7 @@ export component Test() {
49
49
  }
50
50
  </style>
51
51
  }`;
52
- const { css } = compile(source, 'test.ripple');
52
+ const { css } = compile(source, 'test.tsrx');
53
53
 
54
54
  expect(css).toContain('&.x {');
55
55
  });
@@ -65,7 +65,7 @@ export component Test() {
65
65
  }
66
66
  </style>
67
67
  }`;
68
- const { css } = compile(source, 'test.ripple');
68
+ const { css } = compile(source, 'test.tsrx');
69
69
 
70
70
  expect(css).toMatch(/div\.ripple-[a-z0-9]+:is\(html\.dark-mode \*\) {/);
71
71
  });
@@ -83,7 +83,7 @@ export component Test() {
83
83
  }
84
84
  </style>
85
85
  }`;
86
- const { css } = compile(source, 'test.ripple');
86
+ const { css } = compile(source, 'test.tsrx');
87
87
 
88
88
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
89
89
  expect(css).toContain('&.class {');
@@ -102,7 +102,7 @@ export component Test() {
102
102
  }
103
103
  </style>
104
104
  }`;
105
- const { css } = compile(source, 'test.ripple');
105
+ const { css } = compile(source, 'test.tsrx');
106
106
 
107
107
  expect(css).toContain('* {');
108
108
  expect(css).toMatch(/&:hover \.class\.ripple-[a-z0-9]+ {/);
@@ -120,7 +120,7 @@ export component Test() {
120
120
  }
121
121
  </style>
122
122
  }`;
123
- const { css } = compile(source, 'test.ripple');
123
+ const { css } = compile(source, 'test.tsrx');
124
124
 
125
125
  expect(css).toContain(' x, y {');
126
126
  });
@@ -140,7 +140,7 @@ export component Test() {
140
140
  }
141
141
  </style>
142
142
  }`;
143
- const { css } = compile(source, 'test.ripple');
143
+ const { css } = compile(source, 'test.tsrx');
144
144
 
145
145
  expect(css).toMatch(/div\.ripple-[a-z0-9]+/);
146
146
  expect(css).toContain('z {');
@@ -175,7 +175,7 @@ export component Test() {
175
175
  }
176
176
  </style>
177
177
  }`;
178
- const { css } = compile(source, 'test.ripple');
178
+ const { css } = compile(source, 'test.tsrx');
179
179
 
180
180
  expect(css).toContain('@keyframes test-in {');
181
181
  expect(css).toContain('.x {');
@@ -196,7 +196,7 @@ export component Test() {
196
196
  }
197
197
  </style>
198
198
  }`;
199
- const { css } = compile(source, 'test.ripple');
199
+ const { css } = compile(source, 'test.tsrx');
200
200
 
201
201
  expect(css).toContain('@keyframes orphan');
202
202
  expect(css).not.toContain('-global-orphan');
@@ -220,7 +220,7 @@ export component Test() {
220
220
  }
221
221
  </style>
222
222
  }`;
223
- const { css } = compile(source, 'test.ripple');
223
+ const { css } = compile(source, 'test.tsrx');
224
224
 
225
225
  expect(css).toMatch(/div\.ripple-[a-z0-9]+\.blue {/);
226
226
  expect(css).toMatch(/span\.blue\.x\.ripple-[a-z0-9]+ {/);
@@ -238,7 +238,7 @@ export component Test() {
238
238
  }
239
239
  </style>
240
240
  }`;
241
- const { css } = compile(source, 'test.ripple');
241
+ const { css } = compile(source, 'test.tsrx');
242
242
 
243
243
  expect(css).toContain('div > section > p');
244
244
  expect(css).toMatch(/p\.ripple-[a-z0-9]+ {/);
@@ -259,7 +259,7 @@ export component Test() {
259
259
  }
260
260
  </style>
261
261
  }`;
262
- const { css } = compile(source, 'test.ripple');
262
+ const { css } = compile(source, 'test.tsrx');
263
263
 
264
264
  expect(css).toMatch(/x\.ripple-[a-z0-9]+ :is\(html \*\) {/);
265
265
  });
@@ -286,7 +286,7 @@ export component Test() {
286
286
  }
287
287
  </style>
288
288
  }`;
289
- const { css } = compile(source, 'test.ripple');
289
+ const { css } = compile(source, 'test.tsrx');
290
290
 
291
291
  expect(css).toContain('.foo {');
292
292
  expect(css).toMatch(/\.ripple-[a-z0-9]+:has\(x:where\(\.ripple-[a-z0-9]+\)\) {/);
@@ -341,7 +341,7 @@ export component Test() {
341
341
  }
342
342
  </style>
343
343
  }`;
344
- const { css } = compile(source, 'test.ripple');
344
+ const { css } = compile(source, 'test.tsrx');
345
345
 
346
346
  expect(css).toContain(':not(.foo)');
347
347
  expect(css).toContain('span');
@@ -376,7 +376,7 @@ export component Test({ children }) {
376
376
  :global(.x) + .bar { color: green; }
377
377
  </style>
378
378
  }`;
379
- const { css } = compile(source, 'test.ripple');
379
+ const { css } = compile(source, 'test.tsrx');
380
380
 
381
381
  expect(css).toMatch(/\.before\.ripple-[a-z0-9]+ \+ \.foo:where\(\.ripple-[a-z0-9]+\) {/);
382
382
  expect((css.match(/\.x\ /g) || []).length).toBe(0);
@@ -417,7 +417,7 @@ export component Test({ children }) {
417
417
  component Child1() {
418
418
  <div>{'child1'}</div>
419
419
  }`;
420
- const { css } = compile(source, 'test.ripple');
420
+ const { css } = compile(source, 'test.tsrx');
421
421
 
422
422
  expect(css).toMatch(/\.before\.ripple-[a-z0-9]+ \+ \.foo:where\(\.ripple-[a-z0-9]+\) {/);
423
423
  expect((css.match(/\.x\ /g) || []).length).toBe(5);
@@ -463,7 +463,7 @@ export component Test({ children }) {
463
463
  component Child1() {
464
464
  <div>{'child1'}</div>
465
465
  }`;
466
- const { css } = compile(source, 'test.ripple');
466
+ const { css } = compile(source, 'test.tsrx');
467
467
 
468
468
  expect(css).toMatch(/\.before\.ripple-[a-z0-9]+ \+ \.foo:where\(\.ripple-[a-z0-9]+\) {/);
469
469
  expect((css.match(/\.x\ /g) || []).length).toBe(5);
@@ -507,7 +507,7 @@ export component Test({ children, classes }) {
507
507
  </style>
508
508
  }`;
509
509
 
510
- const { css } = compile(source, 'test.ripple');
510
+ const { css } = compile(source, 'test.tsrx');
511
511
 
512
512
  expect(css).toMatch(/\.before\.ripple-[a-z0-9]+ \+ \.foo:where\(\.ripple-[a-z0-9]+\) {/);
513
513
  expect((css.match(/\.x\ /g) || []).length).toBe(5);
@@ -531,7 +531,7 @@ export component Test() {
531
531
  }
532
532
  </style>
533
533
  }`;
534
- const { css } = compile(source, 'test.ripple');
534
+ const { css } = compile(source, 'test.tsrx');
535
535
 
536
536
  expect(css).toMatch(/html body \.root\.ripple-[a-z0-9]+ p:where\(\.ripple-[a-z0-9]+\) {/);
537
537
  });
@@ -557,7 +557,7 @@ export component Test() {
557
557
  }
558
558
  </style>
559
559
  }`;
560
- const { css } = compile(source, 'test.ripple');
560
+ const { css } = compile(source, 'test.tsrx');
561
561
 
562
562
  expect(css).toContain('@media (min-width: 768px) {');
563
563
  expect(css).toContain('.foo {');
@@ -588,7 +588,7 @@ export component Test() {
588
588
  }
589
589
  </style>
590
590
  }`;
591
- const { css } = compile(source, 'test.ripple');
591
+ const { css } = compile(source, 'test.tsrx');
592
592
 
593
593
  expect(css).toMatch(
594
594
  /g\.ripple-[a-z0-9]+:has\(> h:where\(\.ripple-[a-z0-9]+\) > i:where\(\.ripple-[a-z0-9]+\)\)/,
@@ -612,7 +612,7 @@ export component Test() {
612
612
  }
613
613
  </style>
614
614
  }`;
615
- const { css } = compile(source, 'test.ripple');
615
+ const { css } = compile(source, 'test.tsrx');
616
616
 
617
617
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ h1\[data-title="Hello, world!"\]/);
618
618
  expect(css).toContain('h1[attribute], video[autoplay]');
@@ -631,7 +631,7 @@ export component Test() {
631
631
  }
632
632
  </style>
633
633
  }`;
634
- const { css } = compile(source, 'test.ripple');
634
+ const { css } = compile(source, 'test.tsrx');
635
635
 
636
636
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ \.h1\\,h2\\,h3 {/);
637
637
  });
@@ -656,7 +656,7 @@ export component Test() {
656
656
  }
657
657
  </style>
658
658
  }`;
659
- const { css } = compile(source, 'test.ripple');
659
+ const { css } = compile(source, 'test.tsrx');
660
660
 
661
661
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ :is\(h1, h2\)/);
662
662
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ :where\(h1, h2\)/);
@@ -677,7 +677,7 @@ export component Test() {
677
677
  }
678
678
  </style>
679
679
  }`;
680
- const { css } = compile(source, 'test.ripple');
680
+ const { css } = compile(source, 'test.tsrx');
681
681
 
682
682
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ h1 ~ :is\(h2, h3\)/);
683
683
  });
@@ -698,7 +698,7 @@ export component Test() {
698
698
  }
699
699
  </style>
700
700
  }`;
701
- expect(() => compile(source, 'test.ripple')).toThrow(
701
+ expect(() => compile(source, 'test.tsrx')).toThrow(
702
702
  ':global(...) can be at the start or end of a selector sequence, but not in the middle',
703
703
  );
704
704
  });
@@ -18,7 +18,7 @@ export component Test() {
18
18
  }
19
19
  </style>
20
20
  }`;
21
- const { css } = compile(source, 'test.ripple');
21
+ const { css } = compile(source, 'test.tsrx');
22
22
 
23
23
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ ::slotted\(span\) {/);
24
24
  expect(css).toContain('::slotted(*) {');
@@ -39,7 +39,7 @@ export component Test() {
39
39
  }
40
40
  </style>
41
41
  }`;
42
- const { css } = compile(source, 'test.ripple');
42
+ const { css } = compile(source, 'test.tsrx');
43
43
 
44
44
  expect(css).toMatch(/div\.ripple-[a-z0-9]+ ::part\(input\) {/);
45
45
  expect(css).toContain('::part(button) {');
@@ -64,7 +64,7 @@ export component Test() {
64
64
  }
65
65
  </style>
66
66
  }`;
67
- const { css } = compile(source, 'test.ripple');
67
+ const { css } = compile(source, 'test.tsrx');
68
68
 
69
69
  expect(css).toContain(':host {');
70
70
  expect(css).toContain(':host(.active) {');
@@ -94,7 +94,7 @@ export component Test() {
94
94
  }
95
95
  </style>
96
96
  }`;
97
- const { css } = compile(source, 'test.ripple');
97
+ const { css } = compile(source, 'test.tsrx');
98
98
 
99
99
  expect(css).toContain('span:nth-child(odd) {');
100
100
  expect(css).toContain('span:nth-last-child(2) {');
@@ -120,7 +120,7 @@ export component Test() {
120
120
  }
121
121
  </style>
122
122
  }`;
123
- const { css } = compile(source, 'test.ripple');
123
+ const { css } = compile(source, 'test.tsrx');
124
124
 
125
125
  expect(css).toContain(':lang(en) {');
126
126
  expect(css).toContain(':dir(rtl) {');
@@ -144,7 +144,7 @@ export component Test() {
144
144
  }
145
145
  </style>
146
146
  }`;
147
- const { css } = compile(source, 'test.ripple');
147
+ const { css } = compile(source, 'test.tsrx');
148
148
 
149
149
  expect(css).toContain('div:focus-within {');
150
150
  expect(css).toContain('input:focus-visible {');
@@ -171,7 +171,7 @@ export component Test() {
171
171
  }
172
172
  </style>
173
173
  }`;
174
- const { css } = compile(source, 'test.ripple');
174
+ const { css } = compile(source, 'test.tsrx');
175
175
 
176
176
  expect(css).toContain(':any-link {');
177
177
  expect(css).toContain(':target {');
@@ -216,7 +216,7 @@ export component Test() {
216
216
  }
217
217
  </style>
218
218
  }`;
219
- const { css } = compile(source, 'test.ripple');
219
+ const { css } = compile(source, 'test.tsrx');
220
220
 
221
221
  expect(css).toContain('input:required {');
222
222
  expect(css).toContain('input:optional {');
@@ -18,7 +18,7 @@ export component Test() {
18
18
  }
19
19
  </style>
20
20
  }`;
21
- const { css } = compile(source, 'test.ripple');
21
+ const { css } = compile(source, 'test.tsrx');
22
22
 
23
23
  expect(css).toContain('@media (min-width: 768px) {');
24
24
  expect(css).toContain('div {');
@@ -42,7 +42,7 @@ export component Test() {
42
42
  }
43
43
  </style>
44
44
  }`;
45
- const { css } = compile(source, 'test.ripple');
45
+ const { css } = compile(source, 'test.tsrx');
46
46
 
47
47
  expect(css).toContain('@supports (display: grid) {');
48
48
  expect(css).toContain('.container {');
@@ -70,7 +70,7 @@ export component Test() {
70
70
  }
71
71
  </style>
72
72
  }`;
73
- const { css } = compile(source, 'test.ripple');
73
+ const { css } = compile(source, 'test.tsrx');
74
74
 
75
75
  expect(css).toContain('@media (min-width: 768px) {');
76
76
  expect(css).toContain('.foo {');
@@ -91,7 +91,7 @@ export component Test() {
91
91
  }
92
92
  </style>
93
93
  }`;
94
- const { css } = compile(source, 'test.ripple');
94
+ const { css } = compile(source, 'test.tsrx');
95
95
 
96
96
  expect(css).toContain('@container (min-width: 400px) {');
97
97
  expect(css).toContain('div {');
@@ -116,7 +116,7 @@ export component Test() {
116
116
  }
117
117
  </style>
118
118
  }`;
119
- const { css } = compile(source, 'test.ripple');
119
+ const { css } = compile(source, 'test.tsrx');
120
120
 
121
121
  expect(css).toContain('@media screen {');
122
122
  expect(css).toContain('@supports (display: flex) {');
@@ -12,7 +12,7 @@ export component Test() {
12
12
  }
13
13
  </style>
14
14
  }`;
15
- const { css } = compile(source, 'test.ripple');
15
+ const { css } = compile(source, 'test.tsrx');
16
16
 
17
17
  expect(css).toContain('div {');
18
18
  expect(css).toContain('color: red;');
@@ -34,7 +34,7 @@ export component Test() {
34
34
  }
35
35
  </style>
36
36
  }`;
37
- const { css } = compile(source, 'test.ripple');
37
+ const { css } = compile(source, 'test.tsrx');
38
38
 
39
39
  expect(css).toContain('div.foo {');
40
40
  expect(css).toContain('.foo {');
@@ -58,7 +58,7 @@ export component Test() {
58
58
  }
59
59
  </style>
60
60
  }`;
61
- const { css } = compile(source, 'test.ripple');
61
+ const { css } = compile(source, 'test.tsrx');
62
62
 
63
63
  expect(css).toContain('div .foo');
64
64
  expect(css).toContain('div > .foo');
@@ -82,7 +82,7 @@ export component Test() {
82
82
  }
83
83
  </style>
84
84
  }`;
85
- const { css } = compile(source, 'test.ripple');
85
+ const { css } = compile(source, 'test.tsrx');
86
86
 
87
87
  expect(css).toContain('.x {');
88
88
  expect(css).toContain('.a, .selector, .list {');
@@ -104,7 +104,7 @@ export component Test() {
104
104
  }
105
105
  </style>
106
106
  }`;
107
- const { css } = compile(source, 'test.ripple');
107
+ const { css } = compile(source, 'test.tsrx');
108
108
 
109
109
  expect(css).toContain('button:hover {');
110
110
  expect(css).toContain('button:focus {');
@@ -124,7 +124,7 @@ export component Test() {
124
124
  }
125
125
  </style>
126
126
  }`;
127
- const { css } = compile(source, 'test.ripple');
127
+ const { css } = compile(source, 'test.tsrx');
128
128
 
129
129
  expect(css).toContain('html,');
130
130
  expect(css).toContain('body {');
@@ -155,7 +155,7 @@ export component Test() {
155
155
  }
156
156
  </style>
157
157
  }`;
158
- const { css } = compile(source, 'test.ripple');
158
+ const { css } = compile(source, 'test.tsrx');
159
159
 
160
160
  expect(css).toMatch(/\.styled-container\.ripple-[a-z0-9]+/);
161
161
  expect(css).toMatch(/\.text\.ripple-[a-z0-9]+/);