From 9be43e92a0ff3080439d747c3ef51a82bff4499c Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Wed, 18 Aug 2021 14:42:34 +0200 Subject: [PATCH 1/3] Bump elm for M1 support --- packages/core/integration-tests/package.json | 2 +- yarn.lock | 50 +++----------------- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/packages/core/integration-tests/package.json b/packages/core/integration-tests/package.json index adb78208f59..00185cbecc6 100644 --- a/packages/core/integration-tests/package.json +++ b/packages/core/integration-tests/package.json @@ -26,7 +26,7 @@ "command-exists": "^1.2.6", "core-js": "^3.2.1", "cross-env": "^7.0.0", - "elm": "^0.19.1-3", + "elm": "^0.19.1-5", "elm-hot": "^1.1.5", "get-port": "^5.0.0", "graphql": "^15.0.0", diff --git a/yarn.lock b/yarn.lock index 191848ab7bb..f7ad4c63158 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4336,17 +4336,6 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" -css-select@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-3.1.2.tgz#d52cbdc6fee379fba97fb0d3925abbd18af2d9d8" - integrity sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA== - dependencies: - boolbase "^1.0.0" - css-what "^4.0.0" - domhandler "^4.0.0" - domutils "^2.4.3" - nth-check "^2.0.0" - css-select@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067" @@ -4388,11 +4377,6 @@ css-what@^3.2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== -css-what@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-4.0.0.tgz#35e73761cab2eeb3d3661126b23d7aa0e8432233" - integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== - css-what@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad" @@ -4962,16 +4946,7 @@ domutils@^1.5.1, domutils@^1.7.0: dom-serializer "0" domelementtype "1" -domutils@^2.4.2, domutils@^2.4.3, domutils@^2.5.2: - version "2.6.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.6.0.tgz#2e15c04185d43fb16ae7057cb76433c6edb938b7" - integrity sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - -domutils@^2.6.0: +domutils@^2.4.2, domutils@^2.5.2, domutils@^2.6.0: version "2.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.7.0.tgz#8ebaf0c41ebafcf55b0b72ec31c56323712c5442" integrity sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg== @@ -5070,10 +5045,10 @@ elm-hot@^1.1.5: resolved "https://registry.yarnpkg.com/elm-hot/-/elm-hot-1.1.5.tgz#bba309b592d39b5c3195c3c6f608f36b96c23b89" integrity sha512-HSMlAr6INTV82wkpPNG0zsHoJXo/04GwG7bnhFX8s4zyIbbzuJAovsdo27FAT6/NKx5IVTXGI+IFcK9Z7oN1Tw== -elm@^0.19.1-3: - version "0.19.1-3" - resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.1-3.tgz#2382aa1943bc79974b5d95b0a6acbe010ee16909" - integrity sha512-6y36ewCcVmTOx8lj7cKJs3bhI5qMfoVEigePZ9PhEUNKpwjjML/pU2u2YSpHVAznuCcojoF6KIsrS1Ci7GtVaQ== +elm@^0.19.1-5: + version "0.19.1-5" + resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.1-5.tgz#61f18437222972e20f316f9b2d2c76a781a9991b" + integrity sha512-dyBoPvFiNLvxOStQJdyq28gZEjS/enZXdZ5yyCtNtDEMbFJJVQq4pYNRKvhrKKdlxNot6d96iQe1uczoqO5yvA== dependencies: request "^2.88.0" @@ -12440,20 +12415,7 @@ svgo@^1.2.2: unquote "~1.1.1" util.promisify "~1.0.0" -svgo@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.3.0.tgz#6b3af81d0cbd1e19c83f5f63cec2cb98c70b5373" - integrity sha512-fz4IKjNO6HDPgIQxu4IxwtubtbSfGEAJUq/IXyTPIkGhWck/faiiwfkvsB8LnBkKLvSoyNNIY6d13lZprJMc9Q== - dependencies: - "@trysound/sax" "0.1.1" - chalk "^4.1.0" - commander "^7.1.0" - css-select "^3.1.2" - css-tree "^1.1.2" - csso "^4.2.0" - stable "^0.1.8" - -svgo@^2.4.0: +svgo@^2.3.0, svgo@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.4.0.tgz#0c42653101fd668692c0f69b55b8d7b182ef422b" integrity sha512-W25S1UUm9Lm9VnE0TvCzL7aso/NCzDEaXLaElCUO/KaVitw0+IBicSVfM1L1c0YHK5TOFh73yQ2naCpVHEQ/OQ== From 14c57136a04bb21bec39cdd409a19c6888c4720b Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Sun, 8 Aug 2021 16:29:35 +0200 Subject: [PATCH 2/3] Bump swc --- Cargo.lock | 186 ++++++++++-------- packages/transformers/js/core/Cargo.toml | 6 +- .../transformers/js/core/src/env_replacer.rs | 1 - 3 files changed, 111 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c81c09b5edc..282c23ad761 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "ahash" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -23,9 +34,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.41" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" +checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" [[package]] name = "arrayvec" @@ -78,9 +89,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" @@ -105,9 +116,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" [[package]] name = "cfg-if" @@ -275,14 +286,25 @@ checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "hermit-abi" @@ -318,9 +340,9 @@ checksum = "1f7280c75fb2e2fc47080ec80ccc481376923acb04501957fc38f935c3de5088" [[package]] name = "indexmap" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown", @@ -415,9 +437,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "libmimalloc-sys" @@ -439,9 +461,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" @@ -460,9 +482,9 @@ dependencies = [ [[package]] name = "napi" -version = "1.7.5" +version = "1.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cd02f5de365f9bd6e85f1d11176a9ea70ff63ce55ea4412cb4e00fd5a0fe6c" +checksum = "eb22375ec7cbd8bee4535126bb323e4e62cbf8088d84f0225d4d3226d1619bd5" dependencies = [ "napi-sys", "serde", @@ -563,9 +585,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "ordered-float" -version = "2.5.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f100fcfb41e5385e0991f74981732049f9b896821542a219420491046baafdc2" +checksum = "039f02eb0f69271f26abe3202189275d7aa2258b903cb0281b5de710a2570ff3" dependencies = [ "num-traits", ] @@ -733,9 +755,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" dependencies = [ "unicode-xid", ] @@ -755,7 +777,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha", "rand_core", @@ -779,7 +801,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", ] [[package]] @@ -871,9 +893,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" dependencies = [ "serde_derive", ] @@ -901,9 +923,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" dependencies = [ "proc-macro2", "quote", @@ -912,9 +934,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" dependencies = [ "itoa", "ryu", @@ -923,9 +945,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" +checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" dependencies = [ "block-buffer", "cfg-if 1.0.0", @@ -936,9 +958,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbce6d4507c7e4a3962091436e56e95290cb71fa302d0d270e32130b75fbff27" +checksum = "729a25c17d72b06c68cb47955d44fda88ad2d3e7d77e025663fdd69b93dd71a1" [[package]] name = "smallvec" @@ -1052,10 +1074,11 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.10.21" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526ac4386aca6a792d75bb3bd5cb72eb170e2029f4ce0f6a9d280923da4b0ce8" +checksum = "0fc89b8c9f2fa3fc646e7d1a05ebc2063b1396b3ba5277afc741505bd7414fff" dependencies = [ + "ahash", "ast_node", "atty", "cfg-if 0.1.10", @@ -1078,9 +1101,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.47.0" +version = "0.49.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab98b7f6777222431bdf193bbfc6046af53cc105c8702390a9109d1a4511329b" +checksum = "3efef728f69665d765c52b233155dcb3290424f56a9f978ecfbd53f136804461" dependencies = [ "is-macro", "num-bigint", @@ -1092,9 +1115,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.60.1" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e84b5477973503f94c6a82f02bc6008c148dc3dd5b07bb81fee6f5f93e3a190" +checksum = "96a380bd935ce811c0bc8b961abc97cbf3a8c759213634aa59f5b0601162ba4e" dependencies = [ "bitflags", "num-bigint", @@ -1121,12 +1144,16 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.9.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d234e6348de8d954334700f65a35485363de082fd58671c07f060f1fa499f59c" +checksum = "2bc6a797d2df5f60cc9ab6a85aa7a49ab1bcaac8150d184f79a27deba2d21983" dependencies = [ "anyhow", + "dashmap", + "fxhash", + "log", "normpath", + "once_cell", "serde", "serde_json", "swc_atoms", @@ -1137,9 +1164,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.61.1" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ed9b5648252851ae2cfc066717fcae9c5561be74f496eda64afc791d9b17ed" +checksum = "e0418c8dcb041d74e90c2179290bf3be0e58f2425d1f86843a5e297a13755912" dependencies = [ "either", "enum_kind", @@ -1158,9 +1185,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.27.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538902691c3a274a6e80ce7860c91b96977ebd977e1ca7fba77057e425267951" +checksum = "283a609ec84132c2751bdee13a7a81228007206538ef09a1066163602f0d34d8" dependencies = [ "dashmap", "fxhash", @@ -1182,9 +1209,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.57.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd060899f0cb2994ad9d2c04475e30864549e80dde35a526acdf3a79ec8d722" +checksum = "9c50b45538663ae18d56768c93567312dd5cbf29786678a94cfa610172ba93a4" dependencies = [ "swc_atoms", "swc_common", @@ -1204,9 +1231,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.20.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311b66839a94ea620382ecadb46c001132c21ad15b13f0e04ffe3ad115a8ce78" +checksum = "b5de480c55ae93eb59715cfc8f66965d192bc62cd4c12e33cff9f940f9431e12" dependencies = [ "fxhash", "once_cell", @@ -1223,9 +1250,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.6.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f7417ff08dd6da5bf7ab96e96bb6ae43cdf484235ded9855d5260011cc0186" +checksum = "cdcbad381d349cbff95f7602bf2d9ad6a40c7df92a391d4af62221bd0d7633a2" dependencies = [ "swc_atoms", "swc_common", @@ -1237,9 +1264,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.23.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f464846be30234400767c1f7785bdfd2d27fef6f3cfb9f4e24a2044c9e8e76d2" +checksum = "4cca0020d15ecb278fcdc4cd55f199f39e0c42ceb9e7f9740416f36120c17ad5" dependencies = [ "arrayvec", "fxhash", @@ -1274,9 +1301,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.24.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22c79be4775f2f6f166c7901706e5cc64cd837e6a26b8f0d7ced224321a39dc2" +checksum = "ac0abb8acb4b72d1ef37971b0bfed8e267ecaab37b3d34bac96205d7b62689e2" dependencies = [ "Inflector", "anyhow", @@ -1296,9 +1323,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.27.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422f1a381ee1782fa5b3d883fb01239e9bca26515932b93e4fa3e956275c684f" +checksum = "fb3b4c8d2613ce06be5cf8160159eb468117ef6257eba744e1bf18125cca31ad" dependencies = [ "dashmap", "fxhash", @@ -1318,9 +1345,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.24.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a18d71bee10a061894ff92d36fcc54e43197c92f70cdb98309021bff282290" +checksum = "02a8edf26ee1695c0137a829dbb8bb3c6681c1ae55e23ff45e0e0f41308e795f" dependencies = [ "either", "fxhash", @@ -1338,9 +1365,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.25.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e2bf91bc9166722159d919cff5dc0276fd404031c53a0f5c6716fdcdcb3a0a" +checksum = "72eabb27291ac7bef4f1f85e3aa7d335138dde1a1606b7d584e7f414882e5f3c" dependencies = [ "base64 0.13.0", "dashmap", @@ -1361,9 +1388,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.26.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d642e21c1088a040e680e81527a7d7528c3703070d15f93cc56cce7c8591f2" +checksum = "dc043fd29ceac49f13c1c994ba784f404cca3e189dd6cb771bfe905a0f776592" dependencies = [ "fxhash", "serde", @@ -1378,9 +1405,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.38.0" +version = "0.41.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db19d40a76ba6c01ebbbd73981645dd2552cdbfc14605481c7a9b7f6f26bd20e" +checksum = "50bacaf860e4224e1a12bea8730c94de28f990f92685dad57aa572e3473043f7" dependencies = [ "once_cell", "scoped-tls", @@ -1393,9 +1420,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.33.0" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ad83badbeda1123290a73ca6254158ed027f72f1b593f96acddcaed5d49c6a" +checksum = "d51ce688b7c984d0325261edb3ced4195790c7ac76982e269d2114ec04e3ae7c" dependencies = [ "num-bigint", "swc_atoms", @@ -1406,9 +1433,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.43.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e1c5047fe3f5a6c301a312c278ac018789ba4a6e40e556612e82defda422c" +checksum = "e41615d9e65c7b148950211dacd0b2343a646d84493b9c8efa8795ee1a6e2f4f" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -1444,9 +1471,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583cfe83f6002e1118559308b88181f34b5936b403b72548cd0259bfcf0ca39e" +checksum = "a423caa0b4585118164dbad8f1ad52b592a9a9370b25decc4d84c6b4309132c0" dependencies = [ "either", "swc_visit_macros", @@ -1488,9 +1515,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" dependencies = [ "tinyvec_macros", ] @@ -1509,12 +1536,9 @@ checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] +checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" [[package]] name = "unicode-normalization" @@ -1578,6 +1602,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" version = "0.2.72" diff --git a/packages/transformers/js/core/Cargo.toml b/packages/transformers/js/core/Cargo.toml index 1f2872fda6e..279d45252d5 100644 --- a/packages/transformers/js/core/Cargo.toml +++ b/packages/transformers/js/core/Cargo.toml @@ -8,9 +8,9 @@ edition = "2018" crate-type = ["rlib"] [dependencies] -swc_ecmascript = { version = "0.43.0", features = ["parser", "transforms", "module", "optimization", "react", "typescript", "utils", "visit", "codegen", "utils"] } -swc_ecma_preset_env = "0.27.0" -swc_common = { version = "0.10.21", features = ["tty-emitter", "sourcemap"] } +swc_ecmascript = { version = "0.57.0", features = ["parser", "transforms", "module", "optimization", "react", "typescript", "utils", "visit", "codegen", "utils"] } +swc_ecma_preset_env = "0.38.0" +swc_common = { version = "0.11.6", features = ["tty-emitter", "sourcemap"] } swc_atoms = "0.2.6" indoc = "1.0.3" serde = "1.0.123" diff --git a/packages/transformers/js/core/src/env_replacer.rs b/packages/transformers/js/core/src/env_replacer.rs index 7d90274f143..f71552a52c0 100644 --- a/packages/transformers/js/core/src/env_replacer.rs +++ b/packages/transformers/js/core/src/env_replacer.rs @@ -126,7 +126,6 @@ impl<'a> Fold for EnvReplacer<'a> { } } PatOrExpr::Expr(expr) => Some(&**expr), - _ => None, }; if let Some(Expr::Member(MemberExpr { From 7fc7199548f250dbdcbea2aa9c036a9e0ce76fe9 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Sun, 15 Aug 2021 12:15:56 +0200 Subject: [PATCH 3/3] Fixup test fixtures --- packages/transformers/js/core/src/hoist.rs | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/packages/transformers/js/core/src/hoist.rs b/packages/transformers/js/core/src/hoist.rs index 19df1329367..d8e2fe4963a 100644 --- a/packages/transformers/js/core/src/hoist.rs +++ b/packages/transformers/js/core/src/hoist.rs @@ -2476,7 +2476,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; let $abc$var$test = { bar: 3 }; @@ -2494,7 +2494,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; console.log($abc$import$558d6cfb8af8a010$3705fc5f2281438d); "#} ); @@ -2509,7 +2509,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; console.log($abc$import$558d6cfb8af8a010$9099ad97b570f7c, $abc$import$558d6cfb8af8a010$9099ad97b570f7c.bar); "#} ); @@ -2529,8 +2529,8 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; - import "abc:bar"; + import "abc:other"; + import "abc:bar"; console.log($abc$import$558d6cfb8af8a010$9099ad97b570f7c); console.log($abc$import$3705fc5f2281438d$9099ad97b570f7c); "#} @@ -2550,10 +2550,10 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; - import "abc:bar"; + import "abc:other"; + import "abc:bar"; console.log($abc$import$558d6cfb8af8a010$9099ad97b570f7c); - import "abc:x"; + import "abc:x"; console.log($abc$import$10b1f2ceae7ab64e); console.log($abc$import$3705fc5f2281438d$9099ad97b570f7c); "#} @@ -2573,7 +2573,7 @@ mod tests { code, indoc! {r#" const $abc$var$x = 4; - import "abc:other"; + import "abc:other"; var $abc$require$bar = $abc$import$558d6cfb8af8a010$3705fc5f2281438d; const $abc$var$baz = 3; console.log($abc$require$bar); @@ -2591,7 +2591,7 @@ mod tests { code, indoc! {r#" const $abc$var$x = 3; - import "abc:other"; + import "abc:other"; const $abc$var$bar = 2; console.log($abc$import$558d6cfb8af8a010$3705fc5f2281438d); "#} @@ -2610,7 +2610,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; const { foo: $abc$var$foo , ...$abc$var$bar } = $abc$import$558d6cfb8af8a010; console.log($abc$var$foo, $abc$var$bar); "#} @@ -2626,7 +2626,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:x"; + import "abc:x"; const { x: { y: $abc$var$z } } = $abc$import$10b1f2ceae7ab64e; console.log($abc$var$z); "#} @@ -2642,7 +2642,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; console.log($abc$import$558d6cfb8af8a010[bar]); "#} ); @@ -2657,7 +2657,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; console.log($abc$import$558d6cfb8af8a010[bar], $abc$import$558d6cfb8af8a010.baz); "#} ); @@ -2683,7 +2683,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; var $abc$require$foo = $abc$import$558d6cfb8af8a010$ba02ad2230917043; console.log($abc$require$foo); "#} @@ -2699,7 +2699,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; const $abc$var$foo = $abc$import$558d6cfb8af8a010[bar]; console.log($abc$var$foo); "#} @@ -2715,7 +2715,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; const { foo: $abc$var$foo } = $abc$import$558d6cfb8af8a010$ba02ad2230917043; console.log($abc$var$foo); "#} @@ -2737,12 +2737,12 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; function $abc$var$x() { const foo = $abc$import$558d6cfb8af8a010; console.log(foo.bar); } - import "abc:bar"; + import "abc:bar"; "#} ); assert_eq!( @@ -2763,7 +2763,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; var $abc$var$foo = (function() { if (Date.now() < 0) { var bar = $abc$import$558d6cfb8af8a010; @@ -2788,7 +2788,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; function $abc$var$x() { const foo = $abc$import$558d6cfb8af8a010$ba02ad2230917043; console.log(foo); @@ -2807,7 +2807,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; function $abc$var$x() { console.log($abc$import$558d6cfb8af8a010$ba02ad2230917043); } @@ -2826,7 +2826,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; function $abc$var$x() { const foo = $abc$import$558d6cfb8af8a010[test]; console.log(foo); @@ -2846,7 +2846,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; function $abc$var$x() { const { foo: foo } = $abc$import$558d6cfb8af8a010; console.log(foo); @@ -2863,8 +2863,8 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:a"; - import "abc:b"; + import "abc:a"; + import "abc:b"; let $abc$var$x = $abc$import$7ac649919d1c80a6 + $abc$import$a91ade93898ecc38; "#} ); @@ -2878,8 +2878,8 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:a"; - import "abc:b"; + import "abc:a"; + import "abc:b"; let $abc$var$x = (!$abc$import$7ac649919d1c80a6, $abc$import$a91ade93898ecc38); "#} ); @@ -2893,8 +2893,8 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:a"; - import "abc:b"; + import "abc:a"; + import "abc:b"; let $abc$var$x = $abc$import$7ac649919d1c80a6 || $abc$import$a91ade93898ecc38; "#} ); @@ -2908,8 +2908,8 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:a"; - import "abc:b"; + import "abc:a"; + import "abc:b"; let $abc$var$x = condition ? $abc$import$7ac649919d1c80a6 : $abc$import$a91ade93898ecc38; "#} ); @@ -2923,7 +2923,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:a"; + import "abc:a"; if (condition) $abc$import$7ac649919d1c80a6; "#} ); @@ -2937,7 +2937,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:y"; + import "abc:y"; for(let x = $abc$import$57bbd0ca114c72e; x < 5; x++){ } "#} @@ -3087,7 +3087,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:bar"; + import "abc:bar"; "#} ); @@ -3100,7 +3100,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:bar"; + import "abc:bar"; "#} ); } @@ -3382,7 +3382,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; async function $abc$var$test() { const x = await $abc$importAsync$558d6cfb8af8a010; console.log(x.foo); @@ -3413,7 +3413,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; async function $abc$var$test() { const x = await $abc$importAsync$558d6cfb8af8a010; console.log(x[foo]); @@ -3444,7 +3444,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; async function $abc$var$test() { const { foo: foo } = await $abc$importAsync$558d6cfb8af8a010; console.log(foo); @@ -3475,7 +3475,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; async function $abc$var$test() { const { foo: bar } = await $abc$importAsync$558d6cfb8af8a010; console.log(bar); @@ -3503,7 +3503,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then((x)=>x.foo ); "#} @@ -3529,7 +3529,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then((x)=>x ); "#} @@ -3555,7 +3555,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(({ foo: foo })=>foo ); "#} @@ -3581,7 +3581,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(({ foo: bar })=>bar ); "#} @@ -3607,7 +3607,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(function(x) { return x.foo; }); @@ -3634,7 +3634,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(function(x) { return x; }); @@ -3661,7 +3661,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(function({ foo: foo }) { }); "#} @@ -3687,7 +3687,7 @@ mod tests { assert_eq!( code, indoc! {r#" - import "abc:other"; + import "abc:other"; $abc$importAsync$558d6cfb8af8a010.then(function({ foo: bar }) { }); "#}