diff --git a/Cargo.lock b/Cargo.lock index 8a8598914..5e3506f7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,17 +166,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "auto_impl" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "autocfg" version = "1.3.0" @@ -1363,79 +1352,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lexical" -version = "6.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" -dependencies = [ - "lexical-core", -] - -[[package]] -name = "lexical-core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" -dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", -] - -[[package]] -name = "lexical-parse-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" -dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-parse-integer" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-util" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lexical-write-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" -dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", -] - -[[package]] -name = "lexical-write-integer" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" -dependencies = [ - "lexical-util", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.158" @@ -2650,7 +2566,7 @@ dependencies = [ [[package]] name = "styled_jsx" -version = "0.103.0" +version = "0.103.1" dependencies = [ "anyhow", "lightningcss", @@ -2661,13 +2577,6 @@ dependencies = [ "serde", "swc_atoms", "swc_common", - "swc_css_ast", - "swc_css_codegen", - "swc_css_compat", - "swc_css_minifier", - "swc_css_parser", - "swc_css_prefixer", - "swc_css_visit", "swc_ecma_ast", "swc_ecma_minifier", "swc_ecma_parser", @@ -2829,134 +2738,6 @@ dependencies = [ "vergen", ] -[[package]] -name = "swc_css_ast" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145b3ee43b11a92a13bb319c66fed9e34d5953ef4be67e5667075aae68a394c7" -dependencies = [ - "is-macro", - "string_enum", - "swc_atoms", - "swc_common", -] - -[[package]] -name = "swc_css_codegen" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d385256478953a45a010fd759368ad4b9162f6f601d6e200e32024b6a879f2e9" -dependencies = [ - "auto_impl", - "bitflags", - "rustc-hash", - "serde", - "swc_atoms", - "swc_common", - "swc_css_ast", - "swc_css_codegen_macros", - "swc_css_utils", -] - -[[package]] -name = "swc_css_codegen_macros" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e32e407d0a010fedb53cf9dfdccf091521a2c9081efc077da647f7c8963741" -dependencies = [ - "quote", - "syn 2.0.87", -] - -[[package]] -name = "swc_css_compat" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4428f93e54915a676a22f8b04fcc19a77e3e35a5a8609635874d263a1227e22c" -dependencies = [ - "bitflags", - "serde", - "swc_atoms", - "swc_common", - "swc_css_ast", - "swc_css_utils", - "swc_css_visit", -] - -[[package]] -name = "swc_css_minifier" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d068270dd9b8f7f432ba8cc24fb51a7ebc0fd254a57f5cfc4f5a82f74e6ebcaf" -dependencies = [ - "rustc-hash", - "serde", - "swc_atoms", - "swc_common", - "swc_css_ast", - "swc_css_utils", - "swc_css_visit", -] - -[[package]] -name = "swc_css_parser" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e681f9c66208b1ec98e6f69cd068effaa7f0797581d11b88c772a2c312368" -dependencies = [ - "lexical", - "serde", - "swc_atoms", - "swc_common", - "swc_css_ast", -] - -[[package]] -name = "swc_css_prefixer" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcaacf911f12c0c946ea394b927715202ece653536a89628463b3498ae76c36" -dependencies = [ - "once_cell", - "preset_env_base", - "rustc-hash", - "serde", - "serde_json", - "swc_atoms", - "swc_common", - "swc_css_ast", - "swc_css_utils", - "swc_css_visit", -] - -[[package]] -name = "swc_css_utils" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7bd6d3ecd934a0ee3d057f78628cc1f058b4f13bed963e51112d85c86c9ebf" -dependencies = [ - "once_cell", - "rustc-hash", - "serde", - "serde_json", - "swc_atoms", - "swc_css_ast", - "swc_css_visit", -] - -[[package]] -name = "swc_css_visit" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e023a02a0fd04354415d6dcdfcb39d1a37d35873732f801f7d2b67576500d96a" -dependencies = [ - "serde", - "swc_atoms", - "swc_common", - "swc_css_ast", - "swc_visit", -] - [[package]] name = "swc_ecma_ast" version = "16.0.0" diff --git a/Cargo.toml b/Cargo.toml index a5c5c04a7..33072409e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,13 +51,6 @@ swc_atoms = "7.0.0" swc_cached = "2.0.0" swc_common = "15.0.0" swc_core = "45.0.1" -swc_css_ast = "15.0.0" -swc_css_codegen = "15.0.0" -swc_css_compat = "15.0.0" -swc_css_minifier = "15.0.0" -swc_css_parser = "15.0.0" -swc_css_prefixer = "18.0.0" -swc_css_visit = "15.0.0" swc_ecma_ast = "16.0.0" swc_ecma_codegen = "18.0.0" swc_ecma_minifier = "34.0.1" diff --git a/contrib/graphql-codegen-client-preset/src/lib.rs b/contrib/graphql-codegen-client-preset/src/lib.rs index efcc21e8e..cce5689b3 100644 --- a/contrib/graphql-codegen-client-preset/src/lib.rs +++ b/contrib/graphql-codegen-client-preset/src/lib.rs @@ -180,7 +180,8 @@ impl VisitMut for GraphQLVisitor { let platform_specific_path = self.get_relative_import_path("graphql"); - // Find the position after any directive prologue (e.g., "use strict", "use cache") + // Find the position after any directive prologue (e.g., "use strict", "use + // cache") let mut insert_position = 0; for (index, item) in module.body.iter().enumerate() { match item { @@ -198,7 +199,11 @@ impl VisitMut for GraphQLVisitor { } } - for (i, operation_or_fragment_name) in self.graphql_operations_or_fragments_to_import.iter().enumerate() { + for (i, operation_or_fragment_name) in self + .graphql_operations_or_fragments_to_import + .iter() + .enumerate() + { module.body.insert( insert_position + i, ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl { diff --git a/packages/styled-jsx/CHANGELOG.md b/packages/styled-jsx/CHANGELOG.md index 85498614d..4d51efecb 100644 --- a/packages/styled-jsx/CHANGELOG.md +++ b/packages/styled-jsx/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-styled-jsx +## 10.0.0 + +### Major Changes + +- 90c4f87: Drop swc_css mode + ## 9.5.0 ### Minor Changes diff --git a/packages/styled-jsx/README.md b/packages/styled-jsx/README.md index 21507fc19..12e509944 100644 --- a/packages/styled-jsx/README.md +++ b/packages/styled-jsx/README.md @@ -2,6 +2,12 @@ # @swc/plugin-styled-jsx +## 10.0.0 + +### Major Changes + +- 90c4f87: Drop swc_css mode + ## 9.5.0 ### Minor Changes diff --git a/packages/styled-jsx/__tests__/__snapshots__/wasm.test.ts.snap b/packages/styled-jsx/__tests__/__snapshots__/wasm.test.ts.snap index baeb7187f..d03eda763 100644 --- a/packages/styled-jsx/__tests__/__snapshots__/wasm.test.ts.snap +++ b/packages/styled-jsx/__tests__/__snapshots__/wasm.test.ts.snap @@ -77,11 +77,11 @@ export default (({ display })=>/*#__PURE__*/ React.createElement("div", { ] }, \`p.__jsx-style-dynamic-selector{color:\${darken(color) + 2}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "cb506cc21b457018" - }, \`@media(min-width:\${mediumScreen}){p.jsx-98c353683ca4620a{color:green}p.jsx-98c353683ca4620a{color:\${\`red\`}}}p.jsx-98c353683ca4620a{color:red}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { + }, \`@media (min-width:\${mediumScreen}){p.jsx-98c353683ca4620a{color:\${\`red\`}}}p.jsx-98c353683ca4620a{color:red}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "3fbd7f33ecd97f05" - }, \`p.jsx-98c353683ca4620a{-webkit-animation-duration:\${animationDuration};-moz-animation-duration:\${animationDuration};-o-animation-duration:\${animationDuration};animation-duration:\${animationDuration}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { + }, \`p.jsx-98c353683ca4620a{animation-duration:\${animationDuration}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "79b95ec4ba723b8c" - }, \`p.jsx-98c353683ca4620a{-webkit-animation:\${animationDuration} forwards \${animationName};-moz-animation:\${animationDuration} forwards \${animationName};-o-animation:\${animationDuration} forwards \${animationName};animation:\${animationDuration} forwards \${animationName}}div.jsx-98c353683ca4620a{background:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { + }, \`p.jsx-98c353683ca4620a{animation:forwards \${animationDuration};animation-timeline:\${animationName}}div.jsx-98c353683ca4620a{background:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "f7dcddda350c6320", dynamic: [ display ? "block" : "none" @@ -588,7 +588,7 @@ export default function Component() { easing, delay ] - }, \`@-webkit-keyframes customAnimation{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}50%{opacity:\${middleOpacity};-webkit-transform:rotate(\${rotation}deg);transform:rotate(\${rotation}deg)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-moz-keyframes customAnimation{0%{opacity:0;-moz-transform:scale(0);transform:scale(0)}50%{opacity:\${middleOpacity};-moz-transform:rotate(\${rotation}deg);transform:rotate(\${rotation}deg)}100%{opacity:1;-moz-transform:scale(1);transform:scale(1)}}@-o-keyframes customAnimation{0%{opacity:0;-o-transform:scale(0);transform:scale(0)}50%{opacity:\${middleOpacity};-o-transform:rotate(\${rotation}deg);transform:rotate(\${rotation}deg)}100%{opacity:1;-o-transform:scale(1);transform:scale(1)}}@keyframes customAnimation{0%{opacity:0;-webkit-transform:scale(0);-moz-transform:scale(0);-o-transform:scale(0);transform:scale(0)}50%{opacity:\${middleOpacity};-webkit-transform:rotate(\${rotation}deg);-moz-transform:rotate(\${rotation}deg);-o-transform:rotate(\${rotation}deg);transform:rotate(\${rotation}deg)}100%{opacity:1;-webkit-transform:scale(1);-moz-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}.wrapper.__jsx-style-dynamic-selector{}.wrapper.__jsx-style-dynamic-selector .animated.__jsx-style-dynamic-selector{-webkit-animation:customAnimation \${duration}ms \${easing} forwards;-moz-animation:customAnimation \${duration}ms \${easing} forwards;-o-animation:customAnimation \${duration}ms \${easing} forwards;animation:customAnimation \${duration}ms \${easing} forwards;-webkit-animation-delay:\${delay}ms;-moz-animation-delay:\${delay}ms;-o-animation-delay:\${delay}ms;animation-delay:\${delay}ms}\`)); + }, \`@keyframes customAnimation{0%{opacity:0;transform:scale(0)}50%{opacity:\${middleOpacity};transform:rotate(\${rotation}deg)}to{opacity:1;transform:scale(1)}}.wrapper.__jsx-style-dynamic-selector .animated.__jsx-style-dynamic-selector{animation:customAnimation \${duration}ms \${easing} forwards;animation-delay:\${delay}ms}\`)); } " `; @@ -632,7 +632,7 @@ function NavigationItem({ active, className }) { }, className, "navigation-item") || "") }, /*#__PURE__*/ React.createElement(_JSXStyle, { id: "e73bf96b356a8634" - }, '.navigation-item.jsx-e73bf96b356a8634 a::after{content:attr(data-text);content:attr(data-text)/""}')); + }, '.navigation-item.jsx-e73bf96b356a8634 a:after{content:attr(data-text);content:attr(data-text)/""}')); } export default NavigationItem; " @@ -709,7 +709,7 @@ export default function Component() { offset, spacing ] - }, \`.container.__jsx-style-dynamic-selector{--local-var:\${dynamicValue};color:var(--text-color);background:-webkit-linear-gradient(left,\${color1},\${color2});background:-moz-linear-gradient(left,\${color1},\${color2});background:-o-linear-gradient(left,\${color1},\${color2});background:linear-gradient(to right,\${color1},\${color2})}.container.__jsx-style-dynamic-selector .item.__jsx-style-dynamic-selector{-webkit-transform:translate(-webkit-calc(var(--x) + \${offset}px),-webkit-calc(var(--y) + \${offset}px));-moz-transform:translate(-moz-calc(var(--x) + \${offset}px),-moz-calc(var(--y) + \${offset}px));-ms-transform:translate(calc(var(--x) + \${offset}px),calc(var(--y) + \${offset}px));-o-transform:translate(calc(var(--x) + \${offset}px),calc(var(--y) + \${offset}px));transform:translate(-webkit-calc(var(--x) + \${offset}px),-webkit-calc(var(--y) + \${offset}px));transform:translate(-moz-calc(var(--x) + \${offset}px),-moz-calc(var(--y) + \${offset}px));transform:translate(calc(var(--x) + \${offset}px),calc(var(--y) + \${offset}px))}.container.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{margin:-webkit-calc(10px + \${spacing}px);margin:-moz-calc(10px + \${spacing}px);margin:calc(10px + \${spacing}px)}\`)); + }, \`.container.__jsx-style-dynamic-selector{--local-var:\${dynamicValue};color:var(--text-color);background:linear-gradient(to right,\${color1},\${color2})}.container.__jsx-style-dynamic-selector .item.__jsx-style-dynamic-selector{transform:translate(calc(var(--x) + \${offset}px),calc(var(--y) + \${offset}px))}.container.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{margin:calc(10px + \${spacing}px)}\`)); } " `; @@ -977,7 +977,7 @@ export default (()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#_ className: "jsx-6dd5f97e085c0297" }, "world"))), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "6dd5f97e085c0297" - }, "p.jsx-6dd5f97e085c0297{color:cyan}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:hotpink}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"))); + }, "p.jsx-6dd5f97e085c0297{color:#0ff}.foo.jsx-6dd5f97e085c0297{color:#ff69b4;font-size:18px}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"))); function Component1() { return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", null, "test")); } @@ -997,7 +997,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-f84dd0db2f59ea88" }, /*#__PURE__*/ React.createElement(_JSXStyle, { id: "f84dd0db2f59ea88" - }, "body{color:red}:hover{color:red;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-animation:foo 1s ease-out;-moz-animation:foo 1s ease-out;-o-animation:foo 1s ease-out;animation:foo 1s ease-out}div a{display:none}[data-test]>div{color:red}")); + }, "body{color:red}:hover{color:red;animation:1s ease-out foo;display:flex}div a{display:none}[data-test]>div{color:red}")); const Test2 = ()=>/*#__PURE__*/ React.createElement(_JSXStyle, { id: "94239b6d6b42c9b5" }, "p{color:red}"); @@ -1024,7 +1024,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-3d9ecfaa448ef714" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "3d9ecfaa448ef714" - }, ".c1{background:orange!important}")); + }, ":-webkit-any(.c1,.c2){background:orange!important}:-moz-any(.c1,.c2){background:orange!important}:is(.c1,.c2){background:orange!important}")); " `; @@ -1048,7 +1048,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-9303248a3896bf50" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "9303248a3896bf50" - }, ".parent.jsx-9303248a3896bf50{}.parent.jsx-9303248a3896bf50 div{}.parent.jsx-9303248a3896bf50 div.child{background:orange}")); + }, ".parent.jsx-9303248a3896bf50 div :-webkit-any(.child,.child2){background:orange}.parent.jsx-9303248a3896bf50 div :-moz-any(.child,.child2){background:orange}.parent.jsx-9303248a3896bf50 div :is(.child,.child2){background:orange}")); " `; @@ -1060,7 +1060,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-da58316599e32d09" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "da58316599e32d09" - }, ".parent.jsx-da58316599e32d09{}.parent.jsx-da58316599e32d09 div{}.parent.jsx-da58316599e32d09 div.child>.child2{background:orange}")); + }, ".parent.jsx-da58316599e32d09 div.child>.child2{background:orange}")); " `; @@ -1072,7 +1072,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-b0a16d58836c444b" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "b0a16d58836c444b" - }, ".parent.jsx-b0a16d58836c444b{}.parent.jsx-b0a16d58836c444b div{}.parent.jsx-b0a16d58836c444b div.child{background:orange}")); + }, ".parent.jsx-b0a16d58836c444b div.child{background:orange}")); " `; @@ -1083,7 +1083,7 @@ export default function IndexPage() { className: "jsx-b6abd0684ba81871" }, "should be blue.", /*#__PURE__*/ React.createElement(_JSXStyle, { id: "b6abd0684ba81871" - }, "div{color:blue}")); + }, "div{color:#00f}")); } " `; @@ -1108,7 +1108,7 @@ const Test = ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PU className: "jsx-60bae1dc4409a62b" }, "Loading CSS...")), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "60bae1dc4409a62b" - }, "#css-test-page-id.jsx-60bae1dc4409a62b{color:red}.p1.jsx-60bae1dc4409a62b{background:purple!important}.c1,.c2.jsx-60bae1dc4409a62b{background:orange!important}.container.jsx-60bae1dc4409a62b{max-width:1e3px;margin:0 auto;padding:1rem}")); + }, "#css-test-page-id.jsx-60bae1dc4409a62b{color:red}.p1.jsx-60bae1dc4409a62b{background:purple!important}.c2.jsx-60bae1dc4409a62b,.c1{background:orange!important}.container.jsx-60bae1dc4409a62b{max-width:1000px;margin:0 auto;padding:1rem}")); " `; @@ -1193,7 +1193,7 @@ export default function Home() { className: "jsx-762285c3ffa56b0" + " " + "child" }, "this should be green")), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "762285c3ffa56b0" - }, ".container.jsx-762285c3ffa56b0{color:blue;padding:3rem}div.child{color:green}")); + }, ".container.jsx-762285c3ffa56b0{color:#00f;padding:3rem}div.child{color:green}")); } " `; @@ -1203,7 +1203,7 @@ exports[`Should load swc-confidential wasm plugin correctly > Should transform i export default function Home() { return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(_JSXStyle, { id: "c717b7da8095da63" - }, ".theme-root{}.theme-root .parent.jsx-c717b7da8095da63{color:green}")); + }, ".theme-root .parent.jsx-c717b7da8095da63{color:green}")); } " `; @@ -1213,7 +1213,7 @@ exports[`Should load swc-confidential wasm plugin correctly > Should transform i export default function Home() { return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(_JSXStyle, { id: "44c2e59534385f9" - }, "div.jsx-44c2e59534385f9{-webkit-mask-image:-webkit-radial-gradient(white,black);mask-image:-webkit-radial-gradient(white,black)}")); + }, "div.jsx-44c2e59534385f9{-webkit-mask-image:-webkit-radial-gradient(#fff,#000)}")); } " `; @@ -1234,7 +1234,7 @@ export default (({ breakPoint })=>/*#__PURE__*/ React.createElement("div", { dynamic: [ breakPoint ] - }, \`@media(\${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}\`))); + }, \`@media (\${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}\`))); " `; @@ -1247,7 +1247,7 @@ export default function IndexPage() { className: "jsx-6226396a225d1c8b" }, "Hello World."), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "6226396a225d1c8b" - }, "@supports((display:flex)or (display:-webkit-box)or (display:-webkit-flex)or (display:-moz-box)or (display:-ms-flexbox)){h1{color:hotpink}}")); + }, "@supports (display:flex){h1{color:#ff69b4}}")); } " `; @@ -1313,7 +1313,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-3b0234e9651851cb" }, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "3b0234e9651851cb" - }, ".container.jsx-3b0234e9651851cb{color:blue;padding:3rem}.container.jsx-3b0234e9651851cb .inner.jsx-3b0234e9651851cb{color:yellow}"))); + }, ".container.jsx-3b0234e9651851cb{color:#00f;padding:3rem}.container.jsx-3b0234e9651851cb .inner.jsx-3b0234e9651851cb{color:#ff0}"))); " `; @@ -1326,7 +1326,7 @@ export default function IndexPage() { className: "jsx-490e0a92136d9307" }, "Hello World."), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "490e0a92136d9307" - }, ".container{}.container>div{color:green}")); + }, ".container>div{color:green}")); } " `; @@ -1367,7 +1367,7 @@ export default function Component() { ResponsiveBreakpoint[breakpoint], mobileWidth ] - }, \`.component.__jsx-style-dynamic-selector{width:100%}@media(max-width:\${ResponsiveBreakpoint[breakpoint]}){.component.__jsx-style-dynamic-selector{width:\${mobileWidth}px}.component.__jsx-style-dynamic-selector.active.__jsx-style-dynamic-selector{color:blue}.component.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{display:block}}\`)); + }, \`.component.__jsx-style-dynamic-selector{width:100%}@media (max-width:\${ResponsiveBreakpoint[breakpoint]}){.component.__jsx-style-dynamic-selector{width:\${mobileWidth}px}.component.active.__jsx-style-dynamic-selector{color:#00f}.component.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{display:block}}\`)); } " `; @@ -1437,13 +1437,13 @@ export default function Component() { className: "jsx-2552bb7cce0bcbcf" }, "Heading"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "2552bb7cce0bcbcf" - }, ".parent.jsx-2552bb7cce0bcbcf{position:relative}.parent.jsx-2552bb7cce0bcbcf.jsx-2552bb7cce0bcbcf:hover{background-color:red}.parent.jsx-2552bb7cce0bcbcf .child.jsx-2552bb7cce0bcbcf{margin-top:10px}.parent.jsx-2552bb7cce0bcbcf div.jsx-2552bb7cce0bcbcf{padding:15px}.parent.jsx-2552bb7cce0bcbcf h1.jsx-2552bb7cce0bcbcf{font-size:24px}")); + }, ".parent.jsx-2552bb7cce0bcbcf{position:relative}.parent.jsx-2552bb7cce0bcbcf:hover{background-color:red}.parent.jsx-2552bb7cce0bcbcf .child.jsx-2552bb7cce0bcbcf{margin-top:10px}.parent.jsx-2552bb7cce0bcbcf div.jsx-2552bb7cce0bcbcf{padding:15px}.parent.jsx-2552bb7cce0bcbcf h1.jsx-2552bb7cce0bcbcf{font-size:24px}")); } " `; exports[`Should load swc-confidential wasm plugin correctly > Should transform next-54653 correctly 1`] = ` -"const _defaultExport = new String("@media(max-width:870px){th.expiration-date-cell,td.expiration-date-cell{display:none}}"); +"const _defaultExport = new String("@media (max-width:870px){th.expiration-date-cell,td.expiration-date-cell{display:none}}"); _defaultExport.__hash = "fd71bf06ba8860bb"; export default _defaultExport; " @@ -1615,7 +1615,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-d3bc3634b8d1b3fb" }, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "d3bc3634b8d1b3fb" - }, ".container.jsx-d3bc3634b8d1b3fb{color:blue;padding:3rem}.container.jsx-d3bc3634b8d1b3fb.inner.jsx-d3bc3634b8d1b3fb{color:yellow}"))); + }, ".container.jsx-d3bc3634b8d1b3fb{color:#00f;padding:3rem}.container.inner.jsx-d3bc3634b8d1b3fb{color:#ff0}"))); " `; @@ -1636,7 +1636,7 @@ exports[`Should load swc-confidential wasm plugin correctly > Should transform s export default function Home() { return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(_JSXStyle, { id: "86b7ac1a67e57b1" - }, "div.jsx-86b7ac1a67e57b1{}div.jsx-86b7ac1a67e57b1.parent.jsx-86b7ac1a67e57b1{color:green}")); + }, "div.parent.jsx-86b7ac1a67e57b1{color:green}")); } " `; @@ -1774,7 +1774,7 @@ const MaskedDivBad = ()=>{ 0.5 + HEAD_MARGIN_PERCENTAGE, 0.5 + CUTOUT_AVATAR_PERCENTAGE_VISIBLE + HEAD_MARGIN_PERCENTAGE ] - }, \`.head.__jsx-style-dynamic-selector{position:relative}.avatar-wrapper.__jsx-style-dynamic-selector{width:40px;height:40px;background:#ff6b6b;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-mask-image:url('data:image/svg+xml,'),url('data:image/svg+xml,');mask-image:url('data:image/svg+xml,'),url('data:image/svg+xml,');-webkit-mask-size:100%100%;mask-size:100%100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-composite:source-out;mask-composite:subtract}\`)); + }, \`.head.__jsx-style-dynamic-selector{position:relative}.avatar-wrapper.__jsx-style-dynamic-selector{-webkit-mask-composite:source-out;background:#ff6b6b;border-radius:50%;width:40px;height:40px;-webkit-mask-image:url("data:image/svg+xml,"),url("data:image/svg+xml,");mask-image:url("data:image/svg+xml,"),url("data:image/svg+xml,");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-out;mask-composite:subtract}\`)); }; " `; @@ -2006,7 +2006,7 @@ class _class { a || "var(--c)", b || "inherit" ] - }, \`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block;padding:0 \${a || "var(--c)"};color:\${b || "inherit"}}\`)); + }, \`.a:hover .b.__jsx-style-dynamic-selector{padding:0 \${a || "var(--c)"};color:\${b || "inherit"};display:inline-block}\`)); } } export { _class as default }; @@ -2058,7 +2058,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-374655937fd2de40" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "374655937fd2de40" - }, 'html.jsx-374655937fd2de40{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}p{color:#002}p,a.jsx-374655937fd2de40{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}p.jsx-374655937fd2de40{color:#005}p.jsx-374655937fd2de40{color:#006}*.jsx-374655937fd2de40{color:#007}[href="woot"].jsx-374655937fd2de40{color:#008}p.jsx-374655937fd2de40 a.jsx-374655937fd2de40 span.jsx-374655937fd2de40{color:#009}p.jsx-374655937fd2de40 span{background:#00a}p.jsx-374655937fd2de40 a[title="\\'w \\' \\' t\\'"].jsx-374655937fd2de40{margin:auto}p.jsx-374655937fd2de40 span:not(.test){color:#00b}p.jsx-374655937fd2de40,h1.jsx-374655937fd2de40{color:#00c;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-374655937fd2de40{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-374655937fd2de40:hover{color:#00d}p.jsx-374655937fd2de40::before{color:#00e}.jsx-374655937fd2de40:hover{color:#00f}.jsx-374655937fd2de40::before{color:#010}.jsx-374655937fd2de40:hover p.jsx-374655937fd2de40{color:#011}p.jsx-374655937fd2de40+a.jsx-374655937fd2de40{color:#012}p.jsx-374655937fd2de40~a.jsx-374655937fd2de40{color:#013}p.jsx-374655937fd2de40>a.jsx-374655937fd2de40{color:#014}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-374655937fd2de40{color:#015}}.test.jsx-374655937fd2de40{display:block}.inline-flex.jsx-374655937fd2de40{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-374655937fd2de40{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-374655937fd2de40{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=","].jsx-374655937fd2de40{display:inline-block}.test.is-status.jsx-374655937fd2de40 .test.jsx-374655937fd2de40{color:#016}.a-selector.jsx-374655937fd2de40:hover,.a-selector.jsx-374655937fd2de40:focus{outline:none}@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-374655937fd2de40{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-374655937fd2de40{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-374655937fd2de40{margin-bottom:2rem}}}'))); + }, "html.jsx-374655937fd2de40{background-image:linear-gradient(rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#002}a.jsx-374655937fd2de40,p{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}p.jsx-374655937fd2de40{color:#006}.jsx-374655937fd2de40{color:#007}[href=woot].jsx-374655937fd2de40{color:#008}p.jsx-374655937fd2de40 a.jsx-374655937fd2de40 span.jsx-374655937fd2de40{color:#009}p.jsx-374655937fd2de40 span{background:#00a}p.jsx-374655937fd2de40 a[title=\\"'w ' ' t'\\"].jsx-374655937fd2de40{margin:auto}p.jsx-374655937fd2de40 span:not(.test){color:#00b}p.jsx-374655937fd2de40,h1.jsx-374655937fd2de40{color:#00c;animation:3s .1s infinite forwards hahaha}p.jsx-374655937fd2de40{animation:1s hahaha,2s hehehe}p.jsx-374655937fd2de40:hover{color:#00d}p.jsx-374655937fd2de40:before{color:#00e}.jsx-374655937fd2de40:hover{color:#00f}:before{color:#010}.jsx-374655937fd2de40:hover p.jsx-374655937fd2de40{color:#011}p.jsx-374655937fd2de40+a.jsx-374655937fd2de40{color:#012}p.jsx-374655937fd2de40~a.jsx-374655937fd2de40{color:#013}p.jsx-374655937fd2de40>a.jsx-374655937fd2de40{color:#014}@keyframes hahaha{0%{top:0}to{top:100px}}@keyframes hehehe{0%{left:0}to{left:100px}}@media (min-width:500px){.test.jsx-374655937fd2de40{color:#015}}.test.jsx-374655937fd2de40{display:block}.inline-flex.jsx-374655937fd2de40{display:inline-flex}.flex.jsx-374655937fd2de40{display:flex}.test.jsx-374655937fd2de40{box-shadow:0 0 10px #000,inset 0 0 5px #000}.test[title=\\\\,].jsx-374655937fd2de40{display:inline-block}.test.is-status.jsx-374655937fd2de40 .test.jsx-374655937fd2de40{color:#016}.a-selector.jsx-374655937fd2de40:hover,.a-selector.jsx-374655937fd2de40:focus{outline:none}@media (min-width:1px) and (max-width:768px){[class*=grid__col--].jsx-374655937fd2de40{margin-top:12px;margin-bottom:12px}}@media (max-width:64em){.test.jsx-374655937fd2de40{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-374655937fd2de40{margin-bottom:2rem}}}"))); " `; @@ -2070,7 +2070,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-2e0b2fdc9a904355" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "2e0b2fdc9a904355" - }, "p.jsx-2e0b2fdc9a904355 a.jsx-2e0b2fdc9a904355 span.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355 span{background:blue}p.jsx-2e0b2fdc9a904355 a[title=\\"'w ' ' t'\\"].jsx-2e0b2fdc9a904355{margin:auto}p.jsx-2e0b2fdc9a904355 span:not(.test){color:green}p.jsx-2e0b2fdc9a904355,h1.jsx-2e0b2fdc9a904355{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-2e0b2fdc9a904355{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-2e0b2fdc9a904355:hover{color:red}p.jsx-2e0b2fdc9a904355::before{color:red}.jsx-2e0b2fdc9a904355:hover{color:red}.jsx-2e0b2fdc9a904355::before{color:red}.jsx-2e0b2fdc9a904355:hover p.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355+a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355~a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355>a.jsx-2e0b2fdc9a904355{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-2e0b2fdc9a904355{color:red}}.test.jsx-2e0b2fdc9a904355{display:block}.inline-flex.jsx-2e0b2fdc9a904355{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-2e0b2fdc9a904355{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-2e0b2fdc9a904355{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=\\",\\"].jsx-2e0b2fdc9a904355{display:inline-block}.test.is-status.jsx-2e0b2fdc9a904355 .test.jsx-2e0b2fdc9a904355{color:red}.a-selector.jsx-2e0b2fdc9a904355:hover,.a-selector.jsx-2e0b2fdc9a904355:focus{outline:none}"))); + }, "p.jsx-2e0b2fdc9a904355 a.jsx-2e0b2fdc9a904355 span.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355 span{background:#00f}p.jsx-2e0b2fdc9a904355 a[title=\\"'w ' ' t'\\"].jsx-2e0b2fdc9a904355{margin:auto}p.jsx-2e0b2fdc9a904355 span:not(.test){color:green}p.jsx-2e0b2fdc9a904355,h1.jsx-2e0b2fdc9a904355{color:#00f;animation:3s .1s infinite forwards hahaha}p.jsx-2e0b2fdc9a904355{animation:1s hahaha,2s hehehe}p.jsx-2e0b2fdc9a904355:hover,p.jsx-2e0b2fdc9a904355:before,.jsx-2e0b2fdc9a904355:hover,:before,.jsx-2e0b2fdc9a904355:hover p.jsx-2e0b2fdc9a904355,p.jsx-2e0b2fdc9a904355+a.jsx-2e0b2fdc9a904355,p.jsx-2e0b2fdc9a904355~a.jsx-2e0b2fdc9a904355,p.jsx-2e0b2fdc9a904355>a.jsx-2e0b2fdc9a904355{color:red}@keyframes hahaha{0%{top:0}to{top:100px}}@keyframes hehehe{0%{left:0}to{left:100px}}@media (min-width:500px){.test.jsx-2e0b2fdc9a904355{color:red}}.test.jsx-2e0b2fdc9a904355{display:block}.inline-flex.jsx-2e0b2fdc9a904355{display:inline-flex}.flex.jsx-2e0b2fdc9a904355{display:flex}.test.jsx-2e0b2fdc9a904355{box-shadow:0 0 10px #000,inset 0 0 5px #000}.test[title=\\\\,].jsx-2e0b2fdc9a904355{display:inline-block}.test.is-status.jsx-2e0b2fdc9a904355 .test.jsx-2e0b2fdc9a904355{color:red}.a-selector.jsx-2e0b2fdc9a904355:hover,.a-selector.jsx-2e0b2fdc9a904355:focus{outline:none}"))); " `; @@ -2094,7 +2094,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-13e06bb770708a4c" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "13e06bb770708a4c" - }, 'html.jsx-13e06bb770708a4c{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}h1{color:#002}h2,a.jsx-13e06bb770708a4c{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}'))); + }, "html.jsx-13e06bb770708a4c{background-image:linear-gradient(rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}h1{color:#002}a.jsx-13e06bb770708a4c,h2{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}"))); " `; @@ -2106,7 +2106,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-ec1bf2b940b30dc" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "ec1bf2b940b30dc" - }, '@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-ec1bf2b940b30dc{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-ec1bf2b940b30dc{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-ec1bf2b940b30dc{margin-bottom:2rem}}}'))); + }, "@media (min-width:1px) and (max-width:768px){[class*=grid__col--].jsx-ec1bf2b940b30dc{margin-top:12px;margin-bottom:12px}}@media (max-width:64em){.test.jsx-ec1bf2b940b30dc{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-ec1bf2b940b30dc{margin-bottom:2rem}}}"))); " `; @@ -2118,7 +2118,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-292192d0348369b" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "292192d0348369b" - }, 'p.jsx-292192d0348369b{color:red}p.jsx-292192d0348369b{color:red}*.jsx-292192d0348369b{color:blue}[href="woot"].jsx-292192d0348369b{color:red}'))); + }, "p.jsx-292192d0348369b{color:red}.jsx-292192d0348369b{color:#00f}[href=woot].jsx-292192d0348369b{color:red}"))); " `; @@ -2130,7 +2130,7 @@ export default (()=>/*#__PURE__*/ React.createElement("div", { className: "jsx-d8153edfc80ef241" }, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "d8153edfc80ef241" - }, "li.jsx-d8153edfc80ef241:nth-child(2){color:lime}"))); + }, "li.jsx-d8153edfc80ef241:nth-child(2){color:#0f0}"))); " `; diff --git a/packages/styled-jsx/package.json b/packages/styled-jsx/package.json index a79293a89..8317b688e 100644 --- a/packages/styled-jsx/package.json +++ b/packages/styled-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-styled-jsx", - "version": "9.5.0", + "version": "10.0.0", "publishConfig": { "access": "public", "provenance": true diff --git a/packages/styled-jsx/transform/Cargo.toml b/packages/styled-jsx/transform/Cargo.toml index e18d86ec7..bd0e1dc79 100644 --- a/packages/styled-jsx/transform/Cargo.toml +++ b/packages/styled-jsx/transform/Cargo.toml @@ -10,7 +10,7 @@ license = { workspace = true } name = "styled_jsx" repository = { workspace = true } rust-version = { workspace = true } -version = "0.103.0" +version = "0.103.1" [features] @@ -28,13 +28,6 @@ tracing = { workspace = true } preset_env_base = { workspace = true } swc_atoms = { workspace = true } swc_common = { workspace = true } -swc_css_ast = { workspace = true } -swc_css_codegen = { workspace = true } -swc_css_compat = { workspace = true } -swc_css_minifier = { workspace = true } -swc_css_parser = { workspace = true } -swc_css_prefixer = { workspace = true } -swc_css_visit = { workspace = true } swc_ecma_ast = { workspace = true } swc_ecma_minifier = { workspace = true } swc_ecma_parser = { workspace = true } diff --git a/packages/styled-jsx/transform/src/lib.rs b/packages/styled-jsx/transform/src/lib.rs index ecb4ef2b7..37ec11d4f 100644 --- a/packages/styled-jsx/transform/src/lib.rs +++ b/packages/styled-jsx/transform/src/lib.rs @@ -1,6 +1,5 @@ #![feature(box_patterns)] pub mod style; mod transform_css_lightningcss; -mod transform_css_swc; mod utils; pub mod visitor; diff --git a/packages/styled-jsx/transform/src/transform_css_swc.rs b/packages/styled-jsx/transform/src/transform_css_swc.rs deleted file mode 100644 index d493fa0a1..000000000 --- a/packages/styled-jsx/transform/src/transform_css_swc.rs +++ /dev/null @@ -1,387 +0,0 @@ -use std::{panic, sync::Arc}; - -use anyhow::{bail, Error}; -use swc_common::{ - errors::HANDLER, source_map::SmallPos, util::take::Take, BytePos, SourceMap, Span, Spanned, - DUMMY_SP, -}; -use swc_css_ast::{ - ClassSelector, Combinator, CombinatorValue, ComplexSelector, ComplexSelectorChildren, - CompoundSelector, Ident, PseudoClassSelector, PseudoClassSelectorChildren, Stylesheet, - SubclassSelector, Token, TokenAndSpan, -}; -use swc_css_codegen::{ - writer::basic::{BasicCssWriter, BasicCssWriterConfig}, - CodeGenerator, CodegenConfig, Emit, -}; -use swc_css_compat::{compiler::Compiler, feature::Features}; -use swc_css_parser::{ - lexer::Lexer, - parse_input, - parser::{ - input::{InputType, Tokens}, - Parser, ParserConfig, - }, -}; -use swc_css_prefixer::prefixer; -use swc_css_visit::{VisitMut, VisitMutWith}; -use swc_ecma_ast::*; -use swc_ecma_parser::StringInput; -use tracing::{debug, trace}; - -use crate::{ - style::LocalStyle, - transform_css_lightningcss::{read_number, strip_comments}, - utils::{hash_string, string_literal_expr}, - visitor::NativeConfig, -}; - -pub fn transform_css( - _cm: Arc, - style_info: &LocalStyle, - is_global: bool, - class_name: &Option, - native: &NativeConfig, -) -> Result { - let css_str = strip_comments(&style_info.css); - - debug!("CSS: \n{}", css_str); - - // TODO use `parse_string_input` in future - let config = ParserConfig { - allow_wrong_line_comments: true, - css_modules: false, - legacy_nesting: true, - ..Default::default() - }; - let lexer = Lexer::new( - StringInput::new(&css_str, style_info.css_span.lo, style_info.css_span.hi), - None, - config, - ); - let mut parser = Parser::new(lexer, config); - - let result: Result = parser.parse_all(); - let mut ss = match result { - Ok(ss) => ss, - Err(err) => { - HANDLER.with(|handler| { - // Print css parsing errors - err.to_diagnostics(handler).emit(); - - // TODO(kdy1): We may print css so the user can see the error, and report it. - - handler - .struct_span_err( - style_info.css_span, - "Failed to parse css in styled jsx component", - ) - .note(&format!("Input to the css parser is {}", style_info.css)) - .emit() - }); - bail!("Failed to parse css"); - } - }; - // ? Do we need to support optionally prefixing? - ss.visit_mut_with(&mut prefixer(swc_css_prefixer::options::Options { - env: None, - })); - ss.visit_mut_with(&mut Namespacer { - class_name: match class_name { - Some(s) => s.clone(), - None => format!("jsx-{}", &hash_string(&style_info.hash)), - }, - is_global, - is_dynamic: style_info.is_dynamic, - }); - - ss.visit_mut_with(&mut Compiler::new(swc_css_compat::compiler::Config { - process: Features::NESTING, - })); - - let mut s = String::new(); - { - let mut wr = BasicCssWriter::new(&mut s, None, BasicCssWriterConfig::default()); - let mut gen = CodeGenerator::new(&mut wr, CodegenConfig { minify: true }); - - gen.emit(&ss).unwrap(); - } - - s = native.invoke_css_transform(style_info.css_span, s); - - if style_info.expressions.is_empty() { - return Ok(string_literal_expr(&s)); - } - - let mut parts: Vec<&str> = s.split("--styled-jsx-placeholder-").collect(); - let mut final_expressions = vec![]; - for i in parts.iter_mut().skip(1) { - let (num_len, expression_index) = read_number(i, &style_info.is_expr_property); - final_expressions.push(style_info.expressions[expression_index].clone()); - let substr = &i[num_len + 2..]; - *i = substr; - } - - Ok(Expr::Tpl(Tpl { - quasis: parts - .iter() - .map(|quasi| { - TplElement { - cooked: None, // ? Do we need cooked as well - raw: quasi.replace('`', "\\`").into(), - span: DUMMY_SP, - tail: false, - } - }) - .collect(), - exprs: final_expressions, - span: DUMMY_SP, - })) -} - -struct Namespacer { - class_name: String, - is_global: bool, - is_dynamic: bool, -} - -impl VisitMut for Namespacer { - fn visit_mut_complex_selector(&mut self, node: &mut ComplexSelector) { - #[cfg(debug_assertions)] - let _tracing = { - // This will add information to the log messages, only for debug build. - // Note that we use cargo feature to remove all logging on production builds. - - let mut code = String::new(); - { - let mut wr = BasicCssWriter::new(&mut code, None, BasicCssWriterConfig::default()); - let mut gen = CodeGenerator::new(&mut wr, CodegenConfig { minify: true }); - - gen.emit(&*node).unwrap(); - } - - tracing::span!( - tracing::Level::TRACE, - "Namespacer::visit_mut_complex_selector", - class_name = &*self.class_name, - is_global = self.is_global, - is_dynamic = self.is_dynamic, - input = &*code - ) - .entered() - }; - - let mut new_selectors = vec![]; - let mut combinator = None; - - for sel in node.children.take() { - match &sel { - ComplexSelectorChildren::CompoundSelector(selector) => { - match self.get_transformed_selectors(combinator, selector.clone()) { - Ok(transformed_selectors) => new_selectors.extend(transformed_selectors), - Err(_) => { - HANDLER.with(|handler| { - handler - .struct_span_err( - selector.span, - "Failed to transform one off global selector", - ) - .emit() - }); - new_selectors.push(sel); - } - } - - combinator = None; - } - ComplexSelectorChildren::Combinator(v) => { - combinator = Some(v.clone()); - } - }; - } - - node.children = new_selectors; - } -} - -impl Namespacer { - fn get_transformed_selectors( - &mut self, - combinator: Option, - mut node: CompoundSelector, - ) -> Result, Error> { - let mut pseudo_index = None; - - for (i, selector) in node.subclass_selectors.iter().enumerate() { - let (name, children) = match &selector { - SubclassSelector::PseudoClass(PseudoClassSelector { - name, - children: Some(children), - .. - }) if &name.value == "global" => (name, children), - SubclassSelector::PseudoClass(_) | SubclassSelector::PseudoElement(_) => { - if pseudo_index.is_none() { - pseudo_index = Some(i); - } - - continue; - } - _ => continue, - }; - - // One off global selector - if &name.value == "global" { - // TODO(alexander-akait): in future we should use list of component values - let tokens = children - .iter() - .map(|v| match v { - PseudoClassSelectorChildren::PreservedToken(v) => v.clone(), - _ => { - unreachable!(); - } - }) - .collect::>(); - let mut tokens = { - let lo = tokens.first().map(|v| v.span_lo()).unwrap_or(BytePos(0)); - let hi = tokens.last().map(|v| v.span_hi()).unwrap_or(BytePos(0)); - - Tokens { - span: Span::new(lo, hi), - tokens, - } - }; - - // Because it is allowed to write `.bar :global(> .foo) {}` or .bar - // :global(.foo) {}`, so selector can be complex or relative (it violates the - // specification), but it is popular usage, so we just add `a >` at top and then - // remove it - let mut front_tokens = get_front_selector_tokens(&tokens); - - front_tokens.extend(tokens.tokens); - - tokens.tokens = front_tokens; - - let complex_selectors = panic::catch_unwind(|| { - let x: ComplexSelector = parse_input( - InputType::Tokens(&tokens), - ParserConfig { - allow_wrong_line_comments: true, - css_modules: true, - legacy_nesting: true, - ..Default::default() - }, - // TODO(kdy1): We might be able to report syntax errors. - &mut vec![], - ) - .unwrap(); - x - }); - - return match complex_selectors { - Ok(complex_selectors) => { - let mut v = complex_selectors.children[1..].to_vec(); - - if let ComplexSelectorChildren::Combinator(Combinator { - value: CombinatorValue::Descendant, - .. - }) = v[0] - { - v.remove(0); - } - - if v.is_empty() { - bail!("Failed to transform one off global selector"); - } - - trace!("Combinator: {:?}", combinator); - trace!("v[0]: {:?}", v[0]); - - let mut result = vec![]; - - if let Some(combinator) = combinator { - match v.first() { - // `Descendant` combinator can't be the first because we removed it - // above - Some(ComplexSelectorChildren::Combinator(..)) - if combinator.value == CombinatorValue::Descendant => {} - _ => { - result.push(ComplexSelectorChildren::Combinator(combinator)); - } - } - } - - v.iter_mut().for_each(|sel| { - if i < node.subclass_selectors.len() { - if let ComplexSelectorChildren::CompoundSelector(sel) = sel { - sel.subclass_selectors - .extend(node.subclass_selectors[i + 1..].iter().cloned()); - } - } - }); - - result.extend(v); - - Ok(result) - } - Err(_) => bail!("Failed to transform one off global selector"), - }; - } - } - - let subclass_selector = match self.is_dynamic { - true => "__jsx-style-dynamic-selector", - false => &self.class_name, - }; - let insert_index = match pseudo_index { - None => node.subclass_selectors.len(), - Some(i) => i, - }; - - if !self.is_global { - node.subclass_selectors.insert( - insert_index, - SubclassSelector::Class(ClassSelector { - span: DUMMY_SP, - text: Ident { - raw: Some(subclass_selector.into()), - value: subclass_selector.into(), - span: DUMMY_SP, - }, - }), - ); - } - - let mut result = vec![]; - - if let Some(combinator) = combinator { - result.push(ComplexSelectorChildren::Combinator(combinator)); - } - - result.push(ComplexSelectorChildren::CompoundSelector(node)); - - Ok(result) - } -} - -fn get_front_selector_tokens(selector_tokens: &Tokens) -> Vec { - let start_pos = selector_tokens.span.lo.to_u32() - 2; - vec![ - TokenAndSpan { - span: Span { - lo: BytePos(start_pos), - hi: BytePos(start_pos + 1), - }, - token: Token::Ident { - raw: "a".into(), - value: "a".into(), - }, - }, - TokenAndSpan { - span: Span { - lo: BytePos(start_pos + 1), - hi: BytePos(start_pos + 2), - }, - token: Token::WhiteSpace { value: " ".into() }, - }, - ] -} diff --git a/packages/styled-jsx/transform/src/visitor.rs b/packages/styled-jsx/transform/src/visitor.rs index 3fc1037fb..8365479b2 100644 --- a/packages/styled-jsx/transform/src/visitor.rs +++ b/packages/styled-jsx/transform/src/visitor.rs @@ -30,9 +30,6 @@ use crate::{ #[derive(Debug, Clone, Copy, Default, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Config { - #[serde(default)] - pub use_lightningcss: bool, - #[serde(default)] pub browsers: Versions, } @@ -609,24 +606,14 @@ impl StyledJSXTransformer<'_> { match &style_info { JSXStyle::Local(style_info) => { - let css = if self.config.use_lightningcss { - crate::transform_css_lightningcss::transform_css( - self.cm.clone(), - style_info, - is_global, - &self.static_class_name, - &self.config.browsers, - self.native_config, - )? - } else { - crate::transform_css_swc::transform_css( - self.cm.clone(), - style_info, - is_global, - &self.static_class_name, - self.native_config, - )? - }; + let css = crate::transform_css_lightningcss::transform_css( + self.cm.clone(), + style_info, + is_global, + &self.static_class_name, + &self.config.browsers, + self.native_config, + )?; Ok(make_local_styled_jsx_el( style_info, @@ -677,24 +664,14 @@ impl StyledJSXTransformer<'_> { bail!("This shouldn't happen, we already know that this is a template literal"); }; - let css = if self.config.use_lightningcss { - crate::transform_css_lightningcss::transform_css( - self.cm.clone(), - style, - tag == "global", - &static_class_name, - &self.config.browsers, - self.native_config, - )? - } else { - crate::transform_css_swc::transform_css( - self.cm.clone(), - style, - tag == "global", - &static_class_name, - self.native_config, - )? - }; + let css = crate::transform_css_lightningcss::transform_css( + self.cm.clone(), + style, + tag == "global", + &static_class_name, + &self.config.browsers, + self.native_config, + )?; if tag == "resolve" { self.file_has_css_resolve = true; return Ok(Expr::Object(ObjectLit { diff --git a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.js deleted file mode 100644 index 84e2e48f7..000000000 --- a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.js +++ /dev/null @@ -1,32 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Component = ()=><> -
- - <_JSXStyle id={styles.__hash}>{styles} - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} - -

- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

-
-
-

- Welcome! - -

- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -
-
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

- Hello world! - -

-
-
- <> - - - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -
- ; diff --git a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.js b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.js deleted file mode 100644 index 84e2e48f7..000000000 --- a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.js +++ /dev/null @@ -1,32 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Component = ()=><> -
- - <_JSXStyle id={styles.__hash}>{styles} - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} - -

- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

-
-
-

- Welcome! - -

- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -
-
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

- Hello world! - -

-
-
- <> - - - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -
- ; diff --git a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.stderr deleted file mode 100644 index 0f74c1e2c..000000000 --- a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-swc.stderr +++ /dev/null @@ -1,24 +0,0 @@ - x Detected nested styled-jsx tag. - | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:15:1] - 14 | Welcome! - 15 | - : ^^^^^^^^^^^^^^^^^^^^^^^ - 16 | - `---- - x Detected nested styled-jsx tag. - | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:23:1] - 22 | Hello world! - 23 | - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 24 | - `---- - x Detected nested styled-jsx tag. - | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:28:1] - 27 | <> - 28 | - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 29 | - `---- diff --git a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output.js b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output.js index ff5f0e30b..84e2e48f7 100644 --- a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output.js +++ b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output.js @@ -1,42 +1,32 @@ import _JSXStyle from "styled-jsx/style"; -const Component = () => ( - <> +const Component = ()=><>
<_JSXStyle id={styles.__hash}>{styles} - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

<_JSXStyle id={"b3e1b6a7c9b96113"}>{""}

-

Welcome!

- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}
-
<_JSXStyle id={"b3e1b6a7c9b96113"}>{""} -

Hello world!

-
<> - <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}
- -); + ; diff --git a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/nested-style-tags/output.stderr diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.js deleted file mode 100644 index c6cbf3462..000000000 --- a/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output-swc.js b/packages/styled-jsx/transform/tests/errors/no-child/output-swc.js deleted file mode 100644 index c6cbf3462..000000000 --- a/packages/styled-jsx/transform/tests/errors/no-child/output-swc.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/no-child/output-swc.stderr deleted file mode 100644 index 8536708b9..000000000 --- a/packages/styled-jsx/transform/tests/errors/no-child/output-swc.stderr +++ /dev/null @@ -1,8 +0,0 @@ - x Expected one child under JSX style tag, but got 0. - | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:3:1] - 2 |
- 3 | - : ^^^^^^^^^^^^^^^^^^^ - 4 |
- `---- diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output.js b/packages/styled-jsx/transform/tests/errors/no-child/output.js index 680b9f1cd..c6cbf3462 100644 --- a/packages/styled-jsx/transform/tests/errors/no-child/output.js +++ b/packages/styled-jsx/transform/tests/errors/no-child/output.js @@ -1,6 +1,4 @@ import _JSXStyle from "styled-jsx/style"; -export default () => ( -
+export default (()=>
-
-); +
); diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/no-child/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/no-child/output.stderr diff --git a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-lightningcss.js deleted file mode 100644 index f7b857a45..000000000 --- a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-lightningcss.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default { - styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{color:#fff;background:#000;height:100px;font-weight:700}"}, - className: "jsx-71f03d42ea0ec6" -}; diff --git a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.js b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.js deleted file mode 100644 index 6fbd823e7..000000000 --- a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default { - styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{background:#000;color:white;font-weight:700;height:100px}"}, - className: "jsx-71f03d42ea0ec6" -}; diff --git a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.stderr deleted file mode 100644 index 5f86a57a7..000000000 --- a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.stderr +++ /dev/null @@ -1 +0,0 @@ - x /some-project/src/some-file.ts uses `css.resolve`, but ends with `.ts`. The file extension needs to be `.tsx` so that the jsx injected by `css.resolve` will be transformed. diff --git a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.js b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.js index 05f02f26e..f7b857a45 100644 --- a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.js +++ b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.js @@ -1,11 +1,5 @@ import _JSXStyle from "styled-jsx/style"; export default { - styles: ( - <_JSXStyle id={"71f03d42ea0ec6"}> - { - ".container.jsx-71f03d42ea0ec6{background:#000;color:white;font-weight:700;height:100px}" - } - - ), - className: "jsx-71f03d42ea0ec6", + styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{color:#fff;background:#000;height:100px;font-weight:700}"}, + className: "jsx-71f03d42ea0ec6" }; diff --git a/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output.stderr diff --git a/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.js deleted file mode 100644 index 859ecdf97..000000000 --- a/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.js +++ /dev/null @@ -1,13 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/two-children/output-swc.js b/packages/styled-jsx/transform/tests/errors/two-children/output-swc.js deleted file mode 100644 index 859ecdf97..000000000 --- a/packages/styled-jsx/transform/tests/errors/two-children/output-swc.js +++ /dev/null @@ -1,13 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/two-children/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/two-children/output-swc.stderr deleted file mode 100644 index e458fbb6f..000000000 --- a/packages/styled-jsx/transform/tests/errors/two-children/output-swc.stderr +++ /dev/null @@ -1,16 +0,0 @@ - x Expected one child under JSX style tag, but got 2. - | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:3:1] - 2 |
- 3 | ,-> - 13 |
- `---- diff --git a/packages/styled-jsx/transform/tests/errors/two-children/output.js b/packages/styled-jsx/transform/tests/errors/two-children/output.js index b9a550543..859ecdf97 100644 --- a/packages/styled-jsx/transform/tests/errors/two-children/output.js +++ b/packages/styled-jsx/transform/tests/errors/two-children/output.js @@ -1,16 +1,13 @@ import _JSXStyle from "styled-jsx/style"; -export default () => ( -
+export default (()=>
-
-); +
); diff --git a/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/two-children/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/two-children/output.stderr diff --git a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-lightningcss.js deleted file mode 100644 index 697f8041d..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-lightningcss.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.js b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.js deleted file mode 100644 index 697f8041d..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.stderr deleted file mode 100644 index 9223357cb..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-swc.stderr +++ /dev/null @@ -1,8 +0,0 @@ - x Expected a single child of type JSXExpressionContainer under JSX Style tag. - | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:3:1] - 2 |
- 3 | - : ^^^^^^^^^^^^^^^^^^^^^ - 4 |
- `---- diff --git a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output.js b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output.js index 880bce70a..697f8041d 100644 --- a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output.js +++ b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output.js @@ -1,6 +1,4 @@ import _JSXStyle from "styled-jsx/style"; -export default () => ( -
+export default (()=>
-
-); +
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-child-type/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/wrong-child-type/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/wrong-child-type/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/wrong-child-type/output.stderr diff --git a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.js b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.js deleted file mode 100644 index 02963b2f4..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.js b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.js deleted file mode 100644 index 02963b2f4..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.js +++ /dev/null @@ -1,4 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
- -
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.stderr b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.stderr deleted file mode 100644 index 903b10df9..000000000 --- a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-swc.stderr +++ /dev/null @@ -1,8 +0,0 @@ - x Expected a template literal, string or identifier inside the JSXExpressionContainer. - | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:3:1] - 2 |
- 3 | - : ^^^^^^^^^^^^^^^^^^^^^^^ - 4 |
- `---- diff --git a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.js b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.js index 8adefa2fb..02963b2f4 100644 --- a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.js +++ b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.js @@ -1,6 +1,4 @@ import _JSXStyle from "styled-jsx/style"; -export default () => ( -
+export default (()=>
-
-); +
); diff --git a/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.stderr rename to packages/styled-jsx/transform/tests/errors/wrong-jsx-expression-type/output.stderr diff --git a/packages/styled-jsx/transform/tests/fixture.rs b/packages/styled-jsx/transform/tests/fixture.rs index c5defaae4..ef38dcb42 100644 --- a/packages/styled-jsx/transform/tests/fixture.rs +++ b/packages/styled-jsx/transform/tests/fixture.rs @@ -1,9 +1,7 @@ use std::path::PathBuf; -use anyhow::bail; -use lightningcss::stylesheet::ParserOptions; use preset_env_base::Versions; -use styled_jsx::visitor::{styled_jsx, NativeConfig}; +use styled_jsx::visitor::styled_jsx; use swc_common::{FileName, Mark, Span, DUMMY_SP}; use swc_ecma_parser::{EsSyntax, Syntax}; use swc_ecma_transforms::resolver; @@ -17,13 +15,8 @@ fn syntax() -> Syntax { }) } -fn run(input: PathBuf, use_lightningcss: bool) { - let output = input.parent().unwrap().join(if use_lightningcss { - "output.lightningcss.js" - } else { - "output.swc.js" - }); - +fn run(input: PathBuf) { + let output = input.parent().unwrap().join("output.js"); let browsers = Versions { chrome: Some("64".parse().unwrap()), edge: Some("79".parse().unwrap()), @@ -35,47 +28,9 @@ fn run(input: PathBuf, use_lightningcss: bool) { }; let file_name = FileName::Real(PathBuf::from("/some-project/src/some-file.js")); - let config = styled_jsx::visitor::Config { - use_lightningcss, - browsers, - }; + let config = styled_jsx::visitor::Config { browsers }; - let native_config = if use_lightningcss { - Default::default() - } else { - NativeConfig { - process_css: Some(Box::new(move |css| { - let ss = lightningcss::stylesheet::StyleSheet::parse( - css, - ParserOptions { - error_recovery: true, - ..Default::default() - }, - ); - - let ss = match ss { - Ok(v) => v, - Err(err) => { - bail!( - "failed to parse css using lightningcss: {}\nCode: {}", - err, - css - ) - } - }; - - let output = ss.to_css(lightningcss::stylesheet::PrinterOptions { - minify: true, - source_map: None, - project_root: None, - targets: Default::default(), - analyze_dependencies: None, - pseudo_classes: None, - })?; - Ok(output.code) - })), - } - }; + let native_config = Default::default(); test_fixture( syntax(), @@ -97,12 +52,7 @@ fn run(input: PathBuf, use_lightningcss: bool) { #[fixture("tests/fixture/**/input.js")] fn styled_jsx_fixture_lightningcs(input: PathBuf) { - run(input, true); -} - -#[fixture("tests/fixture/**/input.js")] -fn styled_jsx_fixture_swc(input: PathBuf) { - run(input, false); + run(input); } pub struct DropSpan; @@ -118,31 +68,10 @@ fn styled_jsx_errors(input: PathBuf) { true => FileName::Real(PathBuf::from("/some-project/src/some-file.ts")), false => FileName::Real(PathBuf::from("/some-project/src/some-file.js")), }; - { - let output = input.parent().unwrap().join("output-swc.js"); - let config = styled_jsx::visitor::Config { - use_lightningcss: false, - ..Default::default() - }; - let native_config = Default::default(); - - test_fixture( - syntax(), - &|t| styled_jsx(t.cm.clone(), &file_name, &config, &native_config), - &input, - &output, - FixtureTestConfig { - allow_error: true, - module: Some(true), - ..Default::default() - }, - ); - } { - let output = input.parent().unwrap().join("output-lightningcss.js"); + let output = input.parent().unwrap().join("output.js"); let config = styled_jsx::visitor::Config { - use_lightningcss: true, ..Default::default() }; let native_config = Default::default(); diff --git a/packages/styled-jsx/transform/tests/fixture/absent/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/absent/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/absent/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/absent/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/absent/output.swc.js b/packages/styled-jsx/transform/tests/fixture/absent/output.swc.js deleted file mode 100644 index 7c390a192..000000000 --- a/packages/styled-jsx/transform/tests/fixture/absent/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -const a = ()=>
-

hi

- -
; diff --git a/packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.swc.js b/packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.swc.js deleted file mode 100644 index d9d6fda87..000000000 --- a/packages/styled-jsx/transform/tests/fixture/attribute-generation-classname-rewriting/output.swc.js +++ /dev/null @@ -1,63 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>{ - const Element = "div"; - return
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - <_JSXStyle id={"abb4c2202db1a207"}>{"div.jsx-abb4c2202db1a207{color:red}"} -
; -}); diff --git a/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.swc.js b/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.swc.js deleted file mode 100644 index 81d00a1c1..000000000 --- a/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.swc.js +++ /dev/null @@ -1,188 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import styles from "./styles"; -const styles2 = require("./styles2"); -// external only -export const Test1 = ()=>
-

external only

- <_JSXStyle id={styles.__hash}>{styles} - <_JSXStyle id={styles2.__hash}>{styles2} -
; -// external and static -export const Test2 = ()=>
-

external and static

- <_JSXStyle id={"81a68341e430a972"}>{"p.jsx-81a68341e430a972{color:red}"} - <_JSXStyle id={styles.__hash}>{styles} -
; -// external and dynamic -export const Test3 = ({ color })=>
-

external and dynamic

- <_JSXStyle id={"204185c862cdf019"} dynamic={[ - color - ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} - <_JSXStyle id={styles.__hash}>{styles} -
; -// external, static and dynamic -export const Test4 = ({ color })=>
-

external, static and dynamic

- <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"} - <_JSXStyle id={"d2507fa4cfbd96c1"} dynamic={[ - color - ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} - <_JSXStyle id={styles.__hash}>{styles} -
; -// static only -export const Test5 = ()=>
-

static only

- <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-df0159ebd3f9fb6f{display:inline-block}"} - <_JSXStyle id={"81a68341e430a972"}>{"p.jsx-df0159ebd3f9fb6f{color:red}"} -
; -// static and dynamic -export const Test6 = ({ color })=>
-

static and dynamic

- <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"} - <_JSXStyle id={"c6539201a72349bb"} dynamic={[ - color - ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} -
; -// dynamic only -export const Test7 = ({ color })=>
-

dynamic only

- <_JSXStyle id={"d693f0069164030f"} dynamic={[ - color - ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} -
; -// dynamic with scoped compound variable -export const Test8 = ({ color })=>{ - if (color) { - const innerProps = { - color - }; - return
-

dynamic with scoped compound variable

- <_JSXStyle id={"72e709a3d399a385"} dynamic={[ - innerProps.color - ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`} -
; - } -}; -// dynamic with compound variable -export const Test9 = ({ color })=>{ - const innerProps = { - color - }; - return
-

dynamic with compound variable

- <_JSXStyle id={"e32f6a22d3c7cf33"} dynamic={[ - innerProps.color - ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`} -
; -}; -const foo = "red"; -// dynamic with constant variable -export const Test10 = ()=>
-

dynamic with constant variable

- <_JSXStyle id={"f951557e30d3e47c"}>{`p.jsx-f951557e30d3e47c{color:${foo}}`} -
; -// dynamic with complex scope -export const Test11 = ({ color })=>{ - const items = Array.from({ - length: 5 - }).map((item, i)=>
  • - <_JSXStyle id={"2b920e3847a9f530"} dynamic={[ - color - ]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`} - Item #{i + 1} -
  • ); - return
      {items}
    ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.swc.js b/packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.swc.js deleted file mode 100644 index 0824b3d6d..000000000 --- a/packages/styled-jsx/transform/tests/fixture/basic-variables-in-css/output.swc.js +++ /dev/null @@ -1,32 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - const width = 100; - const height = 200; - const color = '#FF0000'; - return
    -

    Basic Variables Test

    - <_JSXStyle id={"1f03eb09b28338e"} dynamic={[ - width, - height, - color - ]}>{`.component.__jsx-style-dynamic-selector{width:${width}px;height:${height}px;color:${color}}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/class/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/class/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/class/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/class/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/class/output.swc.js b/packages/styled-jsx/transform/tests/fixture/class/output.swc.js deleted file mode 100644 index ef0d74f9c..000000000 --- a/packages/styled-jsx/transform/tests/fixture/class/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"b2b86d63f35d25ee"}>{"p.jsx-b2b86d63f35d25ee{color:red}"} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/1/output.swc.js deleted file mode 100644 index a965bfff8..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/1/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"1952086b0a5ae64c"}>{"p.jsx-1952086b0a5ae64c{color:red}"} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/2/output.swc.js deleted file mode 100644 index 727f512ff..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/2/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable-next-line import/no-default-export -- TODO: Fix ESLint Error (#13355) */ import _JSXStyle from "styled-jsx/style"; -export default function ReactCropStyle() { - return <_JSXStyle id={"98af2a12ea19ce8a"}>{".ReactCrop__crop-selection{border-image-source:url(data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==)}"}; -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/3/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/3/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/3/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/3/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/3/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/3/output.swc.js deleted file mode 100644 index 59730cf10..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/3/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable-next-line import/no-default-export -- TODO: Fix ESLint Error (#13355) */ import _JSXStyle from "styled-jsx/style"; -export default function ReactCropStyle() { - return <_JSXStyle id={"d89743bebc326687"}>{".ReactCrop__crop-selection{border-image-source:url(https://example.com/image.png)}"}; -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/4/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/4/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/4/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/4/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/4/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/4/output.swc.js deleted file mode 100644 index ed8e64c03..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/4/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable-next-line import/no-default-export -- TODO: Fix ESLint Error (#13355) */ import _JSXStyle from "styled-jsx/style"; -export default function ReactCropStyle() { - return <_JSXStyle id={"c7434927b24ae3e0"}>{".ReactCrop__crop-selection{border-image-source:url(data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==)}"}; -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/5/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/5/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/5/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/5/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/5/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/5/output.swc.js deleted file mode 100644 index 9d93dcbf3..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/5/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable-next-line import/no-default-export -- TODO: Fix ESLint Error (#13355) */ import _JSXStyle from "styled-jsx/style"; -export default function ReactCropStyle() { - return <_JSXStyle id={"30442c7d82bfaf7f"}>{".ReactCrop__crop-selection{background:red}"}; -} diff --git a/packages/styled-jsx/transform/tests/fixture/comments/6/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/comments/6/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/comments/6/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/comments/6/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/comments/6/output.swc.js b/packages/styled-jsx/transform/tests/fixture/comments/6/output.swc.js deleted file mode 100644 index ef28ac1e1..000000000 --- a/packages/styled-jsx/transform/tests/fixture/comments/6/output.swc.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable-next-line import/no-default-export -- TODO: Fix ESLint Error (#13355) */ import _JSXStyle from "styled-jsx/style"; -export default function ReactCropStyle() { - return <_JSXStyle id={"aafe371d005b29c3"}>{".ReactCrop__crop-selection{background:red}"}; -} diff --git a/packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.swc.js b/packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.swc.js deleted file mode 100644 index c78c925f6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/complex-animation-keyframes/output.swc.js +++ /dev/null @@ -1,40 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - const middleOpacity = 0.5; - const rotation = 180; - const duration = 1000; - const easing = 'ease-in-out'; - const delay = 200; - return
    -
    Animated Element
    - <_JSXStyle id={"c01d10e0e0c03897"} dynamic={[ - middleOpacity, - rotation, - duration, - easing, - delay - ]}>{`@-webkit-keyframes customAnimation{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}50%{opacity:${middleOpacity};-webkit-transform:rotate(${rotation}deg);transform:rotate(${rotation}deg)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-moz-keyframes customAnimation{0%{opacity:0;-moz-transform:scale(0);transform:scale(0)}50%{opacity:${middleOpacity};-moz-transform:rotate(${rotation}deg);transform:rotate(${rotation}deg)}to{opacity:1;-moz-transform:scale(1);transform:scale(1)}}@-o-keyframes customAnimation{0%{opacity:0;-o-transform:scale(0);transform:scale(0)}50%{opacity:${middleOpacity};-o-transform:rotate(${rotation}deg);transform:rotate(${rotation}deg)}to{opacity:1;-o-transform:scale(1);transform:scale(1)}}@keyframes customAnimation{0%{opacity:0;-webkit-transform:scale(0);-moz-transform:scale(0);-o-transform:scale(0);transform:scale(0)}50%{opacity:${middleOpacity};-webkit-transform:rotate(${rotation}deg);-moz-transform:rotate(${rotation}deg);-o-transform:rotate(${rotation}deg);transform:rotate(${rotation}deg)}to{opacity:1;-webkit-transform:scale(1);-moz-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}.wrapper.__jsx-style-dynamic-selector{}.wrapper.__jsx-style-dynamic-selector .animated.__jsx-style-dynamic-selector{-webkit-animation:customAnimation ${duration}ms ${easing} forwards;-moz-animation:customAnimation ${duration}ms ${easing} forwards;-o-animation:customAnimation ${duration}ms ${easing} forwards;animation:customAnimation ${duration}ms ${easing} forwards;-webkit-animation-delay:${delay}ms;-moz-animation-delay:${delay}ms;-o-animation-delay:${delay}ms;animation-delay:${delay}ms}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/component-attribute/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/component-attribute/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/component-attribute/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/component-attribute/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/component-attribute/output.swc.js b/packages/styled-jsx/transform/tests/fixture/component-attribute/output.swc.js deleted file mode 100644 index db3002136..000000000 --- a/packages/styled-jsx/transform/tests/fixture/component-attribute/output.swc.js +++ /dev/null @@ -1,6 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - - <_JSXStyle id={"a9535d7d5f32c3c4"}>{"span.jsx-a9535d7d5f32c3c4{color:red}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/conflicts/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/conflicts/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/conflicts/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/conflicts/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/conflicts/output.swc.js b/packages/styled-jsx/transform/tests/fixture/conflicts/output.swc.js deleted file mode 100644 index 874cf34f5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/conflicts/output.swc.js +++ /dev/null @@ -1,14 +0,0 @@ -// TODO -// export const _JSXStyle = '_JSXStyle-literal' -// export default function() { -// return ( -//
    -//

    test

    -// -//
    -// ) -// } diff --git a/packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.swc.js b/packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.swc.js deleted file mode 100644 index 64834e036..000000000 --- a/packages/styled-jsx/transform/tests/fixture/css-selector-after-pseudo/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -function NavigationItem({ active, className }) { - return - <_JSXStyle id={"e73bf96b356a8634"}>{'.navigation-item.jsx-e73bf96b356a8634 a:after{content:attr(data-text);content:attr(data-text)/""}'} - ; -} -export default NavigationItem; diff --git a/packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.swc.js b/packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.swc.js deleted file mode 100644 index 95d731ea3..000000000 --- a/packages/styled-jsx/transform/tests/fixture/css-tag-same-file/output.swc.js +++ /dev/null @@ -1,15 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (({ children })=>
    -

    {children}

    - <_JSXStyle id={styles.__hash}>{styles} -
    ); -const styles = new String("p.jsx-556239d258b6d66a{color:red}"); -styles.__hash = "556239d258b6d66a"; -class Test extends React.Component { - render() { - return
    -

    {this.props.children}

    - <_JSXStyle id={styles.__hash}>{styles} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.swc.js b/packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.swc.js deleted file mode 100644 index 42da3eb95..000000000 --- a/packages/styled-jsx/transform/tests/fixture/css-variables-and-functions/output.swc.js +++ /dev/null @@ -1,43 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - const dynamicValue = '"dynamic content"'; - const color1 = '#FF0000'; - const color2 = '#0000FF'; - const offset = 5; - const spacing = 10; - return
    -
    CSS Variables and Functions
    - <_JSXStyle id={"906d88069a2f1c7e"} dynamic={[ - dynamicValue, - color1, - color2, - offset, - offset, - spacing - ]}>{`.container.__jsx-style-dynamic-selector{--local-var:${dynamicValue};color:var(--text-color);background:-webkit-linear-gradient(left,${color1},${color2});background:-moz-linear-gradient(left,${color1},${color2});background:-o-linear-gradient(left,${color1},${color2});background:linear-gradient(to right,${color1},${color2})}.container.__jsx-style-dynamic-selector .item.__jsx-style-dynamic-selector{-webkit-transform:translate(-webkit-calc(var(--x) + ${offset}px),-webkit-calc(var(--y) + ${offset}px));-moz-transform:translate(-moz-calc(var(--x) + ${offset}px),-moz-calc(var(--y) + ${offset}px));-ms-transform:translate(calc(var(--x) + ${offset}px),calc(var(--y) + ${offset}px));-o-transform:translate(calc(var(--x) + ${offset}px),calc(var(--y) + ${offset}px));transform:translate(-webkit-calc(var(--x) + ${offset}px),-webkit-calc(var(--y) + ${offset}px));transform:translate(-moz-calc(var(--x) + ${offset}px),-moz-calc(var(--y) + ${offset}px));transform:translate(calc(var(--x) + ${offset}px),calc(var(--y) + ${offset}px))}.container.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{margin:-webkit-calc(10px + ${spacing}px);margin:-moz-calc(10px + ${spacing}px);margin:calc(10px + ${spacing}px)}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.swc.js b/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.swc.js deleted file mode 100644 index 28bf7490a..000000000 --- a/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.swc.js +++ /dev/null @@ -1,15 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const color = "red"; -const otherColor = "green"; -const A = ()=>
    -

    test

    - <_JSXStyle id={"6b8b91efa51734b5"}>{`p.jsx-6b8b91efa51734b5{color:${color}}`} -
    ; -const B = ()=>
    -

    test

    - <_JSXStyle id={"366f6aa79b958630"}>{`p.jsx-366f6aa79b958630{color:${otherColor}}`} -
    ; -export default (()=>); diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.swc.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.swc.js deleted file mode 100644 index c922735ac..000000000 --- a/packages/styled-jsx/transform/tests/fixture/dynamic-element-class/output.swc.js +++ /dev/null @@ -1,19 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - const Element = "div"; - return -

    dynamic element

    - <_JSXStyle id={"f825b24bbab5b83b"}>{".root.jsx-f825b24bbab5b83b{background:red}"} -
    ; - } -} -const Element2 = "div"; -export const Test2 = class { - render() { - return -

    dynamic element

    - <_JSXStyle id={"f825b24bbab5b83b"}>{".root.jsx-f825b24bbab5b83b{background:red}"} -
    ; - } -}; diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.swc.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.swc.js deleted file mode 100644 index 76e47f1f1..000000000 --- a/packages/styled-jsx/transform/tests/fixture/dynamic-element-external/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import styles from "./styles2"; -export default (({ level = 1 })=>{ - const Element = `h${level}`; - return -

    dynamic element

    - <_JSXStyle id={styles.__hash}>{styles} -
    ; -}); diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/dynamic-element/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/dynamic-element/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-element/output.swc.js b/packages/styled-jsx/transform/tests/fixture/dynamic-element/output.swc.js deleted file mode 100644 index 4a858c24c..000000000 --- a/packages/styled-jsx/transform/tests/fixture/dynamic-element/output.swc.js +++ /dev/null @@ -1,28 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (({ level = 1 })=>{ - const Element = `h${level}`; - return -

    dynamic element

    - <_JSXStyle id={"fca64cc3f069b519"}>{".root.jsx-fca64cc3f069b519{background:red}"} -
    ; -}); -export const TestLowerCase = ({ level = 1 })=>{ - const element1 = `h${level}`; - return -

    dynamic element

    - <_JSXStyle id={"fca64cc3f069b519"}>{".root.jsx-fca64cc3f069b519{background:red}"} -
    ; -}; -const Element2 = "div"; -export const Test2 = ()=>{ - return -

    dynamic element

    - <_JSXStyle id={"fca64cc3f069b519"}>{".root.jsx-fca64cc3f069b519{background:red}"} -
    ; -}; -export const Test3 = ({ Component = "div" })=>{ - return -

    dynamic element

    - <_JSXStyle id={"fca64cc3f069b519"}>{".root.jsx-fca64cc3f069b519{background:red}"} -
    ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.swc.js b/packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.swc.js deleted file mode 100644 index 11fc44ff6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/dynamic-this-in-arrow/output.swc.js +++ /dev/null @@ -1,39 +0,0 @@ -// TODO -// import React, { Component } from 'react' -// export default class Index extends Component { -// static getInitialProps() { -// return { color: 'aquamarine' } -// } -// render() { -// return ( -//
    -// {[1, 2].map(idx => ( -//
    -// {[3, 4].map(idx2 => ( -//
    {this.props.color}
    -// ))} -//
    -// ))} -// {[1, 2].map(idx => ( -//
    -//
    -// {this.props.color} -//
    -// -//
    -//
    {this.props.color} hello there
    -//
    -//
    -//
    -//
    -//
    -// ))} -// -//
    -// ) -// } -// } diff --git a/packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.swc.js b/packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.swc.js deleted file mode 100644 index 79908ec11..000000000 --- a/packages/styled-jsx/transform/tests/fixture/exported-jsx-style/output.swc.js +++ /dev/null @@ -1 +0,0 @@ -// module.exports = () =>

    diff --git a/packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.swc.js b/packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.swc.js deleted file mode 100644 index 42b1f9876..000000000 --- a/packages/styled-jsx/transform/tests/fixture/exported-non-jsx-style/output.swc.js +++ /dev/null @@ -1 +0,0 @@ -// module.exports = () =>

    diff --git a/packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.swc.js b/packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.swc.js deleted file mode 100644 index d14b13d73..000000000 --- a/packages/styled-jsx/transform/tests/fixture/external-nested-scope/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -function test() { - ({ - styles: <_JSXStyle id={"7b844396f2efe2ef"}>{"div.jsx-7b844396f2efe2ef{color:red}"}, - className: "jsx-7b844396f2efe2ef" - }); -} diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.swc.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.swc.js deleted file mode 100644 index 8a077d2fd..000000000 --- a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-global/output.swc.js +++ /dev/null @@ -1,11 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import styles, { foo as styles3 } from "./styles"; -const styles2 = require("./styles2"); -export default (()=>
    -

    test

    -
    woot
    -

    woot

    - <_JSXStyle id={styles2.__hash}>{styles2} - <_JSXStyle id={styles3.__hash}>{styles3} - <_JSXStyle id={styles.__hash}>{styles} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.swc.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.swc.js deleted file mode 100644 index bc0275b8f..000000000 --- a/packages/styled-jsx/transform/tests/fixture/external-stylesheet-multi-line/output.swc.js +++ /dev/null @@ -1,6 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import styles from "./styles"; -export default (()=>
    -

    test

    - <_JSXStyle id={styles.__hash}>{styles} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.swc.js b/packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.swc.js deleted file mode 100644 index 182e5d55a..000000000 --- a/packages/styled-jsx/transform/tests/fixture/external-stylesheet/output.swc.js +++ /dev/null @@ -1,20 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import styles from "./styles"; -const styles2 = require("./styles2"); -import { foo as styles3 } from "./styles"; -export default (()=>
    -

    test

    -

    woot

    - <_JSXStyle id={styles2.__hash}>{styles2} - <_JSXStyle id={styles3.__hash}>{styles3} -
    woot
    - <_JSXStyle id={"bee92b62eadf8a14"}>{"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"} - <_JSXStyle id={styles.__hash}>{styles} -
    ); -export const Test = ()=>
    -

    test

    -

    woot

    - <_JSXStyle id={styles3.__hash}>{styles3} -
    woot
    - <_JSXStyle id={"bee92b62eadf8a14"}>{"p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/fragment/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/fragment/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/fragment/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/fragment/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/fragment/output.swc.js b/packages/styled-jsx/transform/tests/fixture/fragment/output.swc.js deleted file mode 100644 index 0d3b290a6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/fragment/output.swc.js +++ /dev/null @@ -1,28 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import React from "react"; -export default (()=><> -

    Testing!!!

    -

    Bar

    - <> - - -

    hello

    - <> -

    foo

    -

    bar

    - -

    world

    -
    - - <_JSXStyle id={"6dd5f97e085c0297"}>{"p.jsx-6dd5f97e085c0297{color:#0ff}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:#ff69b4}#head.jsx-6dd5f97e085c0297{text-decoration:underline}"} - ); -function Component1() { - return <> -
    test
    - ; -} -function Component2() { - return
    - <_JSXStyle id={"678f41ca6d3b294b"}>{"div.jsx-678f41ca6d3b294b{color:red}"} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/global-child-selector/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-child-selector/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-child-selector/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-child-selector/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-child-selector/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-child-selector/output.swc.js deleted file mode 100644 index a181fe063..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-child-selector/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"5a206f122d1cb32e"}>{"div.jsx-5a206f122d1cb32e>span{color:red}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-multiple/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-multiple/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-multiple/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-multiple/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-multiple/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-multiple/output.swc.js deleted file mode 100644 index 8d97ad058..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-multiple/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"3d9ecfaa448ef714"}>{".c1{background:orange!important}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.swc.js deleted file mode 100644 index cc4e881a7..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-2/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"9303248a3896bf50"}>{".parent.jsx-9303248a3896bf50{}.parent.jsx-9303248a3896bf50 div{}.parent.jsx-9303248a3896bf50 div.child{background:orange}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.swc.js deleted file mode 100644 index a21fa41d4..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-3/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"da58316599e32d09"}>{".parent.jsx-da58316599e32d09{}.parent.jsx-da58316599e32d09 div{}.parent.jsx-da58316599e32d09 div.child>.child2{background:orange}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.js similarity index 96% rename from packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.js index f7ba3ca16..0b77985f4 100644 --- a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.js @@ -2,4 +2,4 @@ import _JSXStyle from "styled-jsx/style"; const Test = ()=>
    test <_JSXStyle id={"b0a16d58836c444b"}>{".parent.jsx-b0a16d58836c444b div.child{background:orange}"} -
    ; \ No newline at end of file +
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.swc.js deleted file mode 100644 index 80fee8abb..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-nested-scope-sel/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"b0a16d58836c444b"}>{".parent.jsx-b0a16d58836c444b{}.parent.jsx-b0a16d58836c444b div{}.parent.jsx-b0a16d58836c444b div.child{background:orange}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-nested/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-nested/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-nested/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-nested/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-nested/output.swc.js deleted file mode 100644 index 17225ecca..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-nested/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - test - <_JSXStyle id={"258c8cca0b71d485"}>{".p1.jsx-258c8cca0b71d485{background:purple!important}.p1.jsx-258c8cca0b71d485 .c1,.p1.jsx-258c8cca0b71d485 .c2.jsx-258c8cca0b71d485{background:orange!important}"} -
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-redundant/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-redundant/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-redundant/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-redundant/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-redundant/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-redundant/output.swc.js deleted file mode 100644 index 19f094d8c..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-redundant/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function IndexPage() { - return
    - should be blue. - <_JSXStyle id={"b6abd0684ba81871"}>{"div{color:#00f}"} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/global-sel/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-sel/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-sel/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-sel/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-sel/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-sel/output.swc.js deleted file mode 100644 index 4560921d5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-sel/output.swc.js +++ /dev/null @@ -1,19 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=><> -
    -
    - .p1 -This is another parent. -
    - .c1 - This should be orange bg. -
    .c2 - This should be orange bg as well.
    -
    -
    - -
    - -

    Compiled CSS

    - {compiledCss ?
    {formatCss(compiledCss)}
    :

    Loading CSS...

    } -
    - - <_JSXStyle id={"60bae1dc4409a62b"}>{"#css-test-page-id.jsx-60bae1dc4409a62b{color:red}.p1.jsx-60bae1dc4409a62b{background:purple!important}.c1,.c2.jsx-60bae1dc4409a62b{background:orange!important}.container.jsx-60bae1dc4409a62b{max-width:1000px;margin:0 auto;padding:1rem}"} - ; diff --git a/packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.swc.js deleted file mode 100644 index cec54fef8..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global-styles-with-dynamic-values/output.swc.js +++ /dev/null @@ -1,53 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - const id = 'theme-1'; - const cssVariables = { - '--primary-color': '#0070f3', - '--secondary-color': '#ff0080' - }; - const stringifyCssVariablesObject = (obj)=>{ - return Object.entries(obj).map(([key, value])=>`${key}: ${value};`).join('\n'); - }; - const buttonColor = 'var(--primary-color)'; - const backgroundColor = '#f0f0f0'; - return
    - -
    Styled Div
    - <_JSXStyle id={"470be651447b69a1"} dynamic={[ - id, - stringifyCssVariablesObject(cssVariables), - buttonColor, - backgroundColor - ]}>{`.scope-${id}{${stringifyCssVariablesObject(cssVariables)}}.scope-${id} button{color:${buttonColor}}.scope-${id} div{background-color:${backgroundColor}}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/global/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/global/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/global/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/global/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/global/output.swc.js b/packages/styled-jsx/transform/tests/fixture/global/output.swc.js deleted file mode 100644 index 0bbf973e0..000000000 --- a/packages/styled-jsx/transform/tests/fixture/global/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=>
    - <_JSXStyle id={"f84dd0db2f59ea88"}>{"body{color:red}:hover{color:red;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-animation:1s ease-out foo;-moz-animation:1s ease-out foo;-o-animation:1s ease-out foo;animation:1s ease-out foo}div a{display:none}[data-test]>div{color:red}"} -
    ; -const Test2 = ()=><_JSXStyle id={"94239b6d6b42c9b5"}>{"p{color:red}"}; diff --git a/packages/styled-jsx/transform/tests/fixture/interpolation/1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/interpolation/1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/interpolation/1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/interpolation/1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/interpolation/1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/interpolation/1/output.swc.js deleted file mode 100644 index 78283bfba..000000000 --- a/packages/styled-jsx/transform/tests/fixture/interpolation/1/output.swc.js +++ /dev/null @@ -1,14 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - const breakpoint = "500px"; - return <> -
    - container (should be blue) -
    - responsive (purple on mobile, orange on desktop) -
    -
    - - <_JSXStyle id={"aa91a2d0605d400e"}>{`.container.jsx-aa91a2d0605d400e{color:#00f;padding:3rem}@media (width<=${breakpoint}){.container.jsx-aa91a2d0605d400e .responsive.jsx-aa91a2d0605d400e{color:purple}}`} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/interpolation/2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/interpolation/2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/interpolation/2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/interpolation/2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/interpolation/2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/interpolation/2/output.swc.js deleted file mode 100644 index c36767d81..000000000 --- a/packages/styled-jsx/transform/tests/fixture/interpolation/2/output.swc.js +++ /dev/null @@ -1,14 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - const breakpoint = "500px"; - return
    -
    - container (should be blue) -
    - responsive (purple on mobile, orange on desktop) -
    -
    - - <_JSXStyle id={"aa91a2d0605d400e"}>{`.container.jsx-aa91a2d0605d400e{color:#00f;padding:3rem}@media (width<=${breakpoint}){.container.jsx-aa91a2d0605d400e .responsive.jsx-aa91a2d0605d400e{color:purple}}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-30480/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-30480/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-30480/output.swc.js deleted file mode 100644 index fa326f53d..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.swc.js +++ /dev/null @@ -1,13 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (({ breakPoint })=>
    - <_JSXStyle id={"a06381547918eae1"} dynamic={[ - breakPoint - ]}>{`@media (${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}`} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/issue-30570/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-30570/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-30570/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-30570/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-30570/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-30570/output.swc.js deleted file mode 100644 index 3da742c13..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-30570/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function IndexPage() { - return
    -

    Hello World.

    - - <_JSXStyle id={"6226396a225d1c8b"}>{"@supports (display:flex) or (display:-webkit-box) or (display:-webkit-flex) or (display:-moz-box) or (display:-ms-flexbox){h1{color:#ff69b4}}"} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.swc.js deleted file mode 100644 index 2911d8585..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.swc.js +++ /dev/null @@ -1,40 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"47145d6c8a3181ea"} dynamic={[ - Typography.base.size.default, - Typography.base.lineHeight, - Target.mediumPlus, - Typography.base.size.mediumPlus, - Target.largePlus, - Typography.base.size.largePlus - ]}>{`html{font-size:${Typography.base.size.default};line-height:${Typography.base.lineHeight}}@media ${Target.mediumPlus}{html{font-size:${Typography.base.size.mediumPlus}}}@media ${Target.largePlus}{html{font-size:${Typography.base.size.largePlus}}}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/issue-317/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-317/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-317/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-317/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-317/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-317/output.swc.js deleted file mode 100644 index a52e368a6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-317/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export const MyComponent = ()=><> -
    - <_JSXStyle id={"98442910aac83b4a"}>{"div.jsx-98442910aac83b4a{background-image:url(\"data:image/svg+xml,%3Csvg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 24 24' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cg%3E%3Cpath fill='none' d='M0 0h24v24H0z'%3E%3C/path%3E%3Cpath d='M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1h2v2h6V1h2v2zm3 6V5h-3v2h-2V5H9v2H7V5H4v4h16zm0 2H4v8h16v-8zM6 13h5v4H6v-4z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E%0A\")}"} - ; diff --git a/packages/styled-jsx/transform/tests/fixture/issue-452/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-452/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-452/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-452/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-452/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-452/output.swc.js deleted file mode 100644 index f2d3f2a54..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-452/output.swc.js +++ /dev/null @@ -1,15 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - return <> -
    - container (should be blue) - -
    - this should be green -
    -
    - - - <_JSXStyle id={"762285c3ffa56b0"}>{".container.jsx-762285c3ffa56b0{color:#00f;padding:3rem}div.child{color:green}"} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/issue-456/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-456/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-456/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-456/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-456/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-456/output.swc.js deleted file mode 100644 index 20a85b4ab..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-456/output.swc.js +++ /dev/null @@ -1,6 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - return <> - <_JSXStyle id={"c717b7da8095da63"}>{".theme-root{}.theme-root .parent.jsx-c717b7da8095da63{color:green}"} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/issue-460/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-460/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/issue-460/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/issue-460/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/issue-460/output.swc.js b/packages/styled-jsx/transform/tests/fixture/issue-460/output.swc.js deleted file mode 100644 index 67299a77d..000000000 --- a/packages/styled-jsx/transform/tests/fixture/issue-460/output.swc.js +++ /dev/null @@ -1,6 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - return <> - <_JSXStyle id={"44c2e59534385f9"}>{"div.jsx-44c2e59534385f9{-webkit-mask-image:-webkit-radial-gradient(#fff,#000);mask-image:-webkit-radial-gradient(#fff,#000)}"} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.swc.js b/packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.swc.js deleted file mode 100644 index ee03c6d3c..000000000 --- a/packages/styled-jsx/transform/tests/fixture/legacy-nesting/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    -

    woot

    -

    woot

    - <_JSXStyle id={"3b0234e9651851cb"}>{".container.jsx-3b0234e9651851cb{color:#00f;padding:3rem}.container.jsx-3b0234e9651851cb .inner.jsx-3b0234e9651851cb{color:#ff0}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.swc.js deleted file mode 100644 index 582ed08a5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/lightningcss-1/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function IndexPage() { - return
    -

    Hello World.

    - - <_JSXStyle id={"490e0a92136d9307"}>{".container{}.container>div{color:green}"} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.swc.js b/packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.swc.js deleted file mode 100644 index e8f3acf95..000000000 --- a/packages/styled-jsx/transform/tests/fixture/media-queries-with-variables/output.swc.js +++ /dev/null @@ -1,33 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - const ResponsiveBreakpoint = { - mobile: '768px', - tablet: '1024px', - desktop: '1440px' - }; - const breakpoint = 'mobile'; - const mobileWidth = 320; - return
    -
    Responsive Element
    - <_JSXStyle id={"d98271ddec5d15a5"} dynamic={[ - ResponsiveBreakpoint[breakpoint], - mobileWidth - ]}>{`.component.__jsx-style-dynamic-selector{width:100%}@media (width<=${ResponsiveBreakpoint[breakpoint]}){.component.__jsx-style-dynamic-selector{width:${mobileWidth}px}.component.__jsx-style-dynamic-selector.active.__jsx-style-dynamic-selector{color:#00f}.component.__jsx-style-dynamic-selector div.__jsx-style-dynamic-selector{display:block}}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.swc.js b/packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.swc.js deleted file mode 100644 index 57e74470d..000000000 --- a/packages/styled-jsx/transform/tests/fixture/mixed-global-scoped/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const Test = ()=><_JSXStyle id={"94239b6d6b42c9b5"}>{"p{color:red}"}; -export default (()=>
    -

    test

    - <_JSXStyle id={"80dff25115d29c0e"}>{"body{background:red}"} - <_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-8de09a4a01c37bbf{color:red}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.swc.js b/packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.swc.js deleted file mode 100644 index d5393ee68..000000000 --- a/packages/styled-jsx/transform/tests/fixture/multiple-jsx/output.swc.js +++ /dev/null @@ -1,24 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const attrs = { - id: "test" -}; -const Test1 = ()=>
    - - test - - - <_JSXStyle id={"a9535d7d5f32c3c4"}>{"span.jsx-a9535d7d5f32c3c4{color:red}"} -
    ; -const Test2 = ()=>test; -const Test3 = ()=>
    - test - <_JSXStyle id={"a9535d7d5f32c3c4"}>{"span.jsx-a9535d7d5f32c3c4{color:red}"} -
    ; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"b2b86d63f35d25ee"}>{"p.jsx-b2b86d63f35d25ee{color:red}"} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/nested-selectors/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/nested-selectors/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/nested-selectors/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/nested-selectors/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/nested-selectors/output.swc.js b/packages/styled-jsx/transform/tests/fixture/nested-selectors/output.swc.js deleted file mode 100644 index 1db990f95..000000000 --- a/packages/styled-jsx/transform/tests/fixture/nested-selectors/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Component() { - return
    -
    Nested Selectors Test
    -

    Heading

    - <_JSXStyle id={"2552bb7cce0bcbcf"}>{".parent.jsx-2552bb7cce0bcbcf{position:relative}.parent.jsx-2552bb7cce0bcbcf.jsx-2552bb7cce0bcbcf:hover{background-color:red}.parent.jsx-2552bb7cce0bcbcf .child.jsx-2552bb7cce0bcbcf{margin-top:10px}.parent.jsx-2552bb7cce0bcbcf div.jsx-2552bb7cce0bcbcf{padding:15px}.parent.jsx-2552bb7cce0bcbcf h1.jsx-2552bb7cce0bcbcf{font-size:24px}"} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/next-54653/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-54653/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-54653/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-54653/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-54653/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-54653/output.swc.js deleted file mode 100644 index 4a80ff982..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-54653/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -const _defaultExport = new String( - "@media (width<=870px){th.expiration-date-cell,td.expiration-date-cell{display:none}}", -); -_defaultExport.__hash = "fd71bf06ba8860bb"; -export default _defaultExport; diff --git a/packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-55679/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-55679/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-55679/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-55679/output.swc.js deleted file mode 100644 index a3b537ab1..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-55679/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import { AppProps } from "next/app"; -const someVar = "--var-1"; -export default function App({ Component, pageProps }) { - return <> - <_JSXStyle id={"38fdbc96e669f61f"}>{`:root{${someVar}:red;background-color:var(${someVar})}`} - - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/next-61788/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-61788/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-61788/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-61788/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-61788/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-61788/output.swc.js deleted file mode 100644 index c0c68d6f5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-61788/output.swc.js +++ /dev/null @@ -1,24 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const MOBILE_MAX = 767; -export default function Home() { - return
    -

    Hello

    - <_JSXStyle id={"4eecc8f0301cbbcf"} dynamic={[ - MOBILE_MAX - ]}>{`.header.__jsx-style-dynamic-selector{font-size:48px}@media screen and (width<=${MOBILE_MAX}px){.header.__jsx-style-dynamic-selector{font-size:12px}}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-64389/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-64389/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-64389/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-64389/output.swc.js deleted file mode 100644 index 3963c0313..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-64389/output.swc.js +++ /dev/null @@ -1,10 +0,0 @@ -"use client"; -import _JSXStyle from "styled-jsx/style"; -const color = "color: red;"; -export default function RootLayout({ children }) { - return - - {children} - <_JSXStyle id={"72ba844b023632d9"}>{`body{${color}}body p{font-size:72px}`} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/next-65064/1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-65064/1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-65064/1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-65064/1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-65064/1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-65064/1/output.swc.js deleted file mode 100644 index 0ef3fca34..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-65064/1/output.swc.js +++ /dev/null @@ -1,14 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import React from "react"; -// This should error with https://nextjs.org/docs/messages/nested-styled-jsx-tags -// but does not. -export default function SimplePage() { - return -
    Text
    - - <_JSXStyle id={"68234eda9c798fae"}>{".text.jsx-68234eda9c798fae{color:#00f}.text.jsx-68234eda9c798fae.jsx-68234eda9c798fae:hover{color:red}"} - }/>; -} -const ComponentWithChildAsProp = ({ trigger })=>{ - return
    {trigger}
    ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/next-65064/2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-65064/2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-65064/2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-65064/2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-65064/2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-65064/2/output.swc.js deleted file mode 100644 index a775e7abb..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-65064/2/output.swc.js +++ /dev/null @@ -1,14 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import React from "react"; -// This should error with https://nextjs.org/docs/messages/nested-styled-jsx-tags -// but does not. -export default function SimplePage() { - return -
    Text
    - - <_JSXStyle id={"68234eda9c798fae"}>{".text.jsx-68234eda9c798fae{color:#00f}.text.jsx-68234eda9c798fae.jsx-68234eda9c798fae:hover{color:red}"} -
    }/>; -} -const ComponentWithChildAsProp = ({ trigger })=>{ - return
    {trigger}
    ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-65066/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/next-65066/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr b/packages/styled-jsx/transform/tests/fixture/next-65066/output.stderr similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr rename to packages/styled-jsx/transform/tests/fixture/next-65066/output.stderr diff --git a/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.js b/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.js deleted file mode 100644 index 6ed3882a0..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.js +++ /dev/null @@ -1,19 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import React from "react"; -// This should error with https://nextjs.org/docs/messages/nested-styled-jsx-tags -// but instead it crashes SWC. -export default function Home() { - return
    -
    -
    Text
    - - <_JSXStyle id={"915beb22be3340e9"}>{".text.jsx-915beb22be3340e9:hover{color:#ff0!important}"} -
    - - -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.stderr b/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.stderr deleted file mode 100644 index 2dfe189ea..000000000 --- a/packages/styled-jsx/transform/tests/fixture/next-65066/output.swc.stderr +++ /dev/null @@ -1,11 +0,0 @@ - x Detected nested styled-jsx tag. - | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:22:1] - 21 | - 22 | ,-> - 27 |
    - `---- diff --git a/packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.swc.js b/packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.swc.js deleted file mode 100644 index b0d367f71..000000000 --- a/packages/styled-jsx/transform/tests/fixture/non-styled-jsx-style/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    woot

    - - <_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-94239b6d6b42c9b5{color:red}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.js similarity index 84% rename from packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.js index a8a95346e..cc4445ec3 100644 --- a/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.js @@ -26,4 +26,4 @@ const Title = styled.h1` const AnotherTitle = Title.extend` color: blue; `; -export const Component = () => My page; +export const Component = ()=>My page; diff --git a/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.swc.js b/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.swc.js deleted file mode 100644 index a8a95346e..000000000 --- a/packages/styled-jsx/transform/tests/fixture/not-styled-jsx-tagged-templates/output.swc.js +++ /dev/null @@ -1,29 +0,0 @@ -import css from "hell"; -const color = "red"; -const bar = css` - div { - font-size: 3em; - } -`; -export const uh = bar; -export const foo = css` - div { - color: ${color}; - } -`; -export default css` - div { - font-size: 3em; - } - p { - color: ${color}; - } -`; -const Title = styled.h1` - color: red; - font-size: 50px; -`; -const AnotherTitle = Title.extend` - color: blue; -`; -export const Component = () => My page; diff --git a/packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.swc.js b/packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.swc.js deleted file mode 100644 index bb6201c27..000000000 --- a/packages/styled-jsx/transform/tests/fixture/number-after-placeholder/output.swc.js +++ /dev/null @@ -1,11 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import Link from "next/link"; -export default function IndexPage() { - return
    - Hello World.{" "} - - Abound - - <_JSXStyle id={"e431798e22cb060f"}>{`a.jsx-e431798e22cb060f{color:${"#abcdef"}12}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.swc.js b/packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.swc.js deleted file mode 100644 index 5f86f412e..000000000 --- a/packages/styled-jsx/transform/tests/fixture/one-off-global-selectors/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"c7c3a8e231c9215a"}>{".container.jsx-c7c3a8e231c9215a>*{color:red}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/pack-2714/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/pack-2714/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/pack-2714/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/pack-2714/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/pack-2714/output.swc.js b/packages/styled-jsx/transform/tests/fixture/pack-2714/output.swc.js deleted file mode 100644 index c56efd19f..000000000 --- a/packages/styled-jsx/transform/tests/fixture/pack-2714/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const { className: cardClassName, styles } = { - styles: <_JSXStyle id={"da51c97a2990fbe"}>{`.jsx-da51c97a2990fbe:hover{z-index:${hoverAnimation ? "1" : "auto"}}`}, - className: "jsx-da51c97a2990fbe" -}; diff --git a/packages/styled-jsx/transform/tests/fixture/pack-2819/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/pack-2819/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/pack-2819/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/pack-2819/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/pack-2819/output.swc.js b/packages/styled-jsx/transform/tests/fixture/pack-2819/output.swc.js deleted file mode 100644 index f893ddee6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/pack-2819/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    -

    woot

    -

    woot

    - <_JSXStyle id={"d3bc3634b8d1b3fb"}>{".container.jsx-d3bc3634b8d1b3fb{color:#00f;padding:3rem}.container.jsx-d3bc3634b8d1b3fb.inner.jsx-d3bc3634b8d1b3fb{color:#ff0}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/source-maps/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/source-maps/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/source-maps/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/source-maps/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/source-maps/output.swc.js b/packages/styled-jsx/transform/tests/fixture/source-maps/output.swc.js deleted file mode 100644 index e14ced8ae..000000000 --- a/packages/styled-jsx/transform/tests/fixture/source-maps/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -// TODO: needs sourcemaps -// export default () => ( -//
    -//

    test

    -//

    woot

    -// -//
    -// ) diff --git a/packages/styled-jsx/transform/tests/fixture/specifity/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/specifity/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/specifity/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/specifity/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/specifity/output.swc.js b/packages/styled-jsx/transform/tests/fixture/specifity/output.swc.js deleted file mode 100644 index 5a9b815be..000000000 --- a/packages/styled-jsx/transform/tests/fixture/specifity/output.swc.js +++ /dev/null @@ -1,6 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home() { - return <> - <_JSXStyle id={"86b7ac1a67e57b1"}>{"div.jsx-86b7ac1a67e57b1{}div.jsx-86b7ac1a67e57b1.parent.jsx-86b7ac1a67e57b1{color:green}"} - ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/stateless/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/stateless/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/stateless/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/stateless/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.swc.js b/packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.swc.js deleted file mode 100644 index 587369e43..000000000 --- a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -// TODO -// import css from 'styled-jsx/css' -// const color = 'red' -// export const foo = css`div { color: ${color}}` -// const props = { color: 'red ' } -// export default css` -// div { font-size: 3em; color: ${props.color} } -// p { color: ${this.props.color};} -// ` diff --git a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.swc.js deleted file mode 100644 index 8f616ffc6..000000000 --- a/packages/styled-jsx/transform/tests/fixture/styles-external-invalid2/output.swc.js +++ /dev/null @@ -1,8 +0,0 @@ -// TODO -// import css from 'styled-jsx/css' -// const color = 'red' -// export const foo = css`div { color: ${color}}` -// export default css` -// div { font-size: 3em } -// p { color: ${props.color};} -// ` diff --git a/packages/styled-jsx/transform/tests/fixture/styles/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/styles/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/styles/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/styles/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/styles/output.swc.js b/packages/styled-jsx/transform/tests/fixture/styles/output.swc.js deleted file mode 100644 index 3a35504c5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/styles/output.swc.js +++ /dev/null @@ -1,39 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -import colors, { size } from "./constants"; -const color = "red"; -const bar = new String("div.jsx-aaed0341accea8f{font-size:3em}"); -bar.__hash = "aaed0341accea8f"; -const baz = new String("div{font-size:3em}"); -baz.__hash = "aaed0341accea8f"; -const a = new String(`div{font-size:${size}em}`); -a.__hash = "335ce71362ff6898"; -export const uh = bar; -export const foo = new String(`div.jsx-770e2f89f694f0c4{color:${color}}`); -foo.__hash = "770e2f89f694f0c4"; -({ - styles: <_JSXStyle id={"4bec2f6082dc66fb"}>{`div.jsx-4bec2f6082dc66fb{color:${colors.green.light}}a.jsx-4bec2f6082dc66fb{color:red}`}, - className: "jsx-4bec2f6082dc66fb" -}); -const b = { - styles: <_JSXStyle id={"36047a637012add5"}>{`div.jsx-36047a637012add5{color:${colors.green.light}}a.jsx-36047a637012add5{color:red}`}, - className: "jsx-36047a637012add5" -}; -const dynamic = (colors)=>{ - const b = { - styles: <_JSXStyle id={"7addc29b747c9d9f"} dynamic={[ - colors.green.light - ]}>{`div.__jsx-style-dynamic-selector{color:${colors.green.light}}a.__jsx-style-dynamic-selector{color:red}`}, - className: _JSXStyle.dynamic([ - [ - "7addc29b747c9d9f", - [ - colors.green.light - ] - ] - ]) - }; -}; -export default { - styles: <_JSXStyle id={"c7a3824d3cef225d"}>{`div.jsx-c7a3824d3cef225d{font-size:3em}p.jsx-c7a3824d3cef225d{color:${color}}`}, - className: "jsx-c7a3824d3cef225d" -}; diff --git a/packages/styled-jsx/transform/tests/fixture/styles2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/styles2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/styles2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/styles2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/styles2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/styles2/output.swc.js deleted file mode 100644 index cd7ba2952..000000000 --- a/packages/styled-jsx/transform/tests/fixture/styles2/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -// TODO: support common js -// import css from 'styled-jsx/css' -// module.exports = css` -// div { font-size: 3em } -// ` diff --git a/packages/styled-jsx/transform/tests/fixture/svg-strip/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/svg-strip/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/svg-strip/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/svg-strip/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/svg-strip/output.swc.js b/packages/styled-jsx/transform/tests/fixture/svg-strip/output.swc.js deleted file mode 100644 index 3b0ea4833..000000000 --- a/packages/styled-jsx/transform/tests/fixture/svg-strip/output.swc.js +++ /dev/null @@ -1,30 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -const CUTOUT_AVATAR_PERCENTAGE_VISIBLE = Math.random(); -const HEAD_MARGIN_PERCENTAGE = Math.random(); -const MaskedDivBad = ()=>{ - return <> -
    -
    -
    - <_JSXStyle id={"85c232ff739fabcb"} dynamic={[ - 0.5 + HEAD_MARGIN_PERCENTAGE, - 0.5 + CUTOUT_AVATAR_PERCENTAGE_VISIBLE + HEAD_MARGIN_PERCENTAGE - ]}>{`.head.__jsx-style-dynamic-selector{position:relative}.avatar-wrapper.__jsx-style-dynamic-selector{width:40px;height:40px;background:#ff6b6b;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-mask-image:url("data:image/svg+xml,"),url("data:image/svg+xml,");mask-image:url("data:image/svg+xml,"),url("data:image/svg+xml,");-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-composite:source-out;mask-composite:subtract}`} - ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/too-many/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/too-many/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/too-many/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/too-many/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/too-many/output.swc.js b/packages/styled-jsx/transform/tests/fixture/too-many/output.swc.js deleted file mode 100644 index 91421a0e9..000000000 --- a/packages/styled-jsx/transform/tests/fixture/too-many/output.swc.js +++ /dev/null @@ -1,44 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export const Red = ({ Component = "button" })=>{ - return - { /* Dynamic Styles */ } - <_JSXStyle id={"be86b166ecb19b54"} dynamic={[ - e1, - e2, - e3, - e4, - e5, - e6, - e7, - e8, - e9, - e10, - e11, - e12, - e13, - e14, - e15 - ]}>{`.button.__jsx-style-dynamic-selector{--button-1:${e1};--button-2:${e2};--button-3:${e3};--button-4:${e4};--button-5:${e5};--button-6:${e6};--button-7:${e7};--button-8:${e8};--button-9:${e9};--button-10:${e10};--button-11:${e11};--button-12:${e12};--button-13:${e13};--button-14:${e14};--button-15:${e15}}`} - ; -}; diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.swc.js deleted file mode 100644 index 1fd34e775..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-escape-1/output.swc.js +++ /dev/null @@ -1,9 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"71816f8e3c42a736"}>{'p.jsx-71816f8e3c42a736{content:"`"}'} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.swc.js deleted file mode 100644 index 5b60b7348..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-escape-2/output.swc.js +++ /dev/null @@ -1,15 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default function Home({ fontFamily }) { - return
    - <_JSXStyle id={"3711de44f840974b"} dynamic={[ - fontFamily - ]}>{`body{font-family:${fontFamily}}code:before,code:after{content:"\`"}`} -
    ; -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.swc.js deleted file mode 100644 index 0ca534f3a..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-1-as-property/output.swc.js +++ /dev/null @@ -1,25 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"2b4169e64a56b513"} dynamic={[ - inputSize ? "height: calc(2 * var(--a)) !important;" : "" - ]}>{`@media only screen{a.__jsx-style-dynamic-selector{${inputSize ? "height: calc(2 * var(--a)) !important;" : ""}}}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.swc.js deleted file mode 100644 index b6205415d..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.swc.js +++ /dev/null @@ -1,31 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"9592f624eadc7da7"} dynamic={[ - a[b], - -1 * (c || 0), - d - ]}>{`.a:hover .b.__jsx-style-dynamic-selector{a:${a[b]}px!important;b:translate3d(0,${-1 * (c || 0)}px,-${d}px)scale(1)!important}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.swc.js deleted file mode 100644 index a8f51e9c5..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-3-as-value/output.swc.js +++ /dev/null @@ -1,25 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"dddfe1661b2d8402"} dynamic={[ - a - ]}>{`@media only screen{a.__jsx-style-dynamic-selector{color:${a}}}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.swc.js deleted file mode 100644 index 006273a45..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.swc.js +++ /dev/null @@ -1,28 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"2452258569aadca2"} dynamic={[ - a || "var(--c)", - b || "inherit" - ]}>{`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block;padding:0 ${a || "var(--c)"};color:${b || "inherit"}}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.swc.js b/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.swc.js deleted file mode 100644 index af64cdf24..000000000 --- a/packages/styled-jsx/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.swc.js +++ /dev/null @@ -1,28 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default class { - render() { - return
    -

    test

    - <_JSXStyle id={"58eac9b5aa577a0f"} dynamic={[ - a ? "100%" : "200px", - b ? "0" : "8px 20px" - ]}>{`.item.__jsx-style-dynamic-selector{max-width:${a ? "100%" : "200px"};padding:${b ? "0" : "8px 20px"}}`} -
    ; - } -} diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.swc.js deleted file mode 100644 index 17f39d841..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector-2/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"f12d8626937fd2c6"}>{".a-selector.jsx-f12d8626937fd2c6:hover,.a-selector.jsx-f12d8626937fd2c6:focus{outline:none}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.swc.js deleted file mode 100644 index fb9b2c83a..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-complex-selector/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"2e0b2fdc9a904355"}>{"p.jsx-2e0b2fdc9a904355 a.jsx-2e0b2fdc9a904355 span.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355 span{background:#00f}p.jsx-2e0b2fdc9a904355 a[title=\"'w ' ' t'\"].jsx-2e0b2fdc9a904355{margin:auto}p.jsx-2e0b2fdc9a904355 span:not(.test){color:green}p.jsx-2e0b2fdc9a904355,h1.jsx-2e0b2fdc9a904355{color:#00f;-webkit-animation:3s infinite forwards hahaha;-moz-animation:3s infinite forwards hahaha;-o-animation:3s infinite forwards hahaha;animation:3s infinite forwards hahaha;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:.1s;-moz-animation-delay:.1s;-o-animation-delay:.1s;animation-delay:.1s}p.jsx-2e0b2fdc9a904355{-webkit-animation:1s hahaha,2s hehehe;-moz-animation:1s hahaha,2s hehehe;-o-animation:1s hahaha,2s hehehe;animation:1s hahaha,2s hehehe}p.jsx-2e0b2fdc9a904355:hover{color:red}p.jsx-2e0b2fdc9a904355:before{color:red}.jsx-2e0b2fdc9a904355:hover{color:red}.jsx-2e0b2fdc9a904355:before{color:red}.jsx-2e0b2fdc9a904355:hover p.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355+a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355~a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355>a.jsx-2e0b2fdc9a904355{color:red}@-webkit-keyframes hahaha{0%{top:0}to{top:100px}}@-moz-keyframes hahaha{0%{top:0}to{top:100px}}@-o-keyframes hahaha{0%{top:0}to{top:100px}}@keyframes hahaha{0%{top:0}to{top:100px}}@-webkit-keyframes hehehe{0%{left:0}to{left:100px}}@-moz-keyframes hehehe{0%{left:0}to{left:100px}}@-o-keyframes hehehe{0%{left:0}to{left:100px}}@keyframes hehehe{0%{left:0}to{left:100px}}@media (width>=500px){.test.jsx-2e0b2fdc9a904355{color:red}}.test.jsx-2e0b2fdc9a904355{display:block}.inline-flex.jsx-2e0b2fdc9a904355{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-2e0b2fdc9a904355{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-2e0b2fdc9a904355{-webkit-box-shadow:0 0 10px #000,inset 0 0 5px #000;-moz-box-shadow:0 0 10px #000,inset 0 0 5px #000;box-shadow:0 0 10px #000,inset 0 0 5px #000}.test[title=\\,].jsx-2e0b2fdc9a904355{display:inline-block}.test.is-status.jsx-2e0b2fdc9a904355 .test.jsx-2e0b2fdc9a904355{color:red}.a-selector.jsx-2e0b2fdc9a904355:hover,.a-selector.jsx-2e0b2fdc9a904355:focus{outline:none}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-global/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-global/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-global/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-global/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-global/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-global/output.swc.js deleted file mode 100644 index e70ae1743..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-global/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"13e06bb770708a4c"}>{"html.jsx-13e06bb770708a4c{background-image:-webkit-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:-moz-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:-o-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:linear-gradient(#fffc,#fffc),url(/static/background.svg)}p{color:#001}h1{color:#002}h2,a.jsx-13e06bb770708a4c{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.swc.js deleted file mode 100644 index e7be185cf..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-media-query/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"ec1bf2b940b30dc"}>{"@media (width>=1px) and (width<=768px){[class*=grid__col--].jsx-ec1bf2b940b30dc{margin-top:12px;margin-bottom:12px}}@media (width<=64em){.test.jsx-ec1bf2b940b30dc{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-ec1bf2b940b30dc{margin-bottom:2rem}}}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.swc.js deleted file mode 100644 index a55202efb..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-normal/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"292192d0348369b"}>{"p.jsx-292192d0348369b{color:red}p.jsx-292192d0348369b{color:red}.jsx-292192d0348369b{color:#00f}[href=woot].jsx-292192d0348369b{color:red}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.swc.js deleted file mode 100644 index c9c0bcf77..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css-nth-1/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"d8153edfc80ef241"}>{"li.jsx-d8153edfc80ef241:nth-child(2){color:#0f0}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/transform-css/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/transform-css/output.lightningcss.js rename to packages/styled-jsx/transform/tests/fixture/transform-css/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/transform-css/output.swc.js b/packages/styled-jsx/transform/tests/fixture/transform-css/output.swc.js deleted file mode 100644 index d4384f858..000000000 --- a/packages/styled-jsx/transform/tests/fixture/transform-css/output.swc.js +++ /dev/null @@ -1,5 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    - <_JSXStyle id={"374655937fd2de40"}>{"html.jsx-374655937fd2de40{background-image:-webkit-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:-moz-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:-o-linear-gradient(#fffc,#fffc),url(/static/background.svg);background-image:linear-gradient(#fffc,#fffc),url(/static/background.svg)}p{color:#001}p{color:#002}p,a.jsx-374655937fd2de40{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}p.jsx-374655937fd2de40{color:#005}p.jsx-374655937fd2de40{color:#006}.jsx-374655937fd2de40{color:#007}[href=woot].jsx-374655937fd2de40{color:#008}p.jsx-374655937fd2de40 a.jsx-374655937fd2de40 span.jsx-374655937fd2de40{color:#009}p.jsx-374655937fd2de40 span{background:#00a}p.jsx-374655937fd2de40 a[title=\"'w ' ' t'\"].jsx-374655937fd2de40{margin:auto}p.jsx-374655937fd2de40 span:not(.test){color:#00b}p.jsx-374655937fd2de40,h1.jsx-374655937fd2de40{color:#00c;-webkit-animation:3s infinite forwards hahaha;-moz-animation:3s infinite forwards hahaha;-o-animation:3s infinite forwards hahaha;animation:3s infinite forwards hahaha;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:.1s;-moz-animation-delay:.1s;-o-animation-delay:.1s;animation-delay:.1s}p.jsx-374655937fd2de40{-webkit-animation:1s hahaha,2s hehehe;-moz-animation:1s hahaha,2s hehehe;-o-animation:1s hahaha,2s hehehe;animation:1s hahaha,2s hehehe}p.jsx-374655937fd2de40:hover{color:#00d}p.jsx-374655937fd2de40:before{color:#00e}.jsx-374655937fd2de40:hover{color:#00f}.jsx-374655937fd2de40:before{color:#010}.jsx-374655937fd2de40:hover p.jsx-374655937fd2de40{color:#011}p.jsx-374655937fd2de40+a.jsx-374655937fd2de40{color:#012}p.jsx-374655937fd2de40~a.jsx-374655937fd2de40{color:#013}p.jsx-374655937fd2de40>a.jsx-374655937fd2de40{color:#014}@-webkit-keyframes hahaha{0%{top:0}to{top:100px}}@-moz-keyframes hahaha{0%{top:0}to{top:100px}}@-o-keyframes hahaha{0%{top:0}to{top:100px}}@keyframes hahaha{0%{top:0}to{top:100px}}@-webkit-keyframes hehehe{0%{left:0}to{left:100px}}@-moz-keyframes hehehe{0%{left:0}to{left:100px}}@-o-keyframes hehehe{0%{left:0}to{left:100px}}@keyframes hehehe{0%{left:0}to{left:100px}}@media (width>=500px){.test.jsx-374655937fd2de40{color:#015}}.test.jsx-374655937fd2de40{display:block}.inline-flex.jsx-374655937fd2de40{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-374655937fd2de40{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-374655937fd2de40{-webkit-box-shadow:0 0 10px #000,inset 0 0 5px #000;-moz-box-shadow:0 0 10px #000,inset 0 0 5px #000;box-shadow:0 0 10px #000,inset 0 0 5px #000}.test[title=\\,].jsx-374655937fd2de40{display:inline-block}.test.is-status.jsx-374655937fd2de40 .test.jsx-374655937fd2de40{color:#016}.a-selector.jsx-374655937fd2de40:hover,.a-selector.jsx-374655937fd2de40:focus{outline:none}@media (width>=1px) and (width<=768px){[class*=grid__col--].jsx-374655937fd2de40{margin-top:12px;margin-bottom:12px}}@media (width<=64em){.test.jsx-374655937fd2de40{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-374655937fd2de40{margin-bottom:2rem}}}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/stateless/output.swc.js b/packages/styled-jsx/transform/tests/fixture/whitespace/output.js similarity index 100% rename from packages/styled-jsx/transform/tests/fixture/stateless/output.swc.js rename to packages/styled-jsx/transform/tests/fixture/whitespace/output.js diff --git a/packages/styled-jsx/transform/tests/fixture/whitespace/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/whitespace/output.lightningcss.js deleted file mode 100644 index b3c3e9456..000000000 --- a/packages/styled-jsx/transform/tests/fixture/whitespace/output.lightningcss.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    -

    woot

    -

    woot

    - <_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-94239b6d6b42c9b5{color:red}"} -
    ); diff --git a/packages/styled-jsx/transform/tests/fixture/whitespace/output.swc.js b/packages/styled-jsx/transform/tests/fixture/whitespace/output.swc.js deleted file mode 100644 index b3c3e9456..000000000 --- a/packages/styled-jsx/transform/tests/fixture/whitespace/output.swc.js +++ /dev/null @@ -1,7 +0,0 @@ -import _JSXStyle from "styled-jsx/style"; -export default (()=>
    -

    test

    -

    woot

    -

    woot

    - <_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-94239b6d6b42c9b5{color:red}"} -
    );