commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
1b3672f1e7d38a0039b1ba0ebc136133dd8c907f
Donny/κ°•λ™μœ€
2024-06-22T00:54:52
perf(es/lexer): Use `memchr::memmem` for lexing block comments (#9096) **Description:** This PR also makes the lexer more CPU-cache friendly.
diff --git a/Cargo.lock b/Cargo.lock index f046ab34fd..ff0a789cc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4510,6 +4510,7 @@ version = "0.146.3" dependencies = [ "criterion", "either", + "memchr", "new_debug_unreachable", "num-bigint", "num-traits", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates...
6
79
74
2f02630b1e597692ce5a3d946f8d498ca33709dd
Donny/κ°•λ™μœ€
2024-06-21T17:23:57
perf(es/lexer): Apply various optimizations (#9095) **Description:** - `TokenContexts` now uses smallvec, as the element type is very small (1 byte) now. - Some codes are moved to allow CPU to cache code correctly.
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index aaaab140a0..d6fc4fc150 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -1210,6 +1210,7 @@ impl<'a> Lexer<'a> { Ok(Token::Regex(content, flags)) } + ...
3
123
117
a2645e2fa0a55c4dbe519b6f8baa9e83a69bb2f0
Donny/κ°•λ™μœ€
2024-06-21T13:25:16
feat(swc_core): Reexport `swc_typescript` (#9092)
diff --git a/Cargo.lock b/Cargo.lock index 9b11480354..e420e82b9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3975,6 +3975,7 @@ dependencies = [ "swc_plugin_runner", "swc_trace_macro", "swc_transform_common", + "swc_typescript", "testing", "vergen", ] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_cor...
3
11
0
5625bd64bd7d851f6b64d504e942811c6f1efaef
κ°•λ™μœ€ (Donny)
2024-06-21T11:21:43
chore: Bump crates
diff --git a/Cargo.lock b/Cargo.lock index 255f92fc73..9b11480354 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3766,7 +3766,7 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.230.0" +version = "0.230.1" dependencies = [ "anyhow", "crc", @@ -4793,7 +4793,7 @@ dependencies = [ [[package]] n...
3
4
4
63fd29e7990819a1be7c31db9b37ea0dc2726267
κ°•λ™μœ€ (Donny)
2024-06-21T11:17:40
chore: Workaround a bug of `cargo-mono`
diff --git a/Cargo.lock b/Cargo.lock index ef94e93398..255f92fc73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5287,7 +5287,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "0.1.0" +version = "0.1.1" dependencies = [ "swc_atoms", "swc_common", diff --git a/crates/swc_typescript/Cargo.toml b...
2
9
9
5a2c968720141b115ec2055ea13ae6d025175e95
Luca Casonato
2024-06-21T11:17:50
chore(deps): Replace `sha-1` with `sha1` (#9091) They renamed the crate: https://github.com/RustCrypto/hashes?tab=readme-ov-file#crate-names
diff --git a/Cargo.lock b/Cargo.lock index 69b96123a7..ef94e93398 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3422,17 +3422,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28...
4
5
16
e423d1bcedc24803eaeeed4c72cc84fe9a938f65
Donny/κ°•λ™μœ€
2024-06-21T08:49:43
feat(common): Add fallible methods to `swc_common::SourceMap` (#9090) **Description:** This PR will make `swc_ecma_codegen` not `panic` for invalid spans.
diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 30fc3eb1ea..0283d67a30 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -276,8 +276,13 @@ impl SourceMap { /// Lookup source information about a BytePos pub fn lookup_cha...
2
86
29
56f128fc039b032fba797da015cccecc8ba5d7b7
Donny/κ°•λ™μœ€
2024-06-21T03:45:53
chore: Add a crate `swc_typescript` (#9085) **Description:** This crate will be used for TypeScript Isolated Declaration support
diff --git a/Cargo.lock b/Cargo.lock index 16f9eaaa32..ffc3b602f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5296,6 +5296,10 @@ dependencies = [ "serde_json", ] +[[package]] +name = "swc_typescript" +version = "0.1.0" + [[package]] name = "swc_visit" version = "0.5.14" diff --git a/Cargo.toml b/Cargo.toml ind...
4
30
0
bad7da2bfd6795e454dc11bd60b1d22d7789b7dd
Donny/κ°•λ™μœ€
2024-06-19T06:19:50
chore: Update `new_debug_unreachable` (#9083)
diff --git a/Cargo.lock b/Cargo.lock index abea40788c..aff990671a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2312,9 +2312,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a2473621...
2
3
3
af586069a922525dc24b5f59aefaf53daed7759a
Donny/κ°•λ™μœ€
2024-06-19T01:12:37
perf(es/lexer): Add fast-path to jsx lexer (#9081)
diff --git a/crates/swc_ecma_parser/src/lexer/jsx.rs b/crates/swc_ecma_parser/src/lexer/jsx.rs index 49c8d8181d..924b90523d 100644 --- a/crates/swc_ecma_parser/src/lexer/jsx.rs +++ b/crates/swc_ecma_parser/src/lexer/jsx.rs @@ -1,4 +1,5 @@ use either::Either; +use smartstring::{LazyCompact, SmartString}; use super::...
1
39
15
238f1c50e5b27a8655e10ac2b2be723b62233931
Donny/κ°•λ™μœ€
2024-06-19T00:43:57
perf(es/lexer): Add a fast-path to template literal lexer (#9080) **Description:** We don't need to allocate at all in the fast path.
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index cb553589ed..aaaab140a0 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -1257,7 +1257,21 @@ impl<'a> Lexer<'a> { } } - ...
1
16
2
69f00b85d465e882ec33642d6e8ed22dbe3c3fb2
Donny/κ°•λ™μœ€
2024-06-18T08:53:59
perf(es/lexer): Reduce allocation while lexing identifiers (#9076) **Description:** In the fast path, we don't even use the buffer. ``` Benchmarking es/lexer/cal-com Benchmarking es/lexer/cal-com: Warming up for 3.0000 s Benchmarking es/lexer/cal-com: Collecting 100 samples in estimated 5.5395 s (900 iteratio...
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 7f64433c16..cb553589ed 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -1,12 +1,12 @@ //! ECMAScript lexer. -use std::{cell::RefCell, char, iter::FusedIterator, r...
1
79
36
373bac55aaffbe1f6e001c7c6d490797de45114e
Donny/κ°•λ™μœ€
2024-06-18T08:27:17
perf(es/lexer): Make lexing of string literals faster (#9077) **Description:** We don't need to push a character at a time. This profiling result does not include improvements from https://github.com/swc-project/swc/pull/9076. ``` Benchmarking es/lexer/cal-com es/lexer/cal-com time: [6.4555 ms 6.4936...
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 0e6c0330e5..7f64433c16 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -969,24 +969,42 @@ impl<'a> Lexer<'a> { fn read_str_lit(&mut self) -> LexResult<Token> { ...
1
83
26
6426928b912baa6573b902d7d3c85bcd49b2e823
Donny/κ°•λ™μœ€
2024-06-18T07:32:32
perf(es/lexer): Optimize lexer (#9075) **Description:** - `TokenContext` is now 1 byte. - `read_word_with` now uses `&dyn` instead of `impl FnOnce`.
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index b50bd0d43e..0e6c0330e5 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -754,7 +754,7 @@ impl<'a> Lexer<'a> { /// character. fn read_word_with( &mu...
3
46
53
7698eaa006d2951df0e0e0cb5680fe531d64dcf4
Donny/κ°•λ™μœ€
2024-06-18T03:45:56
perf(common): Use `Chars` in `StringInput` (#9073) **Description:** Now it's possible
diff --git a/crates/swc_common/src/input.rs b/crates/swc_common/src/input.rs index fdb26fba2d..a743ff3c60 100644 --- a/crates/swc_common/src/input.rs +++ b/crates/swc_common/src/input.rs @@ -11,7 +11,7 @@ pub type SourceFileInput<'a> = StringInput<'a>; pub struct StringInput<'a> { last_pos: BytePos, /// Curr...
1
10
10
c3a8c0b56755f17d0611f6559689a5cfb3185c33
Donny/κ°•λ™μœ€
2024-06-18T02:54:34
refactor(common): Simplify `StringInput` implementation (#9071)
diff --git a/crates/swc_common/src/input.rs b/crates/swc_common/src/input.rs index 2a649d5d0d..fdb26fba2d 100644 --- a/crates/swc_common/src/input.rs +++ b/crates/swc_common/src/input.rs @@ -9,7 +9,6 @@ pub type SourceFileInput<'a> = StringInput<'a>; /// Implementation of [Input]. #[derive(Clone)] pub struct StringI...
2
5
25
ca26eb796b1aefa150ccab7b16822ecb748aca7b
Donny/κ°•λ™μœ€
2024-06-16T00:52:53
perf(es/parser): Reduce allocations while lexing numbers (#9057)
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index b6f285eea4..a7cd738a61 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -4,7 +4,6 @@ use std::{cell::RefCell, char, iter::FusedIterator, rc::Rc}; use either::Eithe...
3
32
77
bc8ec625ecee8a077fe84de371c490be14a1a033
Donny/κ°•λ™μœ€
2024-06-15T09:01:40
perf(es/parser): Reduce allocations for `raw` while lexing numbers (#9056)
diff --git a/crates/swc_ecma_parser/src/lexer/number.rs b/crates/swc_ecma_parser/src/lexer/number.rs index 809dfdd0bc..9f02460ce3 100644 --- a/crates/swc_ecma_parser/src/lexer/number.rs +++ b/crates/swc_ecma_parser/src/lexer/number.rs @@ -55,14 +55,18 @@ impl<'a> Lexer<'a> { let starts_with_zero = self.cur...
1
55
41
ab226dcfb7abea0b14430697c53c0002bd823866
Donny/κ°•λ™μœ€
2024-06-15T08:24:12
feat(es/ast): Add more utilities (#9054)
diff --git a/crates/swc_ecma_ast/src/expr.rs b/crates/swc_ecma_ast/src/expr.rs index 05ac8058a4..ed48bcf59b 100644 --- a/crates/swc_ecma_ast/src/expr.rs +++ b/crates/swc_ecma_ast/src/expr.rs @@ -1,4 +1,6 @@ #![allow(clippy::vec_box)] +use std::mem::transmute; + use is_macro::Is; use string_enum::StringEnum; use swc...
11
110
42
12e1c5d03600bb42a3a18ff7a2471712780a8304
κ°•λ™μœ€ (Donny)
2024-06-14T06:28:28
chore: Bump crates
diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 098254c01f..4209ceece8 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_core" repository = "https://github.com/swc-project/swc...
2
2
2
32e23edd8591784bda2b49f941611b01a60e9a80
Donny/κ°•λ™μœ€
2024-06-14T06:13:05
refactor(es/parser): Remove unused `raw: Raw` params (#9048)
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 41c16265e8..b6f285eea4 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -429,11 +429,7 @@ impl<'a> Lexer<'a> { /// Read an escaped character for string literal. ...
2
12
54
60fe5f0effdcc45f0cfd363fd0ff4e6f4dba5b33
Donny/κ°•λ™μœ€
2024-06-14T05:22:26
perf(es/parser): Do not track `raw` by hand (#9047) **Description:** We can skip this logic completely, as it's `raw`. ~I'm under the impression that I'm super stupid~
diff --git a/crates/swc_ecma_ast/src/expr.rs b/crates/swc_ecma_ast/src/expr.rs index 85c905a314..825014cc7a 100644 --- a/crates/swc_ecma_ast/src/expr.rs +++ b/crates/swc_ecma_ast/src/expr.rs @@ -1020,6 +1020,8 @@ pub struct TplElement { /// don't have to worry about this value. pub cooked: Option<Atom>, + ...
6
44
81
733dcc6b83e77a2571a3fee307a73fc0c17bd44c
Donny/κ°•λ™μœ€
2024-06-12T07:43:16
fix(xtask): Fix `nightly` action (#9042)
diff --git a/xtask/src/npm/nightly.rs b/xtask/src/npm/nightly.rs index d90f16cb4b..35de6b6e8c 100644 --- a/xtask/src/npm/nightly.rs +++ b/xtask/src/npm/nightly.rs @@ -1,28 +1,23 @@ use std::process::{Command, Stdio}; -use anyhow::{Context, Result}; +use anyhow::{ensure, Context, Result}; use chrono::Utc; use clap:...
2
11
72
2ecd550d5882feed5d7948ae2944c6add8f83248
SWC Bot
2024-06-12T07:33:17
chore: Publish 1.5.29-nightly-20240612.1
diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 7407600ae2..943857443e 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.279" +version = "0.91.280" dependencies = [ "anyhow", "swc_cli_impl", diff --git a/...
2
2
2
5bffd0ff9b9548e1585b7e791a3f35ad0a83e1e0
Donny/κ°•λ™μœ€
2024-06-12T01:12:05
perf(es/parser): Optimize lexing of template literals, again (#9037) **Description:** Applies same trick as #9036, but for `cooked`
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 509084c1c7..0c0d3e1876 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -1159,9 +1159,34 @@ impl<'a> Lexer<'a> { let start = self.cur_pos(); let m...
1
33
24
6ab19a1b5f37e7f485f392ef3b63af024ae9e644
Donny/κ°•λ™μœ€
2024-06-11T12:20:00
perf(es/parser): Optimize lexing of template literals (#9036) **Description:** We don't need to push one char at a time.
diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 61eb37df48..509084c1c7 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -1160,6 +1160,7 @@ impl<'a> Lexer<'a> { let mut cooked = Ok(String::new()); ...
1
26
4
39654bf1e7136077d2db2f85a93591708b4cfe8c
Donny/κ°•λ™μœ€
2024-06-11T07:14:01
fix(es): Make `output` field optional (#9033)
diff --git a/crates/swc_compiler_base/src/lib.rs b/crates/swc_compiler_base/src/lib.rs index 14291a9d58..fdb82e773d 100644 --- a/crates/swc_compiler_base/src/lib.rs +++ b/crates/swc_compiler_base/src/lib.rs @@ -270,7 +270,9 @@ where Ok(TransformOutput { code, map, - output: Some(serde_json...
1
3
1
825749f44052234ba0de9db3f4cea40517ddd917
Donny/κ°•λ™μœ€
2024-06-07T12:00:26
feat(es): Integrate experimental data API (#9027)
diff --git a/Cargo.lock b/Cargo.lock index 983ab08638..db5e397a56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3754,6 +3754,7 @@ dependencies = [ "swc_plugin_proxy", "swc_plugin_runner", "swc_timer", + "swc_transform_common", "swc_visit", "testing", "tokio", @@ -3898,7 +3899,9 @@ dependencies = [ "napi-de...
7
40
16
2e22b5dc4f37f627950f1f334268469b20a5b4aa
κ°•λ™μœ€ (Donny)
2024-06-07T02:17:20
chore: Fix `nightly` of xtask
diff --git a/xtask/src/npm/nightly.rs b/xtask/src/npm/nightly.rs index e567c89ee9..d90f16cb4b 100644 --- a/xtask/src/npm/nightly.rs +++ b/xtask/src/npm/nightly.rs @@ -23,9 +23,10 @@ impl NightlyCmd { update_swc_crates().context("failed to update swc crates")?; - let root_pkg_json = repositor...
1
3
2
6ce112cfebc9be87df7d6e532a67a1af43cc0038
Donny/κ°•λ™μœ€
2024-06-05T10:37:28
feat(es/transforms): Add an API for returning metadata to JS (#9022)
diff --git a/Cargo.lock b/Cargo.lock index f63935faa2..c36b02d6d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3982,6 +3982,7 @@ dependencies = [ "swc_plugin_proxy", "swc_plugin_runner", "swc_trace_macro", + "swc_transform_common", "testing", "vergen", ] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_c...
4
21
0
2b81d72333caa07c7b072db2e11c672be19e56a4
κ°•λ™μœ€ (Donny)
2024-06-05T06:46:04
chore: Workaround the bug of `cargo-mono`
diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 627f0d06d1..964e81a4d0 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -1,11 +1,11 @@ [package] -authors = ["κ°•λ™μœ€ <kdy1997.dev@gmail.com>"] -description = "Debug utilities" -edition = "2...
4
33
33
668a11d50d768bf3f4712fd0e84ad17b1239c469
SWC Bot
2024-06-05T06:32:40
chore: Bump crates
diff --git a/Cargo.lock b/Cargo.lock index 4abdb39e23..de08d93385 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,7 +1064,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbg-swc" -version = "0.93.4" +version = "0.93.5" dependencies = [ "anyhow", "clap 3....
2
2
2
7f08b03231235c9cfd892cd2597c7fa51a214cc3
huajingyun
2024-06-05T06:31:01
chore: Bump `libc` crate (#9001)
diff --git a/Cargo.lock b/Cargo.lock index 88db4768e3..4abdb39e23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2032,9 +2032,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f...
1
2
2
3bf31148ba5058323ee89bb2ca74b641c52c0669
Donny/κ°•λ™μœ€
2024-06-04T09:51:25
perf(es/parser): Add feature named `tracing-spans` (#9019)
diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 64d847b641..32a45538b8 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -18,10 +18,11 @@ bench = false [features] # Used for debugging -debug = [] -default = ["typescript", "stac...
3
21
20
2fb890cf2019039d3881ddb9c4ce12ca9b1239b7
κ°•λ™μœ€ (Donny)
2024-06-04T00:09:39
chore: Publish crates
diff --git a/Cargo.lock b/Cargo.lock index f826baa78a..59845e7850 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4173,7 +4173,7 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.113.5" +version = "0.113.6" dependencies = [ "arbitrary", "bitflags 2.5.0", diff --git a/crates/swc_ecma_ast/Cargo.to...
2
2
2
9f8e24a76c00b8f4470aadf22f071a60f409a13d
Donny/κ°•λ™μœ€
2024-06-02T10:32:44
fix(es/minifier): Fix evaluation of `-0` as a string (#9011) **Related issue:** - Closes #9010 --------- Co-authored-by: magic-akari <akari.ccino@gmail.com>
diff --git a/Cargo.lock b/Cargo.lock index ed96f8d0eb..6af6fe00a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3225,9 +3225,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac...
7
40
12
2879a4d42b18e7e9d6bc12119a799c6a8c95e108
Donny/κ°•λ™μœ€
2024-06-02T03:35:43
fix(es/minifier): Do not index a string with a surrogate pair (#9013) **Related issue:** - Closes #9008
diff --git a/crates/swc_ecma_minifier/tests/exec.rs b/crates/swc_ecma_minifier/tests/exec.rs index 8ac36c3f02..30ea00ed50 100644 --- a/crates/swc_ecma_minifier/tests/exec.rs +++ b/crates/swc_ecma_minifier/tests/exec.rs @@ -11294,6 +11294,11 @@ fn issue_8964() { ); } +#[test] +fn issue_9008() { + run_default_...
2
16
9
da70ebed692d734ac4c042cd6a67fee9da793731
Donny/κ°•λ™μœ€
2024-05-31T00:56:21
feat(x): Initialize project (#8999) **Description:** SWC X will be a cross-module optimizer that utilizes an enormous amount of information. After merging this, I'll experiment with several approaches.
diff --git a/Cargo.lock b/Cargo.lock index 1118a1a88d..0559ceb014 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5299,6 +5299,10 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "swc_x_optimizer" +version = "0.1.0" + [[package]] name = "swc_xml" version = "0.13.22" diff --git a/Cargo.toml b/Cargo.toml ind...
4
30
0
2a43df49848267ba68a320370e3a5818bf14478e
Donny/κ°•λ™μœ€
2024-05-24T00:16:42
fix(es/minifier): Fix comparison of `-0.0` and `0` (#8973) **Related issue:** - Closes #8972
diff --git a/crates/swc_ecma_minifier/src/compress/util/mod.rs b/crates/swc_ecma_minifier/src/compress/util/mod.rs index 7834921313..eed2bbc304 100644 --- a/crates/swc_ecma_minifier/src/compress/util/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/util/mod.rs @@ -1,4 +1,4 @@ -use std::f64; +use std::{cmp::Ordering, ...
2
33
3
a4567998b0570fe7b657ce1361bd4e7c7d900999
Donny/κ°•λ™μœ€
2024-05-23T03:13:13
fix(es/codegen): Accept `&impl Node` instead of `impl Node` (#8969)
diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index 3da2431743..648856c0e1 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -42,7 +42,7 @@ pub type Result = io::Result<()>; pub fn to_code_default( cm: Lrc<SourceMap>, comments: ...
3
5
5
e80fd41ea806f118ec9eeaa292f840c75aac3967
Donny/κ°•λ™μœ€
2024-05-23T02:23:32
feat(es/codegen): Add `to_code` (#8968) **Description:** This is a utility function for printing an AST node as a string
diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index 3ef445fd52..3da2431743 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -13,7 +13,7 @@ use swc_atoms::Atom; use swc_common::{ comments::{CommentKind, Comments}, sync::Lrc, - ...
4
40
73
ced63a973e48e542bc889675b2f2d4fb48abfb8d
Donny/κ°•λ™μœ€
2024-05-21T01:21:27
feat(plugin/runner): Add description about wasi and file system (#8963) **Description:** - x-ref: https://vercel.slack.com/archives/C01QNLABZJ8/p1715816821287309?thread_ts=1715793483.177469&cid=C01QNLABZJ8
diff --git a/crates/swc_plugin_runner/src/transform_executor.rs b/crates/swc_plugin_runner/src/transform_executor.rs index b79c9eb5ff..a764d3962b 100644 --- a/crates/swc_plugin_runner/src/transform_executor.rs +++ b/crates/swc_plugin_runner/src/transform_executor.rs @@ -394,7 +394,9 @@ impl TransformExecutor { ...
1
3
1
ff60960afe3f2866e5c98f0414884fa93b5ab3f6
Donny/κ°•λ™μœ€
2024-05-14T00:55:06
doc(es/typescript): Fix example (#8952) **Related issue:** - Closes #8950
diff --git a/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs b/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs index fd70e020fd..00e0b3c41f 100644 --- a/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs +++ b/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs @@ -52,7 +52,7 @@ fn ...
1
3
3
606cb677c42dd43c24ba49ad0912998e33159560
Donny/κ°•λ™μœ€
2024-05-13T09:14:21
fix(es): Allow input source map file to be omitted (#8951) **Description:** Some libraries generate source maps but do not upload them to npm, which causes SWC to fail. **Related issue:** - https://github.com/swc-project/swc/issues/8789#issuecomment-2105055772
diff --git a/crates/swc/src/lib.rs b/crates/swc/src/lib.rs index 1b8ed41647..0ead40dfde 100644 --- a/crates/swc/src/lib.rs +++ b/crates/swc/src/lib.rs @@ -114,6 +114,7 @@ extern crate swc_common as common; use std::{ fs::{read_to_string, File}, + io::ErrorKind, path::{Path, PathBuf}, sync::Arc, };...
1
19
0
772c50fd7610768c43cf795b03dcae1d00f715d2
Donny/κ°•λ™μœ€
2024-05-13T00:46:29
fix(es/minifier): Fix evaluation of `String.charCodeAt` (#8946) **Related issue:** - Closes #8943
diff --git a/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs b/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs index ee3e60ba70..d6f6e1db14 100644 --- a/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs +++ b/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs @@ -711,8 +711,13 @@ impl Pure<'_> { ...
2
56
0
8932a1b527a685917e7c24f5fd434a71468abcd8
Austaras
2024-05-07T06:19:24
refactor(es/minifier): Remove unnecessary check (#8927)
diff --git a/crates/swc_ecma_minifier/src/compress/optimize/iife.rs b/crates/swc_ecma_minifier/src/compress/optimize/iife.rs index 2ea598c698..fdc82e1123 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/iife.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/iife.rs @@ -751,18 +751,6 @@ impl Optimizer<'...
1
0
12
0dcdae9bdaaf9687f14be8408b94b3896fad4d55
SWC Bot
2024-04-29T00:56:23
chore: Bump crates
diff --git a/Cargo.lock b/Cargo.lock index 78ffe120c4..20957b6a07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3936,7 +3936,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.91.1" +version = "0.91.2" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/swc_core/Cargo.toml b/crates/s...
2
2
2
7b08d38b8475c431d90368fb8718dc846aba3b9b
κ°•λ™μœ€ (Donny)
2024-04-23T03:19:30
chore: Update bindings
diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 97242d25d9..9fbed1b8c3 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -2961,9 +2961,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.273.27" +version = "0.273.28" source = "registry+https://github.com/rust-lang/crates.io-index"...
1
8
8
e22c3681a6705f2184f0af7032ed30103ab9bfcc
yehonatanz
2024-04-19T13:38:19
fix(es/resolver): Prioritze `jsc.paths` by length in tsc resolver (#8875) **Description:** See #8858 **BREAKING CHANGE:** `jsc.paths` are now prioritized differently to align with `tsc`. The order is: 1. Exact matches 2. Wildcard pattern matches, sorted by length of prefix before wildcard **Related issu...
diff --git a/crates/swc_ecma_loader/src/resolvers/tsc.rs b/crates/swc_ecma_loader/src/resolvers/tsc.rs index 293b7e578f..844686d858 100644 --- a/crates/swc_ecma_loader/src/resolvers/tsc.rs +++ b/crates/swc_ecma_loader/src/resolvers/tsc.rs @@ -1,4 +1,7 @@ -use std::path::{Component, Path, PathBuf}; +use std::{ + cmp:...
2
49
2
6e9d1a4ebfa705d58b576f5de32d4a17393d4e81
Donny/κ°•λ™μœ€
2024-04-18T04:58:21
fix(es/helpers): Fix resolving of `usingCtx` helper (#8874) **Related issue:** - Closes #8872
diff --git a/crates/swc_ecma_transforms_base/src/helpers/mod.rs b/crates/swc_ecma_transforms_base/src/helpers/mod.rs index c313faa912..640d4347a0 100644 --- a/crates/swc_ecma_transforms_base/src/helpers/mod.rs +++ b/crates/swc_ecma_transforms_base/src/helpers/mod.rs @@ -585,7 +585,7 @@ impl VisitMut for Marker { ...
1
82
1
2ec3282722e44c60433d5cdd6a081cac81090885
κ°•λ™μœ€ (Donny)
2024-04-16T23:35:45
chore: Pin version of `proc-macro2` to `v1.0.79`
diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index bb9dcccc79..e43d21078e 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -276,6 +276,7 @@ dependencies = [ "napi-derive", "node_macro_deps", "path-clean 0.1.0", + "proc-macro2", "serde", "serde_json", "sourcemap", @@ -297,6 +298,7 @@ v...
5
8
1
13f7ef70d9d4dd597c0995024a5dfa6ba40380fd
κ°•λ™μœ€ (Donny)
2024-04-16T11:18:36
chore: Pin version of `proc-macro2`
diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index f46bfade4f..a236ae853f 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -219,6 +219,7 @@ dependencies = [ "napi-derive", "node_macro_deps", "path-clean 0.1.0", + "proc-macro2", "serde", "serde_json", "swc_core", @@ -235,6 +236,7 @@ ve...
3
7
3
740c0bb00a0bb9e0f4d808c9dc71e8087d416f72
Donny/κ°•λ™μœ€
2024-04-16T04:39:54
fix(es/minifier): Remove `raw` of strings after modification (#8865) **Related issue:** - Closes #8864
diff --git a/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs b/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs index 1c29a585a2..ee3e60ba70 100644 --- a/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs +++ b/crates/swc_ecma_minifier/src/compress/pure/evaluate.rs @@ -742,9 +742,10 @@ impl Pure<'_> { ...
2
21
1
62c4f5efb84daa5f9e7f88bbbfddd7823bb1355d
Hana
2024-04-12T08:05:34
fix(es/plugin): Create `tokio` runtime only if necessary (#8845) **Description:** Create tokio runtime if it's not in an async context. **Related issue:** - https://github.com/web-infra-dev/rspack/issues/6209 This maybe related to this issue, since creating new tokio runtime consumes a lot of system resou...
diff --git a/crates/swc/src/plugin.rs b/crates/swc/src/plugin.rs index 0cf9b37c3e..35be19cd62 100644 --- a/crates/swc/src/plugin.rs +++ b/crates/swc/src/plugin.rs @@ -55,16 +55,19 @@ impl RustPlugins { return Ok(n); } - tokio::runtime::Runtime::new() - .unwrap() - .b...
1
12
9
c0d901eac6539940ce1956ec5031f624c4c049f0
magic-akari
2024-04-12T04:47:08
doc(swc_core): Resolve build issue with `--all-features` flag (#8848) **Related issue:** - Closes #8829
diff --git a/crates/swc_common/src/plugin/mod.rs b/crates/swc_common/src/plugin/mod.rs index 2185d1d269..66be51bc00 100644 --- a/crates/swc_common/src/plugin/mod.rs +++ b/crates/swc_common/src/plugin/mod.rs @@ -23,5 +23,8 @@ pub mod serialized; pub const PLUGIN_TRANSFORM_AST_SCHEMA_VERSION: u32 = 1; // Reserved for...
1
4
1
e8c63447f64076de64002bcb5a3124b809df44ed
David Sherret
2024-04-11T01:03:29
refactor(es/decorator): Remove unsafe code (#8839)
diff --git a/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs b/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs index 3dbedf9c99..e6897ecbbb 100644 --- a/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs +++ b/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs @@ -1,8 +1,4 ...
1
17
17
3a51140dd77ccf2cc35098a72c411b05de418ff1
David Sherret
2024-04-10T23:43:07
refactor(es): Make the code compile with `miri` (#8836)
diff --git a/crates/swc_ecma_codegen/src/comments.rs b/crates/swc_ecma_codegen/src/comments.rs index 8ab20dcfb7..c37e842f91 100644 --- a/crates/swc_ecma_codegen/src/comments.rs +++ b/crates/swc_ecma_codegen/src/comments.rs @@ -1,5 +1,3 @@ -use swc_common::comments::CommentKind; - use super::*; macro_rules! write_co...
10
13
35
b1973d490afc8e4bc597192caab7a3aa8eb2701d
David Sherret
2024-04-10T23:00:14
refactor(visit): Simplify `Vec::move_map` (#8838)
diff --git a/crates/swc_visit/src/util/move_map.rs b/crates/swc_visit/src/util/move_map.rs index 69b85a22fc..6f6abf05ab 100644 --- a/crates/swc_visit/src/util/move_map.rs +++ b/crates/swc_visit/src/util/move_map.rs @@ -26,26 +26,21 @@ impl<T> MoveMap<T> for Vec<T> { where F: FnMut(T) -> T, { - ...
1
8
13
dc046572def13a3eb625520c5a8bfd651b86f3a3
David Sherret
2024-04-09T01:21:03
fix(visit): Improve `Map` implementation for `Box` (#8819) **Related issue (if exists):** - Closes #8817
diff --git a/crates/swc_visit/src/util/map.rs b/crates/swc_visit/src/util/map.rs index 1b3eb7d07b..992d233264 100644 --- a/crates/swc_visit/src/util/map.rs +++ b/crates/swc_visit/src/util/map.rs @@ -1,4 +1,4 @@ -use std::{mem, ptr}; +use std::ptr; /// Copied from `syntax::ptr::P` of rustc. pub trait Map<T> { @@ -13...
1
3
5
089f61bc37bb9c09dc94a24a5518840883827f57
Donny/κ°•λ™μœ€
2024-04-08T15:19:28
fix(plugin/runner): Pin version of `virtual-fs` (#8827)
diff --git a/Cargo.lock b/Cargo.lock index 76d4e2c5e9..8d7e1bde21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1717,7 +1717,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -5248,6 +5248,7 @@ dependencies = [ "test...
2
5
3
974f5c759c7736ab521d18c8e7bd88210691a2ab
David Sherret
2024-04-04T23:17:28
fix(es/transforms): Fix capacity overflow with decorators (#8815) **Description:** Fixes an incorrect capacity (found while investigating a segfault). More details: https://github.com/denoland/deno/pull/23187#issuecomment-2036266885
diff --git a/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs b/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs index 649c1ec2e0..4adc3f41e8 100644 --- a/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs +++ b/crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs @@ -1,4 +1,5 ...
2
62
36
4f9ab8151dad9984c81c72eb10c2afe5313a7591
Donny/κ°•λ™μœ€
2024-04-03T02:33:25
fix(common): Fix source index for `inputSourceMap` (#8800) **Related issue:** - Closes #8789
diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index beccf76aca..d1a951dfae 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1225,7 +1225,7 @@ impl SourceMap { if let Some(orig) = orig { for src in orig.sources()...
1
1
1
0745624cb71e12b18b06d9ee106066d8b585c4c6
Donny/κ°•λ™μœ€
2024-04-02T07:30:26
perf(atoms): Update `hstr` (#8799) **Description:** **Related issue:** - https://github.com/dudykr/ddbase/pull/27 - https://github.com/dudykr/ddbase/pull/29
diff --git a/Cargo.lock b/Cargo.lock index b76b834937..5fde45311e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1655,15 +1655,16 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust...
2
15
4
571d29781a90f4def4811ae46fa4a5f966e461e6
Donny/κ°•λ™μœ€
2024-04-01T05:26:18
feat(plugin/runner): Improve error message for Wasm plugin crashes (#8794) **Related issue:** - Closes #4333
diff --git a/crates/swc_plugin_runner/src/transform_executor.rs b/crates/swc_plugin_runner/src/transform_executor.rs index a4e681e571..ae8d3a5c9b 100644 --- a/crates/swc_plugin_runner/src/transform_executor.rs +++ b/crates/swc_plugin_runner/src/transform_executor.rs @@ -1,6 +1,6 @@ use std::{env, sync::Arc}; -use an...
1
9
2
95c822e7c43470e4c972bef00d97e7e0de02e0b0
XiaoPi
2024-04-01T02:27:38
fix(es/parser): Tweak msg of `SyntaxError::UsingDeclNotEnabled` (#8791)
diff --git a/crates/swc_ecma_parser/src/error.rs b/crates/swc_ecma_parser/src/error.rs index c61d04b0ab..1715555dd4 100644 --- a/crates/swc_ecma_parser/src/error.rs +++ b/crates/swc_ecma_parser/src/error.rs @@ -540,9 +540,9 @@ impl SyntaxError { SyntaxError::UsingDeclNotAllowedForForInLoop => { ...
1
3
3
6f780ca749a611f54aa4deb628e532fd0a12228f
Donny/κ°•λ™μœ€
2024-04-01T02:01:23
perf(es/parser): Use faster unicode crate (#8785)
diff --git a/Cargo.lock b/Cargo.lock index bc7379d6b3..55ad632ce1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4175,7 +4175,7 @@ dependencies = [ "string_enum", "swc_atoms", "swc_common", - "unicode-id", + "unicode-id-start", ] [[package]] diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Carg...
3
7
9
37f0a7994bdf7d90c30a00f70c6dde97b4d89c8f
Paolo Barbolini
2024-04-01T01:34:46
chore(es/transforms): Add `repository` field to `swc_ecma_ext_transforms` (#8793)
diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 82e57b5c0b..bc858cf1bd 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -5,6 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_ext_transforms/" editio...
1
1
0
2920a88cf772092b63a16d2913704e4e5ebed754
Donny/κ°•λ™μœ€
2024-03-26T01:55:18
build(bindings/node): Update `sourcemap` (#8777)
diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index b62e1b1a97..6f48cefc79 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -277,7 +277,7 @@ dependencies = [ "path-clean 0.1.0", "serde", "serde_json", - "sourcemap 6.4.1", + "sourcemap 8.0.0", "swc_compiler_base", "swc_config", "swc_cor...
2
2
2
f62097ca01a2ffdf852161d2fb040acd57e70081
pshu
2024-03-22T07:02:08
fix(es/utils): Mark `ident` of default fn/class as binding (#8764)
diff --git a/crates/swc_ecma_utils/src/lib.rs b/crates/swc_ecma_utils/src/lib.rs index ac372cd976..27c7a82c89 100644 --- a/crates/swc_ecma_utils/src/lib.rs +++ b/crates/swc_ecma_utils/src/lib.rs @@ -2797,6 +2797,24 @@ where self.is_pat_decl = old; } + fn visit_export_default_decl(&mut self, e: &Expor...
1
24
0
f988b66e1fd921266a8abf6fe9bb997b6878e949
Donny/κ°•λ™μœ€
2024-03-14T03:22:28
fix(es/module): Fix regression of resolving relative modules (#8748) **Description:** - x-ref (vercel slack): https://vercel.slack.com/archives/C03S8ED1DKM/p1710371667695459?thread_ts=1710362018.271789&cid=C03S8ED1DKM **Related issue (if exists):**
diff --git a/crates/swc_ecma_loader/src/resolvers/node.rs b/crates/swc_ecma_loader/src/resolvers/node.rs index eb44710a40..078bfd3cdb 100644 --- a/crates/swc_ecma_loader/src/resolvers/node.rs +++ b/crates/swc_ecma_loader/src/resolvers/node.rs @@ -419,7 +419,7 @@ impl NodeModulesResolver { module_specifier,...
3
8
6
9c1eb017fcd90bd21b43f1a988c7fc67639343c1
Donny/κ°•λ™μœ€
2024-03-13T07:43:50
chore(es): Allow using older `tokio` (#8740) **Description:** I made a mistake while working on https://github.com/swc-project/swc/pull/8711
diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 123729415e..5498f4b67e 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -107,10 +107,7 @@ swc_plugin_proxy = { version = "0.41.5", path = "../swc_plugin_proxy", optional swc_plugin_runner = { version = "0.106.11", path = "../swc_plugin_r...
1
1
4
9a1f04f4269f65df845897d2fb61449985bdd821
Donny/κ°•λ™μœ€
2024-03-08T04:55:36
perf(es): Do not create tokio runtime if not required (#8711) **Related issue:** - Closes #8708.
diff --git a/Cargo.lock b/Cargo.lock index 75f8a678ee..99c42faacf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3717,6 +3717,7 @@ dependencies = [ "swc_timer", "swc_visit", "testing", + "tokio", "tracing", "url", "walkdir", @@ -5629,9 +5630,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601...
6
94
99
4ce39ebf32d79982a31458b7b70d9fecde40cd35
magic-akari
2024-03-06T04:40:25
feat(es/parser): Support Regular Expression `v` flag (#8690) **Related issue:** - Closes #8462
diff --git a/crates/swc_ecma_compat_common/src/regexp.rs b/crates/swc_ecma_compat_common/src/regexp.rs index fc68ee1631..7c24107baf 100644 --- a/crates/swc_ecma_compat_common/src/regexp.rs +++ b/crates/swc_ecma_compat_common/src/regexp.rs @@ -23,6 +23,8 @@ pub struct Config { pub unicode_property_regex: bool, ...
6
10
1
4066dfa830b942e2bc6c0b348dee1a85e3fcc9fc
SWC Bot
2024-03-06T03:57:09
chore: Bump crates
diff --git a/Cargo.lock b/Cargo.lock index 15637f4ab2..63c51e8e40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1056,7 +1056,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbg-swc" -version = "0.91.16" +version = "0.91.17" dependencies = [ "anyhow", "clap ...
2
2
2
b47438245a0fb7f12b325a66a756beeaf58c3c9e
Donny/κ°•λ™μœ€
2024-03-04T10:07:02
perf(visit): Drop `pmutil` to improve compile time (#8673)
diff --git a/Cargo.lock b/Cargo.lock index 6e410d0004..b2d6a2011e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2730,17 +2730,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "pmutil" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a40bc70c2c58040d...
3
154
156
a7a00aafb9ead8cb536e1205087b371e20a795b3
David Sherret
2024-03-02T10:23:14
fix(es/visit): Skip `TsExprWithTypeArgs` from `noop_visit/fold_type` macros (#8677) **Description:** See https://github.com/swc-project/swc/discussions/8669 **BREAKING CHANGE:** `TsExprWithTypeArgs` is now skipped in these macros. This fix might be a breaking change for anyone who was relying on the previous...
diff --git a/crates/swc_ecma_transforms_typescript/src/strip_import_export.rs b/crates/swc_ecma_transforms_typescript/src/strip_import_export.rs index 2e7a73c42b..83958e7c18 100644 --- a/crates/swc_ecma_transforms_typescript/src/strip_import_export.rs +++ b/crates/swc_ecma_transforms_typescript/src/strip_import_export....
2
3
7
1bc4cb7c0548483980e27483022d6abf0888891d
Donny/κ°•λ™μœ€
2024-02-26T07:01:32
fix(es/modules): Do not call `Path::parent()` for `FileName::Anon` (#8662) **Related issue:** - Closes #8660
diff --git a/crates/swc_ecma_transforms_module/src/path.rs b/crates/swc_ecma_transforms_module/src/path.rs index 2166dd994c..3df6d962f8 100644 --- a/crates/swc_ecma_transforms_module/src/path.rs +++ b/crates/swc_ecma_transforms_module/src/path.rs @@ -7,7 +7,7 @@ use std::{ sync::Arc, }; -use anyhow::{Context, E...
1
6
9
e1791340cd35e5465ff3f6b71ac596a138173d04
xc2
2024-02-26T02:48:06
fix(es/codegen): Fix replacement when `inline_script` is on (#8659) **Description:** The replacements for `inline_script` might be with mistake https://github.com/swc-project/swc/blob/40682c8d1f55b42b0a086487e740e975244ed42a/crates/swc_ecma_codegen/src/lib.rs#L649 which in terser is: ![image](https://g...
diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index 1da93072de..24b162c322 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -646,7 +646,7 @@ where if self.cfg.inline_script { value = replace_close_inline_script(&valu...
2
3
2
671c4a78dd294591a0b18a44e18edc29bba30a52
Donny/κ°•λ™μœ€
2024-02-22T04:08:36
perf(visit): Use qualified paths for generated codes (#8655)
diff --git a/crates/swc_visit_macros/src/lib.rs b/crates/swc_visit_macros/src/lib.rs index ef3bf8aa2d..64d1821d1c 100644 --- a/crates/swc_visit_macros/src/lib.rs +++ b/crates/swc_visit_macros/src/lib.rs @@ -101,14 +101,14 @@ pub fn define(tts: proc_macro::TokenStream) -> proc_macro::TokenStream { let mut q = Quo...
1
143
97
3bf3a62505cc3fc6eaf182b75c319ea4bc212ee8
magic-akari
2024-02-21T02:11:19
doc(es/minifier): Update examples code (#8652) **Related issue:** - Closes #8651 The core logic of SWC is correct, but there are incorrect code examples in our code repository.
diff --git a/crates/swc_ecma_minifier/examples/compress.rs b/crates/swc_ecma_minifier/examples/compress.rs index 6b592966d8..d215f13b42 100644 --- a/crates/swc_ecma_minifier/examples/compress.rs +++ b/crates/swc_ecma_minifier/examples/compress.rs @@ -15,7 +15,10 @@ use swc_ecma_minifier::{ option::{ExtraOptions, M...
3
15
3
762959c72d08994c2ad7c4f43405e591cc6af6eb
Donny/κ°•λ™μœ€
2024-02-13T07:03:57
feat(swc_core): Expose ES linter (#8635)
diff --git a/Cargo.lock b/Cargo.lock index e5f2edd762..c09c846a2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3928,6 +3928,7 @@ dependencies = [ "swc_css_visit", "swc_ecma_ast", "swc_ecma_codegen", + "swc_ecma_lints", "swc_ecma_loader", "swc_ecma_minifier", "swc_ecma_parser", diff --git a/crates/swc_core/C...
3
12
0
132be951733660654b5c0992e19b5f3d414e7350
Donny/κ°•λ™μœ€
2024-02-08T01:49:38
fix(es/plugin): Fix schema version issue (#8621)
diff --git a/crates/swc_common/src/plugin/mod.rs b/crates/swc_common/src/plugin/mod.rs index fb9adb7388..2185d1d269 100644 --- a/crates/swc_common/src/plugin/mod.rs +++ b/crates/swc_common/src/plugin/mod.rs @@ -20,7 +20,7 @@ pub mod serialized; * - When removing, or changing existing properties in the AST struct: TBD...
1
1
1
d87fef0fea661b3a50e43af85c12db98e978bc82
David Sherret
2024-02-06T02:10:31
chore(config): Remove an empty file in `swc_config` (#8609)
diff --git a/crates/swc_config/src/lib.rs b/crates/swc_config/src/lib.rs index b46409f4d2..bc7aa5b24c 100644 --- a/crates/swc_config/src/lib.rs +++ b/crates/swc_config/src/lib.rs @@ -1,7 +1,5 @@ //! Configuration for swc -#[macro_use] -mod macros; pub mod config_types; pub mod merge; #[cfg(feature = "sourcemap")]...
2
0
3
16e9d4ca31561caf4fb2a5182337eae78395dbe6
Donny/κ°•λ™μœ€
2024-02-05T11:25:09
fix(es/quote): Fix code generation of `AssignTarget` (#8604)
diff --git a/crates/swc_ecma_quote_macros/src/ast/expr.rs b/crates/swc_ecma_quote_macros/src/ast/expr.rs index 7ec60f00dd..bdcc8244ae 100644 --- a/crates/swc_ecma_quote_macros/src/ast/expr.rs +++ b/crates/swc_ecma_quote_macros/src/ast/expr.rs @@ -1,6 +1,6 @@ use swc_ecma_ast::*; -impl_enum!(AssignTarget, [Simple, Pa...
2
2
2
ef916614f1b714bc765721fd7a35a4a471ac6811
Donny/κ°•λ™μœ€
2024-02-05T11:05:51
fix(es/quote): Support `AssignTarget`, really (#8603)
diff --git a/crates/swc_ecma_quote_macros/src/ctxt.rs b/crates/swc_ecma_quote_macros/src/ctxt.rs index 45e1f6d5c4..3a4cd7bccf 100644 --- a/crates/swc_ecma_quote_macros/src/ctxt.rs +++ b/crates/swc_ecma_quote_macros/src/ctxt.rs @@ -106,7 +106,8 @@ pub(super) fn prepare_vars( "Expr" => VarPos::Expr, ...
1
2
1
6a48be4b6b91c71687c2edc1cf9db9538d9f5650
Donny/κ°•λ™μœ€
2024-02-05T10:50:03
fix(es/quote): Allow variables typed `AssignTarget` (#8602) **Description:** This is required to fix https://github.com/vercel/turbo/pull/7272 **Related issue:** - https://github.com/vercel/turbo/pull/7272
diff --git a/crates/swc_ecma_quote/src/lib.rs b/crates/swc_ecma_quote/src/lib.rs index a7cf6dd5e0..726a50c81e 100644 --- a/crates/swc_ecma_quote/src/lib.rs +++ b/crates/swc_ecma_quote/src/lib.rs @@ -17,6 +17,7 @@ mod clone; /// /// - `Expr` /// - `Pat` +/// - `AssignTarget` /// - `Stmt` /// - `ModuleItem` //...
3
10
1
872a47b851504f4c0095f7c9f2729d50451c97a6
Donny/κ°•λ™μœ€
2024-02-02T03:17:43
test(es/testing): Ensure that `test_inline!` is working properly (#8590) **Related issue:** - Closes #8586
diff --git a/crates/swc_ecma_transforms_testing/src/lib.rs b/crates/swc_ecma_transforms_testing/src/lib.rs index 4a719baefc..64767ea006 100644 --- a/crates/swc_ecma_transforms_testing/src/lib.rs +++ b/crates/swc_ecma_transforms_testing/src/lib.rs @@ -478,7 +478,7 @@ test_inline!( ignore, Syntax::default(), ...
1
8
2
d683089be1116f7944fcd3dbd4536b343becdf5e
Donny/κ°•λ™μœ€
2024-01-29T10:25:42
fix(es/testing): Make `test_inline!` not read output as a file (#8569) **Description:** I made a mistake while working on `test_inline!` **Related issue:** - #8568
diff --git a/crates/swc_ecma_transforms_testing/src/lib.rs b/crates/swc_ecma_transforms_testing/src/lib.rs index 22cb61ef9d..4a719baefc 100644 --- a/crates/swc_ecma_transforms_testing/src/lib.rs +++ b/crates/swc_ecma_transforms_testing/src/lib.rs @@ -361,12 +361,10 @@ where { let _logger = testing::init(); - ...
1
4
6
d6a46158987d0e96d6184d41c2fdd73df92d6681
xiao xin
2024-01-27T04:56:11
fix(es/loader): Make `tsc` resolver work for bare specifier (#8550) **Description:** From the typescript [baseUrl](https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl) doc: When using bare specifiers (module specifiers that don’t begin with ./, ../, or /), baseUrl has a higher precedence ...
diff --git a/crates/swc_ecma_loader/src/resolvers/tsc.rs b/crates/swc_ecma_loader/src/resolvers/tsc.rs index 0f94c0de9c..b7794652bd 100644 --- a/crates/swc_ecma_loader/src/resolvers/tsc.rs +++ b/crates/swc_ecma_loader/src/resolvers/tsc.rs @@ -310,7 +310,14 @@ where } } - if let Ok(v) = se...
2
100
1
039c1685c663cd138e4a0cf769b506d1fd419ba5
κ°•λ™μœ€ (Donny)
2024-01-25T12:36:33
chore: Publish crates
diff --git a/Cargo.lock b/Cargo.lock index 3d9ed022b0..e9cd871c70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4763,7 +4763,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.179.2" +version = "0.179.3" dependencies = [ "Inflector", "anyhow", diff --git a/crates/swc_core/Cargo....
4
4
4
fab27dabed3a4d0478b28c86809cc06482b2c45c
Donny/κ°•λ™μœ€
2024-01-24T12:00:05
fix(es/loader): Don't use browser versions for `jsc.paths` (#8548) **Related issue:** - https://github.com/vercel/next.js/issues/56144
diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index 37ee8e3884..2ef8ab058e 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -1747,12 +1747,16 @@ fn build_resolver( } let r = { - let r = TsConfigResolver::new( - NodeModulesResolver::...
2
12
7
ae786692a0d20254bc233472a23035ba1be25e46
Donny/κ°•λ™μœ€
2024-01-24T09:18:09
fix(es/codegen): Set `sourceRoot` of sourcemaps (#6086) **Related issue:** - Closes #2362
diff --git a/Cargo.lock b/Cargo.lock index 03b3eb0ca0..0ab3f1e28d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3945,6 +3945,7 @@ dependencies = [ "base64", "napi", "napi-derive", + "once_cell", "pathdiff", "serde", "sourcemap", diff --git a/bindings/binding_core_node/src/bundle.rs b/bindings/binding_core_no...
12
247
231
4630426d6aa77af992787456e476b8862c25a45e
Donny/κ°•λ™μœ€
2024-01-23T08:36:04
chore(common): Update `sourcemap` (#8544) **Related issue:** - Closes #7822
diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 35426f2690..447b5ef94e 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -62,7 +62,7 @@ regex = "1" rustc-hash = "1.1.0" serde = { version = "1", features = ["derive"] } serde_json = "1" -sourcemap = "6.2" +sourcema...
6
20
20
71930ffb5625fb58fab3200764ea98b05abab8ba
Fy
2024-01-22T13:02:49
fix(es/quote): Add support for import phase to quote macro (#8536) **Description:** When using quote! to generate import decl, compile error: missing field `phase` in initializer of 'swc_core::ecma::ast::Import'
diff --git a/crates/swc_ecma_quote_macros/src/ast/enums.rs b/crates/swc_ecma_quote_macros/src/ast/enums.rs index 42e9e8a9a6..a04ce84218 100644 --- a/crates/swc_ecma_quote_macros/src/ast/enums.rs +++ b/crates/swc_ecma_quote_macros/src/ast/enums.rs @@ -75,3 +75,4 @@ impl_simple_enum!( impl_simple_enum!(Accessibility, [P...
3
3
2
793f2651a8c44c43cde8b83d4f98eda6e274676c
Donny/κ°•λ™μœ€
2024-01-22T08:51:26
feat(swc_core): Expose `preset_env_base` (#8537)
diff --git a/crates/swc_core/src/lib.rs b/crates/swc_core/src/lib.rs index 9a6ca3204f..2637d9eabd 100644 --- a/crates/swc_core/src/lib.rs +++ b/crates/swc_core/src/lib.rs @@ -30,6 +30,12 @@ pub extern crate swc_ecma_quote_macros; )] pub mod plugin; +#[cfg(feature = "preset_env")] +#[cfg_attr(docsrs, doc(cfg(feature...
1
6
0
4520eca97a7ba6a1239d25e8f119019baed173da
SWC Bot
2024-01-18T14:05:51
chore: Publish crates
diff --git a/Cargo.lock b/Cargo.lock index 11a1df1347..055c7d7840 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1049,7 +1049,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbg-swc" -version = "0.90.30" +version = "0.90.31" dependencies = [ "anyhow", "clap ...
2
2
2
ba753f12885c4c3062afa5782dc7f6652981a659
Donny/κ°•λ™μœ€
2024-01-17T08:59:30
fix(plugin): Set `swc_common::errors::HANDLER` while invoking plugins (#8511) **Description:** - `swc_common::errors::handler::HANDLER` should be used, and `swc_core::plugin::errors::HANDLER` is now a simple alias. **Related issue:** - Closes #8502
diff --git a/crates/swc_core/src/plugin.rs b/crates/swc_core/src/plugin.rs index 3192ef3b28..a9b0679fbc 100644 --- a/crates/swc_core/src/plugin.rs +++ b/crates/swc_core/src/plugin.rs @@ -53,12 +53,7 @@ pub mod memory { ))) )] pub mod errors { - /// global context HANDLER in plugin's transform function. - p...
2
4
15
10449e08d9459af2c313eb7146005bcff016d169
Donny/κ°•λ™μœ€
2024-01-16T04:41:18
fix(es): Fix plugin template & restore `test!` as `test_inline!` (#8508) **Description:** I made a bad decision while migrating tests in the core repository to snapshot testing. So, I'm adding the `test!` macro back with a slight renaming. **Related issue:** - Closes #8504
diff --git a/Cargo.lock b/Cargo.lock index 4e72396055..e0dfba342c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3480,9 +3480,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.5" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9db03534dff993187064c4e...
4
114
16
566063dca5fe73834cdf5e0acf7c7f344a9806a5
Marsel Shayhin
2024-01-03T07:37:37
feat(html/parser): Allow self-closing `/>` on non-void HTML elements via a flag (#8460)
diff --git a/crates/swc_html_codegen/tests/fixture.rs b/crates/swc_html_codegen/tests/fixture.rs index c6e89361c8..7d07b912c9 100644 --- a/crates/swc_html_codegen/tests/fixture.rs +++ b/crates/swc_html_codegen/tests/fixture.rs @@ -638,6 +638,7 @@ fn html5lib_tests_verify(input: PathBuf) { let parser_config = Parse...
3
268
108
d681785b428b7958e7652dc3a7c709ad85b298f9
Luke Page
2023-12-29T12:25:23
fix(es/minifier): Add WeakRef as a safe global reference (#8458) **Description:** I was trying to remove references to Weak Ref from minified code and despite the expression not being used, it was still included. E.g. ``` var x = WeakRef; ``` with ``` { "minify": true, "jsc": { "minify": {...
diff --git a/crates/swc_ecma_usage_analyzer/src/util.rs b/crates/swc_ecma_usage_analyzer/src/util.rs index 1f8e0758b2..fc02f1041a 100644 --- a/crates/swc_ecma_usage_analyzer/src/util.rs +++ b/crates/swc_ecma_usage_analyzer/src/util.rs @@ -39,6 +39,7 @@ pub fn is_global_var_with_pure_property_access(s: &str) -> bool { ...
1
1
0