ripple 0.3.12 → 0.3.14

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 (217) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/package.json +11 -30
  3. package/src/compiler/types/import.d.ts +0 -12
  4. package/src/helpers.d.ts +2 -0
  5. package/src/runtime/array.js +38 -38
  6. package/src/runtime/create-subscriber.js +2 -2
  7. package/src/runtime/index-client.js +15 -13
  8. package/src/runtime/index-server.js +18 -11
  9. package/src/runtime/internal/client/bindings.js +4 -6
  10. package/src/runtime/internal/client/blocks.js +19 -23
  11. package/src/runtime/internal/client/constants.js +20 -9
  12. package/src/runtime/internal/client/events.js +8 -3
  13. package/src/runtime/internal/client/hmr.js +5 -17
  14. package/src/runtime/internal/client/index.js +14 -4
  15. package/src/runtime/internal/client/runtime.js +436 -173
  16. package/src/runtime/internal/client/try.js +334 -156
  17. package/src/runtime/internal/client/types.d.ts +26 -0
  18. package/src/runtime/internal/server/blocks.js +181 -0
  19. package/src/runtime/internal/server/constants.js +7 -0
  20. package/src/runtime/internal/server/index.js +774 -150
  21. package/src/runtime/internal/server/types.d.ts +35 -0
  22. package/src/runtime/media-query.js +34 -33
  23. package/src/runtime/object.js +7 -10
  24. package/src/runtime/proxy.js +2 -3
  25. package/src/runtime/reactive-value.js +23 -21
  26. package/src/server/index.js +1 -1
  27. package/src/utils/ast.js +1 -1
  28. package/src/utils/async.js +35 -0
  29. package/src/utils/attributes.js +43 -0
  30. package/src/utils/builders.js +5 -3
  31. package/tests/client/__snapshots__/computed-properties.test.rsrx.snap +49 -0
  32. package/tests/client/__snapshots__/for.test.rsrx.snap +319 -0
  33. package/tests/client/__snapshots__/html.test.rsrx.snap +40 -0
  34. package/tests/client/_etc.test.rsrx +7 -0
  35. package/tests/client/array/{array.static.test.ripple → array.static.test.rsrx} +18 -20
  36. package/tests/client/async-suspend.test.rsrx +662 -0
  37. package/tests/client/basic/__snapshots__/basic.attributes.test.rsrx.snap +60 -0
  38. package/tests/client/basic/__snapshots__/basic.rendering.test.rsrx.snap +59 -0
  39. package/tests/client/basic/{basic.errors.test.ripple → basic.errors.test.rsrx} +3 -3
  40. package/tests/client/basic/{basic.styling.test.ripple → basic.styling.test.rsrx} +1 -1
  41. package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +12 -0
  42. package/tests/client/compiler/__snapshots__/compiler.typescript.test.rsrx.snap +46 -0
  43. package/tests/client/compiler/{compiler.assignments.test.ripple → compiler.assignments.test.rsrx} +1 -1
  44. package/tests/client/compiler/{compiler.attributes.test.ripple → compiler.attributes.test.rsrx} +1 -1
  45. package/tests/client/compiler/{compiler.basic.test.ripple → compiler.basic.test.rsrx} +13 -13
  46. package/tests/client/compiler/{compiler.tracked-access.test.ripple → compiler.tracked-access.test.rsrx} +1 -1
  47. package/tests/client/compiler/{compiler.try-in-function.test.ripple → compiler.try-in-function.test.rsrx} +9 -7
  48. package/tests/client/compiler/{compiler.typescript.test.ripple → compiler.typescript.test.rsrx} +1 -1
  49. package/tests/client/composite/__snapshots__/composite.render.test.rsrx.snap +37 -0
  50. package/tests/client/css/{global-additional-cases.test.ripple → global-additional-cases.test.rsrx} +1 -1
  51. package/tests/client/css/{global-advanced-selectors.test.ripple → global-advanced-selectors.test.rsrx} +1 -1
  52. package/tests/client/css/{global-at-rules.test.ripple → global-at-rules.test.rsrx} +1 -1
  53. package/tests/client/css/{global-basic.test.ripple → global-basic.test.rsrx} +1 -1
  54. package/tests/client/css/{global-classes-ids.test.ripple → global-classes-ids.test.rsrx} +1 -1
  55. package/tests/client/css/{global-combinators.test.ripple → global-combinators.test.rsrx} +1 -1
  56. package/tests/client/css/{global-complex-nesting.test.ripple → global-complex-nesting.test.rsrx} +1 -1
  57. package/tests/client/css/{global-edge-cases.test.ripple → global-edge-cases.test.rsrx} +1 -1
  58. package/tests/client/css/{global-keyframes.test.ripple → global-keyframes.test.rsrx} +1 -1
  59. package/tests/client/css/{global-nested.test.ripple → global-nested.test.rsrx} +1 -1
  60. package/tests/client/css/{global-pseudo.test.ripple → global-pseudo.test.rsrx} +1 -1
  61. package/tests/client/css/{global-scoping.test.ripple → global-scoping.test.rsrx} +1 -1
  62. package/tests/client/css/{style-identifier.test.ripple → style-identifier.test.rsrx} +1 -1
  63. package/tests/client/{function-overload.test.ripple → function-overload.test.rsrx} +1 -1
  64. package/tests/client/{return.test.ripple → return.test.rsrx} +1 -1
  65. package/tests/client/try.test.rsrx +1702 -0
  66. package/tests/hydration/build-components.js +6 -4
  67. package/tests/hydration/compiled/client/head.js +11 -11
  68. package/tests/hydration/compiled/client/mixed-control-flow.js +55 -70
  69. package/tests/hydration/compiled/client/nested-control-flow.js +72 -88
  70. package/tests/hydration/compiled/client/try.js +42 -54
  71. package/tests/hydration/compiled/server/basic.js +491 -369
  72. package/tests/hydration/compiled/server/composite.js +153 -128
  73. package/tests/hydration/compiled/server/events.js +166 -145
  74. package/tests/hydration/compiled/server/for.js +821 -677
  75. package/tests/hydration/compiled/server/head.js +200 -165
  76. package/tests/hydration/compiled/server/hmr.js +62 -54
  77. package/tests/hydration/compiled/server/html-in-template.js +64 -55
  78. package/tests/hydration/compiled/server/html.js +1477 -1360
  79. package/tests/hydration/compiled/server/if-children.js +448 -408
  80. package/tests/hydration/compiled/server/if.js +204 -171
  81. package/tests/hydration/compiled/server/mixed-control-flow.js +237 -195
  82. package/tests/hydration/compiled/server/nested-control-flow.js +533 -467
  83. package/tests/hydration/compiled/server/portal.js +94 -107
  84. package/tests/hydration/compiled/server/reactivity.js +87 -64
  85. package/tests/hydration/compiled/server/return.js +1424 -1174
  86. package/tests/hydration/compiled/server/switch.js +268 -238
  87. package/tests/hydration/compiled/server/try.js +98 -87
  88. package/tests/hydration/components/{mixed-control-flow.ripple → mixed-control-flow.rsrx} +2 -2
  89. package/tests/hydration/components/{try.ripple → try.rsrx} +4 -2
  90. package/tests/hydration/mixed-control-flow.test.js +14 -0
  91. package/tests/hydration/nested-control-flow.test.js +50 -48
  92. package/tests/hydration/try.test.js +25 -0
  93. package/tests/server/__snapshots__/compiler.test.ripple.snap +0 -32
  94. package/tests/server/__snapshots__/compiler.test.rsrx.snap +95 -0
  95. package/tests/server/{compiler.test.ripple → compiler.test.rsrx} +0 -17
  96. package/tests/server/{html-nesting-validation.test.ripple → html-nesting-validation.test.rsrx} +3 -3
  97. package/tests/server/streaming-ssr.test.rsrx +115 -0
  98. package/tests/server/{style-identifier.test.ripple → style-identifier.test.rsrx} +1 -1
  99. package/tests/server/try.test.rsrx +503 -0
  100. package/tests/setup-server.js +1 -1
  101. package/tests/utils/compiler-compat-config.test.js +4 -4
  102. package/tests/utils/vite-plugin-config.test.js +1 -1
  103. package/tests/utils/vite-plugin-hmr.test.js +5 -5
  104. package/tsconfig.json +2 -0
  105. package/types/index.d.ts +13 -23
  106. package/types/server.d.ts +43 -16
  107. package/src/compiler/comment-utils.js +0 -91
  108. package/src/compiler/errors.js +0 -77
  109. package/src/compiler/identifier-utils.js +0 -80
  110. package/src/compiler/index.d.ts +0 -127
  111. package/src/compiler/index.js +0 -89
  112. package/src/compiler/phases/1-parse/index.js +0 -2964
  113. package/src/compiler/phases/1-parse/style.js +0 -704
  114. package/src/compiler/phases/2-analyze/css-analyze.js +0 -160
  115. package/src/compiler/phases/2-analyze/index.js +0 -2238
  116. package/src/compiler/phases/2-analyze/prune.js +0 -1131
  117. package/src/compiler/phases/2-analyze/validation.js +0 -168
  118. package/src/compiler/phases/3-transform/client/index.js +0 -5301
  119. package/src/compiler/phases/3-transform/segments.js +0 -2129
  120. package/src/compiler/phases/3-transform/server/index.js +0 -1899
  121. package/src/compiler/phases/3-transform/stylesheet.js +0 -545
  122. package/src/compiler/scope.js +0 -476
  123. package/src/compiler/source-map-utils.js +0 -358
  124. package/src/compiler/types/acorn.d.ts +0 -11
  125. package/src/compiler/types/estree-jsx.d.ts +0 -11
  126. package/src/compiler/types/estree.d.ts +0 -11
  127. package/src/compiler/types/index.d.ts +0 -1404
  128. package/src/compiler/types/parse.d.ts +0 -1721
  129. package/src/compiler/utils.js +0 -1263
  130. package/tests/client/_etc.test.ripple +0 -5
  131. package/tests/client/async-suspend.test.ripple +0 -94
  132. package/tests/client/try.test.ripple +0 -196
  133. package/tests/server/streaming-ssr.test.ripple +0 -68
  134. package/tests/server/try.test.ripple +0 -82
  135. /package/tests/client/array/{array.copy-within.test.ripple → array.copy-within.test.rsrx} +0 -0
  136. /package/tests/client/array/{array.derived.test.ripple → array.derived.test.rsrx} +0 -0
  137. /package/tests/client/array/{array.iteration.test.ripple → array.iteration.test.rsrx} +0 -0
  138. /package/tests/client/array/{array.mutations.test.ripple → array.mutations.test.rsrx} +0 -0
  139. /package/tests/client/array/{array.to-methods.test.ripple → array.to-methods.test.rsrx} +0 -0
  140. /package/tests/client/basic/{basic.attributes.test.ripple → basic.attributes.test.rsrx} +0 -0
  141. /package/tests/client/basic/{basic.collections.test.ripple → basic.collections.test.rsrx} +0 -0
  142. /package/tests/client/basic/{basic.components.test.ripple → basic.components.test.rsrx} +0 -0
  143. /package/tests/client/basic/{basic.events.test.ripple → basic.events.test.rsrx} +0 -0
  144. /package/tests/client/basic/{basic.get-set.test.ripple → basic.get-set.test.rsrx} +0 -0
  145. /package/tests/client/basic/{basic.hmr.test.ripple → basic.hmr.test.rsrx} +0 -0
  146. /package/tests/client/basic/{basic.reactivity.test.ripple → basic.reactivity.test.rsrx} +0 -0
  147. /package/tests/client/basic/{basic.rendering.test.ripple → basic.rendering.test.rsrx} +0 -0
  148. /package/tests/client/basic/{basic.utilities.test.ripple → basic.utilities.test.rsrx} +0 -0
  149. /package/tests/client/{boundaries.test.ripple → boundaries.test.rsrx} +0 -0
  150. /package/tests/client/compiler/{compiler.regex.test.ripple → compiler.regex.test.rsrx} +0 -0
  151. /package/tests/client/composite/{composite.dynamic-components.test.ripple → composite.dynamic-components.test.rsrx} +0 -0
  152. /package/tests/client/composite/{composite.generics.test.ripple → composite.generics.test.rsrx} +0 -0
  153. /package/tests/client/composite/{composite.props.test.ripple → composite.props.test.rsrx} +0 -0
  154. /package/tests/client/composite/{composite.reactivity.test.ripple → composite.reactivity.test.rsrx} +0 -0
  155. /package/tests/client/composite/{composite.render.test.ripple → composite.render.test.rsrx} +0 -0
  156. /package/tests/client/{computed-properties.test.ripple → computed-properties.test.rsrx} +0 -0
  157. /package/tests/client/{context.test.ripple → context.test.rsrx} +0 -0
  158. /package/tests/client/{date.test.ripple → date.test.rsrx} +0 -0
  159. /package/tests/client/{dynamic-elements.test.ripple → dynamic-elements.test.rsrx} +0 -0
  160. /package/tests/client/{events.test.ripple → events.test.rsrx} +0 -0
  161. /package/tests/client/{for.test.ripple → for.test.rsrx} +0 -0
  162. /package/tests/client/{function-overload-import.ripple → function-overload-import.rsrx} +0 -0
  163. /package/tests/client/{head.test.ripple → head.test.rsrx} +0 -0
  164. /package/tests/client/{html.test.ripple → html.test.rsrx} +0 -0
  165. /package/tests/client/{input-value.test.ripple → input-value.test.rsrx} +0 -0
  166. /package/tests/client/{lazy-destructuring.test.ripple → lazy-destructuring.test.rsrx} +0 -0
  167. /package/tests/client/{map.test.ripple → map.test.rsrx} +0 -0
  168. /package/tests/client/{media-query.test.ripple → media-query.test.rsrx} +0 -0
  169. /package/tests/client/{object.test.ripple → object.test.rsrx} +0 -0
  170. /package/tests/client/{portal.test.ripple → portal.test.rsrx} +0 -0
  171. /package/tests/client/{ref.test.ripple → ref.test.rsrx} +0 -0
  172. /package/tests/client/{set.test.ripple → set.test.rsrx} +0 -0
  173. /package/tests/client/{svg.test.ripple → svg.test.rsrx} +0 -0
  174. /package/tests/client/{switch.test.ripple → switch.test.rsrx} +0 -0
  175. /package/tests/client/{tsx.test.ripple → tsx.test.rsrx} +0 -0
  176. /package/tests/client/{typescript-generics.test.ripple → typescript-generics.test.rsrx} +0 -0
  177. /package/tests/client/url/{url.derived.test.ripple → url.derived.test.rsrx} +0 -0
  178. /package/tests/client/url/{url.parsing.test.ripple → url.parsing.test.rsrx} +0 -0
  179. /package/tests/client/url/{url.partial-removal.test.ripple → url.partial-removal.test.rsrx} +0 -0
  180. /package/tests/client/url/{url.reactivity.test.ripple → url.reactivity.test.rsrx} +0 -0
  181. /package/tests/client/url/{url.serialization.test.ripple → url.serialization.test.rsrx} +0 -0
  182. /package/tests/client/url-search-params/{url-search-params.derived.test.ripple → url-search-params.derived.test.rsrx} +0 -0
  183. /package/tests/client/url-search-params/{url-search-params.initialization.test.ripple → url-search-params.initialization.test.rsrx} +0 -0
  184. /package/tests/client/url-search-params/{url-search-params.iteration.test.ripple → url-search-params.iteration.test.rsrx} +0 -0
  185. /package/tests/client/url-search-params/{url-search-params.mutation.test.ripple → url-search-params.mutation.test.rsrx} +0 -0
  186. /package/tests/client/url-search-params/{url-search-params.retrieval.test.ripple → url-search-params.retrieval.test.rsrx} +0 -0
  187. /package/tests/client/url-search-params/{url-search-params.serialization.test.ripple → url-search-params.serialization.test.rsrx} +0 -0
  188. /package/tests/client/url-search-params/{url-search-params.tracked-url.test.ripple → url-search-params.tracked-url.test.rsrx} +0 -0
  189. /package/tests/hydration/components/{basic.ripple → basic.rsrx} +0 -0
  190. /package/tests/hydration/components/{composite.ripple → composite.rsrx} +0 -0
  191. /package/tests/hydration/components/{events.ripple → events.rsrx} +0 -0
  192. /package/tests/hydration/components/{for.ripple → for.rsrx} +0 -0
  193. /package/tests/hydration/components/{head.ripple → head.rsrx} +0 -0
  194. /package/tests/hydration/components/{hmr.ripple → hmr.rsrx} +0 -0
  195. /package/tests/hydration/components/{html-in-template.ripple → html-in-template.rsrx} +0 -0
  196. /package/tests/hydration/components/{html.ripple → html.rsrx} +0 -0
  197. /package/tests/hydration/components/{if-children.ripple → if-children.rsrx} +0 -0
  198. /package/tests/hydration/components/{if.ripple → if.rsrx} +0 -0
  199. /package/tests/hydration/components/{nested-control-flow.ripple → nested-control-flow.rsrx} +0 -0
  200. /package/tests/hydration/components/{portal.ripple → portal.rsrx} +0 -0
  201. /package/tests/hydration/components/{reactivity.ripple → reactivity.rsrx} +0 -0
  202. /package/tests/hydration/components/{return.ripple → return.rsrx} +0 -0
  203. /package/tests/hydration/components/{switch.ripple → switch.rsrx} +0 -0
  204. /package/tests/server/{await.test.ripple → await.test.rsrx} +0 -0
  205. /package/tests/server/{basic.attributes.test.ripple → basic.attributes.test.rsrx} +0 -0
  206. /package/tests/server/{basic.components.test.ripple → basic.components.test.rsrx} +0 -0
  207. /package/tests/server/{basic.test.ripple → basic.test.rsrx} +0 -0
  208. /package/tests/server/{composite.props.test.ripple → composite.props.test.rsrx} +0 -0
  209. /package/tests/server/{composite.test.ripple → composite.test.rsrx} +0 -0
  210. /package/tests/server/{context.test.ripple → context.test.rsrx} +0 -0
  211. /package/tests/server/{dynamic-elements.test.ripple → dynamic-elements.test.rsrx} +0 -0
  212. /package/tests/server/{for.test.ripple → for.test.rsrx} +0 -0
  213. /package/tests/server/{head.test.ripple → head.test.rsrx} +0 -0
  214. /package/tests/server/{if.test.ripple → if.test.rsrx} +0 -0
  215. /package/tests/server/{lazy-destructuring.test.ripple → lazy-destructuring.test.rsrx} +0 -0
  216. /package/tests/server/{return.test.ripple → return.test.rsrx} +0 -0
  217. /package/tests/server/{switch.test.ripple → switch.test.rsrx} +0 -0
@@ -0,0 +1,60 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`basic client > attribute rendering > handles boolean attributes with no prop value provides 1`] = `
4
+ <div>
5
+ <div
6
+ class="container"
7
+ >
8
+ <button
9
+ disabled=""
10
+ >
11
+ Button
12
+ </button>
13
+ <input
14
+ checked=""
15
+ type="checkbox"
16
+ />
17
+ </div>
18
+
19
+ </div>
20
+ `;
21
+
22
+ exports[`basic client > attribute rendering > handles boolean props correctly 1`] = `
23
+ <div>
24
+ <div
25
+ data-disabled=""
26
+ />
27
+ <input
28
+ disabled=""
29
+ />
30
+ <!---->
31
+
32
+ </div>
33
+ `;
34
+
35
+ exports[`basic client > attribute rendering > render spread props without duplication 1`] = `
36
+ <div>
37
+ <div>
38
+ <input
39
+ id="vehicle1"
40
+ name="car"
41
+ type="checkbox"
42
+ value="Bike"
43
+ />
44
+ </div>
45
+
46
+ </div>
47
+ `;
48
+
49
+ exports[`basic client > attribute rendering > render static attributes 1`] = `
50
+ <div>
51
+ <div
52
+ class="foo"
53
+ id="bar"
54
+ style="color: red;"
55
+ >
56
+ Hello World
57
+ </div>
58
+
59
+ </div>
60
+ `;
@@ -0,0 +1,59 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`basic client > rendering & text > basic operations 1`] = `
4
+ <div>
5
+ <div>
6
+ 0
7
+ </div>
8
+ <div>
9
+ 2
10
+ </div>
11
+ <div>
12
+ 5
13
+ </div>
14
+ <div>
15
+ 2
16
+ </div>
17
+
18
+ </div>
19
+ `;
20
+
21
+ exports[`basic client > rendering & text > renders semi-dynamic text 1`] = `
22
+ <div>
23
+ <div>
24
+ Hello World
25
+ </div>
26
+
27
+ </div>
28
+ `;
29
+
30
+ exports[`basic client > rendering & text > renders simple JS expression logic correctly 1`] = `
31
+ <div>
32
+ <div>
33
+ {"0":"Test"}
34
+ </div>
35
+ <div>
36
+ 1
37
+ </div>
38
+
39
+ </div>
40
+ `;
41
+
42
+ exports[`basic client > rendering & text > renders static text 1`] = `
43
+ <div>
44
+ <div>
45
+ Hello World
46
+ </div>
47
+
48
+ </div>
49
+ `;
50
+
51
+ exports[`basic client > rendering & text > should handle lexical scopes correctly 1`] = `
52
+ <div>
53
+ <section>
54
+ Nested scope variable
55
+ <!---->
56
+ </section>
57
+
58
+ </div>
59
+ `;
@@ -1,5 +1,5 @@
1
1
  import { flushSync, track, untrack } from 'ripple';
2
- import { compile } from 'ripple/compiler';
2
+ import { compile } from '@tsrx/ripple';
3
3
 
4
4
  describe('basic client > errors', () => {
5
5
  it('renders with error handling simulation', () => {
@@ -182,7 +182,7 @@ describe('basic client > errors', () => {
182
182
  );
183
183
  });
184
184
 
185
- it('should throw error for await in client-side control-flow statements', () => {
185
+ it('should throw error for await inside client components', () => {
186
186
  const code = `
187
187
  export default component App() {
188
188
  let data = 'initial';
@@ -195,7 +195,7 @@ describe('basic client > errors', () => {
195
195
  `;
196
196
  expect(() => {
197
197
  compile(code, 'test.ripple', { mode: 'client' });
198
- }).toThrow('`await` is not allowed in client-side control-flow statements');
198
+ }).toThrow('`await` is not allowed inside client components');
199
199
  });
200
200
 
201
201
  it('should throw error for while loop inside a component', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('basic client > styling', () => {
4
4
  it('renders with styling scoped to component', () => {
@@ -0,0 +1,12 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`compiler > assignments > compiles tracked values in effect with assignment expression 1`] = `"state.count = _$_.get(lazy);"`;
4
+
5
+ exports[`compiler > assignments > compiles tracked values in effect with update expressions 1`] = `
6
+ "_$_.untrack(() => {
7
+ state.preIncrement = _$_.update_pre(lazy);
8
+ state.postIncrement = _$_.update(lazy);
9
+ state.preDecrement = _$_.update_pre(lazy, -1);
10
+ state.postDecrement = _$_.update(lazy, -1);
11
+ });"
12
+ `;
@@ -0,0 +1,46 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`compiler > typescript > compiles TSInstantiationExpression 1`] = `
4
+ "import * as _$_ from 'ripple/internal/client';
5
+
6
+ function makeBox(value) {
7
+ return { value };
8
+ }
9
+
10
+ const makeStringBox = (makeBox);
11
+ const stringBox = makeStringBox('abc');
12
+ const ErrorMap = (Map);
13
+ const errorMap = new ErrorMap();"
14
+ `;
15
+
16
+ exports[`compiler > typescript > removes class TypeScript syntax from JS output 1`] = `
17
+ "import * as _$_ from 'ripple/internal/client';
18
+
19
+ class PrintEvent {
20
+ text;
21
+
22
+ constructor(text) {
23
+ this.text = text;
24
+ }
25
+ }"
26
+ `;
27
+
28
+ exports[`compiler > typescript > removes class extends type arguments from JS output 1`] = `
29
+ "import * as _$_ from 'ripple/internal/client';
30
+
31
+ class StringMap extends Map {
32
+ constructor() {
33
+ var __block = _$_.scope();
34
+
35
+ super();
36
+ }
37
+ }"
38
+ `;
39
+
40
+ exports[`compiler > typescript > removes type assertions from function parameters and leaves default values 1`] = `
41
+ "import * as _$_ from 'ripple/internal/client';
42
+
43
+ function getString(e = 'test') {
44
+ return e;
45
+ }"
46
+ `;
@@ -1,5 +1,5 @@
1
1
  import { RippleArray, effect, track, untrack } from 'ripple';
2
- import { compile } from 'ripple/compiler';
2
+ import { compile } from '@tsrx/ripple';
3
3
 
4
4
  const EFFECT_BODY_REGEX = /_\$\_\.effect\(\(\) => \{([\s\S]*?)\n\t\}\);/;
5
5
 
@@ -1,4 +1,4 @@
1
- import { parse, compile } from 'ripple/compiler';
1
+ import { parse, compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('compiler > attributes', () => {
4
4
  it('generates valid JavaScript for component props with hyphenated attributes', () => {
@@ -1,5 +1,5 @@
1
- import { parse, compile, compile_to_volar_mappings } from 'ripple/compiler';
2
- import { obfuscate_identifier } from 'ripple/compiler/internal/identifier/utils';
1
+ import { parse, compile, compile_to_volar_mappings } from '@tsrx/ripple';
2
+ import { obfuscateIdentifier } from '@tsrx/core';
3
3
  import type * as AST from 'estree';
4
4
 
5
5
  function count_occurrences(string: string, subString: string): number {
@@ -59,7 +59,7 @@ describe('compiler > basics', () => {
59
59
  const explicit_text = elements[1].children[0] as AST.TextNode;
60
60
 
61
61
  expect(elements).toHaveLength(2);
62
- expect(expression.type).toBe('RippleExpression');
62
+ expect(expression.type).toBe('TSRXExpression');
63
63
  expect((expression.expression as AST.Identifier).name).toBe('markup');
64
64
  expect(explicit_text.type).toBe('Text');
65
65
  expect((explicit_text.expression as AST.Identifier).name).toBe('markup');
@@ -321,15 +321,15 @@ describe('compiler > basics', () => {
321
321
  // `;
322
322
  // const result = compile_to_volar_mappings(source, 'test.ripple').code;
323
323
 
324
- // expect(count_occurrences(result, obfuscate_identifier('RippleArray'))).toBe(2);
324
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleArray'))).toBe(2);
325
325
  // expect(count_occurrences(result, 'TA')).toBe(1);
326
- // expect(count_occurrences(result, obfuscate_identifier('RippleObject'))).toBe(2);
326
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleObject'))).toBe(2);
327
327
  // expect(count_occurrences(result, 'TO')).toBe(1);
328
- // expect(count_occurrences(result, obfuscate_identifier('RippleSet'))).toBe(2);
328
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleSet'))).toBe(2);
329
329
  // expect(count_occurrences(result, 'TS')).toBe(1);
330
- // expect(count_occurrences(result, obfuscate_identifier('RippleMap'))).toBe(2);
330
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleMap'))).toBe(2);
331
331
  // expect(count_occurrences(result, 'TM')).toBe(1);
332
- // expect(count_occurrences(result, obfuscate_identifier('createRefKey'))).toBe(2);
332
+ // expect(count_occurrences(result, obfuscateIdentifier('createRefKey'))).toBe(2);
333
333
  // expect(count_occurrences(result, 'crk')).toBe(1);
334
334
  // },
335
335
  // );
@@ -347,11 +347,11 @@ describe('compiler > basics', () => {
347
347
  // `;
348
348
  // const result = compile_to_volar_mappings(source, 'test.ripple').code;
349
349
 
350
- // expect(count_occurrences(result, obfuscate_identifier('RippleArray'))).toBe(2);
351
- // expect(count_occurrences(result, obfuscate_identifier('RippleObject'))).toBe(2);
352
- // expect(count_occurrences(result, obfuscate_identifier('RippleSet'))).toBe(2);
353
- // expect(count_occurrences(result, obfuscate_identifier('RippleMap'))).toBe(2);
354
- // expect(count_occurrences(result, obfuscate_identifier('createRefKey'))).toBe(2);
350
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleArray'))).toBe(2);
351
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleObject'))).toBe(2);
352
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleSet'))).toBe(2);
353
+ // expect(count_occurrences(result, obfuscateIdentifier('RippleMap'))).toBe(2);
354
+ // expect(count_occurrences(result, obfuscateIdentifier('createRefKey'))).toBe(2);
355
355
  // });
356
356
 
357
357
  it('prints longhand tracked property values in to_ts output while preserving [\'#v\']', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('Compiler: Tracked Object Direct Access Checks', () => {
4
4
  it('should error on direct access to __v of a tracked object', () => {
@@ -1,4 +1,4 @@
1
- import { compile_to_volar_mappings } from 'ripple/compiler';
1
+ import { compile_to_volar_mappings } from '@tsrx/ripple';
2
2
 
3
3
  function count_occurrences(string: string, sub_string: string): number {
4
4
  let count = 0;
@@ -71,22 +71,24 @@ describe('compiler > Volar transform does not duplicate try blocks from function
71
71
  });
72
72
 
73
73
  it('try at component top level is preserved', () => {
74
- const source = `export component App() {
74
+ const source = `import { trackAsync } from 'ripple';
75
+ export component App() {
75
76
  try {
76
- await fetch('/api');
77
+ let &[data] = trackAsync(() => fetch('/api'));
77
78
  } catch (e) {}
78
79
  <div>{"hi"}</div>
79
80
  }`;
80
81
  const result = compile_to_volar_mappings(source, 'test.ripple').code;
81
82
 
82
83
  expect(count_occurrences(result, 'try {')).toBe(1);
83
- expect(count_occurrences(result, 'await fetch')).toBe(1);
84
+ expect(count_occurrences(result, 'trackAsync(() => fetch(\'/api\'))')).toBe(1);
84
85
  });
85
86
 
86
87
  it('component-level try and function-level try coexist without duplication', () => {
87
- const source = `export component App() {
88
+ const source = `import { trackAsync } from 'ripple';
89
+ export component App() {
88
90
  try {
89
- await fetch('/init');
91
+ let &[data] = trackAsync(() => fetch('/init'));
90
92
  } catch (e) {}
91
93
 
92
94
  async function refresh() {
@@ -99,7 +101,7 @@ describe('compiler > Volar transform does not duplicate try blocks from function
99
101
  const result = compile_to_volar_mappings(source, 'test.ripple').code;
100
102
 
101
103
  expect(count_occurrences(result, 'try {')).toBe(2);
102
- expect(count_occurrences(result, 'await fetch(\'/init\')')).toBe(1);
104
+ expect(count_occurrences(result, 'trackAsync(() => fetch(\'/init\'))')).toBe(1);
103
105
  expect(count_occurrences(result, 'await fetch(\'/refresh\')')).toBe(1);
104
106
  });
105
107
 
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('compiler > typescript', () => {
4
4
  it('compiles TSInstantiationExpression', () => {
@@ -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
+ `;
@@ -1,5 +1,5 @@
1
1
  import { track } from 'ripple';
2
- import { compile } from 'ripple/compiler';
2
+ import { compile } from '@tsrx/ripple';
3
3
 
4
4
  describe('CSS :global additional use cases', () => {
5
5
  it('handles :global as modifier with dot notation', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with advanced selectors', () => {
4
4
  it('handles :global with ::slotted()', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with @media and @supports', () => {
4
4
  it('handles :global inside @media queries', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global basic tests', () => {
4
4
  it('applies global selector to all elements', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with classes and IDs', () => {
4
4
  it('handles :global with single class', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with combinators', () => {
4
4
  it('handles :global with child combinator', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with complex nesting', () => {
4
4
  it('handles :global block with nested selectors', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global edge cases', () => {
4
4
  it('handles multiple :global selectors in one rule', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with keyframes', () => {
4
4
  it('handles -global- prefix for keyframes', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global nested blocks', () => {
4
4
  it('handles nested global blocks', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global with pseudo-classes', () => {
4
4
  it('handles :global with :has()', () => {
@@ -1,4 +1,4 @@
1
- import { compile } from 'ripple/compiler';
1
+ import { compile } from '@tsrx/ripple';
2
2
 
3
3
  describe('CSS :global scoping verification', () => {
4
4
  it('verifies scoped styles are isolated', () => {
@@ -1,5 +1,5 @@
1
1
  import { track } from 'ripple';
2
- import { compile } from 'ripple/compiler';
2
+ import { compile } from '@tsrx/ripple';
3
3
 
4
4
  describe('#style identifier', () => {
5
5
  describe('basic usage with components', () => {
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
2
  import { mount, flushSync } from 'ripple';
3
- import { test } from './function-overload-import.ripple';
3
+ import { test } from './function-overload-import.rsrx';
4
4
 
5
5
  describe('function overload import tests', () => {
6
6
  describe('function overloads', () => {
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect } from 'vitest';
2
2
  import { flushSync, track } from 'ripple';
3
- import { compile } from 'ripple/compiler';
3
+ import { compile } from '@tsrx/ripple';
4
4
 
5
5
  describe('returns in prohibited scopes', () => {
6
6
  it('throws error when return is used in module scope', () => {