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.
- package/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/runtime/element.js +11 -11
- package/src/runtime/internal/client/composite.js +2 -2
- package/src/runtime/internal/client/expression.js +5 -5
- package/src/runtime/internal/client/index.js +1 -1
- package/src/runtime/internal/client/portal.js +4 -4
- package/src/runtime/internal/server/index.js +4 -4
- package/tests/client/__snapshots__/computed-properties.test.tsrx.snap +49 -0
- package/tests/client/__snapshots__/for.test.tsrx.snap +319 -0
- package/tests/client/__snapshots__/html.test.tsrx.snap +40 -0
- package/tests/client/basic/__snapshots__/basic.attributes.test.tsrx.snap +60 -0
- package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +59 -0
- package/tests/client/basic/{basic.components.test.rsrx → basic.components.test.tsrx} +51 -1
- package/tests/client/basic/{basic.errors.test.rsrx → basic.errors.test.tsrx} +12 -12
- package/tests/client/basic/{basic.styling.test.rsrx → basic.styling.test.tsrx} +1 -1
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +12 -0
- package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +46 -0
- package/tests/client/compiler/{compiler.assignments.test.rsrx → compiler.assignments.test.tsrx} +2 -2
- package/tests/client/compiler/{compiler.attributes.test.rsrx → compiler.attributes.test.tsrx} +4 -4
- package/tests/client/compiler/{compiler.basic.test.rsrx → compiler.basic.test.tsrx} +44 -30
- package/tests/client/compiler/{compiler.tracked-access.test.rsrx → compiler.tracked-access.test.tsrx} +16 -16
- package/tests/client/compiler/{compiler.try-in-function.test.rsrx → compiler.try-in-function.test.tsrx} +8 -8
- package/tests/client/compiler/{compiler.typescript.test.rsrx → compiler.typescript.test.tsrx} +4 -4
- package/tests/client/composite/__snapshots__/composite.render.test.tsrx.snap +37 -0
- package/tests/client/css/{global-additional-cases.test.rsrx → global-additional-cases.test.tsrx} +27 -27
- package/tests/client/css/{global-advanced-selectors.test.rsrx → global-advanced-selectors.test.tsrx} +8 -8
- package/tests/client/css/{global-at-rules.test.rsrx → global-at-rules.test.tsrx} +5 -5
- package/tests/client/css/{global-basic.test.rsrx → global-basic.test.tsrx} +7 -7
- package/tests/client/css/{global-classes-ids.test.rsrx → global-classes-ids.test.tsrx} +7 -7
- package/tests/client/css/{global-combinators.test.rsrx → global-combinators.test.tsrx} +5 -5
- package/tests/client/css/{global-complex-nesting.test.rsrx → global-complex-nesting.test.tsrx} +7 -7
- package/tests/client/css/{global-edge-cases.test.rsrx → global-edge-cases.test.tsrx} +9 -9
- package/tests/client/css/{global-keyframes.test.rsrx → global-keyframes.test.tsrx} +5 -5
- package/tests/client/css/{global-nested.test.rsrx → global-nested.test.tsrx} +5 -5
- package/tests/client/css/{global-pseudo.test.rsrx → global-pseudo.test.tsrx} +6 -6
- package/tests/client/css/{global-scoping.test.rsrx → global-scoping.test.tsrx} +10 -10
- package/tests/client/css/{style-identifier.test.rsrx → style-identifier.test.tsrx} +12 -16
- package/tests/client/{function-overload.test.rsrx → function-overload.test.tsrx} +1 -1
- package/tests/client/{return.test.rsrx → return.test.tsrx} +16 -18
- package/tests/hydration/build-components.js +2 -4
- package/tests/hydration/compiled/client/basic.js +1 -1
- package/tests/hydration/compiled/client/composite.js +4 -4
- package/tests/hydration/compiled/client/head.js +11 -11
- package/tests/hydration/compiled/client/hmr.js +1 -1
- package/tests/hydration/compiled/client/html.js +19 -19
- package/tests/hydration/compiled/client/if-children.js +2 -2
- package/tests/hydration/compiled/client/portal.js +4 -4
- package/tests/hydration/compiled/server/basic.js +1 -1
- package/tests/hydration/compiled/server/composite.js +4 -4
- package/tests/hydration/compiled/server/head.js +11 -11
- package/tests/hydration/compiled/server/hmr.js +1 -1
- package/tests/hydration/compiled/server/html.js +19 -19
- package/tests/hydration/compiled/server/if-children.js +2 -2
- package/tests/hydration/compiled/server/portal.js +4 -4
- package/tests/hydration/components/{html-in-template.rsrx → html-in-template.tsrx} +1 -1
- package/tests/server/__snapshots__/compiler.test.tsrx.snap +95 -0
- package/tests/server/{basic.components.test.rsrx → basic.components.test.tsrx} +48 -0
- package/tests/server/{compiler.test.rsrx → compiler.test.tsrx} +17 -17
- package/tests/server/{html-nesting-validation.test.rsrx → html-nesting-validation.test.tsrx} +38 -38
- package/tests/server/{style-identifier.test.rsrx → style-identifier.test.tsrx} +1 -1
- package/tests/utils/compiler-compat-config.test.js +3 -3
- package/tests/utils/vite-plugin-config.test.js +1 -1
- package/tests/utils/vite-plugin-hmr.test.js +7 -7
- package/tsconfig.json +0 -4
- package/types/index.d.ts +6 -4
- /package/tests/client/{_etc.test.rsrx → _etc.test.tsrx} +0 -0
- /package/tests/client/array/{array.copy-within.test.rsrx → array.copy-within.test.tsrx} +0 -0
- /package/tests/client/array/{array.derived.test.rsrx → array.derived.test.tsrx} +0 -0
- /package/tests/client/array/{array.iteration.test.rsrx → array.iteration.test.tsrx} +0 -0
- /package/tests/client/array/{array.mutations.test.rsrx → array.mutations.test.tsrx} +0 -0
- /package/tests/client/array/{array.static.test.rsrx → array.static.test.tsrx} +0 -0
- /package/tests/client/array/{array.to-methods.test.rsrx → array.to-methods.test.tsrx} +0 -0
- /package/tests/client/{async-suspend.test.rsrx → async-suspend.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.collections.test.rsrx → basic.collections.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.events.test.rsrx → basic.events.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.get-set.test.rsrx → basic.get-set.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.hmr.test.rsrx → basic.hmr.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.reactivity.test.rsrx → basic.reactivity.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.rendering.test.rsrx → basic.rendering.test.tsrx} +0 -0
- /package/tests/client/basic/{basic.utilities.test.rsrx → basic.utilities.test.tsrx} +0 -0
- /package/tests/client/{boundaries.test.rsrx → boundaries.test.tsrx} +0 -0
- /package/tests/client/compiler/{compiler.regex.test.rsrx → compiler.regex.test.tsrx} +0 -0
- /package/tests/client/composite/{composite.dynamic-components.test.rsrx → composite.dynamic-components.test.tsrx} +0 -0
- /package/tests/client/composite/{composite.generics.test.rsrx → composite.generics.test.tsrx} +0 -0
- /package/tests/client/composite/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
- /package/tests/client/composite/{composite.reactivity.test.rsrx → composite.reactivity.test.tsrx} +0 -0
- /package/tests/client/composite/{composite.render.test.rsrx → composite.render.test.tsrx} +0 -0
- /package/tests/client/{computed-properties.test.rsrx → computed-properties.test.tsrx} +0 -0
- /package/tests/client/{context.test.rsrx → context.test.tsrx} +0 -0
- /package/tests/client/{date.test.rsrx → date.test.tsrx} +0 -0
- /package/tests/client/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
- /package/tests/client/{events.test.rsrx → events.test.tsrx} +0 -0
- /package/tests/client/{for.test.rsrx → for.test.tsrx} +0 -0
- /package/tests/client/{function-overload-import.rsrx → function-overload-import.tsrx} +0 -0
- /package/tests/client/{head.test.rsrx → head.test.tsrx} +0 -0
- /package/tests/client/{html.test.rsrx → html.test.tsrx} +0 -0
- /package/tests/client/{input-value.test.rsrx → input-value.test.tsrx} +0 -0
- /package/tests/client/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
- /package/tests/client/{map.test.rsrx → map.test.tsrx} +0 -0
- /package/tests/client/{media-query.test.rsrx → media-query.test.tsrx} +0 -0
- /package/tests/client/{object.test.rsrx → object.test.tsrx} +0 -0
- /package/tests/client/{portal.test.rsrx → portal.test.tsrx} +0 -0
- /package/tests/client/{ref.test.rsrx → ref.test.tsrx} +0 -0
- /package/tests/client/{set.test.rsrx → set.test.tsrx} +0 -0
- /package/tests/client/{svg.test.rsrx → svg.test.tsrx} +0 -0
- /package/tests/client/{switch.test.rsrx → switch.test.tsrx} +0 -0
- /package/tests/client/{try.test.rsrx → try.test.tsrx} +0 -0
- /package/tests/client/{tsx.test.rsrx → tsx.test.tsrx} +0 -0
- /package/tests/client/{typescript-generics.test.rsrx → typescript-generics.test.tsrx} +0 -0
- /package/tests/client/url/{url.derived.test.rsrx → url.derived.test.tsrx} +0 -0
- /package/tests/client/url/{url.parsing.test.rsrx → url.parsing.test.tsrx} +0 -0
- /package/tests/client/url/{url.partial-removal.test.rsrx → url.partial-removal.test.tsrx} +0 -0
- /package/tests/client/url/{url.reactivity.test.rsrx → url.reactivity.test.tsrx} +0 -0
- /package/tests/client/url/{url.serialization.test.rsrx → url.serialization.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.derived.test.rsrx → url-search-params.derived.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.initialization.test.rsrx → url-search-params.initialization.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.iteration.test.rsrx → url-search-params.iteration.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.mutation.test.rsrx → url-search-params.mutation.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.retrieval.test.rsrx → url-search-params.retrieval.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.serialization.test.rsrx → url-search-params.serialization.test.tsrx} +0 -0
- /package/tests/client/url-search-params/{url-search-params.tracked-url.test.rsrx → url-search-params.tracked-url.test.tsrx} +0 -0
- /package/tests/hydration/components/{basic.rsrx → basic.tsrx} +0 -0
- /package/tests/hydration/components/{composite.rsrx → composite.tsrx} +0 -0
- /package/tests/hydration/components/{events.rsrx → events.tsrx} +0 -0
- /package/tests/hydration/components/{for.rsrx → for.tsrx} +0 -0
- /package/tests/hydration/components/{head.rsrx → head.tsrx} +0 -0
- /package/tests/hydration/components/{hmr.rsrx → hmr.tsrx} +0 -0
- /package/tests/hydration/components/{html.rsrx → html.tsrx} +0 -0
- /package/tests/hydration/components/{if-children.rsrx → if-children.tsrx} +0 -0
- /package/tests/hydration/components/{if.rsrx → if.tsrx} +0 -0
- /package/tests/hydration/components/{mixed-control-flow.rsrx → mixed-control-flow.tsrx} +0 -0
- /package/tests/hydration/components/{nested-control-flow.rsrx → nested-control-flow.tsrx} +0 -0
- /package/tests/hydration/components/{portal.rsrx → portal.tsrx} +0 -0
- /package/tests/hydration/components/{reactivity.rsrx → reactivity.tsrx} +0 -0
- /package/tests/hydration/components/{return.rsrx → return.tsrx} +0 -0
- /package/tests/hydration/components/{switch.rsrx → switch.tsrx} +0 -0
- /package/tests/hydration/components/{try.rsrx → try.tsrx} +0 -0
- /package/tests/server/{await.test.rsrx → await.test.tsrx} +0 -0
- /package/tests/server/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
- /package/tests/server/{basic.test.rsrx → basic.test.tsrx} +0 -0
- /package/tests/server/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
- /package/tests/server/{composite.test.rsrx → composite.test.tsrx} +0 -0
- /package/tests/server/{context.test.rsrx → context.test.tsrx} +0 -0
- /package/tests/server/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
- /package/tests/server/{for.test.rsrx → for.test.tsrx} +0 -0
- /package/tests/server/{head.test.rsrx → head.test.tsrx} +0 -0
- /package/tests/server/{if.test.rsrx → if.test.tsrx} +0 -0
- /package/tests/server/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
- /package/tests/server/{return.test.rsrx → return.test.tsrx} +0 -0
- /package/tests/server/{streaming-ssr.test.rsrx → streaming-ssr.test.tsrx} +0 -0
- /package/tests/server/{switch.test.rsrx → switch.test.tsrx} +0 -0
- /package/tests/server/{try.test.rsrx → try.test.tsrx} +0 -0
package/tests/server/{html-nesting-validation.test.rsrx → html-nesting-validation.test.tsrx}
RENAMED
|
@@ -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.
|
|
20
|
-
push_element('span', 'test.
|
|
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.
|
|
29
|
-
push_element('button', 'test.
|
|
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.
|
|
41
|
-
push_element('a', 'test.
|
|
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.
|
|
52
|
-
push_element('div', 'test.
|
|
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.
|
|
64
|
-
push_element('h2', 'test.
|
|
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.
|
|
76
|
-
push_element('form', 'test.
|
|
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.
|
|
87
|
-
push_element('td', 'test.
|
|
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.
|
|
99
|
-
push_element('tr', 'test.
|
|
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.
|
|
110
|
-
push_element('button', 'test.
|
|
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.
|
|
115
|
-
push_element('button', 'test.
|
|
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.
|
|
124
|
-
push_element('button', 'App.
|
|
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.
|
|
131
|
-
expect(msg).toContain('App.
|
|
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.
|
|
136
|
-
push_element('my-button', 'test.
|
|
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.
|
|
145
|
-
push_element('div', 'test.
|
|
146
|
-
push_element('span', 'test.
|
|
147
|
-
push_element('button', 'test.
|
|
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.
|
|
160
|
-
push_element('li', 'test.
|
|
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.
|
|
171
|
-
push_element('div', 'test.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
32
|
+
compile(source, '/src/App.tsrx', {
|
|
33
33
|
mode: 'client',
|
|
34
34
|
compat_kinds: ['react'],
|
|
35
35
|
}),
|
|
@@ -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 .
|
|
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.
|
|
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.
|
|
47
|
-
expect(get_ssr_modules).toHaveBeenCalledWith('/workspace/src/non-component.
|
|
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 .
|
|
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.
|
|
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.
|
|
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
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
|
|
3
|
+
declare const TSRX_ELEMENT: unique symbol;
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type TSRXElement = {
|
|
6
6
|
readonly render: Function;
|
|
7
|
-
readonly [
|
|
7
|
+
readonly [TSRX_ELEMENT]: true;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
/** Type for implicit children fragments rendered with `{children}`. */
|
|
11
|
-
export type Children =
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/tests/client/composite/{composite.generics.test.rsrx → composite.generics.test.tsrx}
RENAMED
|
File without changes
|
|
File without changes
|
/package/tests/client/composite/{composite.reactivity.test.rsrx → composite.reactivity.test.tsrx}
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|