feat(next-swc): Update swc (#34878)

* Update swc

* lockfile

* Update more swc crates

* Update minifier

* chore: update types

* style: fix

* Update deps

Co-authored-by: evilebottnawi <sheo13666q@gmail.com>
This commit is contained in:
Donny/강동윤 2022-03-02 02:41:31 +09:00 committed by GitHub
parent 721dc7bccd
commit 6814852ffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 317 additions and 193 deletions

View file

@ -145,6 +145,15 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "better_scoped_tls"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123"
dependencies = [
"scoped-tls",
]
[[package]]
name = "bitflags"
version = "1.3.2"
@ -162,9 +171,9 @@ dependencies = [
[[package]]
name = "browserslist-rs"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38854056e7d44ad7af1214b7de30ceb71fff036ed67f3d1b48cc1200bb722cba"
checksum = "67bf6eb040d26861376afa30a5b172f066bfda9cef992af7a55ac5395ef91437"
dependencies = [
"ahash",
"anyhow",
@ -660,9 +669,9 @@ checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119"
[[package]]
name = "lock_api"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
dependencies = [
"scopeguard",
]
@ -812,7 +821,7 @@ dependencies = [
"swc_css",
"swc_ecma_loader",
"swc_ecma_transforms_testing",
"swc_ecmascript 0.114.2",
"swc_ecmascript",
"swc_node_base",
"swc_stylis",
"testing",
@ -839,7 +848,7 @@ dependencies = [
"swc_bundler",
"swc_common",
"swc_ecma_loader",
"swc_ecmascript 0.114.2",
"swc_ecmascript",
"swc_node_base",
]
@ -943,15 +952,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "owning_ref"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce"
dependencies = [
"stable_deref_trait",
]
[[package]]
name = "parking_lot"
version = "0.11.1"
@ -960,7 +960,17 @@ checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
dependencies = [
"instant",
"lock_api",
"parking_lot_core",
"parking_lot_core 0.8.0",
]
[[package]]
name = "parking_lot"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
dependencies = [
"lock_api",
"parking_lot_core 0.9.1",
]
[[package]]
@ -978,6 +988,19 @@ dependencies = [
"winapi",
]
[[package]]
name = "parking_lot_core"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
dependencies = [
"cfg-if 1.0.0",
"libc",
"redox_syscall 0.2.10",
"smallvec",
"windows-sys",
]
[[package]]
name = "path-clean"
version = "0.1.0"
@ -1013,7 +1036,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
dependencies = [
"phf_macros",
"phf_shared",
"phf_shared 0.8.0",
"proc-macro-hack",
]
@ -1023,7 +1046,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526"
dependencies = [
"phf_shared",
"phf_shared 0.8.0",
"rand 0.7.3",
]
@ -1034,7 +1057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c"
dependencies = [
"phf_generator",
"phf_shared",
"phf_shared 0.8.0",
"proc-macro-hack",
"proc-macro2",
"quote",
@ -1050,6 +1073,15 @@ dependencies = [
"siphasher",
]
[[package]]
name = "phf_shared"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
]
[[package]]
name = "pin-project-lite"
version = "0.2.7"
@ -1079,6 +1111,23 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "preset_env_base"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e072088b8b97a4ed729b40444fbb5cc6a7c1bc9b9c455a601d4de7f981a4987"
dependencies = [
"ahash",
"anyhow",
"browserslist-rs",
"dashmap",
"from_variant",
"once_cell",
"semver 1.0.4",
"serde",
"st-map",
]
[[package]]
name = "pretty_assertions"
version = "0.7.2"
@ -1508,12 +1557,6 @@ dependencies = [
"static-map-macro",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "static-map-macro"
version = "0.2.1"
@ -1534,14 +1577,14 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "string_cache"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6"
checksum = "33994d0838dc2d152d17a62adf608a869b5e846b65b389af7f3dbc1de45c5b26"
dependencies = [
"lazy_static",
"new_debug_unreachable",
"parking_lot",
"phf_shared",
"parking_lot 0.11.1",
"phf_shared 0.10.0",
"precomputed-hash",
"serde",
]
@ -1553,7 +1596,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97"
dependencies = [
"phf_generator",
"phf_shared",
"phf_shared 0.8.0",
"proc-macro2",
"quote",
]
@ -1579,9 +1622,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
[[package]]
name = "styled_components"
version = "0.14.0"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4ab2ebb6f1bb84fb7b8b2fc16ebed9bbb7933a8f2f5d443c080f096a45b94d"
checksum = "5e824357a52655bd0977b40a11072669ed9e9c16eff78d6eaf54cc7d822d2585"
dependencies = [
"Inflector",
"once_cell",
@ -1589,15 +1632,15 @@ dependencies = [
"serde",
"swc_atoms",
"swc_common",
"swc_ecmascript 0.112.6",
"swc_ecmascript",
"tracing",
]
[[package]]
name = "swc"
version = "0.126.2"
version = "0.138.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c2373a6f6dddd42719a2d8fcd9989849915ae15691fd1a75f6b04d14a6cab91"
checksum = "170a6c528c1b2052c7bdc388b12b6dd82bc51535c10f25298a46577e7183965b"
dependencies = [
"ahash",
"anyhow",
@ -1628,7 +1671,7 @@ dependencies = [
"swc_ecma_transforms_optimization",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecmascript 0.114.2",
"swc_ecmascript",
"swc_node_comments",
"swc_visit",
"tracing",
@ -1646,9 +1689,9 @@ dependencies = [
[[package]]
name = "swc_bundler"
version = "0.107.0"
version = "0.114.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5b6761f9b57072658a42ff25304a7edc7f8444024726ed27d5861e4644c1ffe"
checksum = "7072dba1e14f946f10cb5127f4e8afb8875f5c8a6a29ab6029ffb884342d3684"
dependencies = [
"ahash",
"anyhow",
@ -1657,7 +1700,7 @@ dependencies = [
"indexmap",
"is-macro",
"once_cell",
"parking_lot",
"parking_lot 0.12.0",
"petgraph",
"radix_fmt",
"rayon",
@ -1680,23 +1723,22 @@ dependencies = [
[[package]]
name = "swc_common"
version = "0.17.3"
version = "0.17.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80c35c61c23c33ef41fc779abc3fbd87fd83ee41eb6ced7ba4dd38a87e394986"
checksum = "ffd694004c48af55237f1e471ccefdb76f88da8d8ac4726612ea11c525d02425"
dependencies = [
"ahash",
"ast_node",
"atty",
"better_scoped_tls",
"cfg-if 0.1.10",
"debug_unreachable",
"either",
"from_variant",
"num-bigint",
"once_cell",
"owning_ref",
"parking_lot",
"parking_lot 0.12.0",
"rustc-hash",
"scoped-tls",
"serde",
"siphasher",
"sourcemap",
@ -1711,9 +1753,9 @@ dependencies = [
[[package]]
name = "swc_css"
version = "0.87.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4b570606b904949dcb186af2f32ee57a7731002d3cb72e21183edef0c1f2dc"
checksum = "55d52d595da541b1626e3c9f89441607042cda81d2047dbdc7bec44449b73925"
dependencies = [
"swc_css_ast",
"swc_css_codegen",
@ -1724,9 +1766,9 @@ dependencies = [
[[package]]
name = "swc_css_ast"
version = "0.79.0"
version = "0.86.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00c07118ba87a4139be7d78bff15ba33438195f2eb35376157a5ca2e60cc54c4"
checksum = "2c933063972e7d8d810e893935b10f66b3be1eb9f33685ecb2416cf80e337759"
dependencies = [
"is-macro",
"serde",
@ -1737,9 +1779,9 @@ dependencies = [
[[package]]
name = "swc_css_codegen"
version = "0.84.0"
version = "0.91.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d192566df252168bc1d0a206f0e783e30816a2c75c43ddd04b7ddd703b9d396"
checksum = "59995589f6579069f2aadb1b73b38d53c9d2798e4c6379dc3e8245954ad5cb9e"
dependencies = [
"auto_impl",
"bitflags",
@ -1764,9 +1806,9 @@ dependencies = [
[[package]]
name = "swc_css_parser"
version = "0.85.2"
version = "0.92.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2550222e793736aa09d9361b43a04ca8b9467588bb73cf02ba827484c1243a4"
checksum = "a918661b5fe9192f2608ee6b7aca44c80026b1e08c6058dd9fb6df0eb587a69b"
dependencies = [
"bitflags",
"lexical",
@ -1777,9 +1819,9 @@ dependencies = [
[[package]]
name = "swc_css_utils"
version = "0.76.0"
version = "0.83.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ddab011e673ffd3b3d6dea612d113714caaeab1ec1673adb70b62f5a5727bbe"
checksum = "8b33f951f0bb3f5c4310030cf5ad03ada3fff541010dada65436d00be86e07c1"
dependencies = [
"swc_atoms",
"swc_common",
@ -1789,9 +1831,9 @@ dependencies = [
[[package]]
name = "swc_css_visit"
version = "0.78.0"
version = "0.85.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9489996952eb66ba087c15258c41e34f4a5466e87db90df4e54557f4f47751c"
checksum = "1be861b1f6ceab4f68a3e770910605b2ff0c7aafae7f078bdaa503c8302e6ce3"
dependencies = [
"swc_atoms",
"swc_common",
@ -1801,9 +1843,9 @@ dependencies = [
[[package]]
name = "swc_ecma_ast"
version = "0.65.3"
version = "0.68.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff1aefdc512c8dfefa1de793c0e62a192bd74a7fa7e5affe3f08885751c127ee"
checksum = "d465460177dcdf076f7c32b75cc0adede3c70506b4c7a859440001310e78e71f"
dependencies = [
"is-macro",
"num-bigint",
@ -1816,9 +1858,9 @@ dependencies = [
[[package]]
name = "swc_ecma_codegen"
version = "0.90.0"
version = "0.93.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cf4da57030370c49c343e536d3c7ab66dca3bd8da000b6040884fc6ac689241"
checksum = "aa81be3ef5a662291f5b387681d497b8c73fabb846459fb3a84097cfe7e127c3"
dependencies = [
"bitflags",
"memchr",
@ -1829,7 +1871,6 @@ dependencies = [
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen_macros",
"swc_ecma_parser",
"tracing",
]
@ -1848,9 +1889,9 @@ dependencies = [
[[package]]
name = "swc_ecma_ext_transforms"
version = "0.51.0"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93651c5d1e3783914a789f6f7c26bdf72fa4ff08ac802d64ba304c2e40f5671"
checksum = "0ed2bbd721290b19b26ece0e7f536dce4375c3cd5f5722b838ec1c985b432916"
dependencies = [
"phf",
"swc_atoms",
@ -1862,14 +1903,14 @@ dependencies = [
[[package]]
name = "swc_ecma_lints"
version = "0.14.8"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dc7e7d669e28b2df325d9a232f1d74e7b77d2606c04f0f70cc37e38dcf49ad3"
checksum = "d097f0e4f44ea808b6533ddc2983573030e4e267a503e78f7ab64290ff8a52ab"
dependencies = [
"ahash",
"auto_impl",
"dashmap",
"parking_lot",
"parking_lot 0.12.0",
"rayon",
"regex",
"serde",
@ -1902,9 +1943,9 @@ dependencies = [
[[package]]
name = "swc_ecma_minifier"
version = "0.74.1"
version = "0.81.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "184e0e6337f2a4cfff36e3456e7937846dadf0b47833b7f711654e4acd0a13aa"
checksum = "c7f6648dc44b95432c4253f03bce4c1a5c73a7a8adefe9be11c78c048d925dc0"
dependencies = [
"ahash",
"indexmap",
@ -1931,9 +1972,9 @@ dependencies = [
[[package]]
name = "swc_ecma_parser"
version = "0.88.3"
version = "0.91.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfd30c93f08afdf29226b5695e45aadcc6ce452470cc63ea87a7eb53d29bb02b"
checksum = "58b099ab64a9e667ffcacbbf043710eabccd910f5664a82c997b4a1ff8bc9ed6"
dependencies = [
"either",
"enum_kind",
@ -1951,16 +1992,16 @@ dependencies = [
[[package]]
name = "swc_ecma_preset_env"
version = "0.90.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5335f575d5cd4fcefe8bb3c52fa8dc8d59d461f07da43fb2ac6c31689aa88e0f"
checksum = "16954dd8ff0ad4ef4046a8aee5a31122413242d520efef38bea3c13f350e9a54"
dependencies = [
"ahash",
"anyhow",
"browserslist-rs",
"dashmap",
"indexmap",
"once_cell",
"preset_env_base",
"semver 1.0.4",
"serde",
"serde_json",
@ -1972,19 +2013,17 @@ dependencies = [
"swc_ecma_transforms",
"swc_ecma_utils",
"swc_ecma_visit",
"walkdir",
]
[[package]]
name = "swc_ecma_transforms"
version = "0.117.0"
version = "0.124.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1fa132c1a736c2c61736958f1102249348a4cc911c7f60e3a6255aa49c1c03e"
checksum = "e56c345bb62ac1494ef2d97eabe08ec0d0fc2ec46e029bdb4cb714c34fd15cc8"
dependencies = [
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_compat",
"swc_ecma_transforms_module",
@ -1999,14 +2038,14 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_base"
version = "0.58.2"
version = "0.63.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e79e4c87b02ff0e227963000e90dff59e4ad75bf0c66bf886ba8dba7ec36f5b0"
checksum = "49cfcab3966f8dc8c82604a50ccf54541dcc4101bff72ff70bbd6e73a37a1af7"
dependencies = [
"better_scoped_tls",
"once_cell",
"phf",
"rayon",
"scoped-tls",
"serde",
"smallvec",
"swc_atoms",
@ -2020,9 +2059,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_classes"
version = "0.46.0"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8983235c6902879b65dcb1003d4084adf094408c96d94d62d3f33f44c3fa8e"
checksum = "d15131c3944964e290102ddc180251f01b1264e8873f5565fb3f3c097962f800"
dependencies = [
"swc_atoms",
"swc_common",
@ -2034,9 +2073,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_compat"
version = "0.70.0"
version = "0.75.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ff9a64fc99b205b6104a6996832b0006fc059f5aa9fe61d5fb2c3b9f1885b14"
checksum = "4b1939156171fe03940e5918efb8b3058d6ef06bae23990d361233951b8f8db3"
dependencies = [
"ahash",
"arrayvec 0.7.2",
@ -2054,6 +2093,7 @@ dependencies = [
"swc_ecma_transforms_macros",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_trace_macro",
"tracing",
]
@ -2072,9 +2112,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_module"
version = "0.78.0"
version = "0.84.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "441616e68981062a1650a923d2c63075021a8178045e2112007a90a157cdb1da"
checksum = "da2c5960939be80ad54842bdb42b205d3cf17fd3c2955c693a6fd7f678e70ef3"
dependencies = [
"Inflector",
"ahash",
@ -2094,9 +2134,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_optimization"
version = "0.87.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e074149dd5e969d35a790851b47b0f76700b14fcfda1c05e15751c1458e2dd38"
checksum = "4103b2ba1f24dd7ff735d2fa33d86be5eefad4316d046e09509c11dba4f9bb5f"
dependencies = [
"ahash",
"dashmap",
@ -2117,9 +2157,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_proposal"
version = "0.77.0"
version = "0.82.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "048ac8ea82e02fa9a54b9aa448dc5d15a8e994304364fcd8c4e2f650572c9141"
checksum = "41bca77e95bdebfd9df234e707416bd57015808371010f5f1527314df86fc1e7"
dependencies = [
"either",
"serde",
@ -2127,7 +2167,6 @@ dependencies = [
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_classes",
"swc_ecma_transforms_macros",
@ -2137,9 +2176,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_react"
version = "0.80.0"
version = "0.86.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fb5b7c98597bf41d1503ca4039be5445fd02e7aa381ae520d1c78a8a370f7f5"
checksum = "fb79114c706cad8b83bee288cdfd55156558c74075059bc58558ab84275c3ba1"
dependencies = [
"ahash",
"base64 0.13.0",
@ -2162,9 +2201,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_testing"
version = "0.60.0"
version = "0.65.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c24615dee8b5b818dab31d4e172d3a297cc07b99ee65194133035c83f4fb8da6"
checksum = "6d3bf6537f7fac515dd1bb9f718b3af2c2413aad315704bdbb8b8ebd11b8a0a2"
dependencies = [
"ansi_term",
"anyhow",
@ -2185,15 +2224,14 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_typescript"
version = "0.82.0"
version = "0.89.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7859a18a33f751d488fbc1b7a0073fb08c69d794ad1f8daa2da47bfda2d9242"
checksum = "5e5d6a8cd797383193a8138615a3f78de5da910fdd9b3f3543f02bcced603008"
dependencies = [
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_react",
"swc_ecma_utils",
@ -2202,9 +2240,9 @@ dependencies = [
[[package]]
name = "swc_ecma_utils"
version = "0.65.3"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b462ac7dd5340544e7a12965bb7fbbbf9db8b26c1b32159b43c4b2430fed3fc8"
checksum = "3b289ad92ab2c2b5c55c7b2a8e3395b68b42a8145186549191786af5d44998d3"
dependencies = [
"indexmap",
"once_cell",
@ -2218,9 +2256,9 @@ dependencies = [
[[package]]
name = "swc_ecma_visit"
version = "0.51.1"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32aa4c53401d1390aa45043e0a69d52e1a04ef45845e19b55c484462e6dcd048"
checksum = "768c7cb86162cb2538a188586909b5499740da73b2eb80b258210cf147652c84"
dependencies = [
"num-bigint",
"swc_atoms",
@ -2232,21 +2270,9 @@ dependencies = [
[[package]]
name = "swc_ecmascript"
version = "0.112.6"
version = "0.123.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce38cf2c41ed841d82dbfb1c328379a3ec75d4e4e43900ea8c8ef3c51a44e3cb"
dependencies = [
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_utils",
"swc_ecma_visit",
]
[[package]]
name = "swc_ecmascript"
version = "0.114.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e752c12b209c65e203a952186ab2fcefa8021a17a8a393b7d5f410e1fe1a0e87"
checksum = "643e8b16370a73258bfb162a1b1bf27888b4ed65d05c3962083fed7cae26bf6d"
dependencies = [
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2328,9 +2354,9 @@ dependencies = [
[[package]]
name = "swc_stylis"
version = "0.83.0"
version = "0.90.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07fe7e1fea389c2a95bb8a8a46937d9f10aa573def79ca270e56a43d432822d9"
checksum = "b453e3b964b9aaa96b81ff04c2a38ae64d2b1c55bd0a88b3f9fc478f6a61a1fe"
dependencies = [
"swc_atoms",
"swc_common",
@ -2348,6 +2374,17 @@ dependencies = [
"tracing",
]
[[package]]
name = "swc_trace_macro"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85341fb96c46bd873272553b8b1d4330f886fe5231969cc1564e1c659fee8334"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "swc_visit"
version = "0.3.0"
@ -2408,9 +2445,9 @@ dependencies = [
[[package]]
name = "testing"
version = "0.18.0"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c77495bc9f7737f9a958ec3cf2fba2f0c2296867018c8b4da6ce01d008b93e5e"
checksum = "27fb20163feffc42ee490fc7ef113b187ab09fa4e632e2cec649bce76cd40662"
dependencies = [
"ansi_term",
"difference",
@ -2496,9 +2533,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tracing"
version = "0.1.29"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
checksum = "f6c650a8ef0cd2dd93736f033d21cbd1224c5a967aa0c258d00fcf7dafef9b9f"
dependencies = [
"cfg-if 1.0.0",
"pin-project-lite",
@ -2508,9 +2545,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
version = "0.1.18"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716"
dependencies = [
"proc-macro2",
"quote",
@ -2519,11 +2556,12 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.21"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23"
dependencies = [
"lazy_static",
"valuable",
]
[[package]]
@ -2615,6 +2653,12 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "valuable"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "version_check"
version = "0.9.3"
@ -2658,13 +2702,13 @@ dependencies = [
"console_error_panic_hook",
"next-swc",
"once_cell",
"parking_lot_core",
"parking_lot_core 0.8.0",
"path-clean",
"serde",
"serde_json",
"swc",
"swc_common",
"swc_ecmascript 0.114.2",
"swc_ecmascript",
"tracing",
"wasm-bindgen",
"wasm-bindgen-futures",
@ -2778,3 +2822,46 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6"
dependencies = [
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
[[package]]
name = "windows_i686_gnu"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
[[package]]
name = "windows_i686_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
[[package]]
name = "windows_x86_64_gnu"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
[[package]]
name = "windows_x86_64_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"

View file

@ -15,19 +15,19 @@ fxhash = "0.2.1"
pathdiff = "0.2.0"
serde = "1"
serde_json = "1"
styled_components = "0.14.0"
swc = "0.126.2"
styled_components = "0.17.0"
swc = "0.138.0"
swc_atoms = "0.2.7"
swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_css = "0.87.0"
swc_common = { version = "0.17.9", features = ["concurrent", "sourcemap"] }
swc_css = "0.94.0"
swc_ecma_loader = { version = "0.28.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.114.2", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_ecmascript = { version = "0.123.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_node_base = "0.5.1"
swc_stylis = "0.83.0"
swc_stylis = "0.90.0"
tracing = {version = "0.1.28", features = ["release_max_level_off"]}
regex = "1.5"
[dev-dependencies]
swc_ecma_transforms_testing = "0.60.0"
testing = "0.18.0"
swc_ecma_transforms_testing = "0.65.0"
testing = "0.18.1"
walkdir = "2.3.2"

View file

@ -2,8 +2,8 @@ use easy_error::{bail, Error};
use std::panic;
use std::sync::Arc;
use swc_common::util::take::Take;
use swc_common::SourceMap;
use swc_common::{source_map::Pos, BytePos, Span, SyntaxContext, DUMMY_SP};
use swc_common::{SourceMap, Spanned};
use swc_css::ast::*;
use swc_css::codegen::{
writer::basic::{BasicCssWriter, BasicCssWriterConfig},
@ -183,16 +183,12 @@ impl VisitMut for Namespacer {
combinator = None;
}
ComplexSelectorChildren::Combinator(v) => match v.value {
CombinatorValue::Descendant => {}
_ => {
ComplexSelectorChildren::Combinator(v) => {
combinator = Some(v.clone());
new_selectors.push(sel);
}
},
};
}
node.children = new_selectors;
}
}
@ -204,8 +200,6 @@ impl Namespacer {
mut node: CompoundSelector,
) -> Result<Vec<ComplexSelectorChildren>, Error> {
let mut pseudo_index = None;
let empty_tokens = vec![];
let mut arg_tokens;
for (i, selector) in node.subclass_selectors.iter().enumerate() {
@ -215,8 +209,22 @@ impl Namespacer {
.iter()
.flatten()
.flat_map(|v| match v {
PseudoSelectorChildren::Nth(v) => nth_to_tokens(v).tokens,
PseudoSelectorChildren::PreservedToken(v) => vec![v.clone()],
PseudoClassSelectorChildren::PreservedToken(v) => vec![v.clone()],
PseudoClassSelectorChildren::AnPlusB(an_plus_b) => match an_plus_b {
AnPlusB::Ident(v) => to_tokens(v).tokens,
AnPlusB::AnPlusBNotation(v) => to_tokens(v).tokens,
},
PseudoClassSelectorChildren::Ident(v) => to_tokens(v).tokens,
PseudoClassSelectorChildren::Str(v) => to_tokens(v).tokens,
PseudoClassSelectorChildren::Delimiter(v) => to_tokens(v).tokens,
PseudoClassSelectorChildren::SelectorList(v) => to_tokens(v).tokens,
PseudoClassSelectorChildren::CompoundSelectorList(v) => {
to_tokens(v).tokens
}
PseudoClassSelectorChildren::RelativeSelectorList(v) => {
to_tokens(v).tokens
}
PseudoClassSelectorChildren::CompoundSelector(v) => to_tokens(v).tokens,
})
.collect::<Vec<_>>();
@ -224,10 +232,21 @@ impl Namespacer {
}
SubclassSelector::PseudoElement(PseudoElementSelector {
name, children, ..
}) => match children {
Some(children) => (name, children),
None => (name, &empty_tokens),
},
}) => {
arg_tokens = children
.iter()
.flatten()
.flat_map(|v| match v {
PseudoElementSelectorChildren::PreservedToken(v) => vec![v.clone()],
PseudoElementSelectorChildren::Ident(v) => to_tokens(v).tokens,
PseudoElementSelectorChildren::CompoundSelector(v) => {
to_tokens(v).tokens
}
})
.collect::<Vec<_>>();
(name, &arg_tokens)
}
_ => continue,
};
@ -282,12 +301,16 @@ impl Namespacer {
trace!("Combinator: {:?}", combinator);
trace!("v[0]: {:?}", v[0]);
let mut result = vec![];
if let Some(combinator) = combinator {
match v.get(0) {
Some(ComplexSelectorChildren::Combinator(..)) => {}
Some(..) => {}
// `Descendant` combinator can't be the first because we removed it
// above
Some(ComplexSelectorChildren::Combinator(..))
if combinator.value == CombinatorValue::Descendant => {}
_ => {
v.push(ComplexSelectorChildren::Combinator(combinator));
result.push(ComplexSelectorChildren::Combinator(combinator));
}
}
}
@ -301,7 +324,9 @@ impl Namespacer {
}
});
Ok(v)
result.extend(v);
Ok(result)
}
Err(_) => bail!("Failed to transform one off global selector"),
};
@ -332,7 +357,15 @@ impl Namespacer {
);
}
Ok(vec![ComplexSelectorChildren::CompoundSelector(node)])
let mut result = vec![];
if let Some(combinator) = combinator {
result.push(ComplexSelectorChildren::Combinator(combinator));
}
result.push(ComplexSelectorChildren::CompoundSelector(node));
Ok(result)
}
}
@ -461,17 +494,21 @@ fn get_block_tokens(selector_tokens: &Tokens) -> Vec<TokenAndSpan> {
]
}
fn nth_to_tokens(nth: &Nth) -> Tokens {
fn to_tokens<N: Spanned>(node: &N) -> Tokens
where
for<'aa> CodeGenerator<&'aa mut BasicCssWriter<'aa, &'aa mut std::string::String>>: Emit<N>,
{
let mut s = String::new();
{
let mut wr = BasicCssWriter::new(&mut s, BasicCssWriterConfig { indent: " " });
let mut gen = CodeGenerator::new(&mut wr, CodegenConfig { minify: true });
gen.emit(&nth).unwrap();
gen.emit(node).unwrap();
}
let span = node.span();
let mut lexer = swc_css::parser::lexer::Lexer::new(
StringInput::new(&s, nth.span.lo, nth.span.hi),
StringInput::new(&s, span.lo, span.hi),
ParserConfig {
allow_wrong_line_comments: true,
},
@ -484,7 +521,7 @@ fn nth_to_tokens(nth: &Nth) -> Tokens {
}
Tokens {
span: Span::new(nth.span.lo, nth.span.hi, Default::default()),
span: Span::new(span.lo, span.hi, Default::default()),
tokens,
}
}

View file

@ -1,40 +1,40 @@
function a(a, b) {
(null == b || b > a.length) && (b = a.length);
for(var c = 0, d = new Array(b); c < b; c++)d[c] = a[c];
function b(c, a) {
(null == a || a > c.length) && (a = c.length);
for(var b = 0, d = new Array(a); b < a; b++)d[b] = c[b];
return d;
}
import b from "other";
(function(a, c) {
return (function(a) {
if (Array.isArray(a)) return a;
})(a) || (function(a, c) {
var d, e, f = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"];
if (null != f) {
var g = [], h = !0, i = !1;
import a from "other";
(function(c, b) {
return (function(c) {
if (Array.isArray(c)) return c;
})(c) || (function(c, b) {
var g, h, a = null == c ? null : "undefined" != typeof Symbol && c[Symbol.iterator] || c["@@iterator"];
if (null != a) {
var d = [], e = !0, i = !1;
try {
for(f = f.call(a); !(h = (d = f.next()).done) && (g.push(d.value), !c || g.length !== c); h = !0);
for(a = a.call(c); !(e = (g = a.next()).done) && (d.push(g.value), !b || d.length !== b); e = !0);
} catch (j) {
i = !0, e = j;
i = !0, h = j;
} finally{
try {
h || null == f.return || f.return();
e || null == a.return || a.return();
} finally{
if (i) throw e;
if (i) throw h;
}
}
return g;
return d;
}
})(a, c) || (function(b, c) {
if (b) {
if ("string" == typeof b) return a(b, c);
var d = Object.prototype.toString.call(b).slice(8, -1);
if ("Object" === d && b.constructor && (d = b.constructor.name), "Map" === d || "Set" === d) return Array.from(d);
if ("Arguments" === d || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)) return a(b, c);
})(c, b) || (function(a, d) {
if (a) {
if ("string" == typeof a) return b(a, d);
var c = Object.prototype.toString.call(a).slice(8, -1);
if ("Object" === c && a.constructor && (c = a.constructor.name), "Map" === c || "Set" === c) return Array.from(c);
if ("Arguments" === c || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)) return b(a, d);
}
})(a, c) || (function() {
})(c, b) || (function() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
})();
})(b, 1)[0];
})(a, 1)[0];
var c = function() {
"use strict";
!function(a, b) {

View file

@ -16,12 +16,12 @@ once_cell = "1.8.0"
serde = "1"
serde_json = "1"
next-swc = { version = "0.0.0", path = "../core" }
swc = "0.126.2"
swc = "0.138.0"
swc_atoms = "0.2.7"
swc_bundler = { version = "0.107.0", features = ["concurrent"] }
swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_bundler = { version = "0.114.0", features = ["concurrent"] }
swc_common = { version = "0.17.9", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.28.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.114.2", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_ecmascript = { version = "0.123.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_node_base = "0.5.1"
[build-dependencies]

View file

@ -16,9 +16,9 @@ path-clean = "0.1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
next-swc = { version = "0.0.0", path = "../core" }
swc = "0.126.2"
swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.114.2", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc = "0.138.0"
swc_common = { version = "0.17.9", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.123.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
tracing = {version = "0.1.28", features = ["release_max_level_off"]}
wasm-bindgen = {version = "0.2", features = ["serde-serialize"]}
wasm-bindgen-futures = "0.4.8"