From d57d9971de3e4f31bebfed57e2ec358ceb1595c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= Date: Thu, 17 Oct 2024 22:01:15 +0300 Subject: [PATCH] 1.0.0 --- Cargo.lock | 229 +++++++++--------- Cargo.toml | 28 +-- package.json | 2 +- src/jsx/tests.rs | 181 +++++++++++--- src/refresh/tests.rs | 9 + .../src/jsx/tests.rs/issue_351.js | 8 +- .../src/jsx/tests.rs/issue_517.js | 8 +- 7 files changed, 297 insertions(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd1dce1..7a1db64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,9 +74,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ast_node" -version = "0.9.9" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9184f2b369b3e8625712493c89b785881f27eedc6cde480a81883cef78868b2" +checksum = "94741d66bdda032fcbf33e621b4e3a888d7d11bd3ac4446d82c5593a136936ff" dependencies = [ "proc-macro2", "quote", @@ -113,9 +113,9 @@ dependencies = [ [[package]] name = "better_scoped_tls" -version = "0.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +checksum = "50fd297a11c709be8348aec039c8b91de16075d2b2bdaee1bd562c0875993664" dependencies = [ "scoped-tls", ] @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", "crossbeam-utils", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.9" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32016f1242eb82af5474752d00fd8ebcd9004bd69b462b1c91de833972d08ed4" +checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" dependencies = [ "proc-macro2", "swc_macros_common", @@ -524,6 +524,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -574,12 +580,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -740,9 +746,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "outref" @@ -1049,9 +1055,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -1067,9 +1073,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -1166,18 +1172,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1323,9 +1329,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_enum" -version = "0.4.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" +checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" dependencies = [ "proc-macro2", "quote", @@ -1341,10 +1347,10 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc-plugin-inferno" -version = "0.0.23" +version = "1.0.0" dependencies = [ "base64 0.22.1", - "dashmap 6.0.1", + "dashmap 6.1.0", "indexmap", "once_cell", "rayon", @@ -1363,9 +1369,9 @@ dependencies = [ [[package]] name = "swc_allocator" -version = "0.1.8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc8bd3075d1c6964010333fae9ddcd91ad422a4f8eb8b3206a9b2b6afb4209e" +checksum = "52cacc28f0ada8e4e31a720dd849ff06864b10e6ab0a1aaa99c06456cfe046af" dependencies = [ "bumpalo", "hashbrown 0.14.5", @@ -1376,9 +1382,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.6.7" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6567e4e67485b3e7662b486f1565bdae54bd5b9d6b16b2ba1a9babb1e42125" +checksum = "5d7211e5c57ea972f32b8a104d7006c4a68d094ec30c6a73bcd20d4d6c473c7c" dependencies = [ "bytecheck", "hstr", @@ -1390,9 +1396,9 @@ dependencies = [ [[package]] name = "swc_cached" -version = "0.3.20" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83406221c501860fce9c27444f44125eafe9e598b8b81be7563d7036784cd05c" +checksum = "96b6a5ef4cfec51d3fa30b73600f206453a37fc30cf1141e4644a57b1ed88616" dependencies = [ "ahash 0.8.11", "anyhow", @@ -1404,9 +1410,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.37.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d0a8eaaf1606c9207077d75828008cb2dfb51b095a766bd2b72ef893576e31" +checksum = "e8505eddfd6488cde74b0e80a4b959b12392a8a15eb62243d45eb82cf568b9b9" dependencies = [ "anyhow", "ast_node", @@ -1436,9 +1442,9 @@ dependencies = [ [[package]] name = "swc_config" -version = "0.1.15" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4740e53eaf68b101203c1df0937d5161a29f3c13bceed0836ddfe245b72dd000" +checksum = "4aa30931f9b26af8edcb4cce605909d15dcfd7577220b22c50a2988f2a53c4c1" dependencies = [ "anyhow", "indexmap", @@ -1450,9 +1456,9 @@ dependencies = [ [[package]] name = "swc_config_macro" -version = "0.1.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" +checksum = "7f2ebd37ef52a8555c8c9be78b694d64adcb5e3bc16c928f030d82f1d65fac57" dependencies = [ "proc-macro2", "quote", @@ -1462,9 +1468,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.102.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449b5ad145a9457c7ae21b6d4bcb8db52e430c2e68e86fda849db2f5f53f734" +checksum = "178809c6d98d598e9f2336e22acd4385c32968958f8e408f70a5792d9b29b00f" dependencies = [ "once_cell", "swc_allocator", @@ -1483,9 +1489,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.118.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f866d12e4d519052b92a0a86d1ac7ff17570da1272ca0c89b3d6f802cd79df" +checksum = "6795be2785b968ccff06096bc758b306459f05fc936e6363b4dd39fb27fba22a" dependencies = [ "bitflags", "bytecheck", @@ -1502,13 +1508,14 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.155.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7641608ef117cfbef9581a99d02059b522fcca75e5244fa0cbbd8606689c6f" +checksum = "7ae4fee003ef373adef1ff2af1e73607925f510a8105a5e368c1aa655ece9a41" dependencies = [ "memchr", "num-bigint", "once_cell", + "regex", "serde", "sourcemap", "swc_allocator", @@ -1521,9 +1528,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859fabde36db38634f3fad548dd5e3410c1aebba1b67a3c63e67018fa57a0bca" +checksum = "5f9a42f479a6475647e248fa9750982c87cd985e19d1016a1fc18a70682305d1" dependencies = [ "proc-macro2", "quote", @@ -1533,9 +1540,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75429b44cc479cbe018d5994eddae5ac7ab887ebefeb3596720921bc4cdff551" +checksum = "057714c6d55ef69a015b8d2b21d146514c7d408773e7682e18454e9c1d76d6d8" dependencies = [ "swc_atoms", "swc_common", @@ -1550,9 +1557,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "0.11.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9acdf402b36f8e83084b10e119d7ba9d07e5229ef39e1343f147db816c7b73e" +checksum = "a83e449bb6dfc864f665ff5967f8ade2efdf61c50b0b2094e0e2770dca017e28" dependencies = [ "swc_common", "swc_ecma_ast", @@ -1563,9 +1570,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c988d9018d6abb22b0fcc2da6a624be2db7c56681b6180d1cb5faa2672fd8001" +checksum = "7f248aa75dec77e4b229bb2515f1c640915b43c6a5f3fd74678e90d1979a48b5" dependencies = [ "arrayvec", "indexmap", @@ -1590,9 +1597,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b7a3e086151c70ff940531ddcd04c01351ae80aa4593fd2906255d18a836b4f" +checksum = "89ed78da21bb08165fc6482f9e18fd9d855151f1ceceb52ac479670daf638a93" dependencies = [ "swc_atoms", "swc_common", @@ -1607,9 +1614,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b74c89c9bd4fa532fba3d1ec47b129ec450b4143d3914118cd61b0e44d4a4b" +checksum = "f07d95be4b1b211cdd5037387f5bb9bf71a24b1f0511667b10113d4c081c7e4b" dependencies = [ "serde", "swc_atoms", @@ -1625,9 +1632,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40bf74a06c433eee502ea6347596d5766d77da8baf32653d14a6655df4e181a" +checksum = "a3c8fa68f4f4d9b9185ad67aee6055eec2cecf0b873c4ed3fe52cda54516c778" dependencies = [ "serde", "swc_atoms", @@ -1644,9 +1651,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10afb20890ffda37eefdfe06c3bb0d12e5ec8698667cb9e3689b74066b398845" +checksum = "007e7708253adba943bc5c099fb50176c37090bbf9eddc3579f8806f4c6d5245" dependencies = [ "swc_atoms", "swc_common", @@ -1660,9 +1667,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0608c4814a362d5362bc536507d8c89b287521778e8b678fe4590bfa1843803a" +checksum = "2fb6997a7425e5a5ed48939bd470d044214a24c9b63760a131baa5eb8e3072f8" dependencies = [ "serde", "swc_atoms", @@ -1678,9 +1685,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f12ffb0f4282f4b333efa98c9653d181d89e1b5339d4be0d789189a246ef34b" +checksum = "87f813956f45bb0ddc59e3e74798ab13d323dc7d7994de7215edd97a374ee4db" dependencies = [ "swc_atoms", "swc_common", @@ -1694,9 +1701,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc16be9dd64e1b32569375b0b73ecc7dc74f9d848e8caaf2007896e2cf8d68a7" +checksum = "205d58536ba7cbb4333bf73dc15da14dc3749f77a790c995fa123ffb3e007007" dependencies = [ "swc_atoms", "swc_common", @@ -1713,9 +1720,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.12.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e684ae87d26ad3012e588d0e268158cadee10ddc0cda261069f0f280a8b23ce7" +checksum = "b6399dec3eb785ecd4a910c89640ea711be532cb636d906c14f5cba88a626c64" dependencies = [ "swc_common", "swc_ecma_ast", @@ -1728,9 +1735,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.49.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55fa3d55045b97894bfb04d38aff6d6302ac8a6a38e3bb3dfb0d20475c4974a9" +checksum = "2a3437031ac49f5fdc5f236a9263bb4cab144d34864cf530767b1bf53d3ca75a" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -1747,9 +1754,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.149.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683dada14722714588b56481399c699378b35b2ba4deb5c4db2fb627a97fb54b" +checksum = "af8beb1639d45a3b6b5d0f2e9aa9f99833608b7c9c4596465035bea38264407b" dependencies = [ "either", "new_debug_unreachable", @@ -1769,9 +1776,9 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.26.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945faa325af9833b2541d3b0b4e614812677480c2b763c6c6e8c2a42a133b906" +checksum = "f18ed0d82088c142076b952fd4086c52d98cf8d728ba9f216a463dbdbc53ad75" dependencies = [ "anyhow", "hex", @@ -1782,9 +1789,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.239.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82df2dd8048fe23f1df72acd52bfebf846b3d5a76e048eee32acf9af9bee6a98" +checksum = "b19ea1b66e4e99ae56d8645b763cc55683201c3b373c36c3c6876d279312ca63" dependencies = [ "swc_atoms", "swc_common", @@ -1796,9 +1803,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.145.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f21494e75d0bd8ef42010b47cabab9caaed8f2207570e809f6f4eb51a710d1" +checksum = "7feebd16859fb7c102d9dfdf75dde065825683c38f3ba250729da33dbfc11869" dependencies = [ "better_scoped_tls", "bitflags", @@ -1819,9 +1826,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.134.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3d884594385bea9405a2e1721151470d9a14d3ceec5dd773c0ca6894791601" +checksum = "a82f5b18390f80e0cb0de3a4586db34f6092b419a49b1689ca2b0e8bedae7318" dependencies = [ "swc_atoms", "swc_common", @@ -1833,9 +1840,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.171.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f23da29c1279b6e0c1ac0df9d0f7fd6c955a141a9770e5a0a2d54292509bcf6" +checksum = "e8cc2d31ec8ed2f65ebc6461a931befc6d9e48438d28fb612a30038694a76227" dependencies = [ "arrayvec", "indexmap", @@ -1869,9 +1876,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" -version = "0.5.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" +checksum = "6845dfb88569f3e8cd05901505916a8ebe98be3922f94769ca49f84e8ccec8f7" dependencies = [ "proc-macro2", "quote", @@ -1881,9 +1888,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.190.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4d0255362149854b923125e9910ce0a5405ce6d03fb325c5fdd8e9f13a0845" +checksum = "09e711b88fd1c7127a7a26245a2bc9f98505969eb181709153ea7696abae1459" dependencies = [ "Inflector", "anyhow", @@ -1908,9 +1915,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.148.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902e7dc5033ff3bdaef8961714328a4992a0089b23b16822c51ae6f4968ec682" +checksum = "9ca6416a26f9be7126de6ef68ecd1d1f59416c60f7d6fa4a8c2f13c8cf4a0bff" dependencies = [ "ansi_term", "anyhow", @@ -1934,9 +1941,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.134.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029eec7dd485923a75b5a45befd04510288870250270292fc2c1b3a9e7547408" +checksum = "d3608f6babd45a29875b06b583fc2aa24b756b5aab8fabfe87e4b4371b8d43ba" dependencies = [ "indexmap", "num_cpus", @@ -1953,9 +1960,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.104.8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1c6802e68e51f336e8bc9644e9ff9da75d7da9c1a6247d532f2e908aa33e81" +checksum = "d9cc511aa14bf58a6bc66815e78b76a4fed15f148681856d8d9b0456577050aa" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -1968,9 +1975,9 @@ dependencies = [ [[package]] name = "swc_eq_ignore_macros" -version = "0.1.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" +checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" dependencies = [ "proc-macro2", "quote", @@ -1979,9 +1986,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "0.21.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d049e9256abf29d9fc66d3db3ea44b6815a64ad565ce31e117a74ee96478bb3" +checksum = "fca3b3c6da0e2d659c8a5cc6d0a1c76fe3272ae1d55e93e48c74de655271142b" dependencies = [ "anyhow", "miette", @@ -1992,9 +1999,9 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.13" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f486687bfb7b5c560868f69ed2d458b880cebc9babebcb67e49f31b55c5bf847" +checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" dependencies = [ "proc-macro2", "quote", @@ -2003,18 +2010,18 @@ dependencies = [ [[package]] name = "swc_plugin" -version = "0.90.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd2ab83a683ee8cdd8be4ce3f363d760a9977d4539aeaee5dbed179ec49fcc7" +checksum = "6b45099a38ed45528bef939d0eac1a0c1347749d0c67d3dd744d545316c5fd05" dependencies = [ "once_cell", ] [[package]] name = "swc_plugin_macro" -version = "0.9.16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3232db481484070637b20a155c064096c0ea1ba04fa2247b89b618661b3574f4" +checksum = "0917ccfdcd3fa6cf41bdacef2388702a3b274f9ea708d930e1e8db37c7c3e1c6" dependencies = [ "proc-macro2", "quote", @@ -2023,9 +2030,9 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.47.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07548e19126fbc58b16237e2c8b0075f037774dfdd691fe4c558ba898cfe784b" +checksum = "d2b12f6e1064370116757b9aebc33ab82c123eabc635d00b38770a1f2dbebdc8" dependencies = [ "better_scoped_tls", "rkyv", @@ -2037,9 +2044,9 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "0.1.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" +checksum = "4c78717a841565df57f811376a3d19c9156091c55175e12d378f3a522de70cef" dependencies = [ "proc-macro2", "quote", @@ -2048,9 +2055,9 @@ dependencies = [ [[package]] name = "swc_visit" -version = "0.6.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" +checksum = "b40b33e89a4fe7b07b39665f81203a83ffecb3a930522b6ad075716ee6dad637" dependencies = [ "either", "new_debug_unreachable", @@ -2108,9 +2115,9 @@ dependencies = [ [[package]] name = "testing" -version = "0.39.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3105e9569b7f674d1107d19494c993aafd19ea51f7a558b96b267b49c9b5f2bf" +checksum = "544770604eb95960ad9a00996b95a902d975ee502cf7f93c231112cfb598d035" dependencies = [ "ansi_term", "cargo_metadata", @@ -2129,9 +2136,9 @@ dependencies = [ [[package]] name = "testing_macros" -version = "0.2.14" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39660370116afe46d5ff8bcb01b7afe2140dda3137ef5cb1914681e37a4ee06" +checksum = "a2d27bf245b90a80d5aa231133418ae7db98f032855ce5292e12071ab29c4b26" dependencies = [ "anyhow", "glob", diff --git a/Cargo.toml b/Cargo.toml index 2578c1c..5712551 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "MIT" name = "swc-plugin-inferno" repository = "https://github.com/infernojs/swc-plugin-inferno.git" -version = "0.0.23" +version = "1.0.0" [lib] crate-type = ["cdylib", "rlib"] @@ -30,14 +30,14 @@ strip = "symbols" [dependencies] base64 = "0.22.1" -dashmap = "6.0.1" -indexmap = "2.5.0" -once_cell = "1.19.0" +dashmap = "6.1.0" +indexmap = "2.6.0" +once_cell = "1.20.2" rayon = { version = "1.10.0", optional = true } -serde = { version = "1.0.209", features = ["derive"], optional = true } +serde = { version = "1.0.210", features = ["derive"], optional = true } sha-1 = "=0.10.1" -swc_core = { version = "0.102.2", features = [ +swc_core = { version = "1.0.3", features = [ "swc_atoms", "swc_common", "swc_ecma_ast", @@ -48,13 +48,13 @@ swc_core = { version = "0.102.2", features = [ "ecma_ast", "common", ] } -swc_ecma_parser = { version = "0.149.1" } -swc_config = { version = "0.1.15" } +swc_ecma_parser = { version = "1.0.1" } +swc_config = { version = "1.0.0" } [dev-dependencies] -swc_ecma_codegen = { version = "0.155.1" } -swc_ecma_transforms_compat = { version = "0.171.0" } -swc_ecma_transforms_module = { version = "0.190.0" } -swc_ecma_transforms_testing = { version = "0.148.0" } -swc_ecma_transforms = { version = "0.239.0" } -testing = { version = "0.39.0" } +swc_ecma_codegen = { version = "1.0.0" } +swc_ecma_transforms_compat = { version = "1.0.0" } +swc_ecma_transforms_module = { version = "1.0.0" } +swc_ecma_transforms_testing = { version = "1.0.0" } +swc_ecma_transforms = { version = "1.0.0" } +testing = { version = "1.0.0" } diff --git a/package.json b/package.json index a1b2b32..e4fc00b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swc-plugin-inferno", - "version": "0.0.23", + "version": "1.0.0", "description": "Inferno JSX plugin for SWC `@swc/core`", "main": "swc_plugin_inferno.wasm", "files": [ diff --git a/src/jsx/tests.rs b/src/jsx/tests.rs index 9a4c411..83c686d 100644 --- a/src/jsx/tests.rs +++ b/src/jsx/tests.rs @@ -13,7 +13,6 @@ use swc_core::ecma::visit::FoldWith; use swc_ecma_codegen::{Config, Emitter}; use swc_ecma_parser::{EsSyntax, Parser, Syntax}; use swc_ecma_transforms_compat::es3::property_literals; -use swc_ecma_transforms_module::common_js::common_js; use swc_ecma_transforms_testing::{parse_options, test, test_fixture, FixtureTestConfig, Tester}; use testing::NormalizedOutput; @@ -115,6 +114,7 @@ render(, null); */ test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -136,6 +136,7 @@ onComponentDidMount={childOnComponentDidMount} * Dynamic children */ test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -148,6 +149,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -160,6 +162,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -174,6 +177,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -186,6 +190,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -198,6 +203,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -210,6 +216,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -222,6 +229,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -234,6 +242,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -246,6 +255,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -258,6 +268,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -270,6 +281,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -282,6 +294,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -298,6 +311,7 @@ test!( */ test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -310,6 +324,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -322,6 +337,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -338,6 +354,7 @@ test!( */ test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -350,6 +367,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -362,6 +380,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -374,6 +393,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -390,6 +410,7 @@ test!( */ test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -402,6 +423,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -414,6 +436,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -426,6 +449,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -438,6 +462,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -450,6 +475,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -462,6 +488,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -474,6 +501,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -486,6 +514,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -498,6 +527,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -510,6 +540,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -522,6 +553,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -534,6 +566,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -546,6 +579,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -558,6 +592,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -570,6 +605,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -582,6 +618,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -594,6 +631,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -606,6 +644,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -618,6 +657,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -630,6 +670,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -643,6 +684,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -655,6 +697,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -667,6 +710,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -679,6 +723,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -691,6 +736,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -703,6 +749,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -715,6 +762,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -727,6 +775,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -739,6 +788,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -751,6 +801,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -763,6 +814,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -775,6 +827,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -824,6 +877,7 @@ test!( // "#); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -836,6 +890,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -848,6 +903,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -860,6 +916,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -872,6 +929,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -884,6 +942,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -896,6 +955,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -908,6 +968,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -920,6 +981,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -932,6 +994,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -944,6 +1007,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -956,6 +1020,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -968,6 +1033,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -980,6 +1046,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -992,6 +1059,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1004,6 +1072,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1016,6 +1085,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1028,6 +1098,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1040,6 +1111,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1052,6 +1124,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1064,6 +1137,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1076,6 +1150,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1088,6 +1163,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1100,6 +1176,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1112,6 +1189,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1124,6 +1202,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1136,6 +1215,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1148,6 +1228,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1160,6 +1241,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1172,6 +1254,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1184,6 +1267,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1196,6 +1280,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1210,6 +1295,7 @@ test!( // This could be optimized to have HasVNodeChildren set, // but I'm not sure if anybody writes code like this test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1222,6 +1308,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1250,6 +1337,7 @@ test!( // "#); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1262,6 +1350,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1278,7 +1367,7 @@ fn tr(t: &mut Tester, options: Options, top_level_mark: Mark) -> impl Fold { chain!( resolver(unresolved_mark, top_level_mark, false), - jsx(Some(t.comments.clone()), options, unresolved_mark), + jsx(Some(t.comments.clone()), options, unresolved_mark) ) } @@ -1336,6 +1425,7 @@ fn integration_tr(t: &mut Tester, options: FixtureOptions) -> impl Fold { } test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1350,6 +1440,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1368,6 +1459,7 @@ var bar = function () { ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1392,6 +1484,7 @@ var x = ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1407,6 +1500,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1424,6 +1518,7 @@ var profile =
); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1443,6 +1538,7 @@ var profile =
); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1466,6 +1562,7 @@ var profile =
); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1476,6 +1573,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1486,6 +1584,7 @@ test!( ); test!( + module, // This is not worth optimization if Inferno does not have support for static vNodes trees // cloning the element runtime is more expensive than creating new and adds extra memory ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { @@ -1518,6 +1617,7 @@ class App extends Component { ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1531,6 +1631,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1541,6 +1642,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1551,6 +1653,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1561,6 +1664,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1571,6 +1675,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1594,6 +1699,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1608,6 +1714,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1623,6 +1730,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1649,6 +1757,7 @@ var x = ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1659,6 +1768,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1669,6 +1779,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1679,11 +1790,11 @@ test!(
;
;
; -"#, - ok_if_code_eq +"# ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1701,11 +1812,11 @@ test!(
this should parse as unicode: {'\u00a0 '}
;
w < w
; -", - ok_if_code_eq +" ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1714,11 +1825,11 @@ test!( ported_should_escape_xhtml_jsxtext_2, r"
this should not parse as unicode: \u00a0
; -", - ok_if_code_eq +" ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1729,6 +1840,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1741,6 +1853,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1763,6 +1876,7 @@ Inferno.render( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1816,6 +1932,7 @@ var x = ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1826,6 +1943,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1836,28 +1954,29 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() }), |t| tr(t, Default::default(), Mark::fresh(Mark::root())), ported_should_not_strip_nbsp_even_coupled_with_other_whitespace, - r#"
 
;"#, - ok_if_code_eq + r#"
 
;"# ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() }), |t| tr(t, Default::default(), Mark::fresh(Mark::root())), ported_should_not_strip_tags_with_a_single_child_of_nbsp, - r#"
 
;"#, - ok_if_code_eq + r#"
 
;"# ); test!( + module, // Comments are currently stripped out ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, @@ -1880,6 +1999,7 @@ comment */ ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1912,6 +2032,7 @@ test!( // ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1922,6 +2043,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1935,6 +2057,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1945,6 +2068,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1955,6 +2079,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1965,6 +2090,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1975,6 +2101,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1985,6 +2112,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -1998,21 +2126,15 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() }), |t| { let top_level_mark = Mark::fresh(Mark::root()); - chain!( - tr(t, Default::default(), top_level_mark), - common_js( - top_level_mark, - Default::default(), - Default::default(), - Some(t.comments.clone()) - ) - ) + + tr(t, Default::default(), top_level_mark) }, issue_351, "import Inferno from 'inferno'; @@ -2021,6 +2143,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -2032,21 +2155,15 @@ test!( // https://github.com/swc-project/swc/issues/517 test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() }), |t| { let top_level_mark = Mark::fresh(Mark::root()); - chain!( - tr(t, Default::default(), top_level_mark), - common_js( - Mark::fresh(Mark::root()), - Default::default(), - Default::default(), - Some(t.comments.clone()) - ) - ) + + tr(t, Default::default(), top_level_mark) }, issue_517, "import Inferno from 'inferno'; @@ -2062,6 +2179,7 @@ fn jsx_text() { // https://github.com/swc-project/swc/issues/542 test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -2072,6 +2190,7 @@ test!( ); test!( + module, Syntax::Es(EsSyntax { jsx: true, ..Default::default() @@ -2115,6 +2234,7 @@ fn fixture(input: PathBuf) { &output, FixtureTestConfig { allow_error: true, + module: Some(true), ..Default::default() }, ); @@ -2140,6 +2260,7 @@ fn integration(input: PathBuf) { &output, FixtureTestConfig { allow_error: true, + module: Some(true), ..Default::default() }, ); diff --git a/src/refresh/tests.rs b/src/refresh/tests.rs index 821e5b1..771aafe 100644 --- a/src/refresh/tests.rs +++ b/src/refresh/tests.rs @@ -28,6 +28,7 @@ fn tr(t: &mut Tester) -> impl Fold { } test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -71,6 +72,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -92,6 +94,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -122,6 +125,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -143,6 +147,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -483,6 +488,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -653,6 +659,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() @@ -702,6 +709,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Typescript(::swc_ecma_parser::TsSyntax { tsx: true, ..Default::default() @@ -742,6 +750,7 @@ test!( ); test!( + module, ::swc_ecma_parser::Syntax::Es(::swc_ecma_parser::EsSyntax { jsx: true, ..Default::default() diff --git a/tests/__swc_snapshots__/src/jsx/tests.rs/issue_351.js b/tests/__swc_snapshots__/src/jsx/tests.rs/issue_351.js index 858d5ce..a2e8862 100644 --- a/tests/__swc_snapshots__/src/jsx/tests.rs/issue_351.js +++ b/tests/__swc_snapshots__/src/jsx/tests.rs/issue_351.js @@ -1,6 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _inferno = /*#__PURE__*/ _interop_require_wildcard(require("inferno")); -/*#__PURE__*/ (0, _inferno.createVNode)(1, "div"); +import Inferno, { createVNode } from 'inferno'; +/*#__PURE__*/ createVNode(1, "div"); diff --git a/tests/__swc_snapshots__/src/jsx/tests.rs/issue_517.js b/tests/__swc_snapshots__/src/jsx/tests.rs/issue_517.js index 8a87fa3..5e247e1 100644 --- a/tests/__swc_snapshots__/src/jsx/tests.rs/issue_517.js +++ b/tests/__swc_snapshots__/src/jsx/tests.rs/issue_517.js @@ -1,8 +1,4 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _inferno = /*#__PURE__*/ _interop_require_wildcard(require("inferno")); -/*#__PURE__*/ (0, _inferno.createVNode)(1, "div", null, "Hello World", 16, { +import Inferno, { createVNode } from 'inferno'; +/*#__PURE__*/ createVNode(1, "div", null, "Hello World", 16, { style: "white-space: pre" });