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
|
@@ -12,7 +12,7 @@ export component Test() {
|
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
14
|
}`;
|
|
15
|
-
const { css } = compile(source, 'test.
|
|
15
|
+
const { css } = compile(source, 'test.tsrx');
|
|
16
16
|
|
|
17
17
|
expect(css).toContain('.foo {');
|
|
18
18
|
expect(css).not.toMatch(/\.foo\.ripple-[a-z0-9]+/);
|
|
@@ -37,7 +37,7 @@ export component Test() {
|
|
|
37
37
|
}
|
|
38
38
|
</style>
|
|
39
39
|
}`;
|
|
40
|
-
const { css } = compile(source, 'test.
|
|
40
|
+
const { css } = compile(source, 'test.tsrx');
|
|
41
41
|
|
|
42
42
|
expect(css).toContain('.foo.bar {');
|
|
43
43
|
expect(css).toMatch(/\.foo\.bar\.ripple-[a-z0-9]+ {/);
|
|
@@ -61,7 +61,7 @@ export component Test() {
|
|
|
61
61
|
}
|
|
62
62
|
</style>
|
|
63
63
|
}`;
|
|
64
|
-
const { css } = compile(source, 'test.
|
|
64
|
+
const { css } = compile(source, 'test.tsrx');
|
|
65
65
|
|
|
66
66
|
expect(css).toMatch(/\.outer \.inner\.ripple-[a-z0-9]+ {/);
|
|
67
67
|
expect(css).toMatch(/\(unused\) :global\(div\) \.foo {/);
|
|
@@ -88,7 +88,7 @@ export component Test() {
|
|
|
88
88
|
}
|
|
89
89
|
</style>
|
|
90
90
|
}`;
|
|
91
|
-
const { css } = compile(source, 'test.
|
|
91
|
+
const { css } = compile(source, 'test.tsrx');
|
|
92
92
|
|
|
93
93
|
expect(css).toContain('#app {');
|
|
94
94
|
expect(css).not.toContain('#app #content {');
|
|
@@ -115,7 +115,7 @@ export component Test() {
|
|
|
115
115
|
}
|
|
116
116
|
</style>
|
|
117
117
|
}`;
|
|
118
|
-
const { css } = compile(source, 'test.
|
|
118
|
+
const { css } = compile(source, 'test.tsrx');
|
|
119
119
|
|
|
120
120
|
expect(css).toContain('#app.container {');
|
|
121
121
|
expect(css).toMatch(/\.container#app\.ripple-[a-z0-9]+ {/);
|
|
@@ -141,7 +141,7 @@ export component Test() {
|
|
|
141
141
|
}
|
|
142
142
|
</style>
|
|
143
143
|
}`;
|
|
144
|
-
const { css } = compile(source, 'test.
|
|
144
|
+
const { css } = compile(source, 'test.tsrx');
|
|
145
145
|
|
|
146
146
|
expect((css.match(/\.a\.b\.c\.ripple-[a-z0-9]+ {/g) || []).length).toBe(2);
|
|
147
147
|
expect(css).toMatch(/\.a\.b\.ripple-[a-z0-9]+\.c {/);
|
|
@@ -170,7 +170,7 @@ export component Test() {
|
|
|
170
170
|
}
|
|
171
171
|
</style>
|
|
172
172
|
}`;
|
|
173
|
-
const { css } = compile(source, 'test.
|
|
173
|
+
const { css } = compile(source, 'test.tsrx');
|
|
174
174
|
|
|
175
175
|
expect(css).toMatch(/\.outer \.middle\.ripple-[a-z0-9]+ \.inner:where\(\.ripple-[a-z0-9]+\)/);
|
|
176
176
|
expect(css).toMatch(/\.outer\.ripple-[a-z0-9]+ \.middle \.inner {/);
|
|
@@ -14,7 +14,7 @@ export component Test() {
|
|
|
14
14
|
}
|
|
15
15
|
</style>
|
|
16
16
|
}`;
|
|
17
|
-
const { css } = compile(source, 'test.
|
|
17
|
+
const { css } = compile(source, 'test.tsrx');
|
|
18
18
|
|
|
19
19
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ > span {/);
|
|
20
20
|
expect(css).not.toMatch(/span\.ripple-[a-z0-9]+/);
|
|
@@ -38,7 +38,7 @@ export component Test() {
|
|
|
38
38
|
}
|
|
39
39
|
</style>
|
|
40
40
|
}`;
|
|
41
|
-
const { css } = compile(source, 'test.
|
|
41
|
+
const { css } = compile(source, 'test.tsrx');
|
|
42
42
|
|
|
43
43
|
expect(css).toMatch(/span\.ripple-[a-z0-9]+ \+ span {/);
|
|
44
44
|
expect(css).toContain('(unused) :global(div) + span {');
|
|
@@ -62,7 +62,7 @@ export component Test() {
|
|
|
62
62
|
}
|
|
63
63
|
</style>
|
|
64
64
|
}`;
|
|
65
|
-
const { css } = compile(source, 'test.
|
|
65
|
+
const { css } = compile(source, 'test.tsrx');
|
|
66
66
|
|
|
67
67
|
expect(css).toContain('~');
|
|
68
68
|
|
|
@@ -90,7 +90,7 @@ export component Test() {
|
|
|
90
90
|
}
|
|
91
91
|
</style>
|
|
92
92
|
}`;
|
|
93
|
-
const { css } = compile(source, 'test.
|
|
93
|
+
const { css } = compile(source, 'test.tsrx');
|
|
94
94
|
|
|
95
95
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ > span > button {/);
|
|
96
96
|
expect(css).toMatch(/div > span\.ripple-[a-z0-9]+ \+ button:where\(\.ripple-[a-z0-9]+\) {/);
|
|
@@ -116,7 +116,7 @@ export component Test() {
|
|
|
116
116
|
</style>
|
|
117
117
|
}`;
|
|
118
118
|
|
|
119
|
-
const { css } = compile(source, 'test.
|
|
119
|
+
const { css } = compile(source, 'test.tsrx');
|
|
120
120
|
|
|
121
121
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ span button {/);
|
|
122
122
|
expect(css).toMatch(/div span\.ripple-[a-z0-9]+ button:where\(\.ripple-[a-z0-9]+\) {/);
|
package/tests/client/css/{global-complex-nesting.test.rsrx → global-complex-nesting.test.tsrx}
RENAMED
|
@@ -24,7 +24,7 @@ export component Test() {
|
|
|
24
24
|
}
|
|
25
25
|
</style>
|
|
26
26
|
}`;
|
|
27
|
-
const { css } = compile(source, 'test.
|
|
27
|
+
const { css } = compile(source, 'test.tsrx');
|
|
28
28
|
|
|
29
29
|
expect(css).not.toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
30
30
|
expect(css).not.toMatch(/span\.ripple-[a-z0-9]+ {/);
|
|
@@ -52,7 +52,7 @@ export component Test() {
|
|
|
52
52
|
}
|
|
53
53
|
</style>
|
|
54
54
|
}`;
|
|
55
|
-
const { css } = compile(source, 'test.
|
|
55
|
+
const { css } = compile(source, 'test.tsrx');
|
|
56
56
|
|
|
57
57
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
58
58
|
expect(css).not.toMatch(/span\.ripple-[a-z0-9]+ {/);
|
|
@@ -78,7 +78,7 @@ export component Test() {
|
|
|
78
78
|
}
|
|
79
79
|
</style>
|
|
80
80
|
}`;
|
|
81
|
-
const { css } = compile(source, 'test.
|
|
81
|
+
const { css } = compile(source, 'test.tsrx');
|
|
82
82
|
|
|
83
83
|
expect(css).toContain('div {');
|
|
84
84
|
expect(css).toContain('.local {');
|
|
@@ -109,7 +109,7 @@ export component Test() {
|
|
|
109
109
|
}
|
|
110
110
|
</style>
|
|
111
111
|
}`;
|
|
112
|
-
const { css } = compile(source, 'test.
|
|
112
|
+
const { css } = compile(source, 'test.tsrx');
|
|
113
113
|
|
|
114
114
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
115
115
|
expect(css).toMatch(/button\.ripple-[a-z0-9]+ {/);
|
|
@@ -140,7 +140,7 @@ export component Test() {
|
|
|
140
140
|
}
|
|
141
141
|
</style>
|
|
142
142
|
}`;
|
|
143
|
-
const { css } = compile(source, 'test.
|
|
143
|
+
const { css } = compile(source, 'test.tsrx');
|
|
144
144
|
|
|
145
145
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
146
146
|
expect(css).toContain('span {');
|
|
@@ -172,7 +172,7 @@ export component Test() {
|
|
|
172
172
|
}
|
|
173
173
|
</style>
|
|
174
174
|
}`;
|
|
175
|
-
const { css } = compile(source, 'test.
|
|
175
|
+
const { css } = compile(source, 'test.tsrx');
|
|
176
176
|
|
|
177
177
|
expect(css).toMatch(/\.container\.ripple-[a-z0-9]+ {/);
|
|
178
178
|
expect(css).toMatch(/button\.ripple-[a-z0-9]+ {/);
|
|
@@ -207,7 +207,7 @@ export component Test() {
|
|
|
207
207
|
}
|
|
208
208
|
</style>
|
|
209
209
|
}`;
|
|
210
|
-
const { css } = compile(source, 'test.
|
|
210
|
+
const { css } = compile(source, 'test.tsrx');
|
|
211
211
|
|
|
212
212
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
213
213
|
expect(css).toMatch(/ul\.ripple-[a-z0-9]+ {/);
|
|
@@ -12,7 +12,7 @@ export component Test() {
|
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
14
|
}`;
|
|
15
|
-
const { css } = compile(source, 'test.
|
|
15
|
+
const { css } = compile(source, 'test.tsrx');
|
|
16
16
|
|
|
17
17
|
expect(css).toContain('div, span ');
|
|
18
18
|
expect(css).toContain('(unused) p');
|
|
@@ -33,7 +33,7 @@ export component Test() {
|
|
|
33
33
|
}
|
|
34
34
|
</style>
|
|
35
35
|
}`;
|
|
36
|
-
const { css } = compile(source, 'test.
|
|
36
|
+
const { css } = compile(source, 'test.tsrx');
|
|
37
37
|
|
|
38
38
|
expect(css).toContain('[data-test] {');
|
|
39
39
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+\[data-foo="bar"\]/);
|
|
@@ -54,7 +54,7 @@ export component Test() {
|
|
|
54
54
|
}
|
|
55
55
|
</style>
|
|
56
56
|
}`;
|
|
57
|
-
const { css } = compile(source, 'test.
|
|
57
|
+
const { css } = compile(source, 'test.tsrx');
|
|
58
58
|
|
|
59
59
|
expect(css).toContain('* {');
|
|
60
60
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ \* {/);
|
|
@@ -75,7 +75,7 @@ export component Test() {
|
|
|
75
75
|
}
|
|
76
76
|
</style>
|
|
77
77
|
}`;
|
|
78
|
-
const { css } = compile(source, 'test.
|
|
78
|
+
const { css } = compile(source, 'test.tsrx');
|
|
79
79
|
|
|
80
80
|
expect(css).toContain('#app {');
|
|
81
81
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ #test {/);
|
|
@@ -98,7 +98,7 @@ export component Test() {
|
|
|
98
98
|
}
|
|
99
99
|
</style>
|
|
100
100
|
}`;
|
|
101
|
-
const { css } = compile(source, 'test.
|
|
101
|
+
const { css } = compile(source, 'test.tsrx');
|
|
102
102
|
|
|
103
103
|
expect(css).toContain('div::before {');
|
|
104
104
|
``;
|
|
@@ -118,7 +118,7 @@ export component Test() {
|
|
|
118
118
|
}
|
|
119
119
|
</style>
|
|
120
120
|
}`;
|
|
121
|
-
const { css } = compile(source, 'test.
|
|
121
|
+
const { css } = compile(source, 'test.tsrx');
|
|
122
122
|
|
|
123
123
|
expect(css).toContain('color: red');
|
|
124
124
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
@@ -143,7 +143,7 @@ export component Test() {
|
|
|
143
143
|
}
|
|
144
144
|
</style>
|
|
145
145
|
}`;
|
|
146
|
-
const { css } = compile(source, 'test.
|
|
146
|
+
const { css } = compile(source, 'test.tsrx');
|
|
147
147
|
|
|
148
148
|
expect(css).toMatch(/div\.container > span.wrapper\.ripple-[a-z0-9]+ \+ button\[disabled\] {/);
|
|
149
149
|
expect(css).toMatch(/\.foo > \.bar span\.ripple-[a-z0-9]+ {/);
|
|
@@ -165,7 +165,7 @@ export component Test() {
|
|
|
165
165
|
</style>
|
|
166
166
|
}`;
|
|
167
167
|
|
|
168
|
-
expect(() => compile(source, 'test.
|
|
168
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(
|
|
169
169
|
':global(...) can be at the start or end of a selector sequence, but not in the middle',
|
|
170
170
|
);
|
|
171
171
|
});
|
|
@@ -191,7 +191,7 @@ export component Test() {
|
|
|
191
191
|
}
|
|
192
192
|
</style>
|
|
193
193
|
}`;
|
|
194
|
-
const { css } = compile(source, 'test.
|
|
194
|
+
const { css } = compile(source, 'test.tsrx');
|
|
195
195
|
|
|
196
196
|
expect(css).toMatch(/html div\.ripple-[a-z0-9]+ span:where\(\.ripple-[a-z0-9]+\) {/);
|
|
197
197
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ span:where\(\.ripple-[a-z0-9]+\) strong {/);
|
|
@@ -17,7 +17,7 @@ export component Test() {
|
|
|
17
17
|
}
|
|
18
18
|
</style>
|
|
19
19
|
}`;
|
|
20
|
-
const { css } = compile(source, 'test.
|
|
20
|
+
const { css } = compile(source, 'test.tsrx');
|
|
21
21
|
|
|
22
22
|
expect(css).toContain('@keyframes foo');
|
|
23
23
|
expect(css).not.toContain('-global-foo');
|
|
@@ -36,7 +36,7 @@ export component Test() {
|
|
|
36
36
|
}
|
|
37
37
|
</style>
|
|
38
38
|
}`;
|
|
39
|
-
const { css } = compile(source, 'test.
|
|
39
|
+
const { css } = compile(source, 'test.tsrx');
|
|
40
40
|
|
|
41
41
|
expect(css).toMatch(/@keyframes ripple-[a-z0-9]+-foo/);
|
|
42
42
|
});
|
|
@@ -67,7 +67,7 @@ export component Test() {
|
|
|
67
67
|
}
|
|
68
68
|
</style>
|
|
69
69
|
}`;
|
|
70
|
-
const { css } = compile(source, 'test.
|
|
70
|
+
const { css } = compile(source, 'test.tsrx');
|
|
71
71
|
|
|
72
72
|
expect(css).toContain('@keyframes fadeIn');
|
|
73
73
|
expect(css).not.toContain('-global-fadeIn');
|
|
@@ -93,7 +93,7 @@ export component Test() {
|
|
|
93
93
|
}
|
|
94
94
|
</style>
|
|
95
95
|
}`;
|
|
96
|
-
const { css } = compile(source, 'test.
|
|
96
|
+
const { css } = compile(source, 'test.tsrx');
|
|
97
97
|
|
|
98
98
|
expect(css).toContain('@keyframes foo');
|
|
99
99
|
expect(css).toContain('@keyframes bar');
|
|
@@ -134,7 +134,7 @@ component Child() {
|
|
|
134
134
|
}
|
|
135
135
|
</style>
|
|
136
136
|
}`;
|
|
137
|
-
const { css } = compile(source, 'test.
|
|
137
|
+
const { css } = compile(source, 'test.tsrx');
|
|
138
138
|
|
|
139
139
|
// Parent should have scoped slideIn and global fadeIn
|
|
140
140
|
expect(css).toMatch(/@keyframes ripple-[a-z0-9]+-slideIn/);
|
|
@@ -32,7 +32,7 @@ export component Test() {
|
|
|
32
32
|
}
|
|
33
33
|
</style>
|
|
34
34
|
}`;
|
|
35
|
-
const { css } = compile(source, 'test.
|
|
35
|
+
const { css } = compile(source, 'test.tsrx');
|
|
36
36
|
|
|
37
37
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ {/);
|
|
38
38
|
expect(css).toContain('.x {');
|
|
@@ -67,7 +67,7 @@ export component Test() {
|
|
|
67
67
|
}
|
|
68
68
|
</style>
|
|
69
69
|
}`;
|
|
70
|
-
const { css } = compile(source, 'test.
|
|
70
|
+
const { css } = compile(source, 'test.tsrx');
|
|
71
71
|
|
|
72
72
|
expect(css).toContain('&.x {');
|
|
73
73
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+\.x {/);
|
|
@@ -92,7 +92,7 @@ export component Test() {
|
|
|
92
92
|
}
|
|
93
93
|
</style>
|
|
94
94
|
}`;
|
|
95
|
-
const { css } = compile(source, 'test.
|
|
95
|
+
const { css } = compile(source, 'test.tsrx');
|
|
96
96
|
|
|
97
97
|
expect(css).toContain('div {');
|
|
98
98
|
expect(css).toContain('.y {');
|
|
@@ -118,7 +118,7 @@ export component Test() {
|
|
|
118
118
|
}
|
|
119
119
|
</style>
|
|
120
120
|
}`;
|
|
121
|
-
const { css } = compile(source, 'test.
|
|
121
|
+
const { css } = compile(source, 'test.tsrx');
|
|
122
122
|
|
|
123
123
|
expect(css).toContain('.whatever {');
|
|
124
124
|
expect(css).not.toMatch(/\.whatever\.ripple-[a-z0-9]+ {/);
|
|
@@ -142,7 +142,7 @@ export component Test() {
|
|
|
142
142
|
}
|
|
143
143
|
</style>
|
|
144
144
|
}`;
|
|
145
|
-
const { css } = compile(source, 'test.
|
|
145
|
+
const { css } = compile(source, 'test.tsrx');
|
|
146
146
|
|
|
147
147
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ :is\(span\) {/);
|
|
148
148
|
expect(css).toMatch(/\.foo :is\(div\.ripple-[a-z0-9]+\) {/);
|
|
@@ -18,7 +18,7 @@ export component Test() {
|
|
|
18
18
|
}
|
|
19
19
|
</style>
|
|
20
20
|
}`;
|
|
21
|
-
const { css } = compile(source, 'test.
|
|
21
|
+
const { css } = compile(source, 'test.tsrx');
|
|
22
22
|
|
|
23
23
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+:has\(span\)/);
|
|
24
24
|
expect(css).toContain('div:has(span)');
|
|
@@ -42,7 +42,7 @@ export component Test() {
|
|
|
42
42
|
}
|
|
43
43
|
</style>
|
|
44
44
|
}`;
|
|
45
|
-
const { css } = compile(source, 'test.
|
|
45
|
+
const { css } = compile(source, 'test.tsrx');
|
|
46
46
|
|
|
47
47
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ :is\(span, p:where\(\.ripple-[a-z0-9]+\)\) {/);
|
|
48
48
|
expect(css).not.toMatch(/span:where/);
|
|
@@ -68,7 +68,7 @@ export component Test() {
|
|
|
68
68
|
}
|
|
69
69
|
</style>
|
|
70
70
|
}`;
|
|
71
|
-
const { css } = compile(source, 'test.
|
|
71
|
+
const { css } = compile(source, 'test.tsrx');
|
|
72
72
|
|
|
73
73
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ :where\(span, p:where\(\.ripple-[a-z0-9]+\)\) {/);
|
|
74
74
|
expect(css).not.toMatch(/span:where/);
|
|
@@ -93,7 +93,7 @@ export component Test() {
|
|
|
93
93
|
}
|
|
94
94
|
</style>
|
|
95
95
|
}`;
|
|
96
|
-
const { css } = compile(source, 'test.
|
|
96
|
+
const { css } = compile(source, 'test.tsrx');
|
|
97
97
|
|
|
98
98
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+:not\(span\)/);
|
|
99
99
|
expect(css).toContain('div:not(.foo)');
|
|
@@ -116,7 +116,7 @@ export component Test() {
|
|
|
116
116
|
}
|
|
117
117
|
</style>
|
|
118
118
|
}`;
|
|
119
|
-
const { css } = compile(source, 'test.
|
|
119
|
+
const { css } = compile(source, 'test.tsrx');
|
|
120
120
|
|
|
121
121
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+:is\(:where\(\.ripple-[a-z0-9]+\):has\(span\)\) {/);
|
|
122
122
|
expect(css).toContain('div:where(:is(.foo))');
|
|
@@ -145,7 +145,7 @@ export component Test() {
|
|
|
145
145
|
}
|
|
146
146
|
</style>
|
|
147
147
|
}`;
|
|
148
|
-
const { css } = compile(source, 'test.
|
|
148
|
+
const { css } = compile(source, 'test.tsrx');
|
|
149
149
|
|
|
150
150
|
expect(css).toContain('span:nth-child(2) {');
|
|
151
151
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+ > span:first-child {/);
|
|
@@ -12,7 +12,7 @@ export component Test() {
|
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
14
|
}`;
|
|
15
|
-
const { css } = compile(source, 'test.
|
|
15
|
+
const { css } = compile(source, 'test.tsrx');
|
|
16
16
|
|
|
17
17
|
expect(css).toMatch(/\.scoped\.ripple-[a-z0-9]+/);
|
|
18
18
|
expect(css).not.toContain('.scoped {');
|
|
@@ -29,7 +29,7 @@ export component Test() {
|
|
|
29
29
|
}
|
|
30
30
|
</style>
|
|
31
31
|
}`;
|
|
32
|
-
const { css } = compile(source, 'test.
|
|
32
|
+
const { css } = compile(source, 'test.tsrx');
|
|
33
33
|
|
|
34
34
|
expect(css).toContain('.global {');
|
|
35
35
|
expect(css).not.toMatch(/\.global\.ripple-[a-z0-9]+/);
|
|
@@ -64,7 +64,7 @@ export component Test() {
|
|
|
64
64
|
}
|
|
65
65
|
</style>
|
|
66
66
|
}`;
|
|
67
|
-
const { css } = compile(source, 'test.
|
|
67
|
+
const { css } = compile(source, 'test.tsrx');
|
|
68
68
|
|
|
69
69
|
expect(css).toMatch(/\.outer\.ripple-[a-z0-9]+ {/);
|
|
70
70
|
expect(css).toMatch(/\.outer {/);
|
|
@@ -98,7 +98,7 @@ export component Test() {
|
|
|
98
98
|
}
|
|
99
99
|
</style>
|
|
100
100
|
}`;
|
|
101
|
-
const { css } = compile(source, 'test.
|
|
101
|
+
const { css } = compile(source, 'test.tsrx');
|
|
102
102
|
|
|
103
103
|
expect(css).toContain('div {');
|
|
104
104
|
expect(css).toContain('span {');
|
|
@@ -131,7 +131,7 @@ export component Test() {
|
|
|
131
131
|
}
|
|
132
132
|
</style>
|
|
133
133
|
}`;
|
|
134
|
-
const { css } = compile(source, 'test.
|
|
134
|
+
const { css } = compile(source, 'test.tsrx');
|
|
135
135
|
|
|
136
136
|
expect(css).toMatch(/div\.ripple-[a-z0-9]+/);
|
|
137
137
|
expect(css).toMatch(/span\.ripple-[a-z0-9]+/);
|
|
@@ -153,7 +153,7 @@ export component Test() {
|
|
|
153
153
|
}
|
|
154
154
|
</style>
|
|
155
155
|
}`;
|
|
156
|
-
const { css } = compile(source, 'test.
|
|
156
|
+
const { css } = compile(source, 'test.tsrx');
|
|
157
157
|
|
|
158
158
|
expect(css).toMatch(/\.local\.ripple-[a-z0-9]+ \.global \.local {/);
|
|
159
159
|
expect(css).not.toMatch(/\.global\.ripple-[a-z0-9]+/);
|
|
@@ -180,8 +180,8 @@ export component Test2() {
|
|
|
180
180
|
}
|
|
181
181
|
</style>
|
|
182
182
|
}`;
|
|
183
|
-
const { css: css1 } = compile(source1, 'test1.
|
|
184
|
-
const { css: css2 } = compile(source2, 'test2.
|
|
183
|
+
const { css: css1 } = compile(source1, 'test1.tsrx');
|
|
184
|
+
const { css: css2 } = compile(source2, 'test2.tsrx');
|
|
185
185
|
|
|
186
186
|
expect(css1).toMatch(/\.test\.ripple-[a-z0-9]+/);
|
|
187
187
|
expect(css2).toMatch(/\.test\.ripple-[a-z0-9]+/);
|
|
@@ -218,8 +218,8 @@ export component Test2() {
|
|
|
218
218
|
}
|
|
219
219
|
</style>
|
|
220
220
|
}`;
|
|
221
|
-
const { css: css1 } = compile(source1, 'test1.
|
|
222
|
-
const { css: css2 } = compile(source2, 'test2.
|
|
221
|
+
const { css: css1 } = compile(source1, 'test1.tsrx');
|
|
222
|
+
const { css: css2 } = compile(source2, 'test2.tsrx');
|
|
223
223
|
|
|
224
224
|
expect(css1).toContain('.global {');
|
|
225
225
|
expect(css1).not.toMatch(/\.global\.ripple-[a-z0-9]+/);
|
|
@@ -163,9 +163,7 @@ component App() {
|
|
|
163
163
|
}
|
|
164
164
|
</style>
|
|
165
165
|
}`;
|
|
166
|
-
expect(() => compile(source, 'test.
|
|
167
|
-
/cannot be used directly on DOM elements/,
|
|
168
|
-
);
|
|
166
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/cannot be used directly on DOM elements/);
|
|
169
167
|
});
|
|
170
168
|
|
|
171
169
|
it('errors when #style bracket notation is used directly on a DOM element', () => {
|
|
@@ -179,9 +177,7 @@ component App() {
|
|
|
179
177
|
}
|
|
180
178
|
</style>
|
|
181
179
|
}`;
|
|
182
|
-
expect(() => compile(source, 'test.
|
|
183
|
-
/cannot be used directly on DOM elements/,
|
|
184
|
-
);
|
|
180
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/cannot be used directly on DOM elements/);
|
|
185
181
|
});
|
|
186
182
|
|
|
187
183
|
it('errors when #style references a class in a compound selector passed to component', () => {
|
|
@@ -198,7 +194,7 @@ component App() {
|
|
|
198
194
|
}
|
|
199
195
|
</style>
|
|
200
196
|
}`;
|
|
201
|
-
expect(() => compile(source, 'test.
|
|
197
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
202
198
|
});
|
|
203
199
|
|
|
204
200
|
it('errors if descendant class is attempted to be passed in to child component', () => {
|
|
@@ -224,7 +220,7 @@ component App() {
|
|
|
224
220
|
render(App);
|
|
225
221
|
`;
|
|
226
222
|
|
|
227
|
-
expect(() => compile(source, 'test.
|
|
223
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
228
224
|
});
|
|
229
225
|
|
|
230
226
|
it('errors if combinator class is attempted to be passed in to child component', () => {
|
|
@@ -251,7 +247,7 @@ component App() {
|
|
|
251
247
|
|
|
252
248
|
render(App);
|
|
253
249
|
`;
|
|
254
|
-
expect(() => compile(source, 'test.
|
|
250
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
255
251
|
});
|
|
256
252
|
|
|
257
253
|
it('errors if compound class is attempted to be passed in to child component', () => {
|
|
@@ -278,7 +274,7 @@ component App() {
|
|
|
278
274
|
|
|
279
275
|
render(App);
|
|
280
276
|
`;
|
|
281
|
-
expect(() => compile(source, 'test.
|
|
277
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
282
278
|
});
|
|
283
279
|
|
|
284
280
|
it('errors if descendant #style class is used on a dynamic component', () => {
|
|
@@ -303,7 +299,7 @@ component App() {
|
|
|
303
299
|
|
|
304
300
|
render(App);
|
|
305
301
|
`;
|
|
306
|
-
expect(() => compile(source, 'test.
|
|
302
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
307
303
|
});
|
|
308
304
|
|
|
309
305
|
it('errors when #style references a class that does not exist in the style block', () => {
|
|
@@ -320,7 +316,7 @@ component App() {
|
|
|
320
316
|
}
|
|
321
317
|
</style>
|
|
322
318
|
}`;
|
|
323
|
-
expect(() => compile(source, 'test.
|
|
319
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/does not exist as a stand-alone class/);
|
|
324
320
|
});
|
|
325
321
|
|
|
326
322
|
it('errors when #style is used with a dynamic expression', () => {
|
|
@@ -338,7 +334,7 @@ component App() {
|
|
|
338
334
|
}
|
|
339
335
|
</style>
|
|
340
336
|
}`;
|
|
341
|
-
expect(() => compile(source, 'test.
|
|
337
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(
|
|
342
338
|
/must use a dot property or static string/,
|
|
343
339
|
);
|
|
344
340
|
});
|
|
@@ -347,7 +343,7 @@ component App() {
|
|
|
347
343
|
const source = `function notAComponent() {
|
|
348
344
|
const cls = #style.foo;
|
|
349
345
|
}`;
|
|
350
|
-
expect(() => compile(source, 'test.
|
|
346
|
+
expect(() => compile(source, 'test.tsrx')).toThrow(/can only be used within a component/);
|
|
351
347
|
});
|
|
352
348
|
});
|
|
353
349
|
|
|
@@ -366,7 +362,7 @@ export component App() {
|
|
|
366
362
|
}
|
|
367
363
|
</style>
|
|
368
364
|
}`;
|
|
369
|
-
const { js } = compile(source, 'test.
|
|
365
|
+
const { js } = compile(source, 'test.tsrx');
|
|
370
366
|
|
|
371
367
|
expect(js.code).toContain('highlight');
|
|
372
368
|
expect(js.code).toMatch(/ripple-[a-z0-9]+/);
|
|
@@ -386,7 +382,7 @@ export component App() {
|
|
|
386
382
|
}
|
|
387
383
|
</style>
|
|
388
384
|
}`;
|
|
389
|
-
const { js } = compile(source, 'test.
|
|
385
|
+
const { js } = compile(source, 'test.tsrx', { mode: 'server' });
|
|
390
386
|
|
|
391
387
|
expect(js.code).toContain('highlight');
|
|
392
388
|
expect(js.code).toMatch(/ripple-[a-z0-9]+/);
|
|
@@ -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.
|
|
3
|
+
import { test } from './function-overload-import.tsrx';
|
|
4
4
|
|
|
5
5
|
describe('function overload import tests', () => {
|
|
6
6
|
describe('function overloads', () => {
|