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
@@ -16,8 +16,8 @@ describe('HTML nesting validation', () => {
16
16
 
17
17
  describe('push_element and pop_element runtime', () => {
18
18
  it('does not warn for valid nesting', () => {
19
- push_element('div', 'test.ripple', 1, 0);
20
- push_element('span', 'test.ripple', 2, 0);
19
+ push_element('div', 'test.tsrx', 1, 0);
20
+ push_element('span', 'test.tsrx', 2, 0);
21
21
  pop_element();
22
22
  pop_element();
23
23
 
@@ -25,8 +25,8 @@ describe('HTML nesting validation', () => {
25
25
  });
26
26
 
27
27
  it('warns when button is nested inside button', () => {
28
- push_element('button', 'test.ripple', 1, 0);
29
- push_element('button', 'test.ripple', 2, 0);
28
+ push_element('button', 'test.tsrx', 1, 0);
29
+ push_element('button', 'test.tsrx', 2, 0);
30
30
  pop_element();
31
31
  pop_element();
32
32
 
@@ -37,8 +37,8 @@ describe('HTML nesting validation', () => {
37
37
  });
38
38
 
39
39
  it('warns when a is nested inside a', () => {
40
- push_element('a', 'test.ripple', 1, 0);
41
- push_element('a', 'test.ripple', 2, 0);
40
+ push_element('a', 'test.tsrx', 1, 0);
41
+ push_element('a', 'test.tsrx', 2, 0);
42
42
  pop_element();
43
43
  pop_element();
44
44
 
@@ -48,8 +48,8 @@ describe('HTML nesting validation', () => {
48
48
  });
49
49
 
50
50
  it('warns when div is inside p', () => {
51
- push_element('p', 'test.ripple', 1, 0);
52
- push_element('div', 'test.ripple', 2, 0);
51
+ push_element('p', 'test.tsrx', 1, 0);
52
+ push_element('div', 'test.tsrx', 2, 0);
53
53
  pop_element();
54
54
  pop_element();
55
55
 
@@ -60,8 +60,8 @@ describe('HTML nesting validation', () => {
60
60
  });
61
61
 
62
62
  it('warns when heading is nested inside heading', () => {
63
- push_element('h1', 'test.ripple', 1, 0);
64
- push_element('h2', 'test.ripple', 2, 0);
63
+ push_element('h1', 'test.tsrx', 1, 0);
64
+ push_element('h2', 'test.tsrx', 2, 0);
65
65
  pop_element();
66
66
  pop_element();
67
67
 
@@ -72,8 +72,8 @@ describe('HTML nesting validation', () => {
72
72
  });
73
73
 
74
74
  it('warns when form is nested inside form', () => {
75
- push_element('form', 'test.ripple', 1, 0);
76
- push_element('form', 'test.ripple', 2, 0);
75
+ push_element('form', 'test.tsrx', 1, 0);
76
+ push_element('form', 'test.tsrx', 2, 0);
77
77
  pop_element();
78
78
  pop_element();
79
79
 
@@ -83,8 +83,8 @@ describe('HTML nesting validation', () => {
83
83
  });
84
84
 
85
85
  it('warns when td is not child of tr', () => {
86
- push_element('div', 'test.ripple', 1, 0);
87
- push_element('td', 'test.ripple', 2, 0);
86
+ push_element('div', 'test.tsrx', 1, 0);
87
+ push_element('td', 'test.tsrx', 2, 0);
88
88
  pop_element();
89
89
  pop_element();
90
90
 
@@ -95,8 +95,8 @@ describe('HTML nesting validation', () => {
95
95
  });
96
96
 
97
97
  it('warns when tr is not child of thead or tbody or tfoot', () => {
98
- push_element('div', 'test.ripple', 1, 0);
99
- push_element('tr', 'test.ripple', 2, 0);
98
+ push_element('div', 'test.tsrx', 1, 0);
99
+ push_element('tr', 'test.tsrx', 2, 0);
100
100
  pop_element();
101
101
  pop_element();
102
102
 
@@ -106,13 +106,13 @@ describe('HTML nesting validation', () => {
106
106
  });
107
107
 
108
108
  it('deduplicates warnings for the same message', () => {
109
- push_element('button', 'test.ripple', 1, 0);
110
- push_element('button', 'test.ripple', 2, 0);
109
+ push_element('button', 'test.tsrx', 1, 0);
110
+ push_element('button', 'test.tsrx', 2, 0);
111
111
  pop_element();
112
112
  pop_element();
113
113
 
114
- push_element('button', 'test.ripple', 1, 0);
115
- push_element('button', 'test.ripple', 2, 0);
114
+ push_element('button', 'test.tsrx', 1, 0);
115
+ push_element('button', 'test.tsrx', 2, 0);
116
116
  pop_element();
117
117
  pop_element();
118
118
 
@@ -120,20 +120,20 @@ describe('HTML nesting validation', () => {
120
120
  });
121
121
 
122
122
  it('includes location information in warning', () => {
123
- push_element('button', 'App.ripple', 5, 2);
124
- push_element('button', 'App.ripple', 10, 4);
123
+ push_element('button', 'App.tsrx', 5, 2);
124
+ push_element('button', 'App.tsrx', 10, 4);
125
125
  pop_element();
126
126
  pop_element();
127
127
 
128
128
  expect(consoleErrorSpy).toHaveBeenCalledTimes(1);
129
129
  const msg = consoleErrorSpy.mock.calls[0][0];
130
- expect(msg).toContain('App.ripple:10:4');
131
- expect(msg).toContain('App.ripple:5:2');
130
+ expect(msg).toContain('App.tsrx:10:4');
131
+ expect(msg).toContain('App.tsrx:5:2');
132
132
  });
133
133
 
134
134
  it('does not warn for custom elements', () => {
135
- push_element('my-button', 'test.ripple', 1, 0);
136
- push_element('my-button', 'test.ripple', 2, 0);
135
+ push_element('my-button', 'test.tsrx', 1, 0);
136
+ push_element('my-button', 'test.tsrx', 2, 0);
137
137
  pop_element();
138
138
  pop_element();
139
139
 
@@ -141,10 +141,10 @@ describe('HTML nesting validation', () => {
141
141
  });
142
142
 
143
143
  it('validates ancestor nesting (button deep inside button)', () => {
144
- push_element('button', 'test.ripple', 1, 0);
145
- push_element('div', 'test.ripple', 2, 0);
146
- push_element('span', 'test.ripple', 3, 0);
147
- push_element('button', 'test.ripple', 4, 0);
144
+ push_element('button', 'test.tsrx', 1, 0);
145
+ push_element('div', 'test.tsrx', 2, 0);
146
+ push_element('span', 'test.tsrx', 3, 0);
147
+ push_element('button', 'test.tsrx', 4, 0);
148
148
  pop_element();
149
149
  pop_element();
150
150
  pop_element();
@@ -156,8 +156,8 @@ describe('HTML nesting validation', () => {
156
156
  });
157
157
 
158
158
  it('warns when li is direct child of another li', () => {
159
- push_element('li', 'test.ripple', 1, 0);
160
- push_element('li', 'test.ripple', 2, 0);
159
+ push_element('li', 'test.tsrx', 1, 0);
160
+ push_element('li', 'test.tsrx', 2, 0);
161
161
  pop_element();
162
162
  pop_element();
163
163
 
@@ -167,8 +167,8 @@ describe('HTML nesting validation', () => {
167
167
  });
168
168
 
169
169
  it('includes hydration mismatch warning text', () => {
170
- push_element('p', 'test.ripple', 1, 0);
171
- push_element('div', 'test.ripple', 2, 0);
170
+ push_element('p', 'test.tsrx', 1, 0);
171
+ push_element('div', 'test.tsrx', 2, 0);
172
172
  pop_element();
173
173
  pop_element();
174
174
 
@@ -187,7 +187,7 @@ describe('HTML nesting validation', () => {
187
187
  lines.push('}');
188
188
  const source = lines.join('\n');
189
189
 
190
- const result = compile(source, 'test.ripple', { mode: 'server', dev: true });
190
+ const result = compile(source, 'test.tsrx', { mode: 'server', dev: true });
191
191
 
192
192
  expect(result.js.code).toContain('_$_.push_element');
193
193
  expect(result.js.code).toContain('_$_.pop_element');
@@ -202,7 +202,7 @@ describe('HTML nesting validation', () => {
202
202
  lines.push('}');
203
203
  const source = lines.join('\n');
204
204
 
205
- const result = compile(source, 'test.ripple', { mode: 'server', dev: false });
205
+ const result = compile(source, 'test.tsrx', { mode: 'server', dev: false });
206
206
 
207
207
  expect(result.js.code).not.toContain('push_element');
208
208
  expect(result.js.code).not.toContain('pop_element');
@@ -215,7 +215,7 @@ describe('HTML nesting validation', () => {
215
215
  lines.push('}');
216
216
  const source = lines.join('\n');
217
217
 
218
- const result = compile(source, 'test.ripple', { mode: 'server', dev: true });
218
+ const result = compile(source, 'test.tsrx', { mode: 'server', dev: true });
219
219
 
220
220
  expect(result.js.code).toContain('_$_.push_element(\'button\'');
221
221
  });
@@ -227,7 +227,7 @@ describe('HTML nesting validation', () => {
227
227
  lines.push('}');
228
228
  const source = lines.join('\n');
229
229
 
230
- const result = compile(source, 'test.ripple', { mode: 'client', dev: true });
230
+ const result = compile(source, 'test.tsrx', { mode: 'client', dev: true });
231
231
 
232
232
  expect(result.js.code).not.toContain('push_element');
233
233
  });
@@ -277,7 +277,7 @@ export component App() {
277
277
  }
278
278
  </style>
279
279
  }`;
280
- const { js } = compile(source, 'test.ripple', { mode: 'server' });
280
+ const { js } = compile(source, 'test.tsrx', { mode: 'server' });
281
281
 
282
282
  expect(js.code).toContain('highlight');
283
283
  expect(js.code).toMatch(/ripple-[a-z0-9]+/);
@@ -12,7 +12,7 @@ component App() {
12
12
  describe('compiler tsx compat configuration', () => {
13
13
  it('allows tsx compat when no compat config is provided', () => {
14
14
  expect(() =>
15
- compile(source, '/src/App.rsrx', {
15
+ compile(source, '/src/App.tsrx', {
16
16
  mode: 'client',
17
17
  }),
18
18
  ).not.toThrow();
@@ -20,7 +20,7 @@ describe('compiler tsx compat configuration', () => {
20
20
 
21
21
  it('throws when tsx compat kind is not configured', () => {
22
22
  expect(() =>
23
- compile(source, '/src/App.rsrx', {
23
+ compile(source, '/src/App.tsrx', {
24
24
  mode: 'client',
25
25
  compat_kinds: [],
26
26
  }),
@@ -29,7 +29,7 @@ describe('compiler tsx compat configuration', () => {
29
29
 
30
30
  it('allows tsx compat kinds that are configured', () => {
31
31
  expect(() =>
32
- compile(source, '/src/App.rsrx', {
32
+ compile(source, '/src/App.tsrx', {
33
33
  mode: 'client',
34
34
  compat_kinds: ['react'],
35
35
  }),
@@ -32,7 +32,7 @@ describe('vite-plugin-ripple config resolution', () => {
32
32
  routes: [
33
33
  new RenderRoute({
34
34
  path: '/',
35
- entry: '/src/App.rsrx',
35
+ entry: '/src/App.tsrx',
36
36
  }),
37
37
  ],
38
38
  },
@@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest';
2
2
  import { ripple } from '@ripple-ts/vite-plugin';
3
3
 
4
4
  describe('vite-plugin-ripple hotUpdate', () => {
5
- it('invalidates SSR modules for non-self-accepting .ripple files', async () => {
5
+ it('invalidates SSR modules for non-self-accepting .tsrx files', async () => {
6
6
  const [plugin] = ripple({ excludeRippleExternalModules: true });
7
7
  await plugin.configResolved?.({ root: '/workspace', command: 'serve' });
8
8
 
@@ -28,7 +28,7 @@ describe('vite-plugin-ripple hotUpdate', () => {
28
28
  },
29
29
  },
30
30
  {
31
- file: '/workspace/src/non-component.rsrx',
31
+ file: '/workspace/src/non-component.tsrx',
32
32
  modules: [{ id: 'client:non-component', isSelfAccepting: false }],
33
33
  server: {
34
34
  environments: {
@@ -43,14 +43,14 @@ describe('vite-plugin-ripple hotUpdate', () => {
43
43
  },
44
44
  );
45
45
 
46
- expect(transform_request).toHaveBeenCalledWith('/src/non-component.rsrx');
47
- expect(get_ssr_modules).toHaveBeenCalledWith('/workspace/src/non-component.rsrx');
46
+ expect(transform_request).toHaveBeenCalledWith('/src/non-component.tsrx');
47
+ expect(get_ssr_modules).toHaveBeenCalledWith('/workspace/src/non-component.tsrx');
48
48
  expect(invalidate_ssr_module).toHaveBeenCalledTimes(2);
49
49
  expect(send_hot_update).toHaveBeenCalledWith({ type: 'full-reload' });
50
50
  expect(result).toEqual([]);
51
51
  });
52
52
 
53
- it('keeps self-accepting .ripple files on Vite HMR path', async () => {
53
+ it('keeps self-accepting .tsrx files on Vite HMR path', async () => {
54
54
  const [plugin] = ripple({ excludeRippleExternalModules: true });
55
55
  await plugin.configResolved?.({ root: '/workspace', command: 'serve' });
56
56
 
@@ -74,7 +74,7 @@ describe('vite-plugin-ripple hotUpdate', () => {
74
74
  },
75
75
  },
76
76
  {
77
- file: '/workspace/src/component.rsrx',
77
+ file: '/workspace/src/component.tsrx',
78
78
  modules: [{ id: 'client:component', isSelfAccepting: true }],
79
79
  server: {
80
80
  environments: {
@@ -89,7 +89,7 @@ describe('vite-plugin-ripple hotUpdate', () => {
89
89
  },
90
90
  );
91
91
 
92
- expect(transform_request).toHaveBeenCalledWith('/src/component.rsrx');
92
+ expect(transform_request).toHaveBeenCalledWith('/src/component.tsrx');
93
93
  expect(get_ssr_modules).not.toHaveBeenCalled();
94
94
  expect(invalidate_ssr_module).not.toHaveBeenCalled();
95
95
  expect(send_hot_update).not.toHaveBeenCalled();
package/tsconfig.json CHANGED
@@ -25,11 +25,7 @@
25
25
  "include": [
26
26
  "./*.js",
27
27
  "./src/",
28
- "./tests/**/*.test.ripple",
29
- "./tests/**/*.test.rsrx",
30
28
  "./tests/**/*.test.tsrx",
31
- "./tests/**/*.ripple",
32
- "./tests/**/*.rsrx",
33
29
  "./tests/**/*.tsrx",
34
30
  "./tests/**/*.d.ts",
35
31
  "./tests/**/*.js"
package/types/index.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  export type Component<T = Record<string, any>> = (props: T) => void;
2
2
 
3
- declare const RIPPLE_ELEMENT: unique symbol;
3
+ declare const TSRX_ELEMENT: unique symbol;
4
4
 
5
- export type RippleElement = {
5
+ export type TSRXElement = {
6
6
  readonly render: Function;
7
- readonly [RIPPLE_ELEMENT]: true;
7
+ readonly [TSRX_ELEMENT]: true;
8
8
  };
9
9
 
10
10
  /** Type for implicit children fragments rendered with `{children}`. */
11
- export type Children = RippleElement | Component | string | number | boolean | null | undefined;
11
+ export type Children = TSRXElement | Component | string | number | boolean | null | undefined;
12
+
13
+ export function tsrx_element(render: Function): TSRXElement;
12
14
 
13
15
  export function mount(
14
16
  component: Component,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes