From d73720f736bc0578fbaa300202695f6a6d924234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 23 Aug 2022 14:09:59 +0900 Subject: [PATCH 01/23] Update swc --- packages/next-swc/Cargo.lock | 129 +++++++++--------- packages/next-swc/crates/core/Cargo.toml | 10 +- packages/next-swc/crates/emotion/Cargo.toml | 8 +- .../crates/modularize_imports/Cargo.toml | 4 +- packages/next-swc/crates/napi/Cargo.toml | 10 +- .../crates/styled_components/Cargo.toml | 8 +- .../next-swc/crates/styled_jsx/Cargo.toml | 10 +- packages/next-swc/crates/wasm/Cargo.toml | 8 +- 8 files changed, 93 insertions(+), 94 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index 52433026a0685..e4180abc3064c 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -2018,9 +2018,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "preset_env_base" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f68dc2366d2258e280ad44221403aa0af50868b3e6dc1cb9fb14a302cc01948" +checksum = "ec3fc6fae03023ee1badb75ccbefc36379c419754b30e3848b77a4327f4ec1e2" dependencies = [ "ahash", "anyhow", @@ -2964,9 +2964,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.214.9" +version = "0.218.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66de60ec56727a44e40752aa324bb02a67467d941f60c37be99ad11fbb61446c" +checksum = "60717478d89050e2ebe9f825ea94856e63b71afad0045b5542440f14cf6d1113" dependencies = [ "ahash", "anyhow", @@ -3028,9 +3028,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.177.4" +version = "0.179.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f7d7f3b5b735aee329ed2b7a117d8e4163d4d3410bfe2b19db9b21fa398115" +checksum = "3ea05c46971baa0eb2230f6f90ce1520125776739e01605851453b82df9e0d9e" dependencies = [ "ahash", "anyhow", @@ -3077,9 +3077,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.27.11" +version = "0.27.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056ad401259d209007ecc55d18b2a539091eed3315846e1d923140499af08aed" +checksum = "cba38a2f1291fcf3f78f357802b8cec72ecf5e95808e9d937783e60cd3570b93" dependencies = [ "ahash", "anyhow", @@ -3137,9 +3137,9 @@ dependencies = [ [[package]] name = "swc_css" -version = "0.120.0" +version = "0.121.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3025a9f4c123dfc5976940e9aa986ff06162f5e9b81601fa34dfab9bcc734d" +checksum = "f8fd098803583e25c9b8e1723a980f99ee0bf7a0ad87a0ef5bccc6954c50fb48" dependencies = [ "swc_css_ast", "swc_css_codegen", @@ -3150,9 +3150,9 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "0.107.1" +version = "0.108.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102e00c896dcbbd27f079df342f65ad685a3652ff20c93f8980380956bdc02e4" +checksum = "98716d6d4dc9d63abde21d1af1db6bc40b17dbbd9018fa9e3391a5a37429e870" dependencies = [ "is-macro", "serde", @@ -3163,9 +3163,9 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "0.117.0" +version = "0.118.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea1374bffa56f07d14184d0ed7de1725d71c44c5e10d13347ba58e3b87dad5f" +checksum = "79fabd9af5731c4060211076f0672e7d3bc5bcedc98ccce4ed02e673cc089769" dependencies = [ "auto_impl", "bitflags", @@ -3192,9 +3192,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.116.0" +version = "0.117.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98db1b019681e34f3b5755d1f8e79c1716ceb77eda78219f9ee1cf95c6dfbda7" +checksum = "b6260566c17ce17c5021c73efb70d444ebd12af7525267df50d9b5561ab276c3" dependencies = [ "bitflags", "lexical", @@ -3206,9 +3206,9 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "0.117.0" +version = "0.119.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89e03bf686929c74567627055f73525794de6002143f20540c6a2d7185634d6" +checksum = "ecacdf41e5a712e436e0c6124108f318abc5caf96c4575145ab3bddb6d498fdc" dependencies = [ "once_cell", "preset_env_base", @@ -3223,9 +3223,9 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "0.104.0" +version = "0.105.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4123740701151259c69a4b7ba151efa630ae241111de7564f288059fa3768290" +checksum = "c9edb52559290fb61484a73f1422cd84d4f7c741c17e5c2f2c153a6c7fbf09a1" dependencies = [ "once_cell", "serde", @@ -3238,9 +3238,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "0.106.0" +version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24688aa5b9533715d0f3443ff25b08eb16eddf045dd9a857dc6893fb409f3487" +checksum = "de9b6db7da6d4df5eb7e1cc9636dee8e24468856219e93ecebf066a02330b842" dependencies = [ "serde", "swc_atoms", @@ -3251,9 +3251,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.90.10" +version = "0.90.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4d9cb0825962e9f9baabec6270aeb6e7c21ade1a16d707916186ad5f13126d1" +checksum = "e6b4c117b34ccc510cf6245c2f9b1f24a933beb2ef858bbfba99fb195525ddde" dependencies = [ "bitflags", "bytecheck", @@ -3270,9 +3270,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.121.5" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0bf7259fec5655df5163eafe0fabe4619f1d507b4c19a8b2be8a9ea2c806ff" +checksum = "0acc7d3ea2b74109e0d6803c9653711958aaa01889a226ee12c93f92d5de0fe4" dependencies = [ "memchr", "num-bigint", @@ -3302,9 +3302,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.85.5" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f19eb16fed54a740f92e9cb2d6ee79fc69b4a3b63d4a467c709693a413f6737" +checksum = "f596f280b222941bba5cb3276725138a4c5f91a75fd01332f8a29ad90344eef8" dependencies = [ "phf", "swc_atoms", @@ -3316,9 +3316,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.58.5" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931f3b19bad8a2d0e65eb2bf19771f92d6a0bf73a3b3f47f4a12c5c7259d9b85" +checksum = "53e5d4211f03785a5b8ec046158232d481966dfbac2e5ff546fe94a13f0602c2" dependencies = [ "ahash", "auto_impl", @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.144.7" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244bf8e9472a7fc50466d3ab3a288969f82ab7d2547e445305f745c8c52ba384" +checksum = "42a0989162ca5e886e9c6f07505d33873f8210e44a533db6909f676800f9b630" dependencies = [ "ahash", "arrayvec", @@ -3388,14 +3388,13 @@ dependencies = [ "swc_ecma_visit", "swc_timer", "tracing", - "unicode-id", ] [[package]] name = "swc_ecma_parser" -version = "0.117.5" +version = "0.118.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6f6a817020e88bd7084e516f67f40ef33640c1fe336e66cd0dcdeabdaa16eb" +checksum = "99fe54d8da755f649c81337de073f393eb852d9194a19dfbeebaada772265730" dependencies = [ "either", "enum_kind", @@ -3412,9 +3411,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.158.4" +version = "0.161.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef62b25660684da925c7b53b1a4724bdaf1a8520a419ad736263b101ca4c9e1d" +checksum = "785793720219c467ef461003320cabee596d12d05dfdc5bd3d89ff38bd13c58c" dependencies = [ "ahash", "anyhow", @@ -3437,9 +3436,9 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871addc48b001e559cf74493d465e050b0c6ef244cf7b7112cd756b271d1beac" +checksum = "212d944ab3648cc232351f392dce160b3d9d4c8a61dd3d95116620dc275bf45c" dependencies = [ "anyhow", "hex", @@ -3453,9 +3452,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.183.4" +version = "0.185.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8cbc090b992ae508db16c9ae38024195f5d5b39826f0a74d4091e410fbc045" +checksum = "6e307b4c2100104d10f5840f5cba0c7b2db00742acb88d65652bb86bc4463d5b" dependencies = [ "swc_atoms", "swc_common", @@ -3473,9 +3472,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.103.8" +version = "0.104.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c794bf556b57109e59ee694db25994b27dc5a632de745af40968b4f3e2622862" +checksum = "10d7aeb3338fbc35b2d8f881a6102588b6cd1a6d7d6edf333252ee358c6e9b2c" dependencies = [ "better_scoped_tls", "bitflags", @@ -3496,9 +3495,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.91.5" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37ac07ffe2fd6704763cf6fb1ccf92ab9496ecec0cb28084775fe35d7d21665" +checksum = "f5368a6459a31def42c29a8d0e5ebaafdbe9c731b244a2deb976151d12e37fe4" dependencies = [ "swc_atoms", "swc_common", @@ -3510,9 +3509,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.122.6" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6127cdb1a52d720a1559d1365ea1682de8189612b979be95b12ac17eb0f3c83" +checksum = "8c376bfd35ce0fa4fcd90868b066191e10f6eb2426b12fe9b3d031a465f65a98" dependencies = [ "ahash", "arrayvec", @@ -3550,9 +3549,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.139.4" +version = "0.141.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930bf6a0f0ee0a5fff8da817ae5f1652408714c7198a5f50ef018facdbe9be6f" +checksum = "fe8f03422562c4747c78a55f6ba41625eb1a6167ec8b152df5a28a5bb36ab345" dependencies = [ "Inflector", "ahash", @@ -3578,9 +3577,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.152.4" +version = "0.154.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3cd48bd97dd61b382bca4aa8b316b86364900e293e3e7bc19083e3e40551055" +checksum = "25ad6077e00037f2249df854b60359d6aa85ffbc83ce7e9aea59734016af941a" dependencies = [ "ahash", "dashmap", @@ -3601,9 +3600,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.130.4" +version = "0.132.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5431eff966464e9eb14e31a548fea6a8fb066c0ca13ea3f334c43533ae1f6c7" +checksum = "46f6e9c5772404d7a07a2cda019717cbd294d47215a7a2101332d1d4b64fdc92" dependencies = [ "either", "serde", @@ -3620,9 +3619,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.141.4" +version = "0.143.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25a0fb253cc8f4c91f4f097aafb110baefda11bf3584bea1a034481cb929f22" +checksum = "11cee549bb5166dd212e5e18f49ddd3e5db9698314aa1ffa6deea553f659978e" dependencies = [ "ahash", "base64 0.13.0", @@ -3646,9 +3645,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.105.5" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a3f0a517e598284dff81299e07c0766b81c295a90f34fba60bb0e9b92bd385" +checksum = "539895744adcdbec7f43dcd6018a55f5398edc327f0bd556d79072a382152e50" dependencies = [ "ansi_term", "anyhow", @@ -3670,9 +3669,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.145.4" +version = "0.147.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ece3fe114e22ed4a1711bb1f23d2991b744f89e44c061d84063335421b8f2f2" +checksum = "020383a6e9aa3ab8225f50de42b2528f5d3130a7d92b436a8594d2af05e244aa" dependencies = [ "serde", "swc_atoms", @@ -3686,9 +3685,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.99.5" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30700fb85603ce56423770d77696c1b0c602733a57d3b5cdd93a47ba450b0cd9" +checksum = "671eb0ef731ab6e9357e0a1845f527b02ed319b813b0e274d87b8d942554a353" dependencies = [ "indexmap", "once_cell", @@ -3716,9 +3715,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.189.4" +version = "0.192.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b16deafbca757db8f8e26d0667f93e673a8bf51d99281fd09c83139c9d99818" +checksum = "c1b18f993b6f6e8a5e81230226af043063f28e83eec89cf93d3cb554d2c63bdb" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -3853,9 +3852,9 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "0.71.15" +version = "0.73.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116a790c682e2acfaa674a80320d21fb6d8c22b07b9f0a66160f44d7cc08a44" +checksum = "fabaa68c69344c1fdf7e802e7d059d7f5f08ee9afdbacb3470a4f6e115b7887e" dependencies = [ "anyhow", "once_cell", diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index 8f98805cf49b4..adf664ed901c6 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -26,18 +26,18 @@ swc_emotion = {path="../emotion"} styled_components = {path="../styled_components"} styled_jsx = {path="../styled_jsx"} modularize_imports = {path="../modularize_imports"} -swc = "0.214.9" +swc = "0.218.6" swc_atoms = "0.4.8" -swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] } +swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.71.15", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] } +swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_plugin_runner = { version = "0.73.1", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] } swc_cached = "0.3.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } wasmer = { version = "2.3.0", optional = true, default-features = false } wasmer-wasi = { version = "2.3.0", optional = true, default-features = false } [dev-dependencies] -swc_ecma_transforms_testing = "0.105.5" +swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" walkdir = "2.3.2" diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index 2b38b85d2f878..f3de192d369e8 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -19,13 +19,13 @@ regex = "1.5" serde = "1" sourcemap = "6.0.1" swc_atoms = "0.4.8" -swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.189.4", features = ["codegen", "utils", "visit"] } +swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } +swc_ecmascript = { version = "0.192.0", features = ["codegen", "utils", "visit"] } swc_trace_macro = "0.1.2" tracing = { version = "0.1.32", features = ["release_max_level_info"] } [dev-dependencies] -swc_ecma_transforms_testing = "0.105.5" +swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" serde_json = "1" -swc_ecma_transforms_react = "0.141.4" +swc_ecma_transforms_react = "0.143.0" diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 82f19725e0b72..34312c102441f 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -16,8 +16,8 @@ once_cell = "1.13.0" regex = "1.5" serde = "1" swc_cached = "0.3.5" -swc_ecmascript = { version = "0.189.4", features = ["visit"] } +swc_ecmascript = { version = "0.192.0", features = ["visit"] } [dev-dependencies] -swc_ecma_transforms_testing = "0.105.5" +swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index e05340a4034fe..643aff1e8eab8 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -33,13 +33,13 @@ next-swc = {version = "0.0.0", path = "../core"} once_cell = "1.13.0" serde = "1" serde_json = "1" -swc = "0.214.9" +swc = "0.218.6" swc_atoms = "0.4.8" -swc_bundler = { version = "0.177.4", features = ["concurrent"] } -swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] } +swc_bundler = { version = "0.179.1", features = ["concurrent"] } +swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.71.15", optional = true } +swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_plugin_runner = { version = "0.73.1", optional = true } swc_node_base = "0.5.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } tracing-futures = "0.2.5" diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index ca0943ff27781..884a90044b074 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -16,12 +16,12 @@ once_cell = "1.13.0" regex = {version = "1.5.4", features = ["std", "perf"], default-features = false} serde = {version = "1.0.130", features = ["derive"]} swc_atoms = "0.4.8" -swc_common = { version = "0.27.11", features = ["concurrent"] } -swc_ecmascript = { version = "0.189.4", features = ["utils", "visit"] } +swc_common = { version = "0.27.13", features = ["concurrent"] } +swc_ecmascript = { version = "0.192.0", features = ["utils", "visit"] } tracing = "0.1.32" [dev-dependencies] serde_json = "1" -swc_ecma_transforms_testing = "0.105.5" -swc_ecmascript = { version = "0.189.4", features = ["parser", "transforms"] } +swc_ecma_transforms_testing = "0.106.0" +swc_ecmascript = { version = "0.192.0", features = ["parser", "transforms"] } testing = "0.29.4" diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index 271b2de1eaf6b..b174ee66d89d9 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -11,12 +11,12 @@ version = "0.15.0" [dependencies] easy-error = "1.0.0" -swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] } -swc_css = "0.120.0" -swc_css_prefixer = "0.117.0" -swc_ecmascript = { version = "0.189.4", features = ["parser", "minifier", "utils", "visit"] } +swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } +swc_css = "0.121.0" +swc_css_prefixer = "0.119.1" +swc_ecmascript = { version = "0.192.0", features = ["parser", "minifier", "utils", "visit"] } tracing = "0.1.32" [dev-dependencies] -swc_ecma_transforms_testing = "0.105.5" +swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index 81c7acfcea832..f7de5bb015a18 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -25,10 +25,10 @@ parking_lot_core = "=0.8.0" path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" -swc = "0.214.9" -swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.71.15", default-features = false, optional = true } +swc = "0.218.6" +swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } +swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_plugin_runner = { version = "0.73.1", default-features = false, optional = true } tracing = { version = "0.1.32", features = ["release_max_level_off"] } wasm-bindgen = {version = "0.2", features = ["serde-serialize", "enable-interning"]} wasm-bindgen-futures = "0.4.8" From 9d6b555a73584836f2caca7fb0a7320193148526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 23 Aug 2022 14:10:25 +0900 Subject: [PATCH 02/23] Update test refs --- .../crates/core/tests/full/example/output.js | 46 ++++++++----------- .../tests/fixture/issue-30570/output.js | 2 +- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/packages/next-swc/crates/core/tests/full/example/output.js b/packages/next-swc/crates/core/tests/full/example/output.js index 3f100a93d96b4..4ab20062f2ab8 100644 --- a/packages/next-swc/crates/core/tests/full/example/output.js +++ b/packages/next-swc/crates/core/tests/full/example/output.js @@ -1,47 +1,41 @@ -function n(n, t) { - (null == t || t > n.length) && (t = n.length); - for(var r = 0, e = new Array(t); r < t; r++)e[r] = n[r]; +function r(r, t) { + (null == t || t > r.length) && (t = r.length); + for(var n = 0, e = new Array(t); n < t; n++)e[n] = r[n]; return e; } import t from "other"; -(function(t, r) { - return function(n) { - if (Array.isArray(n)) return n; - }(t) || function(n, t) { - var r, e, o = null == n ? null : "undefined" != typeof Symbol && n[Symbol.iterator] || n["@@iterator"]; - if (null != o) { - var u = [], l = !0, f = !1; +(function(t, n) { + return function(r) { + if (Array.isArray(r)) return r; + }(t) || function(r, t) { + var n, e, l = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != l) { + var u = [], o = !0, f = !1; try { - for(o = o.call(n); !(l = (r = o.next()).done) && (u.push(r.value), !t || u.length !== t); l = !0); + for(l = l.call(r); !(o = (n = l.next()).done) && (u.push(n.value), !t || u.length !== t); o = !0); } catch (i) { f = !0, e = i; } finally{ try { - l || null == o.return || o.return(); + o || null == l.return || l.return(); } finally{ if (f) throw e; } } return u; } - }(t, r) || function t(r, e) { - if (r) { - if ("string" == typeof r) return n(r, e); - var o = Object.prototype.toString.call(r).slice(8, -1); - if ("Object" === o && r.constructor && (o = r.constructor.name), "Map" === o || "Set" === o) return Array.from(o); - if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return n(r, e); + }(t, n) || function t(n, e) { + if (n) { + if ("string" == typeof n) return r(n, e); + var l = Object.prototype.toString.call(n).slice(8, -1); + if ("Object" === l && n.constructor && (l = n.constructor.name), "Map" === l || "Set" === l) return Array.from(l); + if ("Arguments" === l || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)) return r(n, e); } - }(t, r) || function() { + }(t, n) || 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."); }(); })(t, 1)[0]; -var r = function() { - "use strict"; - !function(n, t) { - if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function"); - }(this, r); -}; export var __N_SSG = !0; -export default function e() { +export default function n() { return React.createElement("div", null); }; diff --git a/packages/next-swc/crates/styled_jsx/tests/fixture/issue-30570/output.js b/packages/next-swc/crates/styled_jsx/tests/fixture/issue-30570/output.js index c97fb89238155..97583682d3589 100644 --- a/packages/next-swc/crates/styled_jsx/tests/fixture/issue-30570/output.js +++ b/packages/next-swc/crates/styled_jsx/tests/fixture/issue-30570/output.js @@ -6,7 +6,7 @@ export default function IndexPage() { - <_JSXStyle id={"bbdada4ef17d18ef"}>{"@supports(display:flex){h1{color:hotpink}}"} + <_JSXStyle id={"bbdada4ef17d18ef"}>{"@supports((display:flex)or (display:-webkit-box)or (display:-webkit-flex)or (display:-moz-box)or (display:-ms-flexbox)){h1{color:hotpink}}"} ; }; From aaa597c6c230002d5968c505ae7ccd17c866ae63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 23 Aug 2022 14:10:47 +0900 Subject: [PATCH 03/23] Bump --- packages/next-swc/Cargo.lock | 8 ++++---- packages/next-swc/crates/emotion/Cargo.toml | 2 +- packages/next-swc/crates/modularize_imports/Cargo.toml | 2 +- packages/next-swc/crates/styled_components/Cargo.toml | 2 +- packages/next-swc/crates/styled_jsx/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index e4180abc3064c..f30c4f4dc2348 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -1481,7 +1481,7 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.15.0" +version = "0.16.0" dependencies = [ "convert_case", "handlebars", @@ -2899,7 +2899,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "styled_components" -version = "0.40.0" +version = "0.41.0" dependencies = [ "Inflector", "once_cell", @@ -2916,7 +2916,7 @@ dependencies = [ [[package]] name = "styled_jsx" -version = "0.15.0" +version = "0.16.0" dependencies = [ "easy-error", "swc_common", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "swc_emotion" -version = "0.17.0" +version = "0.18.0" dependencies = [ "base64 0.13.0", "byteorder", diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index f3de192d369e8..f51a97f3d1c08 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -5,7 +5,7 @@ description = "AST Transforms for emotion" license = "Apache-2.0" name = "swc_emotion" repository = "https://github.com/vercel/next.js.git" -version = "0.17.0" +version = "0.18.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 34312c102441f..63c597494a6ec 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0" name = "modularize_imports" repository = "https://github.com/vercel/next.js.git" -version = "0.15.0" +version = "0.16.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index 884a90044b074..2c98ba0734947 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "styled_components" repository = "https://github.com/vercel/next.js.git" -version = "0.40.0" +version = "0.41.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index b174ee66d89d9..72d780c94f55e 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0" name = "styled_jsx" repository = "https://github.com/vercel/next.js.git" -version = "0.15.0" +version = "0.16.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From fa728c9b1702c1f345156f877f43dcc1ebf77cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 25 Aug 2022 16:35:46 +0900 Subject: [PATCH 04/23] Test --- packages/next-swc/crates/core/Cargo.toml | 4 ++-- packages/next-swc/crates/emotion/Cargo.toml | 4 ++-- packages/next-swc/crates/modularize_imports/Cargo.toml | 2 +- packages/next-swc/crates/napi/Cargo.toml | 6 +++--- packages/next-swc/crates/styled_components/Cargo.toml | 4 ++-- packages/next-swc/crates/styled_jsx/Cargo.toml | 2 +- packages/next-swc/crates/wasm/Cargo.toml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index adf664ed901c6..acc920a6596e4 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -26,11 +26,11 @@ swc_emotion = {path="../emotion"} styled_components = {path="../styled_components"} styled_jsx = {path="../styled_jsx"} modularize_imports = {path="../modularize_imports"} -swc = "0.218.6" +swc = "0.219.2" swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] } swc_cached = "0.3.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index f51a97f3d1c08..7126c9ceec660 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -20,7 +20,7 @@ serde = "1" sourcemap = "6.0.1" swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.192.0", features = ["codegen", "utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["codegen", "utils", "visit"] } swc_trace_macro = "0.1.2" tracing = { version = "0.1.32", features = ["release_max_level_info"] } @@ -28,4 +28,4 @@ tracing = { version = "0.1.32", features = ["release_max_level_info"] } swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" serde_json = "1" -swc_ecma_transforms_react = "0.143.0" +swc_ecma_transforms_react = "0.144.0" diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 63c597494a6ec..09eb9d08f5375 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -16,7 +16,7 @@ once_cell = "1.13.0" regex = "1.5" serde = "1" swc_cached = "0.3.5" -swc_ecmascript = { version = "0.192.0", features = ["visit"] } +swc_ecmascript = { version = "0.193.0", features = ["visit"] } [dev-dependencies] swc_ecma_transforms_testing = "0.106.0" diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 643aff1e8eab8..520e28a9d0b6b 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -33,12 +33,12 @@ next-swc = {version = "0.0.0", path = "../core"} once_cell = "1.13.0" serde = "1" serde_json = "1" -swc = "0.218.6" +swc = "0.219.2" swc_atoms = "0.4.8" -swc_bundler = { version = "0.179.1", features = ["concurrent"] } +swc_bundler = { version = "0.180.0", features = ["concurrent"] } swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", optional = true } swc_node_base = "0.5.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index 2c98ba0734947..7203de3c576ba 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -17,11 +17,11 @@ regex = {version = "1.5.4", features = ["std", "perf"], default-features = false serde = {version = "1.0.130", features = ["derive"]} swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent"] } -swc_ecmascript = { version = "0.192.0", features = ["utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["utils", "visit"] } tracing = "0.1.32" [dev-dependencies] serde_json = "1" swc_ecma_transforms_testing = "0.106.0" -swc_ecmascript = { version = "0.192.0", features = ["parser", "transforms"] } +swc_ecmascript = { version = "0.193.0", features = ["parser", "transforms"] } testing = "0.29.4" diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index 72d780c94f55e..e103f3cdb5d32 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -14,7 +14,7 @@ easy-error = "1.0.0" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } swc_css = "0.121.0" swc_css_prefixer = "0.119.1" -swc_ecmascript = { version = "0.192.0", features = ["parser", "minifier", "utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["parser", "minifier", "utils", "visit"] } tracing = "0.1.32" [dev-dependencies] diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index f7de5bb015a18..bc6fdde694a27 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -25,9 +25,9 @@ parking_lot_core = "=0.8.0" path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" -swc = "0.218.6" +swc = "0.219.2" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.192.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", default-features = false, optional = true } tracing = { version = "0.1.32", features = ["release_max_level_off"] } wasm-bindgen = {version = "0.2", features = ["serde-serialize", "enable-interning"]} From 2fe5afc6c22c2dd51174819310dc5931ea175d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 25 Aug 2022 17:32:15 +0900 Subject: [PATCH 05/23] Update --- packages/next-swc/Cargo.lock | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index f30c4f4dc2348..dc61a2fa33df8 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -2964,9 +2964,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.218.6" +version = "0.219.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60717478d89050e2ebe9f825ea94856e63b71afad0045b5542440f14cf6d1113" +checksum = "c459eee5a973d3901898ece1a493b7ece360dfc0ace962441a4d5ee362b3abfb" dependencies = [ "ahash", "anyhow", @@ -3028,9 +3028,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.179.1" +version = "0.180.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea05c46971baa0eb2230f6f90ce1520125776739e01605851453b82df9e0d9e" +checksum = "9a3f6b0f93e3dfe53f8ec75f69340f1a314e3f999a07fe1b4f20ad91ff411953" dependencies = [ "ahash", "anyhow", @@ -3251,9 +3251,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.90.12" +version = "0.90.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b4c117b34ccc510cf6245c2f9b1f24a933beb2ef858bbfba99fb195525ddde" +checksum = "03e3da806375324c0188b7e529146bcf82feaac9d4898260be56976c392d99fc" dependencies = [ "bitflags", "bytecheck", @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.146.0" +version = "0.147.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a0989162ca5e886e9c6f07505d33873f8210e44a533db6909f676800f9b630" +checksum = "cd971e2140d77000e4921aca25a447859ba451fad27d507b9d64230af52352aa" dependencies = [ "ahash", "arrayvec", @@ -3411,9 +3411,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.161.0" +version = "0.162.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785793720219c467ef461003320cabee596d12d05dfdc5bd3d89ff38bd13c58c" +checksum = "0c9ce5d261844baaa4f3abbbd598599ced5ae473fdb1cf08a582208c3a643d03" dependencies = [ "ahash", "anyhow", @@ -3452,9 +3452,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.185.1" +version = "0.186.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e307b4c2100104d10f5840f5cba0c7b2db00742acb88d65652bb86bc4463d5b" +checksum = "38c090cfcfe92382e26de42fc29825acb8b28208c8d5d7cc7101e6fca33d04ba" dependencies = [ "swc_atoms", "swc_common", @@ -3472,9 +3472,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.104.1" +version = "0.104.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d7aeb3338fbc35b2d8f881a6102588b6cd1a6d7d6edf333252ee358c6e9b2c" +checksum = "9a63e36d11a8dad90d8d835c2f4fd1dcf21109c066f3cc9e6d23edc15e212a0c" dependencies = [ "better_scoped_tls", "bitflags", @@ -3509,9 +3509,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.124.0" +version = "0.125.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c376bfd35ce0fa4fcd90868b066191e10f6eb2426b12fe9b3d031a465f65a98" +checksum = "b289c68c08b418dd7614b052b7e5e233b8db5bd7cf0c0b68209c2eede117567c" dependencies = [ "ahash", "arrayvec", @@ -3549,9 +3549,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.141.0" +version = "0.142.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8f03422562c4747c78a55f6ba41625eb1a6167ec8b152df5a28a5bb36ab345" +checksum = "6bce8077213ca43ae3e41aeed1d2ad65c85bbed431c67f4173aac8539d2c342d" dependencies = [ "Inflector", "ahash", @@ -3577,9 +3577,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.154.0" +version = "0.155.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ad6077e00037f2249df854b60359d6aa85ffbc83ce7e9aea59734016af941a" +checksum = "1da8c2189ea97d4c7042df539b1b73224b6cb3cd06e497d49e24e366170c0a0e" dependencies = [ "ahash", "dashmap", @@ -3600,9 +3600,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.132.0" +version = "0.133.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f6e9c5772404d7a07a2cda019717cbd294d47215a7a2101332d1d4b64fdc92" +checksum = "712f200d9271c312766ef1fa1570095df3c07fd442148d1bc2d852468e311f3d" dependencies = [ "either", "serde", @@ -3619,9 +3619,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.143.0" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cee549bb5166dd212e5e18f49ddd3e5db9698314aa1ffa6deea553f659978e" +checksum = "239c70f44896c7605c707bd62b9d878f5f42a6628ec77d04c9a3325afa21b089" dependencies = [ "ahash", "base64 0.13.0", @@ -3669,9 +3669,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.147.0" +version = "0.148.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020383a6e9aa3ab8225f50de42b2528f5d3130a7d92b436a8594d2af05e244aa" +checksum = "5cce5990c95c2c88e7798bdb7156123fcfabc7715671bfed36723862fb32a143" dependencies = [ "serde", "swc_atoms", @@ -3685,9 +3685,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.100.2" +version = "0.100.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671eb0ef731ab6e9357e0a1845f527b02ed319b813b0e274d87b8d942554a353" +checksum = "e7509f6aac102d8c2b8d5d3f63d84a6a5149b291d853cf4c0890400b7660d151" dependencies = [ "indexmap", "once_cell", @@ -3715,9 +3715,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.192.0" +version = "0.193.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b18f993b6f6e8a5e81230226af043063f28e83eec89cf93d3cb554d2c63bdb" +checksum = "9ef84c27584d85f468f87b3bd61ab8e242b33926177c3979d0d9784f5970c59d" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", From 27a193869d95884b61f187fdb21d336afc36b82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 25 Aug 2022 23:28:18 +0900 Subject: [PATCH 06/23] Update @swc/helpers --- pnpm-lock.yaml | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7d4f85f04850..64cbe17cd0be6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,7 +204,7 @@ importers: '@types/trusted-types': 2.0.2 '@typescript-eslint/eslint-plugin': 4.29.1_h7pkbj7dyzxk3ymw6sjfdovo2m '@typescript-eslint/parser': 4.29.1_sphjtq24gqflsrz3rov2wazhhy - '@vercel/fetch': 6.1.1_fii5qhbaymjqmfm7e2spxc5z4m + '@vercel/fetch': 6.1.1_wbqoqouw2iimn65bqgaw3lwmza '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/floating-point-hex-parser': 1.11.1 '@webassemblyjs/helper-api-error': 1.11.1 @@ -313,7 +313,7 @@ importers: tailwindcss: 1.1.3 taskr: 1.1.0 tree-kill: 1.2.2 - tsec: 0.2.1_5yr6raq5qir6dqmptdaiz6dy4a + tsec: 0.2.1_kuhx4c6htogowt7cbr6ror46aq turbo: 1.3.2-canary.1 typescript: 4.6.3 wait-port: 0.2.2 @@ -3080,8 +3080,8 @@ packages: '@babel/helper-validator-identifier': 7.16.7 to-fast-properties: 2.0.0 - /@bazel/bazelisk/1.12.0: - resolution: {integrity: sha512-7oQusq1e4AIyFgotxVV7Pc40Et0QyvoVjujL+7/qV5Vrbfh0Nj3CfqSgl63weEyI4r0+K6RlGVsjfRuBi05p5w==} + /@bazel/bazelisk/1.12.1: + resolution: {integrity: sha512-TGCwVeIiVeQUP6yLpxAg8yluFOC+tBQnWw5l8lqwMxKhRtOA+WaH1CJKAXeCBAaS2MxohhkXq44zj/7AM+t2jg==} hasBin: true dev: true @@ -5778,6 +5778,13 @@ packages: form-data: 3.0.1 dev: true + /@types/node-fetch/2.6.2: + resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} + dependencies: + '@types/node': 17.0.21 + form-data: 3.0.1 + dev: true + /@types/node/10.12.18: resolution: {integrity: sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==} dev: true @@ -6203,14 +6210,14 @@ packages: - supports-color dev: true - /@vercel/fetch/6.1.1_fii5qhbaymjqmfm7e2spxc5z4m: + /@vercel/fetch/6.1.1_wbqoqouw2iimn65bqgaw3lwmza: resolution: {integrity: sha512-nddCkgpA0aVIqOlzh+qVlzDNcQq0cSnqefM+x6SciGI4GCvVZeaZ7WEowgX8I/HwBAq8Uj5Bdnd+r0+sYsJsig==} peerDependencies: '@types/node-fetch': '2' node-fetch: '2' dependencies: '@types/async-retry': 1.2.1 - '@types/node-fetch': 2.6.1 + '@types/node-fetch': 2.6.2 '@vercel/fetch-cached-dns': 2.0.2_node-fetch@2.6.7 '@vercel/fetch-retry': 5.0.3_node-fetch@2.6.7 agentkeepalive: 3.4.1 @@ -11717,6 +11724,10 @@ packages: url-parse-lax: 3.0.0 dev: true + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true + /graceful-fs/4.2.9: resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} @@ -11764,7 +11775,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.7.3 + uglify-js: 3.17.0 dev: true /har-schema/2.0.0: @@ -14351,7 +14362,7 @@ packages: resolution: {integrity: sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=} engines: {node: '>=0.10.0'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 parse-json: 2.2.0 pify: 2.3.0 pinkie-promise: 2.0.1 @@ -16690,7 +16701,7 @@ packages: resolution: {integrity: sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=} engines: {node: '>=0.10.0'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 pify: 2.3.0 pinkie-promise: 2.0.1 dev: true @@ -18271,7 +18282,7 @@ packages: normalize-package-data: 2.5.0 npm-normalize-package-bin: 1.0.1 optionalDependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 dev: true /read-package-json/3.0.0: @@ -20720,14 +20731,14 @@ packages: minimist: 1.2.6 strip-bom: 3.0.0 - /tsec/0.2.1_5yr6raq5qir6dqmptdaiz6dy4a: + /tsec/0.2.1_kuhx4c6htogowt7cbr6ror46aq: resolution: {integrity: sha512-RP9vhbRbRI9VH4CfOlQvo5W9HdfiPKq0gdiUOWI5oKmLaZKNFN8CsPwBfT5ySmhnKNwmmAS/BtY3WoTfABwwig==} hasBin: true peerDependencies: '@bazel/bazelisk': '>=1.7.5' typescript: '>=3.9.2' dependencies: - '@bazel/bazelisk': 1.12.0 + '@bazel/bazelisk': 1.12.1 glob: 7.2.0 minimatch: 3.1.2 typescript: 4.6.3 @@ -20995,14 +21006,11 @@ packages: resolution: {integrity: sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==} dev: true - /uglify-js/3.7.3: - resolution: {integrity: sha512-7tINm46/3puUA4hCkKYo4Xdts+JDaVC9ZPRcG8Xw9R4nhO/gZgUM3TENq8IF4Vatk8qCig4MzP/c8G4u2BkVQg==} + /uglify-js/3.17.0: + resolution: {integrity: sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true - dependencies: - commander: 2.20.3 - source-map: 0.6.1 dev: true optional: true @@ -21962,7 +21970,7 @@ packages: engines: {node: '>=6'} dependencies: detect-indent: 5.0.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 make-dir: 2.1.0 pify: 4.0.1 sort-keys: 2.0.0 From 9ce9d4b7d370dabaf1f981547c6d288d8ee407ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 00:03:23 +0900 Subject: [PATCH 07/23] Update `@swc/helpers` --- package.json | 2 +- packages/next/package.json | 2 +- pnpm-lock.yaml | 86 +++++++++++++++++--------------------- 3 files changed, 41 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 60f97bfdcc160..b9aeee09d1350 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@svgr/webpack": "5.5.0", "@swc/cli": "0.1.55", "@swc/core": "1.2.203", - "@swc/helpers": "0.4.2", + "@swc/helpers": "0.4.11", "@testing-library/react": "13.0.0", "@types/cheerio": "0.22.16", "@types/fs-extra": "8.1.0", diff --git a/packages/next/package.json b/packages/next/package.json index 9e6e893d54916..30357dc826bb2 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -71,7 +71,7 @@ }, "dependencies": { "@next/env": "12.2.6-canary.5", - "@swc/helpers": "0.4.3", + "@swc/helpers": "0.4.11", "caniuse-lite": "^1.0.30001332", "postcss": "8.4.14", "styled-jsx": "5.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64cbe17cd0be6..891f38d151c1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,7 +33,7 @@ importers: '@svgr/webpack': 5.5.0 '@swc/cli': 0.1.55 '@swc/core': 1.2.203 - '@swc/helpers': 0.4.2 + '@swc/helpers': 0.4.11 '@testing-library/react': 13.0.0 '@types/cheerio': 0.22.16 '@types/fs-extra': 8.1.0 @@ -187,7 +187,7 @@ importers: '@svgr/webpack': 5.5.0 '@swc/cli': 0.1.55_@swc+core@1.2.203 '@swc/core': 1.2.203 - '@swc/helpers': 0.4.2 + '@swc/helpers': 0.4.11 '@testing-library/react': 13.0.0_biqbaboplfbrettd7655fr4n2y '@types/cheerio': 0.22.16 '@types/fs-extra': 8.1.0 @@ -427,7 +427,7 @@ importers: '@next/react-refresh-utils': 12.2.6-canary.5 '@next/swc': 12.2.6-canary.5 '@segment/ajv-human-errors': 2.1.2 - '@swc/helpers': 0.4.3 + '@swc/helpers': 0.4.11 '@taskr/clear': 1.1.0 '@taskr/esnext': 1.1.0 '@taskr/watch': 1.1.0 @@ -582,7 +582,7 @@ importers: ws: 8.2.3 dependencies: '@next/env': link:../next-env - '@swc/helpers': 0.4.3 + '@swc/helpers': 0.4.11 caniuse-lite: 1.0.30001332 postcss: 8.4.14 styled-jsx: 5.0.4_@babel+core@7.18.0 @@ -3746,7 +3746,7 @@ packages: collect-v8-coverage: 1.0.1 exit: 0.1.2 glob: 7.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 istanbul-lib-coverage: 3.0.0 istanbul-lib-instrument: 4.0.3 istanbul-lib-report: 3.0.0 @@ -3778,7 +3778,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: callsites: 3.1.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 source-map: 0.6.1 dev: true @@ -3797,7 +3797,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/test-result': 27.0.6 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-haste-map: 27.0.6 jest-runtime: 27.0.6 transitivePeerDependencies: @@ -3814,7 +3814,7 @@ packages: chalk: 4.1.2 convert-source-map: 1.7.0 fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-haste-map: 27.0.6 jest-regex-util: 27.0.6 jest-util: 27.0.6 @@ -5341,17 +5341,10 @@ packages: '@swc/core-win32-x64-msvc': 1.2.203 dev: true - /@swc/helpers/0.4.2: - resolution: {integrity: sha512-556Az0VX7WR6UdoTn4htt/l3zPQ7bsQWK+HqdG4swV7beUCxo/BqmvbOpUkTIm/9ih86LIf1qsUnywNL3obGHw==} - dependencies: - tslib: 2.4.0 - dev: true - - /@swc/helpers/0.4.3: - resolution: {integrity: sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==} + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} dependencies: tslib: 2.4.0 - dev: false /@szmarczak/http-timer/1.1.2: resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} @@ -7069,7 +7062,7 @@ packages: babel-plugin-istanbul: 6.0.0 babel-preset-jest: 27.0.6_@babel+core@7.18.0 chalk: 4.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 slash: 3.0.0 transitivePeerDependencies: - supports-color @@ -8407,7 +8400,7 @@ packages: engines: {node: '>=4'} dependencies: dot-prop: 4.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 make-dir: 1.3.0 unique-string: 1.0.0 write-file-atomic: 2.4.3 @@ -8419,7 +8412,7 @@ packages: engines: {node: '>=8'} dependencies: dot-prop: 5.3.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 make-dir: 3.1.0 unique-string: 2.0.0 write-file-atomic: 3.0.3 @@ -9394,7 +9387,7 @@ packages: engines: {node: '>=10'} dependencies: globby: 11.1.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 is-glob: 4.0.3 is-path-cwd: 2.2.0 is-path-inside: 3.0.3 @@ -10206,7 +10199,6 @@ packages: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: eslint: 7.32.0 - dev: false /eslint-plugin-react/7.23.2_eslint@7.24.0: resolution: {integrity: sha512-AfjgFQB+nYszudkxRkTFu0UR1zEQig0ArVMPloKhxwlwkzaw/fBiH0QWcBBhZONlXqQC51+nfqFrkn4EzHcGBw==} @@ -11157,7 +11149,7 @@ packages: /fs-extra/5.0.0: resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jsonfile: 4.0.0 universalify: 0.1.2 dev: true @@ -11166,7 +11158,7 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jsonfile: 4.0.0 universalify: 0.1.2 dev: true @@ -11186,7 +11178,7 @@ packages: engines: {node: '>=10'} dependencies: at-least-node: 1.0.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jsonfile: 6.0.1 universalify: 2.0.0 dev: true @@ -13300,7 +13292,7 @@ packages: chalk: 4.1.2 deepmerge: 4.2.2 glob: 7.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 is-ci: 3.0.0 jest-circus: 27.0.6 jest-environment-jsdom: 27.0.6 @@ -13433,7 +13425,7 @@ packages: '@types/node': 17.0.21 anymatch: 3.1.1 fb-watchman: 2.0.1 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-regex-util: 27.0.6 jest-serializer: 27.0.6 jest-util: 27.0.6 @@ -13516,7 +13508,7 @@ packages: '@jest/types': 26.6.2 '@types/stack-utils': 2.0.0 chalk: 4.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 micromatch: 4.0.4 pretty-format: 26.6.2 slash: 3.0.0 @@ -13531,7 +13523,7 @@ packages: '@jest/types': 27.0.6 '@types/stack-utils': 2.0.0 chalk: 4.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 micromatch: 4.0.4 pretty-format: 27.5.1 slash: 3.0.0 @@ -13546,7 +13538,7 @@ packages: '@jest/types': 28.1.3 '@types/stack-utils': 2.0.0 chalk: 4.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 micromatch: 4.0.4 pretty-format: 28.1.3 slash: 3.0.0 @@ -13609,7 +13601,7 @@ packages: '@jest/types': 27.0.6 chalk: 4.1.2 escalade: 3.1.1 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-pnp-resolver: 1.2.2_jest-resolve@27.0.6 jest-util: 27.0.6 jest-validate: 27.0.6 @@ -13630,7 +13622,7 @@ packages: chalk: 4.1.2 emittery: 0.8.1 exit: 0.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-docblock: 27.0.6 jest-environment-jsdom: 27.0.6 jest-environment-node: 27.0.6 @@ -13668,7 +13660,7 @@ packages: collect-v8-coverage: 1.0.1 exit: 0.1.2 glob: 7.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-haste-map: 27.0.6 jest-message-util: 27.0.6 jest-mock: 27.0.6 @@ -13689,7 +13681,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@types/node': 17.0.21 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 dev: true /jest-snapshot/27.0.6: @@ -13709,7 +13701,7 @@ packages: babel-preset-current-node-syntax: 1.0.1_@babel+core@7.18.0 chalk: 4.1.2 expect: 27.0.6 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 jest-diff: 27.0.6 jest-get-type: 27.0.6 jest-haste-map: 27.0.6 @@ -13731,7 +13723,7 @@ packages: '@jest/types': 27.0.6 '@types/node': 17.0.21 chalk: 4.1.2 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 is-ci: 3.0.0 picomatch: 2.2.3 dev: true @@ -13985,7 +13977,7 @@ packages: /jsonfile/4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 dev: true /jsonfile/6.0.1: @@ -13993,7 +13985,7 @@ packages: dependencies: universalify: 1.0.0 optionalDependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 dev: true /jsonparse/1.3.1: @@ -14373,7 +14365,7 @@ packages: resolution: {integrity: sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=} engines: {node: '>=4'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 parse-json: 2.2.0 pify: 2.3.0 strip-bom: 3.0.0 @@ -14383,7 +14375,7 @@ packages: resolution: {integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs=} engines: {node: '>=4'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 parse-json: 4.0.0 pify: 3.0.0 strip-bom: 3.0.0 @@ -14393,7 +14385,7 @@ packages: resolution: {integrity: sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==} engines: {node: '>=8'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 parse-json: 5.0.0 strip-bom: 4.0.0 type-fest: 0.6.0 @@ -15653,7 +15645,7 @@ packages: dependencies: env-paths: 2.2.0 glob: 7.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 mkdirp: 0.5.5 nopt: 4.0.3 npmlog: 4.1.2 @@ -15671,7 +15663,7 @@ packages: dependencies: env-paths: 2.2.0 glob: 7.2.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 nopt: 5.0.0 npmlog: 4.1.2 request: 2.88.2 @@ -15822,7 +15814,7 @@ packages: resolution: {integrity: sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==} dependencies: byline: 5.0.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 node-gyp: 5.1.1 resolve-from: 4.0.0 slide: 1.1.6 @@ -18434,7 +18426,7 @@ packages: dependencies: debuglog: 1.0.1 dezalgo: 1.0.3 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 once: 1.4.0 dev: true @@ -20356,7 +20348,7 @@ packages: resolution: {integrity: sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==} engines: {node: '>=8'} dependencies: - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 is-stream: 2.0.0 make-dir: 3.1.0 temp-dir: 1.0.0 @@ -21982,7 +21974,7 @@ packages: engines: {node: '>=8.3'} dependencies: detect-indent: 6.0.0 - graceful-fs: 4.2.9 + graceful-fs: 4.2.10 is-plain-obj: 2.1.0 make-dir: 3.1.0 sort-keys: 4.2.0 From 5109a1efcbbb16ee0a40a6f6bfb1ea28f61f99ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 17:02:43 +0900 Subject: [PATCH 08/23] Update swc --- packages/next-swc/Cargo.lock | 48 +++++++++---------- packages/next-swc/crates/core/Cargo.toml | 4 +- packages/next-swc/crates/emotion/Cargo.toml | 4 +- .../crates/modularize_imports/Cargo.toml | 2 +- packages/next-swc/crates/napi/Cargo.toml | 6 +-- .../crates/styled_components/Cargo.toml | 4 +- .../next-swc/crates/styled_jsx/Cargo.toml | 2 +- packages/next-swc/crates/wasm/Cargo.toml | 4 +- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index dc61a2fa33df8..4f602b7b41f3d 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -2964,9 +2964,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.219.2" +version = "0.221.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c459eee5a973d3901898ece1a493b7ece360dfc0ace962441a4d5ee362b3abfb" +checksum = "cc4e4da960801a944f49aca84ca1ed62b55717ec376a349321927a9d60680984" dependencies = [ "ahash", "anyhow", @@ -3028,9 +3028,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.180.0" +version = "0.182.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3f6b0f93e3dfe53f8ec75f69340f1a314e3f999a07fe1b4f20ad91ff411953" +checksum = "b6bf6f47563dc1bcfe32f56068b6ad55cfe5264fb878c5500de8dfcea8627008" dependencies = [ "ahash", "anyhow", @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.147.0" +version = "0.149.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd971e2140d77000e4921aca25a447859ba451fad27d507b9d64230af52352aa" +checksum = "ec7598a7c36363c7ae4982946a23c7a6fe946c231a4488e8c132e6ad5b05797e" dependencies = [ "ahash", "arrayvec", @@ -3411,9 +3411,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.162.0" +version = "0.164.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ce5d261844baaa4f3abbbd598599ced5ae473fdb1cf08a582208c3a643d03" +checksum = "280e9f05ff2f71557fbb11bedf9fc0d97c99430bb166a44c7579d3253222069a" dependencies = [ "ahash", "anyhow", @@ -3452,9 +3452,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.186.0" +version = "0.188.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c090cfcfe92382e26de42fc29825acb8b28208c8d5d7cc7101e6fca33d04ba" +checksum = "c99ac26bea51c8145672b05342762ccbda59f6aaa12be172e23630d5eaf0fee5" dependencies = [ "swc_atoms", "swc_common", @@ -3509,9 +3509,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.125.0" +version = "0.127.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b289c68c08b418dd7614b052b7e5e233b8db5bd7cf0c0b68209c2eede117567c" +checksum = "0f966e234a9c7055c0d3eeb7c24fa8d93a6afeca8ef7b0ffd5a59a5b33d81ded" dependencies = [ "ahash", "arrayvec", @@ -3549,9 +3549,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.142.0" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bce8077213ca43ae3e41aeed1d2ad65c85bbed431c67f4173aac8539d2c342d" +checksum = "eeaa5672ebdbbf88ea320a34ec29d39f63f05eac9efb07a08197ca35b74f035a" dependencies = [ "Inflector", "ahash", @@ -3577,9 +3577,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.155.0" +version = "0.157.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da8c2189ea97d4c7042df539b1b73224b6cb3cd06e497d49e24e366170c0a0e" +checksum = "a0e7c25e5f99cd1b995b79e1c902eae759f1ef3edec2f3ee1541409536bc79ea" dependencies = [ "ahash", "dashmap", @@ -3600,9 +3600,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.133.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712f200d9271c312766ef1fa1570095df3c07fd442148d1bc2d852468e311f3d" +checksum = "1813b60e0551ced3ae9390dad688977c0e8fb8c4041ae5d72b8afd76f06fb4c7" dependencies = [ "either", "serde", @@ -3619,9 +3619,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.144.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239c70f44896c7605c707bd62b9d878f5f42a6628ec77d04c9a3325afa21b089" +checksum = "524ccc5d330f8077fe5709a6cab42b14a67c8ccd6e478adbdf55489f173e7b82" dependencies = [ "ahash", "base64 0.13.0", @@ -3669,9 +3669,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.148.0" +version = "0.150.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cce5990c95c2c88e7798bdb7156123fcfabc7715671bfed36723862fb32a143" +checksum = "d3d364022ebccdc1e6fb831e7a43da31a77200c0aecde4a143f0065af4185003" dependencies = [ "serde", "swc_atoms", @@ -3715,9 +3715,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.193.0" +version = "0.195.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef84c27584d85f468f87b3bd61ab8e242b33926177c3979d0d9784f5970c59d" +checksum = "3a7c5341e4a940caf5fbbb86c3474441731dc9de4a446900c075d730f9e01d9d" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index acc920a6596e4..2e487cffc68c2 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -26,11 +26,11 @@ swc_emotion = {path="../emotion"} styled_components = {path="../styled_components"} styled_jsx = {path="../styled_jsx"} modularize_imports = {path="../modularize_imports"} -swc = "0.219.2" +swc = "0.221.0" swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] } swc_cached = "0.3.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index 7126c9ceec660..b3e9f4f8b2cf7 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -20,7 +20,7 @@ serde = "1" sourcemap = "6.0.1" swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.193.0", features = ["codegen", "utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["codegen", "utils", "visit"] } swc_trace_macro = "0.1.2" tracing = { version = "0.1.32", features = ["release_max_level_info"] } @@ -28,4 +28,4 @@ tracing = { version = "0.1.32", features = ["release_max_level_info"] } swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" serde_json = "1" -swc_ecma_transforms_react = "0.144.0" +swc_ecma_transforms_react = "0.146.0" diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 09eb9d08f5375..afa81893bfd97 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -16,7 +16,7 @@ once_cell = "1.13.0" regex = "1.5" serde = "1" swc_cached = "0.3.5" -swc_ecmascript = { version = "0.193.0", features = ["visit"] } +swc_ecmascript = { version = "0.195.0", features = ["visit"] } [dev-dependencies] swc_ecma_transforms_testing = "0.106.0" diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 520e28a9d0b6b..5dc06b57202c0 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -33,12 +33,12 @@ next-swc = {version = "0.0.0", path = "../core"} once_cell = "1.13.0" serde = "1" serde_json = "1" -swc = "0.219.2" +swc = "0.221.0" swc_atoms = "0.4.8" -swc_bundler = { version = "0.180.0", features = ["concurrent"] } +swc_bundler = { version = "0.182.0", features = ["concurrent"] } swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", optional = true } swc_node_base = "0.5.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index 7203de3c576ba..f93cf964d3b86 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -17,11 +17,11 @@ regex = {version = "1.5.4", features = ["std", "perf"], default-features = false serde = {version = "1.0.130", features = ["derive"]} swc_atoms = "0.4.8" swc_common = { version = "0.27.13", features = ["concurrent"] } -swc_ecmascript = { version = "0.193.0", features = ["utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["utils", "visit"] } tracing = "0.1.32" [dev-dependencies] serde_json = "1" swc_ecma_transforms_testing = "0.106.0" -swc_ecmascript = { version = "0.193.0", features = ["parser", "transforms"] } +swc_ecmascript = { version = "0.195.0", features = ["parser", "transforms"] } testing = "0.29.4" diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index e103f3cdb5d32..40480e8087f89 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -14,7 +14,7 @@ easy-error = "1.0.0" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } swc_css = "0.121.0" swc_css_prefixer = "0.119.1" -swc_ecmascript = { version = "0.193.0", features = ["parser", "minifier", "utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["parser", "minifier", "utils", "visit"] } tracing = "0.1.32" [dev-dependencies] diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index bc6fdde694a27..cf8095858be20 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -25,9 +25,9 @@ parking_lot_core = "=0.8.0" path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" -swc = "0.219.2" +swc = "0.221.0" swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.193.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_plugin_runner = { version = "0.73.1", default-features = false, optional = true } tracing = { version = "0.1.32", features = ["release_max_level_off"] } wasm-bindgen = {version = "0.2", features = ["serde-serialize", "enable-interning"]} From 27124fc4949fa84d195a24cbae309387c886b63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 17:03:11 +0900 Subject: [PATCH 09/23] Update test refs --- .../crates/core/tests/full/example/output.js | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/next-swc/crates/core/tests/full/example/output.js b/packages/next-swc/crates/core/tests/full/example/output.js index 4ab20062f2ab8..70e0292bd93eb 100644 --- a/packages/next-swc/crates/core/tests/full/example/output.js +++ b/packages/next-swc/crates/core/tests/full/example/output.js @@ -1,41 +1,42 @@ -function r(r, t) { - (null == t || t > r.length) && (t = r.length); - for(var n = 0, e = new Array(t); n < t; n++)e[n] = r[n]; +function t(t, r) { + (null == r || r > t.length) && (r = t.length); + for(var n = 0, e = new Array(r); n < r; n++)e[n] = t[n]; return e; } -import t from "other"; -(function(t, n) { - return function(r) { - if (Array.isArray(r)) return r; - }(t) || function(r, t) { - var n, e, l = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (null != l) { - var u = [], o = !0, f = !1; +import r from "other"; +var n = function(r, n) { + return function(t) { + if (Array.isArray(t)) return t; + }(r) || function(t, r) { + var n, e, o = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; + if (null != o) { + var u = [], l = !0, a = !1; try { - for(l = l.call(r); !(o = (n = l.next()).done) && (u.push(n.value), !t || u.length !== t); o = !0); + for(o = o.call(t); !(l = (n = o.next()).done) && (u.push(n.value), !r || u.length !== r); l = !0); } catch (i) { - f = !0, e = i; + a = !0, e = i; } finally{ try { - o || null == l.return || l.return(); + l || null == o.return || o.return(); } finally{ - if (f) throw e; + if (a) throw e; } } return u; } - }(t, n) || function t(n, e) { + }(r, n) || function r(n, e) { if (n) { - if ("string" == typeof n) return r(n, e); - var l = Object.prototype.toString.call(n).slice(8, -1); - if ("Object" === l && n.constructor && (l = n.constructor.name), "Map" === l || "Set" === l) return Array.from(l); - if ("Arguments" === l || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)) return r(n, e); + if ("string" == typeof n) return t(n, e); + var o = Object.prototype.toString.call(n).slice(8, -1); + if ("Object" === o && n.constructor && (o = n.constructor.name), "Map" === o || "Set" === o) return Array.from(o); + if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return t(n, e); } - }(t, n) || function() { + }(r, n) || 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."); }(); -})(t, 1)[0]; +}(r, 1); +n[0]; export var __N_SSG = !0; -export default function n() { +export default function e() { return React.createElement("div", null); }; From af85f952da4ba1473fc49b7f337938ac1cc9d051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 17:03:35 +0900 Subject: [PATCH 10/23] Update swc again --- packages/next-swc/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index 4f602b7b41f3d..2b10415676b58 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -3472,9 +3472,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.104.3" +version = "0.104.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a63e36d11a8dad90d8d835c2f4fd1dcf21109c066f3cc9e6d23edc15e212a0c" +checksum = "485bb1aa80d43bd1cb1bb6c772d9a00afe904e98cd270203170f37d14d08fca7" dependencies = [ "better_scoped_tls", "bitflags", From db45d6491187693155449487c5f01d54fe985672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 17:50:32 +0900 Subject: [PATCH 11/23] Update swc --- packages/next-swc/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index 2b10415676b58..a47ffe5f20f0e 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.149.2" +version = "0.149.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7598a7c36363c7ae4982946a23c7a6fe946c231a4488e8c132e6ad5b05797e" +checksum = "7f068da1986d7ee9983cf3b132955ad1b7b3ccf44f898edaacb12cdaeb1ac3be" dependencies = [ "ahash", "arrayvec", From 6fdb1b6a9f06ff1a9e249c215fe158c94570e8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 26 Aug 2022 19:23:00 +0900 Subject: [PATCH 12/23] Update swc --- packages/next-swc/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index a47ffe5f20f0e..197fe301646c0 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.149.3" +version = "0.149.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f068da1986d7ee9983cf3b132955ad1b7b3ccf44f898edaacb12cdaeb1ac3be" +checksum = "c4dc0395f33175ffe5c97d92034a0b9796a3f1927bb04a203a844f4c7e4e1a30" dependencies = [ "ahash", "arrayvec", From fdfd49d3a83926795ece6fdae7d639d130ce9cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sat, 27 Aug 2022 11:46:28 +0900 Subject: [PATCH 13/23] Bump --- packages/next-swc/Cargo.lock | 8 ++++---- packages/next-swc/crates/emotion/Cargo.toml | 2 +- packages/next-swc/crates/modularize_imports/Cargo.toml | 2 +- packages/next-swc/crates/styled_components/Cargo.toml | 2 +- packages/next-swc/crates/styled_jsx/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index 197fe301646c0..5bdb1493191ab 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -1481,7 +1481,7 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.16.0" +version = "0.17.0" dependencies = [ "convert_case", "handlebars", @@ -2899,7 +2899,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "styled_components" -version = "0.41.0" +version = "0.42.0" dependencies = [ "Inflector", "once_cell", @@ -2916,7 +2916,7 @@ dependencies = [ [[package]] name = "styled_jsx" -version = "0.16.0" +version = "0.17.0" dependencies = [ "easy-error", "swc_common", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "swc_emotion" -version = "0.18.0" +version = "0.19.0" dependencies = [ "base64 0.13.0", "byteorder", diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index b3e9f4f8b2cf7..87e3b04bafd70 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -5,7 +5,7 @@ description = "AST Transforms for emotion" license = "Apache-2.0" name = "swc_emotion" repository = "https://github.com/vercel/next.js.git" -version = "0.18.0" +version = "0.19.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index afa81893bfd97..72ab803b0a21e 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0" name = "modularize_imports" repository = "https://github.com/vercel/next.js.git" -version = "0.16.0" +version = "0.17.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index f93cf964d3b86..f95cd8ad1d9fa 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "styled_components" repository = "https://github.com/vercel/next.js.git" -version = "0.41.0" +version = "0.42.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index 40480e8087f89..5046278d9cdae 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0" name = "styled_jsx" repository = "https://github.com/vercel/next.js.git" -version = "0.16.0" +version = "0.17.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 2606db95b820b32c131c514aeff9414f68705d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 28 Aug 2022 12:18:40 +0900 Subject: [PATCH 14/23] Update swc --- packages/next-swc/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index 5bdb1493191ab..bc6b2b38ae6d5 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -3359,9 +3359,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.149.4" +version = "0.149.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4dc0395f33175ffe5c97d92034a0b9796a3f1927bb04a203a844f4c7e4e1a30" +checksum = "20af228a0b4fd94d1f86fe20f50eed3db7a635d99c0a2f62a37db0165877c54b" dependencies = [ "ahash", "arrayvec", From 4e8562d6764711b8d9646f41e1d4ce3433a304ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 00:30:06 +0900 Subject: [PATCH 15/23] Merge `swc_core` patch --- .github/workflows/build_test_deploy.yml | 2 +- packages/next-swc/Cargo.lock | 373 ++++++++++-------- packages/next-swc/crates/core/Cargo.toml | 30 +- .../crates/core/src/amp_attributes.rs | 8 +- .../next-swc/crates/core/src/auto_cjs/mod.rs | 2 +- .../src/disallow_re_export_all_in_page.rs | 10 +- .../crates/core/src/hook_optimizer.rs | 16 +- packages/next-swc/crates/core/src/lib.rs | 19 +- .../next-swc/crates/core/src/next_dynamic.rs | 20 +- packages/next-swc/crates/core/src/next_ssg.rs | 16 +- .../next-swc/crates/core/src/page_config.rs | 10 +- .../core/src/react_remove_properties.rs | 7 +- packages/next-swc/crates/core/src/relay.rs | 14 +- .../crates/core/src/remove_console.rs | 12 +- .../next-swc/crates/core/src/shake_exports.rs | 14 +- .../core/src/top_level_binding_collector.rs | 5 +- packages/next-swc/crates/core/tests/errors.rs | 8 +- .../next-swc/crates/core/tests/fixture.rs | 8 +- packages/next-swc/crates/core/tests/full.rs | 12 +- .../next-swc/crates/core/tests/telemetry.rs | 9 +- packages/next-swc/crates/emotion/Cargo.toml | 10 +- .../next-swc/crates/emotion/src/import_map.rs | 6 +- packages/next-swc/crates/emotion/src/lib.rs | 28 +- .../next-swc/crates/emotion/tests/fixture.rs | 12 +- .../crates/modularize_imports/Cargo.toml | 7 +- .../crates/modularize_imports/src/lib.rs | 9 +- .../modularize_imports/tests/fixture.rs | 6 +- packages/next-swc/crates/napi/Cargo.toml | 35 +- .../next-swc/crates/napi/src/bundle/mod.rs | 38 +- packages/next-swc/crates/napi/src/lib.rs | 8 +- packages/next-swc/crates/napi/src/minify.rs | 14 +- packages/next-swc/crates/napi/src/parse.rs | 10 +- .../next-swc/crates/napi/src/transform.rs | 10 +- .../crates/styled_components/Cargo.toml | 18 +- .../crates/styled_components/src/lib.rs | 8 +- .../styled_components/src/utils/analyzer.rs | 8 +- .../crates/styled_components/src/utils/mod.rs | 14 +- .../src/visitors/display_name_and_id.rs | 12 +- .../top_level_binding_collector.rs | 8 +- .../visitors/transpile_css_prop/transpile.rs | 20 +- .../crates/styled_components/tests/fixture.rs | 10 +- .../next-swc/crates/styled_jsx/Cargo.toml | 23 +- .../next-swc/crates/styled_jsx/src/lib.rs | 25 +- .../crates/styled_jsx/src/transform_css.rs | 43 +- .../next-swc/crates/styled_jsx/src/utils.rs | 3 +- .../crates/styled_jsx/tests/fixture.rs | 8 +- packages/next-swc/crates/wasm/Cargo.toml | 31 +- packages/next-swc/crates/wasm/src/lib.rs | 17 +- packages/next-swc/rust-toolchain | 2 +- 49 files changed, 592 insertions(+), 446 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 37b71a4632f0a..fe8dfad1dc11f 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -9,7 +9,7 @@ name: Build, test, and deploy env: NAPI_CLI_VERSION: 2.7.0 TURBO_VERSION: 1.3.2-canary.1 - RUST_TOOLCHAIN: nightly-2022-02-23 + RUST_TOOLCHAIN: nightly-2022-06-12 PNPM_VERSION: 7.2.1 jobs: diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index bc6b2b38ae6d5..b45e43aeb19f5 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -59,9 +59,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.56" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" +checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" [[package]] name = "arrayref" @@ -160,6 +160,24 @@ dependencies = [ "scoped-tls", ] +[[package]] +name = "binding_macros" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "148582743dcb4f3a872f6275a412e8e0c1b64023790fa33c8590e98e7b81d40e" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "js-sys", + "once_cell", + "swc", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -670,7 +688,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" dependencies = [ - "enum-iterator-derive", + "enum-iterator-derive 0.7.0", +] + +[[package]] +name = "enum-iterator" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" +dependencies = [ + "enum-iterator-derive 1.1.0", ] [[package]] @@ -684,6 +711,17 @@ dependencies = [ "syn", ] +[[package]] +name = "enum-iterator-derive" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "enum_kind" version = "0.2.1" @@ -891,6 +929,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "gimli" version = "0.26.1" @@ -1481,16 +1531,14 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.17.0" +version = "0.15.0" dependencies = [ "convert_case", "handlebars", "once_cell", "regex", "serde", - "swc_cached", - "swc_ecma_transforms_testing", - "swc_ecmascript", + "swc_core", "testing", ] @@ -1575,20 +1623,11 @@ dependencies = [ "serde_json", "styled_components", "styled_jsx", - "swc", - "swc_atoms", - "swc_cached", - "swc_common", - "swc_ecma_loader", - "swc_ecma_transforms_testing", - "swc_ecmascript", + "swc_core", "swc_emotion", - "swc_plugin_runner", "testing", "tracing", "walkdir", - "wasmer", - "wasmer-wasi", ] [[package]] @@ -1606,20 +1645,11 @@ dependencies = [ "sentry", "serde", "serde_json", - "swc", - "swc_atoms", - "swc_bundler", - "swc_common", - "swc_ecma_loader", - "swc_ecmascript", - "swc_node_base", - "swc_plugin_runner", + "swc_core", "tracing", "tracing-chrome", "tracing-futures", "tracing-subscriber", - "wasmer", - "wasmer-wasi", ] [[package]] @@ -2018,9 +2048,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "preset_env_base" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3fc6fae03023ee1badb75ccbefc36379c419754b30e3848b77a4327f4ec1e2" +checksum = "79525f471165bbd66b40e93c54a2c98bb51ebb27497d6c97c5cc3441aaec5508" dependencies = [ "ahash", "anyhow", @@ -2078,11 +2108,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2113,9 +2143,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.15" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2410,9 +2440,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" @@ -2589,7 +2619,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.11", + "time 0.3.13", "url", "uuid", ] @@ -2899,31 +2929,24 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "styled_components" -version = "0.42.0" +version = "0.40.0" dependencies = [ "Inflector", "once_cell", "regex", "serde", "serde_json", - "swc_atoms", - "swc_common", - "swc_ecma_transforms_testing", - "swc_ecmascript", + "swc_core", "testing", "tracing", ] [[package]] name = "styled_jsx" -version = "0.17.0" +version = "0.15.0" dependencies = [ "easy-error", - "swc_common", - "swc_css", - "swc_css_prefixer", - "swc_ecma_transforms_testing", - "swc_ecmascript", + "swc_core", "testing", "tracing", ] @@ -2964,9 +2987,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.221.0" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4e4da960801a944f49aca84ca1ed62b55717ec376a349321927a9d60680984" +checksum = "a6cc8d2e59e8d7a2650ea97193aaf50e4b1aa940e0476522a97e4913f63620ef" dependencies = [ "ahash", "anyhow", @@ -3013,11 +3036,10 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454bf2d73485f6c4af9c91e70ce4fd4f17e9294d37b9f2037a3c4c2fe54b598d" +checksum = "8fb43a79c8affc20f5d52b7db093399585ce87674427adc60843dbc8ec242608" dependencies = [ - "bytecheck", "once_cell", "rkyv", "rustc-hash", @@ -3028,9 +3050,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.182.0" +version = "0.185.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf6f47563dc1bcfe32f56068b6ad55cfe5264fb878c5500de8dfcea8627008" +checksum = "00a67427e87cddb6a9502530c966d22f7099cb42783a50712a2ec3cc05ded7f9" dependencies = [ "ahash", "anyhow", @@ -3062,9 +3084,9 @@ dependencies = [ [[package]] name = "swc_cached" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395389d54bea607246bb4a400b9b3df2e55adfe8fcce7965a5b99fed7816cf4d" +checksum = "96395ee002185e0b4bc9fa88e21b7065e77e9795d7e35dfcb02fc8085b5cd1ce" dependencies = [ "ahash", "anyhow", @@ -3111,9 +3133,9 @@ dependencies = [ [[package]] name = "swc_config" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb05ef56c14b95dd7e62e95960153af811b9a447287f1f6ca59f1337fb83d4" +checksum = "fc17721410f3f12aeb42dcb99528350adf122681ab4796e48c2cfc0bda0c752c" dependencies = [ "anyhow", "indexmap", @@ -3136,23 +3158,48 @@ dependencies = [ ] [[package]] -name = "swc_css" -version = "0.121.0" +name = "swc_core" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fd098803583e25c9b8e1723a980f99ee0bf7a0ad87a0ef5bccc6954c50fb48" +checksum = "6ce4529dad9fa47a3030e9af930b6162aec9271a30a7050de21aad5a9ac33c6a" dependencies = [ + "binding_macros", + "swc", + "swc_atoms", + "swc_bundler", + "swc_cached", + "swc_common", "swc_css_ast", "swc_css_codegen", "swc_css_parser", - "swc_css_utils", + "swc_css_prefixer", "swc_css_visit", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_loader", + "swc_ecma_minifier", + "swc_ecma_parser", + "swc_ecma_transforms", + "swc_ecma_transforms_optimization", + "swc_ecma_transforms_react", + "swc_ecma_transforms_testing", + "swc_ecma_transforms_typescript", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_node_base", + "swc_plugin_proxy", + "swc_plugin_runner", + "swc_trace_macro", + "vergen", + "wasmer", + "wasmer-wasi", ] [[package]] name = "swc_css_ast" -version = "0.108.1" +version = "0.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98716d6d4dc9d63abde21d1af1db6bc40b17dbbd9018fa9e3391a5a37429e870" +checksum = "a509e0985a7f9fad59ffe2fca9c32e50f18d443a100b45e0caf3dcfdad3ffbcf" dependencies = [ "is-macro", "serde", @@ -3163,9 +3210,9 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "0.118.1" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fabd9af5731c4060211076f0672e7d3bc5bcedc98ccce4ed02e673cc089769" +checksum = "7285b5dcc1c196f8798f4391f94b7f97fc097c371d99337775ef07f2779682a6" dependencies = [ "auto_impl", "bitflags", @@ -3192,9 +3239,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.117.1" +version = "0.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6260566c17ce17c5021c73efb70d444ebd12af7525267df50d9b5561ab276c3" +checksum = "680fc749baaf53a0ebb5ba09482c43701b3d523ab823005376e39cfb3e4ca213" dependencies = [ "bitflags", "lexical", @@ -3206,9 +3253,9 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "0.119.1" +version = "0.121.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecacdf41e5a712e436e0c6124108f318abc5caf96c4575145ab3bddb6d498fdc" +checksum = "774759d18cf8a0e2f5cab1d7fff457bb383f4b8e8c2fbe25a0a52e2a74c9a7be" dependencies = [ "once_cell", "preset_env_base", @@ -3223,9 +3270,9 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "0.105.1" +version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9edb52559290fb61484a73f1422cd84d4f7c741c17e5c2f2c153a6c7fbf09a1" +checksum = "2b611f636a937f50361b8d18cfae08ae20fa1e3b659ab7d2e5ec7e774a6fbef4" dependencies = [ "once_cell", "serde", @@ -3238,9 +3285,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "0.107.0" +version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9b6db7da6d4df5eb7e1cc9636dee8e24468856219e93ecebf066a02330b842" +checksum = "706be455229bd4c5c5761295fb02ef13f82c26daa0ef8f6efd1d769805462fe6" dependencies = [ "serde", "swc_atoms", @@ -3251,9 +3298,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.90.13" +version = "0.90.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e3da806375324c0188b7e529146bcf82feaac9d4898260be56976c392d99fc" +checksum = "571989e199094be58d107e032c0b868f7b04a59a238e0a31bc9df8faf537dcd3" dependencies = [ "bitflags", "bytecheck", @@ -3270,9 +3317,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.122.0" +version = "0.123.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0acc7d3ea2b74109e0d6803c9653711958aaa01889a226ee12c93f92d5de0fe4" +checksum = "616548c924bb4834b0570078c8edb85c07f5033d438316c482693d8968686dbb" dependencies = [ "memchr", "num-bigint", @@ -3302,9 +3349,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.86.0" +version = "0.87.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f596f280b222941bba5cb3276725138a4c5f91a75fd01332f8a29ad90344eef8" +checksum = "24cc13886dcab94205e82358abd59b49a6ca06f15ee66f28c082d0277c4f0a1f" dependencies = [ "phf", "swc_atoms", @@ -3316,9 +3363,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.59.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e5d4211f03785a5b8ec046158232d481966dfbac2e5ff546fe94a13f0602c2" +checksum = "3240efa29a4a5968134622766cd122ae2cbb81c3bb3f3fdd9e81814f15d28b47" dependencies = [ "ahash", "auto_impl", @@ -3359,9 +3406,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.149.5" +version = "0.152.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20af228a0b4fd94d1f86fe20f50eed3db7a635d99c0a2f62a37db0165877c54b" +checksum = "fe8f12315d3809cc05373b897bac02dc8afb5ee20f7212c6c4a14c039c8f905f" dependencies = [ "ahash", "arrayvec", @@ -3370,6 +3417,7 @@ dependencies = [ "num_cpus", "once_cell", "parking_lot", + "rayon", "regex", "retain_mut", "rustc-hash", @@ -3392,9 +3440,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.118.0" +version = "0.118.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fe54d8da755f649c81337de073f393eb852d9194a19dfbeebaada772265730" +checksum = "da59bf24d3284fd5a93d0aee8f16d618ab43f032f7bdf9985553f4ba26584377" dependencies = [ "either", "enum_kind", @@ -3411,9 +3459,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.164.0" +version = "0.167.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280e9f05ff2f71557fbb11bedf9fc0d97c99430bb166a44c7579d3253222069a" +checksum = "f3d37f5aecc5e4e809946ea76021c00c80ca797471c1b1d36e9225643c999b36" dependencies = [ "ahash", "anyhow", @@ -3436,9 +3484,9 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d944ab3648cc232351f392dce160b3d9d4c8a61dd3d95116620dc275bf45c" +checksum = "3a333f88b7a6e373fe94911f145064044ab1ffb6f2dfd4bcd36ac7ea90026fa6" dependencies = [ "anyhow", "hex", @@ -3452,9 +3500,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.188.0" +version = "0.191.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99ac26bea51c8145672b05342762ccbda59f6aaa12be172e23630d5eaf0fee5" +checksum = "7ca874b86485f26b882110bc711e718707a28aeb8528b1880e46923f619706bc" dependencies = [ "swc_atoms", "swc_common", @@ -3472,15 +3520,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.104.4" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485bb1aa80d43bd1cb1bb6c772d9a00afe904e98cd270203170f37d14d08fca7" +checksum = "45307774c27a152841aa2d9a05c583f3205b7676c20c715de248f95504e186a0" dependencies = [ "better_scoped_tls", "bitflags", "num_cpus", "once_cell", "phf", + "rayon", "rustc-hash", "serde", "smallvec", @@ -3495,9 +3544,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.93.0" +version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5368a6459a31def42c29a8d0e5ebaafdbe9c731b244a2deb976151d12e37fe4" +checksum = "6bd6ef2fe490311bb13898a464f2a582374c50f81996fbcce7358674522f992a" dependencies = [ "swc_atoms", "swc_common", @@ -3509,9 +3558,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.127.1" +version = "0.129.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f966e234a9c7055c0d3eeb7c24fa8d93a6afeca8ef7b0ffd5a59a5b33d81ded" +checksum = "3dce692c9efbfebbc068253eb4d1f97f18809878e4a3d6a85a6900cc507bf08c" dependencies = [ "ahash", "arrayvec", @@ -3519,6 +3568,7 @@ dependencies = [ "is-macro", "num-bigint", "ordered-float", + "rayon", "serde", "smallvec", "swc_atoms", @@ -3549,9 +3599,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.144.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa5672ebdbbf88ea320a34ec29d39f63f05eac9efb07a08197ca35b74f035a" +checksum = "e39d8eca155d211e191d8b3a3ba44908d6aaa82e82152fca73524382e68d9fb3" dependencies = [ "Inflector", "ahash", @@ -3577,14 +3627,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.157.0" +version = "0.160.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e7c25e5f99cd1b995b79e1c902eae759f1ef3edec2f3ee1541409536bc79ea" +checksum = "335fee948f661aa28eaaa438113f5cb28d1128cfbefe47eb3ee8f7f5b2734c73" dependencies = [ "ahash", "dashmap", "indexmap", "once_cell", + "petgraph", + "rayon", "rustc-hash", "serde_json", "swc_atoms", @@ -3595,14 +3647,15 @@ dependencies = [ "swc_ecma_transforms_macros", "swc_ecma_utils", "swc_ecma_visit", + "swc_fast_graph", "tracing", ] [[package]] name = "swc_ecma_transforms_proposal" -version = "0.135.0" +version = "0.137.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1813b60e0551ced3ae9390dad688977c0e8fb8c4041ae5d72b8afd76f06fb4c7" +checksum = "fb2b44281820a732b88b26da3448846ac82e6338af133928b7a879b14ea40e59" dependencies = [ "either", "serde", @@ -3619,15 +3672,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.146.0" +version = "0.148.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524ccc5d330f8077fe5709a6cab42b14a67c8ccd6e478adbdf55489f173e7b82" +checksum = "b148e31430d71af020a9eaed963f55126a150036a8de708fcfd03e6a1b852159" dependencies = [ "ahash", "base64 0.13.0", "dashmap", "indexmap", "once_cell", + "rayon", "regex", "serde", "sha-1 0.10.0", @@ -3645,9 +3699,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.106.0" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539895744adcdbec7f43dcd6018a55f5398edc327f0bd556d79072a382152e50" +checksum = "780945cfbf7755795b5c5d2755c28c17a9cb87ce2549e3597eae66967d63053b" dependencies = [ "ansi_term", "anyhow", @@ -3669,9 +3723,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.150.0" +version = "0.152.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d364022ebccdc1e6fb831e7a43da31a77200c0aecde4a143f0065af4185003" +checksum = "8acba735ad42b7658045c7bb43b8989dfe2681c97b627f264b760d4ca300e670" dependencies = [ "serde", "swc_atoms", @@ -3685,12 +3739,13 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.100.3" +version = "0.101.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7509f6aac102d8c2b8d5d3f63d84a6a5149b291d853cf4c0890400b7660d151" +checksum = "64bf09a91b69dc0ffa57a7bde2a8131be8dbe09997e95b9a51b08ba76e7384fb" dependencies = [ "indexmap", "once_cell", + "rayon", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -3713,24 +3768,9 @@ dependencies = [ "tracing", ] -[[package]] -name = "swc_ecmascript" -version = "0.195.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a7c5341e4a940caf5fbbb86c3474441731dc9de4a446900c075d730f9e01d9d" -dependencies = [ - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_minifier", - "swc_ecma_parser", - "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", -] - [[package]] name = "swc_emotion" -version = "0.19.0" +version = "0.17.0" dependencies = [ "base64 0.13.0", "byteorder", @@ -3741,12 +3781,7 @@ dependencies = [ "serde", "serde_json", "sourcemap", - "swc_atoms", - "swc_common", - "swc_ecma_transforms_react", - "swc_ecma_transforms_testing", - "swc_ecmascript", - "swc_trace_macro", + "swc_core", "testing", "tracing", ] @@ -3778,9 +3813,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0ff4fa987b8722801a7789563b8cbc71058027f2f2cc4e7e95876a0cc4960" +checksum = "056b5c705601d607480e67add408af73144712b445db5872ee2483d76acffb55" dependencies = [ "ahash", "indexmap", @@ -3916,13 +3951,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.92" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -4013,18 +4048,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", @@ -4088,9 +4123,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45" dependencies = [ "itoa", "libc", @@ -4322,6 +4357,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4285d92be83dfbc8950a2601178b89ed36f979ebf51bfcf7b272b17001184e6c" +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + [[package]] name = "unicode-linebreak" version = "0.1.2" @@ -4346,12 +4387,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "unreachable" version = "0.1.1" @@ -4402,6 +4437,21 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "vergen" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffa80ed519f45995741e70664d4abcf147d2a47b8c7ea0a4aa495548ef9474f" +dependencies = [ + "anyhow", + "cfg-if 1.0.0", + "enum-iterator 1.2.0", + "getset", + "rustversion", + "thiserror", + "time 0.3.13", +] + [[package]] name = "version_check" version = "0.9.4" @@ -4461,15 +4511,10 @@ dependencies = [ "path-clean", "serde", "serde_json", - "swc", - "swc_common", - "swc_ecmascript", - "swc_plugin_runner", + "swc_core", "tracing", "wasm-bindgen", "wasm-bindgen-futures", - "wasmer", - "wasmer-wasi", ] [[package]] @@ -4501,9 +4546,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.22" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -4673,7 +4718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" dependencies = [ "cfg-if 1.0.0", - "enum-iterator", + "enum-iterator 0.7.0", "enumset", "leb128", "libloading", @@ -4718,7 +4763,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" dependencies = [ - "enum-iterator", + "enum-iterator 0.7.0", "enumset", "loupe", "rkyv", @@ -4747,7 +4792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" dependencies = [ "backtrace", - "enum-iterator", + "enum-iterator 0.7.0", "indexmap", "loupe", "more-asserts", @@ -4778,7 +4823,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "corosensei", - "enum-iterator", + "enum-iterator 0.7.0", "indexmap", "lazy_static", "libc", diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index 2e487cffc68c2..9ee301a9b1a0f 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib", "rlib"] [features] plugin = [ - "swc/plugin" + "swc_core/plugin_transform_host_native" ] [dependencies] @@ -26,18 +26,26 @@ swc_emotion = {path="../emotion"} styled_components = {path="../styled_components"} styled_jsx = {path="../styled_jsx"} modularize_imports = {path="../modularize_imports"} -swc = "0.221.0" -swc_atoms = "0.4.8" -swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] } -swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.73.1", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] } -swc_cached = "0.3.5" tracing = { version = "0.1.32", features = ["release_max_level_info"] } -wasmer = { version = "2.3.0", optional = true, default-features = false } -wasmer-wasi = { version = "2.3.0", optional = true, default-features = false } + +swc_core = { version = "0.20.2", features = [ + "common_concurrent", + "ecma_ast", + "ecma_visit", + "ecma_loader_node", + "ecma_loader_lru", + "ecma_utils", + "ecma_minifier", + "ecma_transforms", + "ecma_transforms_react", + "ecma_transforms_typescript", + "ecma_parser", + "ecma_parser_typescript", + "cached", + "base_concurrent" # concurrent? +] } [dev-dependencies] -swc_ecma_transforms_testing = "0.106.0" +swc_core = { version = "0.20.2", features = ["testing_transform"] } testing = "0.29.4" walkdir = "2.3.2" diff --git a/packages/next-swc/crates/core/src/amp_attributes.rs b/packages/next-swc/crates/core/src/amp_attributes.rs index a5935641edd92..ebb576a3ad0e0 100644 --- a/packages/next-swc/crates/core/src/amp_attributes.rs +++ b/packages/next-swc/crates/core/src/amp_attributes.rs @@ -1,8 +1,8 @@ -use swc_atoms::JsWord; -use swc_ecmascript::ast::{ - Ident, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXElementName, JSXOpeningElement, +use swc_core::{ + ast::{Ident, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXElementName, JSXOpeningElement}, + atoms::JsWord, + visit::Fold, }; -use swc_ecmascript::visit::Fold; pub fn amp_attributes() -> impl Fold { AmpAttributePatcher::default() diff --git a/packages/next-swc/crates/core/src/auto_cjs/mod.rs b/packages/next-swc/crates/core/src/auto_cjs/mod.rs index 7e49265de7e5b..dfbc3f8b97d6a 100644 --- a/packages/next-swc/crates/core/src/auto_cjs/mod.rs +++ b/packages/next-swc/crates/core/src/auto_cjs/mod.rs @@ -1,4 +1,4 @@ -use swc_ecmascript::{ +use swc_core::{ ast::*, visit::{Visit, VisitWith}, }; diff --git a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs index 2d0871952e1de..01c3635bcd703 100644 --- a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs +++ b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs @@ -1,7 +1,9 @@ -use swc_common::errors::HANDLER; -use swc_common::pass::Optional; -use swc_ecmascript::ast::ExportAll; -use swc_ecmascript::visit::{noop_fold_type, Fold}; +use swc_core::{ + ast::ExportAll, + common::errors::HANDLER, + transforms::pass::Optional, + visit::{noop_fold_type, Fold}, +}; pub fn disallow_re_export_all_in_page(is_page_file: bool) -> impl Fold { Optional::new(DisallowReExportAllInPage, is_page_file) diff --git a/packages/next-swc/crates/core/src/hook_optimizer.rs b/packages/next-swc/crates/core/src/hook_optimizer.rs index 6c95deb9740e0..9db1b2941e119 100644 --- a/packages/next-swc/crates/core/src/hook_optimizer.rs +++ b/packages/next-swc/crates/core/src/hook_optimizer.rs @@ -1,10 +1,12 @@ -use swc_atoms::JsWord; -use swc_common::DUMMY_SP; -use swc_ecmascript::ast::{ - ArrayPat, Callee, Decl, Expr, Ident, ImportDecl, ImportSpecifier, KeyValuePatProp, Number, - ObjectPat, ObjectPatProp, Pat, PropName, VarDecl, VarDeclarator, +use swc_core::{ + ast::{ + ArrayPat, Callee, Decl, Expr, Ident, ImportDecl, ImportSpecifier, KeyValuePatProp, Number, + ObjectPat, ObjectPatProp, Pat, PropName, VarDecl, VarDeclarator, + }, + atoms::JsWord, + common::DUMMY_SP, + visit::{Fold, FoldWith}, }; -use swc_ecmascript::visit::{Fold, FoldWith}; pub fn hook_optimizer() -> impl Fold { HookOptimizer::default() @@ -72,7 +74,7 @@ impl HookOptimizer { } = &decl; let init_clone = init.clone(); if let Pat::Array(a) = name { - if let Expr::Call(c) = &*init.as_deref().unwrap() { + if let Expr::Call(c) = init.as_deref().unwrap() { if let Callee::Expr(i) = &c.callee { if let Expr::Ident(Ident { sym, .. }) = &**i { if self.hooks.contains(sym) { diff --git a/packages/next-swc/crates/core/src/lib.rs b/packages/next-swc/crates/core/src/lib.rs index 98190b487a621..3e7c2d380e72e 100644 --- a/packages/next-swc/crates/core/src/lib.rs +++ b/packages/next-swc/crates/core/src/lib.rs @@ -36,14 +36,15 @@ use serde::Deserialize; use std::cell::RefCell; use std::rc::Rc; use std::{path::PathBuf, sync::Arc}; -use swc::config::ModuleConfig; -use swc_common::comments::Comments; -use swc_common::{self, chain, pass::Optional}; -use swc_common::{FileName, SourceFile, SourceMap}; -use swc_ecmascript::ast::EsVersion; -use swc_ecmascript::parser::parse_file_as_module; -use swc_ecmascript::transforms::pass::noop; -use swc_ecmascript::visit::Fold; + +use swc_core::{ + ast::EsVersion, + base::config::ModuleConfig, + common::{chain, comments::Comments, pass::Optional, FileName, SourceFile, SourceMap}, + parser::parse_file_as_module, + transforms::pass::noop, + visit::Fold, +}; pub mod amp_attributes; mod auto_cjs; @@ -63,7 +64,7 @@ mod top_level_binding_collector; #[serde(rename_all = "camelCase")] pub struct TransformOptions { #[serde(flatten)] - pub swc: swc::config::Options, + pub swc: swc_core::base::config::Options, #[serde(default)] pub disable_next_ssg: bool, diff --git a/packages/next-swc/crates/core/src/next_dynamic.rs b/packages/next-swc/crates/core/src/next_dynamic.rs index 7b82bcaef2e3c..b3f892cbec601 100644 --- a/packages/next-swc/crates/core/src/next_dynamic.rs +++ b/packages/next-swc/crates/core/src/next_dynamic.rs @@ -1,16 +1,18 @@ use std::path::{Path, PathBuf}; use pathdiff::diff_paths; -use swc_atoms::js_word; -use swc_common::errors::HANDLER; -use swc_common::{FileName, DUMMY_SP}; -use swc_ecmascript::ast::{ - ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, - ExprOrSpread, Id, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, - MemberProp, Null, ObjectLit, Prop, PropName, PropOrSpread, Str, Tpl, + +use swc_core::{ + ast::{ + ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, + ExprOrSpread, Id, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, + MemberProp, Null, ObjectLit, Prop, PropName, PropOrSpread, Str, Tpl, + }, + atoms::js_word, + common::{errors::HANDLER, FileName, DUMMY_SP}, + utils::ExprFactory, + visit::{Fold, FoldWith}, }; -use swc_ecmascript::utils::ExprFactory; -use swc_ecmascript::visit::{Fold, FoldWith}; pub fn next_dynamic( is_development: bool, diff --git a/packages/next-swc/crates/core/src/next_ssg.rs b/packages/next-swc/crates/core/src/next_ssg.rs index 9ea18dcb7b841..0a493a5f6d9f7 100644 --- a/packages/next-swc/crates/core/src/next_ssg.rs +++ b/packages/next-swc/crates/core/src/next_ssg.rs @@ -3,12 +3,16 @@ use fxhash::FxHashSet; use std::cell::RefCell; use std::mem::take; use std::rc::Rc; -use swc_common::errors::HANDLER; -use swc_common::pass::{Repeat, Repeated}; -use swc_common::DUMMY_SP; -use swc_ecmascript::ast::*; -use swc_ecmascript::visit::FoldWith; -use swc_ecmascript::visit::{noop_fold_type, Fold}; + +use swc_core::{ + ast::*, + common::{ + errors::HANDLER, + pass::{Repeat, Repeated}, + DUMMY_SP, + }, + visit::{noop_fold_type, Fold, FoldWith}, +}; static SSG_EXPORTS: &[&str; 3] = &["getStaticProps", "getStaticPaths", "getServerSideProps"]; diff --git a/packages/next-swc/crates/core/src/page_config.rs b/packages/next-swc/crates/core/src/page_config.rs index 1747358557f8e..19de191d600ff 100644 --- a/packages/next-swc/crates/core/src/page_config.rs +++ b/packages/next-swc/crates/core/src/page_config.rs @@ -1,8 +1,10 @@ use chrono::Utc; -use swc_common::errors::HANDLER; -use swc_common::{Span, DUMMY_SP}; -use swc_ecmascript::ast::*; -use swc_ecmascript::visit::{Fold, FoldWith}; + +use swc_core::{ + ast::*, + common::{errors::HANDLER, Span, DUMMY_SP}, + visit::{Fold, FoldWith}, +}; pub fn page_config(is_development: bool, is_page_file: bool) -> impl Fold { PageConfig { diff --git a/packages/next-swc/crates/core/src/react_remove_properties.rs b/packages/next-swc/crates/core/src/react_remove_properties.rs index f2944795537d9..2ef344c83b4c5 100644 --- a/packages/next-swc/crates/core/src/react_remove_properties.rs +++ b/packages/next-swc/crates/core/src/react_remove_properties.rs @@ -1,7 +1,10 @@ use regex::Regex; use serde::Deserialize; -use swc_ecmascript::ast::*; -use swc_ecmascript::visit::{noop_fold_type, Fold, FoldWith}; + +use swc_core::{ + ast::*, + visit::{noop_fold_type, Fold, FoldWith}, +}; #[derive(Clone, Debug, Deserialize)] #[serde(untagged)] diff --git a/packages/next-swc/crates/core/src/relay.rs b/packages/next-swc/crates/core/src/relay.rs index 1f3f693e36d38..79ff1477eace7 100644 --- a/packages/next-swc/crates/core/src/relay.rs +++ b/packages/next-swc/crates/core/src/relay.rs @@ -2,12 +2,14 @@ use once_cell::sync::Lazy; use regex::Regex; use serde::Deserialize; use std::path::{Path, PathBuf}; -use swc_atoms::JsWord; -use swc_common::errors::HANDLER; -use swc_common::FileName; -use swc_ecmascript::ast::*; -use swc_ecmascript::utils::{quote_ident, ExprFactory}; -use swc_ecmascript::visit::{Fold, FoldWith}; + +use swc_core::{ + ast::*, + atoms::JsWord, + common::{errors::HANDLER, FileName}, + utils::{quote_ident, ExprFactory}, + visit::{Fold, FoldWith}, +}; #[derive(Copy, Clone, Debug, Deserialize)] #[serde(rename_all = "lowercase")] diff --git a/packages/next-swc/crates/core/src/remove_console.rs b/packages/next-swc/crates/core/src/remove_console.rs index 909cf5b5f3224..17c1a75b76c1a 100644 --- a/packages/next-swc/crates/core/src/remove_console.rs +++ b/packages/next-swc/crates/core/src/remove_console.rs @@ -1,9 +1,11 @@ use serde::Deserialize; -use swc_atoms::JsWord; -use swc_common::collections::AHashSet; -use swc_common::DUMMY_SP; -use swc_ecmascript::ast::*; -use swc_ecmascript::visit::{noop_fold_type, Fold, FoldWith}; + +use swc_core::{ + ast::*, + atoms::JsWord, + common::{collections::AHashSet, DUMMY_SP}, + visit::{noop_fold_type, Fold, FoldWith}, +}; use crate::top_level_binding_collector::collect_top_level_decls; diff --git a/packages/next-swc/crates/core/src/shake_exports.rs b/packages/next-swc/crates/core/src/shake_exports.rs index 23af7d12f9372..60ee858fbf78f 100644 --- a/packages/next-swc/crates/core/src/shake_exports.rs +++ b/packages/next-swc/crates/core/src/shake_exports.rs @@ -1,10 +1,12 @@ use serde::Deserialize; -use swc_atoms::js_word; -use swc_atoms::JsWord; -use swc_common::Mark; -use swc_ecmascript::ast::*; -use swc_ecmascript::transforms::optimization::simplify::dce::{dce, Config as DCEConfig}; -use swc_ecmascript::visit::{Fold, FoldWith}; + +use swc_core::{ + ast::*, + atoms::{js_word, JsWord}, + common::Mark, + transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, + visit::{Fold, FoldWith}, +}; #[derive(Clone, Debug, Deserialize)] pub struct Config { diff --git a/packages/next-swc/crates/core/src/top_level_binding_collector.rs b/packages/next-swc/crates/core/src/top_level_binding_collector.rs index b591a7f5e9c02..6ee3b810366e6 100644 --- a/packages/next-swc/crates/core/src/top_level_binding_collector.rs +++ b/packages/next-swc/crates/core/src/top_level_binding_collector.rs @@ -1,10 +1,11 @@ use std::hash::Hash; -use swc_common::{collections::AHashSet, SyntaxContext}; -use swc_ecmascript::{ + +use swc_core::{ ast::{ ClassDecl, FnDecl, Ident, ImportDefaultSpecifier, ImportNamedSpecifier, ImportStarAsSpecifier, ModuleItem, ObjectPatProp, Param, Pat, Stmt, VarDeclarator, }, + common::{collections::AHashSet, SyntaxContext}, utils::ident::IdentLike, visit::{noop_visit_type, Visit, VisitWith}, }; diff --git a/packages/next-swc/crates/core/tests/errors.rs b/packages/next-swc/crates/core/tests/errors.rs index bd73be935c66d..714a3a51f19d4 100644 --- a/packages/next-swc/crates/core/tests/errors.rs +++ b/packages/next-swc/crates/core/tests/errors.rs @@ -3,9 +3,11 @@ use next_swc::{ next_ssg::next_ssg, }; use std::path::PathBuf; -use swc_common::FileName; -use swc_ecma_transforms_testing::test_fixture_allowing_error; -use swc_ecmascript::parser::{EsConfig, Syntax}; +use swc_core::{ + common::FileName, + parser::{EsConfig, Syntax}, + testing_transform::test_fixture_allowing_error, +}; use testing::fixture; fn syntax() -> Syntax { diff --git a/packages/next-swc/crates/core/tests/fixture.rs b/packages/next-swc/crates/core/tests/fixture.rs index f6879aef8200a..ca02420f319dc 100644 --- a/packages/next-swc/crates/core/tests/fixture.rs +++ b/packages/next-swc/crates/core/tests/fixture.rs @@ -9,10 +9,10 @@ use next_swc::{ shake_exports::{shake_exports, Config as ShakeExportsConfig}, }; use std::path::PathBuf; -use swc_common::{chain, comments::SingleThreadedComments, FileName, Mark}; -use swc_ecma_transforms_testing::{test, test_fixture}; -use swc_ecmascript::{ +use swc_core::{ + common::{chain, comments::SingleThreadedComments, FileName, Mark}, parser::{EsConfig, Syntax}, + testing_transform::{test, test_fixture}, transforms::react::jsx, }; use testing::fixture; @@ -86,7 +86,7 @@ fn next_ssg_fixture(input: PathBuf) { let jsx = jsx::( tr.cm.clone(), None, - swc_ecmascript::transforms::react::Options { + swc_core::transforms::react::Options { next: false.into(), runtime: None, import_source: Some("".into()), diff --git a/packages/next-swc/crates/core/tests/full.rs b/packages/next-swc/crates/core/tests/full.rs index 8466972a49a03..ed4c46d1e166f 100644 --- a/packages/next-swc/crates/core/tests/full.rs +++ b/packages/next-swc/crates/core/tests/full.rs @@ -1,8 +1,8 @@ use next_swc::{custom_before_pass, TransformOptions}; use serde::de::DeserializeOwned; use std::path::{Path, PathBuf}; -use swc::Compiler; -use swc_ecmascript::{ +use swc_core::{ + base::Compiler, parser::{Syntax, TsConfig}, transforms::pass::noop, }; @@ -28,14 +28,14 @@ fn test(input: &Path, minify: bool) { let fm = cm.load_file(input).expect("failed to load file"); let options = TransformOptions { - swc: swc::config::Options { + swc: swc_core::base::config::Options { swcrc: true, output_path: Some(output.clone()), - config: swc::config::Config { - is_module: swc::config::IsModule::Bool(true), + config: swc_core::base::config::Config { + is_module: swc_core::base::config::IsModule::Bool(true), - jsc: swc::config::JscConfig { + jsc: swc_core::base::config::JscConfig { minify: if minify { Some(assert_json("{ \"compress\": true, \"mangle\": true }")) } else { diff --git a/packages/next-swc/crates/core/tests/telemetry.rs b/packages/next-swc/crates/core/tests/telemetry.rs index 52c073d366448..9d46f90a1bff0 100644 --- a/packages/next-swc/crates/core/tests/telemetry.rs +++ b/packages/next-swc/crates/core/tests/telemetry.rs @@ -5,9 +5,12 @@ use std::sync::Arc; use fxhash::FxHashSet; use next_swc::next_ssg::next_ssg; use once_cell::sync::Lazy; -use swc::{try_with_handler, Compiler}; -use swc_common::{FileName, FilePathMapping, SourceMap}; -use swc_ecmascript::transforms::pass::noop; + +use swc_core::{ + base::{try_with_handler, Compiler}, + common::{FileName, FilePathMapping, SourceMap}, + transforms::pass::noop, +}; static COMPILER: Lazy> = Lazy::new(|| { let cm = Arc::new(SourceMap::new(FilePathMapping::empty())); diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index 87e3b04bafd70..9adeb422570af 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -5,7 +5,7 @@ description = "AST Transforms for emotion" license = "Apache-2.0" name = "swc_emotion" repository = "https://github.com/vercel/next.js.git" -version = "0.19.0" +version = "0.17.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,14 +18,10 @@ radix_fmt = "1" regex = "1.5" serde = "1" sourcemap = "6.0.1" -swc_atoms = "0.4.8" -swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.195.0", features = ["codegen", "utils", "visit"] } -swc_trace_macro = "0.1.2" tracing = { version = "0.1.32", features = ["release_max_level_info"] } +swc_core = { version = "0.20.2", features = ["common_concurrent", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] } [dev-dependencies] -swc_ecma_transforms_testing = "0.106.0" +swc_core = { version = "0.20.2", features = ["testing_transform", "ecma_transforms_react"] } testing = "0.29.4" serde_json = "1" -swc_ecma_transforms_react = "0.146.0" diff --git a/packages/next-swc/crates/emotion/src/import_map.rs b/packages/next-swc/crates/emotion/src/import_map.rs index dc8cbdf0ab1da..4f832a1dcc3f0 100644 --- a/packages/next-swc/crates/emotion/src/import_map.rs +++ b/packages/next-swc/crates/emotion/src/import_map.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use swc_atoms::JsWord; -use swc_common::collections::AHashMap; + +use swc_core::{common::collections::AHashMap, ecma::atoms::JsWord}; use crate::{EmotionModuleConfig, ExportItem}; @@ -31,7 +31,7 @@ pub(crate) fn expand_import_map( .for_each(|(local_export_name, Config { canonical_import })| { let ImportItem(package_name, export_name) = canonical_import; - if &*package_name == "@emotion/react" && &*export_name == "jsx" { + if &**package_name == "@emotion/react" && &**export_name == "jsx" { return; } diff --git a/packages/next-swc/crates/emotion/src/lib.rs b/packages/next-swc/crates/emotion/src/lib.rs index 0059bf69cc331..7dd8675593110 100644 --- a/packages/next-swc/crates/emotion/src/lib.rs +++ b/packages/next-swc/crates/emotion/src/lib.rs @@ -8,23 +8,21 @@ use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; use sourcemap::{RawToken, SourceMap as RawSourcemap}; -use swc_atoms::JsWord; -use swc_common::comments::Comments; -use swc_common::util::take::Take; -use swc_common::{BytePos, SourceMapperDyn, DUMMY_SP}; -use swc_ecmascript::ast::{ - ArrayLit, CallExpr, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, JSXElementName, - JSXExpr, JSXExprContainer, JSXObject, ModuleExportName, SourceMapperExt, -}; -use swc_ecmascript::utils::ExprFactory; -use swc_ecmascript::{ - ast::{ - Callee, Expr, ExprOrSpread, Id, Ident, ImportDecl, ImportSpecifier, JSXElement, - KeyValueProp, MemberProp, ObjectLit, Pat, Prop, PropName, PropOrSpread, Tpl, VarDeclarator, +use swc_core::{ + common::{comments::Comments, util::take::Take, BytePos, SourceMapperDyn, DUMMY_SP}, + ecma::utils::ExprFactory, + ecma::visit::{Fold, FoldWith}, + ecma::{ + ast::{ + ArrayLit, CallExpr, Callee, Expr, ExprOrSpread, Id, Ident, ImportDecl, ImportSpecifier, + JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, JSXElement, JSXElementName, + JSXExpr, JSXExprContainer, JSXObject, KeyValueProp, MemberProp, ModuleExportName, + ObjectLit, Pat, Prop, PropName, PropOrSpread, SourceMapperExt, Tpl, VarDeclarator, + }, + atoms::JsWord, }, - visit::{Fold, FoldWith}, + trace_macro::swc_trace, }; -use swc_trace_macro::swc_trace; mod hash; mod import_map; diff --git a/packages/next-swc/crates/emotion/tests/fixture.rs b/packages/next-swc/crates/emotion/tests/fixture.rs index d9f878f7e69c5..1068a3d8cd158 100644 --- a/packages/next-swc/crates/emotion/tests/fixture.rs +++ b/packages/next-swc/crates/emotion/tests/fixture.rs @@ -1,8 +1,11 @@ use std::path::PathBuf; -use swc_common::{chain, comments::SingleThreadedComments, Mark}; -use swc_ecma_transforms_testing::test_fixture; -use swc_ecmascript::parser::{Syntax, TsConfig}; +use swc_core::{ + common::{chain, comments::SingleThreadedComments, Mark}, + ecma::parser::{Syntax, TsConfig}, + ecma::transforms::react::{jsx, Runtime}, + ecma::transforms::testing::test_fixture, +}; use swc_emotion::EmotionOptions; use testing::fixture; @@ -12,7 +15,6 @@ fn ts_syntax() -> Syntax { ..Default::default() }) } -use swc_ecma_transforms_react::{jsx, Runtime}; #[fixture("tests/fixture/**/input.tsx")] fn next_emotion_fixture(input: PathBuf) { @@ -24,7 +26,7 @@ fn next_emotion_fixture(input: PathBuf) { let jsx = jsx::( tr.cm.clone(), Some(tr.comments.as_ref().clone()), - swc_ecmascript::transforms::react::Options { + swc_core::ecma::transforms::react::Options { next: false.into(), runtime: Some(Runtime::Automatic), throw_if_namespace: false.into(), diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 72ab803b0a21e..24901b5ebebe0 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0" name = "modularize_imports" repository = "https://github.com/vercel/next.js.git" -version = "0.17.0" +version = "0.15.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,9 +15,8 @@ handlebars = "4.2.1" once_cell = "1.13.0" regex = "1.5" serde = "1" -swc_cached = "0.3.5" -swc_ecmascript = { version = "0.195.0", features = ["visit"] } +swc_core = { version = "0.20.2", features = ["cached", "ecma_ast", "ecma_visit"] } [dev-dependencies] -swc_ecma_transforms_testing = "0.106.0" +swc_core = { version = "0.20.2", features = ["testing_transform"] } testing = "0.29.4" diff --git a/packages/next-swc/crates/modularize_imports/src/lib.rs b/packages/next-swc/crates/modularize_imports/src/lib.rs index f76a78e2df627..d51779ede0d08 100644 --- a/packages/next-swc/crates/modularize_imports/src/lib.rs +++ b/packages/next-swc/crates/modularize_imports/src/lib.rs @@ -5,9 +5,12 @@ use handlebars::{Context, Handlebars, Helper, HelperResult, Output, RenderContex use once_cell::sync::Lazy; use regex::{Captures, Regex}; use serde::{Deserialize, Serialize}; -use swc_cached::regex::CachedRegex; -use swc_ecmascript::ast::*; -use swc_ecmascript::visit::{noop_fold_type, Fold}; + +use swc_core::{ + cached::regex::CachedRegex, + ecma::ast::*, + ecma::visit::{noop_fold_type, Fold}, +}; static DUP_SLASH_REGEX: Lazy = Lazy::new(|| Regex::new(r"//").unwrap()); diff --git a/packages/next-swc/crates/modularize_imports/tests/fixture.rs b/packages/next-swc/crates/modularize_imports/tests/fixture.rs index 7aeb9e20fef45..1f17c81978de1 100644 --- a/packages/next-swc/crates/modularize_imports/tests/fixture.rs +++ b/packages/next-swc/crates/modularize_imports/tests/fixture.rs @@ -1,8 +1,10 @@ use std::path::PathBuf; use modularize_imports::{modularize_imports, PackageConfig}; -use swc_ecma_transforms_testing::test_fixture; -use swc_ecmascript::parser::{EsConfig, Syntax}; +use swc_core::{ + ecma::parser::{EsConfig, Syntax}, + ecma::transforms::testing::test_fixture, +}; use testing::fixture; fn syntax() -> Syntax { diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 5dc06b57202c0..50d6beadfdfb0 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -14,10 +14,7 @@ default = [] # this is due to some of transitive dependencies have features cannot be enabled at the same time # (i.e wasmer/default vs wasmer/js-default) while cargo merges all the features at once. plugin = [ - "swc/plugin", - "swc_plugin_runner/default", - "wasmer/default", - "wasmer-wasi/default", + "swc_core/plugin_transform_host_native", "next-swc/plugin" ] sentry_native_tls = ["_sentry_native_tls"] @@ -33,20 +30,30 @@ next-swc = {version = "0.0.0", path = "../core"} once_cell = "1.13.0" serde = "1" serde_json = "1" -swc = "0.221.0" -swc_atoms = "0.4.8" -swc_bundler = { version = "0.182.0", features = ["concurrent"] } -swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] } -swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.73.1", optional = true } -swc_node_base = "0.5.5" +swc_core = { version = "0.20.2", features = [ + "allocator_node", + "base_concurrent", # concurrent? + "common_concurrent", + "ecma_ast", + "ecma_loader_node", + "ecma_loader_lru", + "bundler", + "bundler_concurrent", + "ecma_codegen", + "ecma_minifier", + "ecma_parser", + "ecma_parser_typescript", + "ecma_transforms", + "ecma_transforms_optimization", + "ecma_transforms_react", + "ecma_transforms_typescript", + "ecma_utils", + "ecma_visit" +] } tracing = { version = "0.1.32", features = ["release_max_level_info"] } tracing-futures = "0.2.5" tracing-subscriber = "0.3.9" tracing-chrome = "0.5.0" -wasmer = { version = "2.3.0", optional = true, default-features = false } -wasmer-wasi = { version = "2.3.0", optional = true, default-features = false } # There are few build targets we can't use native-tls which default features rely on, # allow to specify alternative (rustls) instead via features. # Note to opt in rustls default-features should be disabled diff --git a/packages/next-swc/crates/napi/src/bundle/mod.rs b/packages/next-swc/crates/napi/src/bundle/mod.rs index a573002efb046..6120bd41a164c 100644 --- a/packages/next-swc/crates/napi/src/bundle/mod.rs +++ b/packages/next-swc/crates/napi/src/bundle/mod.rs @@ -7,20 +7,20 @@ use napi::{CallContext, JsObject, Task}; use once_cell::sync::Lazy; use serde::Deserialize; use std::{collections::HashMap, path::PathBuf, sync::Arc}; -use swc::{config::SourceMapsConfig, try_with_handler, TransformOutput}; -use swc_atoms::JsWord; -use swc_bundler::{Bundler, ModuleData, ModuleRecord}; -use swc_common::{ - collections::AHashMap, - errors::{ColorConfig, Handler}, - BytePos, FileName, SourceMap, Span, -}; -use swc_ecma_loader::{ - resolvers::{lru::CachingResolver, node::NodeModulesResolver}, - TargetEnv, NODE_BUILTINS, -}; -use swc_ecmascript::{ +use swc_core::{ ast::*, + atoms::JsWord, + base::{config::SourceMapsConfig, try_with_handler, TransformOutput}, + bundler::{Bundler, ModuleData, ModuleRecord}, + common::{ + collections::AHashMap, + errors::{ColorConfig, Handler}, + BytePos, FileName, SourceMap, Span, + }, + loader::{ + resolvers::{lru::CachingResolver, node::NodeModulesResolver}, + TargetEnv, NODE_BUILTINS, + }, parser::{lexer::Lexer, EsConfig, Parser, StringInput, Syntax}, visit::{noop_visit_type, Visit, VisitWith}, }; @@ -44,7 +44,7 @@ struct BundleOption { } struct BundleTask { - c: Arc, + c: Arc, config: String, } @@ -58,7 +58,7 @@ impl Task for BundleTask { try_with_handler( self.c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, @@ -79,11 +79,11 @@ impl Task for BundleTask { handler, }, make_resolver(), - swc_bundler::Config { + swc_core::bundler::Config { require: true, disable_inliner: false, external_modules: builtins, - module: swc_bundler::ModuleType::Es, + module: swc_core::bundler::ModuleType::Es, ..Default::default() }, Box::new(CustomHook), @@ -156,7 +156,7 @@ struct CustomLoader<'a> { cm: Arc, } -impl swc_bundler::Load for CustomLoader<'_> { +impl swc_core::bundler::Load for CustomLoader<'_> { fn load(&self, f: &FileName) -> Result { let fm = match f { FileName::Real(path) => self.cm.load_file(path)?, @@ -188,7 +188,7 @@ impl swc_bundler::Load for CustomLoader<'_> { struct CustomHook; -impl swc_bundler::Hook for CustomHook { +impl swc_core::bundler::Hook for CustomHook { fn get_import_meta_props( &self, _span: Span, diff --git a/packages/next-swc/crates/napi/src/lib.rs b/packages/next-swc/crates/napi/src/lib.rs index e102cfbe7365e..eda87bc781107 100644 --- a/packages/next-swc/crates/napi/src/lib.rs +++ b/packages/next-swc/crates/napi/src/lib.rs @@ -32,14 +32,16 @@ DEALINGS IN THE SOFTWARE. #[macro_use] extern crate napi_derive; /// Explicit extern crate to use allocator. -extern crate swc_node_base; +extern crate swc_core; use backtrace::Backtrace; use fxhash::FxHashSet; use napi::{CallContext, Env, JsObject, JsUndefined}; use std::{env, panic::set_hook, sync::Arc}; -use swc::{Compiler, TransformOutput}; -use swc_common::{self, sync::Lazy, FilePathMapping, SourceMap}; +use swc_core::{ + base::{Compiler, TransformOutput}, + common::{sync::Lazy, FilePathMapping, SourceMap}, +}; mod bundle; mod minify; diff --git a/packages/next-swc/crates/napi/src/minify.rs b/packages/next-swc/crates/napi/src/minify.rs index 042373c653899..349fee4c76e3f 100644 --- a/packages/next-swc/crates/napi/src/minify.rs +++ b/packages/next-swc/crates/napi/src/minify.rs @@ -33,13 +33,15 @@ use fxhash::FxHashMap; use napi::{CallContext, JsObject, Task}; use serde::Deserialize; use std::sync::Arc; -use swc::{config::JsMinifyOptions, try_with_handler, TransformOutput}; -use swc_common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap}; +use swc_core::{ + base::{config::JsMinifyOptions, try_with_handler, TransformOutput}, + common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap}, +}; struct MinifyTask { - c: Arc, + c: Arc, code: MinifyTarget, - opts: swc::config::JsMinifyOptions, + opts: swc_core::base::config::JsMinifyOptions, } #[derive(Deserialize)] @@ -78,7 +80,7 @@ impl Task for MinifyTask { fn compute(&mut self) -> napi::Result { try_with_handler( self.c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, @@ -125,7 +127,7 @@ pub fn minify_sync(cx: CallContext) -> napi::Result { let output = try_with_handler( c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, diff --git a/packages/next-swc/crates/napi/src/parse.rs b/packages/next-swc/crates/napi/src/parse.rs index 3210443953e05..4119b3e3dc9bf 100644 --- a/packages/next-swc/crates/napi/src/parse.rs +++ b/packages/next-swc/crates/napi/src/parse.rs @@ -2,8 +2,10 @@ use crate::util::{deserialize_json, CtxtExt, MapErr}; use anyhow::Context as _; use napi::{CallContext, Either, Env, JsObject, JsString, JsUndefined, Task}; use std::sync::Arc; -use swc::{config::ParseOptions, try_with_handler}; -use swc_common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}; +use swc_core::{ + base::{config::ParseOptions, try_with_handler}, + common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}, +}; pub struct ParseTask { pub filename: FileName, @@ -20,7 +22,7 @@ impl Task for ParseTask { type JsValue = JsString; fn compute(&mut self) -> napi::Result { - let c = swc::Compiler::new(Arc::new(SourceMap::new(FilePathMapping::empty()))); + let c = swc_core::base::Compiler::new(Arc::new(SourceMap::new(FilePathMapping::empty()))); let options: ParseOptions = deserialize_json(&self.options).convert_err()?; let comments = c.comments().clone(); @@ -33,7 +35,7 @@ impl Task for ParseTask { c.cm.new_source_file(self.filename.clone(), self.src.clone()); let program = try_with_handler( c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, diff --git a/packages/next-swc/crates/napi/src/transform.rs b/packages/next-swc/crates/napi/src/transform.rs index ad97c0ed1b57f..bab5446bde7d4 100644 --- a/packages/next-swc/crates/napi/src/transform.rs +++ b/packages/next-swc/crates/napi/src/transform.rs @@ -42,9 +42,11 @@ use std::{ rc::Rc, sync::Arc, }; -use swc::{try_with_handler, Compiler, TransformOutput}; -use swc_common::{errors::ColorConfig, FileName}; -use swc_ecmascript::transforms::pass::noop; +use swc_core::{ + base::{try_with_handler, Compiler, TransformOutput}, + common::{errors::ColorConfig, FileName}, + transforms::pass::noop, +}; /// Input to transform #[derive(Debug)] @@ -70,7 +72,7 @@ impl Task for TransformTask { let res = catch_unwind(AssertUnwindSafe(|| { try_with_handler( self.c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index f95cd8ad1d9fa..6335f65517d73 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "styled_components" repository = "https://github.com/vercel/next.js.git" -version = "0.42.0" +version = "0.40.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,13 +15,19 @@ Inflector = "0.11.4" once_cell = "1.13.0" regex = {version = "1.5.4", features = ["std", "perf"], default-features = false} serde = {version = "1.0.130", features = ["derive"]} -swc_atoms = "0.4.8" -swc_common = { version = "0.27.13", features = ["concurrent"] } -swc_ecmascript = { version = "0.195.0", features = ["utils", "visit"] } tracing = "0.1.32" +swc_core = { version = "0.20.2", features = [ + "common_concurrent", + "ecma_ast", + "ecma_utils", + "ecma_visit" +] } [dev-dependencies] serde_json = "1" -swc_ecma_transforms_testing = "0.106.0" -swc_ecmascript = { version = "0.195.0", features = ["parser", "transforms"] } testing = "0.29.4" +swc_core = { version = "0.20.2", features = [ + "ecma_parser", + "ecma_transforms", + "testing_transform" +] } diff --git a/packages/next-swc/crates/styled_components/src/lib.rs b/packages/next-swc/crates/styled_components/src/lib.rs index 88a1fc6d20de7..975841f84ec3e 100644 --- a/packages/next-swc/crates/styled_components/src/lib.rs +++ b/packages/next-swc/crates/styled_components/src/lib.rs @@ -8,9 +8,11 @@ pub use crate::{ }; use serde::Deserialize; use std::{cell::RefCell, rc::Rc}; -use swc_atoms::JsWord; -use swc_common::{chain, pass::Optional, FileName}; -use swc_ecmascript::visit::{Fold, VisitMut}; +use swc_core::{ + common::{chain, pass::Optional, FileName}, + ecma::atoms::JsWord, + ecma::visit::{Fold, VisitMut}, +}; mod css; mod utils; diff --git a/packages/next-swc/crates/styled_components/src/utils/analyzer.rs b/packages/next-swc/crates/styled_components/src/utils/analyzer.rs index b6c4bca8d9e20..9336b6112aefa 100644 --- a/packages/next-swc/crates/styled_components/src/utils/analyzer.rs +++ b/packages/next-swc/crates/styled_components/src/utils/analyzer.rs @@ -1,9 +1,11 @@ use super::State; use crate::Config; use std::{cell::RefCell, rc::Rc}; -use swc_ecmascript::{ - ast::*, - visit::{as_folder, noop_visit_mut_type, noop_visit_type, Fold, Visit, VisitMut, VisitWith}, +use swc_core::{ + ecma::ast::*, + ecma::visit::{ + as_folder, noop_visit_mut_type, noop_visit_type, Fold, Visit, VisitMut, VisitWith, + }, }; pub fn analyzer(config: Rc, state: Rc>) -> impl VisitMut + Fold { diff --git a/packages/next-swc/crates/styled_components/src/utils/mod.rs b/packages/next-swc/crates/styled_components/src/utils/mod.rs index 754b4cc33449a..cdf498dbc88ce 100644 --- a/packages/next-swc/crates/styled_components/src/utils/mod.rs +++ b/packages/next-swc/crates/styled_components/src/utils/mod.rs @@ -1,8 +1,10 @@ pub use self::analyzer::{analyze, analyzer}; use std::{borrow::Cow, cell::RefCell}; -use swc_atoms::js_word; -use swc_common::{collections::AHashMap, SyntaxContext}; -use swc_ecmascript::ast::*; +use swc_core::{ + common::{collections::AHashMap, SyntaxContext}, + ecma::ast::*, + ecma::atoms::js_word, +}; mod analyzer; @@ -310,7 +312,11 @@ impl State { } pub fn prefix_leading_digit(s: &str) -> Cow { - if s.chars().next().map(|c| c.is_digit(10)).unwrap_or(false) { + if s.chars() + .next() + .map(|c| c.is_ascii_digit()) + .unwrap_or(false) + { Cow::Owned(format!("sc-{}", s)) } else { Cow::Borrowed(s) diff --git a/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs b/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs index 0b761ec51f1ba..1df6852878851 100644 --- a/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs +++ b/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs @@ -5,12 +5,12 @@ use crate::{ use once_cell::sync::Lazy; use regex::Regex; use std::{cell::RefCell, convert::TryInto, path::Path, rc::Rc}; -use swc_atoms::{js_word, JsWord}; -use swc_common::{util::take::Take, FileName, DUMMY_SP}; -use swc_ecmascript::{ - ast::*, - utils::{quote_ident, ExprFactory}, - visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith}, +use swc_core::{ + common::{util::take::Take, FileName, DUMMY_SP}, + ecma::ast::*, + ecma::atoms::{js_word, JsWord}, + ecma::utils::{quote_ident, ExprFactory}, + ecma::visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith}, }; use tracing::{debug, span, trace, Level}; diff --git a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/top_level_binding_collector.rs b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/top_level_binding_collector.rs index 85848cb124a27..78cbf49996d9e 100644 --- a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/top_level_binding_collector.rs +++ b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/top_level_binding_collector.rs @@ -1,10 +1,10 @@ -use swc_common::collections::AHashSet; -use swc_ecmascript::{ - ast::{ +use swc_core::{ + common::collections::AHashSet, + ecma::ast::{ ArrowExpr, ClassDecl, FnDecl, Function, Id, ImportDefaultSpecifier, ImportNamedSpecifier, ImportStarAsSpecifier, ObjectPatProp, Pat, VarDeclarator, }, - visit::{noop_visit_type, Visit, VisitWith}, + ecma::visit::{noop_visit_type, Visit, VisitWith}, }; // Modified from swc_ecma_utils/src/lib.rs:BindingCollector. diff --git a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs index 1396c9fedaf4a..26f621482c5c8 100644 --- a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs +++ b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs @@ -8,16 +8,16 @@ use crate::State; use inflector::Inflector; use once_cell::sync::Lazy; use regex::Regex; -use swc_atoms::{js_word, JsWord}; -use swc_common::{ - collections::{AHashMap, AHashSet}, - util::take::Take, - Spanned, DUMMY_SP, -}; -use swc_ecmascript::{ - ast::*, - utils::{prepend_stmt, private_ident, quote_ident, ExprFactory}, - visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith}, +use swc_core::{ + common::{ + collections::{AHashMap, AHashSet}, + util::take::Take, + Spanned, DUMMY_SP, + }, + ecma::ast::*, + ecma::atoms::{js_word, JsWord}, + ecma::utils::{prepend_stmt, private_ident, quote_ident, ExprFactory}, + ecma::visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith}, }; use crate::utils::{get_prop_key_as_expr, get_prop_name, get_prop_name2}; diff --git a/packages/next-swc/crates/styled_components/tests/fixture.rs b/packages/next-swc/crates/styled_components/tests/fixture.rs index 17c3183878cb7..e6191fe519cc4 100644 --- a/packages/next-swc/crates/styled_components/tests/fixture.rs +++ b/packages/next-swc/crates/styled_components/tests/fixture.rs @@ -2,11 +2,11 @@ use std::{fs::read_to_string, path::PathBuf}; use styled_components::{styled_components, Config}; -use swc_common::{chain, Mark}; -use swc_ecma_transforms_testing::test_fixture; -use swc_ecmascript::{ - parser::{EsConfig, Syntax}, - transforms::resolver, +use swc_core::{ + common::{chain, Mark}, + ecma::parser::{EsConfig, Syntax}, + ecma::transforms::resolver, + ecma::transforms::testing::test_fixture, }; #[testing::fixture("tests/fixtures/**/code.js")] diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index 5046278d9cdae..85292553a12ab 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -5,18 +5,29 @@ edition = "2018" license = "Apache-2.0" name = "styled_jsx" repository = "https://github.com/vercel/next.js.git" -version = "0.17.0" +version = "0.15.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] easy-error = "1.0.0" -swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_css = "0.121.0" -swc_css_prefixer = "0.119.1" -swc_ecmascript = { version = "0.195.0", features = ["parser", "minifier", "utils", "visit"] } tracing = "0.1.32" +swc_core = { version = "0.20.2", features = [ + "common_concurrent", + "css_ast", + "css_codegen", + "css_parser", + "css_prefixer", + "css_visit", + "ecma_parser", + "ecma_minifier", + "ecma_utils", + "ecma_visit" +] } + [dev-dependencies] -swc_ecma_transforms_testing = "0.106.0" testing = "0.29.4" +swc_core = { version = "0.20.2", features = [ + "testing_transform" +] } diff --git a/packages/next-swc/crates/styled_jsx/src/lib.rs b/packages/next-swc/crates/styled_jsx/src/lib.rs index ef64527b9f688..3750aa61ef649 100644 --- a/packages/next-swc/crates/styled_jsx/src/lib.rs +++ b/packages/next-swc/crates/styled_jsx/src/lib.rs @@ -3,16 +3,17 @@ use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; use std::mem::take; use std::sync::Arc; -use swc_common::errors::HANDLER; -use swc_common::{collections::AHashSet, FileName, SourceMap, Span, DUMMY_SP}; -use swc_ecmascript::ast::*; -use swc_ecmascript::minifier::{ - eval::{EvalResult, Evaluator}, - marks::Marks, + +use swc_core::{ + common::{collections::AHashSet, errors::HANDLER, FileName, SourceMap, Span, DUMMY_SP}, + ecma::ast::*, + ecma::minifier::{ + eval::{EvalResult, Evaluator}, + marks::Marks, + }, + ecma::utils::{collect_decls, drop_span, prepend_stmt, private_ident}, + ecma::visit::{Fold, FoldWith}, }; -use swc_ecmascript::utils::{collect_decls, prepend_stmt}; -use swc_ecmascript::utils::{drop_span, private_ident}; -use swc_ecmascript::visit::{Fold, FoldWith}; //use external::external_styles; use transform_css::transform_css; @@ -173,7 +174,7 @@ impl Fold for StyledJSXTransformer { if let JSXElementName::Ident(Ident { sym, span, .. }) = &el.name { if sym != "style" && sym != self.style_import_name.as_ref().unwrap() - && (!is_capitalized(&*sym) + && (!is_capitalized(&**sym) || self .nearest_scope_bindings .contains(&(sym.clone(), span.ctxt))) @@ -535,13 +536,13 @@ impl StyledJSXTransformer { } } - return JSXStyle::Local(LocalStyle { + JSXStyle::Local(LocalStyle { hash: format!("{:x}", hasher.finish()), css, css_span, is_dynamic, expressions, - }); + }) } fn replace_jsx_style(&mut self, el: &JSXElement) -> Result { diff --git a/packages/next-swc/crates/styled_jsx/src/transform_css.rs b/packages/next-swc/crates/styled_jsx/src/transform_css.rs index 8ebb1f32bf62f..aae5378d0adfd 100644 --- a/packages/next-swc/crates/styled_jsx/src/transform_css.rs +++ b/packages/next-swc/crates/styled_jsx/src/transform_css.rs @@ -1,22 +1,27 @@ use easy_error::{bail, Error}; use std::panic; use std::sync::Arc; -use swc_common::errors::HANDLER; -use swc_common::util::take::Take; -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}, - CodeGenerator, CodegenConfig, Emit, -}; -use swc_css::parser::{parse_str, parse_tokens, parser::ParserConfig}; -use swc_css::visit::{VisitMut, VisitMutWith}; -use swc_css_prefixer::prefixer; -use swc_ecmascript::ast::{Expr, Tpl, TplElement}; -use swc_ecmascript::parser::StringInput; use tracing::{debug, trace}; +use swc_core::{ + common::{ + errors::HANDLER, source_map::Pos, util::take::Take, BytePos, SourceMap, Span, Spanned, + SyntaxContext, DUMMY_SP, + }, + css::prefixer::prefixer, + css::{ + ast::*, + codegen::{ + writer::basic::{BasicCssWriter, BasicCssWriterConfig}, + CodeGenerator, CodegenConfig, Emit, + }, + parser::{parse_str, parse_tokens, parser::ParserConfig}, + visit::{VisitMut, VisitMutWith}, + }, + ecma::ast::{Expr, Tpl, TplElement}, + ecma::parser::StringInput, +}; + use super::{hash_string, string_literal_expr, LocalStyle}; pub fn transform_css( @@ -110,7 +115,7 @@ pub fn transform_css( /// Returns `(length, value)` fn read_number(s: &str) -> (usize, usize) { for (idx, c) in s.char_indices() { - if c.is_digit(10) { + if c.is_ascii_digit() { continue; } @@ -219,6 +224,12 @@ impl Namespacer { to_tokens(v).tokens } PseudoClassSelectorChildren::CompoundSelector(v) => to_tokens(v).tokens, + PseudoClassSelectorChildren::ForgivingSelectorList(v) => { + to_tokens(v).tokens + } + PseudoClassSelectorChildren::ForgivingRelativeSelectorList(v) => { + to_tokens(v).tokens + } }) .collect::>(); @@ -501,7 +512,7 @@ where } let span = node.span(); - let lexer = swc_css::parser::lexer::Lexer::new( + let lexer = swc_core::css::parser::lexer::Lexer::new( StringInput::new(&s, span.lo, span.hi), ParserConfig { allow_wrong_line_comments: true, diff --git a/packages/next-swc/crates/styled_jsx/src/utils.rs b/packages/next-swc/crates/styled_jsx/src/utils.rs index bc720b16af38b..ed21735336170 100644 --- a/packages/next-swc/crates/styled_jsx/src/utils.rs +++ b/packages/next-swc/crates/styled_jsx/src/utils.rs @@ -1,7 +1,6 @@ use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; -use swc_common::DUMMY_SP; -use swc_ecmascript::ast::*; +use swc_core::{common::DUMMY_SP, ecma::ast::*}; use super::{ExternalStyle, JSXStyle, LocalStyle}; diff --git a/packages/next-swc/crates/styled_jsx/tests/fixture.rs b/packages/next-swc/crates/styled_jsx/tests/fixture.rs index 476f22ebf0280..1805d9ff942fd 100644 --- a/packages/next-swc/crates/styled_jsx/tests/fixture.rs +++ b/packages/next-swc/crates/styled_jsx/tests/fixture.rs @@ -1,10 +1,10 @@ use std::path::PathBuf; use styled_jsx::styled_jsx; -use swc_common::{chain, FileName, Mark, Span, DUMMY_SP}; -use swc_ecma_transforms_testing::{test_fixture, test_fixture_allowing_error}; -use swc_ecmascript::{ +use swc_core::{ + common::{chain, FileName, Mark, Span, DUMMY_SP}, parser::{EsConfig, Syntax}, + testing_transform::{test_fixture, test_fixture_allowing_error}, transforms::resolver, }; use testing::fixture; @@ -60,7 +60,7 @@ fn styled_jsx_fixture(input: PathBuf) { } pub struct DropSpan; -impl swc_ecmascript::visit::VisitMut for DropSpan { +impl swc_core::visit::VisitMut for DropSpan { fn visit_mut_span(&mut self, span: &mut Span) { *span = DUMMY_SP } diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index cf8095858be20..a45eb5164cf16 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -8,12 +8,12 @@ version = "0.0.0" crate-type = ["cdylib"] [features] +default = ["swc_v1"] +swc_v1 = [] + plugin = [ - "swc/plugin", - "swc_plugin_runner/memory_cache", - "wasmer/js-default", - "wasmer-wasi/js-default", - "getrandom/js" + "getrandom/js", + "swc_core/plugin_transform_host_js" ] [dependencies] @@ -25,14 +25,23 @@ parking_lot_core = "=0.8.0" path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" -swc = "0.221.0" -swc_common = { version = "0.27.13", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.195.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } -swc_plugin_runner = { version = "0.73.1", default-features = false, optional = true } tracing = { version = "0.1.32", features = ["release_max_level_off"] } wasm-bindgen = {version = "0.2", features = ["serde-serialize", "enable-interning"]} wasm-bindgen-futures = "0.4.8" -wasmer = { version = "2.3.0", optional = true, default-features = false } -wasmer-wasi = { version = "2.3.0", optional = true, default-features = false } getrandom = { version = "0.2.5", optional = true, default-features = false } js-sys = "0.3.59" + +swc_core = { version = "0.20.2", features = [ + "common_concurrent", + "binding_macro_wasm", + "ecma_codegen", + "ecma_minifier", + "ecma_transforms", + "ecma_transforms_typescript", + "ecma_transforms_optimization", + "ecma_transforms_react", + "ecma_parser", + "ecma_parser_typescript", + "ecma_utils", + "ecma_visit" +] } diff --git a/packages/next-swc/crates/wasm/src/lib.rs b/packages/next-swc/crates/wasm/src/lib.rs index e6b0c73314189..9497620ff4962 100644 --- a/packages/next-swc/crates/wasm/src/lib.rs +++ b/packages/next-swc/crates/wasm/src/lib.rs @@ -3,12 +3,15 @@ use js_sys::JsString; use next_swc::{custom_before_pass, TransformOptions}; use once_cell::sync::Lazy; use std::sync::Arc; -use swc::{config::JsMinifyOptions, config::ParseOptions, try_with_handler, Compiler}; -use swc_common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}; -use swc_ecmascript::transforms::pass::noop; use wasm_bindgen::{prelude::*, JsCast}; use wasm_bindgen_futures::future_to_promise; +use swc_core::{ + base::{config::JsMinifyOptions, config::ParseOptions, try_with_handler, Compiler}, + common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}, + transforms::pass::noop, +}; + fn convert_err(err: Error) -> JsValue { format!("{:?}", err).into() } @@ -21,7 +24,7 @@ pub fn minify_sync(s: JsString, opts: JsValue) -> Result { try_with_handler( c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, @@ -54,7 +57,7 @@ pub fn transform_sync(s: JsValue, opts: JsValue) -> Result { try_with_handler( c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, @@ -112,11 +115,11 @@ pub fn transform(s: JsValue, opts: JsValue) -> js_sys::Promise { pub fn parse_sync(s: JsString, opts: JsValue) -> Result { console_error_panic_hook::set_once(); - let c = swc::Compiler::new(Arc::new(SourceMap::new(FilePathMapping::empty()))); + let c = swc_core::base::Compiler::new(Arc::new(SourceMap::new(FilePathMapping::empty()))); try_with_handler( c.cm.clone(), - swc::HandlerOpts { + swc_core::base::HandlerOpts { ..Default::default() }, |handler| { diff --git a/packages/next-swc/rust-toolchain b/packages/next-swc/rust-toolchain index 4e7e21b019626..928512b397cc7 100644 --- a/packages/next-swc/rust-toolchain +++ b/packages/next-swc/rust-toolchain @@ -1 +1 @@ -nightly-2022-02-23 \ No newline at end of file +nightly-2022-06-12 \ No newline at end of file From eb8efd8f690f3df0633a0ba8e5277e35a0ecdc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 00:31:04 +0900 Subject: [PATCH 16/23] fixup --- packages/next-swc/crates/core/src/amp_attributes.rs | 6 +++--- packages/next-swc/crates/core/src/auto_cjs/mod.rs | 4 ++-- .../crates/core/src/disallow_re_export_all_in_page.rs | 6 +++--- packages/next-swc/crates/core/src/hook_optimizer.rs | 8 ++++---- packages/next-swc/crates/core/src/lib.rs | 8 ++++---- packages/next-swc/crates/core/src/next_dynamic.rs | 10 +++++----- packages/next-swc/crates/core/src/next_ssg.rs | 4 ++-- packages/next-swc/crates/core/src/page_config.rs | 4 ++-- .../crates/core/src/react_remove_properties.rs | 4 ++-- packages/next-swc/crates/core/src/relay.rs | 8 ++++---- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/next-swc/crates/core/src/amp_attributes.rs b/packages/next-swc/crates/core/src/amp_attributes.rs index ebb576a3ad0e0..386980d5e4653 100644 --- a/packages/next-swc/crates/core/src/amp_attributes.rs +++ b/packages/next-swc/crates/core/src/amp_attributes.rs @@ -1,7 +1,7 @@ use swc_core::{ - ast::{Ident, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXElementName, JSXOpeningElement}, - atoms::JsWord, - visit::Fold, + ecma::ast::{Ident, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXElementName, JSXOpeningElement}, + ecma::atoms::JsWord, + ecma::visit::Fold, }; pub fn amp_attributes() -> impl Fold { diff --git a/packages/next-swc/crates/core/src/auto_cjs/mod.rs b/packages/next-swc/crates/core/src/auto_cjs/mod.rs index dfbc3f8b97d6a..0859f9ebe11e0 100644 --- a/packages/next-swc/crates/core/src/auto_cjs/mod.rs +++ b/packages/next-swc/crates/core/src/auto_cjs/mod.rs @@ -1,6 +1,6 @@ use swc_core::{ - ast::*, - visit::{Visit, VisitWith}, + ecma::ast::*, + ecma::visit::{Visit, VisitWith}, }; pub(crate) fn contains_cjs(m: &Module) -> bool { diff --git a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs index 01c3635bcd703..491aa16ee9352 100644 --- a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs +++ b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs @@ -1,8 +1,8 @@ use swc_core::{ - ast::ExportAll, common::errors::HANDLER, - transforms::pass::Optional, - visit::{noop_fold_type, Fold}, + ecma::ast::ExportAll, + ecma::transforms::pass::Optional, + ecma::visit::{noop_fold_type, Fold}, }; pub fn disallow_re_export_all_in_page(is_page_file: bool) -> impl Fold { diff --git a/packages/next-swc/crates/core/src/hook_optimizer.rs b/packages/next-swc/crates/core/src/hook_optimizer.rs index 9db1b2941e119..bf3acd39df647 100644 --- a/packages/next-swc/crates/core/src/hook_optimizer.rs +++ b/packages/next-swc/crates/core/src/hook_optimizer.rs @@ -1,11 +1,11 @@ use swc_core::{ - ast::{ + common::DUMMY_SP, + ecma::ast::{ ArrayPat, Callee, Decl, Expr, Ident, ImportDecl, ImportSpecifier, KeyValuePatProp, Number, ObjectPat, ObjectPatProp, Pat, PropName, VarDecl, VarDeclarator, }, - atoms::JsWord, - common::DUMMY_SP, - visit::{Fold, FoldWith}, + ecma::atoms::JsWord, + ecma::visit::{Fold, FoldWith}, }; pub fn hook_optimizer() -> impl Fold { diff --git a/packages/next-swc/crates/core/src/lib.rs b/packages/next-swc/crates/core/src/lib.rs index 3e7c2d380e72e..19214cd90d7ea 100644 --- a/packages/next-swc/crates/core/src/lib.rs +++ b/packages/next-swc/crates/core/src/lib.rs @@ -38,12 +38,12 @@ use std::rc::Rc; use std::{path::PathBuf, sync::Arc}; use swc_core::{ - ast::EsVersion, base::config::ModuleConfig, common::{chain, comments::Comments, pass::Optional, FileName, SourceFile, SourceMap}, - parser::parse_file_as_module, - transforms::pass::noop, - visit::Fold, + ecma::ast::EsVersion, + ecma::parser::parse_file_as_module, + ecma::transforms::pass::noop, + ecma::visit::Fold, }; pub mod amp_attributes; diff --git a/packages/next-swc/crates/core/src/next_dynamic.rs b/packages/next-swc/crates/core/src/next_dynamic.rs index b3f892cbec601..0bd30a6682b0e 100644 --- a/packages/next-swc/crates/core/src/next_dynamic.rs +++ b/packages/next-swc/crates/core/src/next_dynamic.rs @@ -3,15 +3,15 @@ use std::path::{Path, PathBuf}; use pathdiff::diff_paths; use swc_core::{ - ast::{ + common::{errors::HANDLER, FileName, DUMMY_SP}, + ecma::ast::{ ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, ExprOrSpread, Id, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, MemberProp, Null, ObjectLit, Prop, PropName, PropOrSpread, Str, Tpl, }, - atoms::js_word, - common::{errors::HANDLER, FileName, DUMMY_SP}, - utils::ExprFactory, - visit::{Fold, FoldWith}, + ecma::atoms::js_word, + ecma::utils::ExprFactory, + ecma::visit::{Fold, FoldWith}, }; pub fn next_dynamic( diff --git a/packages/next-swc/crates/core/src/next_ssg.rs b/packages/next-swc/crates/core/src/next_ssg.rs index 0a493a5f6d9f7..022885da76a9e 100644 --- a/packages/next-swc/crates/core/src/next_ssg.rs +++ b/packages/next-swc/crates/core/src/next_ssg.rs @@ -5,13 +5,13 @@ use std::mem::take; use std::rc::Rc; use swc_core::{ - ast::*, common::{ errors::HANDLER, pass::{Repeat, Repeated}, DUMMY_SP, }, - visit::{noop_fold_type, Fold, FoldWith}, + ecma::ast::*, + ecma::visit::{noop_fold_type, Fold, FoldWith}, }; static SSG_EXPORTS: &[&str; 3] = &["getStaticProps", "getStaticPaths", "getServerSideProps"]; diff --git a/packages/next-swc/crates/core/src/page_config.rs b/packages/next-swc/crates/core/src/page_config.rs index 19de191d600ff..213995e5ca52f 100644 --- a/packages/next-swc/crates/core/src/page_config.rs +++ b/packages/next-swc/crates/core/src/page_config.rs @@ -1,9 +1,9 @@ use chrono::Utc; use swc_core::{ - ast::*, common::{errors::HANDLER, Span, DUMMY_SP}, - visit::{Fold, FoldWith}, + ecma::ast::*, + ecma::visit::{Fold, FoldWith}, }; pub fn page_config(is_development: bool, is_page_file: bool) -> impl Fold { diff --git a/packages/next-swc/crates/core/src/react_remove_properties.rs b/packages/next-swc/crates/core/src/react_remove_properties.rs index 2ef344c83b4c5..5e4b03a6b754f 100644 --- a/packages/next-swc/crates/core/src/react_remove_properties.rs +++ b/packages/next-swc/crates/core/src/react_remove_properties.rs @@ -2,8 +2,8 @@ use regex::Regex; use serde::Deserialize; use swc_core::{ - ast::*, - visit::{noop_fold_type, Fold, FoldWith}, + ecma::ast::*, + ecma::visit::{noop_fold_type, Fold, FoldWith}, }; #[derive(Clone, Debug, Deserialize)] diff --git a/packages/next-swc/crates/core/src/relay.rs b/packages/next-swc/crates/core/src/relay.rs index 79ff1477eace7..934d9207716da 100644 --- a/packages/next-swc/crates/core/src/relay.rs +++ b/packages/next-swc/crates/core/src/relay.rs @@ -4,11 +4,11 @@ use serde::Deserialize; use std::path::{Path, PathBuf}; use swc_core::{ - ast::*, - atoms::JsWord, common::{errors::HANDLER, FileName}, - utils::{quote_ident, ExprFactory}, - visit::{Fold, FoldWith}, + ecma::ast::*, + ecma::atoms::JsWord, + ecma::utils::{quote_ident, ExprFactory}, + ecma::visit::{Fold, FoldWith}, }; #[derive(Copy, Clone, Debug, Deserialize)] From 7f34d7c81cd6a14dc315291bbfe82318801cb355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 00:31:45 +0900 Subject: [PATCH 17/23] fixup --- packages/next-swc/crates/core/src/remove_console.rs | 6 +++--- packages/next-swc/crates/core/src/shake_exports.rs | 8 ++++---- .../crates/core/src/top_level_binding_collector.rs | 8 ++++---- packages/next-swc/crates/core/tests/errors.rs | 4 ++-- packages/next-swc/crates/styled_jsx/tests/fixture.rs | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/next-swc/crates/core/src/remove_console.rs b/packages/next-swc/crates/core/src/remove_console.rs index 17c1a75b76c1a..0068cbe16034c 100644 --- a/packages/next-swc/crates/core/src/remove_console.rs +++ b/packages/next-swc/crates/core/src/remove_console.rs @@ -1,10 +1,10 @@ use serde::Deserialize; use swc_core::{ - ast::*, - atoms::JsWord, common::{collections::AHashSet, DUMMY_SP}, - visit::{noop_fold_type, Fold, FoldWith}, + ecma::ast::*, + ecma::atoms::JsWord, + ecma::visit::{noop_fold_type, Fold, FoldWith}, }; use crate::top_level_binding_collector::collect_top_level_decls; diff --git a/packages/next-swc/crates/core/src/shake_exports.rs b/packages/next-swc/crates/core/src/shake_exports.rs index 60ee858fbf78f..c08a19ea28ef9 100644 --- a/packages/next-swc/crates/core/src/shake_exports.rs +++ b/packages/next-swc/crates/core/src/shake_exports.rs @@ -1,11 +1,11 @@ use serde::Deserialize; use swc_core::{ - ast::*, - atoms::{js_word, JsWord}, common::Mark, - transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, - visit::{Fold, FoldWith}, + ecma::ast::*, + ecma::atoms::{js_word, JsWord}, + ecma::transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, + ecma::visit::{Fold, FoldWith}, }; #[derive(Clone, Debug, Deserialize)] diff --git a/packages/next-swc/crates/core/src/top_level_binding_collector.rs b/packages/next-swc/crates/core/src/top_level_binding_collector.rs index 6ee3b810366e6..1eef9229528d1 100644 --- a/packages/next-swc/crates/core/src/top_level_binding_collector.rs +++ b/packages/next-swc/crates/core/src/top_level_binding_collector.rs @@ -1,13 +1,13 @@ use std::hash::Hash; use swc_core::{ - ast::{ + common::{collections::AHashSet, SyntaxContext}, + ecma::ast::{ ClassDecl, FnDecl, Ident, ImportDefaultSpecifier, ImportNamedSpecifier, ImportStarAsSpecifier, ModuleItem, ObjectPatProp, Param, Pat, Stmt, VarDeclarator, }, - common::{collections::AHashSet, SyntaxContext}, - utils::ident::IdentLike, - visit::{noop_visit_type, Visit, VisitWith}, + ecma::utils::ident::IdentLike, + ecma::visit::{noop_visit_type, Visit, VisitWith}, }; // Modified from swc_ecma_utils/src/lib.rs:BindingCollector. diff --git a/packages/next-swc/crates/core/tests/errors.rs b/packages/next-swc/crates/core/tests/errors.rs index 714a3a51f19d4..6af191fe96da3 100644 --- a/packages/next-swc/crates/core/tests/errors.rs +++ b/packages/next-swc/crates/core/tests/errors.rs @@ -5,8 +5,8 @@ use next_swc::{ use std::path::PathBuf; use swc_core::{ common::FileName, - parser::{EsConfig, Syntax}, - testing_transform::test_fixture_allowing_error, + ecma::parser::{EsConfig, Syntax}, + ecma::transforms::testing::test_fixture_allowing_error, }; use testing::fixture; diff --git a/packages/next-swc/crates/styled_jsx/tests/fixture.rs b/packages/next-swc/crates/styled_jsx/tests/fixture.rs index 1805d9ff942fd..afb703d263798 100644 --- a/packages/next-swc/crates/styled_jsx/tests/fixture.rs +++ b/packages/next-swc/crates/styled_jsx/tests/fixture.rs @@ -3,9 +3,9 @@ use std::path::PathBuf; use styled_jsx::styled_jsx; use swc_core::{ common::{chain, FileName, Mark, Span, DUMMY_SP}, - parser::{EsConfig, Syntax}, - testing_transform::{test_fixture, test_fixture_allowing_error}, - transforms::resolver, + ecma::parser::{EsConfig, Syntax}, + ecma::transforms::resolver, + ecma::transforms::testing::{test_fixture, test_fixture_allowing_error}, }; use testing::fixture; From 162d7c6c55786ba54153a455367cdd192710711d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 00:32:32 +0900 Subject: [PATCH 18/23] fixup --- packages/next-swc/crates/core/tests/fixture.rs | 8 ++++---- packages/next-swc/crates/core/tests/full.rs | 4 ++-- packages/next-swc/crates/core/tests/telemetry.rs | 2 +- packages/next-swc/crates/napi/src/bundle/mod.rs | 10 +++++----- packages/next-swc/crates/napi/src/transform.rs | 2 +- packages/next-swc/crates/styled_jsx/tests/fixture.rs | 2 +- packages/next-swc/crates/wasm/src/lib.rs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/next-swc/crates/core/tests/fixture.rs b/packages/next-swc/crates/core/tests/fixture.rs index ca02420f319dc..0bdcb527860fd 100644 --- a/packages/next-swc/crates/core/tests/fixture.rs +++ b/packages/next-swc/crates/core/tests/fixture.rs @@ -11,9 +11,9 @@ use next_swc::{ use std::path::PathBuf; use swc_core::{ common::{chain, comments::SingleThreadedComments, FileName, Mark}, - parser::{EsConfig, Syntax}, - testing_transform::{test, test_fixture}, - transforms::react::jsx, + ecma::parser::{EsConfig, Syntax}, + ecma::transforms::react::jsx, + ecma::transforms::testing::{test, test_fixture}, }; use testing::fixture; @@ -86,7 +86,7 @@ fn next_ssg_fixture(input: PathBuf) { let jsx = jsx::( tr.cm.clone(), None, - swc_core::transforms::react::Options { + swc_core::ecma::transforms::react::Options { next: false.into(), runtime: None, import_source: Some("".into()), diff --git a/packages/next-swc/crates/core/tests/full.rs b/packages/next-swc/crates/core/tests/full.rs index ed4c46d1e166f..2c94e1bc22683 100644 --- a/packages/next-swc/crates/core/tests/full.rs +++ b/packages/next-swc/crates/core/tests/full.rs @@ -3,8 +3,8 @@ use serde::de::DeserializeOwned; use std::path::{Path, PathBuf}; use swc_core::{ base::Compiler, - parser::{Syntax, TsConfig}, - transforms::pass::noop, + ecma::parser::{Syntax, TsConfig}, + ecma::transforms::pass::noop, }; use testing::{NormalizedOutput, Tester}; diff --git a/packages/next-swc/crates/core/tests/telemetry.rs b/packages/next-swc/crates/core/tests/telemetry.rs index 9d46f90a1bff0..3ed93ca189f62 100644 --- a/packages/next-swc/crates/core/tests/telemetry.rs +++ b/packages/next-swc/crates/core/tests/telemetry.rs @@ -9,7 +9,7 @@ use once_cell::sync::Lazy; use swc_core::{ base::{try_with_handler, Compiler}, common::{FileName, FilePathMapping, SourceMap}, - transforms::pass::noop, + ecma::transforms::pass::noop, }; static COMPILER: Lazy> = Lazy::new(|| { diff --git a/packages/next-swc/crates/napi/src/bundle/mod.rs b/packages/next-swc/crates/napi/src/bundle/mod.rs index 6120bd41a164c..a9e0a66121f2c 100644 --- a/packages/next-swc/crates/napi/src/bundle/mod.rs +++ b/packages/next-swc/crates/napi/src/bundle/mod.rs @@ -8,8 +8,6 @@ use once_cell::sync::Lazy; use serde::Deserialize; use std::{collections::HashMap, path::PathBuf, sync::Arc}; use swc_core::{ - ast::*, - atoms::JsWord, base::{config::SourceMapsConfig, try_with_handler, TransformOutput}, bundler::{Bundler, ModuleData, ModuleRecord}, common::{ @@ -17,12 +15,14 @@ use swc_core::{ errors::{ColorConfig, Handler}, BytePos, FileName, SourceMap, Span, }, - loader::{ + ecma::ast::*, + ecma::atoms::JsWord, + ecma::loader::{ resolvers::{lru::CachingResolver, node::NodeModulesResolver}, TargetEnv, NODE_BUILTINS, }, - parser::{lexer::Lexer, EsConfig, Parser, StringInput, Syntax}, - visit::{noop_visit_type, Visit, VisitWith}, + ecma::parser::{lexer::Lexer, EsConfig, Parser, StringInput, Syntax}, + ecma::visit::{noop_visit_type, Visit, VisitWith}, }; #[js_function(1)] diff --git a/packages/next-swc/crates/napi/src/transform.rs b/packages/next-swc/crates/napi/src/transform.rs index bab5446bde7d4..1d19111177b88 100644 --- a/packages/next-swc/crates/napi/src/transform.rs +++ b/packages/next-swc/crates/napi/src/transform.rs @@ -45,7 +45,7 @@ use std::{ use swc_core::{ base::{try_with_handler, Compiler, TransformOutput}, common::{errors::ColorConfig, FileName}, - transforms::pass::noop, + ecma::transforms::pass::noop, }; /// Input to transform diff --git a/packages/next-swc/crates/styled_jsx/tests/fixture.rs b/packages/next-swc/crates/styled_jsx/tests/fixture.rs index afb703d263798..a46d8232fb3ec 100644 --- a/packages/next-swc/crates/styled_jsx/tests/fixture.rs +++ b/packages/next-swc/crates/styled_jsx/tests/fixture.rs @@ -60,7 +60,7 @@ fn styled_jsx_fixture(input: PathBuf) { } pub struct DropSpan; -impl swc_core::visit::VisitMut for DropSpan { +impl swc_core::ecma::visit::VisitMut for DropSpan { fn visit_mut_span(&mut self, span: &mut Span) { *span = DUMMY_SP } diff --git a/packages/next-swc/crates/wasm/src/lib.rs b/packages/next-swc/crates/wasm/src/lib.rs index 9497620ff4962..ed76486c5abf1 100644 --- a/packages/next-swc/crates/wasm/src/lib.rs +++ b/packages/next-swc/crates/wasm/src/lib.rs @@ -9,7 +9,7 @@ use wasm_bindgen_futures::future_to_promise; use swc_core::{ base::{config::JsMinifyOptions, config::ParseOptions, try_with_handler, Compiler}, common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}, - transforms::pass::noop, + ecma::transforms::pass::noop, }; fn convert_err(err: Error) -> JsValue { From 841f9424e4ca90883023304232dfeaffe3c3328d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 00:36:12 +0900 Subject: [PATCH 19/23] Update test refs --- .../crates/core/tests/full/example/output.js | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/next-swc/crates/core/tests/full/example/output.js b/packages/next-swc/crates/core/tests/full/example/output.js index 70e0292bd93eb..0398540c5b35e 100644 --- a/packages/next-swc/crates/core/tests/full/example/output.js +++ b/packages/next-swc/crates/core/tests/full/example/output.js @@ -4,39 +4,38 @@ function t(t, r) { return e; } import r from "other"; -var n = function(r, n) { +(function(r, n) { return function(t) { if (Array.isArray(t)) return t; }(r) || function(t, r) { var n, e, o = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; if (null != o) { - var u = [], l = !0, a = !1; + var u = [], l = !0, i = !1; try { for(o = o.call(t); !(l = (n = o.next()).done) && (u.push(n.value), !r || u.length !== r); l = !0); - } catch (i) { - a = !0, e = i; + } catch (a) { + i = !0, e = a; } finally{ try { l || null == o.return || o.return(); } finally{ - if (a) throw e; + if (i) throw e; } } return u; } - }(r, n) || function r(n, e) { - if (n) { - if ("string" == typeof n) return t(n, e); - var o = Object.prototype.toString.call(n).slice(8, -1); - if ("Object" === o && n.constructor && (o = n.constructor.name), "Map" === o || "Set" === o) return Array.from(o); - if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return t(n, e); + }(r, n) || function(r, n) { + if (r) { + if ("string" == typeof r) return t(r, n); + var e = Object.prototype.toString.call(r).slice(8, -1); + if ("Object" === e && r.constructor && (e = r.constructor.name), "Map" === e || "Set" === e) return Array.from(e); + if ("Arguments" === e || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return t(r, n); } }(r, n) || 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."); }(); -}(r, 1); -n[0]; +})(r, 1)[0]; export var __N_SSG = !0; -export default function e() { +export default function n() { return React.createElement("div", null); }; From c6ce3cbc5ab8fc0150ec463d7b5badd73d4e9f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 17:06:46 +0900 Subject: [PATCH 20/23] feature --- packages/next-swc/crates/core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index 9ee301a9b1a0f..8b66f23df1f46 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -42,7 +42,7 @@ swc_core = { version = "0.20.2", features = [ "ecma_parser", "ecma_parser_typescript", "cached", - "base_concurrent" # concurrent? + "base" ] } [dev-dependencies] From 0e48e19decf36a6fc83c7236259eab3fe3d5f565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 17:07:56 +0900 Subject: [PATCH 21/23] Update swc again --- packages/next-swc/Cargo.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index b45e43aeb19f5..23b20de523e31 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -3159,9 +3159,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce4529dad9fa47a3030e9af930b6162aec9271a30a7050de21aad5a9ac33c6a" +checksum = "30e3327c208ae240cb71b1da1a660e2cdffb4b3316f402c75c9ebc979dc563b2" dependencies = [ "binding_macros", "swc", @@ -3179,7 +3179,7 @@ dependencies = [ "swc_ecma_loader", "swc_ecma_minifier", "swc_ecma_parser", - "swc_ecma_transforms", + "swc_ecma_transforms_base", "swc_ecma_transforms_optimization", "swc_ecma_transforms_react", "swc_ecma_transforms_testing", @@ -3406,9 +3406,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.152.2" +version = "0.152.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8f12315d3809cc05373b897bac02dc8afb5ee20f7212c6c4a14c039c8f905f" +checksum = "62550be2e2773991286ea412d5277b39c81f8a47b1fbcfe68af6bf8788c58722" dependencies = [ "ahash", "arrayvec", @@ -3520,9 +3520,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.106.0" +version = "0.106.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45307774c27a152841aa2d9a05c583f3205b7676c20c715de248f95504e186a0" +checksum = "b1a5bd2f4633734c712b3539b60d5ee7151a93fa827f2b9b19ffb05accece2b0" dependencies = [ "better_scoped_tls", "bitflags", @@ -3627,9 +3627,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.160.2" +version = "0.160.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335fee948f661aa28eaaa438113f5cb28d1128cfbefe47eb3ee8f7f5b2734c73" +checksum = "60929573686464dd117839acef42287205407865385eed448e5625dd4ff5214b" dependencies = [ "ahash", "dashmap", From 166295a0d1e7ea4d44c5c0664b7e8e7b2d219739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 17:09:33 +0900 Subject: [PATCH 22/23] fixup --- packages/next-swc/crates/core/Cargo.toml | 5 +++-- packages/next-swc/crates/emotion/Cargo.toml | 4 ++-- packages/next-swc/crates/modularize_imports/Cargo.toml | 4 ++-- packages/next-swc/crates/napi/Cargo.toml | 2 +- packages/next-swc/crates/styled_components/Cargo.toml | 4 ++-- packages/next-swc/crates/styled_jsx/Cargo.toml | 4 ++-- packages/next-swc/crates/wasm/Cargo.toml | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index 8b66f23df1f46..49c55aae4f927 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -28,7 +28,7 @@ styled_jsx = {path="../styled_jsx"} modularize_imports = {path="../modularize_imports"} tracing = { version = "0.1.32", features = ["release_max_level_info"] } -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "common_concurrent", "ecma_ast", "ecma_visit", @@ -37,6 +37,7 @@ swc_core = { version = "0.20.2", features = [ "ecma_utils", "ecma_minifier", "ecma_transforms", + "__ecma_transforms", "ecma_transforms_react", "ecma_transforms_typescript", "ecma_parser", @@ -46,6 +47,6 @@ swc_core = { version = "0.20.2", features = [ ] } [dev-dependencies] -swc_core = { version = "0.20.2", features = ["testing_transform"] } +swc_core = { version = "0.20.4", features = ["testing_transform"] } testing = "0.29.4" walkdir = "2.3.2" diff --git a/packages/next-swc/crates/emotion/Cargo.toml b/packages/next-swc/crates/emotion/Cargo.toml index 9adeb422570af..ecf9a8f784c6c 100644 --- a/packages/next-swc/crates/emotion/Cargo.toml +++ b/packages/next-swc/crates/emotion/Cargo.toml @@ -19,9 +19,9 @@ regex = "1.5" serde = "1" sourcemap = "6.0.1" tracing = { version = "0.1.32", features = ["release_max_level_info"] } -swc_core = { version = "0.20.2", features = ["common_concurrent", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] } +swc_core = { version = "0.20.4", features = ["common_concurrent", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] } [dev-dependencies] -swc_core = { version = "0.20.2", features = ["testing_transform", "ecma_transforms_react"] } +swc_core = { version = "0.20.4", features = ["testing_transform", "ecma_transforms_react"] } testing = "0.29.4" serde_json = "1" diff --git a/packages/next-swc/crates/modularize_imports/Cargo.toml b/packages/next-swc/crates/modularize_imports/Cargo.toml index 24901b5ebebe0..9cc850592acfe 100644 --- a/packages/next-swc/crates/modularize_imports/Cargo.toml +++ b/packages/next-swc/crates/modularize_imports/Cargo.toml @@ -15,8 +15,8 @@ handlebars = "4.2.1" once_cell = "1.13.0" regex = "1.5" serde = "1" -swc_core = { version = "0.20.2", features = ["cached", "ecma_ast", "ecma_visit"] } +swc_core = { version = "0.20.4", features = ["cached", "ecma_ast", "ecma_visit"] } [dev-dependencies] -swc_core = { version = "0.20.2", features = ["testing_transform"] } +swc_core = { version = "0.20.4", features = ["testing_transform"] } testing = "0.29.4" diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 50d6beadfdfb0..83d8b862754a6 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -30,7 +30,7 @@ next-swc = {version = "0.0.0", path = "../core"} once_cell = "1.13.0" serde = "1" serde_json = "1" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "allocator_node", "base_concurrent", # concurrent? "common_concurrent", diff --git a/packages/next-swc/crates/styled_components/Cargo.toml b/packages/next-swc/crates/styled_components/Cargo.toml index 6335f65517d73..a4ed8723a5b85 100644 --- a/packages/next-swc/crates/styled_components/Cargo.toml +++ b/packages/next-swc/crates/styled_components/Cargo.toml @@ -16,7 +16,7 @@ once_cell = "1.13.0" regex = {version = "1.5.4", features = ["std", "perf"], default-features = false} serde = {version = "1.0.130", features = ["derive"]} tracing = "0.1.32" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "common_concurrent", "ecma_ast", "ecma_utils", @@ -26,7 +26,7 @@ swc_core = { version = "0.20.2", features = [ [dev-dependencies] serde_json = "1" testing = "0.29.4" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "ecma_parser", "ecma_transforms", "testing_transform" diff --git a/packages/next-swc/crates/styled_jsx/Cargo.toml b/packages/next-swc/crates/styled_jsx/Cargo.toml index 85292553a12ab..953d3ed4768f5 100644 --- a/packages/next-swc/crates/styled_jsx/Cargo.toml +++ b/packages/next-swc/crates/styled_jsx/Cargo.toml @@ -13,7 +13,7 @@ version = "0.15.0" easy-error = "1.0.0" tracing = "0.1.32" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "common_concurrent", "css_ast", "css_codegen", @@ -28,6 +28,6 @@ swc_core = { version = "0.20.2", features = [ [dev-dependencies] testing = "0.29.4" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "testing_transform" ] } diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index a45eb5164cf16..56ef94e1e695a 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8" getrandom = { version = "0.2.5", optional = true, default-features = false } js-sys = "0.3.59" -swc_core = { version = "0.20.2", features = [ +swc_core = { version = "0.20.4", features = [ "common_concurrent", "binding_macro_wasm", "ecma_codegen", From f0a1a4a78f548c6f4b3d453c5d91b16f0afba530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 4 Sep 2022 17:11:56 +0900 Subject: [PATCH 23/23] Fix --- .../next-swc/crates/core/src/disallow_re_export_all_in_page.rs | 2 +- packages/next-swc/crates/core/src/lib.rs | 2 +- packages/next-swc/crates/core/tests/full.rs | 2 +- packages/next-swc/crates/core/tests/telemetry.rs | 2 +- packages/next-swc/crates/napi/src/transform.rs | 2 +- packages/next-swc/crates/styled_components/tests/fixture.rs | 2 +- packages/next-swc/crates/styled_jsx/tests/fixture.rs | 2 +- packages/next-swc/crates/wasm/src/lib.rs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs index 491aa16ee9352..3636c4774fcf3 100644 --- a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs +++ b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs @@ -1,7 +1,7 @@ use swc_core::{ common::errors::HANDLER, ecma::ast::ExportAll, - ecma::transforms::pass::Optional, + ecma::transforms::base::pass::Optional, ecma::visit::{noop_fold_type, Fold}, }; diff --git a/packages/next-swc/crates/core/src/lib.rs b/packages/next-swc/crates/core/src/lib.rs index 19214cd90d7ea..68e1efe0d0745 100644 --- a/packages/next-swc/crates/core/src/lib.rs +++ b/packages/next-swc/crates/core/src/lib.rs @@ -42,7 +42,7 @@ use swc_core::{ common::{chain, comments::Comments, pass::Optional, FileName, SourceFile, SourceMap}, ecma::ast::EsVersion, ecma::parser::parse_file_as_module, - ecma::transforms::pass::noop, + ecma::transforms::base::pass::noop, ecma::visit::Fold, }; diff --git a/packages/next-swc/crates/core/tests/full.rs b/packages/next-swc/crates/core/tests/full.rs index 2c94e1bc22683..6c9ad7c5c4b2c 100644 --- a/packages/next-swc/crates/core/tests/full.rs +++ b/packages/next-swc/crates/core/tests/full.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; use swc_core::{ base::Compiler, ecma::parser::{Syntax, TsConfig}, - ecma::transforms::pass::noop, + ecma::transforms::base::pass::noop, }; use testing::{NormalizedOutput, Tester}; diff --git a/packages/next-swc/crates/core/tests/telemetry.rs b/packages/next-swc/crates/core/tests/telemetry.rs index 3ed93ca189f62..85af75512f4f6 100644 --- a/packages/next-swc/crates/core/tests/telemetry.rs +++ b/packages/next-swc/crates/core/tests/telemetry.rs @@ -9,7 +9,7 @@ use once_cell::sync::Lazy; use swc_core::{ base::{try_with_handler, Compiler}, common::{FileName, FilePathMapping, SourceMap}, - ecma::transforms::pass::noop, + ecma::transforms::base::pass::noop, }; static COMPILER: Lazy> = Lazy::new(|| { diff --git a/packages/next-swc/crates/napi/src/transform.rs b/packages/next-swc/crates/napi/src/transform.rs index 1d19111177b88..25c4bfba747d3 100644 --- a/packages/next-swc/crates/napi/src/transform.rs +++ b/packages/next-swc/crates/napi/src/transform.rs @@ -45,7 +45,7 @@ use std::{ use swc_core::{ base::{try_with_handler, Compiler, TransformOutput}, common::{errors::ColorConfig, FileName}, - ecma::transforms::pass::noop, + ecma::transforms::base::pass::noop, }; /// Input to transform diff --git a/packages/next-swc/crates/styled_components/tests/fixture.rs b/packages/next-swc/crates/styled_components/tests/fixture.rs index e6191fe519cc4..509ac5bc6c214 100644 --- a/packages/next-swc/crates/styled_components/tests/fixture.rs +++ b/packages/next-swc/crates/styled_components/tests/fixture.rs @@ -5,7 +5,7 @@ use styled_components::{styled_components, Config}; use swc_core::{ common::{chain, Mark}, ecma::parser::{EsConfig, Syntax}, - ecma::transforms::resolver, + ecma::transforms::base::resolver, ecma::transforms::testing::test_fixture, }; diff --git a/packages/next-swc/crates/styled_jsx/tests/fixture.rs b/packages/next-swc/crates/styled_jsx/tests/fixture.rs index a46d8232fb3ec..d851a562d0b66 100644 --- a/packages/next-swc/crates/styled_jsx/tests/fixture.rs +++ b/packages/next-swc/crates/styled_jsx/tests/fixture.rs @@ -4,7 +4,7 @@ use styled_jsx::styled_jsx; use swc_core::{ common::{chain, FileName, Mark, Span, DUMMY_SP}, ecma::parser::{EsConfig, Syntax}, - ecma::transforms::resolver, + ecma::transforms::base::resolver, ecma::transforms::testing::{test_fixture, test_fixture_allowing_error}, }; use testing::fixture; diff --git a/packages/next-swc/crates/wasm/src/lib.rs b/packages/next-swc/crates/wasm/src/lib.rs index ed76486c5abf1..22b22d479ad8a 100644 --- a/packages/next-swc/crates/wasm/src/lib.rs +++ b/packages/next-swc/crates/wasm/src/lib.rs @@ -9,7 +9,7 @@ use wasm_bindgen_futures::future_to_promise; use swc_core::{ base::{config::JsMinifyOptions, config::ParseOptions, try_with_handler, Compiler}, common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap}, - ecma::transforms::pass::noop, + ecma::transforms::base::pass::noop, }; fn convert_err(err: Error) -> JsValue {