diff --git a/Cargo.lock b/Cargo.lock index 3f850199f..40357d2b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,21 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "aes" version = "0.7.5" @@ -73,6 +58,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +dependencies = [ + "serde", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -198,21 +192,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "base64" version = "0.21.7" @@ -319,6 +298,9 @@ name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] [[package]] name = "bytecheck" @@ -372,20 +354,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.23", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cargo_metadata" version = "0.18.1" @@ -586,7 +554,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.11.2", + "phf 0.10.1", "smallvec", ] @@ -800,12 +768,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - [[package]] name = "glob" version = "0.3.1" @@ -953,12 +915,6 @@ dependencies = [ "syn 2.0.61", ] -[[package]] -name = "is_ci" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" - [[package]] name = "is_terminal_polyfill" version = "1.70.0" @@ -1194,19 +1150,13 @@ checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "miette" -version = "4.7.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ - "atty", - "backtrace", + "cfg-if", "miette-derive", - "once_cell", "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size", "textwrap", "thiserror", "unicode-width", @@ -1214,13 +1164,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "4.7.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.61", ] [[package]] @@ -1229,18 +1179,9 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - [[package]] name = "modularize_imports" -version = "0.68.19" +version = "0.68.20" dependencies = [ "convert_case", "handlebars", @@ -1322,15 +1263,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -1357,9 +1289,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" [[package]] name = "parcel_selectors" @@ -1494,7 +1426,9 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ + "phf_macros 0.10.0", "phf_shared 0.10.0", + "proc-macro-hack", ] [[package]] @@ -1503,7 +1437,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_macros", + "phf_macros 0.11.2", "phf_shared 0.11.2", ] @@ -1537,6 +1471,20 @@ dependencies = [ "rand", ] +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "phf_macros" version = "0.11.2" @@ -1588,9 +1536,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "preset_env_base" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecfcd4aefde8c1ed1ac4f1118ca5021763a717ba87f5508db7785e864dac1d8" +checksum = "1b30eab18be480c194938e433e269d5298a279f6410f02fbc73f3576a325c110" dependencies = [ "ahash 0.8.11", "anyhow", @@ -1614,6 +1562,12 @@ dependencies = [ "yansi", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.82" @@ -1725,7 +1679,7 @@ dependencies = [ [[package]] name = "react_remove_properties" -version = "0.24.15" +version = "0.24.16" dependencies = [ "serde", "swc_atoms", @@ -1800,7 +1754,7 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "remove_console" -version = "0.25.15" +version = "0.25.16" dependencies = [ "serde", "swc_atoms", @@ -1852,12 +1806,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -2171,7 +2119,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "styled_components" -version = "0.96.18" +version = "0.96.19" dependencies = [ "Inflector", "once_cell", @@ -2192,7 +2140,7 @@ dependencies = [ [[package]] name = "styled_jsx" -version = "0.73.27" +version = "0.73.28" dependencies = [ "anyhow", "lightningcss", @@ -2220,31 +2168,15 @@ dependencies = [ ] [[package]] -name = "supports-color" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" -dependencies = [ - "atty", - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" -dependencies = [ - "atty", -] - -[[package]] -name = "supports-unicode" -version = "1.0.2" +name = "swc_allocator" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +checksum = "dae2f696639ba1834a7edb1765a5ea0a7ef57de52ac1403135929bd006748731" dependencies = [ - "atty", + "allocator-api2", + "bumpalo", + "ptr_meta", + "triomphe", ] [[package]] @@ -2277,9 +2209,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.34.3" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7bcbd9faf61cec1a552cbdaec57faefbb10be7cc5f959613c6f91b5a9254" +checksum = "df5ed098e191c0cb289aa89eeae8a5312993cf0997e7c83e011e0a7dd1f6ce7b" dependencies = [ "anyhow", "ast_node", @@ -2298,6 +2230,7 @@ dependencies = [ "serde", "siphasher", "sourcemap", + "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", "swc_visit", @@ -2309,7 +2242,7 @@ dependencies = [ [[package]] name = "swc_confidential" -version = "0.19.15" +version = "0.19.16" dependencies = [ "cipher 0.4.4", "hex", @@ -2355,11 +2288,12 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.96.0" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397aa4b60ac7eed394d0c1f9634ff0cf9dd5841bf1cd4ed2ef7f45955a40cb99" +checksum = "359e202690a515fda2149b5d2e28234577fcb9c7827561ee9c795e5f453eb6e1" dependencies = [ "once_cell", + "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2375,9 +2309,9 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "0.141.0" +version = "0.143.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a5f28ff625a89de2a269bde3ed3b99be74bb9d3dc78dea6f3b071991b2cbf4" +checksum = "bd74b0674c9ab8eebfaada987afc2c1da9bb83519851d253e6c55fe81a7b5d50" dependencies = [ "is-macro", "string_enum", @@ -2387,9 +2321,9 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "0.152.0" +version = "0.154.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894275a04a693db249903c29b31dfc71fae0bde68c49d4c4a935243f9eeba691" +checksum = "248bc5dd4b0cbd6ea6756c2f8ab8ebe120656c46e641ffb9e224ee7d24852a81" dependencies = [ "auto_impl", "bitflags", @@ -2416,9 +2350,9 @@ dependencies = [ [[package]] name = "swc_css_compat" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c87f674685c3ad0c94a1ad85cd605352f97ae92ad4a3993745578d6fe0d4c54" +checksum = "f0f4e646c376b40eeda3bb84bcc65f5ce58f21ceb7db6a351b4ede2492090c07" dependencies = [ "bitflags", "once_cell", @@ -2433,9 +2367,9 @@ dependencies = [ [[package]] name = "swc_css_minifier" -version = "0.117.1" +version = "0.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3018ef38941e9b5681af7651047cd42af8bcb1635ba1d99eee182aafd84bb3" +checksum = "1c86b7e31102ee0592cffbca17f6ca205aacd07fd9c7d2ff032fd0d90f2f4cd1" dependencies = [ "serde", "swc_atoms", @@ -2447,9 +2381,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.151.0" +version = "0.153.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee5dbaaea0df38195d137bcfc68149906bba9c9dffebf5e846234e286f82992" +checksum = "e32cc048c02012857c5e9ceb5105018647a543e4f189e398e6944707c972484e" dependencies = [ "lexical", "serde", @@ -2460,9 +2394,9 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "0.155.0" +version = "0.157.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9930655060121c32d829e13fe4fa11294c03e71eb84c22e039703c929dcdf7" +checksum = "bba3432b5aa419493e0c609d0915d5f14c74a5c14bb89ac6146498974a027c1c" dependencies = [ "once_cell", "preset_env_base", @@ -2477,9 +2411,9 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "0.138.0" +version = "0.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b135df778449825f38d54664bb179c839b3285f9a553ec10dd3cc3eafb751599" +checksum = "47ab39714e7f531b892385aeb562e326f525efe738c3294d0d7f16c25fbca982" dependencies = [ "once_cell", "serde", @@ -2492,9 +2426,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "0.140.0" +version = "0.142.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97dceaa18c8ae7f5a4c991e15efc5c333e5880b58ee6d61e42fd1365748ff05" +checksum = "e46be9a8ef2f97903a49df3092f8846b4d631784bc64f2d9b2f39769660517aa" dependencies = [ "serde", "swc_atoms", @@ -2505,9 +2439,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.115.1" +version = "0.117.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be1306930c235435a892104c00c2b5e16231043c085d5a10bd3e7537b15659b" +checksum = "536e973cd624cada731c22ad9ba3aa7a6432a5c1b6e002ec4f12809a8718da5d" dependencies = [ "bitflags", "bytecheck", @@ -2525,9 +2459,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.151.1" +version = "0.154.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5141a8cb4eb69e090e6aea5d49061b46919be5210f3d084f9d9ad63d30f5cff" +checksum = "6ca6056bb7016fdeaee8e3d792e3242a8cfa6f2a81a2010e7f6c5cb961719a17" dependencies = [ "memchr", "num-bigint", @@ -2556,9 +2490,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.197.1" +version = "0.200.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42abacd1c2682fd238c682209a616ebfee96abe2b9583aba273e7f1532b62bfc" +checksum = "a815397e95ed7b356b8ad22a8c37c234b7d75b629a36ed0d82271c9635642525" dependencies = [ "arrayvec", "indexmap", @@ -2566,6 +2500,7 @@ dependencies = [ "num_cpus", "once_cell", "parking_lot", + "phf 0.11.2", "radix_fmt", "regex", "rustc-hash", @@ -2589,12 +2524,11 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.146.7" +version = "0.148.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417d95a184c1872bc4e4db82c721c20c38bdf01214a65ee512c37b9985b78c01" +checksum = "59627c3704453c1bcb283c51ee161a5acf9988c80f80ef0250743fede0406602" dependencies = [ "either", - "memchr", "new_debug_unreachable", "num-bigint", "num-traits", @@ -2612,9 +2546,9 @@ dependencies = [ [[package]] name = "swc_ecma_quote_macros" -version = "0.57.1" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9537bc1a7daca42be1922137f4e59458bd72dd330cf9c96877e191e632bc2a8a" +checksum = "743fb9ee2dd1b4557c80018eb8f37f0028dc4098c474838a1fea63b357fadfd5" dependencies = [ "anyhow", "proc-macro2", @@ -2629,9 +2563,9 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f495dae76f1ef3f5be46993b050c3c7f9bf534bcdacf1e40789d32255040776" +checksum = "60432dde66f551adda7014459d28b43f361170a20029b47d163905c6dcfa33cd" dependencies = [ "anyhow", "hex", @@ -2642,9 +2576,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.232.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6845e7a7001aa2793225568e0661b55f57352a2103fa28934dd9cbc0d41cd933" +checksum = "bae99435503b117b96ffe1030976270c6ec6bdb6f5c62fcb2ce63674b48b1465" dependencies = [ "swc_atoms", "swc_common", @@ -2656,9 +2590,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.140.1" +version = "0.143.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4341c6272c4feaaf22cc8104f65ebcadac8ad2098dfacb6eb62e8c053698a40d" +checksum = "cfe85a837d11d62a9370cf0e06ac5d2afa417b1367c272930df038f29e22ff81" dependencies = [ "better_scoped_tls", "bitflags", @@ -2691,9 +2625,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.201.1" +version = "0.204.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f7845e59b50f8f6bf37a4067f6e91aad0c10fd5d2beb18df68b7ea7ee1ea09" +checksum = "aabd07c779dbad98f6b20529fd26375c69bcf1bd3c4d9bf8c897deea2b957108" dependencies = [ "dashmap", "indexmap", @@ -2715,9 +2649,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.186.2" +version = "0.189.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446da32cac8299973aaf1d37496562bfd0c1e4f3c3ab5d0af6f07f42e8184102" +checksum = "8284a266850bd85c10dbe24ecb792cdc3342e6b1910358771d233be0ce2abe0b" dependencies = [ "base64 0.21.7", "dashmap", @@ -2739,9 +2673,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.143.1" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774e9741d3377635e9b48b8f118722d758f42e51743789c0852f4b1524b7c428" +checksum = "366434f6d636c0d8590572e6dc479549d50a3451f7176c615781e1c0cee000ef" dependencies = [ "ansi_term", "anyhow", @@ -2765,9 +2699,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146562ac3515c8de0fa9d479c43ae673cf9df9ece814f8b8130686080a7251ac" +checksum = "1b3f3791d671c6b054f43e4b372bc77e6d2d559bdafd42dbe43294c7270d2cdb" dependencies = [ "indexmap", "rustc-hash", @@ -2782,9 +2716,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.130.1" +version = "0.133.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6a7f430bd83e14f3bf39f01e25806a5c403af73ff2cf94b647132594ddd63c" +checksum = "51b1346598210788a9dd16580a74cad627726bd166157e3ff4628d8324d125b9" dependencies = [ "indexmap", "num_cpus", @@ -2801,10 +2735,11 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.101.0" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0d997f0c9b4e181225f603d161f6757c2a97022258170982cfe005ec69ec92" +checksum = "0c6fd5dd0479b531085242c2b30f81a1bfdafa473c89f58e00f380006d204a2b" dependencies = [ + "new_debug_unreachable", "num-bigint", "swc_atoms", "swc_common", @@ -2815,7 +2750,7 @@ dependencies = [ [[package]] name = "swc_emotion" -version = "0.72.16" +version = "0.72.17" dependencies = [ "base64 0.22.1", "byteorder", @@ -2853,9 +2788,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8f9a90efb59dc5d918b4470e5d152f34cac2f8733bfba141a96440cab3eff" +checksum = "e02c81943772dc4fb0a6228360552d353fedc1a368ee6d80a5172ecb376b1796" dependencies = [ "anyhow", "miette", @@ -2866,9 +2801,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf5c1687e9858fb9de1ffa90a3e21369095406e97ace870a389320d105b0a" +checksum = "d78cdaedc56703bb852a84434aae862ead825fbcfb65e83bc53d50b91d6405b5" dependencies = [ "indexmap", "petgraph", @@ -2889,7 +2824,7 @@ dependencies = [ [[package]] name = "swc_magic" -version = "0.19.15" +version = "0.19.16" dependencies = [ "serde", "swc_atoms", @@ -2999,9 +2934,9 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98740e5a1ac82ad0de823bcf4aea97a76dce77c1ccff167d148e8a114b2932c0" +checksum = "19712a471479078252c013a33f24a6b9215630a1a75973a0c1532d7235f8abd2" dependencies = [ "better_scoped_tls", "rkyv", @@ -3133,7 +3068,7 @@ dependencies = [ [[package]] name = "swc_prefresh" -version = "0.1.1" +version = "0.1.2" dependencies = [ "serde", "swc_atoms", @@ -3149,7 +3084,7 @@ dependencies = [ [[package]] name = "swc_relay" -version = "0.44.20" +version = "0.44.21" dependencies = [ "once_cell", "regex", @@ -3167,9 +3102,9 @@ dependencies = [ [[package]] name = "swc_timer" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2460de9f00f2af53f65b787c771a6ba90c719d600adb3c71cbb87219646ab4" +checksum = "78cf01b1f8a318614f566145b0016b2a0e84ac66d78c1374cdc3438e06c27740" dependencies = [ "tracing", ] @@ -3187,9 +3122,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.5.14" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" +checksum = "52e2acde04c355dc8ffd62c56f263ba61a94b5c6d21ce2cdeaf857b5d74451a6" dependencies = [ "either", "swc_visit_macros", @@ -3257,24 +3192,14 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "testing" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d395aa823f3ad1ad845ed74b96188f493b469794cfbe9ef82f03196064086f" +checksum = "4ab10ecb9cf00ddccd7216451bd3fa5842969ce85c1139e8ddf7c14924a799e2" dependencies = [ "ansi_term", - "cargo_metadata 0.15.4", + "cargo_metadata", "difference", "once_cell", "pretty_assertions", @@ -3306,9 +3231,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", "unicode-linebreak", @@ -3434,9 +3359,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" dependencies = [ "serde", "stable_deref_trait", @@ -3474,9 +3399,9 @@ checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" -version = "1.0.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" +checksum = "bc3882f69607a2ac8cc4de3ee7993d8f68bb06f2974271195065b3bd07f2edea" [[package]] name = "unicode-ident" @@ -3547,7 +3472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", - "cargo_metadata 0.18.1", + "cargo_metadata", "regex", "rustversion", ] @@ -3751,7 +3676,7 @@ name = "xtask" version = "0.1.0" dependencies = [ "anyhow", - "cargo_metadata 0.18.1", + "cargo_metadata", "clap", ] diff --git a/packages/emotion/CHANGELOG.md b/packages/emotion/CHANGELOG.md index eea851c26..bab7d1dd0 100644 --- a/packages/emotion/CHANGELOG.md +++ b/packages/emotion/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-emotion +## 3.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 3.0.9 ### Patch Changes diff --git a/packages/emotion/Cargo.toml b/packages/emotion/Cargo.toml index ecbcf20eb..b20cbbb45 100644 --- a/packages/emotion/Cargo.toml +++ b/packages/emotion/Cargo.toml @@ -17,12 +17,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde = "1" serde_json = "1.0.117" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_emotion = { path = "./transform" } swc_plugin_macro = "0.9.16" -swc_plugin_proxy = "0.44.0" +swc_plugin_proxy = "0.46.0" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/emotion/README.md b/packages/emotion/README.md index 1b41e53ce..184dee79f 100644 --- a/packages/emotion/README.md +++ b/packages/emotion/README.md @@ -34,6 +34,12 @@ Source code for plugin itself (not transforms) are copied from https://github.co # @swc/plugin-emotion +## 3.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 3.0.9 ### Patch Changes diff --git a/packages/emotion/package.json b/packages/emotion/package.json index 7f2b7171d..ca5874599 100644 --- a/packages/emotion/package.json +++ b/packages/emotion/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-emotion", - "version": "3.0.9", + "version": "3.0.10", "description": "SWC plugin for emotion css-in-js library", "main": "swc_plugin_emotion.wasm", "scripts": { diff --git a/packages/emotion/transform/Cargo.toml b/packages/emotion/transform/Cargo.toml index b1b5b87b5..96e2f32df 100644 --- a/packages/emotion/transform/Cargo.toml +++ b/packages/emotion/transform/Cargo.toml @@ -7,7 +7,7 @@ license = { workspace = true } name = "swc_emotion" repository = { workspace = true } rust-version = { workspace = true } -version = "0.72.16" +version = "0.72.17" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -22,17 +22,17 @@ regex = "1.10" serde = "1" sourcemap = "8.0.1" swc_atoms = "0.6.7" -swc_common = "0.34.3" -swc_ecma_ast = "0.115.1" -swc_ecma_codegen = "0.151.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_ecma_ast = "0.117.0" +swc_ecma_codegen = "0.154.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_trace_macro = "0.1.3" tracing = { version = "0.1.40" } [dev-dependencies] serde_json = "1" -swc_ecma_parser = "0.146.7" -swc_ecma_transforms_react = "0.186.2" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_parser = "0.148.0" +swc_ecma_transforms_react = "0.189.0" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/emotion/transform/src/lib.rs b/packages/emotion/transform/src/lib.rs index 50bf65a1c..d2294d0c9 100644 --- a/packages/emotion/transform/src/lib.rs +++ b/packages/emotion/transform/src/lib.rs @@ -15,10 +15,10 @@ use swc_atoms::JsWord; use swc_common::{comments::Comments, util::take::Take, BytePos, SourceMapperDyn, DUMMY_SP}; use swc_ecma_ast::{ ArrayLit, CallExpr, Callee, ClassDecl, ClassMethod, ClassProp, Expr, ExprOrSpread, FnDecl, Id, - Ident, ImportDecl, ImportSpecifier, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, - JSXElement, JSXElementName, JSXExpr, JSXExprContainer, JSXObject, KeyValueProp, MemberProp, - MethodProp, ModuleExportName, ObjectLit, Pat, Prop, PropName, PropOrSpread, SourceMapperExt, - SpreadElement, Tpl, VarDeclarator, + Ident, IdentName, ImportDecl, ImportSpecifier, JSXAttr, JSXAttrName, JSXAttrOrSpread, + JSXAttrValue, JSXElement, JSXElementName, JSXExpr, JSXExprContainer, JSXObject, KeyValueProp, + MemberProp, MethodProp, ModuleExportName, ObjectLit, Pat, Prop, PropName, PropOrSpread, + SourceMapperExt, SpreadElement, Tpl, VarDeclarator, }; use swc_ecma_utils::ExprFactory; use swc_ecma_visit::{Fold, FoldWith}; @@ -350,7 +350,7 @@ impl EmotionTransformer { ); self.emotion_target_class_name_count += 1; PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident::new(key.into(), DUMMY_SP)), + key: PropName::Ident(IdentName::new(key.into(), DUMMY_SP)), value: stable_class_name.into(), }))) } @@ -494,7 +494,7 @@ impl Fold for EmotionTransformer { if self.options.auto_label.unwrap_or(false) { args_props.push(PropOrSpread::Prop(Box::new( Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident::new( + key: PropName::Ident(IdentName::new( "label".into(), DUMMY_SP, )), @@ -563,7 +563,7 @@ impl Fold for EmotionTransformer { if self.options.auto_label.unwrap_or(false) { args_props.push(PropOrSpread::Prop(Box::new( Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident::new( + key: PropName::Ident(IdentName::new( "label".into(), DUMMY_SP, )), @@ -585,16 +585,16 @@ impl Fold for EmotionTransformer { } return CallExpr { span: expr.span, - type_args: expr.type_args, args: expr.args, callee: CallExpr { span: DUMMY_SP, - type_args: None, - callee: Ident::new(i.sym.clone(), i.span) + callee: Ident::new(i.sym.clone(), i.span, i.ctxt) .as_callee(), args, + ..Default::default() } .as_callee(), + ..Default::default() }; } } @@ -671,7 +671,7 @@ impl Fold for EmotionTransformer { if self.options.auto_label.unwrap_or(false) { object_props.push(PropOrSpread::Prop(Box::new( Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident::new( + key: PropName::Ident(IdentName::new( "label".into(), DUMMY_SP, )), @@ -732,7 +732,7 @@ impl Fold for EmotionTransformer { } args }, - type_args: None, + ..Default::default() }); } } @@ -754,10 +754,9 @@ impl Fold for EmotionTransformer { } } return Expr::Call(CallExpr { - span: DUMMY_SP, callee: i.take().as_callee(), args, - type_args: None, + ..Default::default() }); } } @@ -774,7 +773,7 @@ impl Fold for EmotionTransformer { if self.options.auto_label.unwrap_or(false) { object_props.push(PropOrSpread::Prop(Box::new( Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident::new( + key: PropName::Ident(IdentName::new( "label".into(), DUMMY_SP, )), @@ -793,11 +792,7 @@ impl Fold for EmotionTransformer { self.comments.add_pure_comment(member_expr.span.lo()); return Expr::Call(CallExpr { - span: DUMMY_SP, - type_args: None, callee: CallExpr { - type_args: None, - span: DUMMY_SP, callee: i.take().as_callee(), args: vec![ prop.take().sym.as_arg(), @@ -807,9 +802,11 @@ impl Fold for EmotionTransformer { }) .as_arg(), ], + ..Default::default() } .as_callee(), args, + ..Default::default() }); } } @@ -820,7 +817,6 @@ impl Fold for EmotionTransformer { { self.comments.add_pure_comment(member_expr.span.lo()); return Expr::Call(CallExpr { - span: DUMMY_SP, callee: member_expr.take().as_callee(), args: { let mut args = self.create_args_from_tagged_tpl( @@ -836,7 +832,7 @@ impl Fold for EmotionTransformer { } args }, - type_args: None, + ..Default::default() }); } } diff --git a/packages/jest/CHANGELOG.md b/packages/jest/CHANGELOG.md index 5966c60b8..c3b3fe867 100644 --- a/packages/jest/CHANGELOG.md +++ b/packages/jest/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-jest +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/jest/Cargo.toml b/packages/jest/Cargo.toml index 4ed41d133..a44fce79c 100644 --- a/packages/jest/Cargo.toml +++ b/packages/jest/Cargo.toml @@ -17,10 +17,10 @@ crate-type = ["cdylib", "rlib"] [dependencies] phf = { version = "0.11.2", features = ["macros"] } serde = { version = "1.0.201", features = ["derive"] } -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/jest/README.md b/packages/jest/README.md index c5aace982..655dbd8ec 100644 --- a/packages/jest/README.md +++ b/packages/jest/README.md @@ -2,6 +2,12 @@ # @swc/plugin-jest +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/jest/package.json b/packages/jest/package.json index 9dc3b39e1..665091ba4 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-jest", - "version": "2.0.7", + "version": "2.0.8", "description": "SWC plugin for jest", "main": "swc_plugin_jest.wasm", "scripts": { diff --git a/packages/jest/src/lib.rs b/packages/jest/src/lib.rs index 7202bade0..5e3028656 100644 --- a/packages/jest/src/lib.rs +++ b/packages/jest/src/lib.rs @@ -59,18 +59,18 @@ impl Jest { ) => match &*callee.obj { Expr::Ident(i) if i.sym == *"jest" => match prop { _ if HOIST_METHODS.contains(&*prop.sym) => { - hoisted.push(T::from_stmt(stmt)); + hoisted.push(T::from(stmt)); } - _ => new.push(T::from_stmt(stmt)), + _ => new.push(T::from(stmt)), }, - _ => new.push(T::from_stmt(stmt)), + _ => new.push(T::from(stmt)), }, - _ => new.push(T::from_stmt(stmt)), + _ => new.push(T::from(stmt)), }, - _ => new.push(T::from_stmt(stmt)), + _ => new.push(T::from(stmt)), }, - _ => new.push(T::from_stmt(stmt)), + _ => new.push(T::from(stmt)), }, Err(node) => new.push(node), }; diff --git a/packages/loadable-components/CHANGELOG.md b/packages/loadable-components/CHANGELOG.md index 58cc53430..0327fe3a0 100644 --- a/packages/loadable-components/CHANGELOG.md +++ b/packages/loadable-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-loadable-components +## 1.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 1.0.9 ### Patch Changes diff --git a/packages/loadable-components/Cargo.toml b/packages/loadable-components/Cargo.toml index d9d38e854..ba0defd4b 100644 --- a/packages/loadable-components/Cargo.toml +++ b/packages/loadable-components/Cargo.toml @@ -20,17 +20,17 @@ once_cell = "1.19.0" regex = "1.10.4" serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = [ +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = [ "ecma_quote", "ecma_plugin_transform", ] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" -swc_plugin_proxy = "0.44.0" +swc_plugin_proxy = "0.46.0" tracing = { version = "0.1.40", features = ["release_max_level_off"] } [dev-dependencies] -testing = "0.36.0" +testing = "0.38.0" diff --git a/packages/loadable-components/README.md b/packages/loadable-components/README.md index 68ee98964..e392ffe2f 100644 --- a/packages/loadable-components/README.md +++ b/packages/loadable-components/README.md @@ -23,6 +23,12 @@ By default `loadable-components` are configured to transform dynamic imports use # @swc/plugin-loadable-components +## 1.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 1.0.9 ### Patch Changes diff --git a/packages/loadable-components/package.json b/packages/loadable-components/package.json index 60fb2eeba..58bd251e0 100644 --- a/packages/loadable-components/package.json +++ b/packages/loadable-components/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-loadable-components", - "version": "1.0.9", + "version": "1.0.10", "description": "SWC plugin for `@loadable/components`", "main": "swc_plugin_loadable_components.wasm", "scripts": { diff --git a/packages/loadable-components/src/lib.rs b/packages/loadable-components/src/lib.rs index bb67be2d8..efdfc8bc7 100644 --- a/packages/loadable-components/src/lib.rs +++ b/packages/loadable-components/src/lib.rs @@ -321,19 +321,16 @@ where key: PropName::Ident(quote_ident!("chunkName")), function: Box::new(Function { params: clone_params(func), - decorators: Default::default(), - span: DUMMY_SP, body: Some(BlockStmt { - span: DUMMY_SP, stmts: vec![Stmt::Return(ReturnStmt { span: DUMMY_SP, arg: Some(Box::new(self.replace_chunk_name(import))), })], + ..Default::default() }), is_generator: false, is_async: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }), } } @@ -347,8 +344,6 @@ where decorators: Default::default(), pat: Pat::Ident(quote_ident!("props").into()), }], - decorators: Default::default(), - span: DUMMY_SP, body: Some( quote!( " @@ -370,8 +365,7 @@ where ), is_generator: false, is_async: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }), } } @@ -392,8 +386,6 @@ where decorators: Default::default(), pat: Pat::Ident(quote_ident!("props").into()), }], - decorators: Default::default(), - span: DUMMY_SP, body: Some( quote!( " @@ -411,8 +403,7 @@ where ), is_generator: false, is_async: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }), } } @@ -426,8 +417,6 @@ where decorators: Default::default(), pat: Pat::Ident(quote_ident!("props").into()), }], - decorators: Default::default(), - span: DUMMY_SP, body: Some( quote!( " @@ -446,8 +435,7 @@ where ), is_generator: false, is_async: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }), } } @@ -463,8 +451,6 @@ where key: PropName::Ident(quote_ident!("resolve")), function: Box::new(Function { params: clone_params(func), - decorators: Default::default(), - span: DUMMY_SP, body: Some( quote!( " @@ -482,8 +468,7 @@ where ), is_generator: false, is_async: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }), } } @@ -564,7 +549,7 @@ where .as_arg(), "-".as_arg(), ], - type_args: Default::default(), + ..Default::default() }) } diff --git a/packages/noop/CHANGELOG.md b/packages/noop/CHANGELOG.md index 14ca23042..47465b70c 100644 --- a/packages/noop/CHANGELOG.md +++ b/packages/noop/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-noop +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/noop/Cargo.toml b/packages/noop/Cargo.toml index cc642f546..1b0185df0 100644 --- a/packages/noop/Cargo.toml +++ b/packages/noop/Cargo.toml @@ -18,10 +18,10 @@ version = "0.18.4" crate-type = ["cdylib", "rlib"] [dependencies] -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/noop/README.md b/packages/noop/README.md index 43493b45b..d2b97f31c 100644 --- a/packages/noop/README.md +++ b/packages/noop/README.md @@ -2,6 +2,12 @@ # @swc/plugin-noop +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/noop/package.json b/packages/noop/package.json index c40dedf08..197be87ee 100644 --- a/packages/noop/package.json +++ b/packages/noop/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-noop", - "version": "2.0.7", + "version": "2.0.8", "description": "Noop SWC plugin, for debugging", "main": "swc_plugin_noop.wasm", "scripts": { diff --git a/packages/prefresh/CHANGELOG.md b/packages/prefresh/CHANGELOG.md index d1e457da4..141a1187f 100644 --- a/packages/prefresh/CHANGELOG.md +++ b/packages/prefresh/CHANGELOG.md @@ -1 +1,7 @@ # @swc/plugin-prefresh + +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) diff --git a/packages/prefresh/Cargo.toml b/packages/prefresh/Cargo.toml index c545fa934..8affaf4ab 100644 --- a/packages/prefresh/Cargo.toml +++ b/packages/prefresh/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] serde_json = "1.0.117" -swc_common = { version = "0.34.3" } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } +swc_common = { version = "0.36.0" } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } swc_prefresh = { path = "./transform" } diff --git a/packages/prefresh/README.md b/packages/prefresh/README.md index 47568be0d..1f5cbf207 100644 --- a/packages/prefresh/README.md +++ b/packages/prefresh/README.md @@ -39,3 +39,9 @@ And SWC has built-in React Refresh transformation, therefore, this plugin only i ``` # @swc/plugin-prefresh + +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) diff --git a/packages/prefresh/package.json b/packages/prefresh/package.json index b03f8c567..1b8d4bda0 100644 --- a/packages/prefresh/package.json +++ b/packages/prefresh/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-prefresh", - "version": "2.0.7", + "version": "2.0.8", "description": "SWC plugin for preact refresh", "main": "swc_plugin_prefresh.wasm", "scripts": { diff --git a/packages/prefresh/transform/Cargo.toml b/packages/prefresh/transform/Cargo.toml index 68ef62f77..777ef12da 100644 --- a/packages/prefresh/transform/Cargo.toml +++ b/packages/prefresh/transform/Cargo.toml @@ -10,18 +10,18 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.1.1" +version = "0.1.2" [dependencies] serde = { version = "1", features = ["derive"] } swc_atoms = "0.6.7" -swc_common = "0.34.3" -swc_core = { version = "0.96.0", features = ["ecma_quote"] } -swc_ecma_ast = "0.115.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_core = { version = "0.99.2", features = ["ecma_quote"] } +swc_ecma_ast = "0.117.0" +swc_ecma_visit = "0.103.1" [dev-dependencies] -swc_ecma_parser = "0.146.7" -swc_ecma_transforms_base = "0.140.1" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_parser = "0.148.0" +swc_ecma_transforms_base = "0.143.1" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/prefresh/transform/src/lib.rs b/packages/prefresh/transform/src/lib.rs index 08fced709..7c166bf17 100644 --- a/packages/prefresh/transform/src/lib.rs +++ b/packages/prefresh/transform/src/lib.rs @@ -155,9 +155,8 @@ impl VisitMut for PrefreshPlugin { .skip(1) .map(|s| { Box::new(Expr::Ident(Ident { - span: DUMMY_SP, sym: Atom::from(s.replace('}', "").to_string()), - optional: false, + ..Default::default() })) }) .collect::>(); diff --git a/packages/react-remove-properties/CHANGELOG.md b/packages/react-remove-properties/CHANGELOG.md index 9f57d3154..3432b3d35 100644 --- a/packages/react-remove-properties/CHANGELOG.md +++ b/packages/react-remove-properties/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-react-remove-properties +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/react-remove-properties/Cargo.toml b/packages/react-remove-properties/Cargo.toml index d6e33273f..17b160866 100644 --- a/packages/react-remove-properties/Cargo.toml +++ b/packages/react-remove-properties/Cargo.toml @@ -21,10 +21,10 @@ crate-type = ["cdylib", "rlib"] react_remove_properties = { path = "./transform" } serde_json = "1.0.117" swc_cached = "0.3.20" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/react-remove-properties/README.md b/packages/react-remove-properties/README.md index 68c7fd346..b23aec9ee 100644 --- a/packages/react-remove-properties/README.md +++ b/packages/react-remove-properties/README.md @@ -23,6 +23,12 @@ or # @swc/plugin-react-remove-properties +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/react-remove-properties/package.json b/packages/react-remove-properties/package.json index 0df7fbf27..35c02bf36 100644 --- a/packages/react-remove-properties/package.json +++ b/packages/react-remove-properties/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-react-remove-properties", - "version": "2.0.7", + "version": "2.0.8", "description": "SWC plugin for https://www.npmjs.com/package/babel-plugin-react-remove-properties", "main": "swc_plugin_react_remove_properties.wasm", "scripts": { diff --git a/packages/react-remove-properties/transform/Cargo.toml b/packages/react-remove-properties/transform/Cargo.toml index 1593c4533..16485ffa0 100644 --- a/packages/react-remove-properties/transform/Cargo.toml +++ b/packages/react-remove-properties/transform/Cargo.toml @@ -11,7 +11,7 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.24.15" +version = "0.24.16" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,12 +20,12 @@ version = "0.24.15" serde = { version = "1", features = ["derive"] } swc_atoms = "0.6.7" swc_cached = "0.3.20" -swc_common = "0.34.3" -swc_ecma_ast = "0.115.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_ecma_ast = "0.117.0" +swc_ecma_visit = "0.103.1" [dev-dependencies] -swc_ecma_parser = "0.146.7" -swc_ecma_transforms_base = "0.140.1" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_parser = "0.148.0" +swc_ecma_transforms_base = "0.143.1" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/relay/CHANGELOG.md b/packages/relay/CHANGELOG.md index 06841bed4..3f60bd142 100644 --- a/packages/relay/CHANGELOG.md +++ b/packages/relay/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-relay +## 2.0.13 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.12 ### Patch Changes diff --git a/packages/relay/Cargo.toml b/packages/relay/Cargo.toml index d13dbe6d8..fae27c6fe 100644 --- a/packages/relay/Cargo.toml +++ b/packages/relay/Cargo.toml @@ -19,11 +19,11 @@ once_cell = "1.19.0" regex = "1.10" serde = "1" serde_json = "1" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" swc_relay = { path = "./transform" } tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/relay/README.md b/packages/relay/README.md index 262d78297..83db8c470 100644 --- a/packages/relay/README.md +++ b/packages/relay/README.md @@ -104,6 +104,12 @@ In this example typescript graphql files will output transpiled import path of ` # @swc/plugin-relay +## 2.0.13 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.12 ### Patch Changes diff --git a/packages/relay/package.json b/packages/relay/package.json index ba83bf617..d860d1786 100644 --- a/packages/relay/package.json +++ b/packages/relay/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-relay", - "version": "2.0.12", + "version": "2.0.13", "description": "SWC plugin for relay", "main": "swc_plugin_relay.wasm", "types": "./types.d.ts", diff --git a/packages/relay/transform/Cargo.toml b/packages/relay/transform/Cargo.toml index 55ceba5bd..d92348092 100644 --- a/packages/relay/transform/Cargo.toml +++ b/packages/relay/transform/Cargo.toml @@ -11,7 +11,7 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.44.20" +version = "0.44.21" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -22,12 +22,12 @@ regex = "1.10" serde = "1" serde_json = "1" swc_atoms = "0.6.7" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" tracing = { version = "0.1.40" } [dev-dependencies] -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/relay/transform/src/lib.rs b/packages/relay/transform/src/lib.rs index 1e7c0c0b1..8a0287f64 100644 --- a/packages/relay/transform/src/lib.rs +++ b/packages/relay/transform/src/lib.rs @@ -12,7 +12,7 @@ use once_cell::sync::Lazy; use regex::Regex; use serde::Deserialize; use swc_atoms::JsWord; -use swc_common::{FileName, Mark, DUMMY_SP}; +use swc_common::{FileName, Mark, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::{prepend_stmts, quote_ident, ExprFactory}; use swc_ecma_visit::{Fold, FoldWith}; @@ -86,10 +86,11 @@ impl RelayImport { specifiers: vec![ImportSpecifier::Default(ImportDefaultSpecifier { span: Default::default(), local: Ident { - span: self + ctxt: self .unresolved_mark - .map(|m| DUMMY_SP.apply_mark(m)) + .map(|m| SyntaxContext::empty().apply_mark(m)) .unwrap_or_default(), + span: DUMMY_SP, sym: self.item.clone(), optional: false, }, @@ -172,7 +173,8 @@ fn build_require_expr_from_path(path: &str, mark: Option) -> Expr { Expr::Call(CallExpr { span: Default::default(), callee: quote_ident!( - mark.map(|m| DUMMY_SP.apply_mark(m)).unwrap_or(DUMMY_SP), + mark.map(|m| SyntaxContext::empty().apply_mark(m)) + .unwrap_or_default(), "require" ) .as_callee(), @@ -182,7 +184,7 @@ fn build_require_expr_from_path(path: &str, mark: Option) -> Expr { raw: None, }) .as_arg()], - type_args: None, + ..Default::default() }) } @@ -316,12 +318,12 @@ impl Relay { unresolved_mark: self.unresolved_mark, }); let operation_ident = Ident { - span: self + ctxt: self .unresolved_mark - .map(|m| DUMMY_SP.apply_mark(m)) + .map(|m| SyntaxContext::empty().apply_mark(m)) .unwrap_or_default(), sym: ident_name, - optional: false, + ..Default::default() }; Some(Expr::Ident(operation_ident)) } else { diff --git a/packages/remove-console/CHANGELOG.md b/packages/remove-console/CHANGELOG.md index 89e7be94b..3a753d5c1 100644 --- a/packages/remove-console/CHANGELOG.md +++ b/packages/remove-console/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-remove-console +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/remove-console/Cargo.toml b/packages/remove-console/Cargo.toml index 2afe226b2..b5db3df90 100644 --- a/packages/remove-console/Cargo.toml +++ b/packages/remove-console/Cargo.toml @@ -20,10 +20,10 @@ crate-type = ["cdylib", "rlib"] [dependencies] remove_console = { path = "./transform" } serde_json = "1.0.117" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/remove-console/README.md b/packages/remove-console/README.md index 46613b682..cf174a2ad 100644 --- a/packages/remove-console/README.md +++ b/packages/remove-console/README.md @@ -21,6 +21,12 @@ or # @swc/plugin-remove-console +## 2.0.8 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.7 ### Patch Changes diff --git a/packages/remove-console/package.json b/packages/remove-console/package.json index 01f84ddf9..beacbef4c 100644 --- a/packages/remove-console/package.json +++ b/packages/remove-console/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-remove-console", - "version": "2.0.7", + "version": "2.0.8", "description": "SWC plugin for https://www.npmjs.com/package/babel-plugin-remove-console", "main": "swc_plugin_remove_console.wasm", "scripts": { diff --git a/packages/remove-console/transform/Cargo.toml b/packages/remove-console/transform/Cargo.toml index 15444a870..1a8e0e2e9 100644 --- a/packages/remove-console/transform/Cargo.toml +++ b/packages/remove-console/transform/Cargo.toml @@ -11,7 +11,7 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.25.15" +version = "0.25.16" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,12 +20,12 @@ version = "0.25.15" serde = { version = "1", features = ["derive"] } swc_atoms = "0.6.7" swc_cached = "0.3.20" -swc_common = "0.34.3" -swc_ecma_ast = "0.115.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_ecma_ast = "0.117.0" +swc_ecma_visit = "0.103.1" [dev-dependencies] -swc_ecma_parser = "0.146.7" -swc_ecma_transforms_base = "0.140.1" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_parser = "0.148.0" +swc_ecma_transforms_base = "0.143.1" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/remove-console/transform/src/lib.rs b/packages/remove-console/transform/src/lib.rs index 0db6c7f04..1ab7bcfb6 100644 --- a/packages/remove-console/transform/src/lib.rs +++ b/packages/remove-console/transform/src/lib.rs @@ -33,7 +33,7 @@ struct RemoveConsole { impl RemoveConsole { fn is_global_console(&self, ident: &Ident) -> bool { - &ident.sym == "console" && ident.span.ctxt == self.unresolved_ctxt + &ident.sym == "console" && ident.ctxt == self.unresolved_ctxt } fn should_remove_call(&mut self, n: &CallExpr) -> bool { diff --git a/packages/styled-components/CHANGELOG.md b/packages/styled-components/CHANGELOG.md index e81388d47..b3b081635 100644 --- a/packages/styled-components/CHANGELOG.md +++ b/packages/styled-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-styled-components +## 2.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.9 ### Patch Changes diff --git a/packages/styled-components/Cargo.toml b/packages/styled-components/Cargo.toml index 584a40b38..1900238cd 100644 --- a/packages/styled-components/Cargo.toml +++ b/packages/styled-components/Cargo.toml @@ -22,10 +22,10 @@ serde = { version = "1.0.201", features = ["derive"] } serde_json = "1.0.117" styled_components = { path = "./transform" } swc_atoms = "0.6.7" -swc_common = { version = "0.34.3", features = ["concurrent"] } -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = { version = "0.36.0", features = ["concurrent"] } +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } diff --git a/packages/styled-components/README.md b/packages/styled-components/README.md index 14b9a1c8c..fa9177ff6 100644 --- a/packages/styled-components/README.md +++ b/packages/styled-components/README.md @@ -28,6 +28,12 @@ Then update your `.swcrc` file like below: # @swc/plugin-styled-components +## 2.0.10 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.9 ### Patch Changes diff --git a/packages/styled-components/package.json b/packages/styled-components/package.json index 1fc0f5e59..4597a0a94 100644 --- a/packages/styled-components/package.json +++ b/packages/styled-components/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-styled-components", - "version": "2.0.9", + "version": "2.0.10", "description": "SWC plugin for styled-components", "main": "swc_plugin_styled_components.wasm", "scripts": { diff --git a/packages/styled-components/src/lib.rs b/packages/styled-components/src/lib.rs index d4b873088..44d8d4bc0 100644 --- a/packages/styled-components/src/lib.rs +++ b/packages/styled-components/src/lib.rs @@ -1,5 +1,7 @@ #![allow(clippy::not_unsafe_ptr_arg_deref)] +use std::sync::Arc; + use styled_components::Config; use swc_common::{SourceMapper, Spanned}; use swc_core::{ @@ -21,10 +23,12 @@ fn styled_components(mut program: Program, data: TransformPluginProgramMetadata) ) .expect("invalid config for styled-components"); - let file_name = match data.get_context(&TransformPluginMetadataContextKind::Filename) { - Some(s) => FileName::Real(s.into()), - None => FileName::Anon, - }; + let file_name = Arc::new( + match data.get_context(&TransformPluginMetadataContextKind::Filename) { + Some(s) => FileName::Real(s.into()), + None => FileName::Anon, + }, + ); let pos = data.source_map.lookup_char_pos(program.span().lo); let hash = pos.file.src_hash; diff --git a/packages/styled-components/transform/Cargo.toml b/packages/styled-components/transform/Cargo.toml index d8d4ff6d7..5f6093ee2 100644 --- a/packages/styled-components/transform/Cargo.toml +++ b/packages/styled-components/transform/Cargo.toml @@ -12,7 +12,7 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.96.18" +version = "0.96.19" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -26,15 +26,15 @@ regex = { version = "1.10.4", features = [ ], default-features = false } serde = { version = "1.0.201", features = ["derive"] } swc_atoms = "0.6.7" -swc_common = "0.34.3" -swc_ecma_ast = "0.115.1" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_ecma_ast = "0.117.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" tracing = "0.1.40" [dev-dependencies] serde_json = "1" -swc_ecma_parser = "0.146.7" -swc_ecma_transforms = "0.232.1" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_parser = "0.148.0" +swc_ecma_transforms = "0.235.0" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/styled-components/transform/src/lib.rs b/packages/styled-components/transform/src/lib.rs index e52bdf719..1ddcdfb46 100644 --- a/packages/styled-components/transform/src/lib.rs +++ b/packages/styled-components/transform/src/lib.rs @@ -1,6 +1,6 @@ #![deny(unused)] -use std::{cell::RefCell, rc::Rc}; +use std::{cell::RefCell, rc::Rc, sync::Arc}; use serde::Deserialize; use swc_atoms::JsWord; @@ -72,7 +72,7 @@ impl Config { } pub fn styled_components( - file_name: FileName, + file_name: Arc, src_file_hash: u128, config: Config, comments: C, diff --git a/packages/styled-components/transform/src/utils/analyzer.rs b/packages/styled-components/transform/src/utils/analyzer.rs index 373019f98..4b85055ca 100644 --- a/packages/styled-components/transform/src/utils/analyzer.rs +++ b/packages/styled-components/transform/src/utils/analyzer.rs @@ -84,7 +84,7 @@ impl Visit for Analyzer<'_> { if is_styled { self.state.styled_required = Some(name.id.to_id()); - self.state.unresolved_ctxt = Some(callee.span.ctxt); + self.state.unresolved_ctxt = Some(callee.ctxt); } } } diff --git a/packages/styled-components/transform/src/utils/mod.rs b/packages/styled-components/transform/src/utils/mod.rs index 88b04e176..31a8ca4b1 100644 --- a/packages/styled-components/transform/src/utils/mod.rs +++ b/packages/styled-components/transform/src/utils/mod.rs @@ -21,7 +21,7 @@ pub(crate) fn get_prop_key_as_expr(p: &Prop) -> Cow { pub(crate) fn prop_name_to_expr(p: &PropName) -> Cow { match p { - PropName::Ident(p) => Cow::Owned(Expr::Ident(p.clone())), + PropName::Ident(p) => Cow::Owned(Expr::Ident(p.clone().into())), PropName::Str(p) => Cow::Owned(Expr::Lit(Lit::Str(p.clone()))), PropName::Num(p) => Cow::Owned(Expr::Lit(Lit::Num(p.clone()))), PropName::BigInt(p) => Cow::Owned(Expr::Lit(Lit::BigInt(p.clone()))), @@ -42,9 +42,9 @@ pub(crate) fn get_prop_name(p: &Prop) -> Option<&PropName> { pub(crate) fn get_prop_name2(p: &Prop) -> PropName { match p { - Prop::Shorthand(ident) => PropName::Ident(ident.clone()), + Prop::Shorthand(ident) => PropName::Ident(ident.clone().into()), Prop::KeyValue(p) => p.key.clone(), - Prop::Assign(x) => PropName::Ident(x.key.clone()), + Prop::Assign(x) => PropName::Ident(x.key.clone().into()), Prop::Getter(p) => p.key.clone(), Prop::Setter(p) => p.key.clone(), Prop::Method(p) => p.key.clone(), @@ -93,7 +93,7 @@ impl State { }) => { if let Expr::Ident(obj) = &**obj { if Some(obj.to_id()) == self.import_local_name("default", Some(obj)) - && !self.is_helper(&Expr::Ident(prop.clone())) + && !self.is_helper(&Expr::Ident(prop.clone().into())) { return true; } diff --git a/packages/styled-components/transform/src/visitors/display_name_and_id.rs b/packages/styled-components/transform/src/visitors/display_name_and_id.rs index 9f22fb03a..4bd44870a 100644 --- a/packages/styled-components/transform/src/visitors/display_name_and_id.rs +++ b/packages/styled-components/transform/src/visitors/display_name_and_id.rs @@ -1,4 +1,4 @@ -use std::{cell::RefCell, convert::TryInto, path::Path, rc::Rc}; +use std::{cell::RefCell, convert::TryInto, path::Path, rc::Rc, sync::Arc}; use once_cell::sync::Lazy; use regex::Regex; @@ -15,7 +15,7 @@ use crate::{ }; pub fn display_name_and_id( - file_name: FileName, + file_name: Arc, src_file_hash: u128, config: Rc, state: Rc>, @@ -36,7 +36,7 @@ static DISPLAY_NAME_REGEX: Lazy = #[derive(Debug)] struct DisplayNameAndId { - file_name: FileName, + file_name: Arc, src_file_hash: u128, config: Rc, @@ -69,7 +69,7 @@ impl DisplayNameAndId { fn get_display_name(&mut self, _: &Expr) -> JsWord { let component_name = self.cur_display_name.clone().unwrap_or(js_word!("")); - match &self.file_name { + match &*self.file_name { FileName::Real(f) if self.config.file_name => { let block_name = self.get_block_name(f); @@ -190,7 +190,6 @@ impl DisplayNameAndId { if let Expr::TaggedTpl(e) = e { e.tag = Box::new(Expr::Call(CallExpr { - span: DUMMY_SP, callee: e .tag .take() @@ -201,7 +200,7 @@ impl DisplayNameAndId { props: with_config_props, } .as_arg()], - type_args: Default::default(), + ..Default::default() })); return; } @@ -222,7 +221,7 @@ impl DisplayNameAndId { props: with_config_props, } .as_arg()], - type_args: Default::default(), + ..Default::default() })); return; } diff --git a/packages/styled-components/transform/src/visitors/template_literals.rs b/packages/styled-components/transform/src/visitors/template_literals.rs index 61f7f309d..520d8ee1c 100644 --- a/packages/styled-components/transform/src/visitors/template_literals.rs +++ b/packages/styled-components/transform/src/visitors/template_literals.rs @@ -63,7 +63,7 @@ impl VisitMut for TemplateLiterals { span: tagged.span, callee: tagged.tag.into(), args, - type_args: tagged.type_params, + ..Default::default() }) }); } diff --git a/packages/styled-components/transform/src/visitors/transpile_css_prop/transpile.rs b/packages/styled-components/transform/src/visitors/transpile_css_prop/transpile.rs index f49064ee9..c8b0630b8 100644 --- a/packages/styled-components/transform/src/visitors/transpile_css_prop/transpile.rs +++ b/packages/styled-components/transform/src/visitors/transpile_css_prop/transpile.rs @@ -9,7 +9,7 @@ use swc_atoms::JsWord; use swc_common::{ collections::{AHashMap, AHashSet}, util::take::Take, - Spanned, DUMMY_SP, + Spanned, SyntaxContext, DUMMY_SP, }; use swc_ecma_ast::*; use swc_ecma_utils::{prepend_stmt, private_ident, quote_ident, ExprFactory}; @@ -97,6 +97,7 @@ impl VisitMut for TranspileCssProp { let id_sym = JsWord::from(id_sym); let styled_idx = self.next_styled_idx(id_sym.clone()); let id = quote_ident!( + SyntaxContext::empty(), elem.opening.name.span(), append_if_gt_one(&format!("_Styled{}", id_sym), styled_idx) ); @@ -112,7 +113,7 @@ impl VisitMut for TranspileCssProp { raw: None, }) .as_arg()], - type_args: Default::default(), + ..Default::default() })), None::, ) @@ -124,7 +125,7 @@ impl VisitMut for TranspileCssProp { span: DUMMY_SP, callee: import_name.as_callee(), args: vec![name_expr.as_arg()], - type_args: Default::default(), + ..Default::default() }), if self.is_top_level_ident(&name) { Some(name) @@ -210,7 +211,7 @@ impl VisitMut for TranspileCssProp { let p = quote_ident!("p"); let mut reducer = PropertyReducer { - p: p.clone(), + p: p.clone().into(), replace_object_with_prop_function: false, extra_attrs: Default::default(), identifier_idx: &mut self.identifier_idx, @@ -228,13 +229,11 @@ impl VisitMut for TranspileCssProp { if reducer.replace_object_with_prop_function { css = Expr::Arrow(ArrowExpr { - span: DUMMY_SP, params: vec![Pat::Ident(p.clone().into())], body: Box::new(BlockStmtOrExpr::Expr(Box::new(css.take()))), is_async: false, is_generator: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }); } } else { @@ -271,15 +270,13 @@ impl VisitMut for TranspileCssProp { })); acc.push(Box::new(Expr::Arrow(ArrowExpr { - span: DUMMY_SP, params: vec![Pat::Ident(p.clone().into())], body: Box::new(BlockStmtOrExpr::Expr( p.make_member(identifier).into(), )), is_async: false, is_generator: false, - type_params: Default::default(), - return_type: Default::default(), + ..Default::default() }))); acc @@ -296,22 +293,22 @@ impl VisitMut for TranspileCssProp { span: DUMMY_SP, callee: styled.as_callee(), args: vec![css.as_arg()], - type_args: Default::default(), + ..Default::default() })), _ => Box::new(Expr::TaggedTpl(TaggedTpl { span: DUMMY_SP, tag: Box::new(styled), - type_params: Default::default(), tpl: Box::new(css.expect_tpl()), + ..Default::default() })), }), definite: false, }; let stmt = Stmt::Decl(Decl::Var(Box::new(VarDecl { - span: DUMMY_SP, kind: VarDeclKind::Var, declare: false, decls: vec![var], + ..Default::default() }))); match inject_after { Some(injector) => { @@ -334,7 +331,7 @@ impl VisitMut for TranspileCssProp { match attr { JSXAttrOrSpread::JSXAttr(attr) => { if match &attr.name { - JSXAttrName::Ident(Ident { sym, .. }) => sym.is_empty(), + JSXAttrName::Ident(IdentName { sym, .. }) => sym.is_empty(), _ => false, } { return false; @@ -552,7 +549,7 @@ fn set_value_of_prop(prop: &mut Prop, value: Box) { match prop { Prop::Shorthand(p) => { *prop = Prop::KeyValue(KeyValueProp { - key: PropName::Ident(p.clone()), + key: PropName::Ident(p.clone().into()), value, }); } @@ -589,10 +586,10 @@ fn set_key_of_prop(prop: &mut Prop, key: Box) { }); } -fn get_local_identifier(idx: &mut usize, expr: &Expr) -> Ident { +fn get_local_identifier(idx: &mut usize, expr: &Expr) -> IdentName { *idx += 1; - let identifier = quote_ident!(expr.span(), append_if_gt_one("$_css", *idx)); + let identifier = IdentName::new(append_if_gt_one("$_css", *idx).into(), expr.span()); // TODO: Unique identifier @@ -613,7 +610,7 @@ fn get_name_ident(el: &JSXElementName) -> Ident { JSXElementName::JSXMemberExpr(e) => Ident { sym: format!("{}_{}", get_name_of_jsx_obj(&e.obj), e.prop.sym).into(), span: e.prop.span, - optional: false, + ..Default::default() }, _ => { unimplemented!("get_name_ident for namespaced jsx element") diff --git a/packages/styled-jsx/CHANGELOG.md b/packages/styled-jsx/CHANGELOG.md index f1a8731c3..11a825086 100644 --- a/packages/styled-jsx/CHANGELOG.md +++ b/packages/styled-jsx/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-styled-jsx +## 2.0.14 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.13 ### Patch Changes diff --git a/packages/styled-jsx/Cargo.toml b/packages/styled-jsx/Cargo.toml index b0a8ceac0..9883cc057 100644 --- a/packages/styled-jsx/Cargo.toml +++ b/packages/styled-jsx/Cargo.toml @@ -25,16 +25,16 @@ anyhow = "1" serde_json = "1" styled_jsx = { path = "./transform" } swc_atoms = "0.6.7" -swc_common = "0.34.3" -swc_core = { version = "0.96.0", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.115.1" -swc_ecma_minifier = "0.197.1" -swc_ecma_parser = "0.146.7" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +swc_common = "0.36.0" +swc_core = { version = "0.99.2", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.117.0" +swc_ecma_minifier = "0.200.1" +swc_ecma_parser = "0.148.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" tracing = { version = "0.1.40", features = ["release_max_level_off"] } [dev-dependencies] -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/styled-jsx/README.md b/packages/styled-jsx/README.md index 3730971f9..803f43f3f 100644 --- a/packages/styled-jsx/README.md +++ b/packages/styled-jsx/README.md @@ -2,6 +2,12 @@ # @swc/plugin-styled-jsx +## 2.0.14 + +### Patch Changes + +- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0) + ## 2.0.13 ### Patch Changes diff --git a/packages/styled-jsx/package.json b/packages/styled-jsx/package.json index c8794f010..e1fbd8184 100644 --- a/packages/styled-jsx/package.json +++ b/packages/styled-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-styled-jsx", - "version": "2.0.13", + "version": "2.0.14", "description": "SWC plugin for styled-jsx", "main": "swc_plugin_styled_jsx.wasm", "scripts": { diff --git a/packages/styled-jsx/transform/Cargo.toml b/packages/styled-jsx/transform/Cargo.toml index 486d46d03..a3e55e268 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.73.27" +version = "0.73.28" [features] @@ -26,23 +26,23 @@ parcel_selectors = "0.26.4" serde = { version = "1", features = ["derive"] } tracing = "0.1.40" -preset_env_base = "0.5.0" -swc_common = "0.34.3" -swc_css_ast = "0.141.0" -swc_css_codegen = "0.152.0" -swc_css_compat = "0.28.0" -swc_css_minifier = "0.117.1" -swc_css_parser = "0.151.0" -swc_css_prefixer = "0.155.0" -swc_css_visit = "0.140.0" -swc_ecma_ast = "0.115.1" -swc_ecma_minifier = "0.197.1" -swc_ecma_parser = "0.146.7" -swc_ecma_utils = "0.130.1" -swc_ecma_visit = "0.101.0" +preset_env_base = "0.5.1" +swc_common = "0.36.0" +swc_css_ast = "0.143.0" +swc_css_codegen = "0.154.0" +swc_css_compat = "0.30.0" +swc_css_minifier = "0.119.0" +swc_css_parser = "0.153.0" +swc_css_prefixer = "0.157.0" +swc_css_visit = "0.142.0" +swc_ecma_ast = "0.117.0" +swc_ecma_minifier = "0.200.1" +swc_ecma_parser = "0.148.0" +swc_ecma_utils = "0.133.1" +swc_ecma_visit = "0.103.1" swc_plugin_macro = "0.9.16" [dev-dependencies] -swc_ecma_transforms = "0.232.1" -swc_ecma_transforms_testing = "0.143.1" -testing = "0.36.0" +swc_ecma_transforms = "0.235.0" +swc_ecma_transforms_testing = "0.146.0" +testing = "0.38.0" diff --git a/packages/styled-jsx/transform/src/transform_css_lightningcss.rs b/packages/styled-jsx/transform/src/transform_css_lightningcss.rs index 3c430a470..f27b72d44 100644 --- a/packages/styled-jsx/transform/src/transform_css_lightningcss.rs +++ b/packages/styled-jsx/transform/src/transform_css_lightningcss.rs @@ -61,7 +61,7 @@ fn report( let mut db = DiagnosticBuilder::new(handler, level, &err.kind.to_string()); if let Some(lo) = lo { - db.set_span(Span::new(lo, lo, Default::default())); + db.set_span(Span::new(lo, lo)); } db.emit(); diff --git a/packages/styled-jsx/transform/src/transform_css_swc.rs b/packages/styled-jsx/transform/src/transform_css_swc.rs index e3319fd33..28decd9da 100644 --- a/packages/styled-jsx/transform/src/transform_css_swc.rs +++ b/packages/styled-jsx/transform/src/transform_css_swc.rs @@ -2,8 +2,8 @@ use std::{panic, sync::Arc}; use anyhow::{bail, Error}; use swc_common::{ - errors::HANDLER, source_map::Pos, util::take::Take, BytePos, SourceMap, Span, Spanned, - SyntaxContext, DUMMY_SP, + errors::HANDLER, source_map::SmallPos, util::take::Take, BytePos, SourceMap, Span, Spanned, + DUMMY_SP, }; use swc_css_ast::{ ClassSelector, Combinator, CombinatorValue, ComplexSelector, ComplexSelectorChildren, @@ -243,7 +243,7 @@ impl Namespacer { let hi = tokens.last().map(|v| v.span_hi()).unwrap_or(BytePos(0)); Tokens { - span: Span::new(lo, hi, Default::default()), + span: Span::new(lo, hi), tokens, } }; @@ -366,7 +366,6 @@ fn get_front_selector_tokens(selector_tokens: &Tokens) -> Vec { span: Span { lo: BytePos(start_pos), hi: BytePos(start_pos + 1), - ctxt: SyntaxContext::empty(), }, token: Token::Ident { raw: "a".into(), @@ -377,7 +376,6 @@ fn get_front_selector_tokens(selector_tokens: &Tokens) -> Vec { span: Span { lo: BytePos(start_pos + 1), hi: BytePos(start_pos + 2), - ctxt: SyntaxContext::empty(), }, token: Token::WhiteSpace { value: " ".into() }, }, diff --git a/packages/styled-jsx/transform/src/utils.rs b/packages/styled-jsx/transform/src/utils.rs index 42b16dc2e..d953b66c1 100644 --- a/packages/styled-jsx/transform/src/utils.rs +++ b/packages/styled-jsx/transform/src/utils.rs @@ -66,13 +66,11 @@ pub fn compute_class_names( callee: Callee::Expr(Box::new(Expr::Member(MemberExpr { obj: Box::new(Expr::Ident(Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() })), - prop: MemberProp::Ident(Ident { + prop: MemberProp::Ident(IdentName { sym: "dynamic".into(), span: DUMMY_SP, - optional: false, }), span: DUMMY_SP, }))), @@ -121,8 +119,7 @@ pub fn compute_class_names( })), spread: None, }], - span: DUMMY_SP, - type_args: None, + ..Default::default() })), }; @@ -161,10 +158,9 @@ pub fn compute_class_names( pub fn make_external_styled_jsx_el(style: &ExternalStyle, style_import_name: &str) -> JSXElement { let attrs = vec![JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { + name: JSXAttrName::Ident(IdentName { sym: "id".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), value: Some(JSXAttrValue::JSXExprContainer(JSXExprContainer { expr: JSXExpr::Expr(Box::new(style.expr.clone())), @@ -175,8 +171,7 @@ pub fn make_external_styled_jsx_el(style: &ExternalStyle, style_import_name: &st let opening = JSXOpeningElement { name: JSXElementName::Ident(Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), attrs, span: DUMMY_SP, @@ -187,8 +182,7 @@ pub fn make_external_styled_jsx_el(style: &ExternalStyle, style_import_name: &st let closing = Some(JSXClosingElement { name: JSXElementName::Ident(Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), span: DUMMY_SP, }); @@ -216,10 +210,9 @@ pub fn make_local_styled_jsx_el( _ => style_info.hash.clone(), }; let mut attrs = vec![JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { + name: JSXAttrName::Ident(IdentName { sym: "id".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), value: Some(JSXAttrValue::JSXExprContainer(JSXExprContainer { expr: JSXExpr::Expr(Box::new(string_literal_expr( @@ -232,10 +225,9 @@ pub fn make_local_styled_jsx_el( if style_info.is_dynamic { attrs.push(JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { + name: JSXAttrName::Ident(IdentName { sym: "dynamic".into(), span: DUMMY_SP, - optional: false, }), value: Some(JSXAttrValue::JSXExprContainer(JSXExprContainer { expr: JSXExpr::Expr(Box::new(Expr::Array(ArrayLit { @@ -260,8 +252,7 @@ pub fn make_local_styled_jsx_el( let opening = JSXOpeningElement { name: JSXElementName::Ident(Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), attrs, span: DUMMY_SP, @@ -272,8 +263,7 @@ pub fn make_local_styled_jsx_el( let closing = Some(JSXClosingElement { name: JSXElementName::Ident(Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), span: DUMMY_SP, }); @@ -303,8 +293,7 @@ pub fn styled_jsx_import_decl(style_import_name: &str) -> ModuleItem { specifiers: vec![ImportSpecifier::Default(ImportDefaultSpecifier { local: Ident { sym: style_import_name.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }, span: DUMMY_SP, })], @@ -329,11 +318,10 @@ pub fn string_literal_expr(s: &str) -> Expr { s.replace("\\`", "`").into() } -pub fn ident(s: &str) -> Ident { - Ident { +pub fn ident(s: &str) -> IdentName { + IdentName { sym: s.into(), - span: DUMMY_SP, - optional: false, + ..Default::default() } } diff --git a/packages/styled-jsx/transform/src/visitor.rs b/packages/styled-jsx/transform/src/visitor.rs index c0bc81ea5..3a9cff7fa 100644 --- a/packages/styled-jsx/transform/src/visitor.rs +++ b/packages/styled-jsx/transform/src/visitor.rs @@ -193,13 +193,14 @@ impl Fold for StyledJSXTransformer<'_> { el.attrs = el.attrs.fold_with(self); - if let JSXElementName::Ident(Ident { sym, span, .. }) = &el.name { + if let JSXElementName::Ident(Ident { + sym, span, ctxt, .. + }) = &el.name + { if sym != "style" && sym != self.style_import_name.as_ref().unwrap() && (!is_capitalized(sym) - || self - .nearest_scope_bindings - .contains(&(sym.clone(), span.ctxt))) + || self.nearest_scope_bindings.contains(&(sym.clone(), *ctxt))) { let (existing_class_name, existing_index, existing_spread_index) = get_existing_class_name(&el); @@ -300,11 +301,13 @@ impl Fold for StyledJSXTransformer<'_> { let declarator = declarator.fold_children_with(self); if let Some(external_hash) = &self.external_hash.take() { if let Pat::Ident(BindingIdent { - id: Ident { span, sym, .. }, + id: Ident { + span, ctxt, sym, .. + }, .. }) = &declarator.name { - self.add_hash = Some(((sym.clone(), span.ctxt), external_hash.clone())); + self.add_hash = Some(((sym.clone(), *ctxt), external_hash.clone())); } } declarator @@ -349,7 +352,8 @@ impl Fold for StyledJSXTransformer<'_> { name: Pat::Ident(BindingIdent { id: Ident { sym: default_ident.0.clone(), - span: DUMMY_SP.with_ctxt(default_ident.1), + ctxt: default_ident.1, + span: DUMMY_SP, optional: false, }, type_ann: None, @@ -358,7 +362,7 @@ impl Fold for StyledJSXTransformer<'_> { definite: false, span: DUMMY_SP, }], - span: DUMMY_SP, + ..Default::default() }))))); self.add_default_decl = None; if let Some(add_hash) = self.add_hash.take() { @@ -564,10 +568,9 @@ impl StyledJSXTransformer<'_> { return JSXStyle::External(ExternalStyle { expr: Expr::Member(MemberExpr { obj: Box::new(Expr::Ident(ident.clone())), - prop: MemberProp::Ident(Ident { + prop: MemberProp::Ident(IdentName { sym: "__hash".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), span: DUMMY_SP, }), @@ -597,7 +600,7 @@ impl StyledJSXTransformer<'_> { let is_global = el.opening.attrs.iter().any(|attr| { if let JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { sym, .. }), + name: JSXAttrName::Ident(IdentName { sym, .. }), .. }) = &attr { @@ -664,7 +667,7 @@ impl StyledJSXTransformer<'_> { let tag = match &*tagged_tpl.tag { Expr::Ident(Ident { sym, .. }) => sym.to_string(), Expr::Member(MemberExpr { - prop: MemberProp::Ident(Ident { sym, .. }), + prop: MemberProp::Ident(IdentName { sym, .. }), .. }) => sym.to_string(), _ => String::from("not_styled_jsx_tag"), @@ -701,10 +704,9 @@ impl StyledJSXTransformer<'_> { return Ok(Expr::Object(ObjectLit { props: vec![ PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident { + key: PropName::Ident(IdentName { sym: "styles".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), value: Box::new(Expr::JSXElement(Box::new(make_local_styled_jsx_el( style, @@ -714,10 +716,9 @@ impl StyledJSXTransformer<'_> { )))), }))), PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp { - key: PropName::Ident(Ident { + key: PropName::Ident(IdentName { sym: "className".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() }), value: Box::new(class_name.unwrap()), }))), @@ -728,15 +729,13 @@ impl StyledJSXTransformer<'_> { Ok(Expr::New(NewExpr { callee: Box::new(Expr::Ident(Ident { sym: "String".into(), - span: DUMMY_SP, - optional: false, + ..Default::default() })), args: Some(vec![ExprOrSpread { expr: Box::new(css), spread: None, }]), - span: DUMMY_SP, - type_args: None, + ..Default::default() })) } @@ -768,7 +767,7 @@ fn is_styled_jsx(el: &JSXElement) -> bool { el.opening.attrs.iter().any(|attr| { if let JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { sym, .. }), + name: JSXAttrName::Ident(IdentName { sym, .. }), .. }) = &attr { @@ -789,7 +788,7 @@ fn is_global(el: &JSXElement) -> bool { el.opening.attrs.iter().any(|attr| { if let JSXAttrOrSpread::JSXAttr(JSXAttr { - name: JSXAttrName::Ident(Ident { sym, .. }), + name: JSXAttrName::Ident(IdentName { sym, .. }), .. }) = &attr { @@ -872,7 +871,7 @@ fn get_existing_class_name(el: &JSXOpeningElement) -> (Option, Option { @@ -897,7 +896,7 @@ fn get_existing_class_name(el: &JSXOpeningElement) -> (Option, Option Stmt { left: MemberExpr { obj: Box::new(Expr::Ident(Ident { sym: id.0, - span: DUMMY_SP.with_ctxt(id.1), - optional: false, + ctxt: id.1, + ..Default::default() })), - prop: MemberProp::Ident(Ident { + prop: MemberProp::Ident(IdentName { sym: "__hash".into(), span: DUMMY_SP, - optional: false, }), span: DUMMY_SP, } 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-lightningcss.stderr index c6fa377bc..0f74c1e2c 100644 --- a/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.stderr +++ b/packages/styled-jsx/transform/tests/errors/nested-style-tags/output-lightningcss.stderr @@ -1,25 +1,22 @@ - x Detected nested styled-jsx tag. | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:14:1] + ,-[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:22:1] + ,-[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:27:1] + ,-[input.js:28:1] 27 | <> 28 | : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 index c6fa377bc..0f74c1e2c 100644 --- 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 @@ -1,25 +1,22 @@ - x Detected nested styled-jsx tag. | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:14:1] + ,-[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:22:1] + ,-[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:27:1] + ,-[input.js:28:1] 27 | <> 28 | : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr index bc9b26f12..8536708b9 100644 --- a/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr +++ b/packages/styled-jsx/transform/tests/errors/no-child/output-lightningcss.stderr @@ -1,7 +1,6 @@ - x Expected one child under JSX style tag, but got 0. | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:2:1] + ,-[input.js:3:1] 2 |
3 | : ^^^^^^^^^^^^^^^^^^^ 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 index bc9b26f12..8536708b9 100644 --- a/packages/styled-jsx/transform/tests/errors/no-child/output-swc.stderr +++ b/packages/styled-jsx/transform/tests/errors/no-child/output-swc.stderr @@ -1,7 +1,6 @@ - x Expected one child under JSX style tag, but got 0. | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:2:1] + ,-[input.js:3:1] 2 |
3 | : ^^^^^^^^^^^^^^^^^^^ 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-lightningcss.stderr index ad7185a0b..5f86a57a7 100644 --- 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-lightningcss.stderr @@ -1,2 +1 @@ - 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-swc.stderr b/packages/styled-jsx/transform/tests/errors/ts-with-css-resolve/output-swc.stderr index ad7185a0b..5f86a57a7 100644 --- 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 @@ -1,2 +1 @@ - 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/two-children/output-lightningcss.stderr b/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.stderr index 0a36017dc..e458fbb6f 100644 --- a/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.stderr +++ b/packages/styled-jsx/transform/tests/errors/two-children/output-lightningcss.stderr @@ -1,7 +1,6 @@ - x Expected one child under JSX style tag, but got 2. | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:2:1] + ,-[input.js:3:1] 2 |
3 | ,-> : ^^^^^^^^^^^^^^^^^^^^^ 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 index 5e556b0f8..9223357cb 100644 --- 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 @@ -1,7 +1,6 @@ - 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:2:1] + ,-[input.js:3:1] 2 |
3 | : ^^^^^^^^^^^^^^^^^^^^^ 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-lightningcss.stderr index eb28a30a7..903b10df9 100644 --- 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-lightningcss.stderr @@ -1,7 +1,6 @@ - x Expected a template literal, string or identifier inside the JSXExpressionContainer. | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:2:1] + ,-[input.js:3:1] 2 |
3 | : ^^^^^^^^^^^^^^^^^^^^^^^ 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 index eb28a30a7..903b10df9 100644 --- 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 @@ -1,7 +1,6 @@ - x Expected a template literal, string or identifier inside the JSXExpressionContainer. | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children - ,-[input.js:2:1] + ,-[input.js:3:1] 2 |
3 | : ^^^^^^^^^^^^^^^^^^^^^^^ 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.lightningcss.js index 2333b3720..6f4e3cea1 100644 --- a/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/attribute-generation-modes/output.lightningcss.js @@ -16,7 +16,7 @@ export const Test2 = ()=>

external and dynamic

- <_JSXStyle id={"7148bb7ee4fbe10d"} dynamic={[ + <_JSXStyle id={"d2da13039fc0361"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} <_JSXStyle id={styles.__hash}>{styles} @@ -38,7 +38,7 @@ export const Test3 = ({ color })=>

external, static and dynamic

<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"} - <_JSXStyle id={"33057711e8314060"} dynamic={[ + <_JSXStyle id={"6dde3bd8f10491b0"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} <_JSXStyle id={styles.__hash}>{styles} @@ -67,7 +67,7 @@ export const Test5 = ()=>
// static and dynamic export const Test6 = ({ color })=>

static and dynamic

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

dynamic only

- <_JSXStyle id={"7148bb7ee4fbe10d"} dynamic={[ + <_JSXStyle id={"a759cffae3a9783c"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}
; @@ -115,7 +115,7 @@ export const Test8 = ({ color })=>{ }; return
{ ])}>

dynamic with scoped compound variable

- <_JSXStyle id={"6441d4f07e362f1"} dynamic={[ + <_JSXStyle id={"94b3e0247b9a36c"} dynamic={[ innerProps.color ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}
; @@ -142,7 +142,7 @@ export const Test9 = ({ color })=>{ }; return
{ ])}>

dynamic with compound variable

- <_JSXStyle id={"71fd8d88f94be286"} dynamic={[ + <_JSXStyle id={"7f3d84a1e2a80ddf"} 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={"26bcb03111c69ebc"}>{`p.jsx-26bcb03111c69ebc{color:${foo}}`} +export const Test10 = ()=>
+

dynamic with constant variable

+ <_JSXStyle id={"8b3000ec45e05233"}>{`p.jsx-8b3000ec45e05233{color:${foo}}`}
; // dynamic with complex scope export const Test11 = ({ color })=>{ @@ -173,13 +173,13 @@ export const Test11 = ({ color })=>{ length: 5 }).map((item, i)=>
  • - <_JSXStyle id={"377d4c5029ec8f2d"} dynamic={[ + <_JSXStyle id={"657d9cf312a27b74"} dynamic={[ color ]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`} Item #{i + 1} 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 index 2333b3720..6f4e3cea1 100644 --- 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 @@ -16,7 +16,7 @@ export const Test2 = ()=>

    external and dynamic

    - <_JSXStyle id={"7148bb7ee4fbe10d"} dynamic={[ + <_JSXStyle id={"d2da13039fc0361"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} <_JSXStyle id={styles.__hash}>{styles} @@ -38,7 +38,7 @@ export const Test3 = ({ color })=>

    external, static and dynamic

    <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"} - <_JSXStyle id={"33057711e8314060"} dynamic={[ + <_JSXStyle id={"6dde3bd8f10491b0"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`} <_JSXStyle id={styles.__hash}>{styles} @@ -67,7 +67,7 @@ export const Test5 = ()=>
    // static and dynamic export const Test6 = ({ color })=>

    static and dynamic

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

    dynamic only

    - <_JSXStyle id={"7148bb7ee4fbe10d"} dynamic={[ + <_JSXStyle id={"a759cffae3a9783c"} dynamic={[ color ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}
    ; @@ -115,7 +115,7 @@ export const Test8 = ({ color })=>{ }; return
    { ])}>

    dynamic with scoped compound variable

    - <_JSXStyle id={"6441d4f07e362f1"} dynamic={[ + <_JSXStyle id={"94b3e0247b9a36c"} dynamic={[ innerProps.color ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}
    ; @@ -142,7 +142,7 @@ export const Test9 = ({ color })=>{ }; return
    { ])}>

    dynamic with compound variable

    - <_JSXStyle id={"71fd8d88f94be286"} dynamic={[ + <_JSXStyle id={"7f3d84a1e2a80ddf"} 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={"26bcb03111c69ebc"}>{`p.jsx-26bcb03111c69ebc{color:${foo}}`} +export const Test10 = ()=>
    +

    dynamic with constant variable

    + <_JSXStyle id={"8b3000ec45e05233"}>{`p.jsx-8b3000ec45e05233{color:${foo}}`}
    ; // dynamic with complex scope export const Test11 = ({ color })=>{ @@ -173,13 +173,13 @@ export const Test11 = ({ color })=>{ length: 5 }).map((item, i)=>
  • - <_JSXStyle id={"377d4c5029ec8f2d"} dynamic={[ + <_JSXStyle id={"657d9cf312a27b74"} dynamic={[ color ]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`} Item #{i + 1} 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.lightningcss.js index 93f484d6d..e53d17ec1 100644 --- a/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/different-jsx-ids/output.lightningcss.js @@ -1,13 +1,13 @@ import _JSXStyle from "styled-jsx/style"; const color = "red"; const otherColor = "green"; -const A = ()=>
    -

    test

    - <_JSXStyle id={"7148bb7ee4fbe10d"}>{`p.jsx-7148bb7ee4fbe10d{color:${color}}`} +const A = ()=>
    +

    test

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

    test

    - <_JSXStyle id={"702a462674d88be"}>{`p.jsx-702a462674d88be{color:${otherColor}}`} +const B = ()=>
    +

    test

    + <_JSXStyle id={"ddf7b1ec0b39ee5b"}>{`p.jsx-ddf7b1ec0b39ee5b{color:${otherColor}}`}
    ; export default (()=>
    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 index 93f484d6d..e53d17ec1 100644 --- 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 @@ -1,13 +1,13 @@ import _JSXStyle from "styled-jsx/style"; const color = "red"; const otherColor = "green"; -const A = ()=>
    -

    test

    - <_JSXStyle id={"7148bb7ee4fbe10d"}>{`p.jsx-7148bb7ee4fbe10d{color:${color}}`} +const A = ()=>
    +

    test

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

    test

    - <_JSXStyle id={"702a462674d88be"}>{`p.jsx-702a462674d88be{color:${otherColor}}`} +const B = ()=>
    +

    test

    + <_JSXStyle id={"ddf7b1ec0b39ee5b"}>{`p.jsx-ddf7b1ec0b39ee5b{color:${otherColor}}`}
    ; export default (()=>
    diff --git a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js index 4856df90f..746b4c5c8 100644 --- a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/issue-30480/output.lightningcss.js @@ -1,13 +1,13 @@ import _JSXStyle from "styled-jsx/style"; export default (({ breakPoint })=>
    - <_JSXStyle id={"a071f38f8da1d469"} dynamic={[ + <_JSXStyle id={"e5fa52a87d22cbeb"} dynamic={[ breakPoint ]}>{`@media (${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}`}
    ); 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 index 4856df90f..746b4c5c8 100644 --- a/packages/styled-jsx/transform/tests/fixture/issue-30480/output.swc.js +++ b/packages/styled-jsx/transform/tests/fixture/issue-30480/output.swc.js @@ -1,13 +1,13 @@ import _JSXStyle from "styled-jsx/style"; export default (({ breakPoint })=>
    - <_JSXStyle id={"a071f38f8da1d469"} dynamic={[ + <_JSXStyle id={"e5fa52a87d22cbeb"} dynamic={[ breakPoint ]}>{`@media (${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}`}
    ); 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.lightningcss.js index 44b933c0e..137f90243 100644 --- 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.lightningcss.js @@ -3,7 +3,7 @@ export default class { render() { return

    test

    - <_JSXStyle id={"469be1774c8967f0"} dynamic={[ + <_JSXStyle id={"20b71d72b438ca89"} dynamic={[ Typography.base.size.default, Typography.base.lineHeight, Target.mediumPlus, 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 index 44b933c0e..137f90243 100644 --- 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 @@ -3,7 +3,7 @@ export default class { render() { return

    test

    - <_JSXStyle id={"469be1774c8967f0"} dynamic={[ + <_JSXStyle id={"20b71d72b438ca89"} dynamic={[ Typography.base.size.default, Typography.base.lineHeight, Target.mediumPlus, diff --git a/packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js index f86626e4b..d46015c43 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/next-55679/output.lightningcss.js @@ -3,7 +3,7 @@ import { AppProps } from "next/app"; const someVar = "--var-1"; export default function App({ Component, pageProps }) { return <> - <_JSXStyle id={"f559f0d916e6258b"}>{`:root{${someVar}:red;background-color:var(${someVar})}`} - + <_JSXStyle id={"375c0739fd480132"}>{`:root{${someVar}:red;background-color:var(${someVar})}`} + ; } 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 index f86626e4b..d46015c43 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-55679/output.swc.js +++ b/packages/styled-jsx/transform/tests/fixture/next-55679/output.swc.js @@ -3,7 +3,7 @@ import { AppProps } from "next/app"; const someVar = "--var-1"; export default function App({ Component, pageProps }) { return <> - <_JSXStyle id={"f559f0d916e6258b"}>{`:root{${someVar}:red;background-color:var(${someVar})}`} - + <_JSXStyle id={"375c0739fd480132"}>{`: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.lightningcss.js index 67c03f1b5..ddaa7dda7 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-61788/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/next-61788/output.lightningcss.js @@ -3,7 +3,7 @@ const MOBILE_MAX = 767; export default function Home() { return

    Hello

    - <_JSXStyle id={"e9062ed9ed84de84"} dynamic={[ + <_JSXStyle id={"f9c7b7e360105f70"} dynamic={[ MOBILE_MAX ]}>{`.header.__jsx-style-dynamic-selector{font-size:48px}`}
    ; 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 index 67c03f1b5..ddaa7dda7 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-61788/output.swc.js +++ b/packages/styled-jsx/transform/tests/fixture/next-61788/output.swc.js @@ -3,7 +3,7 @@ const MOBILE_MAX = 767; export default function Home() { return

    Hello

    - <_JSXStyle id={"e9062ed9ed84de84"} dynamic={[ + <_JSXStyle id={"f9c7b7e360105f70"} dynamic={[ MOBILE_MAX ]}>{`.header.__jsx-style-dynamic-selector{font-size:48px}`}
    ; diff --git a/packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js b/packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js index b654d1678..558ba666a 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js +++ b/packages/styled-jsx/transform/tests/fixture/next-64389/output.lightningcss.js @@ -2,9 +2,9 @@ import _JSXStyle from "styled-jsx/style"; const color = "color: red;"; export default function RootLayout({ children }) { - return - - {children} - <_JSXStyle id={"b0ba821eb5d16c3b"}>{`body{${color}}body p{font-size:72px}`} + return + + {children} + <_JSXStyle id={"84b13d47b42d4e1a"}>{`body{${color}}body p{font-size:72px}`} ; } 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 index b654d1678..558ba666a 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-64389/output.swc.js +++ b/packages/styled-jsx/transform/tests/fixture/next-64389/output.swc.js @@ -2,9 +2,9 @@ import _JSXStyle from "styled-jsx/style"; const color = "color: red;"; export default function RootLayout({ children }) { - return - - {children} - <_JSXStyle id={"b0ba821eb5d16c3b"}>{`body{${color}}body p{font-size:72px}`} + return + + {children} + <_JSXStyle id={"84b13d47b42d4e1a"}>{`body{${color}}body p{font-size:72px}`} ; } diff --git a/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr b/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr index 0a05a19f2..2dfe189ea 100644 --- a/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr +++ b/packages/styled-jsx/transform/tests/fixture/next-65066/output.lightningcss.stderr @@ -1,7 +1,6 @@ - x Detected nested styled-jsx tag. | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags - ,-[input.js:21:1] + ,-[input.js:22:1] 21 | 22 | ,->