From 6fc3f1665be3cd162746ab6e8e614e60c59f5d1e Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Wed, 21 May 2025 15:24:54 +0000 Subject: [PATCH 001/209] chore: Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0201ce9ca179..8613395a89ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [1.11.29] - 2025-05-21 ### Bug Fixes From 4bc4244c195d3a364b588348657fd8a3d8c22079 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Thu, 22 May 2025 00:49:31 +0800 Subject: [PATCH 002/209] refactor(es/codegen): Migrate to `ryu-js` for numeric literal codegen (#10503) --- .changeset/cyan-rules-exist.md | 6 +++++ Cargo.lock | 1 + .../binaryIntegerLiteral.1.normal.js | 4 +-- .../binaryIntegerLiteral.2.minified.js | 2 +- .../octalIntegerLiteral.1.normal.js | 4 +-- .../octalIntegerLiteral.2.minified.js | 2 +- crates/swc_ecma_codegen/Cargo.toml | 1 + crates/swc_ecma_codegen/src/lit.rs | 25 ++++++++++++++----- .../tests/benches-full/d3.js | 4 +-- .../tests/benches-full/echarts.js | 4 +-- .../tests/benches-full/three.js | 2 +- .../tests/benches-full/victory.js | 4 +-- .../tests/fixture/issues/2257/full/output.js | 10 ++++---- .../issues/6957/number-tostring/output.js | 18 ++++++------- .../pages/index-cb36c1bf7f830e3c/output.js | 6 ++--- .../pages/_app-72ad41192608e93a/output.js | 6 ++--- .../fixture/next/react-pdf-renderer/output.js | 6 ++--- .../fixture/next/wrap-contracts/output.js | 6 ++--- 18 files changed, 66 insertions(+), 45 deletions(-) create mode 100644 .changeset/cyan-rules-exist.md diff --git a/.changeset/cyan-rules-exist.md b/.changeset/cyan-rules-exist.md new file mode 100644 index 000000000000..99b727d7719b --- /dev/null +++ b/.changeset/cyan-rules-exist.md @@ -0,0 +1,6 @@ +--- +swc_core: minor +swc_ecma_codegen: minor +--- + +refactor(es/codegen): Migrate to ryu-js for numeric literal codegen diff --git a/Cargo.lock b/Cargo.lock index 96f67cec7c69..f34e3eb4df70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5268,6 +5268,7 @@ dependencies = [ "once_cell", "regex", "rustc-hash 2.1.1", + "ryu-js", "serde", "serde_json", "sourcemap", diff --git a/crates/swc/tests/tsc-references/binaryIntegerLiteral.1.normal.js b/crates/swc/tests/tsc-references/binaryIntegerLiteral.1.normal.js index 60502c9806b7..833fc568b9e6 100644 --- a/crates/swc/tests/tsc-references/binaryIntegerLiteral.1.normal.js +++ b/crates/swc/tests/tsc-references/binaryIntegerLiteral.1.normal.js @@ -1,7 +1,7 @@ //// [binaryIntegerLiteral.ts] var bin1 = 26; var bin2 = 26; -var bin3 = 9671406556917009000000000; +var bin3 = 9.671406556917009e+24; var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; var obj1 = { 26: "Hello", @@ -15,7 +15,7 @@ var obj2 = { a: bin2, bin2: bin2, b: 26, - 9671406556917009000000000: false + 9.671406556917009e+24: false }; obj1[26]; // string obj1[26]; // string diff --git a/crates/swc/tests/tsc-references/binaryIntegerLiteral.2.minified.js b/crates/swc/tests/tsc-references/binaryIntegerLiteral.2.minified.js index be8790c23235..87a3af419f25 100644 --- a/crates/swc/tests/tsc-references/binaryIntegerLiteral.2.minified.js +++ b/crates/swc/tests/tsc-references/binaryIntegerLiteral.2.minified.js @@ -10,6 +10,6 @@ var obj1 = { a: 26, bin2: 26, b: 26, - 9671406556917009000000000: !1 + 9.671406556917009e+24: !1 }; obj1[26], obj1[26], obj1["26"], obj1["0b11010"], obj1.a, obj1.b, obj1.bin1, obj1.Infinity, obj2[26], obj2[26], obj2["26"], obj2["0B11010"], obj2.a, obj2.b, obj2.bin2, obj2[9.671406556917009e+24], obj2["9.671406556917009e+24"], obj2.Infinity; diff --git a/crates/swc/tests/tsc-references/octalIntegerLiteral.1.normal.js b/crates/swc/tests/tsc-references/octalIntegerLiteral.1.normal.js index 9312e03f9aaf..92c34bcce1f5 100644 --- a/crates/swc/tests/tsc-references/octalIntegerLiteral.1.normal.js +++ b/crates/swc/tests/tsc-references/octalIntegerLiteral.1.normal.js @@ -2,7 +2,7 @@ var oct1 = 19230; var oct2 = 19230; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; -var oct4 = 54624374234151770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000; +var oct4 = 5.462437423415177e+244; var obj1 = { 19230: "Hello", a: 19230, @@ -15,7 +15,7 @@ var obj2 = { a: 19230, b: oct2, oct2: oct2, - 54624374234151770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: false + 5.462437423415177e+244: false }; obj1[19230]; // string obj1["0o45436"]; // any diff --git a/crates/swc/tests/tsc-references/octalIntegerLiteral.2.minified.js b/crates/swc/tests/tsc-references/octalIntegerLiteral.2.minified.js index 8bade43a0e7b..c3e898a0fcfe 100644 --- a/crates/swc/tests/tsc-references/octalIntegerLiteral.2.minified.js +++ b/crates/swc/tests/tsc-references/octalIntegerLiteral.2.minified.js @@ -10,6 +10,6 @@ var obj1 = { a: 19230, b: 19230, oct2: 19230, - 54624374234151770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: !1 + 5.462437423415177e+244: !1 }; obj1[19230], obj1["0o45436"], obj1["19230"], obj1[19230], obj1.a, obj1.b, obj1.oct1, obj1.Infinity, obj2[19230], obj2["0O45436"], obj2["19230"], obj2[19230], obj2.a, obj2.b, obj2.oct2, obj2[5.462437423415177e+244], obj2["5.462437423415177e+244"], obj2.Infinity; diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 584815e1dcf5..a6865ae644a4 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -24,6 +24,7 @@ num-bigint = { workspace = true, features = ["serde"] } once_cell = { workspace = true } regex = { workspace = true } rustc-hash = { workspace = true } +ryu-js = { workspace = true } serde = { workspace = true } sourcemap = { workspace = true } tracing = { workspace = true } diff --git a/crates/swc_ecma_codegen/src/lit.rs b/crates/swc_ecma_codegen/src/lit.rs index 505187f2f68d..1ebe6497faf6 100644 --- a/crates/swc_ecma_codegen/src/lit.rs +++ b/crates/swc_ecma_codegen/src/lit.rs @@ -224,10 +224,7 @@ where // Handle infinity if num.value.is_infinite() && num.raw.is_none() { - if num.value.is_sign_negative() { - self.wr.write_str_lit(num.span, "-")?; - } - self.wr.write_str_lit(num.span, "Infinity")?; + self.wr.write_str_lit(num.span, &num.value.print())?; return Ok(false); } @@ -254,7 +251,7 @@ where if num.value.is_infinite() && num.raw.is_some() { self.wr.write_str_lit(DUMMY_SP, num.raw.as_ref().unwrap())?; } else { - value = num.value.to_string(); + value = num.value.print(); self.wr.write_str_lit(DUMMY_SP, &value)?; } } else if raw.len() > 2 @@ -276,7 +273,7 @@ where } } _ => { - value = num.value.to_string(); + value = num.value.print(); self.wr.write_str_lit(DUMMY_SP, &value)?; } } @@ -603,3 +600,19 @@ pub fn minify_number(num: f64, detect_dot: &mut bool) -> String { fn clz(s: &str) -> usize { s.as_bytes().iter().take_while(|&&c| c == b'0').count() } + +pub trait Print { + fn print(&self) -> String; +} + +impl Print for f64 { + fn print(&self) -> String { + // preserve -0.0 + if *self == 0.0 { + return self.to_string(); + } + + let mut buffer = ryu_js::Buffer::new(); + buffer.format(*self).to_string() + } +} diff --git a/crates/swc_ecma_minifier/tests/benches-full/d3.js b/crates/swc_ecma_minifier/tests/benches-full/d3.js index 3f355db3453e..34e23effe0e7 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/d3.js +++ b/crates/swc_ecma_minifier/tests/benches-full/d3.js @@ -3402,7 +3402,7 @@ function(global, factory) { for(let k = 0, xp, yp; k < this._ids.length; k++){ const i = this._ids[k], x = coords[2 * i], y = coords[2 * i + 1]; // skip near-duplicate points - if (k > 0 && 0.0000000000000002220446049250313 >= Math.abs(x - xp) && 0.0000000000000002220446049250313 >= Math.abs(y - yp) || (xp = x, yp = y, i === i0 || i === i1 || i === i2)) continue; + if (k > 0 && 2.220446049250313e-16 >= Math.abs(x - xp) && 2.220446049250313e-16 >= Math.abs(y - yp) || (xp = x, yp = y, i === i0 || i === i1 || i === i2)) continue; // find a visible edge on the convex hull using edge hash let start = 0; for(let j = 0, key = this._hashKey(x, y); j < this._hashSize && (-1 === (start = hullHash[(key + j) % this._hashSize]) || start === hullNext[start]); j++); @@ -4983,7 +4983,7 @@ function(global, factory) { // Second, count the (signed) number of times a segment crosses a lambda // from the point to the South pole. If it is zero, then the point is the // same side as the South pole. - return (angle < -0.000001 || angle < 1e-6 && sum < -0.000000000001) ^ 1 & winding; + return (angle < -0.000001 || angle < 1e-6 && sum < -1e-12) ^ 1 & winding; } function clip(pointVisible, clipLine, interpolate, start) { return function(sink) { diff --git a/crates/swc_ecma_minifier/tests/benches-full/echarts.js b/crates/swc_ecma_minifier/tests/benches-full/echarts.js index 39b68fa2f5bd..ff23ecd044f6 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/echarts.js +++ b/crates/swc_ecma_minifier/tests/benches-full/echarts.js @@ -5099,10 +5099,10 @@ }, Displayable.STYLE_CHANGED_BIT = 2, Displayable.initDefaultProps = void ((dispProto = Displayable.prototype).type = 'displayable', dispProto.invisible = !1, dispProto.z = 0, dispProto.z2 = 0, dispProto.zlevel = 0, dispProto.culling = !1, dispProto.cursor = 'pointer', dispProto.rectHover = !1, dispProto.incremental = !1, dispProto._rect = null, dispProto.dirtyRectTolerance = 0, dispProto.__dirty = Element.REDARAW_BIT | Displayable.STYLE_CHANGED_BIT), Displayable; }(Element), tmpRect = new BoundingRect(0, 0, 0, 0), viewRect = new BoundingRect(0, 0, 0, 0), mathPow = Math.pow, mathSqrt = Math.sqrt, THREE_SQRT = mathSqrt(3), ONE_THIRD = 1 / 3, _v0 = create(), _v1 = create(), _v2 = create(); function isAroundZero(val) { - return val > -0.00000001 && val < 1e-8; + return val > -1e-8 && val < 1e-8; } function isNotAroundZero$1(val) { - return val > 1e-8 || val < -0.00000001; + return val > 1e-8 || val < -1e-8; } function cubicAt(p0, p1, p2, p3, t) { var onet = 1 - t; diff --git a/crates/swc_ecma_minifier/tests/benches-full/three.js b/crates/swc_ecma_minifier/tests/benches-full/three.js index ec05de12fc59..5da14a0faafa 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/three.js +++ b/crates/swc_ecma_minifier/tests/benches-full/three.js @@ -5,7 +5,7 @@ function(global, factory) { ], factory) : factory((global = 'undefined' != typeof globalThis ? globalThis : global || self).THREE = {}); }(this, function(exports1) { 'use strict'; - void 0 === Number.EPSILON && (Number.EPSILON = 0.0000000000000002220446049250313), void 0 === Number.isInteger && // Missing in IE + void 0 === Number.EPSILON && (Number.EPSILON = 2.220446049250313e-16), void 0 === Number.isInteger && // Missing in IE // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger (Number.isInteger = function(value) { return 'number' == typeof value && isFinite(value) && Math.floor(value) === value; diff --git a/crates/swc_ecma_minifier/tests/benches-full/victory.js b/crates/swc_ecma_minifier/tests/benches-full/victory.js index a06982d7a3aa..ccfb0512d365 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/victory.js +++ b/crates/swc_ecma_minifier/tests/benches-full/victory.js @@ -7224,7 +7224,7 @@ for(var k = 0, xp = void 0, yp = void 0; k < this._ids.length; k++){ var i$8 = this._ids[k], x$2 = coords[2 * i$8], y$2 = coords[2 * i$8 + 1]; // skip near-duplicate points - if (!(k > 0 && 0.0000000000000002220446049250313 >= Math.abs(x$2 - xp) && 0.0000000000000002220446049250313 >= Math.abs(y$2 - yp)) && (xp = x$2, yp = y$2, i$8 !== i0 && i$8 !== i1 && i$8 !== i2)) { + if (!(k > 0 && 2.220446049250313e-16 >= Math.abs(x$2 - xp) && 2.220446049250313e-16 >= Math.abs(y$2 - yp)) && (xp = x$2, yp = y$2, i$8 !== i0 && i$8 !== i1 && i$8 !== i2)) { for(var start = 0, j$1 = 0, key = this._hashKey(x$2, y$2); j$1 < this._hashSize && (-1 === (start = hullHash[(key + j$1) % this._hashSize]) || start === hullNext[start]); j$1++); for(// find a visible edge on the convex hull using edge hash var e = start = hullPrev[start], q = void 0; q = hullNext[e], !orient(x$2, y$2, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]);)if ((e = q) === start) { @@ -21151,7 +21151,7 @@ * @returns {Array} the minDomain based on props */ function getDomainFromMinMax(min, max) { var verySmallNumber, minVal, maxVal; - return +min == +max ? (verySmallNumber = 0 === max ? 0.0000000002 : 0.0000000001, minVal = max instanceof Date ? new Date(max - 1) : max - verySmallNumber, maxVal = max instanceof Date ? new Date(+max + 1) : +max + verySmallNumber, 0 === max ? [ + return +min == +max ? (verySmallNumber = 0 === max ? 2e-10 : 1e-10, minVal = max instanceof Date ? new Date(max - 1) : max - verySmallNumber, maxVal = max instanceof Date ? new Date(+max + 1) : +max + verySmallNumber, 0 === max ? [ 0, maxVal ] : [ diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js index 961081208125..413d603040ea 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js @@ -4811,7 +4811,7 @@ // https://tc39.es/ecma262/#sec-math.expm1 module.exports = !$expm1 || // Old FF bug $expm1(10) > 22025.465794806719 || 22025.4657948067165168 > $expm1(10) || // Tor Browser bug - -0.00000000000000002 != $expm1(-0.00000000000000002) ? function(x) { + -2e-17 != $expm1(-2e-17) ? function(x) { return 0 == (x *= 1) ? x : x > -0.000001 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; } : $expm1; /***/ }, @@ -4832,7 +4832,7 @@ // https://tc39.es/ecma262/#sec-math.log1p // eslint-disable-next-line es/no-math-log1p -- safe module.exports = Math.log1p || function(x) { - return (x *= 1) > -0.00000001 && x < 1e-8 ? x - x * x / 2 : log(1 + x); + return (x *= 1) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x); }; /***/ }, /***/ 62381: /***/ function(module) { @@ -6887,7 +6887,7 @@ stat: !0, forced: fails(function() { // eslint-disable-next-line es/no-math-sinh -- required for testing - return -0.00000000000000002 != Math.sinh(-0.00000000000000002); + return -2e-17 != Math.sinh(-2e-17); }) }, { sinh: function(x) { @@ -6976,7 +6976,7 @@ target: "Number", stat: !0 }, { - EPSILON: 0.0000000000000002220446049250313 + EPSILON: 2.220446049250313e-16 }); /***/ }, /***/ 36017: /***/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { @@ -7112,7 +7112,7 @@ if (fractDigits < 0 || fractDigits > 20) throw RangeError("Incorrect fraction digits"); // eslint-disable-next-line no-self-compare -- NaN check if (number != number) return "NaN"; - if (number <= -1000000000000000000000 || number >= 1e21) return String(number); + if (number <= -1e+21 || number >= 1e21) return String(number); if (number < 0 && (sign = "-", number = -number), number > 1e-21) if (z = ((e = log(number * pow(2, 69, 1)) - 69) < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1)) * 0x10000000000000, (e = 52 - e) > 0) { for(multiply(data, 0, z), j = fractDigits; j >= 7;)multiply(data, 1e7, 0), j -= 7; for(multiply(data, pow(10, j, 1), 0), j = e - 1; j >= 23;)divide(data, 8388608), j -= 23; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/6957/number-tostring/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/6957/number-tostring/output.js index 208a6fb59f22..52af15dd3fd7 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/6957/number-tostring/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/6957/number-tostring/output.js @@ -98,12 +98,12 @@ assertEquals("-3c3bc3a4a2f75c0000", "-3c3bc3a4a2f75c0000"); assertEquals("-25a55a46e5da9a00000", "-25a55a46e5da9a00000"); assertEquals("-0.0000a7c5ac471b4788", (-0.00001).toString(16)); assertEquals("-0.000010c6f7a0b5ed8d", (-0.000001).toString(16)); -assertEquals("-0.000001ad7f29abcaf48", (-0.0000001).toString(16)); -assertEquals("-0.000002036565348d256", (-0.00000012).toString(16)); -assertEquals("-0.0000021047ee22aa466", (-0.000000123).toString(16)); -assertEquals("-0.0000002af31dc4611874", (-0.00000001).toString(16)); -assertEquals("-0.000000338a23b87483be", (-0.000000012).toString(16)); -assertEquals("-0.00000034d3fe36aaa0a2", (-0.0000000123).toString(16)); +assertEquals("-0.000001ad7f29abcaf48", (-1e-7).toString(16)); +assertEquals("-0.000002036565348d256", (-1.2e-7).toString(16)); +assertEquals("-0.0000021047ee22aa466", (-1.23e-7).toString(16)); +assertEquals("-0.0000002af31dc4611874", (-1e-8).toString(16)); +assertEquals("-0.000000338a23b87483be", (-1.2e-8).toString(16)); +assertEquals("-0.00000034d3fe36aaa0a2", (-1.23e-8).toString(16)); assertEquals("4294967296", "4294967296"); assertEquals("ffffffff", "ffffffff"); assertEquals("11111111111111111111111111111111", "11111111111111111111111111111111"); @@ -308,9 +308,9 @@ assertEquals("123456789", "123456789"); assertEquals("1.2345679e+8", "1.2345679e+8"); assertEquals("1.234568e+8", "1.234568e+8"); assertEquals("-1.234568e+8", "-1.234568e+8"); -assertEquals("-1.2e-9", Number(-0.0000000012345).toPrecision(2)); -assertEquals("-1.2e-8", Number(-0.000000012345).toPrecision(2)); -assertEquals("-1.2e-7", Number(-0.00000012345).toPrecision(2)); +assertEquals("-1.2e-9", Number(-1.2345e-9).toPrecision(2)); +assertEquals("-1.2e-8", Number(-1.2345e-8).toPrecision(2)); +assertEquals("-1.2e-7", Number(-1.2345e-7).toPrecision(2)); assertEquals("-0.0000012", Number(-0.0000012345).toPrecision(2)); assertEquals("-0.000012", Number(-0.000012345).toPrecision(2)); assertEquals("-0.00012", Number(-0.00012345).toPrecision(2)); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js index da467ce117bb..0e81339ac61f 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js @@ -6530,10 +6530,10 @@ if (offset + ext > buf.length || offset < 0) throw RangeError("Index out of range"); } function writeFloat(buf, value, offset, littleEndian, noAssert) { - return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 4, 3.4028234663852886e38, -340282346638528860000000000000000000000), ieee754.write(buf, value, offset, littleEndian, 23, 4), offset + 4; + return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 4, 3.4028234663852886e38, -3.4028234663852886e+38), ieee754.write(buf, value, offset, littleEndian, 23, 4), offset + 4; } function writeDouble(buf, value, offset, littleEndian, noAssert) { - return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 8, 1.7976931348623157e308, -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000), ieee754.write(buf, value, offset, littleEndian, 52, 8), offset + 8; + return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 8, 1.7976931348623157e308, -1.7976931348623157e+308), ieee754.write(buf, value, offset, littleEndian, 52, 8), offset + 8; } exports.Buffer = Buffer, exports.SlowBuffer = function(length) { return +length != length && // eslint-disable-line eqeqeq @@ -6982,7 +6982,7 @@ } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); }, exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 0.00000005960464477539062 * (23 === mLen), i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = +(value < 0 || 0 === value && 1 / value < 0); + var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 5.960464477539062e-8 * (23 === mLen), i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = +(value < 0 || 0 === value && 1 / value < 0); for(isNaN(value = Math.abs(value)) || value === 1 / 0 ? (m = +!!isNaN(value), e = eMax) : (e = Math.floor(Math.log(value) / Math.LN2), value * (c = Math.pow(2, -e)) < 1 && (e--, c *= 2), e + eBias >= 1 ? value += rt / c : value += rt * Math.pow(2, 1 - eBias), value * c >= 2 && (e++, c /= 2), e + eBias >= eMax ? (m = 0, e = eMax) : e + eBias >= 1 ? (m = (value * c - 1) * Math.pow(2, mLen), e += eBias) : (m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen), e = 0)); mLen >= 8; buffer[offset + i] = 0xff & m, i += d, m /= 256, mLen -= 8); for(e = e << mLen | m, eLen += mLen; eLen > 0; buffer[offset + i] = 0xff & e, i += d, e /= 256, eLen -= 8); buffer[offset + i - d] |= 128 * s; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js index 15f608ae7360..5383d1452eef 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js @@ -349,10 +349,10 @@ if (t + f > e.length || t < 0) throw RangeError("Index out of range"); } function writeFloat(e, r, t, f, i) { - return r *= 1, t >>>= 0, i || checkIEEE754(e, r, t, 4, 34028234663852886e22, -340282346638528860000000000000000000000), n.write(e, r, t, f, 23, 4), t + 4; + return r *= 1, t >>>= 0, i || checkIEEE754(e, r, t, 4, 34028234663852886e22, -3.4028234663852886e+38), n.write(e, r, t, f, 23, 4), t + 4; } function writeDouble(e, r, t, f, i) { - return r *= 1, t >>>= 0, i || checkIEEE754(e, r, t, 8, 17976931348623157e292, -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000), n.write(e, r, t, f, 52, 8), t + 8; + return r *= 1, t >>>= 0, i || checkIEEE754(e, r, t, 8, 17976931348623157e292, -1.7976931348623157e+308), n.write(e, r, t, f, 52, 8), t + 8; } r.Buffer = Buffer, r.SlowBuffer = function(e) { return +e != e && (e = 0), Buffer.alloc(+e); @@ -729,7 +729,7 @@ } return (p ? -1 : 1) * o * Math.pow(2, i - f); }, r.write = function(e, r, t, f, n, i) { - var o, u, a, s = 8 * i - n - 1, h = (1 << s) - 1, c = h >> 1, l = 0.00000005960464477539062 * (23 === n), p = f ? 0 : i - 1, y = f ? 1 : -1, g = +(r < 0 || 0 === r && 1 / r < 0); + var o, u, a, s = 8 * i - n - 1, h = (1 << s) - 1, c = h >> 1, l = 5.960464477539062e-8 * (23 === n), p = f ? 0 : i - 1, y = f ? 1 : -1, g = +(r < 0 || 0 === r && 1 / r < 0); for(isNaN(r = Math.abs(r)) || r === 1 / 0 ? (u = +!!isNaN(r), o = h) : (o = Math.floor(Math.log(r) / Math.LN2), r * (a = Math.pow(2, -o)) < 1 && (o--, a *= 2), o + c >= 1 ? r += l / a : r += l * Math.pow(2, 1 - c), r * a >= 2 && (o++, a /= 2), o + c >= h ? (u = 0, o = h) : o + c >= 1 ? (u = (r * a - 1) * Math.pow(2, n), o += c) : (u = r * Math.pow(2, c - 1) * Math.pow(2, n), o = 0)); n >= 8; e[t + p] = 255 & u, p += y, u /= 256, n -= 8); for(o = o << n | u, s += n; s > 0; e[t + p] = 255 & o, p += y, o /= 256, s -= 8); e[t + p - y] |= 128 * g; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js index ad4b7373f482..0f1d01f976cf 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js @@ -20588,10 +20588,10 @@ if (r + n > e.length || r < 0) throw RangeError("Index out of range"); } function E(e, t, r, n, o) { - return t *= 1, r >>>= 0, o || w(e, t, r, 4, 34028234663852886e22, -340282346638528860000000000000000000000), i.write(e, t, r, n, 23, 4), r + 4; + return t *= 1, r >>>= 0, o || w(e, t, r, 4, 34028234663852886e22, -3.4028234663852886e+38), i.write(e, t, r, n, 23, 4), r + 4; } function _(e, t, r, n, o) { - return t *= 1, r >>>= 0, o || w(e, t, r, 8, 17976931348623157e292, -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000), i.write(e, t, r, n, 52, 8), r + 8; + return t *= 1, r >>>= 0, o || w(e, t, r, 8, 17976931348623157e292, -1.7976931348623157e+308), i.write(e, t, r, n, 52, 8), r + 8; } t.Buffer = u, t.SlowBuffer = function(e) { return +e != e && (e = 0), u.alloc(+e); @@ -20968,7 +20968,7 @@ } return (d ? -1 : 1) * a * Math.pow(2, o - n); }, t.write = function(e, t, r, n, i, o) { - var a, u, l, s = 8 * o - i - 1, c = (1 << s) - 1, f = c >> 1, p = 0.00000005960464477539062 * (23 === i), d = n ? 0 : o - 1, h = n ? 1 : -1, y = +(t < 0 || 0 === t && 1 / t < 0); + var a, u, l, s = 8 * o - i - 1, c = (1 << s) - 1, f = c >> 1, p = 5.960464477539062e-8 * (23 === i), d = n ? 0 : o - 1, h = n ? 1 : -1, y = +(t < 0 || 0 === t && 1 / t < 0); for(isNaN(t = Math.abs(t)) || t === 1 / 0 ? (u = +!!isNaN(t), a = c) : (a = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), a + f >= 1 ? t += p / l : t += p * Math.pow(2, 1 - f), t * l >= 2 && (a++, l /= 2), a + f >= c ? (u = 0, a = c) : a + f >= 1 ? (u = (t * l - 1) * Math.pow(2, i), a += f) : (u = t * Math.pow(2, f - 1) * Math.pow(2, i), a = 0)); i >= 8; e[r + d] = 255 & u, d += h, u /= 256, i -= 8); for(a = a << i | u, s += i; s > 0; e[r + d] = 255 & a, d += h, a /= 256, s -= 8); e[r + d - h] |= 128 * y; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js b/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js index 27b5ee415c86..986003e484dd 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js @@ -11235,10 +11235,10 @@ if (offset + ext > buf.length || offset < 0) throw RangeError('Index out of range'); } function writeFloat(buf, value, offset, littleEndian, noAssert) { - return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -340282346638528860000000000000000000000), ieee754.write(buf, value, offset, littleEndian, 23, 4), offset + 4; + return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38), ieee754.write(buf, value, offset, littleEndian, 23, 4), offset + 4; } function writeDouble(buf, value, offset, littleEndian, noAssert) { - return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000), ieee754.write(buf, value, offset, littleEndian, 52, 8), offset + 8; + return value *= 1, offset >>>= 0, noAssert || checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157e+308), ieee754.write(buf, value, offset, littleEndian, 52, 8), offset + 8; } Buffer.prototype.slice = function(start, end) { const len = this.length; @@ -16084,7 +16084,7 @@ } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); }, exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 0.00000005960464477539062 * (23 === mLen), i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = +(value < 0 || 0 === value && 1 / value < 0); + var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 5.960464477539062e-8 * (23 === mLen), i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = +(value < 0 || 0 === value && 1 / value < 0); for(isNaN(value = Math.abs(value)) || value === 1 / 0 ? (m = +!!isNaN(value), e = eMax) : (e = Math.floor(Math.log(value) / Math.LN2), value * (c = Math.pow(2, -e)) < 1 && (e--, c *= 2), e + eBias >= 1 ? value += rt / c : value += rt * Math.pow(2, 1 - eBias), value * c >= 2 && (e++, c /= 2), e + eBias >= eMax ? (m = 0, e = eMax) : e + eBias >= 1 ? (m = (value * c - 1) * Math.pow(2, mLen), e += eBias) : (m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen), e = 0)); mLen >= 8; buffer[offset + i] = 0xff & m, i += d, m /= 256, mLen -= 8); for(e = e << mLen | m, eLen += mLen; eLen > 0; buffer[offset + i] = 0xff & e, i += d, e /= 256, eLen -= 8); buffer[offset + i - d] |= 128 * s; From 41075a1c8776b62d7c2fc6436677d5d6b083a2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 21 May 2025 15:32:35 -0700 Subject: [PATCH 003/209] fix(es/react-compiler): Fix usefulness detection (#10506) **Description:** JSX is also a target of the React Compiler **Related issue:** - https://github.com/vercel/next.js/pull/79479 --- .changeset/ten-tables-design.md | 6 ++++ .../swc_ecma_react_compiler/src/fast_check.rs | 35 +++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .changeset/ten-tables-design.md diff --git a/.changeset/ten-tables-design.md b/.changeset/ten-tables-design.md new file mode 100644 index 000000000000..6199ad52c2cb --- /dev/null +++ b/.changeset/ten-tables-design.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_react_compiler: patch +--- + +fix(react-compiler/support): Fix usefulness detection diff --git a/crates/swc_ecma_react_compiler/src/fast_check.rs b/crates/swc_ecma_react_compiler/src/fast_check.rs index 135abf552a58..2402dc91ad8d 100644 --- a/crates/swc_ecma_react_compiler/src/fast_check.rs +++ b/crates/swc_ecma_react_compiler/src/fast_check.rs @@ -1,10 +1,5 @@ -use swc_ecma_ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, VarDeclarator}; +use swc_ecma_ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, Stmt, VarDeclarator}; use swc_ecma_visit::{Visit, VisitWith}; - -/// Returns true if the `program` is a good target for the react compiler. -/// -/// If this function returns false, it means that it does not worth to apply the -/// React Compiler to the file. pub fn is_required(program: &Program) -> bool { let mut finder = Finder::default(); finder.visit_program(program); @@ -36,6 +31,25 @@ impl Visit for Finder { node.visit_children_with(self); } + fn visit_expr(&mut self, node: &Expr) { + if self.found { + return; + } + if matches!( + node, + Expr::JSXMember(..) + | Expr::JSXNamespacedName(..) + | Expr::JSXEmpty(..) + | Expr::JSXElement(..) + | Expr::JSXFragment(..) + ) { + self.found = true; + return; + } + + node.visit_children_with(self); + } + fn visit_fn_decl(&mut self, node: &FnDecl) { let old = self.is_interested; self.is_interested = node.ident.sym.starts_with("use") @@ -49,7 +63,7 @@ impl Visit for Finder { fn visit_fn_expr(&mut self, node: &FnExpr) { let old = self.is_interested; - self.is_interested = node.ident.as_ref().is_some_and(|ident| { + self.is_interested |= node.ident.as_ref().is_some_and(|ident| { ident.sym.starts_with("use") || ident.sym.starts_with(|c: char| c.is_ascii_uppercase()) }); @@ -71,6 +85,13 @@ impl Visit for Finder { node.visit_children_with(self); } + fn visit_stmt(&mut self, node: &Stmt) { + if self.found { + return; + } + node.visit_children_with(self); + } + fn visit_var_declarator(&mut self, node: &VarDeclarator) { let old = self.is_interested; From 1298e767e78d69ba02efb1cb3260266b5a2812c2 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Thu, 22 May 2025 21:22:41 +0800 Subject: [PATCH 004/209] fix(ts/fast-dts): Correctly emit Symbol-keyed accessors in declarations (#10508) **Related issue:** - Closes: #10507 --- .changeset/silent-cameras-invent.md | 6 + crates/swc_typescript/src/fast_dts/class.rs | 47 ++----- crates/swc_typescript/src/fast_dts/types.rs | 46 +++---- .../src/fast_dts/util/ast_ext.rs | 123 +++++++++++++++--- .../tests/fixture/symbol-getter-setter.snap | 14 ++ .../tests/fixture/symbol-getter-setter.ts | 23 ++++ 6 files changed, 175 insertions(+), 84 deletions(-) create mode 100644 .changeset/silent-cameras-invent.md create mode 100644 crates/swc_typescript/tests/fixture/symbol-getter-setter.snap create mode 100644 crates/swc_typescript/tests/fixture/symbol-getter-setter.ts diff --git a/.changeset/silent-cameras-invent.md b/.changeset/silent-cameras-invent.md new file mode 100644 index 000000000000..3ef110de6732 --- /dev/null +++ b/.changeset/silent-cameras-invent.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_typescript: patch +--- + +fix(ts/fast-dts): Correctly emit Symbol-keyed accessors in declarations diff --git a/crates/swc_typescript/src/fast_dts/class.rs b/crates/swc_typescript/src/fast_dts/class.rs index 6f817e690336..e913ef3baecf 100644 --- a/crates/swc_typescript/src/fast_dts/class.rs +++ b/crates/swc_typescript/src/fast_dts/class.rs @@ -8,7 +8,7 @@ use swc_ecma_ast::{ use super::{ type_ann, - util::ast_ext::{ExprExit, PatExt, PropNameExit}, + util::ast_ext::{ExprExit, PatExt, PropNameExit, StaticProp}, FastDts, }; @@ -155,10 +155,10 @@ impl FastDts { } else { method.function.params.truncate(1); let param = method.function.params.first_mut().unwrap(); - let static_name = method.key.static_name(); + let static_prop = method.key.static_prop(self.unresolved_mark); - if let Some(type_ann) = static_name - .and_then(|name| setter_getter_annotations.get(name.as_ref())) + if let Some(type_ann) = static_prop + .and_then(|prop| setter_getter_annotations.get(&prop)) { param.pat.set_type_ann(Some(type_ann.clone())); } @@ -179,8 +179,8 @@ impl FastDts { if method.function.return_type.is_none() { method.function.return_type = method .key - .static_name() - .and_then(|name| setter_getter_annotations.get(name.as_ref())) + .static_prop(self.unresolved_mark) + .and_then(|prop| setter_getter_annotations.get(&prop)) .cloned(); } if method.function.return_type.is_none() { @@ -460,7 +460,7 @@ impl FastDts { pub(crate) fn collect_getter_or_setter_annotations( &mut self, class: &Class, - ) -> FxHashMap> { + ) -> FxHashMap> { let mut annotations = FxHashMap::default(); for member in &class.body { let ClassMember::Method(method) = member else { @@ -478,7 +478,7 @@ impl FastDts { continue; } - let Some(static_name) = method.key.static_name().map(|name| name.to_string()) else { + let Some(static_prop) = method.key.static_prop(self.unresolved_mark) else { continue; }; @@ -490,7 +490,7 @@ impl FastDts { .clone() .or_else(|| self.infer_function_return_type(&method.function)) { - annotations.insert(static_name, type_ann); + annotations.insert(static_prop, type_ann); } } MethodKind::Setter => { @@ -499,7 +499,7 @@ impl FastDts { }; if let Some(type_ann) = first_param.pat.get_type_ann() { - annotations.insert(static_name, type_ann.clone()); + annotations.insert(static_prop, type_ann.clone()); } } _ => continue, @@ -522,31 +522,6 @@ impl FastDts { } pub(crate) fn is_global_symbol_object(&self, expr: &Expr) -> bool { - let Some(obj) = (match expr { - Expr::Member(member) => Some(&member.obj), - Expr::OptChain(opt_chain) => opt_chain.base.as_member().map(|member| &member.obj), - _ => None, - }) else { - return false; - }; - - // https://github.com/microsoft/TypeScript/blob/cbac1ddfc73ca3b9d8741c1b51b74663a0f24695/src/compiler/transformers/declarations.ts#L1011 - if let Some(ident) = obj.as_ident() { - // Exactly `Symbol.something` and `Symbol` either does not resolve - // or definitely resolves to the global Symbol - return ident.sym.as_str() == "Symbol" && ident.ctxt.has_mark(self.unresolved_mark); - } - - if let Some(member_expr) = obj.as_member() { - // Exactly `globalThis.Symbol.something` and `globalThis` resolves - // to the global `globalThis` - if let Some(ident) = member_expr.obj.as_ident() { - return ident.sym.as_str() == "globalThis" - && ident.ctxt.has_mark(self.unresolved_mark) - && member_expr.prop.is_ident_with("Symbol"); - } - } - - false + expr.get_global_symbol_prop(self.unresolved_mark).is_some() } } diff --git a/crates/swc_typescript/src/fast_dts/types.rs b/crates/swc_typescript/src/fast_dts/types.rs index a0b549cd8be4..f1cb4283b3fc 100644 --- a/crates/swc_typescript/src/fast_dts/types.rs +++ b/crates/swc_typescript/src/fast_dts/types.rs @@ -11,7 +11,7 @@ use super::{ inferrer::ReturnTypeInferrer, type_ann, util::{ - ast_ext::{ExprExit, PatExt}, + ast_ext::{ExprExit, PatExt, StaticProp}, types::{ts_keyword_type, ts_lit_type}, }, FastDts, @@ -191,30 +191,16 @@ impl FastDts { let mut has_setter = false; - if let Some(static_name) = getter.key.static_name() { - if has_seen.contains(&static_name) { + if let Some(static_prop) = getter.key.static_prop(self.unresolved_mark) { + if has_seen.contains(&static_prop) { continue; } - has_setter = seen_setter.contains(static_name.as_ref()); - if let Some(type_ann) = - setter_getter_annotations.get(static_name.as_ref()) - { + has_setter = seen_setter.contains(&static_prop); + if let Some(type_ann) = setter_getter_annotations.get(&static_prop) { getter_type_ann = Some(type_ann.clone()); } - has_seen.insert(static_name); - } - - // [TODO]: check cases not handled by - // collect_object_getter_or_setter_annotations - if getter_type_ann.is_none() { - getter_type_ann = getter.type_ann.clone().or_else(|| { - getter - .body - .as_ref() - .and_then(|body| ReturnTypeInferrer::infer(self, &body.stmts)) - .map(type_ann) - }); + has_seen.insert(static_prop); } if getter_type_ann.is_none() { @@ -238,17 +224,15 @@ impl FastDts { let mut setter_type_ann = None; - if let Some(static_name) = setter.key.static_name() { - if has_seen.contains(&static_name) { + if let Some(static_prop) = setter.key.static_prop(self.unresolved_mark) { + if has_seen.contains(&static_prop) { continue; } - if let Some(type_ann) = - setter_getter_annotations.get(static_name.as_ref()) - { + if let Some(type_ann) = setter_getter_annotations.get(&static_prop) { setter_type_ann = Some(type_ann.clone()); } - has_seen.insert(static_name); + has_seen.insert(static_prop); } if setter_type_ann.is_none() { @@ -434,7 +418,7 @@ impl FastDts { pub(crate) fn collect_object_getter_or_setter_annotations( &mut self, object: &ObjectLit, - ) -> (FxHashMap>, FxHashSet) { + ) -> (FxHashMap>, FxHashSet) { let mut annotations = FxHashMap::default(); let mut seen_setter = FxHashSet::default(); @@ -443,7 +427,7 @@ impl FastDts { continue; }; - let Some(static_name) = prop.static_name().map(|name| name.to_string()) else { + let Some(static_prop) = prop.static_prop(self.unresolved_mark) else { continue; }; @@ -457,14 +441,14 @@ impl FastDts { .clone() .or_else(|| ReturnTypeInferrer::infer(self, &body.stmts).map(type_ann)) { - annotations.insert(static_name, type_ann); + annotations.insert(static_prop, type_ann); } } Prop::Setter(setter) => { if let Some(type_ann) = setter.param.get_type_ann().clone() { - annotations.insert(static_name.clone(), type_ann); + annotations.insert(static_prop.clone(), type_ann); } - seen_setter.insert(static_name); + seen_setter.insert(static_prop); } _ => {} } diff --git a/crates/swc_typescript/src/fast_dts/util/ast_ext.rs b/crates/swc_typescript/src/fast_dts/util/ast_ext.rs index a4f33b955379..4583fd4e6555 100644 --- a/crates/swc_typescript/src/fast_dts/util/ast_ext.rs +++ b/crates/swc_typescript/src/fast_dts/util/ast_ext.rs @@ -1,12 +1,15 @@ use std::borrow::Cow; use swc_atoms::Atom; +use swc_common::Mark; use swc_ecma_ast::{ - BindingIdent, Expr, Ident, Lit, MemberProp, ObjectPatProp, Pat, Prop, PropName, TsTypeAnn, + BindingIdent, ComputedPropName, Expr, Ident, Lit, MemberProp, ObjectPatProp, Pat, Prop, + PropName, TsTypeAnn, }; pub trait ExprExit { fn get_root_ident(&self) -> Option<&Ident>; + fn get_global_symbol_prop(&self, unresolved_mark: Mark) -> Option<&MemberProp>; } impl ExprExit for Expr { @@ -21,6 +24,43 @@ impl ExprExit for Expr { _ => None, } } + + fn get_global_symbol_prop(&self, unresolved_mark: Mark) -> Option<&MemberProp> { + let (obj, prop) = (match self { + Expr::Member(member) => Some((&member.obj, &member.prop)), + Expr::OptChain(opt_chain) => opt_chain + .base + .as_member() + .map(|member| (&member.obj, &member.prop)), + _ => None, + })?; + + // https://github.com/microsoft/TypeScript/blob/cbac1ddfc73ca3b9d8741c1b51b74663a0f24695/src/compiler/transformers/declarations.ts#L1011 + if let Some(ident) = obj.as_ident() { + // Exactly `Symbol.something` and `Symbol` either does not resolve + // or definitely resolves to the global Symbol + return if ident.sym.as_str() == "Symbol" && ident.ctxt.has_mark(unresolved_mark) { + Some(prop) + } else { + None + }; + } + + if let Some(member_expr) = obj.as_member() { + // Exactly `globalThis.Symbol.something` and `globalThis` resolves + // to the global `globalThis` + if let Some(ident) = member_expr.obj.as_ident() { + if ident.sym.as_str() == "globalThis" + && ident.ctxt.has_mark(unresolved_mark) + && member_expr.prop.is_ident_with("Symbol") + { + return Some(prop); + } + } + } + + None + } } pub trait PatExt { @@ -88,6 +128,7 @@ impl PatExt for Pat { pub trait PropNameExit { fn static_name(&self) -> Option>; + fn static_prop(&self, unresolved_mark: Mark) -> Option; } impl PropNameExit for PropName { @@ -97,23 +138,54 @@ impl PropNameExit for PropName { PropName::Str(string) => Some(Cow::Borrowed(string.value.as_str())), PropName::Num(number) => Some(Cow::Owned(number.value.to_string())), PropName::BigInt(big_int) => Some(Cow::Owned(big_int.value.to_string())), - PropName::Computed(computed_prop_name) => match computed_prop_name.expr.as_ref() { - Expr::Lit(lit) => match lit { - Lit::Str(string) => Some(Cow::Borrowed(string.value.as_str())), - Lit::Bool(b) => Some(Cow::Owned(b.value.to_string())), - Lit::Null(_) => Some(Cow::Borrowed("null")), - Lit::Num(number) => Some(Cow::Owned(number.value.to_string())), - Lit::BigInt(big_int) => Some(Cow::Owned(big_int.value.to_string())), - Lit::Regex(regex) => Some(Cow::Owned(regex.exp.to_string())), - Lit::JSXText(_) => None, - }, - Expr::Tpl(tpl) if tpl.exprs.is_empty() => tpl - .quasis - .first() - .and_then(|e| e.cooked.as_ref()) - .map(|atom| Cow::Borrowed(atom.as_str())), - _ => None, + PropName::Computed(computed_prop_name) => computed_prop_name.static_name(), + } + } + + fn static_prop(&self, unresolved_mark: Mark) -> Option { + match self { + PropName::Computed(c) => c.static_prop(unresolved_mark), + prop => prop.static_name().map(Into::into).map(StaticProp::Name), + } + } +} + +impl PropNameExit for ComputedPropName { + fn static_name(&self) -> Option> { + match self.expr.as_ref() { + Expr::Lit(lit) => match lit { + Lit::Str(string) => Some(Cow::Borrowed(string.value.as_str())), + Lit::Bool(b) => Some(Cow::Owned(b.value.to_string())), + Lit::Null(_) => Some(Cow::Borrowed("null")), + Lit::Num(number) => Some(Cow::Owned(number.value.to_string())), + Lit::BigInt(big_int) => Some(Cow::Owned(big_int.value.to_string())), + Lit::Regex(regex) => Some(Cow::Owned(regex.exp.to_string())), + Lit::JSXText(_) => None, }, + Expr::Tpl(tpl) if tpl.exprs.is_empty() => tpl + .quasis + .first() + .and_then(|e| e.cooked.as_ref()) + .map(|atom| Cow::Borrowed(atom.as_str())), + _ => None, + } + } + + fn static_prop(&self, unresolved_mark: Mark) -> Option { + match self.expr.as_ref() { + Expr::Member(..) | Expr::OptChain(..) => self + .expr + .get_global_symbol_prop(unresolved_mark) + .and_then(|prop| match prop { + MemberProp::Ident(ident_name) => { + Some(StaticProp::Symbol(ident_name.sym.clone())) + } + MemberProp::Computed(c) => { + c.static_name().map(Into::into).map(StaticProp::Symbol) + } + MemberProp::PrivateName(..) => None, + }), + _ => self.static_name().map(Into::into).map(StaticProp::Name), } } } @@ -129,6 +201,17 @@ impl PropNameExit for Prop { Self::Method(method_prop) => method_prop.key.static_name(), } } + + fn static_prop(&self, unresolved_mark: Mark) -> Option { + match self { + Self::Shorthand(ident_name) => Some(StaticProp::Name(ident_name.sym.clone())), + Self::KeyValue(key_value_prop) => key_value_prop.key.static_prop(unresolved_mark), + Self::Assign(..) => None, + Self::Getter(getter_prop) => getter_prop.key.static_prop(unresolved_mark), + Self::Setter(setter_prop) => setter_prop.key.static_prop(unresolved_mark), + Self::Method(method_prop) => method_prop.key.static_prop(unresolved_mark), + } + } } pub trait MemberPropExt { @@ -150,3 +233,9 @@ impl MemberPropExt for MemberProp { } } } + +#[derive(Eq, Hash, PartialEq, Clone)] +pub(crate) enum StaticProp { + Name(Atom), + Symbol(Atom), +} diff --git a/crates/swc_typescript/tests/fixture/symbol-getter-setter.snap b/crates/swc_typescript/tests/fixture/symbol-getter-setter.snap new file mode 100644 index 000000000000..4c50435beeec --- /dev/null +++ b/crates/swc_typescript/tests/fixture/symbol-getter-setter.snap @@ -0,0 +1,14 @@ +```==================== .D.TS ==================== + +// @isolatedDeclarations: true +// @emitDeclarationOnly: true +export declare const foo: { + [Symbol.toStringTag]: string; +}; +export declare class Foo { + #private; + get [Symbol.toStringTag](): string; + set [Symbol.toStringTag](value: string); +} + + diff --git a/crates/swc_typescript/tests/fixture/symbol-getter-setter.ts b/crates/swc_typescript/tests/fixture/symbol-getter-setter.ts new file mode 100644 index 000000000000..7ebdfe83336f --- /dev/null +++ b/crates/swc_typescript/tests/fixture/symbol-getter-setter.ts @@ -0,0 +1,23 @@ +// @isolatedDeclarations: true +// @emitDeclarationOnly: true + +let x = ""; + +export const foo = { + get [Symbol.toStringTag]() { + return x; + }, + set [Symbol.toStringTag](value: string) { + x = value; + }, +}; + +export class Foo { + #x = ""; + get [Symbol.toStringTag]() { + return this.#x; + } + set [Symbol.toStringTag](value: string) { + this.#x = value; + } +} From 7b47f661dd6794f658023b649ebcdc153fe6e27c Mon Sep 17 00:00:00 2001 From: bohan Date: Fri, 23 May 2025 03:06:43 +0800 Subject: [PATCH 005/209] perf(es/renamer): Merge analyze/collect (#10509) --- .changeset/wicked-monkeys-agree.md | 6 + .../src/rename/analyer_and_collector.rs | 575 ++++++++++++++++++ .../src/rename/analyzer/mod.rs | 427 +++---------- .../src/rename/collector.rs | 295 --------- .../src/rename/mod.rs | 43 +- 5 files changed, 684 insertions(+), 662 deletions(-) create mode 100644 .changeset/wicked-monkeys-agree.md create mode 100644 crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs delete mode 100644 crates/swc_ecma_transforms_base/src/rename/collector.rs diff --git a/.changeset/wicked-monkeys-agree.md b/.changeset/wicked-monkeys-agree.md new file mode 100644 index 000000000000..e879618a06bd --- /dev/null +++ b/.changeset/wicked-monkeys-agree.md @@ -0,0 +1,6 @@ +--- +swc_core: minor +swc_ecma_transforms_base: minor +--- + +perf(es/renamer): Merge analyze/collect diff --git a/crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs b/crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs new file mode 100644 index 000000000000..74a285c6cf18 --- /dev/null +++ b/crates/swc_ecma_transforms_base/src/rename/analyer_and_collector.rs @@ -0,0 +1,575 @@ +use std::hash::Hash; + +use rustc_hash::FxHashSet; +use swc_atoms::Atom; +use swc_common::{Mark, SyntaxContext}; +use swc_ecma_ast::*; +use swc_ecma_utils::{ident::IdentLike, stack_size::maybe_grow_default}; +use swc_ecma_visit::{noop_visit_type, visit_obj_and_computed, Visit, VisitWith}; + +use super::{analyzer::scope::Scope, Analyzer}; + +struct IdCollector { + ids: FxHashSet, + stopped: bool, +} + +impl IdCollector { + fn handle_ident(&mut self, n: &Ident) { + if !self.stopped && n.ctxt != SyntaxContext::empty() { + self.ids.insert(n.to_id()); + } + } +} + +struct CustomBindingCollector +where + I: IdentLike + Eq + Hash + Send + Sync, +{ + bindings: FxHashSet, + preserved: FxHashSet, + is_pat_decl: bool, + + /// [None] if there's no `eval`. + pub top_level_for_eval: Option, +} + +impl CustomBindingCollector +where + I: IdentLike + Eq + Hash + Send + Sync, +{ + fn add(&mut self, i: &Ident) { + if let Some(top_level_ctxt) = self.top_level_for_eval { + if i.ctxt == top_level_ctxt { + self.preserved.insert(I::from_ident(i)); + return; + } + } + + self.bindings.insert(I::from_ident(i)); + } + + fn handle_assign_pat_prop(&mut self, node: &AssignPatProp) { + if self.is_pat_decl { + self.add(&Ident::from(&node.key)); + } + } + + fn handle_binding_ident(&mut self, node: &BindingIdent) { + if self.is_pat_decl { + self.add(&Ident::from(node)); + } + } + + fn handle_class_expr(&mut self, node: &ClassExpr) { + if let Some(id) = &node.ident { + self.add(id); + } + } + + fn handle_fn_expr(&mut self, node: &FnExpr) { + if let Some(id) = &node.ident { + self.add(id); + } + } +} + +pub(super) struct AnalyzerAndCollector { + analyzer: Analyzer, + id_collector: IdCollector, + decl_collector: CustomBindingCollector, +} + +impl Visit for AnalyzerAndCollector { + noop_visit_type!(); + + fn visit_arrow_expr(&mut self, node: &ArrowExpr) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + self.decl_collector.is_pat_decl = true; + + let old_analyzer = self.analyzer.enter_fn_scope(); + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + self.analyzer.is_pat_decl = true; + + node.params.visit_with(self); + + // FIXME: Tests failing after this change - needs investigation + // self.decl_collector.is_pat_decl = false; + self.analyzer.is_pat_decl = false; + + match node.body.as_ref() { + BlockStmtOrExpr::BlockStmt(n) => n.visit_children_with(self), + BlockStmtOrExpr::Expr(n) => n.visit_with(self), + } + + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + self.analyzer.exit_scope(old_analyzer); + + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + } + + fn visit_assign_target(&mut self, node: &AssignTarget) { + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + self.analyzer.is_pat_decl = false; + + node.visit_children_with(self); + + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + } + + fn visit_assign_pat_prop(&mut self, node: &AssignPatProp) { + node.visit_children_with(self); + + self.decl_collector.handle_assign_pat_prop(node); + } + + fn visit_binding_ident(&mut self, node: &BindingIdent) { + node.visit_children_with(self); + + self.decl_collector.handle_binding_ident(node); + self.analyzer.handle_binding_ident(node); + } + + fn visit_block_stmt(&mut self, node: &BlockStmt) { + let old_analyzer = self.analyzer.enter_block_scope(); + + node.visit_children_with(self); + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_bin_expr(&mut self, node: &BinExpr) { + maybe_grow_default(|| node.visit_children_with(self)); + } + + fn visit_catch_clause(&mut self, node: &CatchClause) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + + let old_analyzer = self.analyzer.enter_block_scope(); + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + let old_analyzer_in_catch_params = self.analyzer.in_catch_params; + + self.decl_collector.is_pat_decl = false; + self.analyzer.in_catch_params = false; + self.analyzer.is_pat_decl = false; + + node.body.visit_children_with(self); + + self.decl_collector.is_pat_decl = true; + self.analyzer.is_pat_decl = true; + self.analyzer.in_catch_params = true; + + node.param.visit_with(self); + + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + + self.analyzer.in_catch_params = old_analyzer_in_catch_params; + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_class_decl(&mut self, node: &ClassDecl) { + self.analyzer.handle_class_decl(node); + + node.visit_children_with(self); + + self.decl_collector.add(&node.ident); + } + + fn visit_class_expr(&mut self, node: &ClassExpr) { + let old_analyzer = self.analyzer.enter_block_scope(); + + self.analyzer.handle_class_expr(node); + + node.visit_children_with(self); + + self.decl_collector.handle_class_expr(node); + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_class_method(&mut self, node: &ClassMethod) { + node.key.visit_with(self); + + let old_analyzer = self.analyzer.enter_fn_scope(); + + node.function.decorators.visit_with(self); + node.function.params.visit_with(self); + if let Some(body) = &node.function.body { + body.visit_children_with(self); + } + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_constructor(&mut self, node: &Constructor) { + let old_analyzer = self.analyzer.enter_fn_scope(); + node.key.visit_with(self); + node.params.visit_with(self); + if let Some(body) = &node.body { + body.visit_children_with(self); + } + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_default_decl(&mut self, node: &DefaultDecl) { + match node { + DefaultDecl::Class(c) => { + self.analyzer.handle_class_expr(c); + self.decl_collector.handle_class_expr(c); + + let old_analyzer = self.analyzer.enter_fn_scope(); + c.visit_children_with(self); + self.analyzer.exit_scope(old_analyzer); + } + DefaultDecl::Fn(f) => { + self.analyzer.handle_fn_expr(f); + + f.visit_with(self); + } + DefaultDecl::TsInterfaceDecl(_) => {} + } + } + + fn visit_export_named_specifier(&mut self, n: &ExportNamedSpecifier) { + let old_id_collector_stopped = self.id_collector.stopped; + self.id_collector.stopped = true; + + self.analyzer.handle_export_named_specifier(n); + + n.visit_children_with(self); + + self.id_collector.stopped = old_id_collector_stopped; + } + + fn visit_expr(&mut self, node: &Expr) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + self.decl_collector.is_pat_decl = false; + + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + self.analyzer.is_pat_decl = false; + + self.analyzer.handle_expr(node); + + node.visit_children_with(self); + + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + } + + fn visit_fn_decl(&mut self, node: &FnDecl) { + // https://github.com/swc-project/swc/issues/6819 + // + // We need to check for assign pattern because safari has a bug. + // https://github.com/swc-project/swc/issues/9015 + let has_rest = node + .function + .params + .iter() + .any(|p| p.pat.is_rest() || p.pat.is_assign()); + let need_skip_analyzer_record = + self.analyzer.is_first_node && self.analyzer.skip_first_fn_or_class_decl; + self.analyzer.is_first_node = false; + + if !need_skip_analyzer_record { + self.analyzer.add_decl(node.ident.to_id(), true); + + if has_rest { + self.analyzer.add_usage(node.ident.to_id()); + } + } + + node.ident.visit_with(self); + + let old_analyzer = self.analyzer.enter_fn_scope(); + + if !need_skip_analyzer_record && has_rest { + // self.analyer is different from above because we are in a function scope + self.analyzer.add_usage(node.ident.to_id()); + } + + node.function.decorators.visit_with(self); + node.function.params.visit_with(self); + if let Some(body) = &node.function.body { + body.visit_children_with(self); + } + + self.analyzer.exit_scope(old_analyzer); + self.decl_collector.add(&node.ident); + } + + fn visit_fn_expr(&mut self, node: &FnExpr) { + if let Some(id) = &node.ident { + let old_analyzer0 = self.analyzer.enter_fn_scope(); + self.analyzer.add_decl(id.to_id(), true); + let old_analyzer1 = self.analyzer.enter_fn_scope(); + // https://github.com/swc-project/swc/issues/6819 + // + // We need to check for assign pattern because safari has a bug. + // https://github.com/swc-project/swc/issues/9015 + if node + .function + .params + .iter() + .any(|p| p.pat.is_rest() || p.pat.is_assign()) + { + self.analyzer.add_usage(id.to_id()); + } + node.function.decorators.visit_with(self); + node.function.params.visit_with(self); + if let Some(body) = &node.function.body { + body.visit_children_with(self); + } + self.analyzer.exit_scope(old_analyzer1); + self.analyzer.exit_scope(old_analyzer0); + } else { + node.visit_children_with(self) + } + + self.decl_collector.handle_fn_expr(node); + } + + fn visit_for_in_stmt(&mut self, node: &ForInStmt) { + let old_analyzer0 = self.analyzer.enter_block_scope(); + node.left.visit_with(self); + node.right.visit_with(self); + let old_analyzer1 = self.analyzer.enter_block_scope(); + match node.body.as_ref() { + Stmt::Block(n) => n.visit_children_with(self), + _ => node.body.visit_with(self), + } + self.analyzer.exit_scope(old_analyzer1); + self.analyzer.exit_scope(old_analyzer0); + } + + fn visit_for_of_stmt(&mut self, node: &ForOfStmt) { + let old_analyzer0 = self.analyzer.enter_block_scope(); + node.left.visit_with(self); + node.right.visit_with(self); + let old_analyzer1 = self.analyzer.enter_block_scope(); + match node.body.as_ref() { + Stmt::Block(n) => n.visit_children_with(self), + _ => node.body.visit_with(self), + } + self.analyzer.exit_scope(old_analyzer1); + self.analyzer.exit_scope(old_analyzer0); + } + + fn visit_for_stmt(&mut self, node: &ForStmt) { + let old_analyzer0 = self.analyzer.enter_block_scope(); + node.init.visit_with(self); + node.test.visit_with(self); + node.update.visit_with(self); + let old_analyzer1 = self.analyzer.enter_block_scope(); + match node.body.as_ref() { + Stmt::Block(n) => n.visit_children_with(self), + _ => node.body.visit_with(self), + } + self.analyzer.exit_scope(old_analyzer1); + self.analyzer.exit_scope(old_analyzer0); + } + + fn visit_function(&mut self, node: &Function) { + let old_analyzer = self.analyzer.enter_fn_scope(); + + node.decorators.visit_with(self); + node.params.visit_with(self); + if let Some(body) = &node.body { + body.visit_children_with(self); + } + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_import_default_specifier(&mut self, node: &ImportDefaultSpecifier) { + node.visit_children_with(self); + + self.analyzer.add_decl(node.local.to_id(), true); + self.decl_collector.add(&node.local); + } + + fn visit_import_named_specifier(&mut self, node: &ImportNamedSpecifier) { + node.visit_children_with(self); + + self.analyzer.add_decl(node.local.to_id(), true); + self.decl_collector.add(&node.local); + } + + fn visit_import_star_as_specifier(&mut self, node: &ImportStarAsSpecifier) { + node.visit_children_with(self); + + self.analyzer.add_decl(node.local.to_id(), true); + self.decl_collector.add(&node.local); + } + + fn visit_param(&mut self, node: &Param) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + self.decl_collector.is_pat_decl = true; + + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + let old_analyzer_need_hoist = self.analyzer.var_belong_to_fn_scope; + + // Params belong to function scope. + // Params in catch clause belong to block scope + self.analyzer.var_belong_to_fn_scope = !self.analyzer.in_catch_params; + self.analyzer.is_pat_decl = false; + node.decorators.visit_with(self); + + self.analyzer.is_pat_decl = true; + node.pat.visit_with(self); + + self.analyzer.var_belong_to_fn_scope = old_analyzer_need_hoist; + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + } + + fn visit_prop(&mut self, node: &Prop) { + node.visit_children_with(self); + self.analyzer.handle_prop(node); + } + + fn visit_static_block(&mut self, node: &StaticBlock) { + let old_analyzer = self.analyzer.enter_fn_scope(); + + node.body.visit_children_with(self); + + self.analyzer.exit_scope(old_analyzer); + } + + fn visit_stmt(&mut self, node: &Stmt) { + self.analyzer.is_first_node = false; + node.visit_children_with(self); + } + + fn visit_ts_param_prop(&mut self, p: &TsParamProp) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + self.decl_collector.is_pat_decl = true; + + p.visit_children_with(self); + + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + } + + fn visit_var_decl(&mut self, node: &VarDecl) { + let old_analyzer_need_hoisted = self.analyzer.var_belong_to_fn_scope; + self.analyzer.var_belong_to_fn_scope = node.kind == VarDeclKind::Var; + + node.visit_children_with(self); + + self.analyzer.var_belong_to_fn_scope = old_analyzer_need_hoisted; + } + + fn visit_var_declarator(&mut self, node: &VarDeclarator) { + let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; + self.decl_collector.is_pat_decl = true; + + let old_analyzer_is_pat_decl = self.analyzer.is_pat_decl; + self.analyzer.is_pat_decl = true; + + node.name.visit_with(self); + + self.decl_collector.is_pat_decl = false; + self.analyzer.is_pat_decl = false; + + node.init.visit_with(self); + + self.analyzer.is_pat_decl = old_analyzer_is_pat_decl; + self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; + } + + fn visit_super_prop(&mut self, node: &SuperProp) { + let old_id_collector_stopped = self.id_collector.stopped; + if node.is_ident() { + self.id_collector.stopped = true; + } + + node.visit_children_with(self); + + if node.is_ident() { + self.id_collector.stopped = old_id_collector_stopped; + } + } + + fn visit_export_default_specifier(&mut self, n: &ExportDefaultSpecifier) { + let old_id_collector_stopped = self.id_collector.stopped; + self.id_collector.stopped = true; + + n.visit_children_with(self); + + self.id_collector.stopped = old_id_collector_stopped; + } + + fn visit_export_namespace_specifier(&mut self, n: &ExportNamespaceSpecifier) { + let old_id_collector_stopped = self.id_collector.stopped; + self.id_collector.stopped = true; + + n.visit_children_with(self); + + self.id_collector.stopped = old_id_collector_stopped; + } + + fn visit_ident(&mut self, id: &Ident) { + self.id_collector.handle_ident(id); + } + + fn visit_named_export(&mut self, node: &NamedExport) { + let old_id_collector_stopped = self.id_collector.stopped; + if node.src.is_some() { + self.id_collector.stopped = true; + } + + node.visit_children_with(self); + + if node.src.is_some() { + self.id_collector.stopped = old_id_collector_stopped; + } + } +} + +pub(super) fn analyzer_and_collect_unresolved( + n: &N, + has_eval: bool, + top_level_mark: Mark, + skip_first_fn_or_class_decl: bool, +) -> (Scope, FxHashSet) +where + N: VisitWith, +{ + let analyzer = Analyzer::new(has_eval, top_level_mark, skip_first_fn_or_class_decl); + let id_collector = IdCollector { + ids: Default::default(), + stopped: false, + }; + let decl_collector = CustomBindingCollector { + bindings: Default::default(), + preserved: Default::default(), + is_pat_decl: false, + top_level_for_eval: has_eval + .then_some(top_level_mark) + .map(|m| SyntaxContext::empty().apply_mark(m)), + }; + + let mut v = AnalyzerAndCollector { + analyzer, + id_collector, + decl_collector, + }; + + n.visit_with(&mut v); + + let (usages, decls, preserved) = ( + v.id_collector.ids, + v.decl_collector.bindings, + v.decl_collector.preserved, + ); + + let unresolved = usages + .into_iter() + .filter(|used_id| !decls.contains(used_id)) + .map(|v| v.0) + .chain(preserved.into_iter().map(|v| v.0)) + .collect::>(); + + (v.analyzer.scope, unresolved) +} diff --git a/crates/swc_ecma_transforms_base/src/rename/analyzer/mod.rs b/crates/swc_ecma_transforms_base/src/rename/analyzer/mod.rs index a95469614f90..4cfe90d1cd30 100644 --- a/crates/swc_ecma_transforms_base/src/rename/analyzer/mod.rs +++ b/crates/swc_ecma_transforms_base/src/rename/analyzer/mod.rs @@ -12,22 +12,40 @@ pub(super) mod scope; pub(super) struct Analyzer { /// If `eval` exists for the current scope, we only rename synthesized /// identifiers. - pub has_eval: bool, + pub(super) has_eval: bool, /// The [Mark] which is parent of user-specified identifiers. - pub top_level_mark: Mark, + pub(super) top_level_mark: Mark, - pub is_pat_decl: bool, - pub var_belong_to_fn_scope: bool, - pub in_catch_params: bool, - pub scope: Scope, + pub(super) is_pat_decl: bool, + pub(super) var_belong_to_fn_scope: bool, + pub(super) in_catch_params: bool, + pub(super) scope: Scope, /// If we try add variables declared by `var` to the block scope, /// variables will be added to `hoisted_vars` and merged to latest /// function scope in the end. - pub hoisted_vars: Vec, + pub(super) hoisted_vars: Vec, + + pub(super) skip_first_fn_or_class_decl: bool, + pub(super) is_first_node: bool, } impl Analyzer { - fn add_decl(&mut self, id: Id, belong_to_fn_scope: bool) { + pub(super) fn new( + has_eval: bool, + top_level_mark: Mark, + skip_first_fn_or_class_decl: bool, + ) -> Self { + Self { + has_eval, + top_level_mark, + skip_first_fn_or_class_decl, + is_first_node: true, + hoisted_vars: Vec::with_capacity(32), + ..Default::default() + } + } + + pub(super) fn add_decl(&mut self, id: Id, belong_to_fn_scope: bool) { if belong_to_fn_scope { match self.scope.kind { ScopeKind::Fn => { @@ -55,7 +73,7 @@ impl Analyzer { } } - fn add_usage(&mut self, id: Id) { + pub(super) fn add_usage(&mut self, id: Id) { self.scope.add_usage(id); } @@ -63,183 +81,89 @@ impl Analyzer { self.scope.reserve_usage(len); } - fn with_scope(&mut self, kind: ScopeKind, op: F) - where - F: FnOnce(&mut Analyzer), - { - { - let mut v = Analyzer { - has_eval: self.has_eval, - top_level_mark: self.top_level_mark, - - is_pat_decl: self.is_pat_decl, - var_belong_to_fn_scope: false, - in_catch_params: false, - scope: Scope { - kind, - ..Default::default() - }, - hoisted_vars: Default::default(), - }; - - op(&mut v); - if !v.hoisted_vars.is_empty() { - debug_assert!(matches!(v.scope.kind, ScopeKind::Block)); - self.reserve_usage(v.hoisted_vars.len()); - v.hoisted_vars.clone().into_iter().for_each(|id| { - // For variables declared in block scope using `var` and `function`, - // We should create a fake usage in the block to prevent conflicted - // renaming. - v.add_usage(id); - }); - match self.scope.kind { - ScopeKind::Fn => { - self.reserve_decl(v.hoisted_vars.len(), true); - v.hoisted_vars - .into_iter() - .for_each(|id| self.add_decl(id, true)); - } - ScopeKind::Block => { - self.hoisted_vars.extend(v.hoisted_vars); - } - } - } - self.scope.children.push(v.scope); - } + fn enter_scope(&mut self, kind: ScopeKind) -> Self { + let mut analyer = Analyzer { + has_eval: self.has_eval, + top_level_mark: self.top_level_mark, + is_pat_decl: self.is_pat_decl, + var_belong_to_fn_scope: false, + in_catch_params: false, + scope: Scope { + kind, + ..Default::default() + }, + skip_first_fn_or_class_decl: false, + is_first_node: false, + hoisted_vars: Default::default(), + }; + std::mem::swap(self, &mut analyer); + analyer // old analyzer } - fn with_fn_scope(&mut self, op: F) - where - F: FnOnce(&mut Analyzer), - { - self.with_scope(ScopeKind::Fn, op) + pub(super) fn enter_fn_scope(&mut self) -> Self { + self.enter_scope(ScopeKind::Fn) } - fn visit_fn_body_within_same_scope(&mut self, body: &Option) { - if let Some(body) = &body { - body.visit_children_with(self); - } + pub(super) fn enter_block_scope(&mut self) -> Self { + self.enter_scope(ScopeKind::Block) } - fn visit_for_body_within_same_scope(&mut self, body: &Stmt) { - match body { - Stmt::Block(s) => s.visit_children_with(self), - _ => body.visit_with(self), - } - } -} - -impl Visit for Analyzer { - noop_visit_type!(); - - fn visit_arrow_expr(&mut self, e: &ArrowExpr) { - self.with_fn_scope(|v| { - let old = v.is_pat_decl; - v.is_pat_decl = true; - e.params.visit_with(v); - v.is_pat_decl = old; - match e.body.as_ref() { - BlockStmtOrExpr::BlockStmt(n) => n.visit_children_with(v), - BlockStmtOrExpr::Expr(n) => n.visit_with(v), + pub(super) fn exit_scope(&mut self, mut v: Self) { + std::mem::swap(self, &mut v); + if !v.hoisted_vars.is_empty() { + debug_assert!(matches!(v.scope.kind, ScopeKind::Block)); + self.reserve_usage(v.hoisted_vars.len()); + v.hoisted_vars.clone().into_iter().for_each(|id| { + // For variables declared in block scope using `var` and `function`, + // We should create a fake usage in the block to prevent conflicted + // renaming. + v.add_usage(id); + }); + match self.scope.kind { + ScopeKind::Fn => { + self.reserve_decl(v.hoisted_vars.len(), true); + v.hoisted_vars + .into_iter() + .for_each(|id| self.add_decl(id, true)); + } + ScopeKind::Block => { + self.hoisted_vars.extend(v.hoisted_vars); + } } - }); - } - - fn visit_assign_target(&mut self, n: &AssignTarget) { - let old = self.is_pat_decl; - - self.is_pat_decl = false; - n.visit_children_with(self); - - self.is_pat_decl = old; + } + self.scope.children.push(v.scope); } - fn visit_binding_ident(&mut self, i: &BindingIdent) { + pub(super) fn handle_binding_ident(&mut self, node: &BindingIdent) { if self.is_pat_decl { - self.add_decl(i.to_id(), self.var_belong_to_fn_scope) + self.add_decl(node.to_id(), self.var_belong_to_fn_scope) } else { - self.add_usage(i.to_id()) + self.add_usage(node.to_id()) } } - fn visit_block_stmt(&mut self, n: &BlockStmt) { - self.with_scope(ScopeKind::Block, |v| n.visit_children_with(v)) - } - - fn visit_catch_clause(&mut self, n: &CatchClause) { - self.with_scope(ScopeKind::Block, |v| { - let old = v.is_pat_decl; - let old_in_catch_params = v.in_catch_params; - - v.is_pat_decl = false; - n.body.visit_children_with(v); - - v.is_pat_decl = true; - v.in_catch_params = true; - n.param.visit_with(v); - - v.is_pat_decl = old; - v.in_catch_params = old_in_catch_params; - }) - } - - fn visit_class_decl(&mut self, c: &ClassDecl) { - self.add_decl(c.ident.to_id(), false); - - c.class.visit_with(self); - } - - fn visit_class_expr(&mut self, c: &ClassExpr) { - self.with_fn_scope(|v| { - if let Some(id) = &c.ident { - v.add_decl(id.to_id(), false); - } - - c.class.visit_with(v); - }) - } - - fn visit_class_method(&mut self, f: &ClassMethod) { - f.key.visit_with(self); - - self.with_fn_scope(|v| { - f.function.decorators.visit_with(v); - f.function.params.visit_with(v); - v.visit_fn_body_within_same_scope(&f.function.body); - }) + pub(super) fn handle_class_decl(&mut self, node: &ClassDecl) { + if self.is_first_node && self.skip_first_fn_or_class_decl { + self.is_first_node = false; + return; + } + self.is_first_node = false; + self.add_decl(node.ident.to_id(), false); } - fn visit_constructor(&mut self, f: &Constructor) { - self.with_fn_scope(|v| { - f.key.visit_with(v); - f.params.visit_with(v); - v.visit_fn_body_within_same_scope(&f.body); - }) + pub(super) fn handle_class_expr(&mut self, node: &ClassExpr) { + if let Some(id) = &node.ident { + self.add_decl(id.to_id(), false); + } } - fn visit_default_decl(&mut self, d: &DefaultDecl) { - match d { - DefaultDecl::Class(c) => { - if let Some(id) = &c.ident { - self.add_decl(id.to_id(), false); - } - - self.with_fn_scope(|v| { - c.class.visit_with(v); - }) - } - DefaultDecl::Fn(f) => { - if let Some(id) = &f.ident { - self.add_decl(id.to_id(), true); - } - - f.visit_with(self); - } - DefaultDecl::TsInterfaceDecl(_) => {} + pub(super) fn handle_fn_expr(&mut self, node: &FnExpr) { + if let Some(id) = &node.ident { + self.add_decl(id.to_id(), true); } } - fn visit_export_named_specifier(&mut self, n: &ExportNamedSpecifier) { + pub(super) fn handle_export_named_specifier(&mut self, n: &ExportNamedSpecifier) { match &n.orig { ModuleExportName::Ident(orig) => { self.add_usage(orig.to_id()); @@ -248,180 +172,15 @@ impl Visit for Analyzer { }; } - fn visit_expr(&mut self, e: &Expr) { - let old_is_pat_decl = self.is_pat_decl; - - self.is_pat_decl = false; - maybe_grow_default(|| e.visit_children_with(self)); - + pub(super) fn handle_expr(&mut self, e: &Expr) { if let Expr::Ident(i) = e { self.add_usage(i.to_id()); } - - self.is_pat_decl = old_is_pat_decl; - } - - fn visit_fn_decl(&mut self, f: &FnDecl) { - self.add_decl(f.ident.to_id(), true); - - // https://github.com/swc-project/swc/issues/6819 - // - // We need to check for assign pattern because safari has a bug. - // https://github.com/swc-project/swc/issues/9015 - let has_rest = f - .function - .params - .iter() - .any(|p| p.pat.is_rest() || p.pat.is_assign()); - if has_rest { - self.add_usage(f.ident.to_id()); - } - - self.with_fn_scope(|v| { - if has_rest { - v.add_usage(f.ident.to_id()); - } - - f.function.decorators.visit_with(v); - f.function.params.visit_with(v); - // WARN: Option::visit_mut_children_wth - // is not same with BlockStmt::visit_mut_children_wth - v.visit_fn_body_within_same_scope(&f.function.body); - }) - } - - fn visit_fn_expr(&mut self, f: &FnExpr) { - if let Some(id) = &f.ident { - self.with_fn_scope(|v| { - v.add_decl(id.to_id(), true); - v.with_fn_scope(|v| { - // https://github.com/swc-project/swc/issues/6819 - // - // We need to check for assign pattern because safari has a bug. - // https://github.com/swc-project/swc/issues/9015 - if f.function - .params - .iter() - .any(|p| p.pat.is_rest() || p.pat.is_assign()) - { - v.add_usage(id.to_id()); - } - - f.function.decorators.visit_with(v); - f.function.params.visit_with(v); - v.visit_fn_body_within_same_scope(&f.function.body); - }); - }) - } else { - f.function.visit_with(self) - } - } - - fn visit_for_in_stmt(&mut self, n: &ForInStmt) { - self.with_scope(ScopeKind::Block, |v| { - n.left.visit_with(v); - n.right.visit_with(v); - - v.with_scope(ScopeKind::Block, |v| { - v.visit_for_body_within_same_scope(&n.body); - }) - }); - } - - fn visit_for_of_stmt(&mut self, n: &ForOfStmt) { - self.with_scope(ScopeKind::Block, |v| { - n.left.visit_with(v); - n.right.visit_with(v); - - v.with_scope(ScopeKind::Block, |v| { - v.visit_for_body_within_same_scope(&n.body); - }) - }); - } - - fn visit_for_stmt(&mut self, n: &ForStmt) { - self.with_scope(ScopeKind::Block, |v| { - n.init.visit_with(v); - n.test.visit_with(v); - n.update.visit_with(v); - - v.with_scope(ScopeKind::Block, |v| { - v.visit_for_body_within_same_scope(&n.body); - }) - }); - } - - // ensure param and function body always in same scope - fn visit_function(&mut self, f: &Function) { - self.with_fn_scope(|v| { - f.decorators.visit_with(v); - f.params.visit_with(v); - v.visit_fn_body_within_same_scope(&f.body); - }) } - fn visit_import_default_specifier(&mut self, n: &ImportDefaultSpecifier) { - self.add_decl(n.local.to_id(), true); - } - - fn visit_import_named_specifier(&mut self, n: &ImportNamedSpecifier) { - self.add_decl(n.local.to_id(), true); - } - - fn visit_import_star_as_specifier(&mut self, n: &ImportStarAsSpecifier) { - self.add_decl(n.local.to_id(), true); - } - - fn visit_param(&mut self, e: &Param) { - let old = self.is_pat_decl; - let old_need_hoisted = self.var_belong_to_fn_scope; - - // Params belong to function scope. - // Params in catch clause belong to block scope - self.var_belong_to_fn_scope = !self.in_catch_params; - self.is_pat_decl = false; - e.decorators.visit_with(self); - - self.is_pat_decl = true; - e.pat.visit_with(self); - - self.is_pat_decl = old; - self.var_belong_to_fn_scope = old_need_hoisted - } - - fn visit_prop(&mut self, p: &Prop) { - p.visit_children_with(self); - - if let Prop::Shorthand(i) = p { - self.add_usage(i.to_id()) - } - } - - fn visit_static_block(&mut self, n: &StaticBlock) { - self.with_fn_scope(|v| n.body.visit_children_with(v)) - } - - fn visit_super_prop_expr(&mut self, e: &SuperPropExpr) { - if let SuperProp::Computed(c) = &e.prop { - c.visit_with(self); + pub(super) fn handle_prop(&mut self, node: &Prop) { + if let Prop::Shorthand(i) = node { + self.add_usage(i.to_id()); } } - - fn visit_var_decl(&mut self, n: &VarDecl) { - let old_need_hoisted = self.var_belong_to_fn_scope; - self.var_belong_to_fn_scope = n.kind == VarDeclKind::Var; - n.visit_children_with(self); - self.var_belong_to_fn_scope = old_need_hoisted; - } - - fn visit_var_declarator(&mut self, v: &VarDeclarator) { - let old = self.is_pat_decl; - self.is_pat_decl = true; - v.name.visit_with(self); - - self.is_pat_decl = false; - v.init.visit_with(self); - - self.is_pat_decl = old; - } } diff --git a/crates/swc_ecma_transforms_base/src/rename/collector.rs b/crates/swc_ecma_transforms_base/src/rename/collector.rs deleted file mode 100644 index 8f0f23bb0417..000000000000 --- a/crates/swc_ecma_transforms_base/src/rename/collector.rs +++ /dev/null @@ -1,295 +0,0 @@ -use std::hash::Hash; - -use rustc_hash::FxHashSet; -use swc_atoms::Atom; -use swc_common::{Mark, SyntaxContext}; -use swc_ecma_ast::*; -use swc_ecma_utils::{ident::IdentLike, stack_size::maybe_grow_default}; -use swc_ecma_visit::{noop_visit_type, visit_obj_and_computed, Visit, VisitWith}; - -struct IdCollector { - ids: FxHashSet, - stopped: bool, -} - -impl IdCollector { - fn handle_ident(&mut self, n: &Ident) { - if !self.stopped && n.ctxt != SyntaxContext::empty() { - self.ids.insert(n.to_id()); - } - } -} - -struct CustomBindingCollector -where - I: IdentLike + Eq + Hash + Send + Sync, -{ - bindings: FxHashSet, - preserved: FxHashSet, - is_pat_decl: bool, - - /// [None] if there's no `eval`. - pub top_level_for_eval: Option, -} - -impl CustomBindingCollector -where - I: IdentLike + Eq + Hash + Send + Sync, -{ - fn add(&mut self, i: &Ident) { - if let Some(top_level_ctxt) = self.top_level_for_eval { - if i.ctxt == top_level_ctxt { - self.preserved.insert(I::from_ident(i)); - return; - } - } - - self.bindings.insert(I::from_ident(i)); - } - - fn handle_assign_pat_prop(&mut self, node: &AssignPatProp) { - if self.is_pat_decl { - self.add(&Ident::from(&node.key)); - } - } - - fn handle_binding_ident(&mut self, node: &BindingIdent) { - if self.is_pat_decl { - self.add(&Ident::from(node)); - } - } - - fn handle_class_expr(&mut self, node: &ClassExpr) { - if let Some(id) = &node.ident { - self.add(id); - } - } - - fn handle_fn_expr(&mut self, node: &FnExpr) { - if let Some(id) = &node.ident { - self.add(id); - } - } -} - -pub(super) struct Collector { - id_collector: IdCollector, - decl_collector: CustomBindingCollector, -} - -impl Visit for Collector { - noop_visit_type!(); - - fn visit_arrow_expr(&mut self, node: &ArrowExpr) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = true; - - node.visit_children_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_assign_pat_prop(&mut self, node: &AssignPatProp) { - node.visit_children_with(self); - - self.decl_collector.handle_assign_pat_prop(node); - } - - fn visit_binding_ident(&mut self, node: &BindingIdent) { - node.visit_children_with(self); - - self.decl_collector.handle_binding_ident(node); - } - - fn visit_bin_expr(&mut self, node: &BinExpr) { - maybe_grow_default(|| node.visit_children_with(self)); - } - - fn visit_catch_clause(&mut self, node: &CatchClause) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = true; - - node.param.visit_with(self); - - self.decl_collector.is_pat_decl = false; - - node.body.visit_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_class_decl(&mut self, node: &ClassDecl) { - node.visit_children_with(self); - - self.decl_collector.add(&node.ident); - } - - fn visit_class_expr(&mut self, node: &ClassExpr) { - node.visit_children_with(self); - - self.decl_collector.handle_class_expr(node); - } - - fn visit_expr(&mut self, node: &Expr) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = false; - - node.visit_children_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_fn_decl(&mut self, node: &FnDecl) { - node.visit_children_with(self); - - self.decl_collector.add(&node.ident); - } - - fn visit_fn_expr(&mut self, node: &FnExpr) { - node.visit_children_with(self); - - self.decl_collector.handle_fn_expr(node); - } - - fn visit_import_default_specifier(&mut self, node: &ImportDefaultSpecifier) { - node.visit_children_with(self); - - self.decl_collector.add(&node.local); - } - - fn visit_import_named_specifier(&mut self, node: &ImportNamedSpecifier) { - node.visit_children_with(self); - - self.decl_collector.add(&node.local); - } - - fn visit_import_star_as_specifier(&mut self, node: &ImportStarAsSpecifier) { - node.visit_children_with(self); - - self.decl_collector.add(&node.local); - } - - fn visit_param(&mut self, node: &Param) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = true; - - node.visit_children_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_ts_param_prop(&mut self, p: &TsParamProp) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = true; - - p.visit_children_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_var_declarator(&mut self, node: &VarDeclarator) { - let old_decl_collector_is_pat_decl = self.decl_collector.is_pat_decl; - self.decl_collector.is_pat_decl = true; - - node.name.visit_with(self); - - self.decl_collector.is_pat_decl = false; - - node.init.visit_with(self); - - self.decl_collector.is_pat_decl = old_decl_collector_is_pat_decl; - } - - fn visit_super_prop(&mut self, node: &SuperProp) { - let old_id_collector_stopped = self.id_collector.stopped; - if node.is_ident() { - self.id_collector.stopped = true; - } - - node.visit_children_with(self); - - if node.is_ident() { - self.id_collector.stopped = old_id_collector_stopped; - } - } - - fn visit_export_default_specifier(&mut self, n: &ExportDefaultSpecifier) { - let old_id_collector_stopped = self.id_collector.stopped; - self.id_collector.stopped = true; - - n.visit_children_with(self); - - self.id_collector.stopped = old_id_collector_stopped; - } - - fn visit_export_named_specifier(&mut self, n: &ExportNamedSpecifier) { - let old_id_collector_stopped = self.id_collector.stopped; - self.id_collector.stopped = true; - - n.visit_children_with(self); - - self.id_collector.stopped = old_id_collector_stopped; - } - - fn visit_export_namespace_specifier(&mut self, n: &ExportNamespaceSpecifier) { - let old_id_collector_stopped = self.id_collector.stopped; - self.id_collector.stopped = true; - - n.visit_children_with(self); - - self.id_collector.stopped = old_id_collector_stopped; - } - - fn visit_ident(&mut self, id: &Ident) { - self.id_collector.handle_ident(id); - } - - fn visit_named_export(&mut self, e: &NamedExport) { - let old_id_collector_stopped = self.id_collector.stopped; - if e.src.is_some() { - self.id_collector.stopped = true; - } - - e.visit_children_with(self); - - if e.src.is_some() { - self.id_collector.stopped = old_id_collector_stopped; - } - } -} - -pub(super) fn collect(n: &N, top_level_mark_for_eval: Option) -> FxHashSet -where - N: VisitWith, -{ - let id_collector = IdCollector { - ids: Default::default(), - stopped: false, - }; - let decl_collector = CustomBindingCollector { - bindings: Default::default(), - preserved: Default::default(), - is_pat_decl: false, - top_level_for_eval: top_level_mark_for_eval.map(|m| SyntaxContext::empty().apply_mark(m)), - }; - - let mut v = Collector { - id_collector, - decl_collector, - }; - - n.visit_with(&mut v); - - let (usages, decls, preserved) = ( - v.id_collector.ids, - v.decl_collector.bindings, - v.decl_collector.preserved, - ); - - usages - .into_iter() - .filter(|used_id| !decls.contains(used_id)) - .map(|v| v.0) - .chain(preserved.into_iter().map(|v| v.0)) - .collect() -} diff --git a/crates/swc_ecma_transforms_base/src/rename/mod.rs b/crates/swc_ecma_transforms_base/src/rename/mod.rs index 8de9e72d53c3..06397a59bdde 100644 --- a/crates/swc_ecma_transforms_base/src/rename/mod.rs +++ b/crates/swc_ecma_transforms_base/src/rename/mod.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::hash_map::Entry}; -use collector::{collect, Collector}; +use analyer_and_collector::AnalyzerAndCollector; use rustc_hash::{FxHashMap, FxHashSet}; use swc_atoms::Atom; use swc_ecma_ast::*; @@ -19,8 +19,8 @@ use self::renamer_single::{Send, Sync}; use self::{analyzer::Analyzer, ops::Operator}; use crate::hygiene::Config; +mod analyer_and_collector; mod analyzer; -mod collector; mod eval; mod ops; @@ -112,25 +112,16 @@ where { fn get_map(&mut self, node: &N, skip_one: bool, top_level: bool, has_eval: bool) -> RenameMap where - N: VisitWith + VisitWith, + N: VisitWith, { - let mut scope = { - let mut v = Analyzer { - has_eval, - top_level_mark: self.config.top_level_mark, - - ..Default::default() - }; - if skip_one { - node.visit_children_with(&mut v); - } else { - node.visit_with(&mut v); - } - v.scope - }; - scope.prepare_renaming(); + let (mut scope, unresolved) = analyer_and_collector::analyzer_and_collect_unresolved( + node, + has_eval, + self.config.top_level_mark, + skip_one, + ); - let unresolved = collect(node, has_eval.then_some(self.config.top_level_mark)); + scope.prepare_renaming(); let mut unresolved = if !top_level { let mut set = self.unresolved.clone(); @@ -222,20 +213,6 @@ macro_rules! unit { } else { let map = self.get_map(n, false, false, false); - if !map.is_empty() { - n.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); - } - } - } - }; - ($name:ident, $T:ty, true) => { - /// Only called if `eval` exists - fn $name(&mut self, n: &mut $T) { - if !self.config.ignore_eval && contains_eval(n, true) { - n.visit_mut_children_with(self); - } else { - let map = self.get_map(n, true, false, false); - if !map.is_empty() { n.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); } From a2d56645cbf753770a2634e23423a59acaae6b84 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 23 May 2025 03:09:51 +0800 Subject: [PATCH 006/209] refactor(ts/fast-dts): Derive computed flags from source code (#10510) --- .changeset/flat-steaks-relate.md | 5 +++ crates/swc_typescript/src/fast_dts/types.rs | 32 +++++++++---------- .../tests/fixture/ts-property.snap | 6 ++++ .../tests/fixture/ts-property.ts | 15 +++++++++ 4 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 .changeset/flat-steaks-relate.md diff --git a/.changeset/flat-steaks-relate.md b/.changeset/flat-steaks-relate.md new file mode 100644 index 000000000000..5bafe27afe4c --- /dev/null +++ b/.changeset/flat-steaks-relate.md @@ -0,0 +1,5 @@ +--- +swc_typescript: patch +--- + +refactor(ts/fast-dts): Derive computed flags from source code diff --git a/crates/swc_typescript/src/fast_dts/types.rs b/crates/swc_typescript/src/fast_dts/types.rs index f1cb4283b3fc..5ee5fc90bc9b 100644 --- a/crates/swc_typescript/src/fast_dts/types.rs +++ b/crates/swc_typescript/src/fast_dts/types.rs @@ -172,12 +172,12 @@ impl FastDts { self.inferred_type_of_expression(kv.value.span()); } - let (key, computed) = self.transform_property_name_to_expr(&kv.key); + let key = self.transform_property_name_to_expr(&kv.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { span: DUMMY_SP, readonly: is_const, key: Box::new(key), - computed, + computed: kv.key.is_computed(), optional: false, type_ann, })); @@ -207,12 +207,12 @@ impl FastDts { self.accessor_must_have_explicit_return_type(getter.span); } - let (key, computed) = self.transform_property_name_to_expr(&getter.key); + let key = self.transform_property_name_to_expr(&getter.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { span: DUMMY_SP, readonly: !has_setter, key: Box::new(key), - computed, + computed: getter.key.is_computed(), optional: false, type_ann: getter_type_ann, })); @@ -243,12 +243,12 @@ impl FastDts { self.accessor_must_have_explicit_return_type(setter.span); } - let (key, computed) = self.transform_property_name_to_expr(&setter.key); + let key = self.transform_property_name_to_expr(&setter.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { span: DUMMY_SP, readonly: false, key: Box::new(key), - computed, + computed: setter.key.is_computed(), optional: false, type_ann: setter_type_ann, })); @@ -259,12 +259,12 @@ impl FastDts { } if is_const { - let (key, computed) = self.transform_property_name_to_expr(&method.key); + let key = self.transform_property_name_to_expr(&method.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { span: DUMMY_SP, readonly: is_const, key: Box::new(key), - computed, + computed: method.key.is_computed(), optional: false, type_ann: self .transform_fn_to_ts_type( @@ -275,11 +275,11 @@ impl FastDts { })); } else { let return_type = self.infer_function_return_type(&method.function); - let (key, computed) = self.transform_property_name_to_expr(&method.key); + let key = self.transform_property_name_to_expr(&method.key); members.push(TsTypeElement::TsMethodSignature(TsMethodSignature { span: DUMMY_SP, key: Box::new(key), - computed, + computed: method.key.is_computed(), optional: false, params: self .transform_fn_params_to_ts_type(&method.function.params), @@ -340,13 +340,13 @@ impl FastDts { }))) } - pub(crate) fn transform_property_name_to_expr(&mut self, name: &PropName) -> (Expr, bool) { + pub(crate) fn transform_property_name_to_expr(&mut self, name: &PropName) -> Expr { match name { - PropName::Ident(ident) => (Expr::Ident(ident.clone().into()), false), - PropName::Str(str_prop) => (Lit::Str(str_prop.clone()).into(), false), - PropName::Num(num) => (Lit::Num(num.clone()).into(), true), - PropName::Computed(computed) => (*computed.expr.clone(), true), - PropName::BigInt(big_int) => (Lit::BigInt(big_int.clone()).into(), true), + PropName::Ident(ident) => Expr::Ident(ident.clone().into()), + PropName::Str(str_prop) => Lit::Str(str_prop.clone()).into(), + PropName::Num(num) => Lit::Num(num.clone()).into(), + PropName::Computed(computed) => *computed.expr.clone(), + PropName::BigInt(big_int) => Lit::BigInt(big_int.clone()).into(), } } diff --git a/crates/swc_typescript/tests/fixture/ts-property.snap b/crates/swc_typescript/tests/fixture/ts-property.snap index b92ff8c03ec7..b22650ba66fe 100644 --- a/crates/swc_typescript/tests/fixture/ts-property.snap +++ b/crates/swc_typescript/tests/fixture/ts-property.snap @@ -6,6 +6,12 @@ export interface I { [A]: "123"; [B]: "456"; } +export declare const foo: { + "foo"(): string; + ["bar"](): string; + 123(): string; + 1n(): string; +}; export { }; diff --git a/crates/swc_typescript/tests/fixture/ts-property.ts b/crates/swc_typescript/tests/fixture/ts-property.ts index 6ad8330f58c2..ff44253e3ec2 100644 --- a/crates/swc_typescript/tests/fixture/ts-property.ts +++ b/crates/swc_typescript/tests/fixture/ts-property.ts @@ -4,3 +4,18 @@ export interface I { [A]: "123"; [B]: "456"; } + +export const foo = { + "foo"(): string { + return "foo"; + }, + ["bar"](): string { + return "bar"; + }, + 123(): string { + return "123"; + }, + 1n(): string { + return "1n"; + }, +}; From 1cb38430410e92a07bfdb973095985ac46be9b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Thu, 22 May 2025 12:10:26 -0700 Subject: [PATCH 007/209] chore: Publish crates with `swc_core` `v26.1.0` --- .changeset/cyan-rules-exist.md | 6 --- .changeset/flat-steaks-relate.md | 5 --- .changeset/silent-cameras-invent.md | 6 --- .changeset/ten-tables-design.md | 6 --- .changeset/wicked-monkeys-agree.md | 6 --- CHANGELOG-CORE.md | 38 +++++++++++------ CHANGELOG.md | 41 ++++++++++++------- Cargo.lock | 10 ++--- crates/dbg-swc/Cargo.toml | 4 +- crates/swc/Cargo.toml | 6 +-- crates/swc_bundler/Cargo.toml | 4 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 10 ++--- crates/swc_ecma_codegen/Cargo.toml | 2 +- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 4 +- crates/swc_ecma_minifier/Cargo.toml | 4 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 4 +- crates/swc_ecma_transforms_base/Cargo.toml | 4 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../swc_ecma_transforms_proposal/Cargo.toml | 4 +- crates/swc_ecma_transforms_react/Cargo.toml | 4 +- crates/swc_ecma_transforms_testing/Cargo.toml | 4 +- .../swc_ecma_transforms_typescript/Cargo.toml | 4 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 4 +- crates/swc_html_minifier/Cargo.toml | 4 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 6 +-- 44 files changed, 113 insertions(+), 117 deletions(-) delete mode 100644 .changeset/cyan-rules-exist.md delete mode 100644 .changeset/flat-steaks-relate.md delete mode 100644 .changeset/silent-cameras-invent.md delete mode 100644 .changeset/ten-tables-design.md delete mode 100644 .changeset/wicked-monkeys-agree.md diff --git a/.changeset/cyan-rules-exist.md b/.changeset/cyan-rules-exist.md deleted file mode 100644 index 99b727d7719b..000000000000 --- a/.changeset/cyan-rules-exist.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: minor -swc_ecma_codegen: minor ---- - -refactor(es/codegen): Migrate to ryu-js for numeric literal codegen diff --git a/.changeset/flat-steaks-relate.md b/.changeset/flat-steaks-relate.md deleted file mode 100644 index 5bafe27afe4c..000000000000 --- a/.changeset/flat-steaks-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -swc_typescript: patch ---- - -refactor(ts/fast-dts): Derive computed flags from source code diff --git a/.changeset/silent-cameras-invent.md b/.changeset/silent-cameras-invent.md deleted file mode 100644 index 3ef110de6732..000000000000 --- a/.changeset/silent-cameras-invent.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_typescript: patch ---- - -fix(ts/fast-dts): Correctly emit Symbol-keyed accessors in declarations diff --git a/.changeset/ten-tables-design.md b/.changeset/ten-tables-design.md deleted file mode 100644 index 6199ad52c2cb..000000000000 --- a/.changeset/ten-tables-design.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_react_compiler: patch ---- - -fix(react-compiler/support): Fix usefulness detection diff --git a/.changeset/wicked-monkeys-agree.md b/.changeset/wicked-monkeys-agree.md deleted file mode 100644 index e879618a06bd..000000000000 --- a/.changeset/wicked-monkeys-agree.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: minor -swc_ecma_transforms_base: minor ---- - -perf(es/renamer): Merge analyze/collect diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 168d2d742339..5bdea6c32161 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,4 +1,30 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(es/react-compiler)** Fix usefulness detection ([#10506](https://github.com/swc-project/swc/issues/10506)) ([41075a1](https://github.com/swc-project/swc/commit/41075a1c8776b62d7c2fc6436677d5d6b083a2f8)) + + +- **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) + +### Performance + + + +- **(es/renamer)** Merge analyze/collect ([#10509](https://github.com/swc-project/swc/issues/10509)) ([7b47f66](https://github.com/swc-project/swc/commit/7b47f661dd6794f658023b649ebcdc153fe6e27c)) + +### Refactor + + + +- **(es/codegen)** Migrate to `ryu-js` for numeric literal codegen ([#10503](https://github.com/swc-project/swc/issues/10503)) ([4bc4244](https://github.com/swc-project/swc/commit/4bc4244c195d3a364b588348657fd8a3d8c22079)) + + +- **(ts/fast-dts)** Derive computed flags from source code ([#10510](https://github.com/swc-project/swc/issues/10510)) ([a2d5664](https://github.com/swc-project/swc/commit/a2d56645cbf753770a2634e23423a59acaae6b84)) + ## [swc_core@v26.0.1] - 2025-05-21 ### Bug Fixes @@ -2356,9 +2382,6 @@ - **(es/common)** Introduce pure `Span` and `BytePos` to handle `#__PURE__` ([#9539](https://github.com/swc-project/swc/issues/9539)) ([f63a481](https://github.com/swc-project/swc/commit/f63a481833ebe9b5eae0708ee69b6a50b946ee28)) -- **(es/minifier)** Support mangle cache ([#9489](https://github.com/swc-project/swc/issues/9489)) ([af922d8](https://github.com/swc-project/swc/commit/af922d83e58596021476006564edb6270069d437)) - - - **(plugin/runner)** Improve error message ([#9502](https://github.com/swc-project/swc/issues/9502)) ([da52930](https://github.com/swc-project/swc/commit/da529304fe23bcb1a15c25811f928ebf91207ef0)) ### Miscellaneous Tasks @@ -2373,9 +2396,6 @@ - **(es)** Add helpers ([#9586](https://github.com/swc-project/swc/issues/9586)) ([b94a0e1](https://github.com/swc-project/swc/commit/b94a0e1fd2b900b05c5f18d3d993a74ff9cc6e7d)) - -- **(es/codegen)** Bump minimum required swc_allocator version to 0.1.8 ([#9492](https://github.com/swc-project/swc/issues/9492)) ([5258763](https://github.com/swc-project/swc/commit/5258763cf673e1684808bc2766ba6ee9c84642f1)) - ### Performance @@ -2385,12 +2405,6 @@ - **(es/utils)** Rewrite inject_after_super ([#9496](https://github.com/swc-project/swc/issues/9496)) ([c562cfa](https://github.com/swc-project/swc/commit/c562cfa8af1163a4946ef79cb025d461c7e2e5e0)) -### Refactor - - - -- **(es/utils)** Unify `prepend_stmts` ([#9493](https://github.com/swc-project/swc/issues/9493)) ([faec8c1](https://github.com/swc-project/swc/commit/faec8c134d950d10a9f2dce0e5680d9230f87ceb)) - ### Testing diff --git a/CHANGELOG.md b/CHANGELOG.md index 8613395a89ea..1f1fb77ad1fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,30 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(es/react-compiler)** Fix usefulness detection ([#10506](https://github.com/swc-project/swc/issues/10506)) ([41075a1](https://github.com/swc-project/swc/commit/41075a1c8776b62d7c2fc6436677d5d6b083a2f8)) + + +- **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) + +### Performance + + + +- **(es/renamer)** Merge analyze/collect ([#10509](https://github.com/swc-project/swc/issues/10509)) ([7b47f66](https://github.com/swc-project/swc/commit/7b47f661dd6794f658023b649ebcdc153fe6e27c)) + +### Refactor + + + +- **(es/codegen)** Migrate to `ryu-js` for numeric literal codegen ([#10503](https://github.com/swc-project/swc/issues/10503)) ([4bc4244](https://github.com/swc-project/swc/commit/4bc4244c195d3a364b588348657fd8a3d8c22079)) + + +- **(ts/fast-dts)** Derive computed flags from source code ([#10510](https://github.com/swc-project/swc/issues/10510)) ([a2d5664](https://github.com/swc-project/swc/commit/a2d56645cbf753770a2634e23423a59acaae6b84)) + ## [1.11.29] - 2025-05-21 ### Bug Fixes @@ -2048,21 +2074,6 @@ -- **(es/minifier)** Support mangle cache ([#9489](https://github.com/swc-project/swc/issues/9489)) ([af922d8](https://github.com/swc-project/swc/commit/af922d83e58596021476006564edb6270069d437)) - - - **(plugin/runner)** Improve error message ([#9502](https://github.com/swc-project/swc/issues/9502)) ([da52930](https://github.com/swc-project/swc/commit/da529304fe23bcb1a15c25811f928ebf91207ef0)) -### Miscellaneous Tasks - - - -- **(es/codegen)** Bump minimum required swc_allocator version to 0.1.8 ([#9492](https://github.com/swc-project/swc/issues/9492)) ([5258763](https://github.com/swc-project/swc/commit/5258763cf673e1684808bc2766ba6ee9c84642f1)) - -### Refactor - - - -- **(es/utils)** Unify `prepend_stmts` ([#9493](https://github.com/swc-project/swc/issues/9493)) ([faec8c1](https://github.com/swc-project/swc/commit/faec8c134d950d10a9f2dce0e5680d9230f87ceb)) - diff --git a/Cargo.lock b/Cargo.lock index f34e3eb4df70..a4ede695d7b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.0.1" +version = "26.1.0" dependencies = [ "anyhow", "binding_macros", @@ -5256,7 +5256,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.0.0" +version = "13.1.0" dependencies = [ "ascii", "base64 0.22.1", @@ -5717,7 +5717,7 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.0" +version = "4.0.1" dependencies = [ "swc_atoms", "swc_common", @@ -5764,7 +5764,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.0.1" +version = "15.1.0" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", @@ -6474,7 +6474,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.1" +version = "14.0.2" dependencies = [ "bitflags 2.6.0", "petgraph 0.7.1", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 4844901b7907..49625f99afa7 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -32,12 +32,12 @@ swc_common = { version = "11.0.0", features = [ "tty-emitter", ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index dccd8ee7eb4b..d98643109b2a 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -80,7 +80,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_compiler_base = { version = "22.0.0", path = "../swc_compiler_base" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_ext_transforms = { version = "15.0.0", path = "../swc_ecma_ext_transforms" } swc_ecma_lints = { version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ @@ -99,7 +99,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea "react", "typescript", ] } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } @@ -110,7 +110,7 @@ swc_plugin_proxy = { version = "11.0.0", path = "../swc_plugin_proxy", optional swc_plugin_runner = { version = "13.0.0", path = "../swc_plugin_runner", optional = true, default-features = false } swc_timer = { version = "1.0.0", path = "../swc_timer" } swc_transform_common = { version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { version = "14.0.1", path = "../swc_typescript" } +swc_typescript = { version = "14.0.2", path = "../swc_typescript" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dependencies.tokio] diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 50673dca588e..4de8a34ba55c 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -41,10 +41,10 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 3dcb18c3a184..f49f1dfeccc0 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.0.1", features = [ +swc_core = { version = "26.1.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 4facefeda515..cfd08708df0f 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -29,7 +29,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 88bb0f68fdc1..2740d3ce6fb8 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.0.1" +version = "26.1.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -365,15 +365,15 @@ swc_css_prefixer = { optional = true, version = "13.0.0", path = swc_css_utils = { optional = true, version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { optional = true, version = "11.0.0", path = "../swc_css_visit" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { optional = true, version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { optional = true, version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_minifier = { optional = true, version = "20.0.0", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } -swc_ecma_react_compiler = { optional = true, version = "4.0.0", path = "../swc_ecma_react_compiler" } -swc_ecma_transforms_base = { optional = true, version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_react_compiler = { optional = true, version = "4.0.1", path = "../swc_ecma_react_compiler" } +swc_ecma_transforms_base = { optional = true, version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_module = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_module" } swc_ecma_transforms_optimization = { optional = true, version = "16.0.0", path = "../swc_ecma_transforms_optimization" } @@ -393,7 +393,7 @@ swc_plugin_proxy = { optional = true, version = "11.0.0", path = swc_plugin_runner = { optional = true, version = "13.0.0", path = "../swc_plugin_runner", default-features = false } swc_trace_macro = { optional = true, version = "2.0.1", path = "../swc_trace_macro" } swc_transform_common = { optional = true, version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { optional = true, version = "14.0.1", path = "../swc_typescript" } +swc_typescript = { optional = true, version = "14.0.2", path = "../swc_typescript" } testing = { optional = true, version = "12.0.0", path = "../testing" } [build-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index a6865ae644a4..b417ed312aa7 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_codegen" repository = { workspace = true } -version = "13.0.0" +version = "13.1.0" [features] # This does not enable serde for ast nodes. diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 31d081a47919..6da20e1bb9b2 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -18,7 +18,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 5df059095156..7d0db46968c2 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -27,7 +27,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 35835f92d87f..653a58103019 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 5753b54e424c..38413f61de09 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -19,7 +19,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index c7b3694477c4..b976d82b6874 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -20,7 +20,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index d474a622961d..fbd53f80eb18 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -19,7 +19,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 4860d08af030..58cb9f1159da 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -18,7 +18,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 65d41385dae7..c6e1596f012b 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 24e880ae244b..9de6ae20fd11 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -21,7 +21,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 491d4c710f53..d237f32e23f8 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index b6022a2fbb62..7b2d4b6a5fe8 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -37,10 +37,10 @@ anyhow = { workspace = true } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } walkdir = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 46b089f2e54c..c0592d625467 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -62,9 +62,9 @@ swc_config = { version = "3.0.0", path = "../swc_config", features = [ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.0", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 0562d5baad4b..a6f67f871782 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -44,7 +44,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index cd0537c4775e..830c8b8d5f63 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_react_compiler" repository = { workspace = true } -version = "4.0.0" +version = "4.0.1" [package.metadata.docs.rs] diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index ef94df227ade..3243b2df4fe3 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -38,7 +38,7 @@ par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } swc_ecma_transforms_module = { version = "17.0.0", path = "../swc_ecma_transforms_module", optional = true } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization", optional = true } @@ -55,7 +55,7 @@ pretty_assertions = { workspace = true } sourcemap = { workspace = true } tempfile = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index a7ebeb9e8c64..1c9145933c40 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.js"] license = { workspace = true } name = "swc_ecma_transforms_base" repository = { workspace = true } -version = "15.0.1" +version = "15.1.0" [lib] bench = false @@ -42,7 +42,7 @@ criterion = { workspace = true } par-core = { workspace = true, features = ["chili"] } rayon = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 68ab5333ac2d..3873b2a899da 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -15,6 +15,6 @@ bench = false swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 4e47e7c86ed5..e85e6c5af88b 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_compat_es2020 = { version = "16.0.0", path = "../swc_ecma_compat_e swc_ecma_compat_es2021 = { version = "15.0.0", path = "../swc_ecma_compat_es2021" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_compat_es3 = { version = "15.0.0", path = "../swc_ecma_compat_es3" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 8e6c4037df0f..9d13a15c6224 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -35,7 +35,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index ac8ecbd36a7a..73dccf178130 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -36,7 +36,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 13e2b068cee4..f1c5764fd306 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -26,7 +26,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } @@ -35,7 +35,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] serde_json = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index b76e5c937ad4..eca297de39be 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -34,13 +34,13 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen/" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen/" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat/" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 7ce3122a5d36..33416ed2fafc 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -27,10 +27,10 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index adf7e39c30f7..1a80a5957d19 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -24,7 +24,7 @@ serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } @@ -33,7 +33,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 1dfca031b281..e522aaf72bf6 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -39,7 +39,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen", optional = true } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 8f22b7c21b14..30daad4ec424 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -21,9 +21,9 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_lexer = { version = "14.0.0", path = "../swc_ecma_lexer" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 8b750c51124d..83659415f66c 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -39,14 +39,14 @@ swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = swc_css_minifier = { version = "11.0.0", path = "../swc_css_minifier", optional = true } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser", optional = true } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen", features = [ +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen = { version = "11.0.0", path = "../swc_html_codegen" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 88a3e73032ba..38fc03f8dee2 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -39,7 +39,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index f7394196b430..196aa0cf12ab 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_typescript" repository = { workspace = true } -version = "14.0.1" +version = "14.0.2" [dependencies] bitflags = {workspace = true } @@ -22,7 +22,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.0.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.0.1", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } testing = { version = "12.0.0", path = "../testing" } From 6de3ef65bc599679020de13a3085824f06e047a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=B9=E0=A4=BF=E0=A4=AE=E0=A4=BE=E0=A4=82=E0=A4=B6?= =?UTF-8?q?=E0=A5=81?= Date: Fri, 23 May 2025 00:45:12 +0530 Subject: [PATCH 008/209] fix(es/minifier): Fix missing variable (#10478) **Description:** This PR fixes the member expression usage bug. **Related issue:** - Closes https://github.com/swc-project/swc/issues/10412 --- .../src/compress/optimize/unused.rs | 4 +- .../tests/fixture/issues/10412/config.json | 44 +++++++++++++++++++ .../tests/fixture/issues/10412/input.js | 9 ++++ .../tests/fixture/issues/10412/output.js | 10 +++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10412/config.json create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10412/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10412/output.js diff --git a/crates/swc_ecma_minifier/src/compress/optimize/unused.rs b/crates/swc_ecma_minifier/src/compress/optimize/unused.rs index c66f6992fc5b..730887068a4a 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/unused.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/unused.rs @@ -182,10 +182,12 @@ impl Optimizer<'_> { } if let Some(v) = self.data.vars.get(&i.to_id()) { + let is_used_in_member = + v.property_mutation_count > 0 || v.flags.contains(VarUsageInfoFlags::USED_AS_REF); if v.ref_count == 0 && v.usage_count == 0 && !v.flags.contains(VarUsageInfoFlags::REASSIGNED) - && v.property_mutation_count == 0 + && !is_used_in_member { self.changed = true; report_change!( diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10412/config.json b/crates/swc_ecma_minifier/tests/fixture/issues/10412/config.json new file mode 100644 index 000000000000..21583dfed99e --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10412/config.json @@ -0,0 +1,44 @@ +{ + "arguments": false, + "arrows": true, + "booleans": true, + "booleans_as_integers": false, + "collapse_vars": true, + "comparisons": true, + "computed_props": true, + "conditionals": true, + "dead_code": true, + "directives": true, + "drop_console": false, + "drop_debugger": true, + "evaluate": true, + "expression": false, + "hoist_funs": false, + "hoist_props": true, + "hoist_vars": false, + "if_return": true, + "join_vars": true, + "keep_classnames": false, + "keep_fargs": true, + "keep_fnames": false, + "keep_infinity": false, + "loops": true, + "negate_iife": true, + "properties": true, + "reduce_funcs": false, + "reduce_vars": false, + "side_effects": true, + "switches": true, + "typeofs": true, + "unsafe": false, + "unsafe_arrows": false, + "unsafe_comps": false, + "unsafe_Function": false, + "unsafe_math": false, + "unsafe_symbols": false, + "unsafe_methods": false, + "unsafe_proto": false, + "unsafe_regexp": false, + "unsafe_undefined": false, + "unused": true +} \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10412/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/10412/input.js new file mode 100644 index 000000000000..f5a14a5cec2c --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10412/input.js @@ -0,0 +1,9 @@ +(function (e, i) { + // "_" rename to another name also reproduce + var _ = (((i = {})[n.NONE] = { platform: a.NONE }), i); + + e.getPlatform = function () { + // "_" should not be removed + console.log(_[t.toString()]); + }; +})(); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10412/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/10412/output.js new file mode 100644 index 000000000000..3a77d358f13a --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10412/output.js @@ -0,0 +1,10 @@ +!function(e, i) { + // "_" rename to another name also reproduce + var _ = ((i = {})[n.NONE] = { + platform: a.NONE + }, i); + e.getPlatform = function() { + // "_" should not be removed + console.log(_[t.toString()]); + }; +}(); From 56443727dd195a2a3500014b8f54b9a18e14e484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 22 May 2025 14:34:21 -0700 Subject: [PATCH 009/209] fix(es/utils): Fix `extract_var_ids` (#10511) **Description:** This had a bug. --- crates/swc_ecma_utils/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/swc_ecma_utils/src/lib.rs b/crates/swc_ecma_utils/src/lib.rs index 135101fac0bd..88ba9f14f306 100644 --- a/crates/swc_ecma_utils/src/lib.rs +++ b/crates/swc_ecma_utils/src/lib.rs @@ -602,6 +602,8 @@ pub struct Hoister { impl Visit for Hoister { noop_visit_type!(); + fn visit_arrow_expr(&mut self, _: &ArrowExpr) {} + fn visit_assign_expr(&mut self, node: &AssignExpr) { node.right.visit_children_with(self); } @@ -612,10 +614,16 @@ impl Visit for Hoister { self.vars.push(node.key.clone().into()); } + fn visit_constructor(&mut self, _: &Constructor) {} + fn visit_fn_decl(&mut self, f: &FnDecl) { self.vars.push(f.ident.clone()); } + fn visit_function(&mut self, _: &Function) {} + + fn visit_getter_prop(&mut self, _: &GetterProp) {} + fn visit_pat(&mut self, p: &Pat) { p.visit_children_with(self); @@ -624,6 +632,8 @@ impl Visit for Hoister { } } + fn visit_setter_prop(&mut self, _: &SetterProp) {} + fn visit_var_decl(&mut self, v: &VarDecl) { if v.kind != VarDeclKind::Var { return; @@ -631,8 +641,6 @@ impl Visit for Hoister { v.visit_children_with(self) } - - fn visit_fn_expr(&mut self, _n: &FnExpr) {} } #[derive(Debug, Clone, Copy)] From dc603ed5f79fd05d13d05bc10faa9b2ca15e23e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Thu, 22 May 2025 15:29:23 -0700 Subject: [PATCH 010/209] chore: Publish crates with `swc_core` `v26.1.1` --- CHANGELOG-CORE.md | 17 ++++++++++------ CHANGELOG.md | 20 ++++++------------- Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 4 ++-- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- .../swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 4 ++-- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- 41 files changed, 64 insertions(+), 67 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 5bdea6c32161..db9ed1565f7c 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,17 @@ +- **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) + + +- **(es/utils)** Fix `extract_var_ids` ([#10511](https://github.com/swc-project/swc/issues/10511)) ([5644372](https://github.com/swc-project/swc/commit/56443727dd195a2a3500014b8f54b9a18e14e484)) + +## [swc_core@v26.1.0] - 2025-05-22 + +### Bug Fixes + + + - **(es/react-compiler)** Fix usefulness detection ([#10506](https://github.com/swc-project/swc/issues/10506)) ([41075a1](https://github.com/swc-project/swc/commit/41075a1c8776b62d7c2fc6436677d5d6b083a2f8)) @@ -2337,9 +2348,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Track if a var is used with `in` ([#9508](https://github.com/swc-project/swc/issues/9508)) ([7d6269e](https://github.com/swc-project/swc/commit/7d6269e3b826524e340edf274a5e42b2a0ea058a)) - - - **(es/minifier)** Iterate object properties in reverse direction while inlining property access ([#9507](https://github.com/swc-project/swc/issues/9507)) ([f584ef7](https://github.com/swc-project/swc/commit/f584ef76d75e86da15d0725ac94be35a88a1c946)) @@ -2381,9 +2389,6 @@ - **(es/common)** Introduce pure `Span` and `BytePos` to handle `#__PURE__` ([#9539](https://github.com/swc-project/swc/issues/9539)) ([f63a481](https://github.com/swc-project/swc/commit/f63a481833ebe9b5eae0708ee69b6a50b946ee28)) - -- **(plugin/runner)** Improve error message ([#9502](https://github.com/swc-project/swc/issues/9502)) ([da52930](https://github.com/swc-project/swc/commit/da529304fe23bcb1a15c25811f928ebf91207ef0)) - ### Miscellaneous Tasks diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f1fb77ad1fd..2571f85946fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,15 @@ +- **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) + + - **(es/react-compiler)** Fix usefulness detection ([#10506](https://github.com/swc-project/swc/issues/10506)) ([41075a1](https://github.com/swc-project/swc/commit/41075a1c8776b62d7c2fc6436677d5d6b083a2f8)) +- **(es/utils)** Fix `extract_var_ids` ([#10511](https://github.com/swc-project/swc/issues/10511)) ([5644372](https://github.com/swc-project/swc/commit/56443727dd195a2a3500014b8f54b9a18e14e484)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) ### Performance @@ -2062,18 +2068,4 @@ - **(es/typescript)** Preserve more comments ([#9509](https://github.com/swc-project/swc/issues/9509)) ([3e253ec](https://github.com/swc-project/swc/commit/3e253ecc21f2028437572093b42df97ef5fe505e)) -## [1.7.19] - 2024-08-28 - -### Bug Fixes - - - -- **(es/minifier)** Track if a var is used with `in` ([#9508](https://github.com/swc-project/swc/issues/9508)) ([7d6269e](https://github.com/swc-project/swc/commit/7d6269e3b826524e340edf274a5e42b2a0ea058a)) - -### Features - - - -- **(plugin/runner)** Improve error message ([#9502](https://github.com/swc-project/swc/issues/9502)) ([da52930](https://github.com/swc-project/swc/commit/da529304fe23bcb1a15c25811f928ebf91207ef0)) - diff --git a/Cargo.lock b/Cargo.lock index a4ede695d7b1..fa6091bf408b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.1.0" +version = "26.1.1" dependencies = [ "anyhow", "binding_macros", @@ -5581,7 +5581,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.0" +version = "20.0.1" dependencies = [ "ansi_term", "anyhow", @@ -6036,7 +6036,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.0" +version = "15.0.1" dependencies = [ "indexmap 2.7.1", "num_cpus", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 49625f99afa7..5fb3ea6eea5d 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -33,7 +33,7 @@ swc_common = { version = "11.0.0", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index d98643109b2a..7232fd768432 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -88,7 +88,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ @@ -102,7 +102,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } swc_node_comments = { version = "11.0.0", path = "../swc_node_comments" } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 4de8a34ba55c..9dbf3f7f74eb 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -46,7 +46,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loa swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_graph_analyzer = { version = "12.0.0", path = "../swc_graph_analyzer/" } @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index f49f1dfeccc0..937dfff8ae5c 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.1.0", features = [ +swc_core = { version = "26.1.1", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index cfd08708df0f..bc317f66560c 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -30,7 +30,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 2740d3ce6fb8..4514705c79d3 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.1.0" +version = "26.1.1" [package.metadata.docs.rs] features = [ "allocator_node", @@ -368,7 +368,7 @@ swc_ecma_ast = { optional = true, version = "11.0.0", path = swc_ecma_codegen = { optional = true, version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "20.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } @@ -382,7 +382,7 @@ swc_ecma_transforms_react = { optional = true, version = "17.0.0", path = swc_ecma_transforms_testing = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_testing" } swc_ecma_transforms_typescript = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_usage_analyzer = { optional = true, version = "16.0.0", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { optional = true, version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { optional = true, version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "1.2.3", path = "../swc_malloc" } swc_node_bundler = { optional = true, version = "26.0.0", path = "../swc_node_bundler" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 6da20e1bb9b2..b657f96a853f 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -19,7 +19,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index ec2c5f552b56..c4b09aeef921 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -14,6 +14,6 @@ version = "15.0.0" [dependencies] swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 7d0db46968c2..68a93c6b61ed 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -30,7 +30,7 @@ swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_c swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 653a58103019..c14d22082136 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -18,7 +18,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 38413f61de09..665288226f99 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -21,7 +21,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index b976d82b6874..f6fe6eadb381 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -22,7 +22,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index fbd53f80eb18..831f53305f1d 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -20,7 +20,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 58cb9f1159da..2bef712f5a62 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -19,7 +19,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index c6e1596f012b..80cadb007051 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -19,6 +19,6 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 9de6ae20fd11..6acc4ad077c3 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -24,6 +24,6 @@ swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_c swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index d237f32e23f8..02dce7e8f98f 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index c20d0ec66874..2cc215d9a4bf 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -17,5 +17,5 @@ phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 7b2d4b6a5fe8..61ad5310a36c 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -29,7 +29,7 @@ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index c0592d625467..39dff84f0da0 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.0" +version = "20.0.1" [package.metadata.docs.rs] all-features = true @@ -67,7 +67,7 @@ swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.0", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index a6f67f871782..a393ec7f9d31 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea "compat", "proposal", ] } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 3243b2df4fe3..c54646d78cf5 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_tra swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal", optional = true } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react", optional = true } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript", optional = true } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 1c9145933c40..c8eab935ef60 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -33,7 +33,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 3873b2a899da..f5b33e013a37 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -16,5 +16,5 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index e85e6c5af88b..175d4e633266 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -48,7 +48,7 @@ swc_ecma_compat_es3 = { version = "15.0.0", path = "../swc_ecma_compat_e swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 9d13a15c6224..88acd69ffd08 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 73dccf178130..413b50c4516e 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -38,7 +38,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index f1c5764fd306..ee6554d50cb3 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -29,7 +29,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index eca297de39be..b491bad145d1 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 33416ed2fafc..bcbcf08b4c97 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -31,6 +31,6 @@ swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 1a80a5957d19..28b70f612d9c 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -26,7 +26,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index ac9d093273d4..a067c62626c5 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -31,6 +31,6 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index f4ca4ec87b75..4038aed57dc9 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_utils" repository = { workspace = true } -version = "15.0.0" +version = "15.0.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index e522aaf72bf6..df45fb41e003 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,12 +40,12 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", optional = true } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils", optional = true } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils", optional = true } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [dev-dependencies] diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index e311e0ba887a..a5b3b8a23546 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -31,7 +31,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_estree_ast = { version = "11.0.0", path = "../swc_estree_ast" } swc_node_comments = { version = "11.0.0", path = "../swc_node_comments/" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 83659415f66c..5690a0c79ecb 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -42,7 +42,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 38fc03f8dee2..a7b9e61de470 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -43,7 +43,7 @@ swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 196aa0cf12ab..b7fd78235f1d 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -17,7 +17,7 @@ thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.0", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } From f65f02831cb68245d5790a6c867ac3e997eedbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 23 May 2025 08:20:26 -0700 Subject: [PATCH 011/209] chore(bindings): Use published versions of crates (#10513) **Related issue:** - https://github.com/nodejs/amaro/pull/241 --- .github/workflows/CI.yml | 24 ++++- bindings/Cargo.lock | 183 +++++++++++++++++++++++++++++++++++++-- bindings/Cargo.toml | 43 ++++----- 3 files changed, 216 insertions(+), 34 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c54598e65e61..4f46e31c8d07 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -144,6 +144,13 @@ jobs: with: profile: minimal + - name: Patch + shell: bash + run: | + echo '[patch.crates-io]' >> bindings/Cargo.toml + ./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + cd bindings && cargo update -p swc_core -p swc_fast_ts_strip + - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh @@ -351,9 +358,17 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 18 cache: "yarn" + - name: Patch + shell: bash + run: | + echo '[patch.crates-io]' >> bindings/Cargo.toml + ./scripts/cargo/patch-section.sh + ./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + cd bindings && cargo update -p swc_core -p swc_fast_ts_strip + - name: Set platform name run: | export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())") @@ -404,6 +419,13 @@ jobs: - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Patch + shell: bash + run: | + echo '[patch.crates-io]' >> bindings/Cargo.toml + ./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + cd bindings && cargo update -p swc_core -p swc_fast_ts_strip + - name: Prepare run: | rustup target add wasm32-wasip1 diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index a1a853e01eb9..42bb18b8987b 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -121,6 +121,8 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "ast_node" version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fb5864e2f5bf9fd9797b94b2dfd1554d4c3092b535008b27d7e15c86675a2f" dependencies = [ "proc-macro2", "quote", @@ -210,6 +212,8 @@ dependencies = [ [[package]] name = "better_scoped_tls" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50fd297a11c709be8348aec039c8b91de16075d2b2bdaee1bd562c0875993664" dependencies = [ "scoped-tls", ] @@ -232,7 +236,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -309,6 +313,8 @@ dependencies = [ [[package]] name = "binding_macros" version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c23c0cf9351aa158baee33c9dea1870a0f21393375cf00b2a6170ad7f477aa1b" dependencies = [ "anyhow", "console_error_panic_hook", @@ -1509,6 +1515,8 @@ dependencies = [ [[package]] name = "from_variant" version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" dependencies = [ "proc-macro2", "swc_macros_common", @@ -1797,6 +1805,8 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71399f53a92ef72ee336a4b30201c6e944827e14e0af23204c291aad9c24cc85" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", @@ -3243,6 +3253,8 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "preset_env_base" version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06c1ead1873928228f01ffafe4800c3accb27d019c034626c54698408e36bfb" dependencies = [ "anyhow", "browserslist-rs", @@ -4398,6 +4410,8 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_enum" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" dependencies = [ "proc-macro2", "quote", @@ -4426,6 +4440,8 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swc" version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707e7a089761c5f4661765cc38b689d795d67bb0810782cdece3997cd03a6e94" dependencies = [ "anyhow", "base64", @@ -4480,6 +4496,8 @@ dependencies = [ [[package]] name = "swc_allocator" version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6b926f0d94bbb34031fe5449428cfa1268cdc0b31158d6ad9c97e0fc1e79dd" dependencies = [ "allocator-api2", "bumpalo", @@ -4492,6 +4510,8 @@ dependencies = [ [[package]] name = "swc_atoms" version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7077ba879f95406459bc0c81f3141c529b34580bc64d7ab7bd15e7118a0391" dependencies = [ "bytecheck 0.8.1", "hstr", @@ -4505,6 +4525,8 @@ dependencies = [ [[package]] name = "swc_bundler" version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66f1e45e5e60780d93df3a91942e95998745d330dff2550071fcc19e87cdc173" dependencies = [ "anyhow", "crc", @@ -4544,6 +4566,8 @@ dependencies = [ [[package]] name = "swc_cli_impl" version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662c31306f388f8662a0d524a4f6c2fb32946240f06f04e1f0b3af5b4cb021ce" dependencies = [ "anyhow", "clap", @@ -4566,6 +4590,8 @@ dependencies = [ [[package]] name = "swc_common" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209e700a12f0fccd72db3bac7a751e631ef777d543c9e86247e9366b11e30a27" dependencies = [ "anyhow", "ast_node", @@ -4596,6 +4622,8 @@ dependencies = [ [[package]] name = "swc_compiler_base" version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aef98ee955eac3339cb3a8152c64746196bd14919b41afdf2cc410c06e6cfee" dependencies = [ "anyhow", "base64", @@ -4622,6 +4650,8 @@ dependencies = [ [[package]] name = "swc_config" version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01bfcbbdea182bdda93713aeecd997749ae324686bf7944f54d128e56be4ea9" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -4639,6 +4669,8 @@ dependencies = [ [[package]] name = "swc_config_macro" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2ebd37ef52a8555c8c9be78b694d64adcb5e3bc16c928f030d82f1d65fac57" dependencies = [ "proc-macro2", "quote", @@ -4648,7 +4680,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.0.1" +version = "26.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e938c75f4bc1af7cbf1b48584198b3614b32d8a2f376ae9e501b9b6a8e9f969e" dependencies = [ "binding_macros", "swc", @@ -4675,6 +4709,8 @@ dependencies = [ [[package]] name = "swc_css_ast" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a434516e60c9ceebcd288c5b22f6d6d4051403e11691a97a2c6729b74d8a9aba" dependencies = [ "is-macro", "string_enum", @@ -4685,6 +4721,8 @@ dependencies = [ [[package]] name = "swc_css_codegen" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "838abcc39836584f28b413370575636286ea36cbaa00b748f787a3a68868e0c8" dependencies = [ "auto_impl", "bitflags 2.9.0", @@ -4700,6 +4738,8 @@ dependencies = [ [[package]] name = "swc_css_codegen_macros" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50abd25b3b79f18423cdf99b0d11dee24e64496be3b8abe18c10a2c40bd6c91f" dependencies = [ "proc-macro2", "quote", @@ -4710,6 +4750,8 @@ dependencies = [ [[package]] name = "swc_css_minifier" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f809a4dff6a164664ff1553ec7ef891a69241c26a9ec788f0e59053542c9fc" dependencies = [ "rustc-hash 2.1.1", "serde", @@ -4723,6 +4765,8 @@ dependencies = [ [[package]] name = "swc_css_parser" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c5f791bcaedb06018e1f6a5c6f8a45e03149be6cc72f291dae8782d90a3654" dependencies = [ "lexical", "serde", @@ -4734,6 +4778,8 @@ dependencies = [ [[package]] name = "swc_css_utils" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62b1d0dc15f9f09405f90f76cfb89900a5eaeb53486e91cdad1e8df25a1ee3d" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -4748,6 +4794,8 @@ dependencies = [ [[package]] name = "swc_css_visit" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf01ce7c4f3d05f82ee58692daaa0df8bee5c8115842df36780bc3ce74faa41" dependencies = [ "serde", "swc_atoms", @@ -4759,6 +4807,8 @@ dependencies = [ [[package]] name = "swc_ecma_ast" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2313360a518a37c4b9ee50030d189222927a3af902903cc70c50f6929e402dc" dependencies = [ "bitflags 2.9.0", "bytecheck 0.8.1", @@ -4780,7 +4830,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.0.0" +version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f929a62c96d50fc87fb54cf2135ecaec2d343d6df461f82462b8aed12da8cb" dependencies = [ "ascii", "compact_str", @@ -4789,6 +4841,7 @@ dependencies = [ "once_cell", "regex", "rustc-hash 2.1.1", + "ryu-js", "serde", "sourcemap 9.2.0", "swc_allocator", @@ -4802,6 +4855,8 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99e1931669a67c83e2c2b4375674f6901d1480994a76aa75b23f1389e6c5076" dependencies = [ "proc-macro2", "quote", @@ -4812,6 +4867,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "842e35f35bb7732f35b885c906e93183817d76e167234ab45948bf7cfc856804" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -4828,6 +4885,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5d027ec8260c28031723a13d30f12793f0f1cdb1f64133c4da32891e5058e8" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4839,6 +4898,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "073fd6f4f2fe6e5929056fab53d1ce188818b81b7008904bc7f932efa3348717" dependencies = [ "arrayvec", "indexmap 2.8.0", @@ -4864,6 +4925,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f53fcada063eba1c278e829a8b9ec024408c5bad526171b0cb96c77bf9c533b" dependencies = [ "swc_atoms", "swc_common", @@ -4879,6 +4942,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d9a8e0589b8933b4e2de95a787b33e6ef91371c5a85f9d73c5870ac546fc6b7" dependencies = [ "serde", "swc_atoms", @@ -4895,6 +4960,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb69df2828e6d00ca815d66fd1e609e64683abf705dcc46b195fbc7353cabe89" dependencies = [ "serde", "swc_atoms", @@ -4912,6 +4979,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a71abfad6a3a6093098f46e68e026d132ca15906fed912b0912f561a1cbd67f5" dependencies = [ "swc_atoms", "swc_common", @@ -4926,6 +4995,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b226871c16b8f4e3914c1dff2e8c93626fbc6a6bfeb3fb598f941d04890e20" dependencies = [ "serde", "swc_atoms", @@ -4942,6 +5013,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f79df9e55b7c3fd29e4116fc6ef1e0155c86fe64fa6a91d357469501d574ef2" dependencies = [ "swc_atoms", "swc_common", @@ -4956,6 +5029,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7749e111ac8251708d6067dc20d0a9399dd7d8e3cd75a18d309830575064d1" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -4974,6 +5049,8 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecfb2f4d16cd2459bdae7a12a0c3258bb53d63d97c0bbff50dade9c3f324c634" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4987,6 +5064,8 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db3a2e81be5e12bf58f53a9217791e695bb79e43e6e9e0b63be602c048f0451" dependencies = [ "phf", "swc_atoms", @@ -4999,6 +5078,8 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602a6a5190cbb4adc134bdf9a525b845912a86039130c2b476ff20123b1aacd5" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5022,6 +5103,8 @@ dependencies = [ [[package]] name = "swc_ecma_lints" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf720184ed1f84a61a34df1c9d73be0931a8184a7ed6af67ad8f5f1bbec3881" dependencies = [ "auto_impl", "dashmap 5.5.3", @@ -5041,6 +5124,8 @@ dependencies = [ [[package]] name = "swc_ecma_loader" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c6a8a5ca19c9b24daf598debb4f2fa57bf21a3bd76046d9791b7f2a0b0c93" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5060,7 +5145,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.0" +version = "20.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879d5f44a9d7480710dadbcd33e8b8d436132f92d668999061d52b5f211a6d3b" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5097,6 +5184,8 @@ dependencies = [ [[package]] name = "swc_ecma_parser" version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebfd62dc0ffe6b80bedcd049f1c949133de6d524d12d2edbb0b6fb64896cefb" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5121,6 +5210,8 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f94ea6dfa4daf55a08e210cbc213b5758b6bc92a929a3af75f478c8b0253cf" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5143,7 +5234,9 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.0" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e537bf1ae5e982275ab538f4171d292032a354b30be5115c82e91745c7fe355" dependencies = [ "swc_atoms", "swc_common", @@ -5154,6 +5247,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f91c0e075315f1e745f65888e135ff05e3d16b6c6393c70dc9fb2c944b40fe" dependencies = [ "par-core", "swc_atoms", @@ -5172,7 +5267,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.0.1" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb01eeec1de9e2cfd089e3afcf3db60df10c812f97a42d953d094eba32e9d26f" dependencies = [ "better_scoped_tls", "bitflags 2.9.0", @@ -5196,6 +5293,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c30a47eb83be77705a16103918db015a409a45e158a490697d8419a6f92151a" dependencies = [ "swc_atoms", "swc_common", @@ -5208,6 +5307,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab71af00c78903335fc2ac0ad4308e6729b6be60e47393a36357fb20ffbb612" dependencies = [ "arrayvec", "indexmap 2.8.0", @@ -5244,6 +5345,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6845dfb88569f3e8cd05901505916a8ebe98be3922f94769ca49f84e8ccec8f7" dependencies = [ "proc-macro2", "quote", @@ -5254,6 +5357,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc169d2f3e52ab9619aff70b97b6f9db7b96feec8112454df3dd7d134f34078a" dependencies = [ "Inflector", "anyhow", @@ -5280,6 +5385,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e184bf675c5c9111e1b155e49fc267bc2971b732ac22d80887cc46973a782b7" dependencies = [ "dashmap 5.5.3", "indexmap 2.8.0", @@ -5303,6 +5410,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21a20e2231143fe4aacecf2f1957c80bca8096ebe52f27e6e5624a49a2a385d" dependencies = [ "either", "rustc-hash 2.1.1", @@ -5321,6 +5430,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f141582d19aa9679ecfc811bc72cb8ef24290bc1e53ba208445ff5d5745f2b" dependencies = [ "base64", "dashmap 5.5.3", @@ -5346,6 +5457,8 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5af18b9b3f38cf775b9dcf46f0fdbde542d6559e5759799263ef0f76563fcd9b" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5363,6 +5476,8 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b1f2dccff9c6cde3f72a86babcc34b1213e0cef8c6e2f1a1da75eca7f5bbe73" dependencies = [ "bitflags 2.9.0", "indexmap 2.8.0", @@ -5378,7 +5493,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.0" +version = "15.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199e2f048c1998d550ebe5296e0876a3e5b2f963d75a925c2208466071edb9d8" dependencies = [ "indexmap 2.8.0", "num_cpus", @@ -5399,6 +5516,8 @@ dependencies = [ [[package]] name = "swc_ecma_visit" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8227d1d2d76a9ccfd190ec06bb4a4720bf3edb9f954c69816b2bca5f5aa43887" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -5412,6 +5531,8 @@ dependencies = [ [[package]] name = "swc_eq_ignore_macros" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" dependencies = [ "proc-macro2", "quote", @@ -5421,6 +5542,8 @@ dependencies = [ [[package]] name = "swc_error_reporters" version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572075b92eef780f9a13b99abcb4fbf8e6272abeed27b361632b5e3a2e8de70d" dependencies = [ "anyhow", "miette", @@ -5435,6 +5558,8 @@ dependencies = [ [[package]] name = "swc_fast_ts_strip" version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f7061f0bfa9f1a60c3bbc2c72af7441f0dde77925284822e2a71e6dc2746a5" dependencies = [ "anyhow", "serde", @@ -5452,6 +5577,8 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852cac708da0cd6705f4b840b2da08061d061efced10c55f41a93ae7711736a1" dependencies = [ "auto_impl", "petgraph 0.7.1", @@ -5463,6 +5590,8 @@ dependencies = [ [[package]] name = "swc_html" version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7246397da37cfe250a88e6dc03bca27bac52388c1943844a3fbfcb7deba506ce" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -5473,6 +5602,8 @@ dependencies = [ [[package]] name = "swc_html_ast" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf011d422c327fe895a11748459c6b7f87a1fe2be3b8ddf88ff1b8a387bcfa0" dependencies = [ "is-macro", "serde", @@ -5484,6 +5615,8 @@ dependencies = [ [[package]] name = "swc_html_codegen" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebb539cb7801958fa9830e191ea287c44763fb28f2ffd1c03f680682dbfca005" dependencies = [ "auto_impl", "bitflags 2.9.0", @@ -5498,6 +5631,8 @@ dependencies = [ [[package]] name = "swc_html_codegen_macros" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faba8a7b6944ce27a17de34a6578e6900bb13db4247c2a004e6ed22658e9cad5" dependencies = [ "proc-macro2", "quote", @@ -5508,6 +5643,8 @@ dependencies = [ [[package]] name = "swc_html_minifier" version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c09e7b1f35254c3d9fb0dc4ff10a8e5078f8d49c52be41724f144fb5a2189e1c" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5536,6 +5673,8 @@ dependencies = [ [[package]] name = "swc_html_parser" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d61db194416b3bb8c3b6d83594a7879744c3c0e39cfea4857a9828ad928733a" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -5547,6 +5686,8 @@ dependencies = [ [[package]] name = "swc_html_utils" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e20f7a34bd591c5ccd3dadc03fd604de4d553375c54b5bd1908561e6d7306f" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5559,6 +5700,8 @@ dependencies = [ [[package]] name = "swc_html_visit" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69629a92e1f71bf078506e1cc2298678d69bdc6e89e582fbaf8139d7be65310" dependencies = [ "serde", "swc_atoms", @@ -5570,6 +5713,8 @@ dependencies = [ [[package]] name = "swc_macros_common" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" dependencies = [ "proc-macro2", "quote", @@ -5579,6 +5724,8 @@ dependencies = [ [[package]] name = "swc_malloc" version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d516f998f5ca21eda82a81723095fa7f2056b48a18b08040ca1d0b177db8e40c" dependencies = [ "mimalloc", "tikv-jemallocator", @@ -5587,6 +5734,8 @@ dependencies = [ [[package]] name = "swc_node_bundler" version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed98d6e103babf8ace118c0dcac6b9526ccfe2c1fb3f54c7f4ea554f9b0fe53f" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5615,6 +5764,8 @@ dependencies = [ [[package]] name = "swc_node_comments" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75011be56778fa9d67fce20853b9a00f46484bfaef230e8098c08ad9caf8dc7" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", @@ -5625,6 +5776,8 @@ dependencies = [ [[package]] name = "swc_nodejs_common" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb8398dd81e4dc5ea31d9f932cbdcebef0c16fb85c289b7c4aa976f68a43d87e" dependencies = [ "anyhow", "napi", @@ -5637,6 +5790,8 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab1281343dca1fe02aa027e2dfdf77067e62506e77b651e3e9c1a4e3fa8bccf6" dependencies = [ "better_scoped_tls", "bytecheck 0.8.1", @@ -5652,6 +5807,8 @@ dependencies = [ [[package]] name = "swc_plugin_runner" version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4802311e7168c171b047c28335603e8969e62ba4d75c0c607b53e77fbcb1a9aa" dependencies = [ "anyhow", "enumset", @@ -5678,6 +5835,8 @@ dependencies = [ [[package]] name = "swc_timer" version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4db06b46cc832f7cf83c2ce21905fc465d01443a2bdccf63644383e1f5847532" dependencies = [ "tracing", ] @@ -5685,6 +5844,8 @@ dependencies = [ [[package]] name = "swc_trace_macro" version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559185db338f1bcb50297aafd4f79c0956c84dc71a66da4cffb57acf9d93fd88" dependencies = [ "proc-macro2", "quote", @@ -5694,6 +5855,8 @@ dependencies = [ [[package]] name = "swc_transform_common" version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be97f7341c59045d8ecbd5579acad8063e545d10304db086846b9dcf985c56e" dependencies = [ "better_scoped_tls", "once_cell", @@ -5705,7 +5868,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.1" +version = "14.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cd2a925ff8cf74f64a2efe3aaf9b63bfc5458b62620878a9444b2b18cf5fc4" dependencies = [ "bitflags 2.9.0", "petgraph 0.7.1", @@ -5721,6 +5886,8 @@ dependencies = [ [[package]] name = "swc_visit" version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9138b6a36bbe76dd6753c4c0794f7e26480ea757bee499738bedbbb3ae3ec5f3" dependencies = [ "either", "new_debug_unreachable", diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 271499ce6b27..d1d31f5383d0 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -36,24 +36,24 @@ resolver = "2" serde-wasm-bindgen = "0.6.5" serde_json = "1.0.120" sourcemap = "8.0.1" - swc_atoms = { path = "../crates/swc_atoms" } - swc_cli_impl = { path = "../crates/swc_cli_impl" } - swc_common = { path = "../crates/swc_common" } - swc_compiler_base = { path = "../crates/swc_compiler_base" } - swc_config = { path = "../crates/swc_config" } - swc_core = { path = "../crates/swc_core" } - swc_css_ast = { path = "../crates/swc_css_ast" } - swc_css_codegen = { path = "../crates/swc_css_codegen" } - swc_css_minifier = { path = "../crates/swc_css_minifier" } - swc_css_parser = { path = "../crates/swc_css_parser" } - swc_ecma_react_compiler = { path = "../crates/swc_ecma_react_compiler" } - swc_error_reporters = { path = "../crates/swc_error_reporters" } - swc_fast_ts_strip = { path = "../crates/swc_fast_ts_strip" } - swc_html = { path = "../crates/swc_html" } - swc_html_ast = { path = "../crates/swc_html_ast" } - swc_html_minifier = { path = "../crates/swc_html_minifier" } - swc_malloc = { path = "../crates/swc_malloc" } - swc_nodejs_common = { path = "../crates/swc_nodejs_common" } + swc_atoms = "5.0.0" + swc_cli_impl = "26.0.0" + swc_common = "11.0.0" + swc_compiler_base = "22.0.0" + swc_config = "3.0.0" + swc_core = "26.1.1" + swc_css_ast = "11.0.0" + swc_css_codegen = "11.0.0" + swc_css_minifier = "11.0.0" + swc_css_parser = "11.0.0" + swc_ecma_react_compiler = "4.0.1" + swc_error_reporters = "13.0.0" + swc_fast_ts_strip = "19.0.0" + swc_html = "20.0.0" + swc_html_ast = "11.0.0" + swc_html_minifier = "20.0.0" + swc_malloc = "1.2.3" + swc_nodejs_common = "1.0.0" tracing = "0.1.40" tracing-chrome = "0.7.2" tracing-futures = "0.2.5" @@ -148,10 +148,3 @@ strip = "symbols" [profile.dev.package."*"] debug-assertions = false - -[patch.crates-io] -# Remove this once https://github.com/wasmerio/wasmer/pull/5564 is merged and released -wasmer = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" } -wasmer-cache = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" } -wasmer-compiler-cranelift = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" } -wasmer-wasix = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" } \ No newline at end of file From 505bf542cd197afb2a5a5f7cd89ed97ac681a923 Mon Sep 17 00:00:00 2001 From: bohan Date: Sat, 24 May 2025 01:12:35 +0800 Subject: [PATCH 012/209] perf(es/minifier): Merge `PropertyCollector` into usage analyzer (#10514) --- .changeset/angry-lions-sniff.md | 7 + crates/swc_ecma_minifier/src/compress/mod.rs | 4 +- crates/swc_ecma_minifier/src/lib.rs | 2 +- .../src/pass/mangle_props.rs | 159 ++++-------------- crates/swc_ecma_minifier/src/program_data.rs | 54 +++++- .../src/analyzer/mod.rs | 53 +++++- .../src/analyzer/storage.rs | 10 ++ crates/swc_ecma_usage_analyzer/src/util.rs | 39 ++++- 8 files changed, 187 insertions(+), 141 deletions(-) create mode 100644 .changeset/angry-lions-sniff.md diff --git a/.changeset/angry-lions-sniff.md b/.changeset/angry-lions-sniff.md new file mode 100644 index 000000000000..1a03df1ccac4 --- /dev/null +++ b/.changeset/angry-lions-sniff.md @@ -0,0 +1,7 @@ +--- +swc_ecma_minifier: patch +swc_ecma_usage_analyzer: patch +swc_core: minor +--- + +perf(ecma/minifier): dont clone option diff --git a/crates/swc_ecma_minifier/src/compress/mod.rs b/crates/swc_ecma_minifier/src/compress/mod.rs index e3e45aac7350..d40b772475a0 100644 --- a/crates/swc_ecma_minifier/src/compress/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/mod.rs @@ -80,7 +80,7 @@ impl Compressor<'_> { ); if self.options.hoist_vars || self.options.hoist_fns { - let data = analyze(&*n, Some(self.marks)); + let data = analyze(&*n, Some(self.marks), false); let mut v = decl_hoister( DeclHoisterConfig { @@ -173,7 +173,7 @@ impl Compressor<'_> { { let _timer = timer!("apply full optimizer"); - let mut data = analyze(&*n, Some(self.marks)); + let mut data = analyze(&*n, Some(self.marks), false); // TODO: reset_opt_flags // diff --git a/crates/swc_ecma_minifier/src/lib.rs b/crates/swc_ecma_minifier/src/lib.rs index bc145b970263..73b818f723db 100644 --- a/crates/swc_ecma_minifier/src/lib.rs +++ b/crates/swc_ecma_minifier/src/lib.rs @@ -248,7 +248,7 @@ pub fn optimize( ); if let Some(property_mangle_options) = &mangle.props { - mangle_properties(&mut n, property_mangle_options.clone(), chars); + mangle_properties(&mut n, property_mangle_options, chars); } } diff --git a/crates/swc_ecma_minifier/src/pass/mangle_props.rs b/crates/swc_ecma_minifier/src/pass/mangle_props.rs index 109f9154f64d..32f9b02dbfb0 100644 --- a/crates/swc_ecma_minifier/src/pass/mangle_props.rs +++ b/crates/swc_ecma_minifier/src/pass/mangle_props.rs @@ -3,17 +3,11 @@ use std::collections::HashSet; use once_cell::sync::Lazy; use rustc_hash::{FxHashMap, FxHashSet}; use swc_atoms::Atom; -use swc_ecma_ast::{ - CallExpr, Callee, Expr, IdentName, KeyValueProp, Lit, MemberExpr, MemberProp, Program, Prop, - PropName, Str, SuperProp, SuperPropExpr, -}; +use swc_ecma_ast::*; +use swc_ecma_usage_analyzer::util::get_mut_object_define_property_name_arg; use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; -use crate::{ - option::ManglePropertiesOptions, - program_data::{analyze, ProgramData, VarUsageInfoFlags}, - util::base54::Base54Chars, -}; +use crate::{option::ManglePropertiesOptions, program_data::analyze, util::base54::Base54Chars}; pub static JS_ENVIRONMENT_PROPS: Lazy> = Lazy::new(|| { let domprops: Vec = serde_json::from_str(include_str!("../lists/domprops.json")) @@ -31,9 +25,9 @@ pub static JS_ENVIRONMENT_PROPS: Lazy> = Lazy::new(|| { word_set }); -struct ManglePropertiesState { +struct ManglePropertiesState<'a> { chars: Base54Chars, - options: ManglePropertiesOptions, + options: &'a ManglePropertiesOptions, names_to_mangle: FxHashSet, unmangleable: FxHashSet, @@ -45,14 +39,22 @@ struct ManglePropertiesState { n: usize, } -impl ManglePropertiesState { - fn add(&mut self, name: &Atom) { - if self.can_mangle(name) { - self.names_to_mangle.insert(name.clone()); - } - - if !self.should_mangle(name) { - self.unmangleable.insert(name.clone()); +impl<'a> ManglePropertiesState<'a> { + fn add(&mut self, name: Atom) { + let can_mangle = self.can_mangle(&name); + let should_mangle = self.should_mangle(&name); + match (can_mangle, !should_mangle) { + (true, true) => { + self.names_to_mangle.insert(name.clone()); + self.unmangleable.insert(name); + } + (false, true) => { + self.unmangleable.insert(name); + } + (true, false) => { + self.names_to_mangle.insert(name); + } + _ => {} } } @@ -98,7 +100,7 @@ impl ManglePropertiesState { pub(crate) fn mangle_properties( m: &mut Program, - options: ManglePropertiesOptions, + options: &ManglePropertiesOptions, chars: Base54Chars, ) { let mut state = ManglePropertiesState { @@ -110,119 +112,20 @@ pub(crate) fn mangle_properties( n: 0, }; - let data = analyze(&*m, None); - m.visit_mut_with(&mut PropertyCollector { - state: &mut state, - data, - }); - - m.visit_mut_with(&mut Mangler { state: &mut state }); -} - -// Step 1 -- collect candidates to mangle -pub struct PropertyCollector<'a> { - data: ProgramData, - state: &'a mut ManglePropertiesState, -} - -impl VisitMut for PropertyCollector<'_> { - fn visit_mut_call_expr(&mut self, call: &mut CallExpr) { - call.visit_mut_children_with(self); - - if let Some(prop_name) = get_object_define_property_name_arg(call) { - self.state.add(&prop_name.value); - } - } - - fn visit_mut_member_expr(&mut self, member_expr: &mut MemberExpr) { - member_expr.visit_mut_children_with(self); - - let is_root_declared = is_root_of_member_expr_declared(member_expr, &self.data); + let mut data = analyze(&*m, None, true); - if is_root_declared { - if let MemberProp::Ident(ident) = &mut member_expr.prop { - self.state.add(&ident.sym); - } - } - } - - fn visit_mut_prop(&mut self, prop: &mut Prop) { - prop.visit_mut_children_with(self); - - if let Prop::Shorthand(ident) = prop { - self.state.add(&ident.sym); - } + for prop in std::mem::take(data.property_atoms.as_mut().unwrap()) { + state.add(prop); } - fn visit_mut_prop_name(&mut self, name: &mut PropName) { - name.visit_mut_children_with(self); - - match name { - PropName::Ident(ident) => { - self.state.add(&ident.sym); - } - PropName::Str(s) => { - self.state.add(&s.value); - } - _ => {} - }; - } -} - -fn is_root_of_member_expr_declared(member_expr: &MemberExpr, data: &ProgramData) -> bool { - match &*member_expr.obj { - Expr::Member(member_expr) => is_root_of_member_expr_declared(member_expr, data), - Expr::Ident(expr) => data - .vars - .get(&expr.to_id()) - .map(|var| var.flags.contains(VarUsageInfoFlags::DECLARED)) - .unwrap_or(false), - - _ => false, - } -} - -fn is_object_property_call(call: &CallExpr) -> bool { - // Find Object.defineProperty - if let Callee::Expr(callee) = &call.callee { - match &**callee { - Expr::Member(MemberExpr { - obj, - prop: MemberProp::Ident(IdentName { sym, .. }), - .. - }) if *sym == *"defineProperty" => { - if obj.is_ident_ref_to("Object") { - return true; - } - } - - _ => {} - } - }; - - false -} - -fn get_object_define_property_name_arg(call: &mut CallExpr) -> Option<&mut Str> { - if is_object_property_call(call) { - let second_arg: &mut Expr = call.args.get_mut(1).map(|arg| &mut arg.expr)?; - - if let Expr::Lit(Lit::Str(s)) = second_arg { - Some(s) - } else { - None - } - } else { - None - } + m.visit_mut_with(&mut Mangler { state: &mut state }); } -// Step 2 -- mangle those properties -struct Mangler<'a> { - state: &'a mut ManglePropertiesState, +struct Mangler<'a, 'b> { + state: &'a mut ManglePropertiesState<'b>, } -impl Mangler<'_> { +impl Mangler<'_, '_> { fn mangle_ident(&mut self, ident: &mut IdentName) { if let Some(mangled) = self.state.gen_name(&ident.sym) { ident.sym = mangled; @@ -237,13 +140,13 @@ impl Mangler<'_> { } } -impl VisitMut for Mangler<'_> { +impl VisitMut for Mangler<'_, '_> { noop_visit_mut_type!(); fn visit_mut_call_expr(&mut self, call: &mut CallExpr) { call.visit_mut_children_with(self); - if let Some(prop_name_str) = get_object_define_property_name_arg(call) { + if let Some(prop_name_str) = get_mut_object_define_property_name_arg(call) { self.mangle_str(prop_name_str); } } diff --git a/crates/swc_ecma_minifier/src/program_data.rs b/crates/swc_ecma_minifier/src/program_data.rs index ae96e7b77201..2e335fe21d12 100644 --- a/crates/swc_ecma_minifier/src/program_data.rs +++ b/crates/swc_ecma_minifier/src/program_data.rs @@ -8,7 +8,7 @@ use swc_ecma_ast::*; use swc_ecma_usage_analyzer::{ alias::{Access, AccessKind}, analyzer::{ - analyze_with_storage, + analyze_with_custom_storage, storage::{ScopeDataLike, Storage, VarDataLike}, Ctx, ScopeKind, UsageAnalyzer, }, @@ -18,11 +18,19 @@ use swc_ecma_usage_analyzer::{ use swc_ecma_utils::{Merge, Type, Value}; use swc_ecma_visit::VisitWith; -pub(crate) fn analyze(n: &N, marks: Option) -> ProgramData +pub(crate) fn analyze(n: &N, marks: Option, collect_property_atoms: bool) -> ProgramData where N: VisitWith>, { - analyze_with_storage::(n, marks) + let data = if collect_property_atoms { + ProgramData { + property_atoms: Some(Vec::with_capacity(128)), + ..Default::default() + } + } else { + ProgramData::default() + }; + analyze_with_custom_storage(data, n, marks) } /// Analyzed info of a whole program we are working on. @@ -35,6 +43,8 @@ pub(crate) struct ProgramData { pub(crate) scopes: FxHashMap, initialized_vars: IndexSet, + + pub(crate) property_atoms: Option>, } bitflags::bitflags! { @@ -170,6 +180,22 @@ impl Storage for ProgramData { type ScopeData = ScopeData; type VarData = VarUsageInfo; + fn new(collect_prop_atom: bool) -> Self { + if collect_prop_atom { + ProgramData { + property_atoms: Some(Vec::with_capacity(128)), + ..Default::default() + } + } else { + ProgramData::default() + } + } + + #[inline(always)] + fn need_collect_prop_atom(&self) -> bool { + self.property_atoms.is_some() + } + fn scope(&mut self, ctxt: swc_common::SyntaxContext) -> &mut Self::ScopeData { self.scopes.entry(ctxt).or_default() } @@ -197,7 +223,7 @@ impl Storage for ProgramData { for (id, mut var_info) in child.vars { // trace!("merge({:?},{}{:?})", kind, id.0, id.1); let inited = self.initialized_vars.contains(&id); - match self.vars.entry(id.clone()) { + match self.vars.entry(id) { Entry::Occupied(mut e) => { if var_info.flags.contains(VarUsageInfoFlags::INLINE_PREVENTED) { e.get_mut() @@ -320,12 +346,16 @@ impl Storage for ProgramData { } } } + + if let Some(property_atoms) = self.property_atoms.as_mut() { + property_atoms.extend(child.property_atoms.unwrap()); + } } fn report_usage(&mut self, ctx: Ctx, i: Id) { let inited = self.initialized_vars.contains(&i); - let e = self.vars.entry(i.clone()).or_insert_with(|| { + let e = self.vars.entry(i).or_insert_with(|| { let mut default = VarUsageInfo::default(); default.flags.insert(VarUsageInfoFlags::USED_ABOVE_DECL); Box::new(default) @@ -508,6 +538,16 @@ impl Storage for ProgramData { other.property_mutation_count += 1; } } + + fn add_property_atom(&mut self, atom: Atom) { + if let Some(atoms) = self.property_atoms.as_mut() { + atoms.push(atom); + } + } + + fn get_var_data(&self, id: Id) -> Option<&Self::VarData> { + self.vars.get(&id).map(|v| v.as_ref()) + } } impl ScopeDataLike for ScopeData { @@ -603,6 +643,10 @@ impl VarDataLike for VarUsageInfo { fn mark_used_recursively(&mut self) { self.flags.insert(VarUsageInfoFlags::USED_RECURSIVELY); } + + fn is_declared(&self) -> bool { + self.flags.contains(VarUsageInfoFlags::DECLARED) + } } impl ProgramData { diff --git a/crates/swc_ecma_usage_analyzer/src/analyzer/mod.rs b/crates/swc_ecma_usage_analyzer/src/analyzer/mod.rs index 563ebb3b63ae..ef3db01f52c2 100644 --- a/crates/swc_ecma_usage_analyzer/src/analyzer/mod.rs +++ b/crates/swc_ecma_usage_analyzer/src/analyzer/mod.rs @@ -13,7 +13,7 @@ use self::storage::*; use crate::{ alias::{collect_infects_from, AliasConfig}, marks::Marks, - util::can_end_conditionally, + util::{can_end_conditionally, get_object_define_property_name_arg}, }; mod ctx; @@ -24,6 +24,14 @@ pub mod storage; /// /// If `marks` is [None], markers are ignored. pub fn analyze_with_storage(n: &N, marks: Option) -> S +where + S: Storage, + N: VisitWith>, +{ + analyze_with_custom_storage(Default::default(), n, marks) +} + +pub fn analyze_with_custom_storage(data: S, n: &N, marks: Option) -> S where S: Storage, N: VisitWith>, @@ -31,7 +39,7 @@ where let _timer = timer!("analyze"); let mut v = UsageAnalyzer { - data: Default::default(), + data, marks, scope: Default::default(), ctx: Default::default(), @@ -88,7 +96,7 @@ where F: FnOnce(&mut UsageAnalyzer) -> Ret, { let mut child = UsageAnalyzer { - data: Default::default(), + data: S::new(S::need_collect_prop_atom(&self.data)), marks: self.marks, ctx: self.ctx.with(BitContext::IsTopLevel, false), expr_ctx: self.expr_ctx, @@ -397,6 +405,10 @@ where tracing::instrument(level = "debug", skip_all) )] fn visit_call_expr(&mut self, n: &CallExpr) { + if let Some(prop_name) = get_object_define_property_name_arg(n) { + self.data.add_property_atom(prop_name.value.clone()); + } + let inline_prevented = self.ctx.bit_ctx.contains(BitContext::InlinePrevented) || self .marks @@ -1017,7 +1029,25 @@ where if let MemberProp::Ident(prop) = &e.prop { v.add_accessed_property(prop.sym.clone()); } - }) + }); + + fn is_root_of_member_expr_declared(member_expr: &MemberExpr, data: &impl Storage) -> bool { + match &*member_expr.obj { + Expr::Member(member_expr) => is_root_of_member_expr_declared(member_expr, data), + Expr::Ident(ident) => data + .get_var_data(ident.to_id()) + .map(|var| var.is_declared()) + .unwrap_or(false), + + _ => false, + } + } + + if is_root_of_member_expr_declared(e, &self.data) { + if let MemberProp::Ident(ident) = &e.prop { + self.data.add_property_atom(ident.sym.clone()); + } + } } #[cfg_attr( @@ -1147,9 +1177,24 @@ where if let Prop::Shorthand(i) = n { self.report_usage(i); + self.data.add_property_atom(i.sym.clone()); } } + fn visit_prop_name(&mut self, node: &PropName) { + node.visit_children_with(self); + + match node { + PropName::Ident(ident) => { + self.data.add_property_atom(ident.sym.clone()); + } + PropName::Str(s) => { + self.data.add_property_atom(s.value.clone()); + } + _ => {} + }; + } + fn visit_script(&mut self, n: &Script) { let ctx = self.ctx.with(BitContext::IsTopLevel, true); n.visit_children_with(&mut *self.with_ctx(ctx)) diff --git a/crates/swc_ecma_usage_analyzer/src/analyzer/storage.rs b/crates/swc_ecma_usage_analyzer/src/analyzer/storage.rs index bb51032918af..53955a217e25 100644 --- a/crates/swc_ecma_usage_analyzer/src/analyzer/storage.rs +++ b/crates/swc_ecma_usage_analyzer/src/analyzer/storage.rs @@ -10,6 +10,12 @@ pub trait Storage: Sized + Default { type ScopeData: ScopeDataLike; type VarData: VarDataLike; + fn new(collect_prop_atom: bool) -> Self; + + fn need_collect_prop_atom(&self) -> bool; + + fn add_property_atom(&mut self, atom: Atom); + fn scope(&mut self, ctxt: SyntaxContext) -> &mut Self::ScopeData; fn top_scope(&mut self) -> &mut Self::ScopeData; @@ -34,6 +40,8 @@ pub trait Storage: Sized + Default { fn truncate_initialized_cnt(&mut self, len: usize); fn mark_property_mutation(&mut self, id: Id); + + fn get_var_data(&self, id: Id) -> Option<&Self::VarData>; } pub trait ScopeDataLike: Sized + Default + Clone { @@ -83,4 +91,6 @@ pub trait VarDataLike: Sized { fn mark_used_above_decl(&mut self); fn mark_used_recursively(&mut self); + + fn is_declared(&self) -> bool; } diff --git a/crates/swc_ecma_usage_analyzer/src/util.rs b/crates/swc_ecma_usage_analyzer/src/util.rs index 03d98609ffb0..ae4b205e1283 100644 --- a/crates/swc_ecma_usage_analyzer/src/util.rs +++ b/crates/swc_ecma_usage_analyzer/src/util.rs @@ -1,4 +1,4 @@ -use swc_ecma_ast::Stmt; +use swc_ecma_ast::*; pub fn is_global_var_with_pure_property_access(s: &str) -> bool { match s { @@ -95,3 +95,40 @@ pub fn can_end_conditionally(s: &Stmt) -> bool { can_end(s, true) } + +/// Find `Object.defineProperty()` +fn is_object_property_call(call: &CallExpr) -> bool { + if let Callee::Expr(callee) = &call.callee { + match &**callee { + Expr::Member(MemberExpr { + obj, + prop: MemberProp::Ident(IdentName { sym, .. }), + .. + }) if *sym == *"defineProperty" && obj.is_ident_ref_to("Object") => { + return true; + } + + _ => {} + } + }; + + false +} + +pub fn get_mut_object_define_property_name_arg(call: &mut CallExpr) -> Option<&mut Str> { + if is_object_property_call(call) { + let second_arg: &mut Expr = call.args.get_mut(1).map(|arg| &mut arg.expr)?; + second_arg.as_mut_lit().and_then(|lit| lit.as_mut_str()) + } else { + None + } +} + +pub fn get_object_define_property_name_arg(call: &CallExpr) -> Option<&Str> { + if is_object_property_call(call) { + let second_arg: &Expr = call.args.get(1).map(|arg| &arg.expr)?; + second_arg.as_lit().and_then(|lit| lit.as_str()) + } else { + None + } +} From 56be73d9959590a340a6a5d80cd2ac056bcbdd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 23 May 2025 14:39:21 -0700 Subject: [PATCH 013/209] chore: Publish crates with `swc_core` `v26.2.0` --- .changeset/angry-lions-sniff.md | 7 ------- CHANGELOG-CORE.md | 14 ++++++++++++++ CHANGELOG.md | 9 +++++++++ Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- 14 files changed, 39 insertions(+), 23 deletions(-) delete mode 100644 .changeset/angry-lions-sniff.md diff --git a/.changeset/angry-lions-sniff.md b/.changeset/angry-lions-sniff.md deleted file mode 100644 index 1a03df1ccac4..000000000000 --- a/.changeset/angry-lions-sniff.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -swc_ecma_minifier: patch -swc_ecma_usage_analyzer: patch -swc_core: minor ---- - -perf(ecma/minifier): dont clone option diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index db9ed1565f7c..f3599cd362e5 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,6 +1,20 @@ # Changelog ## [unreleased] +### Miscellaneous Tasks + + + +- **(bindings)** Use published versions of crates ([#10513](https://github.com/swc-project/swc/issues/10513)) ([f65f028](https://github.com/swc-project/swc/commit/f65f02831cb68245d5790a6c867ac3e997eedbfd)) + +### Performance + + + +- **(es/minifier)** Merge `PropertyCollector` into usage analyzer ([#10514](https://github.com/swc-project/swc/issues/10514)) ([505bf54](https://github.com/swc-project/swc/commit/505bf542cd197afb2a5a5f7cd89ed97ac681a923)) + +## [swc_core@v26.1.1] - 2025-05-22 + ### Bug Fixes diff --git a/CHANGELOG.md b/CHANGELOG.md index 2571f85946fc..f9d07c925db2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,19 @@ - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) +### Miscellaneous Tasks + + + +- **(bindings)** Use published versions of crates ([#10513](https://github.com/swc-project/swc/issues/10513)) ([f65f028](https://github.com/swc-project/swc/commit/f65f02831cb68245d5790a6c867ac3e997eedbfd)) + ### Performance +- **(es/minifier)** Merge `PropertyCollector` into usage analyzer ([#10514](https://github.com/swc-project/swc/issues/10514)) ([505bf54](https://github.com/swc-project/swc/commit/505bf542cd197afb2a5a5f7cd89ed97ac681a923)) + + - **(es/renamer)** Merge analyze/collect ([#10509](https://github.com/swc-project/swc/issues/10509)) ([7b47f66](https://github.com/swc-project/swc/commit/7b47f661dd6794f658023b649ebcdc153fe6e27c)) ### Refactor diff --git a/Cargo.lock b/Cargo.lock index fa6091bf408b..b4d9ccba9fac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.1.1" +version = "26.2.0" dependencies = [ "anyhow", "binding_macros", @@ -5581,7 +5581,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.1" +version = "20.0.2" dependencies = [ "ansi_term", "anyhow", @@ -6020,7 +6020,7 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "16.0.0" +version = "16.0.1" dependencies = [ "bitflags 2.6.0", "indexmap 2.7.1", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 5fb3ea6eea5d..2a373c18dd74 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -33,7 +33,7 @@ swc_common = { version = "11.0.0", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 7232fd768432..4db7fd98bdfc 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -88,7 +88,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 9dbf3f7f74eb..6ca09295c5b3 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 937dfff8ae5c..2843fe966944 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.1.1", features = [ +swc_core = { version = "26.2.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index bc317f66560c..258194964824 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -30,7 +30,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 4514705c79d3..6a505e91033c 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.1.1" +version = "26.2.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -368,7 +368,7 @@ swc_ecma_ast = { optional = true, version = "11.0.0", path = swc_ecma_codegen = { optional = true, version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.1", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "20.0.2", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } @@ -381,7 +381,7 @@ swc_ecma_transforms_proposal = { optional = true, version = "15.0.0", path = swc_ecma_transforms_react = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_react" } swc_ecma_transforms_testing = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_testing" } swc_ecma_transforms_typescript = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_typescript" } -swc_ecma_usage_analyzer = { optional = true, version = "16.0.0", path = "../swc_ecma_usage_analyzer" } +swc_ecma_usage_analyzer = { optional = true, version = "16.0.1", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { optional = true, version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "1.2.3", path = "../swc_malloc" } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 39dff84f0da0..58ba3f535c05 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.1" +version = "20.0.2" [package.metadata.docs.rs] all-features = true @@ -66,7 +66,7 @@ swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_usage_analyzer = { version = "16.0.0", path = "../swc_ecma_usage_analyzer" } +swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index a067c62626c5..af8a230a01a8 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_usage_analyzer" repository = { workspace = true } -version = "16.0.0" +version = "16.0.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index df45fb41e003..52dc240b95a2 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,7 +40,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 5690a0c79ecb..8132edcb6a1e 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -42,7 +42,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.1", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } From 1c02ef63aa48b239a43f359991af736071634a21 Mon Sep 17 00:00:00 2001 From: bohan Date: Mon, 26 May 2025 22:20:49 +0800 Subject: [PATCH 014/209] perf(es/minifier): Remove needless clone (#10523) --- .changeset/real-monkeys-rhyme.md | 6 ++++++ crates/swc_ecma_minifier/src/compress/optimize/props.rs | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/real-monkeys-rhyme.md diff --git a/.changeset/real-monkeys-rhyme.md b/.changeset/real-monkeys-rhyme.md new file mode 100644 index 000000000000..f1b0cfbd70b3 --- /dev/null +++ b/.changeset/real-monkeys-rhyme.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_minifier: patch +--- + +refactor(ecma/minifier): less clone diff --git a/crates/swc_ecma_minifier/src/compress/optimize/props.rs b/crates/swc_ecma_minifier/src/compress/optimize/props.rs index b6e4788c2510..241888d87b20 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/props.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/props.rs @@ -147,7 +147,6 @@ impl Optimizer<'_> { PropName::Str(s) => ( s.value.clone(), s.value - .clone() .replace(|c: char| !Ident::is_valid_continue(c), "$") .into(), ), From 931a2d6761bfec72cdda7eb875ad02dc217848b9 Mon Sep 17 00:00:00 2001 From: bohan Date: Mon, 26 May 2025 22:26:08 +0800 Subject: [PATCH 015/209] refactor(es/parser): Share code for parsing strings (#10522) --- .changeset/tame-rocks-shave.md | 6 ++++ .../swc_ecma_lexer/src/common/parser/expr.rs | 12 ++++++++ .../swc_ecma_lexer/src/common/parser/ident.rs | 7 ++--- .../swc_ecma_lexer/src/common/parser/jsx.rs | 5 ++-- .../swc_ecma_lexer/src/common/parser/mod.rs | 10 ++----- .../src/common/parser/module_item.rs | 29 +++--------------- .../src/common/parser/typescript.rs | 30 +++++-------------- 7 files changed, 36 insertions(+), 63 deletions(-) create mode 100644 .changeset/tame-rocks-shave.md diff --git a/.changeset/tame-rocks-shave.md b/.changeset/tame-rocks-shave.md new file mode 100644 index 000000000000..4f4c2cd4c08e --- /dev/null +++ b/.changeset/tame-rocks-shave.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_lexer: patch +--- + +refactor(ecma/parser): common parse str lit diff --git a/crates/swc_ecma_lexer/src/common/parser/expr.rs b/crates/swc_ecma_lexer/src/common/parser/expr.rs index bc0fffa46630..c9a44fc09fb7 100644 --- a/crates/swc_ecma_lexer/src/common/parser/expr.rs +++ b/crates/swc_ecma_lexer/src/common/parser/expr.rs @@ -229,6 +229,18 @@ pub fn parse_tagged_tpl<'a, P: Parser<'a>>( }) } +pub fn parse_str_lit<'a>(p: &mut impl Parser<'a>) -> swc_ecma_ast::Str { + let start = p.cur_pos(); + let t = p.bump(); + debug_assert!(t.is_str()); + let (value, raw) = t.take_str(p.input_mut()); + swc_ecma_ast::Str { + span: p.span(start), + value, + raw: Some(raw), + } +} + pub fn parse_lit<'a, P: Parser<'a>>(p: &mut P) -> PResult { let start = p.cur_pos(); let cur = cur!(p, true); diff --git a/crates/swc_ecma_lexer/src/common/parser/ident.rs b/crates/swc_ecma_lexer/src/common/parser/ident.rs index 8c6247de46ad..6a1c5ca8f233 100644 --- a/crates/swc_ecma_lexer/src/common/parser/ident.rs +++ b/crates/swc_ecma_lexer/src/common/parser/ident.rs @@ -3,7 +3,7 @@ use swc_atoms::atom; use swc_common::{BytePos, Span}; use swc_ecma_ast::*; -use super::{buffer::Buffer, expr::parse_lit, PResult, Parser}; +use super::{buffer::Buffer, expr::parse_str_lit, PResult, Parser}; use crate::{ common::{context::Context, lexer::token::TokenFactory}, error::SyntaxError, @@ -15,10 +15,7 @@ pub fn parse_module_export_name<'a, P: Parser<'a>>(p: &mut P) -> PResult ModuleExportName::Str(str_lit), - _ => unreachable!(), - } + ModuleExportName::Str(parse_str_lit(p)) } else if cur.is_word() { ModuleExportName::Ident(parse_ident_name(p)?.into()) } else { diff --git a/crates/swc_ecma_lexer/src/common/parser/jsx.rs b/crates/swc_ecma_lexer/src/common/parser/jsx.rs index 929c1d6bd715..cf10b8b376bf 100644 --- a/crates/swc_ecma_lexer/src/common/parser/jsx.rs +++ b/crates/swc_ecma_lexer/src/common/parser/jsx.rs @@ -11,7 +11,7 @@ use crate::{ lexer::token::TokenFactory, parser::{ buffer::Buffer, - expr::{parse_assignment_expr, parse_lit}, + expr::{parse_assignment_expr, parse_str_lit}, get_qualified_jsx_name, ident::parse_ident_ref, typescript::{parse_ts_type_args, try_parse_ts}, @@ -158,8 +158,7 @@ fn parse_jsx_attr_value<'a, P: Parser<'a>>(p: &mut P) -> PResult { JSXExpr::Expr(..) => Ok(node.into()), } } else if cur.is_str() { - let lit = parse_lit(p)?; - Ok(JSXAttrValue::Lit(lit)) + Ok(JSXAttrValue::Lit(Lit::Str(parse_str_lit(p)))) } else if cur.is_jsx_tag_start() { let expr = parse_jsx_element(p)?; match expr { diff --git a/crates/swc_ecma_lexer/src/common/parser/mod.rs b/crates/swc_ecma_lexer/src/common/parser/mod.rs index bd15ecb4d036..e1421cc86e52 100644 --- a/crates/swc_ecma_lexer/src/common/parser/mod.rs +++ b/crates/swc_ecma_lexer/src/common/parser/mod.rs @@ -1,6 +1,6 @@ use std::ops::DerefMut; -use expr::parse_assignment_expr; +use expr::{parse_assignment_expr, parse_str_lit}; use expr_ext::ExprExt; use swc_atoms::Atom; use swc_common::{BytePos, Span, Spanned}; @@ -337,13 +337,7 @@ pub trait Parser<'a>: Sized + Clone { let start = p.input_mut().cur_pos(); let cur = cur!(p, true); let v = if cur.is_str() { - let t = p.bump(); - let (value, raw) = t.take_str(p.input_mut()); - PropName::Str(Str { - span: p.span(start), - value, - raw: Some(raw), - }) + PropName::Str(parse_str_lit(p)) } else if cur.is_num() { let t = p.bump(); let (value, raw) = t.take_num(p.input_mut()); diff --git a/crates/swc_ecma_lexer/src/common/parser/module_item.rs b/crates/swc_ecma_lexer/src/common/parser/module_item.rs index 758a3e34287b..2e68342d92d5 100644 --- a/crates/swc_ecma_lexer/src/common/parser/module_item.rs +++ b/crates/swc_ecma_lexer/src/common/parser/module_item.rs @@ -20,6 +20,7 @@ use crate::{ class_and_fn::{ parse_async_fn_decl, parse_class_decl, parse_decorators, parse_default_class, }, + expr::parse_str_lit, ident::parse_binding_ident, object::parse_object_expr, typescript::{parse_ts_enum_decl, parse_ts_interface_decl}, @@ -63,16 +64,9 @@ fn parse_from_clause_and_semi<'a, P: Parser<'a>>( ) -> PResult<(Box, Option>)> { expect!(p, &P::Token::FROM); - let str_start = p.cur_pos(); let cur = cur!(p, true); let src = if cur.is_str() { - let t = p.bump(); - let (value, raw) = t.take_str(p.input_mut()); - Box::new(Str { - span: p.span(str_start), - value, - raw: Some(raw), - }) + Box::new(parse_str_lit(p)) } else { unexpected!(p, "a string literal") }; @@ -764,15 +758,8 @@ fn parse_import<'a, P: Parser<'a>>(p: &mut P) -> PResult { expect!(p, &P::Token::IMPORT); // Handle import 'mod.js' - let str_start = p.cur_pos(); if cur!(p, false).is_ok_and(|cur| cur.is_str()) { - let t = p.bump(); - let (value, raw) = t.take_str(p.input_mut()); - let src = Box::new(Str { - span: p.span(str_start), - value, - raw: Some(raw), - }); + let src = Box::new(parse_str_lit(p)); let _ = cur!(p, false); let with = if p.input().syntax().import_attributes() && !p.input_mut().had_line_break_before_cur() @@ -892,16 +879,8 @@ fn parse_import<'a, P: Parser<'a>>(p: &mut P) -> PResult { let src = { expect!(p, &P::Token::FROM); - let str_start = p.cur_pos(); - if cur!(p, true).is_str() { - let t = p.bump(); - let (value, raw) = t.take_str(p.input_mut()); - Box::new(Str { - span: p.span(str_start), - value, - raw: Some(raw), - }) + Box::new(parse_str_lit(p)) } else { unexpected!(p, "a string literal") } diff --git a/crates/swc_ecma_lexer/src/common/parser/typescript.rs b/crates/swc_ecma_lexer/src/common/parser/typescript.rs index 7446a60cc3e9..c589f26a2706 100644 --- a/crates/swc_ecma_lexer/src/common/parser/typescript.rs +++ b/crates/swc_ecma_lexer/src/common/parser/typescript.rs @@ -20,7 +20,9 @@ use crate::{ lexer::token::TokenFactory, parser::{ buffer::Buffer, - expr::{parse_assignment_expr, parse_lit, parse_subscripts, parse_unary_expr}, + expr::{ + parse_assignment_expr, parse_lit, parse_str_lit, parse_subscripts, parse_unary_expr, + }, ident::{parse_ident, parse_ident_name}, module_item::parse_module_item_block_body, object::parse_object_expr, @@ -957,10 +959,7 @@ fn parse_ts_enum_member<'a, P: Parser<'a>>(p: &mut P) -> PResult { // literal or identifier. let cur = cur!(p, true); let id = if cur.is_str() { - parse_lit(p).map(|lit| match lit { - Lit::Str(s) => TsEnumMemberId::Str(s), - _ => unreachable!(), - })? + TsEnumMemberId::Str(parse_str_lit(p)) } else if cur.is_num() { let cur = p.bump(); let (value, raw) = cur.take_num(p.input_mut()); @@ -1337,10 +1336,7 @@ fn parse_ts_external_module_ref<'a, P: Parser<'a>>(p: &mut P) -> PResult s, - _ => unreachable!(), - }; + let expr = parse_str_lit(p); expect!(p, &P::Token::RPAREN); Ok(TsExternalModuleRef { span: p.span(start), @@ -2217,18 +2213,11 @@ fn parse_ts_import_type<'a, P: Parser<'a>>(p: &mut P) -> PResult { let _ = cur!(p, false); - let arg_span = p.input().cur_span(); - let cur = cur!(p, true); let arg = if cur.is_str() { - let t = p.bump(); - let (value, raw) = t.take_str(p.input_mut()); - Str { - span: arg_span, - value, - raw: Some(raw), - } + parse_str_lit(p) } else { + let arg_span = p.input().cur_span(); p.bump(); p.emit_err(arg_span, SyntaxError::TS1141); Str { @@ -2401,10 +2390,7 @@ fn parse_ts_ambient_external_module_decl<'a, P: Parser<'a>>( let id = parse_ident_name(p)?; (true, TsModuleName::Ident(id.into())) } else if cur!(p, true).is_str() { - let id = parse_lit(p).map(|lit| match lit { - Lit::Str(s) => TsModuleName::Str(s), - _ => unreachable!(), - })?; + let id = TsModuleName::Str(parse_str_lit(p)); (false, id) } else { unexpected!(p, "global or a string literal"); From 2bc551cb39d99ecebd5d6f10fc94a93173b2aefa Mon Sep 17 00:00:00 2001 From: bohan Date: Tue, 27 May 2025 20:16:11 +0800 Subject: [PATCH 016/209] perf(es/parser): Reduce comparison while reading logical (#10526) --- .changeset/poor-forks-heal.md | 6 ++ crates/swc_ecma_lexer/src/common/lexer/mod.rs | 80 +++++++++---------- .../swc_ecma_lexer/src/common/lexer/token.rs | 16 ++++ .../src/common/parser/object.rs | 4 +- crates/swc_ecma_lexer/src/lexer/table.rs | 4 +- crates/swc_ecma_parser/src/lexer/table.rs | 4 +- 6 files changed, 65 insertions(+), 49 deletions(-) create mode 100644 .changeset/poor-forks-heal.md diff --git a/.changeset/poor-forks-heal.md b/.changeset/poor-forks-heal.md new file mode 100644 index 000000000000..4d325ec9c13b --- /dev/null +++ b/.changeset/poor-forks-heal.md @@ -0,0 +1,6 @@ +--- +swc_ecma_lexer: patch +swc_core: patch +--- + +refactor(ecma/parser): less cmp when read logical diff --git a/crates/swc_ecma_lexer/src/common/lexer/mod.rs b/crates/swc_ecma_lexer/src/common/lexer/mod.rs index fb7efc8896eb..7dec5274a9b6 100644 --- a/crates/swc_ecma_lexer/src/common/lexer/mod.rs +++ b/crates/swc_ecma_lexer/src/common/lexer/mod.rs @@ -16,7 +16,7 @@ use swc_ecma_ast::{EsVersion, Ident}; use self::jsx::xhtml; use super::{context::Context, input::Tokens}; -use crate::{error::SyntaxError, token::BinOpToken}; +use crate::error::SyntaxError; pub mod char; pub mod comments_buffer; @@ -1731,6 +1731,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_logical(&mut self) -> LexResult { + debug_assert!(C == b'|' || C == b'&'); let had_line_break_before_last = self.had_line_break_before_last(); let start = self.cur_pos(); @@ -1739,17 +1740,18 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { self.input_mut().bump(); } let token = if C == b'&' { - BinOpToken::BitAnd + Self::Token::BIT_AND } else { - BinOpToken::BitOr + Self::Token::BIT_OR }; // '|=', '&=' if self.input_mut().eat_byte(b'=') { - return Ok(match token { - BinOpToken::BitAnd => Self::Token::BIT_AND_EQ, - BinOpToken::BitOr => Self::Token::BIT_OR_EQ, - _ => unreachable!(), + return Ok(if token.is_bit_and() { + Self::Token::BIT_AND_EQ + } else { + debug_assert!(token.is_bit_or()); + Self::Token::BIT_OR_EQ }); } @@ -1766,16 +1768,17 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { self.input_mut().bump(); } - return Ok(match token { - BinOpToken::BitAnd => Self::Token::LOGICAL_AND_EQ, - BinOpToken::BitOr => Self::Token::LOGICAL_OR_EQ, - _ => unreachable!(), + return Ok(if token.is_bit_and() { + Self::Token::LOGICAL_AND_EQ + } else { + debug_assert!(token.is_bit_or()); + Self::Token::LOGICAL_OR_EQ }); } // ||||||| // ^ - if had_line_break_before_last && token == BinOpToken::BitOr && self.is_str("||||| ") { + if had_line_break_before_last && token.is_bit_or() && self.is_str("||||| ") { let span = fixed_len_span(start, 7); self.emit_error_span(span, SyntaxError::TS1185); self.skip_line_comment(5); @@ -1783,55 +1786,48 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { return self.error_span(span, SyntaxError::TS1185); } - return Ok(match token { - BinOpToken::BitAnd => Self::Token::LOGICAL_AND, - BinOpToken::BitOr => Self::Token::LOGICAL_OR, - _ => unreachable!(), + return Ok(if token.is_bit_and() { + Self::Token::LOGICAL_AND + } else { + debug_assert!(token.is_bit_or()); + Self::Token::LOGICAL_OR }); } - Ok(if token == BinOpToken::BitAnd { - Self::Token::BIT_AND - } else { - Self::Token::BIT_OR - }) + Ok(token) } /// Read a token given `*` or `%`. /// /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] - fn read_token_mul_mod(&mut self) -> LexResult { - let is_mul = C == b'*'; + fn read_token_mul_mod(&mut self, is_mul: bool) -> LexResult { unsafe { // Safety: cur() is Some(c) self.input_mut().bump(); } - let mut token = if is_mul { - BinOpToken::Mul + let token = if is_mul { + if self.input_mut().eat_byte(b'*') { + // `**` + Self::Token::EXP + } else { + Self::Token::MUL + } } else { - BinOpToken::Mod + Self::Token::MOD }; - // check for ** - if is_mul && self.input_mut().eat_byte(b'*') { - token = BinOpToken::Exp - } - Ok(if self.input_mut().eat_byte(b'=') { - match token { - BinOpToken::Mul => Self::Token::MUL_EQ, - BinOpToken::Mod => Self::Token::MOD_EQ, - BinOpToken::Exp => Self::Token::EXP_EQ, - _ => unreachable!(), + if token.is_star() { + Self::Token::MUL_EQ + } else if token.is_mod() { + Self::Token::MOD_EQ + } else { + debug_assert!(token.is_exp()); + Self::Token::EXP_EQ } } else { - match token { - BinOpToken::Mul => Self::Token::MUL, - BinOpToken::Mod => Self::Token::MOD, - BinOpToken::Exp => Self::Token::EXP, - _ => unreachable!(), - } + token }) } diff --git a/crates/swc_ecma_lexer/src/common/lexer/token.rs b/crates/swc_ecma_lexer/src/common/lexer/token.rs index 6557b11dff75..9deab185d436 100644 --- a/crates/swc_ecma_lexer/src/common/lexer/token.rs +++ b/crates/swc_ecma_lexer/src/common/lexer/token.rs @@ -515,6 +515,10 @@ pub trait TokenFactory<'a, TokenAndSpan, I: Tokens>: Sized + Parti Self::MUL.eq(self) } #[inline(always)] + fn is_mod(&self) -> bool { + Self::MOD.eq(self) + } + #[inline(always)] fn is_semi(&self) -> bool { Self::SEMI.eq(self) } @@ -570,4 +574,16 @@ pub trait TokenFactory<'a, TokenAndSpan, I: Tokens>: Sized + Parti fn is_debugger(&self) -> bool { Self::DEBUGGER.eq(self) } + #[inline(always)] + fn is_bit_and(&self) -> bool { + Self::BIT_AND.eq(self) + } + #[inline(always)] + fn is_bit_or(&self) -> bool { + Self::BIT_OR.eq(self) + } + #[inline(always)] + fn is_exp(&self) -> bool { + Self::EXP.eq(self) + } } diff --git a/crates/swc_ecma_lexer/src/common/parser/object.rs b/crates/swc_ecma_lexer/src/common/parser/object.rs index fc073eea050e..8c57d427f945 100644 --- a/crates/swc_ecma_lexer/src/common/parser/object.rs +++ b/crates/swc_ecma_lexer/src/common/parser/object.rs @@ -6,7 +6,7 @@ use swc_ecma_ast::*; use super::{ expr::parse_assignment_expr, pat::{parse_binding_element, parse_binding_pat_or_ident}, - Parser, + PResult, Parser, }; use crate::{ common::{ @@ -23,8 +23,6 @@ use crate::{ error::SyntaxError, }; -pub type PResult = Result; - fn parse_object<'a, P: Parser<'a>, Object, ObjectProp>( p: &mut P, parse_prop: impl Fn(&mut P) -> PResult, diff --git a/crates/swc_ecma_lexer/src/lexer/table.rs b/crates/swc_ecma_lexer/src/lexer/table.rs index 0e4f793229e0..105478b1e189 100644 --- a/crates/swc_ecma_lexer/src/lexer/table.rs +++ b/crates/swc_ecma_lexer/src/lexer/table.rs @@ -388,10 +388,10 @@ const UNI: ByteHandler = Some(|lexer| { const COL: ByteHandler = Some(|lexer| lexer.read_token_colon().map(Some)); /// `%` -const PRC: ByteHandler = Some(|lexer| lexer.read_token_mul_mod::().map(Some)); +const PRC: ByteHandler = Some(|lexer| lexer.read_token_mul_mod(false).map(Some)); /// `*` -const ATR: ByteHandler = Some(|lexer| lexer.read_token_mul_mod::().map(Some)); +const ATR: ByteHandler = Some(|lexer| lexer.read_token_mul_mod(true).map(Some)); /// `?` const QST: ByteHandler = Some(|lexer| lexer.read_token_question_mark().map(Some)); diff --git a/crates/swc_ecma_parser/src/lexer/table.rs b/crates/swc_ecma_parser/src/lexer/table.rs index 7711dbcdbbfa..d1a4ff1947a1 100644 --- a/crates/swc_ecma_parser/src/lexer/table.rs +++ b/crates/swc_ecma_parser/src/lexer/table.rs @@ -329,10 +329,10 @@ const UNI: ByteHandler = Some(|lexer| { const COL: ByteHandler = Some(|lexer| lexer.read_token_colon().map(Some)); /// `%` -const PRC: ByteHandler = Some(|lexer| lexer.read_token_mul_mod::().map(Some)); +const PRC: ByteHandler = Some(|lexer| lexer.read_token_mul_mod(false).map(Some)); /// `*` -const ATR: ByteHandler = Some(|lexer| lexer.read_token_mul_mod::().map(Some)); +const ATR: ByteHandler = Some(|lexer| lexer.read_token_mul_mod(true).map(Some)); /// `?` const QST: ByteHandler = Some(|lexer| lexer.read_token_question_mark().map(Some)); From 4b3f924edf996983e2a61cc29eb0c552cf71af7a Mon Sep 17 00:00:00 2001 From: magic-akari Date: Tue, 27 May 2025 20:56:47 +0800 Subject: [PATCH 017/209] feat(es/regexp): Add crates for RegExp (#10525) --- Cargo.lock | 48 + crates/swc_ecma_regexp/Cargo.toml | 35 + crates/swc_ecma_regexp/README.md | 16 + .../swc_ecma_regexp/examples/parse_literal.rs | 68 + .../swc_ecma_regexp/examples/regex_visitor.rs | 24 + crates/swc_ecma_regexp/src/ast.rs | 1 + crates/swc_ecma_regexp/src/diagnostics.rs | 243 + crates/swc_ecma_regexp/src/lib.rs | 169 + crates/swc_ecma_regexp/src/options.rs | 7 + .../src/parser/flags_parser.rs | 121 + crates/swc_ecma_regexp/src/parser/mod.rs | 367 + .../swc_ecma_regexp/src/parser/parser_impl.rs | 124 + .../src/parser/pattern_parser/character.rs | 140 + .../src/parser/pattern_parser/mod.rs | 6 + .../pattern_parser/pattern_parser_impl.rs | 2413 +++ .../src/parser/pattern_parser/state.rs | 260 + .../parser/pattern_parser/unicode_property.rs | 362 + .../swc_ecma_regexp/src/parser/reader/mod.rs | 159 + .../src/parser/reader/reader_impl.rs | 136 + .../reader/string_literal_parser/README.md | 5 + .../reader/string_literal_parser/ast.rs | 25 + .../string_literal_parser/characters.rs | 43 + .../string_literal_parser/diagnostics.rs | 21 + .../reader/string_literal_parser/mod.rs | 310 + .../reader/string_literal_parser/options.rs | 12 + .../string_literal_parser/parser_impl.rs | 555 + .../src/parser/span_factory.rs | 21 + crates/swc_ecma_regexp/src/surrogate_pair.rs | 1 + crates/swc_ecma_regexp_ast/Cargo.toml | 29 + crates/swc_ecma_regexp_ast/README.md | 3 + crates/swc_ecma_regexp_ast/src/display.rs | 407 + crates/swc_ecma_regexp_ast/src/lib.rs | 348 + crates/swc_ecma_regexp_common/Cargo.toml | 13 + crates/swc_ecma_regexp_common/README.md | 3 + crates/swc_ecma_regexp_common/src/lib.rs | 3 + .../src/surrogate_pair.rs | 11 + crates/swc_ecma_regexp_visit/Cargo.toml | 26 + crates/swc_ecma_regexp_visit/src/generated.rs | 17337 ++++++++++++++++ crates/swc_ecma_regexp_visit/src/lib.rs | 7 + tools/generate-code/src/main.rs | 10 + 40 files changed, 23889 insertions(+) create mode 100644 crates/swc_ecma_regexp/Cargo.toml create mode 100644 crates/swc_ecma_regexp/README.md create mode 100644 crates/swc_ecma_regexp/examples/parse_literal.rs create mode 100644 crates/swc_ecma_regexp/examples/regex_visitor.rs create mode 100644 crates/swc_ecma_regexp/src/ast.rs create mode 100644 crates/swc_ecma_regexp/src/diagnostics.rs create mode 100644 crates/swc_ecma_regexp/src/lib.rs create mode 100644 crates/swc_ecma_regexp/src/options.rs create mode 100644 crates/swc_ecma_regexp/src/parser/flags_parser.rs create mode 100644 crates/swc_ecma_regexp/src/parser/mod.rs create mode 100644 crates/swc_ecma_regexp/src/parser/parser_impl.rs create mode 100644 crates/swc_ecma_regexp/src/parser/pattern_parser/character.rs create mode 100644 crates/swc_ecma_regexp/src/parser/pattern_parser/mod.rs create mode 100644 crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs create mode 100644 crates/swc_ecma_regexp/src/parser/pattern_parser/state.rs create mode 100644 crates/swc_ecma_regexp/src/parser/pattern_parser/unicode_property.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/mod.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/README.md create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/ast.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/characters.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/diagnostics.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/mod.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/options.rs create mode 100644 crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs create mode 100644 crates/swc_ecma_regexp/src/parser/span_factory.rs create mode 100644 crates/swc_ecma_regexp/src/surrogate_pair.rs create mode 100644 crates/swc_ecma_regexp_ast/Cargo.toml create mode 100644 crates/swc_ecma_regexp_ast/README.md create mode 100644 crates/swc_ecma_regexp_ast/src/display.rs create mode 100644 crates/swc_ecma_regexp_ast/src/lib.rs create mode 100644 crates/swc_ecma_regexp_common/Cargo.toml create mode 100644 crates/swc_ecma_regexp_common/README.md create mode 100644 crates/swc_ecma_regexp_common/src/lib.rs create mode 100644 crates/swc_ecma_regexp_common/src/surrogate_pair.rs create mode 100644 crates/swc_ecma_regexp_visit/Cargo.toml create mode 100644 crates/swc_ecma_regexp_visit/src/generated.rs create mode 100644 crates/swc_ecma_regexp_visit/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index b4d9ccba9fac..3feda3246704 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5725,6 +5725,54 @@ dependencies = [ "swc_ecma_visit", ] +[[package]] +name = "swc_ecma_regexp" +version = "0.0.0" +dependencies = [ + "phf", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "swc_atoms", + "swc_common", + "swc_ecma_regexp_ast", + "swc_ecma_regexp_common", + "swc_ecma_regexp_visit", + "swc_visit", + "testing", + "unicode-id-start", +] + +[[package]] +name = "swc_ecma_regexp_ast" +version = "0.0.0" +dependencies = [ + "bitflags 2.6.0", + "bytecheck 0.8.1", + "is-macro", + "rancor", + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_regexp_common", +] + +[[package]] +name = "swc_ecma_regexp_common" +version = "0.0.0" + +[[package]] +name = "swc_ecma_regexp_visit" +version = "0.0.0" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_regexp_ast", + "swc_html_ast", + "swc_visit", +] + [[package]] name = "swc_ecma_testing" version = "12.0.0" diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml new file mode 100644 index 000000000000..a2d77c15c1ae --- /dev/null +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -0,0 +1,35 @@ +[package] +authors = ["강동윤 ", "magic-akari "] +description = "ECMAScript regular expressions" +documentation = "https://rustdoc.swc.rs/swc_ecma_regexp/" +edition = "2021" +include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] +license = { workspace = true } +name = "swc_ecma_regexp" +repository = "https://github.com/swc-project/swc.git" +version = "0.0.0" + +[lib] +bench = false + +[features] +debug = [] + +[dependencies] +phf = { workspace = true, features = ["macros"] } +rustc-hash = { workspace = true } +unicode-id-start = { workspace = true } + +swc_atoms = { version = "5.0.0", path = "../swc_atoms" } +swc_common = { version = "11.0.0", path = "../swc_common" } +swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } +swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } +swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } +swc_visit = { version = "2.0.0", path = "../swc_visit" } + + +[dev-dependencies] +serde = { workspace = true } +serde_json = { workspace = true } + +testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_regexp/README.md b/crates/swc_ecma_regexp/README.md new file mode 100644 index 000000000000..a143bd970608 --- /dev/null +++ b/crates/swc_ecma_regexp/README.md @@ -0,0 +1,16 @@ +# RegExp + +Implements ECMAScript® 2024 Language Specification + +- https://tc39.es/ecma262/2024/multipage/ecmascript-language-lexical-grammar.html#sec-literals-regular-expression-literals +- https://tc39.es/ecma262/2024/multipage/text-processing.html#sec-regexp-regular-expression-objects +- https://tc39.es/ecma262/2024/multipage/additional-ecmascript-features-for-web-browsers.html#sec-regular-expressions-patterns + +And, Stage 4 proposals + +- https://github.com/tc39/proposal-duplicate-named-capturing-groups +- https://github.com/tc39/proposal-regexp-modifiers + +# References + +https://github.com/oxc-project/oxc/blob/3efc25fdebe4e02331f47767a74855f1d0d2bb15/crates/oxc_regular_expression diff --git a/crates/swc_ecma_regexp/examples/parse_literal.rs b/crates/swc_ecma_regexp/examples/parse_literal.rs new file mode 100644 index 000000000000..5d8a99065bfc --- /dev/null +++ b/crates/swc_ecma_regexp/examples/parse_literal.rs @@ -0,0 +1,68 @@ +#![expect(clippy::print_stdout)] + +use swc_ecma_regexp::{LiteralParser, Options}; + +fn main() { + for (pattern_text, flags_text) in [ + (r"ab", ""), + (r"abc", "i"), + (r"abcd", "igv"), + (r"emo👈🏻ji", "u"), + (r"ab|c", "i"), + (r"a|b+|c", "i"), + (r"a{0}|b{1,2}|c{3,}", "i"), + (r"(?=a)|(?<=b)|(?!c)|(?x\1c", "u"), + (r"(cg)(?cg)(?:g)", ""), + (r"{3}", ""), // Error + (r"Em🥹j", ""), + (r"^(?=ab)\b(?!cd)(?<=ef)\B(?)(?)", ""), // Error + (r"(?noname)", "v"), // Error + (r"[\bb]", ""), + (r"a{2,1}", "v"), // Error + ] { + let parser = LiteralParser::new( + pattern_text, + Some(flags_text), + // +1 for added `/` in error reports + Options { + pattern_span_offset: 1, + ..Options::default() + }, + ); + let ret = parser.parse(); + + let literal = format!("/{pattern_text}/{flags_text}"); + println!("Parse: {literal}"); + match ret { + Ok(pattern) => { + println!("✨ {pattern:#?}"); + } + Err(error) => { + // [TODO]: Use swc error handling + // let error = error.with_source_code(literal); + println!("💥 {error:?}"); + } + } + println!(); + } +} diff --git a/crates/swc_ecma_regexp/examples/regex_visitor.rs b/crates/swc_ecma_regexp/examples/regex_visitor.rs new file mode 100644 index 000000000000..7ea4cc531f55 --- /dev/null +++ b/crates/swc_ecma_regexp/examples/regex_visitor.rs @@ -0,0 +1,24 @@ +#![expect(clippy::print_stdout)] + +use swc_ecma_regexp::{LiteralParser, Options}; +use swc_ecma_regexp_ast::*; +use swc_ecma_regexp_visit::{Visit, VisitWith}; + +struct TestVisitor; + +impl Visit for TestVisitor { + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + println!("Visiting capturing group: {node:?}"); + node.visit_children_with(self); + } +} + +fn main() { + let source_text = r"(https?:\/\/github\.com\/(([^\s]+)\/([^\s]+))\/([^\s]+\/)?(issues|pull)\/([0-9]+))|(([^\s]+)\/([^\s]+))?#([1-9][0-9]*)($|[\s\:\;\-\(\=])"; + + let parser = LiteralParser::new(source_text, None, Options::default()); + let pattern = parser.parse().unwrap(); + + let mut visitor = TestVisitor; + visitor.visit_pattern(&pattern); +} diff --git a/crates/swc_ecma_regexp/src/ast.rs b/crates/swc_ecma_regexp/src/ast.rs new file mode 100644 index 000000000000..3091333f6916 --- /dev/null +++ b/crates/swc_ecma_regexp/src/ast.rs @@ -0,0 +1 @@ +pub use swc_ecma_regexp_ast::*; diff --git a/crates/swc_ecma_regexp/src/diagnostics.rs b/crates/swc_ecma_regexp/src/diagnostics.rs new file mode 100644 index 000000000000..67de4d45e229 --- /dev/null +++ b/crates/swc_ecma_regexp/src/diagnostics.rs @@ -0,0 +1,243 @@ +use std::{ + borrow::Cow, + fmt::{self, Display}, +}; + +use swc_common::Span; + +type Either = std::result::Result; + +#[derive(Debug)] +pub struct RegexpDiagnostic { + message: Cow<'static, str>, + label: Option>>, + help: Option>, +} + +impl RegexpDiagnostic { + pub fn error>>(message: T) -> Self { + RegexpDiagnostic { + message: message.into(), + label: None, + help: None, + } + } + + pub fn with_label(mut self, span: Span) -> Self { + self.label = Some(Ok(span)); + self + } + + pub fn with_labels(mut self, spans: Vec) -> Self { + self.label = Some(Err(spans)); + self + } + + pub fn with_help>>(mut self, help: T) -> Self { + self.help = Some(help.into()); + self + } +} + +impl Display for RegexpDiagnostic { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { + self.message.fmt(f) + } +} + +pub type Result = std::result::Result; + +const PREFIX: &str = "Invalid regular expression:"; + +#[cold] +pub fn invalid_input(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid input string literal")).with_label(span) +} + +// --- + +#[cold] +pub fn unknown_flag(span: Span, flag: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Unknown flag: `{flag}` found")).with_label(span) +} + +#[cold] +pub fn duplicated_flags(span: Span, flag: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Duplicated flag: `{flag}` found")).with_label(span) +} + +#[cold] +pub fn invalid_unicode_flags(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Invalid unicode flags combination `u` and `v`" + )) + .with_label(span) +} + +// --- + +#[cold] +pub fn duplicated_capturing_group_names(spans: Vec) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Duplicated capturing group names")).with_labels(spans) +} + +#[cold] +pub fn too_may_capturing_groups(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Too many capturing groups")).with_label(span) +} + +#[cold] +pub fn parse_pattern_incomplete(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Could not parse the entire pattern")).with_label(span) +} + +#[cold] +pub fn lone_quantifier(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Lone quantifier found, expected with `{kind}`" + )) + .with_label(span) +} + +#[cold] +pub fn unterminated_pattern(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Unterminated {kind}")).with_label(span) +} + +#[cold] +pub fn invalid_extended_atom_escape(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid extended atom escape")).with_label(span) +} + +#[cold] +pub fn invalid_braced_quantifier(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid braced quantifier")).with_label(span) +} + +#[cold] +pub fn invalid_indexed_reference(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid indexed reference")).with_label(span) +} + +#[cold] +pub fn empty_group_specifier(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Group specifier is empty")).with_label(span) +} + +#[cold] +pub fn invalid_named_reference(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid named reference")).with_label(span) +} + +#[cold] +pub fn invalid_unicode_property_name_negative_strings(span: Span, name: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Invalid property name `{name}`(negative + property of strings)" + )) + .with_label(span) +} + +#[cold] +pub fn invalid_character_class(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Invalid character class with strings unicode property" + )) + .with_label(span) +} + +#[cold] +pub fn character_class_range_out_of_order(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Character {kind} range out of order")) + .with_label(span) +} + +#[cold] +pub fn character_class_range_invalid_atom(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Character class range with invalid atom")) + .with_label(span) +} + +#[cold] +pub fn invalid_class_atom(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid class atom")).with_label(span) +} + +#[cold] +pub fn empty_class_set_expression(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Expected nonempty class set expression")) + .with_label(span) +} + +#[cold] +pub fn class_intersection_unexpected_ampersand(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Unexpected `&` inside of class intersection" + )) + .with_label(span) +} + +#[cold] +pub fn class_set_expression_invalid_character(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Unexpected character inside of {kind}")) + .with_label(span) +} + +#[cold] +pub fn character_class_contents_invalid_operands(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Invalid class operands inside of character class contents" + )) + .with_label(span) +} + +#[cold] +pub fn too_large_number_in_braced_quantifier(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Number is too large in braced quantifier")) + .with_label(span) +} + +#[cold] +pub fn braced_quantifier_out_of_order(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!( + "{PREFIX} Numbers out of order in braced quantifier" + )) + .with_label(span) +} + +#[cold] +pub fn too_large_number_digits(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Number is too large in {kind} digits")) + .with_label(span) +} + +#[cold] +pub fn invalid_unicode_property(span: Span, kind: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid unicode property {kind}")).with_label(span) +} + +#[cold] +pub fn invalid_unicode_property_of_strings(span: Span, name: &str) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid unicode property `{name}`")) + .with_help("Enable `UnicodeSetsMode` to use this property") + .with_label(span) +} + +#[cold] +pub fn invalid_unicode_escape_sequence(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid unicode escape sequence")).with_label(span) +} + +#[cold] +pub fn invalid_surrogate_pair(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid surrogate pair")).with_label(span) +} + +#[cold] +pub fn invalid_modifiers(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Invalid modifiers")).with_label(span) +} + +#[cold] +pub fn unknown_modifiers(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("{PREFIX} Unknown modifiers")).with_label(span) +} diff --git a/crates/swc_ecma_regexp/src/lib.rs b/crates/swc_ecma_regexp/src/lib.rs new file mode 100644 index 000000000000..2deaa39d7f64 --- /dev/null +++ b/crates/swc_ecma_regexp/src/lib.rs @@ -0,0 +1,169 @@ +pub mod ast; +mod diagnostics; +mod options; +mod parser; +mod surrogate_pair; + +pub use crate::{ + options::Options, + parser::{ConstructorParser, LiteralParser}, +}; + +#[cfg(test)] +mod test { + + use crate::{LiteralParser, Options}; + + type Case<'a> = ( + &'a str, + /* expected display, None means expect the same as original */ Option<&'a str>, + ); + + static CASES: &[Case] = &[ + ("/ab/", None), + ("/ab/u", None), + ("/abc/i", None), + ("/abc/iu", None), + ("/a*?/i", None), + ("/a*?/iu", None), + ("/emo👈🏻ji/", None), + ("/emo👈🏻ji/u", None), + ("/ab|c/i", None), + ("/ab|c/iu", None), + ("/a|b+|c/i", None), + ("/a|b+|c/iu", None), + ("/(?=a)|(?<=b)|(?!c)|(?cg)(?:g)/", None), + (r"/(cg)(?cg)(?:g)/u", None), + (r"/^(?=ab)\b(?!cd)(?<=ef)\B(? + (r"/\1/", None), + (r"/\2/", None), + (r"/\3/", None), + (r"/\4/", None), + (r"/\5/", None), + (r"/\6/", None), + (r"/\7/", None), + (r"/\00/", None), + (r"/\07/", None), + (r"/\30/", None), + (r"/\37/", None), + (r"/\40/", None), + (r"/\47/", None), + (r"/\70/", None), + (r"/\77/", None), + (r"/\000/", None), + (r"/\007/", None), + (r"/\070/", None), + (r"/\300/", None), + (r"/\307/", None), + (r"/\370/", None), + (r"/\377/", None), + (r"/\0111/", None), + (r"/\0022/", None), + (r"/\0003/", None), + (r"/(.)\1/", None), + // Identity escape from: + (r"/\C/", None), + (r"/O\PQ/", None), + (r"/\8/", None), + (r"/7\89/", None), + (r"/\9/", None), + (r"/8\90/", None), + (r"/(.)(.)(.)(.)(.)(.)(.)(.)\8\8/", None), + // Class escape from: + (r"/\c0/", None), + (r"/[\c0]/", None), + (r"/\c1/", None), + (r"/[\c10]+/", None), + (r"/\c8/", None), + (r"/[\c8]/", None), + (r"/[\c80]+/", None), + (r"/\c_/", None), + // Capitalize hex unicodes -- + (r"/^|\udf06/gu", Some(r"/^|\uDF06/gu")), + (r"/\udf06/", Some(r"/\uDF06/")), + (r"/\udf06/u", Some(r"/\uDF06/u")), + (r"/^|\udf06/g", Some(r"/^|\uDF06/g")), + // -- + (r"/[\-]/", None), + (r"/[\-]/u", None), + (r"/[\-]/v", None), + (r"/([\-a-z]{0,31})/iu", None), + // ES2025 --- + (r"/(?i:.)/", None), + (r"/(?-s:.)/", None), + (r"/(?im-s:.)/u", None), + (r"/(?m-is:.)/v", None), + (r"/(?smi:.)/v", Some(r"/(?ims:.)/v")), + ]; + + #[test] + fn test_display() { + for (input, output) in CASES { + let (left_slash, right_slash) = (input.find('/').unwrap(), input.rfind('/').unwrap()); + + let pattern = &input[left_slash + 1..right_slash]; + let flags = &input[right_slash + 1..]; + + let actual = LiteralParser::new(pattern, Some(flags), Options::default()) + .parse() + .unwrap(); + + let expect = output.unwrap_or(input); + assert_eq!(expect, format!("/{actual}/{flags}")); // This uses `Display` impls + } + } +} diff --git a/crates/swc_ecma_regexp/src/options.rs b/crates/swc_ecma_regexp/src/options.rs new file mode 100644 index 000000000000..7073bf3b43f7 --- /dev/null +++ b/crates/swc_ecma_regexp/src/options.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Copy, Debug, Default)] +pub struct Options { + /// Used to adjust `Span` positions to fit the global source code. + pub pattern_span_offset: u32, + /// Used to adjust `Span` positions to fit the global source code. + pub flags_span_offset: u32, +} diff --git a/crates/swc_ecma_regexp/src/parser/flags_parser.rs b/crates/swc_ecma_regexp/src/parser/flags_parser.rs new file mode 100644 index 000000000000..0f38de5d647c --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/flags_parser.rs @@ -0,0 +1,121 @@ +use rustc_hash::FxHashSet; + +use crate::{ + diagnostics::{self, Result}, + parser::{reader::Reader, span_factory::SpanFactory}, +}; + +pub struct FlagsParser<'a> { + reader: Reader<'a>, + span_factory: SpanFactory, +} + +impl<'a> FlagsParser<'a> { + pub fn new(reader: Reader<'a>, span_offset: u32) -> Self { + Self { + reader, + span_factory: SpanFactory::new(span_offset), + } + } + + /// Returns: (is_unicode_mode, is_unicode_sets_mode) + pub fn parse(mut self) -> Result<(bool, bool)> { + let mut is_unicode_mode = false; + let mut is_unicode_sets_mode = false; + let mut unique_flags = FxHashSet::default(); + + while let Some(cp) = self.reader.peek() { + let span_start = self.reader.offset(); + self.reader.advance(); + let span_end = self.reader.offset(); + + if unique_flags.contains(&cp) { + return Err(diagnostics::duplicated_flags( + self.span_factory.create(span_start, span_end), + &self.reader.atom(span_start, span_end), + )); + } + if char::try_from(cp).map_or(true, |c| { + !matches!(c, 'd' | 'g' | 'i' | 'm' | 's' | 'u' | 'v' | 'y') + }) { + return Err(diagnostics::unknown_flag( + self.span_factory.create(span_start, span_end), + &self.reader.atom(span_start, span_end), + )); + } + + if cp == 'u' as u32 { + if unique_flags.contains(&('v' as u32)) { + return Err(diagnostics::invalid_unicode_flags( + self.span_factory.create(span_start, span_end), + )); + } + is_unicode_mode = true; + } + if cp == 'v' as u32 { + if unique_flags.contains(&('u' as u32)) { + return Err(diagnostics::invalid_unicode_flags( + self.span_factory.create(span_start, span_end), + )); + } + is_unicode_mode = true; + is_unicode_sets_mode = true; + } + + unique_flags.insert(cp); + } + + Ok((is_unicode_mode, is_unicode_sets_mode)) + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn should_pass() { + for (flags_text, expected) in &[ + ("", (false, false)), + ("i", (false, false)), + ("u", (true, false)), + ("v", (true, true)), + ("vg", (true, true)), + ] { + let reader = Reader::initialize(flags_text, true, false).unwrap(); + let result = FlagsParser::new(reader, 0).parse().unwrap(); + assert_eq!(result, *expected); + } + } + + #[test] + fn should_fail() { + for flags_text in &["uv", "vu", "uu", "vv", "gg", "$"] { + let reader = Reader::initialize(flags_text, true, false).unwrap(); + let err = FlagsParser::new(reader, 0).parse(); + assert!(err.is_err()); + // println!("{:?}", err.unwrap_err().with_source_code(*flags_text)); + } + for flags_text in &[r#""uv""#, "'V'", "\"-\"", r#""\162""#] { + let reader = Reader::initialize(flags_text, true, true).unwrap(); + let err = FlagsParser::new(reader, 0).parse(); + assert!(err.is_err()); + // println!("{:?}", err.unwrap_err().with_source_code(*flags_text)); + } + } + + #[test] + fn string_literal() { + for reader in [ + Reader::initialize("u", true, false).unwrap(), + Reader::initialize("'u'", true, true).unwrap(), + Reader::initialize(r#""\165""#, true, true).unwrap(), + Reader::initialize(r#""\x75""#, true, true).unwrap(), + Reader::initialize(r#""\u0075""#, true, true).unwrap(), + Reader::initialize(r#""\u{0075}""#, true, true).unwrap(), + ] { + let result = FlagsParser::new(reader, 0).parse().unwrap(); + assert_eq!(result, (true, false)); + } + } +} diff --git a/crates/swc_ecma_regexp/src/parser/mod.rs b/crates/swc_ecma_regexp/src/parser/mod.rs new file mode 100644 index 000000000000..0b301b003749 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/mod.rs @@ -0,0 +1,367 @@ +mod flags_parser; +mod parser_impl; +mod pattern_parser; +mod reader; +mod span_factory; + +pub use parser_impl::{ConstructorParser, LiteralParser}; + +#[cfg(test)] +mod test { + + use crate::{ConstructorParser, LiteralParser, Options}; + + #[test] + fn should_pass() { + for (pattern_text, flags_text) in &[ + ("", ""), + ("a", ""), + ("a+", ""), + ("a*", ""), + ("a?", ""), + ("^$^$^$", ""), + ("(?=a){1}", ""), + ("(?!a){1}", ""), + ("a{1}", ""), + ("a{1", ""), + ("a|{", ""), + ("a{", ""), + ("a{,", ""), + ("a{1,", ""), + ("a{1,}", ""), + ("a{1,2}", ""), + ("x{9007199254740991}", ""), + ("x{9007199254740991,9007199254740991}", ""), + ("a|b", ""), + ("a|b|c", ""), + ("a|b+?|c", ""), + ("a+b*?c{1}d{2,}e{3,4}?", ""), + (r"^(?=ab)\b(?!cd)(?<=ef)\B(?.)\x1f", ""), + ("a]", ""), + ("a}", ""), + ("]", ""), + ("[]", ""), + ("[a]", ""), + ("[ab]", ""), + ("[a-b]", ""), + ("[-]", ""), + ("[a-]", ""), + ("[-a]", ""), + ("[-a-]", ""), + (r"[a\-b]", ""), + (r"[-a-b]", ""), + (r"[a-b-]", ""), + (r"[a\-b-]", ""), + (r"[\[\]\-]", ""), + ("[a-z0-9]", ""), + ("[a-a]", ""), + (r"[\d-\D]", ""), + (r"^([\ud801[\udc28-\udc4f])$", ""), + (r"[a-c]]", ""), + ( + r"[ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻ-ϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎ-ӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣա-ևᴀ-ᴫᵢ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ]", + "", + ), + (r"[a-z0-9[.\\]]", "v"), + (r"[a&&b&&c]", "v"), + (r"[a--b--c]", "v"), + (r"[[a-z]--b--c]", "v"), + (r"[[[[[[[[[[[[[[[[[[[[[[[[a]]]]]]]]]]]]]]]]]]]]]]]]", "v"), + (r"[\q{}\q{a}\q{bc}\q{d|e|f}\q{|||}]", "v"), + (r"(?A)\k", ""), + (r"(?)\k", ""), + (r"\k", ""), + (r"\k<4>", ""), + (r"\k", ""), + (r"(?)\k", ""), + (r"(?)\k", "u"), + (r"\1", ""), + (r"\1()", ""), + (r"\1()", "u"), + (r"(?..)(?..)", ""), + // ES2025 --- + // Duplicate named capturing groups + (r"(?..)|(?..)", ""), + (r"(?[0-9]{4})-[0-9]{2}|[0-9]{2}-(?[0-9]{4})", ""), + (r"(?:(?x)|(?y))\k", ""), + (r"(?a)|(?b)", ""), + (r"(?:(?a)|(?a)(?b))(?:(?c)|(?d))", ""), + (r"(?:(?a)|(?b))\\k", ""), + (r"(?:(?:(?a)|(?b)|c)\\k){2}", ""), + (r"(?:(?:(?a)|(?b))\\k){2}", ""), + (r"(?:(?:(?a)\\k|(?b)\\k)|(?:))\\k", ""), + (r"(?:(?:(?a\\k)|(?b\\k))|(?:))\\k", ""), + // Modifiers + (r"(?:.)", ""), + (r"(?s:.)", ""), + (r"(?ism:.)", ""), + (r"(?-s:.)", ""), + (r"(?-smi:.)", ""), + (r"(?s-im:.)", ""), + (r"(?si-m:.)", ""), + (r"(?im-s:.)", "v"), + (r"(?ims-:.)", ""), + ] { + let res = + LiteralParser::new(pattern_text, Some(flags_text), Options::default()).parse(); + if let Err(err) = res { + panic!("Failed to parse /{pattern_text}/{flags_text}\n💥 {err}"); + } + } + } + + #[test] + fn should_fail() { + for (pattern_text, flags_text) in &[ + ("a)", ""), + (r"a\", ""), + ("a]", "u"), + ("a}", "u"), + ("a|+", ""), + ("a|{", "u"), + ("a{", "u"), + ("a{1", "u"), + ("a{1,", "u"), + ("a{,", "u"), + ("x{9007199254740992}", ""), + ("x{9007199254740991,9007199254740992}", ""), + ("x{99999999999999999999999999999999999999999999999999}", ""), + (r"\99999999999999999999999999999999999999999999999999", ""), + (r"\u{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}", "u"), + ("(?=a", ""), + ("(?", "u"), + (r"\k<4>", "u"), + (r"\k", "u"), + ("a(?:", ""), + ("(", ""), + (")", "v"), + ("(a", ""), + ("(?", ""), + ("(?<", ""), + (r"(?.)", ""), + (r"(?.)", "u"), + (r"(?<\>.)", ""), + (r"(?<\>.)", "u"), + ("(?)", ""), + ("(?=a){1}", "u"), + ("(?!a){1}", "u"), + (r"[\d-\D]", "u"), + ("[", ""), + ("[", "v"), + ("[[", "v"), + ("[[]", "v"), + ("[z-a]", ""), + (r"[a-c]]", "u"), + ( + r"^([a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķ-ĸĺļľŀłńņň-ʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌ-ƍƒƕƙ-ƛƞơƣƥƨƪ-ƫƭưƴƶƹ-ƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜ-ǝǟǡǣǥǧǩǫǭǯ-ǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿ-ɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐ-ϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻ-ϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎ-ӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣա-ևᴀ-ᴫᵢ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶ-ᾷιῂ-ῄῆ-ῇῐ-ΐῖ-ῗῠ-ῧῲ-ῴῶ-ῷⁱⁿℊℎ-ℏℓℯℴℹℼ-ℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥ-ⱦⱨⱪⱬⱱⱳ-ⱴⱶ-ⱼⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ-ⳤⴀ-ⴥꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌff-stﬓ-ﬗa-z]|\ud801[\udc28-\udc4f]|\ud835[\udc1a-\udc33\udc4e-\udc54\udc56-\udc67\udc82-\udc9b\udcb6-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udccf\udcea-\udd03\udd1e-\udd37\udd52-\udd6b\udd86-\udd9f\uddba-\uddd3\uddee-\ude07\ude22-\ude3b\ude56-\ude6f\ude8a-\udea5\udec2-\udeda\udedc-\udee1\udefc-\udf14\udf16-\udf1b\udf36-\udf4e\udf50-\udf55\udf70-\udf88\udf8a-\udf8f\udfaa-\udfc2\udfc4-\udfc9\udfcb])$", + "", + ), + (r"[[\d-\D]]", "v"), + (r"[a&&b--c]", "v"), + (r"[a--b&&c]", "v"), + (r"[\q{]", "v"), + (r"[\q{\a}]", "v"), + // ES2025 --- + // Duplicate named capturing groups + (r"(?.)(?.)", ""), + (r"(?.(?..))", "u"), + ("(?)|(?)(?)", ""), + ("(((((((?.)))))))(?)", ""), + ("(?:(?a)|(?b))(?c)", ""), + ("(?a)(?:(?b)|(?c))", ""), + ("(?:(?:(?a)|(?b)))(?c)", ""), + ("(?:(?:(?a)|(?b))|(?:))(?c)", ""), + // Modifiers + (r"(?a:.)", ""), + (r"(?-S:.)", ""), + (r"(?-:.)", ""), + (r"(?iM:.)", ""), + (r"(?imms:.)", ""), + (r"(?-sI:.)", ""), + (r"(?ii-s:.)", ""), + (r"(?i-msm:.)", ""), + (r"(?i", ""), + (r"(?i-", ""), + (r"(?i-s", ""), + ] { + assert!( + LiteralParser::new(pattern_text, Some(flags_text), Options::default()) + .parse() + .is_err(), + "/{pattern_text}/{flags_text} should fail to parse, but passed!" + ); + } + } + + #[test] + fn should_fail_early_errors() { + for (pattern_text, flags_text, is_err) in &[ + // No tests for 4,294,967,295 left parens + (r"(?..)(?..)", "", true), + (r"a{2,1}", "", true), + (r"(?)\k", "", true), + (r"()\2", "u", true), + (r"[a-\d]", "u", true), + (r"[\d-z]", "u", true), + (r"[\d-\d]", "u", true), + (r"[z-a]", "", true), + (r"\u{110000}", "u", true), + (r"(?<\uD800\uDBFF>)", "", true), + (r"\u{0}\u{110000}", "u", true), + (r"(?)", "", true), + (r"\p{Foo=Bar}", "u", true), + (r"\p{Foo}", "u", true), + (r"\p{Basic_Emoji}", "u", true), + (r"\P{Basic_Emoji}", "v", true), + (r"[^\p{Basic_Emoji}]", "v", true), + (r"[[^\p{Basic_Emoji}]]", "v", true), + (r"[^\q{}]", "v", true), + (r"[[^\q{}]]", "v", true), + (r"[[^\q{ng}]]", "v", true), + (r"[[^\q{a|}]]", "v", true), + (r"[[^\q{ng}\q{o|k}]]", "v", true), + (r"[[^\q{o|k}\q{ng}\q{o|k}]]", "v", true), + (r"[[^\q{o|k}\q{o|k}\q{ng}]]", "v", true), + (r"[[^\q{}&&\q{ng}]]", "v", true), + (r"[[^\q{ng}&&\q{o|k}]]", "v", false), + (r"[[^\q{ng}&&\q{o|k}&&\q{ng}]]", "v", false), + (r"[[^\q{ng}--\q{o|k}]]", "v", true), + (r"[[^\q{o|k}--\q{ng}]]", "v", false), + (r"[[z-a]]", "v", true), + (r"[[[[[^[[[[\q{ng}]]]]]]]]]", "v", true), + (r"[^[[[[[[[[[[[[[[[[\q{ng}]]]]]]]]]]]]]]]]]", "v", true), + // ES2025 --- + // Duplicated named capture groups + ("(?:(?a)|(?b))(?c)", "", true), + ("(?:(?a)|(?b))(?c)", "", false), + ("(?a)(?:(?b)|(?c))", "", true), + ("(?a)|(?:(?b)|(?c))", "", false), + // Modifiers + (r"(?ii:.)", "", true), + (r"(?-ss:.)", "", true), + (r"(?im-im:.)", "", true), + ] { + assert_eq!( + LiteralParser::new(pattern_text, Some(flags_text), Options::default()) + .parse() + .is_err(), + *is_err, + "/{pattern_text}/{flags_text} should fail with early error, but passed!" + ); + } + } + + #[test] + fn should_handle_empty() { + let pattern1 = LiteralParser::new("", None, Options::default()) + .parse() + .unwrap(); + let pattern2 = ConstructorParser::new("''", None, Options::default()) + .parse() + .unwrap(); + + assert_eq!(pattern1.body.body[0].body.len(), 1); + assert_eq!(pattern2.body.body[0].body.len(), 1); + } + + #[test] + fn should_handle_unicode() { + let source_text = "このEmoji🥹の数が変わる"; + + for (flags_text, expected) in [(None, 15), (Some("u"), 14), (Some("v"), 14)] { + let pattern = LiteralParser::new(source_text, flags_text, Options::default()) + .parse() + .unwrap(); + assert_eq!(pattern.body.body[0].body.len(), expected); + } + } + + #[test] + fn span_offset() { + let pattern_text = "Adjust span but should have no side effect for parsing"; + let ret1 = LiteralParser::new( + pattern_text, + None, + Options { + pattern_span_offset: 0, + flags_span_offset: 0, + }, + ) + .parse() + .unwrap(); + let ret2 = LiteralParser::new( + pattern_text, + None, + Options { + pattern_span_offset: 123, + flags_span_offset: 456, + }, + ) + .parse() + .unwrap(); + + assert_ne!(ret1.span, ret2.span); + assert_eq!(ret1.to_string(), ret2.to_string()); + } + + #[test] + fn string_literal() { + let source_text = r"RegExp('Invalid! -> \u{1234568} <-')"; + let err = ConstructorParser::new( + &source_text[7..35], + None, + Options { + pattern_span_offset: 7, + ..Options::default() + }, + ) + .parse(); + assert!(err.is_err()); + // println!("{:?}", err.unwrap_err().with_source_code(source_text)); + + let ret1 = LiteralParser::new(r"\d{4}-\d{2}-\d{2}", Some("vi"), Options::default()) + .parse() + .unwrap(); + let ret2 = + ConstructorParser::new(r"'\\d{4}-\\d{2}-\\d{2}'", Some("'vi'"), Options::default()) + .parse() + .unwrap(); + assert_eq!(ret1.to_string(), ret2.to_string()); + } +} diff --git a/crates/swc_ecma_regexp/src/parser/parser_impl.rs b/crates/swc_ecma_regexp/src/parser/parser_impl.rs new file mode 100644 index 000000000000..1d0fedb9c65f --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/parser_impl.rs @@ -0,0 +1,124 @@ +use super::{ + flags_parser::FlagsParser, pattern_parser::PatternParser, reader::Reader, + span_factory::SpanFactory, +}; +use crate::{ + ast, + diagnostics::{self, Result}, + options::Options, +}; + +/// Regular expression parser for `/literal/` usage. +/// - `pattern_text`: the text between `/` and `/` +/// - `flags_text`: the text after the second `/` +pub struct LiteralParser<'a> { + pattern_text: &'a str, + flags_text: Option<&'a str>, + options: Options, +} + +impl<'a> LiteralParser<'a> { + pub fn new(pattern_text: &'a str, flags_text: Option<&'a str>, options: Options) -> Self { + Self { + pattern_text, + flags_text, + options, + } + } + + pub fn parse(self) -> Result { + let parse_string_literal = false; + let Options { + pattern_span_offset, + flags_span_offset, + } = self.options; + + let (unicode_mode, unicode_sets_mode) = if let Some(flags_text) = self.flags_text { + let reader = Reader::initialize(flags_text, true, parse_string_literal)?; // For literal, never expect to throw + + FlagsParser::new(reader, flags_span_offset).parse()? + } else { + (false, false) + }; + + let pattern_text = if self.pattern_text.is_empty() { + "(?:)" + } else { + self.pattern_text + }; + let reader = Reader::initialize(pattern_text, unicode_mode, parse_string_literal)?; // For literal, never expect to throw + + PatternParser::new( + reader, + (unicode_mode, unicode_sets_mode), + pattern_span_offset, + ) + .parse() + } +} + +/// Regular expression parser for `new RegExp("constrocutor")` usage. +/// - `pattern_text`: the string literal text as 1st argument of `RegExp` +/// constructor +/// - `flags_text`: the string literal text as 2nd argument of `RegExp` +/// constructor +/// +/// String literal text should be in the form of `'...'` or `"..."` and may +/// contain escape sequences. +pub struct ConstructorParser<'a> { + pattern_text: &'a str, + flags_text: Option<&'a str>, + options: Options, +} + +impl<'a> ConstructorParser<'a> { + pub fn new(pattern_text: &'a str, flags_text: Option<&'a str>, options: Options) -> Self { + Self { + pattern_text, + flags_text, + options, + } + } + + pub fn parse(self) -> Result { + let parse_string_literal = true; + let Options { + pattern_span_offset, + flags_span_offset, + } = self.options; + + let (unicode_mode, unicode_sets_mode) = if let Some(flags_text) = self.flags_text { + let reader = + Reader::initialize(flags_text, true, parse_string_literal).map_err(|_| { + let span_start = flags_span_offset; + #[expect(clippy::cast_possible_truncation)] + let span_end = flags_span_offset + flags_text.len() as u32; + diagnostics::invalid_input(SpanFactory::span_from_u32(span_start, span_end)) + })?; + + FlagsParser::new(reader, self.options.flags_span_offset).parse()? + } else { + (false, false) + }; + + let pattern_text = if matches!(self.pattern_text, r#""""# | "''") { + r#""(?:)""# + } else { + self.pattern_text + }; + let reader = + Reader::initialize(pattern_text, unicode_mode, parse_string_literal).map_err(|_| { + let span_start = pattern_span_offset; + #[expect(clippy::cast_possible_truncation)] + let span_end = pattern_span_offset + pattern_text.len() as u32; + diagnostics::invalid_input(SpanFactory::span_from_u32(span_start, span_end)) + })?; + + PatternParser::new( + reader, + (unicode_mode, unicode_sets_mode), + pattern_span_offset, + ) + .parse() + } +} diff --git a/crates/swc_ecma_regexp/src/parser/pattern_parser/character.rs b/crates/swc_ecma_regexp/src/parser/pattern_parser/character.rs new file mode 100644 index 000000000000..8cf81aa2e0ff --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/pattern_parser/character.rs @@ -0,0 +1,140 @@ +// ``` +// SyntaxCharacter :: one of +// ^ $ \ . * + ? ( ) [ ] { } | +// ``` +pub fn is_syntax_character(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| { + matches!( + ch, + '^' | '$' | '\\' | '.' | '*' | '+' | '?' | '(' | ')' | '[' | ']' | '{' | '}' | '|' + ) + }) +} + +// ``` +// ClassSetSyntaxCharacter :: one of +// ( ) [ ] { } / - \ | +// ``` +pub fn is_class_set_syntax_character(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| { + matches!( + ch, + '(' | ')' | '[' | ']' | '{' | '}' | '/' | '-' | '\\' | '|' + ) + }) +} + +// ``` +// ClassSetReservedDoublePunctuator :: one of +// && !! ## $$ %% ** ++ ,, .. :: ;; << == >> ?? @@ ^^ `` ~~ +// ``` +pub fn is_class_set_reserved_double_punctuator(cp1: u32, cp2: u32) -> bool { + char::from_u32(cp1).is_some_and(|ch1| { + char::from_u32(cp2).is_some_and(|ch2| { + matches!( + (ch1, ch2), + ('&', '&') + | ('!', '!') + | ('#', '#') + | ('$', '$') + | ('%', '%') + | ('*', '*') + | ('+', '+') + | (',', ',') + | ('.', '.') + | (':', ':') + | (';', ';') + | ('<', '<') + | ('=', '=') + | ('>', '>') + | ('?', '?') + | ('@', '@') + | ('^', '^') + | ('`', '`') + | ('~', '~') + ) + }) + }) +} + +// ``` +// ClassSetReservedPunctuator :: one of +// & - ! # % , : ; < = > @ ` ~ +// ``` +pub fn is_class_set_reserved_punctuator(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| { + matches!( + ch, + '&' | '-' | '!' | '#' | '%' | ',' | ':' | ';' | '<' | '=' | '>' | '@' | '`' | '~' + ) + }) +} + +pub fn is_decimal_digit(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| ch.is_ascii_digit()) +} + +pub fn is_octal_digit(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| ch.is_ascii_digit() && ch < '8') +} + +pub fn is_valid_unicode(cp: u32) -> bool { + (0..=0x0010_ffff).contains(&cp) +} + +// ``` +// UnicodePropertyNameCharacter :: +// AsciiLetter +// _ +// ``` +pub fn is_unicode_property_name_character(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| ch.is_ascii_alphabetic() || ch == '_') +} + +// ``` +// UnicodePropertyValueCharacter :: +// UnicodePropertyNameCharacter +// DecimalDigit +// ``` +pub fn is_unicode_property_value_character(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| ch.is_ascii_alphanumeric() || ch == '_') +} + +pub fn is_unicode_id_start(cp: u32) -> bool { + char::from_u32(cp).is_some_and(unicode_id_start::is_id_start) +} + +pub fn is_unicode_id_continue(cp: u32) -> bool { + char::from_u32(cp).is_some_and(unicode_id_start::is_id_continue) +} + +pub fn is_identifier_start_char(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| unicode_id_start::is_id_start(ch) || ch == '$' || ch == '_') +} + +pub fn is_identifier_part_char(cp: u32) -> bool { + char::from_u32(cp).is_some_and(|ch| unicode_id_start::is_id_continue(ch) || ch == '$') +} + +pub fn map_control_escape(cp: u32) -> Option { + match char::from_u32(cp) { + Some('f') => Some(0x0c), + Some('n') => Some(0x0a), + Some('r') => Some(0x0d), + Some('t') => Some(0x09), + Some('v') => Some(0x0b), + _ => None, + } +} + +pub fn map_c_ascii_letter(cp: u32) -> Option { + char::from_u32(cp) + .filter(char::is_ascii_alphabetic) + .map(|_| cp % 0x20) +} + +pub fn map_hex_digit(cp: u32) -> Option { + char::from_u32(cp) + .filter(char::is_ascii_hexdigit) + .and_then(|c| c.to_digit(16)) +} diff --git a/crates/swc_ecma_regexp/src/parser/pattern_parser/mod.rs b/crates/swc_ecma_regexp/src/parser/pattern_parser/mod.rs new file mode 100644 index 000000000000..e1bb146ee2b2 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/pattern_parser/mod.rs @@ -0,0 +1,6 @@ +mod character; +mod pattern_parser_impl; +mod state; +mod unicode_property; + +pub use pattern_parser_impl::PatternParser; diff --git a/crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs b/crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs new file mode 100644 index 000000000000..6d977347c3b6 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/pattern_parser/pattern_parser_impl.rs @@ -0,0 +1,2413 @@ +use std::vec; + +use diagnostics::Result; +use swc_atoms::Atom as SpanAtom; + +use crate::{ + ast, diagnostics, + parser::{ + pattern_parser::{character, state::State, unicode_property}, + reader::Reader, + span_factory::SpanFactory, + }, + surrogate_pair, +}; + +pub struct PatternParser<'a> { + reader: Reader<'a>, + state: State, + span_factory: SpanFactory, +} + +impl<'a> PatternParser<'a> { + pub fn new( + reader: Reader<'a>, + (unicode_mode, unicode_sets_mode): (bool, bool), + span_offset: u32, + ) -> Self { + Self { + reader, + state: State::new(unicode_mode, unicode_sets_mode), + span_factory: SpanFactory::new(span_offset), + } + } + + pub fn parse(mut self) -> Result { + // Pre parse whole pattern to collect: + // - the number of (named|unnamed) capturing groups + // - For `\1` in `\1()` to be handled as indexed reference + // - names of named capturing groups + // - For `\k`, `\k(?)` to be handled as early error in + // `+NamedCaptureGroups` + // + // NOTE: It means that this perform 2 loops for every cases. + // - Pros: Code is simple enough and easy to understand + // - Cons: 1st pass is completely useless if the pattern does not contain any + // capturing groups + // We may re-consider this if we need more performance rather than simplicity. + let checkpoint = self.reader.checkpoint(); + + // [SS:EE] Pattern :: Disjunction + // It is a Syntax Error if Pattern contains two or more GroupSpecifiers for + // which the CapturingGroupName of GroupSpecifier is the same. + self.state + .initialize_with_parsing(&mut self.reader) + .map_err(|offsets| { + diagnostics::duplicated_capturing_group_names( + offsets + .iter() + .map(|&(start, end)| self.span_factory.create(start, end)) + .collect(), + ) + })?; + self.reader.rewind(checkpoint); + + // [SS:EE] Pattern :: Disjunction + // It is a Syntax Error if CountLeftCapturingParensWithin(Pattern) ≥ 2**32 - 1. + // + // If this is greater than `u32::MAX`, it is memory overflow, though. + // But I never seen such a gigantic pattern with 4,294,967,295 parens! + if u32::MAX == self.state.num_of_capturing_groups { + return Err(diagnostics::too_may_capturing_groups( + self.span_factory.create(0, 0), + )); + } + + // Let's start parsing! + let span_start = self.reader.offset(); + let disjunction = self.parse_disjunction()?; + + if self.reader.peek().is_some() { + let span_start = self.reader.offset(); + return Err(diagnostics::parse_pattern_incomplete( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + Ok(ast::Pattern { + span: self.span_factory.create(span_start, self.reader.offset()), + body: disjunction, + }) + } + + // ``` + // Disjunction[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups] :: + // Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] + // Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] | Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] + // ``` + fn parse_disjunction(&mut self) -> Result { + let span_start = self.reader.offset(); + + let mut body = vec![]; + loop { + body.push(self.parse_alternative()?); + + if !self.reader.eat('|') { + break; + } + } + + Ok(ast::Disjunction { + span: self.span_factory.create(span_start, self.reader.offset()), + body, + }) + } + + // ``` + // Alternative[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups] :: + // [empty] + // Alternative[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] Term[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] + // ``` + fn parse_alternative(&mut self) -> Result { + let span_start = self.reader.offset(); + + let mut body = vec![]; + while let Some(term) = self.parse_term()? { + body.push(term); + } + + Ok(ast::Alternative { + span: self.span_factory.create(span_start, self.reader.offset()), + body, + }) + } + + // ``` + // Term[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups] :: + // [+UnicodeMode] Assertion[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] + // [+UnicodeMode] Atom[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] Quantifier + // [+UnicodeMode] Atom[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] + // [~UnicodeMode] QuantifiableAssertion[?NamedCaptureGroups] Quantifier + // [~UnicodeMode] Assertion[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] + // [~UnicodeMode] ExtendedAtom[?NamedCaptureGroups] Quantifier + // [~UnicodeMode] ExtendedAtom[?NamedCaptureGroups] + // ``` + // (Annex B) + fn parse_term(&mut self) -> Result> { + // [+UnicodeMode] Assertion + // [+UnicodeMode] Atom Quantifier + // [+UnicodeMode] Atom + if self.state.unicode_mode { + if let Some(assertion) = self.parse_assertion()? { + return Ok(Some(assertion)); + } + + let span_start = self.reader.offset(); + return match (self.parse_atom()?, self.consume_quantifier()?) { + (Some(atom), Some(((min, max), greedy))) => { + Ok(Some(ast::Term::Quantifier(Box::new(ast::Quantifier { + span: self.span_factory.create(span_start, self.reader.offset()), + greedy, + min, + max, + body: atom, + })))) + } + (Some(atom), None) => Ok(Some(atom)), + (None, Some(_)) => Err(diagnostics::lone_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + "Atom", + )), + (None, None) => Ok(None), + }; + } + + // [~UnicodeMode] QuantifiableAssertion Quantifier + // [~UnicodeMode] Assertion + // [~UnicodeMode] ExtendedAtom Quantifier + // [~UnicodeMode] ExtendedAtom + let span_start = self.reader.offset(); + if let Some(assertion) = self.parse_assertion()? { + // `QuantifiableAssertion` = (Negative)Lookahead: `(?=...)` or `(?!...)` + if let ast::Term::LookAroundAssertion(look_around) = &assertion { + if matches!( + look_around.kind, + ast::LookAroundAssertionKind::Lookahead + | ast::LookAroundAssertionKind::NegativeLookahead + ) { + if let Some(((min, max), greedy)) = self.consume_quantifier()? { + return Ok(Some(ast::Term::Quantifier(Box::new(ast::Quantifier { + span: self.span_factory.create(span_start, self.reader.offset()), + greedy, + min, + max, + body: assertion, + })))); + } + } + } + + return Ok(Some(assertion)); + } + + match (self.parse_extended_atom()?, self.consume_quantifier()?) { + (Some(extended_atom), Some(((min, max), greedy))) => { + Ok(Some(ast::Term::Quantifier(Box::new(ast::Quantifier { + span: self.span_factory.create(span_start, self.reader.offset()), + min, + max, + greedy, + body: extended_atom, + })))) + } + (Some(extended_atom), None) => Ok(Some(extended_atom)), + (None, Some(_)) => Err(diagnostics::lone_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + "ExtendedAtom", + )), + (None, None) => Ok(None), + } + } + + // ``` + // Assertion[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups] :: + // ^ + // $ + // \b + // \B + // [+UnicodeMode] (?= Disjunction[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // [+UnicodeMode] (?! Disjunction[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // [~UnicodeMode] QuantifiableAssertion[?NamedCaptureGroups] + // (?<= Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? Result> { + let span_start = self.reader.offset(); + + let kind = if self.reader.eat('^') { + Some(ast::BoundaryAssertionKind::Start) + } else if self.reader.eat('$') { + Some(ast::BoundaryAssertionKind::End) + } else if self.reader.eat2('\\', 'b') { + Some(ast::BoundaryAssertionKind::Boundary) + } else if self.reader.eat2('\\', 'B') { + Some(ast::BoundaryAssertionKind::NegativeBoundary) + } else { + None + }; + + if let Some(kind) = kind { + return Ok(Some(ast::Term::BoundaryAssertion(Box::new( + ast::BoundaryAssertion { + span: self.span_factory.create(span_start, self.reader.offset()), + kind, + }, + )))); + } + + let kind = if self.reader.eat3('(', '?', '=') { + Some(ast::LookAroundAssertionKind::Lookahead) + } else if self.reader.eat3('(', '?', '!') { + Some(ast::LookAroundAssertionKind::NegativeLookahead) + } else if self.reader.eat4('(', '?', '<', '=') { + Some(ast::LookAroundAssertionKind::Lookbehind) + } else if self.reader.eat4('(', '?', '<', '!') { + Some(ast::LookAroundAssertionKind::NegativeLookbehind) + } else { + None + }; + + if let Some(kind) = kind { + let disjunction = self.parse_disjunction()?; + + if !self.reader.eat(')') { + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "lookaround assertion", + )); + } + + return Ok(Some(ast::Term::LookAroundAssertion(Box::new( + ast::LookAroundAssertion { + span: self.span_factory.create(span_start, self.reader.offset()), + kind, + body: disjunction, + }, + )))); + } + + Ok(None) + } + + // ``` + // Atom[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups] :: + // PatternCharacter + // . + // \ AtomEscape[?UnicodeMode, ?NamedCaptureGroups] + // CharacterClass[?UnicodeMode, ?UnicodeSetsMode] + // ( GroupSpecifier[?UnicodeMode][opt] Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers - RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // ``` + fn parse_atom(&mut self) -> Result> { + let span_start = self.reader.offset(); + + // PatternCharacter + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| !character::is_syntax_character(cp)) + { + self.reader.advance(); + + return Ok(Some(ast::Term::Character(Box::new(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: cp, + })))); + } + + // . + if self.reader.eat('.') { + return Ok(Some(ast::Term::Dot(ast::Dot { + span: self.span_factory.create(span_start, self.reader.offset()), + }))); + } + + // \ AtomEscape[?UnicodeMode, ?NamedCaptureGroups] + if self.reader.eat('\\') { + if let Some(atom_escape) = self.parse_atom_escape(span_start)? { + return Ok(Some(atom_escape)); + } + } + + // CharacterClass[?UnicodeMode, ?UnicodeSetsMode] + if let Some(character_class) = self.parse_character_class()? { + return Ok(Some(ast::Term::CharacterClass(Box::new(character_class)))); + } + + // ( GroupSpecifier[?UnicodeMode][opt] Disjunction[?UnicodeMode, + // ?UnicodeSetsMode, ?NamedCaptureGroups] ) ( Disjunction[?UnicodeMode, + // ?UnicodeSetsMode, ?NamedCaptureGroups] ) + if let Some(capturing_group) = self.parse_capturing_group()? { + return Ok(Some(ast::Term::CapturingGroup(Box::new(capturing_group)))); + } + + // (?: Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, + // ?NamedCaptureGroups] ) (? RegularExpressionModifiers - + // RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, + // ?NamedCaptureGroups] ) + if let Some(ignore_group) = self.parse_ignore_group()? { + return Ok(Some(ast::Term::IgnoreGroup(Box::new(ignore_group)))); + } + + Ok(None) + } + + // ``` + // ExtendedAtom[NamedCaptureGroups] :: + // . + // \ AtomEscape[~UnicodeMode, ?NamedCaptureGroups] + // \ [lookahead = c] + // CharacterClass[~UnicodeMode, ~UnicodeSetsMode] + // ( GroupSpecifier[~UnicodeMode][opt] Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers - RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // InvalidBracedQuantifier + // ExtendedPatternCharacter + // ``` + fn parse_extended_atom(&mut self) -> Result> { + let span_start = self.reader.offset(); + + // . + if self.reader.eat('.') { + return Ok(Some(ast::Term::Dot(ast::Dot { + span: self.span_factory.create(span_start, self.reader.offset()), + }))); + } + + if self.reader.eat('\\') { + // \ AtomEscape[~UnicodeMode, ?NamedCaptureGroups] + if let Some(atom_escape) = self.parse_atom_escape(span_start)? { + return Ok(Some(atom_escape)); + } + + // \ [lookahead = c] + if self.reader.peek().filter(|&cp| cp == 'c' as u32).is_some() { + return Ok(Some(ast::Term::Character(Box::new(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: '\\' as u32, + })))); + } + + return Err(diagnostics::invalid_extended_atom_escape( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + // CharacterClass[~UnicodeMode, ~UnicodeSetsMode] + if let Some(character_class) = self.parse_character_class()? { + return Ok(Some(ast::Term::CharacterClass(Box::new(character_class)))); + } + + // ( GroupSpecifier[?UnicodeMode][opt] Disjunction[?UnicodeMode, + // ?UnicodeSetsMode, ?NamedCaptureGroups] ) ( Disjunction[?UnicodeMode, + // ?UnicodeSetsMode, ?NamedCaptureGroups] ) + if let Some(capturing_group) = self.parse_capturing_group()? { + return Ok(Some(ast::Term::CapturingGroup(Box::new(capturing_group)))); + } + + // (?: Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, + // ?NamedCaptureGroups] ) (? RegularExpressionModifiers - + // RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, + // ?NamedCaptureGroups] ) + if let Some(ignore_group) = self.parse_ignore_group()? { + return Ok(Some(ast::Term::IgnoreGroup(Box::new(ignore_group)))); + } + + // InvalidBracedQuantifier + let span_start = self.reader.offset(); + if self.consume_quantifier()?.is_some() { + // [SS:EE] ExtendedAtom :: InvalidBracedQuantifier + // It is a Syntax Error if any source text is matched by this production. + // (Annex B) + return Err(diagnostics::invalid_braced_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + // ExtendedPatternCharacter + if let Some(cp) = self.consume_extended_pattern_character() { + return Ok(Some(ast::Term::Character(Box::new(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: cp, + })))); + } + + Ok(None) + } + + // ``` + // AtomEscape[UnicodeMode, NamedCaptureGroups] :: + // [+UnicodeMode] DecimalEscape + // [~UnicodeMode] DecimalEscape but only if the CapturingGroupNumber of DecimalEscape is ≤ CountLeftCapturingParensWithin(the Pattern containing DecimalEscape) + // CharacterClassEscape[?UnicodeMode] + // CharacterEscape[?UnicodeMode, ?NamedCaptureGroups] + // [+NamedCaptureGroups] k GroupName[?UnicodeMode] + // ``` + // (Annex B) + fn parse_atom_escape(&mut self, span_start: u32) -> Result> { + let checkpoint = self.reader.checkpoint(); + + // DecimalEscape: \1 means indexed reference + if let Some(index) = self.consume_decimal_escape()? { + if self.state.unicode_mode { + // [SS:EE] AtomEscape :: DecimalEscape + // It is a Syntax Error if the CapturingGroupNumber of DecimalEscape is strictly + // greater than CountLeftCapturingParensWithin(the Pattern containing + // AtomEscape). + if self.state.num_of_capturing_groups < index { + return Err(diagnostics::invalid_indexed_reference( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(ast::Term::IndexedReference(Box::new( + ast::IndexedReference { + span: self.span_factory.create(span_start, self.reader.offset()), + index, + }, + )))); + } + + if index <= self.state.num_of_capturing_groups { + return Ok(Some(ast::Term::IndexedReference(Box::new( + ast::IndexedReference { + span: self.span_factory.create(span_start, self.reader.offset()), + index, + }, + )))); + } + + self.reader.rewind(checkpoint); + } + + // CharacterClassEscape: \d, \p{...} + if let Some(character_class_escape) = self.parse_character_class_escape(span_start) { + return Ok(Some(ast::Term::CharacterClassEscape(Box::new( + character_class_escape, + )))); + } + if let Some(unicode_property_escape) = + self.parse_character_class_escape_unicode(span_start)? + { + return Ok(Some(ast::Term::UnicodePropertyEscape(Box::new( + unicode_property_escape, + )))); + } + + // CharacterEscape: \n, \cM, \0, etc... + if let Some(character_escape) = self.parse_character_escape(span_start)? { + return Ok(Some(ast::Term::Character(Box::new(character_escape)))); + } + + // k GroupName: \k means named reference + if self.state.named_capture_groups && self.reader.eat('k') { + if let Some(name) = self.consume_group_name()? { + // [SS:EE] AtomEscape :: k GroupName + // It is a Syntax Error if GroupSpecifiersThatMatch(GroupName) is empty. + if !self.state.capturing_group_names.contains(&name) { + return Err(diagnostics::empty_group_specifier( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(ast::Term::NamedReference(Box::new( + ast::NamedReference { + span: self.span_factory.create(span_start, self.reader.offset()), + name, + }, + )))); + } + + return Err(diagnostics::invalid_named_reference( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + Ok(None) + } + + // ``` + // CharacterClassEscape :: + // d + // D + // s + // S + // w + // W + // ``` + fn parse_character_class_escape( + &mut self, + span_start: u32, + ) -> Option { + let kind = if self.reader.eat('d') { + ast::CharacterClassEscapeKind::D + } else if self.reader.eat('D') { + ast::CharacterClassEscapeKind::NegativeD + } else if self.reader.eat('s') { + ast::CharacterClassEscapeKind::S + } else if self.reader.eat('S') { + ast::CharacterClassEscapeKind::NegativeS + } else if self.reader.eat('w') { + ast::CharacterClassEscapeKind::W + } else if self.reader.eat('W') { + ast::CharacterClassEscapeKind::NegativeW + } else { + return None; + }; + + Some(ast::CharacterClassEscape { + span: self.span_factory.create(span_start, self.reader.offset()), + kind, + }) + } + + // ``` + // CharacterClassEscape[UnicodeMode] :: + // [+UnicodeMode] p{ UnicodePropertyValueExpression } + // [+UnicodeMode] P{ UnicodePropertyValueExpression } + // ``` + fn parse_character_class_escape_unicode( + &mut self, + span_start: u32, + ) -> Result> { + if !self.state.unicode_mode { + return Ok(None); + } + + let negative = if self.reader.eat('p') { + false + } else if self.reader.eat('P') { + true + } else { + return Ok(None); + }; + + if self.reader.eat('{') { + if let Some((name, value, strings)) = + self.consume_unicode_property_value_expression()? + { + if self.reader.eat('}') { + // [SS:EE] CharacterClassEscape :: P{ UnicodePropertyValueExpression } + // It is a Syntax Error if MayContainStrings of the + // UnicodePropertyValueExpression is true. MayContainStrings + // is true + // - if the UnicodePropertyValueExpression is LoneUnicodePropertyNameOrValue + // - and it is binary property of strings(can be true only with + // `UnicodeSetsMode`) + if negative && strings { + return Err(diagnostics::invalid_unicode_property_name_negative_strings( + self.span_factory.create(span_start, self.reader.offset()), + name.as_str(), + )); + } + + return Ok(Some(ast::UnicodePropertyEscape { + span: self.span_factory.create(span_start, self.reader.offset()), + negative, + strings, + name, + value, + })); + } + } + } + + Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "unicode property escape", + )) + } + + // ``` + // CharacterEscape[UnicodeMode, NamedCaptureGroups] :: + // ControlEscape + // c AsciiLetter + // 0 [lookahead ∉ DecimalDigit] + // HexEscapeSequence + // RegExpUnicodeEscapeSequence[?UnicodeMode] + // [~UnicodeMode] LegacyOctalEscapeSequence + // IdentityEscape[?UnicodeMode, ?NamedCaptureGroups] + // ``` + // (Annex B) + fn parse_character_escape(&mut self, span_start: u32) -> Result> { + // e.g. \n + if let Some(cp) = self.reader.peek().and_then(character::map_control_escape) { + self.reader.advance(); + + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::SingleEscape, + value: cp, + })); + } + + // e.g. \cM + let checkpoint = self.reader.checkpoint(); + if self.reader.eat('c') { + if let Some(cp) = self.reader.peek().and_then(character::map_c_ascii_letter) { + self.reader.advance(); + + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::ControlLetter, + value: cp, + })); + } + self.reader.rewind(checkpoint); + } + + // e.g. \0 + if self.reader.peek().filter(|&cp| cp == '0' as u32).is_some() + && self + .reader + .peek2() + .filter(|&cp| character::is_decimal_digit(cp)) + .is_none() + { + self.reader.advance(); + + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Null, + value: 0x00, + })); + } + + // e.g. \x41 + if self.reader.eat('x') { + if let Some(cp) = self.consume_fixed_hex_digits(2) { + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::HexadecimalEscape, + value: cp, + })); + } + self.reader.rewind(checkpoint); + } + + // e.g. \u{1f600} + if let Some(cp) = self.consume_reg_exp_unicode_escape_sequence(self.state.unicode_mode)? { + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::UnicodeEscape, + value: cp, + })); + } + + // e.g. \1, \00, \000 + if !self.state.unicode_mode { + if let Some(cp) = self.consume_legacy_octal_escape_sequence() { + let span = self.span_factory.create(span_start, self.reader.offset()); + // Keep original digits for `to_string()` + // Otherwise `\0022`(octal \002 + symbol 2) will be `\22`(octal \22) + let digits = span.hi.0 - span.lo.0 - 1; // -1 for '\' + + return Ok(Some(ast::Character { + span, + kind: (match digits { + 3 => ast::CharacterKind::Octal3, + 2 => ast::CharacterKind::Octal2, + _ => ast::CharacterKind::Octal1, + }), + value: cp, + })); + } + } + + // e.g. \. + if let Some(cp) = self.consume_identity_escape() { + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Identifier, + value: cp, + })); + } + + Ok(None) + } + + // ``` + // CharacterClass[UnicodeMode, UnicodeSetsMode] :: + // [ [lookahead ≠ ^] ClassContents[?UnicodeMode, ?UnicodeSetsMode] ] + // [^ ClassContents[?UnicodeMode, ?UnicodeSetsMode] ] + // ``` + fn parse_character_class(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if self.reader.eat('[') { + let negative = self.reader.eat('^'); + let (kind, body) = self.parse_class_contents()?; + + if self.reader.eat(']') { + let strings = PatternParser::may_contain_strings_in_class_contents(kind, &body); + + // [SS:EE] CharacterClass :: [^ ClassContents ] + // It is a Syntax Error if MayContainStrings of the ClassContents is true. + if negative && strings { + return Err(diagnostics::invalid_character_class( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(ast::CharacterClass { + span: self.span_factory.create(span_start, self.reader.offset()), + negative, + kind, + strings, + body, + })); + } + + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "character class", + )); + } + + Ok(None) + } + + // ``` + // ClassContents[UnicodeMode, UnicodeSetsMode] :: + // [empty] + // [~UnicodeSetsMode] NonemptyClassRanges[?UnicodeMode] + // [+UnicodeSetsMode] ClassSetExpression + // ``` + fn parse_class_contents( + &mut self, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + // [empty] + if self.reader.peek().filter(|&cp| cp == ']' as u32).is_some() + // Unterminated + || self.reader.peek().is_none() + { + return Ok((ast::CharacterClassContentsKind::Union, vec![])); + } + + // [+UnicodeSetsMode] ClassSetExpression + if self.state.unicode_sets_mode { + return self.parse_class_set_expression(); + } + + // [~UnicodeSetsMode] NonemptyClassRanges[?UnicodeMode] + self.parse_nonempty_class_ranges() + } + + // ``` + // NonemptyClassRanges[UnicodeMode] :: + // ClassAtom[?UnicodeMode] + // ClassAtom[?UnicodeMode] NonemptyClassRangesNoDash[?UnicodeMode] + // ClassAtom[?UnicodeMode] - ClassAtom[?UnicodeMode] ClassContents[?UnicodeMode, ~UnicodeSetsMode] + // + // NonemptyClassRangesNoDash[UnicodeMode] :: + // ClassAtom[?UnicodeMode] + // ClassAtomNoDash[?UnicodeMode] NonemptyClassRangesNoDash[?UnicodeMode] + // ClassAtomNoDash[?UnicodeMode] - ClassAtom[?UnicodeMode] ClassContents[?UnicodeMode, ~UnicodeSetsMode] + // ``` + fn parse_nonempty_class_ranges( + &mut self, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + let mut body = vec![]; + + loop { + let range_span_start = self.reader.offset(); + + let Some(class_atom) = self.parse_class_atom()? else { + break; + }; + + let span_start = self.reader.offset(); + if !self.reader.eat('-') { + // ClassAtom[?UnicodeMode] + body.push(class_atom); + continue; + } + + let dash = ast::CharacterClassContents::Character(Box::new(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: '-' as u32, + })); + + let Some(class_atom_to) = self.parse_class_atom()? else { + // ClassAtom[?UnicodeMode] NonemptyClassRangesNoDash[?UnicodeMode] + // => ClassAtom[?UnicodeMode] ClassAtom[?UnicodeMode] + // => ClassAtom[?UnicodeMode] - + body.push(class_atom); + body.push(dash); + continue; + }; + + // ClassAtom[?UnicodeMode] - ClassAtom[?UnicodeMode] ClassContents[?UnicodeMode, + // ~UnicodeSetsMode] If both sides are characters, it is a range. + if let ( + ast::CharacterClassContents::Character(from), + ast::CharacterClassContents::Character(to), + ) = (&class_atom, &class_atom_to) + { + // [SS:EE] NonemptyClassRanges :: ClassAtom - ClassAtom ClassContents + // [SS:EE] NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom + // ClassContents It is a Syntax Error if IsCharacterClass of the + // first ClassAtom is false, IsCharacterClass of the second ClassAtom is false, + // and the CharacterValue of the first ClassAtom is strictly greater than the + // CharacterValue of the second ClassAtom. + if to.value < from.value { + return Err(diagnostics::character_class_range_out_of_order( + self.span_factory.create(span_start, self.reader.offset()), + "class atom", + )); + } + + body.push(ast::CharacterClassContents::CharacterClassRange(Box::new( + ast::CharacterClassRange { + span: from.span.with_hi(to.span.hi), + min: *from.clone(), + max: *to.clone(), + }, + ))); + continue; + } + + // If not, it is just a union of characters. + + // [SS:EE] NonemptyClassRanges :: ClassAtom - ClassAtom ClassContents + // [SS:EE] NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom + // ClassContents It is a Syntax Error if IsCharacterClass of the + // first ClassAtom is true or IsCharacterClass of the second ClassAtom is true + // and this production has a [UnicodeMode] parameter. (Annex B) + if self.state.unicode_mode { + return Err(diagnostics::character_class_range_invalid_atom( + self.span_factory + .create(range_span_start, self.reader.offset()), + )); + } + + body.push(class_atom); + body.push(dash); + body.push(class_atom_to); + } + + // [empty] is already covered by the caller, but for sure + debug_assert!(!body.is_empty()); + + Ok((ast::CharacterClassContentsKind::Union, body)) + } + + // ``` + // ClassAtom[UnicodeMode] :: + // - + // ClassAtomNoDash[?UnicodeMode] + // ``` + fn parse_class_atom(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if self.reader.eat('-') { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: '-' as u32, + }, + )))); + } + + self.parse_class_atom_no_dash() + } + + // ``` + // ClassAtomNoDash[UnicodeMode, NamedCaptureGroups] :: + // SourceCharacter but not one of \ or ] or - + // \ ClassEscape[?UnicodeMode, ?NamedCaptureGroups] + // \ [lookahead = c] + // ``` + // (Annex B) + fn parse_class_atom_no_dash(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| cp != '\\' as u32 && cp != ']' as u32 && cp != '-' as u32) + { + self.reader.advance(); + + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: cp, + }, + )))); + } + + if self.reader.eat('\\') { + if self.reader.peek().filter(|&cp| cp == 'c' as u32).is_some() { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: '\\' as u32, + }, + )))); + } + + if let Some(class_escape) = self.parse_class_escape(span_start)? { + return Ok(Some(class_escape)); + } + + return Err(diagnostics::invalid_class_atom( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + Ok(None) + } + + // ``` + // ClassEscape[UnicodeMode, NamedCaptureGroups] :: + // b + // [+UnicodeMode] - + // [~UnicodeMode] c ClassControlLetter + // CharacterClassEscape[?UnicodeMode] + // CharacterEscape[?UnicodeMode, ?NamedCaptureGroups] + // + // ClassControlLetter :: + // DecimalDigit + // _ + // ``` + // (Annex B) + fn parse_class_escape( + &mut self, + span_start: u32, + ) -> Result> { + // b + if self.reader.eat('b') { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::SingleEscape, + value: 0x08, + }, + )))); + } + + // [+UnicodeMode] - + if self.state.unicode_mode && self.reader.eat('-') { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::SingleEscape, + value: '-' as u32, + }, + )))); + } + + // [~UnicodeMode] c ClassControlLetter + if !self.state.unicode_mode { + let checkpoint = self.reader.checkpoint(); + + if self.reader.eat('c') { + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| character::is_decimal_digit(cp) || cp == '-' as u32) + { + self.reader.advance(); + + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::ControlLetter, + value: cp, + }, + )))); + } + + self.reader.rewind(checkpoint); + } + } + + // CharacterClassEscape[?UnicodeMode] + if let Some(character_class_escape) = self.parse_character_class_escape(span_start) { + return Ok(Some(ast::CharacterClassContents::CharacterClassEscape( + Box::new(character_class_escape), + ))); + } + if let Some(unicode_property_escape) = + self.parse_character_class_escape_unicode(span_start)? + { + return Ok(Some(ast::CharacterClassContents::UnicodePropertyEscape( + Box::new(unicode_property_escape), + ))); + } + + // CharacterEscape[?UnicodeMode, ?NamedCaptureGroups] + if let Some(character_escape) = self.parse_character_escape(span_start)? { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + character_escape, + )))); + } + + Ok(None) + } + + // ``` + // ClassSetExpression :: + // ClassUnion + // ClassIntersection + // ClassSubtraction + // ``` + fn parse_class_set_expression( + &mut self, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + // ClassUnion :: ClassSetRange ClassUnion[opt] + if let Some(class_set_range) = self.parse_class_set_range()? { + return self.parse_class_set_union(class_set_range); + } + + if let Some(class_set_operand) = self.parse_class_set_operand()? { + // ClassIntersection + if self.reader.peek().filter(|&cp| cp == '&' as u32).is_some() + && self.reader.peek2().filter(|&cp| cp == '&' as u32).is_some() + { + return self.parse_class_set_intersection(class_set_operand); + } + // ClassSubtraction + if self.reader.peek().filter(|&cp| cp == '-' as u32).is_some() + && self.reader.peek2().filter(|&cp| cp == '-' as u32).is_some() + { + return self.parse_class_set_subtraction(class_set_operand); + } + + // ClassUnion :: ClassSetOperand ClassUnion[opt] + return self.parse_class_set_union(class_set_operand); + } + + let span_start = self.reader.offset(); + Err(diagnostics::empty_class_set_expression( + self.span_factory.create(span_start, self.reader.offset()), + )) + } + + // ``` + // ClassUnion :: + // ClassSetRange ClassUnion[opt] + // ClassSetOperand ClassUnion[opt] + // ``` + fn parse_class_set_union( + &mut self, + class_set_range_or_class_set_operand: ast::CharacterClassContents, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + let mut body = vec![]; + body.push(class_set_range_or_class_set_operand); + + loop { + if let Some(class_set_range) = self.parse_class_set_range()? { + body.push(class_set_range); + continue; + } + if let Some(class_set_operand) = self.parse_class_set_operand()? { + body.push(class_set_operand); + continue; + } + + break; + } + + Ok((ast::CharacterClassContentsKind::Union, body)) + } + + // ``` + // ClassIntersection :: + // ClassSetOperand && [lookahead ≠ &] ClassSetOperand + // ClassIntersection && [lookahead ≠ &] ClassSetOperand + // ``` + fn parse_class_set_intersection( + &mut self, + class_set_operand: ast::CharacterClassContents, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + let mut body = vec![]; + body.push(class_set_operand); + + loop { + if self.reader.peek().filter(|&cp| cp == ']' as u32).is_some() { + break; + } + + if self.reader.eat2('&', '&') { + let span_start = self.reader.offset(); + if self.reader.eat('&') { + return Err(diagnostics::class_intersection_unexpected_ampersand( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + if let Some(class_set_operand) = self.parse_class_set_operand()? { + body.push(class_set_operand); + continue; + } + } + + let span_start = self.reader.offset(); + return Err(diagnostics::class_set_expression_invalid_character( + self.span_factory.create(span_start, self.reader.offset()), + "class intersection", + )); + } + + Ok((ast::CharacterClassContentsKind::Intersection, body)) + } + + // ``` + // ClassSubtraction :: + // ClassSetOperand -- ClassSetOperand + // ClassSubtraction -- ClassSetOperand + // ``` + fn parse_class_set_subtraction( + &mut self, + class_set_operand: ast::CharacterClassContents, + ) -> Result<( + ast::CharacterClassContentsKind, + Vec, + )> { + let mut body = vec![]; + body.push(class_set_operand); + + loop { + if self.reader.peek().filter(|&cp| cp == ']' as u32).is_some() { + break; + } + + if self.reader.eat2('-', '-') { + if let Some(class_set_operand) = self.parse_class_set_operand()? { + body.push(class_set_operand); + continue; + } + } + + let span_start = self.reader.offset(); + return Err(diagnostics::class_set_expression_invalid_character( + self.span_factory.create(span_start, self.reader.offset()), + "class subtraction", + )); + } + + Ok((ast::CharacterClassContentsKind::Subtraction, body)) + } + + // ``` + // ClassSetRange :: + // ClassSetCharacter - ClassSetCharacter + // ``` + fn parse_class_set_range(&mut self) -> Result> { + let checkpoint = self.reader.checkpoint(); + + if let Some(class_set_character) = self.parse_class_set_character()? { + if self.reader.eat('-') { + if let Some(class_set_character_to) = self.parse_class_set_character()? { + // [SS:EE] ClassSetRange :: ClassSetCharacter - ClassSetCharacter + // It is a Syntax Error if the CharacterValue of the first ClassSetCharacter is + // strictly greater than the CharacterValue of the second ClassSetCharacter. + if class_set_character_to.value < class_set_character.value { + return Err(diagnostics::character_class_range_out_of_order( + class_set_character + .span + .with_hi(class_set_character_to.span.hi), + "class set", + )); + } + + return Ok(Some(ast::CharacterClassContents::CharacterClassRange( + Box::new(ast::CharacterClassRange { + span: class_set_character + .span + .with_hi(class_set_character_to.span.hi), + min: class_set_character, + max: class_set_character_to, + }), + ))); + } + } + } + self.reader.rewind(checkpoint); + + Ok(None) + } + + // ``` + // ClassSetOperand :: + // NestedClass + // ClassStringDisjunction + // ClassSetCharacter + // + // ClassStringDisjunction :: + // \q{ ClassStringDisjunctionContents } + // ``` + fn parse_class_set_operand(&mut self) -> Result> { + if let Some(nested_class) = self.parse_nested_class()? { + return Ok(Some(nested_class)); + } + + let span_start = self.reader.offset(); + if self.reader.eat3('\\', 'q', '{') { + let (class_string_disjunction_contents, strings) = + self.parse_class_string_disjunction_contents()?; + + if self.reader.eat('}') { + return Ok(Some(ast::CharacterClassContents::ClassStringDisjunction( + Box::new(ast::ClassStringDisjunction { + span: self.span_factory.create(span_start, self.reader.offset()), + strings, + body: class_string_disjunction_contents, + }), + ))); + } + + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "class string disjunction", + )); + } + + if let Some(class_set_character) = self.parse_class_set_character()? { + return Ok(Some(ast::CharacterClassContents::Character(Box::new( + class_set_character, + )))); + } + + Ok(None) + } + + // ``` + // NestedClass :: + // [ [lookahead ≠ ^] ClassContents[+UnicodeMode, +UnicodeSetsMode] ] + // [^ ClassContents[+UnicodeMode, +UnicodeSetsMode] ] + // \ CharacterClassEscape[+UnicodeMode] + // ``` + fn parse_nested_class(&mut self) -> Result> { + let span_start = self.reader.offset(); + + // [ [lookahead ≠ ^] ClassContents[+UnicodeMode, +UnicodeSetsMode] ] + // [^ ClassContents[+UnicodeMode, +UnicodeSetsMode] ] + if self.reader.eat('[') { + let negative = self.reader.eat('^'); + let (kind, body) = self.parse_class_contents()?; + + if self.reader.eat(']') { + let strings = PatternParser::may_contain_strings_in_class_contents(kind, &body); + + // [SS:EE] NestedClass :: [^ ClassContents ] + // It is a Syntax Error if MayContainStrings of the ClassContents is true. + if negative && strings { + return Err(diagnostics::character_class_contents_invalid_operands( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(ast::CharacterClassContents::NestedCharacterClass( + Box::new(ast::CharacterClass { + span: self.span_factory.create(span_start, self.reader.offset()), + negative, + kind, + strings, + body, + }), + ))); + } + + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "nested class", + )); + } + + // \ CharacterClassEscape[+UnicodeMode] + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + if self.reader.eat('\\') { + if let Some(character_class_escape) = self.parse_character_class_escape(span_start) { + return Ok(Some(ast::CharacterClassContents::CharacterClassEscape( + Box::new(character_class_escape), + ))); + } + if let Some(unicode_property_escape) = + self.parse_character_class_escape_unicode(span_start)? + { + return Ok(Some(ast::CharacterClassContents::UnicodePropertyEscape( + Box::new(unicode_property_escape), + ))); + } + + self.reader.rewind(checkpoint); + } + + Ok(None) + } + + // ``` + // ClassStringDisjunctionContents :: + // ClassString + // ClassString | ClassStringDisjunctionContents + // ``` + // Returns: (ClassStringDisjunctionContents, contain_strings) + fn parse_class_string_disjunction_contents(&mut self) -> Result<(Vec, bool)> { + let mut body = vec![]; + let mut strings = false; + + loop { + let class_string = self.parse_class_string()?; + + // Propagate strings flag + if class_string.strings { + strings = true; + } + body.push(class_string); + + if !self.reader.eat('|') { + break; + } + } + + if body.is_empty() { + strings = true; + } + + Ok((body, strings)) + } + + // ``` + // ClassString :: + // [empty] + // NonEmptyClassString + // + // NonEmptyClassString :: + // ClassSetCharacter NonEmptyClassString[opt] + // ``` + // Returns (ClassString, contain_strings) + fn parse_class_string(&mut self) -> Result { + let span_start = self.reader.offset(); + + let mut body = vec![]; + while let Some(class_set_character) = self.parse_class_set_character()? { + body.push(class_set_character); + } + + // `true` if empty or contains 2 or more characters + let strings = body.len() != 1; + + Ok(ast::ClassString { + span: self.span_factory.create(span_start, self.reader.offset()), + strings, + body, + }) + } + + // ``` + // ClassSetCharacter :: + // [lookahead ∉ ClassSetReservedDoublePunctuator] SourceCharacter but not ClassSetSyntaxCharacter + // \ CharacterEscape[+UnicodeMode] + // \ ClassSetReservedPunctuator + // \b + // ``` + fn parse_class_set_character(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if let (Some(cp1), Some(cp2)) = (self.reader.peek(), self.reader.peek2()) { + if !character::is_class_set_reserved_double_punctuator(cp1, cp2) + && !character::is_class_set_syntax_character(cp1) + { + self.reader.advance(); + + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Symbol, + value: cp1, + })); + } + } + + let checkpoint = self.reader.checkpoint(); + if self.reader.eat('\\') { + if let Some(character_escape) = self.parse_character_escape(span_start)? { + return Ok(Some(character_escape)); + } + + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| character::is_class_set_reserved_punctuator(cp)) + { + self.reader.advance(); + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::Identifier, + value: cp, + })); + } + + if self.reader.eat('b') { + return Ok(Some(ast::Character { + span: self.span_factory.create(span_start, self.reader.offset()), + kind: ast::CharacterKind::SingleEscape, + value: 0x08, + })); + } + + self.reader.rewind(checkpoint); + } + + Ok(None) + } + + // ``` + // ( GroupSpecifier[?UnicodeMode][opt] Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // + // GroupSpecifier[UnicodeMode] :: + // ? GroupName[?UnicodeMode] + // ``` + fn parse_capturing_group(&mut self) -> Result> { + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + + if self.reader.eat('(') { + let mut group_name = None; + + // GroupSpecifier is optional, but if it exists, `?` is also required + if self.reader.eat('?') { + let Some(name) = self.consume_group_name()? else { + // If GroupSpecifier is not found, fallback to `parse_ignore_group()` branch + self.reader.rewind(checkpoint); + return Ok(None); + }; + + group_name = Some(name); + } + + let disjunction = self.parse_disjunction()?; + if self.reader.eat(')') { + return Ok(Some(ast::CapturingGroup { + span: self.span_factory.create(span_start, self.reader.offset()), + name: group_name, + body: disjunction, + })); + } + + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "capturing group", + )); + } + + Ok(None) + } + + // ``` + // (?: Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // (? RegularExpressionModifiers - RegularExpressionModifiers : Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] ) + // ``` + fn parse_ignore_group(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if self.reader.eat2('(', '?') { + let modifiers = if self.reader.peek().filter(|&cp| cp == ':' as u32).is_some() { + None + } else { + self.parse_modifiers()? + }; + + if self.reader.eat(':') { + let disjunction = self.parse_disjunction()?; + + if !self.reader.eat(')') { + return Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "ignore group", + )); + } + + return Ok(Some(ast::IgnoreGroup { + span: self.span_factory.create(span_start, self.reader.offset()), + modifiers, + body: disjunction, + })); + } + } + + Ok(None) + } + + // ``` + // RegularExpressionModifiers :: + // [empty] + // RegularExpressionModifiers RegularExpressionModifier + // + // RegularExpressionModifier :: one of + // `i` `m` `s` + // ``` + fn parse_modifiers(&mut self) -> Result> { + let span_start = self.reader.offset(); + + let mut enabling = ast::Modifier::empty(); + let mut disabling = ast::Modifier::empty(); + let mut duplicate = false; + + // Enabling + while self + .reader + .peek() + .filter(|&cp| cp == ':' as u32 || cp == '-' as u32) + .is_none() + { + if self.reader.eat('i') { + if enabling.contains(ast::Modifier::I) { + duplicate = true; + } + enabling |= ast::Modifier::I; + continue; + } + if self.reader.eat('m') { + if enabling.contains(ast::Modifier::M) { + duplicate = true; + } + enabling |= ast::Modifier::M; + continue; + } + if self.reader.eat('s') { + if enabling.contains(ast::Modifier::S) { + duplicate = true; + } + enabling |= ast::Modifier::S; + continue; + } + + return Err(diagnostics::unknown_modifiers( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + // Disabling + if self.reader.eat('-') { + while self.reader.peek().filter(|&cp| cp == ':' as u32).is_none() { + if self.reader.eat('i') { + if disabling.contains(ast::Modifier::I) { + duplicate = true; + } + disabling |= ast::Modifier::I; + continue; + } + if self.reader.eat('m') { + if disabling.contains(ast::Modifier::M) { + duplicate = true; + } + disabling |= ast::Modifier::M; + continue; + } + if self.reader.eat('s') { + if disabling.contains(ast::Modifier::S) { + duplicate = true; + } + disabling |= ast::Modifier::S; + continue; + } + + return Err(diagnostics::unknown_modifiers( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + } + + // [SS:EE] Atom :: (? RegularExpressionModifiers : Disjunction ) + // It is a Syntax Error if the source text matched by RegularExpressionModifiers + // contains the same code point more than once. [SS:EE] Atom :: (? + // RegularExpressionModifiers - RegularExpressionModifiers : Disjunction ) + // It is a Syntax Error if the source text matched by the first + // RegularExpressionModifiers and the source text matched by the second + // RegularExpressionModifiers are both empty. It is a Syntax Error if + // the source text matched by the first RegularExpressionModifiers contains the + // same code point more than once. It is a Syntax Error if any code + // point in the source text matched by the first RegularExpressionModifiers is + // also contained in the source text matched by the second + // RegularExpressionModifiers. + if enabling.is_empty() && disabling.is_empty() + || duplicate + || [ast::Modifier::I, ast::Modifier::M, ast::Modifier::S] + .iter() + .any(|&modifier| enabling.contains(modifier) && disabling.contains(modifier)) + { + return Err(diagnostics::invalid_modifiers( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + Ok(Some(ast::Modifiers { + span: self.span_factory.create(span_start, self.reader.offset()), + enabling, + disabling, + })) + } + + // --- + + // ``` + // Quantifier :: + // QuantifierPrefix + // QuantifierPrefix ? + // + // QuantifierPrefix :: + // * + // + + // ? + // { DecimalDigits[~Sep] } + // { DecimalDigits[~Sep] ,} + // { DecimalDigits[~Sep] , DecimalDigits[~Sep] } + // ``` + /// Returns: ((min, max), greedy) + fn consume_quantifier(&mut self) -> Result), bool)>> { + const MAX_QUANTIFIER: u64 = 9_007_199_254_740_991; // 2^53 - 1 + let is_greedy = |reader: &mut Reader| !reader.eat('?'); + + if self.reader.eat('*') { + return Ok(Some(((0, None), is_greedy(&mut self.reader)))); + } + if self.reader.eat('+') { + return Ok(Some(((1, None), is_greedy(&mut self.reader)))); + } + if self.reader.eat('?') { + return Ok(Some(((0, Some(1)), is_greedy(&mut self.reader)))); + } + + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + if self.reader.eat('{') { + if let Some(min) = self.consume_decimal_digits()? { + if self.reader.eat('}') { + if MAX_QUANTIFIER < min { + return Err(diagnostics::too_large_number_in_braced_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(((min, Some(min)), is_greedy(&mut self.reader)))); + } + + if self.reader.eat(',') { + if self.reader.eat('}') { + if MAX_QUANTIFIER < min { + return Err(diagnostics::too_large_number_in_braced_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(((min, None), is_greedy(&mut self.reader)))); + } + + if let Some(max) = self.consume_decimal_digits()? { + if self.reader.eat('}') { + if max < min { + // [SS:EE] QuantifierPrefix :: { DecimalDigits , DecimalDigits } + // It is a Syntax Error if the MV of the first DecimalDigits is + // strictly greater than the MV of the second DecimalDigits. + return Err(diagnostics::braced_quantifier_out_of_order( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + if MAX_QUANTIFIER < min || MAX_QUANTIFIER < max { + return Err(diagnostics::too_large_number_in_braced_quantifier( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(((min, Some(max)), is_greedy(&mut self.reader)))); + } + } + } + } + + self.reader.rewind(checkpoint); + } + + Ok(None) + } + + // ``` + // DecimalEscape :: + // NonZeroDigit DecimalDigits[~Sep][opt] [lookahead ∉ DecimalDigit] + // ``` + fn consume_decimal_escape(&mut self) -> Result> { + let checkpoint = self.reader.checkpoint(); + + if let Some(index) = self.consume_decimal_digits()? { + // \0 is CharacterEscape, not DecimalEscape + if index != 0 { + #[expect(clippy::cast_possible_truncation)] + return Ok(Some(index as u32)); + } + + self.reader.rewind(checkpoint); + } + + Ok(None) + } + + // ``` + // DecimalDigits[Sep] :: + // DecimalDigit + // DecimalDigits[?Sep] DecimalDigit + // [+Sep] DecimalDigits[+Sep] NumericLiteralSeparator DecimalDigit + // ``` + // ([Sep] is disabled for `QuantifierPrefix` and `DecimalEscape`, skip it) + fn consume_decimal_digits(&mut self) -> Result> { + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + + let mut value: u64 = 0; + while let Some(cp) = self + .reader + .peek() + .filter(|&cp| character::is_decimal_digit(cp)) + { + // `- '0' as u32`: convert code point to digit + #[expect(clippy::cast_lossless)] + let d = (cp - '0' as u32) as u64; + + // To prevent panic on overflow cases like `\999999999999999999999`, + // `a{999999999999999999999}` + if let Some(v) = value.checked_mul(10).and_then(|v| v.checked_add(d)) { + value = v; + self.reader.advance(); + } else { + return Err(diagnostics::too_large_number_digits( + self.span_factory.create(span_start, self.reader.offset()), + "decimal", + )); + } + } + + if self.reader.checkpoint() != checkpoint { + return Ok(Some(value)); + } + + Ok(None) + } + + // ``` + // UnicodePropertyValueExpression :: + // UnicodePropertyName = UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + // ``` + /// Returns: `(name, Option, is_strings_related_unicode_property)` + fn consume_unicode_property_value_expression( + &mut self, + ) -> Result, bool)>> { + let checkpoint = self.reader.checkpoint(); + + // UnicodePropertyName=UnicodePropertyValue + if let Some(name) = self.consume_unicode_property_name() { + if self.reader.eat('=') { + let span_start = self.reader.offset(); + + if let Some(value) = self.consume_unicode_property_value() { + // [SS:EE] UnicodePropertyValueExpression :: UnicodePropertyName = + // UnicodePropertyValue It is a Syntax Error if the source + // text matched by UnicodePropertyName is not a Unicode property name or + // property alias listed in the “Property name and aliases” column of Table 65. + // [SS:EE] UnicodePropertyValueExpression :: UnicodePropertyName = + // UnicodePropertyValue It is a Syntax Error if the source + // text matched by UnicodePropertyValue is not a property value or property + // value alias for the Unicode property or property alias given by the source + // text matched by UnicodePropertyName listed in PropertyValueAliases.txt. + if !unicode_property::is_valid_unicode_property(&name, &value) { + return Err(diagnostics::invalid_unicode_property( + self.span_factory.create(span_start, self.reader.offset()), + "name", + )); + } + + return Ok(Some((name, Some(value), false))); + } + } + } + self.reader.rewind(checkpoint); + + let span_start = self.reader.offset(); + // LoneUnicodePropertyNameOrValue + if let Some(name_or_value) = self.consume_unicode_property_value() { + // [SS:EE] UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue + // It is a Syntax Error if the source text matched by + // LoneUnicodePropertyNameOrValue is not a Unicode property value or property + // value alias for the General_Category (gc) property listed in + // PropertyValueAliases.txt, nor a binary property or binary property alias + // listed in the “Property name and aliases” column of Table 66, nor a binary + // property of strings listed in the “Property name” column of Table 67. + if unicode_property::is_valid_unicode_property("General_Category", &name_or_value) { + return Ok(Some(( + "General_Category".into(), + Some(name_or_value), + false, + ))); + } + if unicode_property::is_valid_lone_unicode_property(&name_or_value) { + return Ok(Some((name_or_value, None, false))); + } + // [SS:EE] UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue + // It is a Syntax Error if the enclosing Pattern does not have a + // [UnicodeSetsMode] parameter and the source text matched by + // LoneUnicodePropertyNameOrValue is a binary property of strings listed in the + // “Property name” column of Table 67. + if unicode_property::is_valid_lone_unicode_property_of_strings(&name_or_value) { + if !self.state.unicode_sets_mode { + return Err(diagnostics::invalid_unicode_property_of_strings( + self.span_factory.create(span_start, self.reader.offset()), + name_or_value.as_str(), + )); + } + + return Ok(Some((name_or_value, None, true))); + } + + return Err(diagnostics::invalid_unicode_property( + self.span_factory.create(span_start, self.reader.offset()), + "name and/or value", + )); + } + + Ok(None) + } + + fn consume_unicode_property_name(&mut self) -> Option { + let span_start = self.reader.offset(); + + let checkpoint = self.reader.checkpoint(); + while character::is_unicode_property_name_character(self.reader.peek()?) { + self.reader.advance(); + } + + if checkpoint == self.reader.checkpoint() { + return None; + } + + Some(self.reader.atom(span_start, self.reader.offset())) + } + + fn consume_unicode_property_value(&mut self) -> Option { + let span_start = self.reader.offset(); + + let checkpoint = self.reader.checkpoint(); + while character::is_unicode_property_value_character(self.reader.peek()?) { + self.reader.advance(); + } + + if checkpoint == self.reader.checkpoint() { + return None; + } + + Some(self.reader.atom(span_start, self.reader.offset())) + } + + // ``` + // GroupName[UnicodeMode] :: + // < RegExpIdentifierName[?UnicodeMode] > + // ``` + fn consume_group_name(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if !self.reader.eat('<') { + return Ok(None); + } + + if let Some(group_name) = self.consume_reg_exp_idenfigier_name()? { + if self.reader.eat('>') { + return Ok(Some(group_name)); + } + } + + Err(diagnostics::unterminated_pattern( + self.span_factory.create(span_start, self.reader.offset()), + "capturing group name", + )) + } + + // ``` + // RegExpIdentifierName[UnicodeMode] :: + // RegExpIdentifierStart[?UnicodeMode] + // RegExpIdentifierName[?UnicodeMode] RegExpIdentifierPart[?UnicodeMode] + // ``` + fn consume_reg_exp_idenfigier_name(&mut self) -> Result> { + let span_start = self.reader.offset(); + + if self.consume_reg_exp_idenfigier_start()?.is_some() { + while self.consume_reg_exp_idenfigier_part()?.is_some() {} + return Ok(Some(self.reader.atom(span_start, self.reader.offset()))); + } + + Ok(None) + } + + // ``` + // RegExpIdentifierStart[UnicodeMode] :: + // IdentifierStartChar + // \ RegExpUnicodeEscapeSequence[+UnicodeMode] + // [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate + // ``` + fn consume_reg_exp_idenfigier_start(&mut self) -> Result> { + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| character::is_identifier_start_char(cp)) + { + self.reader.advance(); + return Ok(Some(cp)); + } + + let span_start = self.reader.offset(); + if self.reader.eat('\\') { + if let Some(cp) = self.consume_reg_exp_unicode_escape_sequence(true)? { + // [SS:EE] RegExpIdentifierStart :: \ RegExpUnicodeEscapeSequence + // It is a Syntax Error if the CharacterValue of RegExpUnicodeEscapeSequence is + // not the numeric value of some code point matched by the IdentifierStartChar + // lexical grammar production. + if !character::is_identifier_start_char(cp) { + return Err(diagnostics::invalid_unicode_escape_sequence( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(cp)); + } + + return Err(diagnostics::invalid_unicode_escape_sequence( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + if !self.state.unicode_mode { + let span_start = self.reader.offset(); + + if let Some(lead_surrogate) = self + .reader + .peek() + .filter(|&cp| surrogate_pair::is_lead_surrogate(cp)) + { + if let Some(trail_surrogate) = self + .reader + .peek2() + .filter(|&cp| surrogate_pair::is_trail_surrogate(cp)) + { + self.reader.advance(); + self.reader.advance(); + let cp = + surrogate_pair::combine_surrogate_pair(lead_surrogate, trail_surrogate); + + // [SS:EE] RegExpIdentifierStart :: UnicodeLeadSurrogate UnicodeTrailSurrogate + // It is a Syntax Error if the RegExpIdentifierCodePoint of + // RegExpIdentifierStart is not matched by the UnicodeIDStart lexical grammar + // production. + if !character::is_unicode_id_start(cp) { + return Err(diagnostics::invalid_surrogate_pair( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(cp)); + } + } + } + + Ok(None) + } + + // ``` + // RegExpIdentifierPart[UnicodeMode] :: + // IdentifierPartChar + // \ RegExpUnicodeEscapeSequence[+UnicodeMode] + // [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate + // ``` + fn consume_reg_exp_idenfigier_part(&mut self) -> Result> { + if let Some(cp) = self + .reader + .peek() + .filter(|&cp| character::is_identifier_part_char(cp)) + { + self.reader.advance(); + return Ok(Some(cp)); + } + + let span_start = self.reader.offset(); + if self.reader.eat('\\') { + if let Some(cp) = self.consume_reg_exp_unicode_escape_sequence(true)? { + // [SS:EE] RegExpIdentifierPart :: \ RegExpUnicodeEscapeSequence + // It is a Syntax Error if the CharacterValue of RegExpUnicodeEscapeSequence is + // not the numeric value of some code point matched by the IdentifierPartChar + // lexical grammar production. + if !character::is_identifier_part_char(cp) { + return Err(diagnostics::invalid_unicode_escape_sequence( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(cp)); + } + + return Err(diagnostics::invalid_unicode_escape_sequence( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + if !self.state.unicode_mode { + let span_start = self.reader.offset(); + + if let Some(lead_surrogate) = self + .reader + .peek() + .filter(|&cp| surrogate_pair::is_lead_surrogate(cp)) + { + if let Some(trail_surrogate) = self + .reader + .peek2() + .filter(|&cp| surrogate_pair::is_trail_surrogate(cp)) + { + self.reader.advance(); + self.reader.advance(); + + let cp = + surrogate_pair::combine_surrogate_pair(lead_surrogate, trail_surrogate); + // [SS:EE] RegExpIdentifierPart :: UnicodeLeadSurrogate UnicodeTrailSurrogate + // It is a Syntax Error if the RegExpIdentifierCodePoint of RegExpIdentifierPart + // is not matched by the UnicodeIDContinue lexical grammar production. + if !character::is_unicode_id_continue(cp) { + return Err(diagnostics::invalid_surrogate_pair( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + return Ok(Some(cp)); + } + } + } + + Ok(None) + } + + // ``` + // RegExpUnicodeEscapeSequence[UnicodeMode] :: + // [+UnicodeMode] u HexLeadSurrogate \u HexTrailSurrogate + // [+UnicodeMode] u HexLeadSurrogate + // [+UnicodeMode] u HexTrailSurrogate + // [+UnicodeMode] u HexNonSurrogate + // [~UnicodeMode] u Hex4Digits + // [+UnicodeMode] u{ CodePoint } + // ``` + fn consume_reg_exp_unicode_escape_sequence( + &mut self, + unicode_mode: bool, + ) -> Result> { + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + + if self.reader.eat('u') { + if unicode_mode { + let checkpoint = self.reader.checkpoint(); + + // HexLeadSurrogate + HexTrailSurrogate + if let Some(lead_surrogate) = self + .consume_fixed_hex_digits(4) + .filter(|&cp| surrogate_pair::is_lead_surrogate(cp)) + { + if self.reader.eat2('\\', 'u') { + if let Some(trail_surrogate) = self + .consume_fixed_hex_digits(4) + .filter(|&cp| surrogate_pair::is_trail_surrogate(cp)) + { + return Ok(Some(surrogate_pair::combine_surrogate_pair( + lead_surrogate, + trail_surrogate, + ))); + } + } + } + self.reader.rewind(checkpoint); + + // HexLeadSurrogate + if let Some(lead_surrogate) = self + .consume_fixed_hex_digits(4) + .filter(|&cp| surrogate_pair::is_lead_surrogate(cp)) + { + return Ok(Some(lead_surrogate)); + } + self.reader.rewind(checkpoint); + + // HexTrailSurrogate + if let Some(trail_surrogate) = self + .consume_fixed_hex_digits(4) + .filter(|&cp| surrogate_pair::is_trail_surrogate(cp)) + { + return Ok(Some(trail_surrogate)); + } + self.reader.rewind(checkpoint); + } + + // HexNonSurrogate and Hex4Digits are the same + if let Some(hex_digits) = self.consume_fixed_hex_digits(4) { + return Ok(Some(hex_digits)); + } + + // {CodePoint} + if unicode_mode { + let checkpoint = self.reader.checkpoint(); + + if self.reader.eat('{') { + if let Some(hex_digits) = self + .consume_hex_digits()? + .filter(|&cp| character::is_valid_unicode(cp)) + { + if self.reader.eat('}') { + return Ok(Some(hex_digits)); + } + } + } + self.reader.rewind(checkpoint); + } + + if self.state.unicode_mode { + return Err(diagnostics::invalid_unicode_escape_sequence( + self.span_factory.create(span_start, self.reader.offset()), + )); + } + + self.reader.rewind(checkpoint); + } + + Ok(None) + } + + // ``` + // LegacyOctalEscapeSequence :: + // 0 [lookahead ∈ { 8, 9 }] + // NonZeroOctalDigit [lookahead ∉ OctalDigit] + // ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + // FourToSeven OctalDigit + // ZeroToThree OctalDigit OctalDigit + // ``` + fn consume_legacy_octal_escape_sequence(&mut self) -> Option { + if let Some(first) = self.consume_octal_digit() { + // 0 [lookahead ∈ { 8, 9 }] + if first == 0 + && self + .reader + .peek() + .filter(|&cp| cp == '8' as u32 || cp == '9' as u32) + .is_some() + { + return Some(first); + } + + if let Some(second) = self.consume_octal_digit() { + if let Some(third) = self.consume_octal_digit() { + // ZeroToThree OctalDigit OctalDigit + if first <= 3 { + return Some(first * 64 + second * 8 + third); + } + } + + // ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + // FourToSeven OctalDigit + return Some(first * 8 + second); + } + + // NonZeroOctalDigit [lookahead ∉ OctalDigit] + return Some(first); + } + + None + } + + fn consume_octal_digit(&mut self) -> Option { + let cp = self.reader.peek()?; + + if character::is_octal_digit(cp) { + self.reader.advance(); + // `- '0' as u32`: convert code point to digit + return Some(cp - '0' as u32); + } + + None + } + + // ``` + // IdentityEscape[UnicodeMode, NamedCaptureGroups] :: + // [+UnicodeMode] SyntaxCharacter + // [+UnicodeMode] / + // [~UnicodeMode] SourceCharacterIdentityEscape[?NamedCaptureGroups] + // + // SourceCharacterIdentityEscape[NamedCaptureGroups] :: + // [~NamedCaptureGroups] SourceCharacter but not c + // [+NamedCaptureGroups] SourceCharacter but not one of c or k + // ``` + // (Annex B) + fn consume_identity_escape(&mut self) -> Option { + let cp = self.reader.peek()?; + + if self.state.unicode_mode { + if character::is_syntax_character(cp) || cp == '/' as u32 { + self.reader.advance(); + return Some(cp); + } + return None; + } + + if self.state.named_capture_groups { + if cp != 'c' as u32 && cp != 'k' as u32 { + self.reader.advance(); + return Some(cp); + } + return None; + } + + if cp != 'c' as u32 { + self.reader.advance(); + return Some(cp); + } + + None + } + + // ``` + // ExtendedPatternCharacter :: + // SourceCharacter but not one of ^ $ \ . * + ? ( ) [ | + // ``` + fn consume_extended_pattern_character(&mut self) -> Option { + let cp = self.reader.peek()?; + + if cp == '^' as u32 + || cp == '$' as u32 + || cp == '\\' as u32 + || cp == '.' as u32 + || cp == '*' as u32 + || cp == '+' as u32 + || cp == '?' as u32 + || cp == '(' as u32 + || cp == ')' as u32 + || cp == '[' as u32 + || cp == '|' as u32 + { + return None; + } + + self.reader.advance(); + Some(cp) + } + + fn consume_hex_digits(&mut self) -> Result> { + let span_start = self.reader.offset(); + let checkpoint = self.reader.checkpoint(); + + let mut value: u32 = 0; + while let Some(hex) = self.reader.peek().and_then(character::map_hex_digit) { + // To prevent panic on overflow cases like `\u{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}` + if let Some(v) = value.checked_mul(16).and_then(|v| v.checked_add(hex)) { + value = v; + self.reader.advance(); + } else { + return Err(diagnostics::too_large_number_digits( + self.span_factory.create(span_start, self.reader.offset()), + "hex", + )); + } + } + + if self.reader.checkpoint() != checkpoint { + return Ok(Some(value)); + } + + Ok(None) + } + + fn consume_fixed_hex_digits(&mut self, len: usize) -> Option { + let checkpoint = self.reader.checkpoint(); + + let mut value = 0; + for _ in 0..len { + let Some(hex) = self.reader.peek().and_then(character::map_hex_digit) else { + self.reader.rewind(checkpoint); + return None; + }; + + value = (16 * value) + hex; + self.reader.advance(); + } + + Some(value) + } + + // --- + + fn may_contain_strings_in_class_contents( + kind: ast::CharacterClassContentsKind, + body: &[ast::CharacterClassContents], + ) -> bool { + let may_contain_strings = |item: &ast::CharacterClassContents| match item { + // MayContainStrings is true + // - if ClassContents contains UnicodePropertyValueExpression + // - && UnicodePropertyValueExpression is LoneUnicodePropertyNameOrValue + // - && it is binary property of strings(can be true only with `UnicodeSetsMode`) + ast::CharacterClassContents::UnicodePropertyEscape(item) => item.strings, + // MayContainStrings is true + // - if ClassStringDisjunction is [empty] + // - || if ClassStringDisjunction contains ClassString + // - && ClassString is [empty] + // - || ClassString contains 2 more ClassSetCharacters + ast::CharacterClassContents::ClassStringDisjunction(item) => item.strings, + // MayContainStrings is true + // - if NestedClass has MayContainStrings: true + ast::CharacterClassContents::NestedCharacterClass(item) => item.strings, + _ => false, + }; + + match kind { + // MayContainStrings is true + // - if ClassContents is ClassUnion + // - && ClassUnion has ClassOperands + // - && at least 1 ClassOperand has MayContainStrings: true + ast::CharacterClassContentsKind::Union => body.iter().any(may_contain_strings), + // MayContainStrings is true + // - if ClassContents is ClassIntersection + // - && ClassIntersection has ClassOperands + // - && all ClassOperands have MayContainStrings: true + ast::CharacterClassContentsKind::Intersection => body.iter().all(may_contain_strings), + // MayContainStrings is true + // - if ClassContents is ClassSubtraction + // - && ClassSubtraction has ClassOperands + // - && the first ClassOperand has MayContainStrings: true + ast::CharacterClassContentsKind::Subtraction => { + body.iter().next().is_some_and(may_contain_strings) + } + } + } +} diff --git a/crates/swc_ecma_regexp/src/parser/pattern_parser/state.rs b/crates/swc_ecma_regexp/src/parser/pattern_parser/state.rs new file mode 100644 index 000000000000..021b759ea909 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/pattern_parser/state.rs @@ -0,0 +1,260 @@ +use rustc_hash::{FxHashMap, FxHashSet}; +use swc_atoms::Atom; + +use crate::parser::reader::Reader; + +/// Currently all of properties are read only from outside of this module. +/// Even inside of this module, it is not changed after initialized. +#[derive(Debug)] +pub struct State { + // Mode flags + pub unicode_mode: bool, + pub unicode_sets_mode: bool, + pub named_capture_groups: bool, + // Other states + pub num_of_capturing_groups: u32, + pub capturing_group_names: FxHashSet, +} + +type DuplicatedNamedCapturingGroupOffsets = Vec<(u32, u32)>; + +impl State { + pub fn new(unicode_mode: bool, unicode_sets_mode: bool) -> Self { + Self { + unicode_mode, + unicode_sets_mode, + named_capture_groups: false, + num_of_capturing_groups: 0, + capturing_group_names: FxHashSet::default(), + } + } + + pub fn initialize_with_parsing( + &mut self, + reader: &mut Reader, + ) -> Result<(), DuplicatedNamedCapturingGroupOffsets> { + let (num_of_left_capturing_parens, capturing_group_names) = parse_capturing_groups(reader)?; + + // In Annex B, this is `false` by default. + // It is `true` + // - if `u` or `v` flag is set + // - or if `GroupName` is found in pattern + self.named_capture_groups = + self.unicode_mode || self.unicode_sets_mode || !capturing_group_names.is_empty(); + + self.num_of_capturing_groups = num_of_left_capturing_parens; + self.capturing_group_names = capturing_group_names; + + Ok(()) + } +} + +enum SimpleUnit { + Open, + Close, + Pipe, + GroupName(Atom), +} + +/// Returns: Result<(num_of_left_parens, capturing_group_names), +/// duplicated_named_capturing_group_offsets> +fn parse_capturing_groups<'a>( + reader: &mut Reader<'a>, +) -> Result<(u32, FxHashSet), DuplicatedNamedCapturingGroupOffsets> { + // Count only normal CapturingGroup(named, unnamed) + // (?...), (...) + // IgnoreGroup, and LookaroundAssertions are ignored + // (?:...) + // (?=...), (?!...), (?<=...), (? = FxHashMap::default(); + // At the same time, check duplicates + // If you want to process this most efficiently: + // - define a scope for each Disjunction + // - then check for duplicates for each `|` while inheriting the parent-child + // relationship + // ref. https://source.chromium.org/chromium/chromium/src/+/main:v8/src/regexp/regexp-parser.cc;l=1644 + // However, duplicates are rare in the first place. + // And as long as it works simply, this may be enough. + let mut may_duplicates: FxHashMap = + FxHashMap::default(); + let mut simplified: Vec = vec![]; + + let mut in_escape = false; + let mut in_character_class = false; + while let Some(cp) = reader.peek() { + if in_escape { + in_escape = false; + } else if cp == '\\' as u32 { + in_escape = true; + } else if cp == '[' as u32 { + in_character_class = true; + } else if cp == ']' as u32 { + in_character_class = false; + } else if !in_character_class && cp == '|' as u32 { + simplified.push(SimpleUnit::Pipe); + } else if !in_character_class && cp == ')' as u32 { + simplified.push(SimpleUnit::Close); + } else if !in_character_class && cp == '(' as u32 { + reader.advance(); + + simplified.push(SimpleUnit::Open); + + // Skip IgnoreGroup + if reader.eat2('?', ':') + // Skip LookAroundAssertion + || reader.eat2('?', '=') + || reader.eat2('?', '!') + || reader.eat3('?', '<', '=') + || reader.eat3('?', '<', '!') + { + continue; + } + + // Count named or unnamed capturing groups + num_of_left_capturing_parens += 1; + + // Collect capturing group names + if reader.eat2('?', '<') { + let span_start = reader.offset(); + while let Some(ch) = reader.peek() { + if ch == '>' as u32 { + break; + } + reader.advance(); + } + let span_end = reader.offset(); + + if reader.eat('>') { + let group_name = reader.atom(span_start, span_end); + + simplified.push(SimpleUnit::GroupName(group_name.clone())); + // Check duplicates later + if let Some(last_span) = group_names.get(&group_name) { + let entry = may_duplicates.entry(group_name).or_default(); + entry.push(*last_span); + entry.push((span_start, span_end)); + } else { + group_names.insert(group_name, (span_start, span_end)); + } + + continue; + } + } + + // Unnamed + continue; + } + + reader.advance(); + } + + // Check duplicates and emit error if exists + if !may_duplicates.is_empty() { + // Check must be done for each group name + for (group_name, spans) in may_duplicates { + let iter = simplified.iter().clone(); + + let mut alternative_depth = FxHashSet::default(); + let mut depth = 0_u32; + let mut is_first = true; + + 'outer: for token in iter { + match token { + SimpleUnit::Open => { + depth += 1; + } + SimpleUnit::Close => { + // May panic if the pattern has invalid, unbalanced parens + depth = depth.saturating_sub(1); + } + SimpleUnit::Pipe => { + if !is_first { + alternative_depth.insert(depth); + } + } + SimpleUnit::GroupName(name) => { + // Check target group name only + if *name != group_name { + continue; + } + // Skip the first one, because it is not duplicated + if is_first { + is_first = false; + continue; + } + + // If left outer `|` is found, both can participate + // `|(?)` + // ^ ^ depth: 1 + // ^ depth: 0 + for i in (0..depth).rev() { + if alternative_depth.contains(&i) { + // Remove it, next duplicates requires another `|` + alternative_depth.remove(&i); + continue 'outer; + } + } + + return Err(spans); + } + } + } + } + } + + Ok(( + num_of_left_capturing_parens, + group_names.keys().cloned().collect(), + )) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn count_capturing_groups() { + for (source_text, expected) in [ + ("()", (1, 0)), + (r"\1()", (1, 0)), + ("(foo)", (1, 0)), + ("(foo)(bar)", (2, 0)), + ("(foo(bar))", (2, 0)), + ("(foo)[(bar)]", (1, 0)), + (r"(foo)\(bar\)", (1, 0)), + ("(foo)(?bar)", (2, 1)), + ("(foo)(?=...)(?!...)(?<=...)(?bar)(?baz)", (3, 2)), + ("(?.)(?.)|(?..)|(?.)", (4, 2)), + ("(?.)(?.)|(?:..)|(?.)", (3, 2)), + ] { + let mut reader = Reader::initialize(source_text, true, false).unwrap(); + + let (num_of_left_capturing_parens, capturing_group_names) = + parse_capturing_groups(&mut reader).unwrap(); + + let actual = (num_of_left_capturing_parens, capturing_group_names.len()); + assert_eq!(expected, actual, "{source_text}"); + } + } + + #[test] + fn duplicated_named_capturing_groups() { + for source_text in [ + "(?.)(?..)", + "(?.(?..))", + "|(?.(?..))", + "(?.)|(?.(?..))", + ] { + let mut reader = Reader::initialize(source_text, true, false).unwrap(); + + assert!( + parse_capturing_groups(&mut reader).is_err(), + "{source_text}" + ); + } + } +} diff --git a/crates/swc_ecma_regexp/src/parser/pattern_parser/unicode_property.rs b/crates/swc_ecma_regexp/src/parser/pattern_parser/unicode_property.rs new file mode 100644 index 000000000000..71dfbebc46a9 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/pattern_parser/unicode_property.rs @@ -0,0 +1,362 @@ +use phf::{phf_set, Set}; + +// https://tc39.es/ecma262/2024/multipage/text-processing.html#table-nonbinary-unicode-properties +pub fn is_valid_unicode_property(name: &str, value: &str) -> bool { + if matches!(name, "General_Category" | "gc") { + return GC_PROPERTY_VALUES.contains(value); + } + if matches!(name, "Script" | "sc") { + return SC_PROPERTY_VALUES.contains(value); + } + if matches!(name, "Script_Extensions" | "scx") { + return SC_PROPERTY_VALUES.contains(value) || SCX_PROPERTY_VALUES.contains(value); + } + false +} + +pub fn is_valid_lone_unicode_property(name_or_value: &str) -> bool { + BINARY_UNICODE_PROPERTIES.contains(name_or_value) +} +/// This should be used with `UnicodeSetsMode` +pub fn is_valid_lone_unicode_property_of_strings(name_or_value: &str) -> bool { + BINARY_UNICODE_PROPERTIES_OF_STRINGS.contains(name_or_value) +} + +// spellchecker:off +// # General_Category (gc) +// https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt +static GC_PROPERTY_VALUES: Set<&'static str> = phf_set! { + "C", "Other", + "Cc", "Control", "cntrl", + "Cf", "Format", + "Cn", "Unassigned", + "Co", "Private_Use", + "Cs", "Surrogate", + "L", "Letter", + "LC", "Cased_Letter", + "Ll", "Lowercase_Letter", + "Lm", "Modifier_Letter", + "Lo", "Other_Letter", + "Lt", "Titlecase_Letter", + "Lu", "Uppercase_Letter", + "M", "Mark", "Combining_Mark", + "Mc", "Spacing_Mark", + "Me", "Enclosing_Mark", + "Mn", "Nonspacing_Mark", + "N", "Number", + "Nd", "Decimal_Number", "digit", + "Nl", "Letter_Number", + "No", "Other_Number", + "P", "Punctuation", "punct", + "Pc", "Connector_Punctuation", + "Pd", "Dash_Punctuation", + "Pe", "Close_Punctuation", + "Pf", "Final_Punctuation", + "Pi", "Initial_Punctuation", + "Po", "Other_Punctuation", + "Ps", "Open_Punctuation", + "S", "Symbol", + "Sc", "Currency_Symbol", + "Sk", "Modifier_Symbol", + "Sm", "Math_Symbol", + "So", "Other_Symbol", + "Z", "Separator", + "Zl", "Line_Separator", + "Zp", "Paragraph_Separator", + "Zs", "Space_Separator" +}; + +static SC_PROPERTY_VALUES: Set<&'static str> = phf_set! { + "Adlm", "Adlam", + "Aghb", "Caucasian_Albanian", + "Ahom", + "Arab", "Arabic", + "Armi", "Imperial_Aramaic", + "Armn", "Armenian", + "Avst", "Avestan", + "Bali", "Balinese", + "Bamu", "Bamum", + "Bass", "Bassa_Vah", + "Batk", "Batak", + "Beng", "Bengali", + "Bhks", "Bhaiksuki", + "Bopo", "Bopomofo", + "Brah", "Brahmi", + "Brai", "Braille", + "Bugi", "Buginese", + "Buhd", "Buhid", + "Cakm", "Chakma", + "Cans", "Canadian_Aboriginal", + "Cari", "Carian", + "Cham", + "Cher", "Cherokee", + "Chrs", "Chorasmian", + "Copt", "Coptic", "Qaac", + "Cpmn", "Cypro_Minoan", + "Cprt", "Cypriot", + "Cyrl", "Cyrillic", + "Deva", "Devanagari", + "Diak", "Dives_Akuru", + "Dogr", "Dogra", + "Dsrt", "Deseret", + "Dupl", "Duployan", + "Egyp", "Egyptian_Hieroglyphs", + "Elba", "Elbasan", + "Elym", "Elymaic", + "Ethi", "Ethiopic", + "Gara", "Garay", + "Geor", "Georgian", + "Glag", "Glagolitic", + "Gong", "Gunjala_Gondi", + "Gonm", "Masaram_Gondi", + "Goth", "Gothic", + "Gran", "Grantha", + "Grek", "Greek", + "Gujr", "Gujarati", + "Gukh", "Gurung_Khema", + "Guru", "Gurmukhi", + "Hang", "Hangul", + "Hani", "Han", + "Hano", "Hanunoo", + "Hatr", "Hatran", + "Hebr", "Hebrew", + "Hira", "Hiragana", + "Hluw", "Anatolian_Hieroglyphs", + "Hmng", "Pahawh_Hmong", + "Hmnp", "Nyiakeng_Puachue_Hmong", + "Hrkt", "Katakana_Or_Hiragana", + "Hung", "Old_Hungarian", + "Ital", "Old_Italic", + "Java", "Javanese", + "Kali", "Kayah_Li", + "Kana", "Katakana", + "Kawi", + "Khar", "Kharoshthi", + "Khmr", "Khmer", + "Khoj", "Khojki", + "Kits", "Khitan_Small_Script", + "Knda", "Kannada", + "Krai", "Kirat_Rai", + "Kthi", "Kaithi", + "Lana", "Tai_Tham", + "Laoo", "Lao", + "Latn", "Latin", + "Lepc", "Lepcha", + "Limb", "Limbu", + "Lina", "Linear_A", + "Linb", "Linear_B", + "Lisu", + "Lyci", "Lycian", + "Lydi", "Lydian", + "Mahj", "Mahajani", + "Maka", "Makasar", + "Mand", "Mandaic", + "Mani", "Manichaean", + "Marc", "Marchen", + "Medf", "Medefaidrin", + "Mend", "Mende_Kikakui", + "Merc", "Meroitic_Cursive", + "Mero", "Meroitic_Hieroglyphs", + "Mlym", "Malayalam", + "Modi", + "Mong", "Mongolian", + "Mroo", "Mro", + "Mtei", "Meetei_Mayek", + "Mult", "Multani", + "Mymr", "Myanmar", + "Nagm", "Nag_Mundari", + "Nand", "Nandinagari", + "Narb", "Old_North_Arabian", + "Nbat", "Nabataean", + "Newa", + "Nkoo", "Nko", + "Nshu", "Nushu", + "Ogam", "Ogham", + "Olck", "Ol_Chiki", + "Onao", "Ol_Onal", + "Orkh", "Old_Turkic", + "Orya", "Oriya", + "Osge", "Osage", + "Osma", "Osmanya", + "Ougr", "Old_Uyghur", + "Palm", "Palmyrene", + "Pauc", "Pau_Cin_Hau", + "Perm", "Old_Permic", + "Phag", "Phags_Pa", + "Phli", "Inscriptional_Pahlavi", + "Phlp", "Psalter_Pahlavi", + "Phnx", "Phoenician", + "Plrd", "Miao", + "Prti", "Inscriptional_Parthian", + "Rjng", "Rejang", + "Rohg", "Hanifi_Rohingya", + "Runr", "Runic", + "Samr", "Samaritan", + "Sarb", "Old_South_Arabian", + "Saur", "Saurashtra", + "Sgnw", "SignWriting", + "Shaw", "Shavian", + "Shrd", "Sharada", + "Sidd", "Siddham", + "Sind", "Khudawadi", + "Sinh", "Sinhala", + "Sogd", "Sogdian", + "Sogo", "Old_Sogdian", + "Sora", "Sora_Sompeng", + "Soyo", "Soyombo", + "Sund", "Sundanese", + "Sunu", "Sunuwar", + "Sylo", "Syloti_Nagri", + "Syrc", "Syriac", + "Tagb", "Tagbanwa", + "Takr", "Takri", + "Tale", "Tai_Le", + "Talu", "New_Tai_Lue", + "Taml", "Tamil", + "Tang", "Tangut", + "Tavt", "Tai_Viet", + "Telu", "Telugu", + "Tfng", "Tifinagh", + "Tglg", "Tagalog", + "Thaa", "Thaana", + "Thai", + "Tibt", "Tibetan", + "Tirh", "Tirhuta", + "Tnsa", "Tangsa", + "Todr", "Todhri", + "Toto", + "Tutg", "Tulu_Tigalari", + "Ugar", "Ugaritic", + "Vaii", "Vai", + "Vith", "Vithkuqi", + "Wara", "Warang_Citi", + "Wcho", "Wancho", + "Xpeo", "Old_Persian", + "Xsux", "Cuneiform", + "Yezi", "Yezidi", + "Yiii", "Yi", + "Zanb", "Zanabazar_Square", + "Zinh", "Inherited", "Qaai", + "Zyyy", "Common", + "Zzzz", "Unknown", +}; + +static SCX_PROPERTY_VALUES: Set<&'static str> = phf_set! { + // Empty +}; + +// Table 66: Binary Unicode property aliases +// https://tc39.es/ecma262/2024/multipage/text-processing.html#table-binary-unicode-properties +static BINARY_UNICODE_PROPERTIES: Set<&'static str> = phf_set! { + "ASCII", + "ASCII_Hex_Digit", + "AHex", + "Alphabetic", + "Alpha", + "Any", + "Assigned", + "Bidi_Control", + "Bidi_C", + "Bidi_Mirrored", + "Bidi_M", + "Case_Ignorable", + "CI", + "Cased", + "Changes_When_Casefolded", + "CWCF", + "Changes_When_Casemapped", + "CWCM", + "Changes_When_Lowercased", + "CWL", + "Changes_When_NFKC_Casefolded", + "CWKCF", + "Changes_When_Titlecased", + "CWT", + "Changes_When_Uppercased", + "CWU", + "Dash", + "Default_Ignorable_Code_Point", + "DI", + "Deprecated", + "Dep", + "Diacritic", + "Dia", + "Emoji", + "Emoji_Component", + "EComp", + "Emoji_Modifier", + "EMod", + "Emoji_Modifier_Base", + "EBase", + "Emoji_Presentation", + "EPres", + "Extended_Pictographic", + "ExtPict", + "Extender", + "Ext", + "Grapheme_Base", + "Gr_Base", + "Grapheme_Extend", + "Gr_Ext", + "Hex_Digit", + "Hex", + "IDS_Binary_Operator", + "IDSB", + "IDS_Trinary_Operator", + "IDST", + "ID_Continue", + "IDC", + "ID_Start", + "IDS", + "Ideographic", + "Ideo", + "Join_Control", + "Join_C", + "Logical_Order_Exception", + "LOE", + "Lowercase", + "Lower", + "Math", + "Noncharacter_Code_Point", + "NChar", + "Pattern_Syntax", + "Pat_Syn", + "Pattern_White_Space", + "Pat_WS", + "Quotation_Mark", + "QMark", + "Radical", + "Regional_Indicator", + "RI", + "Sentence_Terminal", + "STerm", + "Soft_Dotted", + "SD", + "Terminal_Punctuation", + "Term", + "Unified_Ideograph", + "UIdeo", + "Uppercase", + "Upper", + "Variation_Selector", + "VS", + "White_Space", + "space", + "XID_Continue", + "XIDC", + "XID_Start", + "XIDS", +}; + +// Table 67: Binary Unicode properties of strings +// https://tc39.es/ecma262/2024/multipage/text-processing.html#table-binary-unicode-properties-of-strings +static BINARY_UNICODE_PROPERTIES_OF_STRINGS: Set<&'static str> = phf_set! { + "Basic_Emoji", + "Emoji_Keycap_Sequence", + "RGI_Emoji_Modifier_Sequence", + "RGI_Emoji_Flag_Sequence", + "RGI_Emoji_Tag_Sequence", + "RGI_Emoji_ZWJ_Sequence", + "RGI_Emoji", +}; +// spellchecker:on diff --git a/crates/swc_ecma_regexp/src/parser/reader/mod.rs b/crates/swc_ecma_regexp/src/parser/reader/mod.rs new file mode 100644 index 000000000000..17ea7251d640 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/mod.rs @@ -0,0 +1,159 @@ +mod reader_impl; +mod string_literal_parser; + +pub use reader_impl::Reader; + +#[cfg(test)] +mod test { + use crate::parser::reader::Reader; + + #[test] + fn should_fail() { + for reader in [ + Reader::initialize(r#""Unterminated"#, true, true), + Reader::initialize(r#""Unterminated"#, false, true), + Reader::initialize("'Unterminated!", true, true), + Reader::initialize("'Unterminated!", false, true), + ] { + assert!(reader.is_err()); + } + } + + #[test] + fn should_pass_basic() { + for mut reader in [ + Reader::initialize("RegExp!", true, false).unwrap(), + Reader::initialize("RegExp!", false, false).unwrap(), + Reader::initialize(r#""RegExp!""#, true, true).unwrap(), + Reader::initialize(r#""RegExp!""#, false, true).unwrap(), + Reader::initialize("'RegExp!'", true, true).unwrap(), + Reader::initialize("'RegExp!'", false, true).unwrap(), + ] { + assert_eq!(reader.peek(), Some('R' as u32)); + assert_eq!(reader.peek2(), Some('e' as u32)); + assert!(reader.eat('R')); + assert!(!reader.eat('R')); + assert!(reader.eat('e')); + assert!(reader.eat('g')); + assert!(reader.eat('E')); + assert!(!reader.eat3('E', 'x', 'p')); + assert!(reader.eat2('x', 'p')); + + let checkpoint = reader.checkpoint(); + assert_eq!(reader.peek(), Some('!' as u32)); + reader.advance(); + reader.advance(); + + reader.rewind(checkpoint); + assert_eq!(reader.peek(), Some('!' as u32)); + + assert!(reader.eat('!')); + assert_eq!(reader.peek(), None); + } + } + + #[test] + fn should_pass_unicode() { + let source_text = "𠮷野家は👈🏻あっち"; + + let mut unicode_reader = Reader::initialize(source_text, true, false).unwrap(); + assert!(unicode_reader.eat('𠮷')); // Can eat + assert!(unicode_reader.eat2('野', '家')); + let checkpoint = unicode_reader.checkpoint(); + assert!(unicode_reader.eat('は')); + unicode_reader.advance(); // Emoji + unicode_reader.advance(); // Skin tone + assert!(unicode_reader.eat('あ')); + assert_eq!(unicode_reader.peek(), Some('っ' as u32)); + assert_eq!(unicode_reader.peek2(), Some('ち' as u32)); + unicode_reader.rewind(checkpoint); + assert!(unicode_reader.eat('は')); + + let mut legacy_reader = Reader::initialize(source_text, false, false).unwrap(); + assert!(!legacy_reader.eat('𠮷')); // Can not eat + legacy_reader.advance(); + assert!(!legacy_reader.eat('𠮷')); // Also can not + legacy_reader.advance(); + assert!(legacy_reader.eat('野')); + assert!(legacy_reader.eat('家')); + let checkpoint = unicode_reader.checkpoint(); + assert!(legacy_reader.eat('は')); + legacy_reader.advance(); // Emoji(High surrogate) + legacy_reader.advance(); // Emoji(Low surrogate) + legacy_reader.advance(); // Skin tone(High surrogate) + legacy_reader.advance(); // Skin tone(Low surrogate) + assert_eq!(legacy_reader.peek(), Some('あ' as u32)); + assert_eq!(legacy_reader.peek2(), Some('っ' as u32)); + assert!(legacy_reader.eat3('あ', 'っ', 'ち')); + legacy_reader.rewind(checkpoint); + assert!(legacy_reader.eat('は')); + } + + #[test] + fn span_position() { + let source_text1 = r"^ Catch😎 @@ symbols🇺🇳 $"; + let reader1 = Reader::initialize(source_text1, true, false).unwrap(); + + let source_text2 = format!("\"{source_text1}\""); + let reader2 = Reader::initialize(&source_text2, true, true).unwrap(); + + for mut reader in [reader1, reader2] { + while reader.peek() != Some('^' as u32) { + reader.advance(); + } + let s1 = reader.offset(); + assert!(reader.eat('^')); + let e1 = reader.offset(); + assert_eq!(&reader.atom(s1, e1), "^"); + + while reader.peek() != Some('@' as u32) { + reader.advance(); + } + let s2 = reader.offset(); + assert!(reader.eat('@')); + assert!(reader.eat('@')); + let e2 = reader.offset(); + assert_eq!(&reader.atom(s2, e2), "@@"); + + while reader.peek() != Some('$' as u32) { + reader.advance(); + } + let s3 = reader.offset(); + assert!(reader.eat('$')); + let e3 = reader.offset(); + + assert_eq!(&reader.atom(s3, e3), "$"); + } + } + + #[test] + fn handle_escapes() { + let mut reader1 = Reader::initialize("こんにちWorld2024", true, false).unwrap(); + let mut reader2 = Reader::initialize( + r#""\u3053\u3093\u306B\u3061\u0057\u006F\u0072\u006C\u0064\u0032\u0030\u0032\u0034""#, + false, + true, + ) + .unwrap(); + + assert_eq!(reader1.eat('こ'), reader2.eat('こ')); + assert_eq!(reader1.eat('ん'), reader2.eat('ん')); + + loop { + match (reader1.peek(), reader2.peek()) { + (None, None) => { + break; // All passed + } + (Some(cp1), Some(cp2)) if cp1 == cp2 => { + reader1.advance(); + reader2.advance(); + // println!("{} == {}: {:?}", cp1, cp2, + // char::try_from(cp1)); + } + _ => { + panic!("Mismatched characters"); + } + } + } + } +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs b/crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs new file mode 100644 index 000000000000..4956cc6d224f --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/reader_impl.rs @@ -0,0 +1,136 @@ +use swc_atoms::Atom; + +use crate::{ + diagnostics::Result, + parser::reader::string_literal_parser::{ + ast as StringLiteralAst, parse_regexp_literal, Options as StringLiteralParserOptions, + Parser as StringLiteralParser, + }, +}; + +pub struct Reader<'a> { + source_text: &'a str, + units: Vec, + index: usize, + offset: u32, +} + +impl<'a> Reader<'a> { + pub fn initialize( + source_text: &'a str, + unicode_mode: bool, + parse_string_literal: bool, + ) -> Result { + // NOTE: This must be `0`. + // Since `source_text` here may be a slice of the original source text, + // using `Span` for `span.source_text(source_text)` will be out of range in some + // cases. + let span_offset = 0; + + let units = if parse_string_literal { + let StringLiteralAst::StringLiteral { body, .. } = StringLiteralParser::new( + source_text, + StringLiteralParserOptions { + strict_mode: false, + span_offset, + combine_surrogate_pair: unicode_mode, + }, + ) + .parse()?; + body + } else { + parse_regexp_literal(source_text, span_offset, unicode_mode) + }; + + Ok(Self { + source_text, + units, + index: 0, + // If `parse_string_literal` is `true`, the first character is the opening quote. + // We need to +1 to skip it. + offset: u32::from(parse_string_literal), + }) + } + + pub fn offset(&self) -> u32 { + self.offset + } + + pub fn checkpoint(&self) -> (usize, u32) { + (self.index, self.offset) + } + + pub fn rewind(&mut self, checkpoint: (usize, u32)) { + self.index = checkpoint.0; + self.offset = checkpoint.1; + } + + pub fn advance(&mut self) { + if let Some(unit) = self.units.get(self.index) { + self.offset = unit.span.hi.0; + self.index += 1; + } + } + + fn peek_nth(&self, n: usize) -> Option { + let nth = self.index + n; + self.units.get(nth).map(|cp| cp.value) + } + + pub fn peek(&self) -> Option { + self.peek_nth(0) + } + + pub fn peek2(&self) -> Option { + self.peek_nth(1) + } + + pub fn eat(&mut self, ch: char) -> bool { + if self.peek_nth(0) == Some(ch as u32) { + self.advance(); + return true; + } + false + } + + pub fn eat2(&mut self, ch: char, ch2: char) -> bool { + if self.peek_nth(0) == Some(ch as u32) && self.peek_nth(1) == Some(ch2 as u32) { + self.advance(); + self.advance(); + return true; + } + false + } + + pub fn eat3(&mut self, ch: char, ch2: char, ch3: char) -> bool { + if self.peek_nth(0) == Some(ch as u32) + && self.peek_nth(1) == Some(ch2 as u32) + && self.peek_nth(2) == Some(ch3 as u32) + { + self.advance(); + self.advance(); + self.advance(); + return true; + } + false + } + + pub fn eat4(&mut self, ch: char, ch2: char, ch3: char, ch4: char) -> bool { + if self.peek_nth(0) == Some(ch as u32) + && self.peek_nth(1) == Some(ch2 as u32) + && self.peek_nth(2) == Some(ch3 as u32) + && self.peek_nth(3) == Some(ch4 as u32) + { + self.advance(); + self.advance(); + self.advance(); + self.advance(); + return true; + } + false + } + + pub fn atom(&self, start: u32, end: u32) -> Atom { + Atom::from(&self.source_text[start as usize..end as usize]) + } +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/README.md b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/README.md new file mode 100644 index 000000000000..7aa4d0194070 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/README.md @@ -0,0 +1,5 @@ +# string_literal_parser + +Implements ECMAScript® 2024 Language Specification + +- https://tc39.es/ecma262/2024/multipage/ecmascript-language-lexical-grammar.html#prod-StringLiteral diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/ast.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/ast.rs new file mode 100644 index 000000000000..28505b4ca32c --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/ast.rs @@ -0,0 +1,25 @@ +use swc_common::Span; + +#[derive(Debug)] +pub struct StringLiteral { + #[allow(unused, clippy::allow_attributes)] + pub span: Span, + #[allow(unused, clippy::allow_attributes)] + pub kind: StringLiteralKind, + pub body: Vec, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum StringLiteralKind { + Double, + Single, +} + +/// Represents UTF-16 code unit(u16 as u32) or Unicode code point(char as u32). +/// `Span` width may be more than 1, since there will be escape sequences. +#[derive(Debug, Clone, Copy)] +pub struct CodePoint { + pub span: Span, + // NOTE: If we need codegen, more information should be added. + pub value: u32, +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/characters.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/characters.rs new file mode 100644 index 000000000000..930b548652e8 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/characters.rs @@ -0,0 +1,43 @@ +pub const LF: char = '\n'; +pub const CR: char = '\r'; +pub const LS: char = '\u{2028}'; +pub const PS: char = '\u{2029}'; + +// ``` +// LineTerminator :: +// +// +// +// +// ``` +pub fn is_line_terminator(ch: char) -> bool { + matches!(ch, LF | CR | LS | PS) +} + +// ``` +// SingleEscapeCharacter :: one of +// ' " \ b f n r t v +// ``` +pub fn is_single_escape_character(ch: char) -> bool { + matches!(ch, '\'' | '"' | '\\' | 'b' | 'f' | 'n' | 'r' | 't' | 'v') +} + +// ``` +// NonEscapeCharacter :: +// SourceCharacter but not one of EscapeCharacter or LineTerminator +// +// EscapeCharacter :: +// SingleEscapeCharacter +// DecimalDigit +// x +// u +// ``` +pub fn is_non_escape_character(ch: char) -> bool { + let is_escape_character = + |ch| is_single_escape_character(ch) || ch.is_ascii_digit() || matches!(ch, 'x' | 'u'); + + if is_escape_character(ch) || is_line_terminator(ch) { + return false; + } + true +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/diagnostics.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/diagnostics.rs new file mode 100644 index 000000000000..71c751674ce3 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/diagnostics.rs @@ -0,0 +1,21 @@ +use swc_common::Span; + +use crate::diagnostics::RegexpDiagnostic; + +#[cold] +pub fn invalid_input(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error( + "String literal should be wrapped with ' or \", or escaped properly".to_string(), + ) + .with_label(span) +} + +#[cold] +pub fn legacy_in_strict_mode(kind: &str, span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error(format!("Not allowed {kind} in strict mode")).with_label(span) +} + +#[cold] +pub fn too_large_unicode_escape_sequence(span: Span) -> RegexpDiagnostic { + RegexpDiagnostic::error("Too large unicode escape sequence".to_string()).with_label(span) +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/mod.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/mod.rs new file mode 100644 index 000000000000..719daf4a4ca9 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/mod.rs @@ -0,0 +1,310 @@ +pub mod ast; +mod characters; +mod diagnostics; +mod options; +mod parser_impl; + +pub use options::Options; +pub use parser_impl::{parse_regexp_literal, Parser}; + +#[cfg(test)] +mod test { + use swc_common::Span; + + use super::{ast, parse_regexp_literal, Options, Parser}; + + trait SpanExt { + fn source_text(self, source_text: &str) -> &str; + } + + impl SpanExt for Span { + fn source_text(self, source_text: &str) -> &str { + &source_text[self.lo.0 as usize..self.hi.0 as usize] + } + } + + #[test] + fn should_pass() { + for source_text in [ + r#""""#, + r"''", + r#""Hello, world!""#, + r"'Hello, world!'", + r#""He said, \"Hello!\"""#, + r#"'She said, "Hello!"'"#, + r"'It\'s a sunny day'", + "'Line1\\nLine2'", + "'Column1\tColumn2'", + r#""Path to file: C:\\Program Files\\MyApp""#, + r"'Backspace\bTest'", + r"'FormFeed\fTest'", + "'CarriageReturn\\rTest'", + r"'VerticalTab\vTest'", + r#""NullChar\0Test""#, + r#""Hex A: \x41""#, + r#""Unicode A: \u0041""#, + r#""Smiley: 😀""#, + r#""Smiley: \u{1F600}""#, + r#""Octal 7: \7""#, + r#""Octal 77: \77""#, + r#""Octal 123: \123""#, + r#""Non-octal digits: \8\9""#, + r#""This is a long string\ + that spans\ + multiple lines""#, + r"'Line separator:\u2028Test'", + r"'Paragraph separator:\u2029Test'", + r#""NonEscapeCharacter: \c""#, + r#""Zero followed by 8 and 9: \08\09""#, + r#""NonZeroOctalDigit not followed by OctalDigit: \1x""#, + r#""ZeroToThree OctalDigit not followed by OctalDigit: \33x""#, + r#""FourToSeven OctalDigit: \47""#, + r#""Unicode brace escape: \u{0041}""#, + r#""Escaped backslash and quote: \\\"""#, + r#""Invalid escape: \@""#, + r#""He said, 'Hello!'""#, + r#"'She replied, "Hi!"'"#, + r#""Multiple escapes: \n\t\r""#, + r#""Longest octal escape: \377""#, + r#""Number at end: \1234""#, + r#""Escape followed by letter: \1a""#, + r#""This is a long string that spans\ + multiple lines using\ + multiple continuations""#, + r#""Not an escape: \\g""#, + r#""Surrogate pair: \uD83D\uDE00""#, + r#""Line continuation with terminator: \ +\r\n""#, + r#""Special chars: !@#$%^&*()_+-=[]{}|;':,.<>/?\"''""#, + r#""Combined escapes: \n\\\"\t\u0041\x42""#, + ] { + if let Err(err) = Parser::new(source_text, Options::default()).parse() { + panic!("Expect to parse: {source_text} but failed: {err}"); + } + } + } + + #[test] + fn should_fail() { + for source_text in [ + r"Not quoted", + r"'Unterminated", + r#""Line terminator +without continuation""#, + r#""Invalid hex escape: \xG1""#, + r#""Invalid escapes: \x\y\z""#, + r#""Invalid unicode escape: \u00G1""#, + r#""Invalid unicode brace escape: \u{G1}""#, + r#""Too many digits: \u{1234567}""#, + r#""str"+'str'"#, + r#"'str'+"str""#, + ] { + let result = Parser::new(source_text, Options::default()).parse(); + assert!( + result.is_err(), + "Expect to fail: {source_text} but passed..." + ); + // println!("{:?}", + // result.unwrap_err().with_source_code(source_text)); + } + } + + #[test] + fn should_fail_early_errors() { + for source_text in [ + r#""invalid octal \777""#, + r#""invalid non-octal decimal \9""#, + ] { + // These are allowed in non-strict mode. + let result = Parser::new( + source_text, + Options { + strict_mode: false, + ..Options::default() + }, + ) + .parse(); + assert!( + result.is_ok(), + "Expect to parse: {source_text} but failed..." + ); + + // But not in strict mode. + let result = Parser::new( + source_text, + Options { + strict_mode: true, + ..Options::default() + }, + ) + .parse(); + assert!( + result.is_err(), + "Expect to fail w/ early error: {source_text} but passed..." + ); + // println!("{:?}", + // result.unwrap_err().with_source_code(source_text)); + } + } + + #[test] + fn parse_quotes() { + let options = Options::default(); + + let ast = Parser::new(r#""double""#, options).parse().unwrap(); + assert_eq!(ast.kind, ast::StringLiteralKind::Double); + + let ast = Parser::new(r"'single'", options).parse().unwrap(); + assert_eq!(ast.kind, ast::StringLiteralKind::Single); + } + + #[test] + fn should_combine_surrogate_pair() { + let source_text = "'👈🏻(=2+2)'"; + + let ast = Parser::new( + source_text, + Options { + combine_surrogate_pair: false, + ..Options::default() + }, + ) + .parse() + .unwrap(); + assert_eq!(ast.body.len(), 10); + + let ast = Parser::new( + source_text, + Options { + combine_surrogate_pair: true, + ..Options::default() + }, + ) + .parse() + .unwrap(); + assert_eq!(ast.body.len(), 8); + } + + #[test] + fn span_offset() { + let source_text = "\"Adjust span but should have no side effect for parsing\""; + let ret1 = Parser::new( + source_text, + Options { + span_offset: 0, + ..Options::default() + }, + ) + .parse() + .unwrap(); + let ret2 = Parser::new( + source_text, + Options { + span_offset: 10, + ..Options::default() + }, + ) + .parse() + .unwrap(); + + assert_ne!(ret1.span, ret2.span); + for (a, b) in ret1.body.iter().zip(ret2.body.iter()) { + assert_ne!(a.span, b.span); + } + } + + #[test] + fn restore_span() { + let source_text = "'123'"; + let ast = Parser::new( + source_text, + Options { + span_offset: 0, + combine_surrogate_pair: false, + strict_mode: false, + }, + ) + .parse() + .unwrap(); + + assert_eq!(ast.span.source_text(source_text), source_text); + + let source_text = "\"Hi,\\n🦄\\w\""; + let ast = Parser::new( + source_text, + Options { + span_offset: 0, + combine_surrogate_pair: true, + strict_mode: false, + }, + ) + .parse() + .unwrap(); + + assert_eq!(ast.span.source_text(source_text), source_text); + let mut units = ast.body.iter(); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"H"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"i"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r","); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"\n"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"🦄"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"\w"); + assert!(units.next().is_none()); + + let source_text = "...'<-HERE->'..."; + let ast = Parser::new( + &source_text[3..13], + Options { + span_offset: 3, + ..Options::default() + }, + ) + .parse() + .unwrap(); + + assert_eq!(ast.span.source_text(source_text), "'<-HERE->'"); + let mut units = ast.body.iter(); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"<"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"-"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"H"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"E"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"R"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"E"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r"-"); + assert_eq!(units.next().unwrap().span.source_text(source_text), r">"); + assert!(units.next().is_none()); + } + + #[test] + fn regexp_literal() { + let source_text1 = r"re = new RegExp('^12🥳3\\d(?=4)\\\\$')"; + let offset1 = (16, 39); + + let source_text2 = r"re = /^12🥳3\d(?=4)\\$/"; + let offset2 = (6, 24); + + let combine_surrogate_pair = false; + + let ret1 = Parser::new( + &source_text1[offset1.0..offset1.1], + Options { + span_offset: u32::try_from(offset1.0).unwrap(), + combine_surrogate_pair, + strict_mode: false, + }, + ) + .parse() + .unwrap() + .body; + let ret2 = parse_regexp_literal( + &source_text2[offset2.0..offset2.1], + u32::try_from(offset2.0).unwrap(), + combine_surrogate_pair, + ); + + assert_eq!(ret1.len(), ret2.len()); + for (a, b) in ret1.iter().zip(ret2.iter()) { + assert_eq!(a.value, b.value); + } + } +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/options.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/options.rs new file mode 100644 index 000000000000..04147a5bd261 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/options.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Copy, Debug, Default)] +pub struct Options { + /// Used to adjust `Span` positions to fit the global source code. + pub span_offset: u32, + /// In JavaScript, internal representation of strings is UTF-16. + /// But for our usage in Rust, it is more convenient to work with + /// UTF-32(char) unit if desired. + pub combine_surrogate_pair: bool, + /// If `true`, parser will emit error when legacy octal escape sequences are + /// found. + pub strict_mode: bool, +} diff --git a/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs new file mode 100644 index 000000000000..38be6356e5b1 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/reader/string_literal_parser/parser_impl.rs @@ -0,0 +1,555 @@ +use super::{ + ast, + characters::{ + is_line_terminator, is_non_escape_character, is_single_escape_character, CR, LF, LS, PS, + }, + diagnostics, + options::Options, +}; +use crate::{diagnostics::Result, parser::span_factory::SpanFactory}; + +// Internal representation of escape sequence resolved unit in a string literal. +type OffsetsAndCp = ((u32, u32), u32); + +/// Helper API for `RegExp` literal parsing. +/// This time, we don't need to handle escape sequences. +pub fn parse_regexp_literal( + source_text: &str, + span_offset: u32, + combine_surrogate_pair: bool, +) -> Vec { + let mut body = vec![]; + + let mut offset = 0; + for ch in source_text.chars() { + let start = offset; + #[expect(clippy::cast_possible_truncation)] + let end = start + ch.len_utf8() as u32; + + let offsets_and_cp: OffsetsAndCp = ((start, end), ch as u32); + Parser::handle_code_point( + &mut body, + offsets_and_cp, + span_offset, + combine_surrogate_pair, + ); + offset = end; + } + + body +} + +pub struct Parser { + // NOTE: In JavaScript, string literals are UTF-16 encoded, + // so we need to be aware of surrogate pairs, while collecting offsets for `Span`. + // Rather than using `encode_utf16()`, split surrogate pairs manually is easier + // to detect the start and end of each code point. + chars: Vec, + index: usize, + offset: u32, + options: Options, +} + +impl Parser { + // This is public because it is used in `parse_regexp_literal()`. + pub fn handle_code_point( + body: &mut Vec, + (offsets, cp): OffsetsAndCp, + span_offset: u32, + combine_surrogate_pair: bool, + ) { + let span = SpanFactory::span_from_u32(span_offset + offsets.0, span_offset + offsets.1); + + if combine_surrogate_pair || (0..=0xffff).contains(&cp) { + // If the code point is in the BMP or if forced, just push it + body.push(ast::CodePoint { span, value: cp }); + } else { + // Otherwise, split the code point into a surrogate pair, sharing the same span + let (lead, trail) = ( + 0xd800 + ((cp - 0x10000) >> 10), + 0xdc00 + ((cp - 0x10000) & 0x3ff), + ); + body.push(ast::CodePoint { span, value: lead }); + body.push(ast::CodePoint { span, value: trail }); + } + } + + // --- + + pub fn new(source_text: &str, options: Options) -> Self { + Self { + chars: source_text.chars().collect::>(), + index: 0, + offset: 0, + options, + } + } + + // ``` + // StringLiteral :: + // " DoubleStringCharacters[opt] " + // ' SingleStringCharacters[opt] ' + // ``` + pub fn parse(mut self) -> Result { + let (quote_char, kind) = if self.eat('"') { + ('"', ast::StringLiteralKind::Double) + } else if self.eat('\'') { + ('\'', ast::StringLiteralKind::Single) + } else { + return Err(diagnostics::invalid_input(SpanFactory::span_from_u32( + self.options.span_offset, + self.options.span_offset, + ))); + }; + + let body = self.parse_string_characters(quote_char)?; + + if self.eat(quote_char) { + if self.peek().is_some() { + return Err(diagnostics::invalid_input(SpanFactory::span_from_u32( + self.options.span_offset + self.offset(), + self.options.span_offset + self.offset(), + ))); + } + + let span = SpanFactory::span_from_u32( + self.options.span_offset, + self.options.span_offset + self.offset(), + ); + return Ok(ast::StringLiteral { span, kind, body }); + } + + Err(diagnostics::invalid_input(SpanFactory::span_from_u32( + self.options.span_offset + self.offset(), + self.options.span_offset + self.offset(), + ))) + } + + // --- + + // ``` + // DoubleStringCharacters :: + // DoubleStringCharacter DoubleStringCharacters[opt] + // + // SingleStringCharacters :: + // SingleStringCharacter SingleStringCharacters[opt] + // ``` + fn parse_string_characters( + &mut self, + single_or_double_quote: char, + ) -> Result> { + let mut body = vec![]; + while let Some(code_point) = self.parse_string_character(single_or_double_quote)? { + Parser::handle_code_point( + &mut body, + code_point, + self.options.span_offset, + self.options.combine_surrogate_pair, + ); + } + Ok(body) + } + + // ``` + // DoubleStringCharacter :: + // SourceCharacter but not one of " or \ or LineTerminator + // + // + // \ EscapeSequence + // LineContinuation + // + // SingleStringCharacter :: + // SourceCharacter but not one of ' or \ or LineTerminator + // + // + // \ EscapeSequence + // LineContinuation + // ``` + fn parse_string_character( + &mut self, + single_or_double_quote: char, + ) -> Result> { + let offset_start = self.offset(); + let checkpoint = self.checkpoint(); + + if let Some(ch) = self + .peek() + .filter(|&ch| ch != single_or_double_quote && ch != '\\' && !is_line_terminator(ch)) + { + self.advance(); + return Ok(Some(((offset_start, self.offset()), ch as u32))); + } + if self.peek() == Some(LS) { + self.advance(); + return Ok(Some(((offset_start, self.offset()), LS as u32))); + } + if self.peek() == Some(PS) { + self.advance(); + return Ok(Some(((offset_start, self.offset()), PS as u32))); + } + if self.eat('\\') { + if let Some(cp) = self.parse_escape_sequence(offset_start)? { + return Ok(Some(((offset_start, self.offset()), cp))); + } + self.rewind(checkpoint); + } + if let Some(cp) = self.parse_line_terminator_sequence() { + return Ok(Some(((offset_start, self.offset()), cp))); + } + + Ok(None) + } + + // ``` + // EscapeSequence :: + // CharacterEscapeSequence + // 0 [lookahead ∉ DecimalDigit] + // LegacyOctalEscapeSequence + // NonOctalDecimalEscapeSequence + // HexEscapeSequence + // UnicodeEscapeSequence + // ``` + fn parse_escape_sequence(&mut self, offset_start: u32) -> Result> { + if let Some(cp) = self.parse_character_escape_sequence() { + return Ok(Some(cp)); + } + if self.peek() == Some('0') && self.peek2().map_or(true, |ch| !ch.is_ascii_digit()) { + self.advance(); + return Ok(Some(0x00)); + } + if let Some(cp) = self.parse_legacy_octal_escape_sequence() { + // [SS:EE] EscapeSequence :: LegacyOctalEscapeSequence + // It is a Syntax Error if IsStrict(this production) is true. + if self.options.strict_mode { + return Err(diagnostics::legacy_in_strict_mode( + "octal escape sequence", + SpanFactory::span_from_u32( + self.options.span_offset + offset_start, + self.options.span_offset + self.offset(), + ), + )); + } + return Ok(Some(cp)); + } + if let Some(cp) = self.parse_non_octal_decimal_escape_sequence() { + // [SS:EE] EscapeSequence :: NonOctalDecimalEscapeSequence + // It is a Syntax Error if IsStrict(this production) is true. + if self.options.strict_mode { + return Err(diagnostics::legacy_in_strict_mode( + "non octal decimal escape sequence", + SpanFactory::span_from_u32( + self.options.span_offset + offset_start, + self.options.span_offset + self.offset(), + ), + )); + } + return Ok(Some(cp)); + } + if let Some(cp) = self.parse_hex_escape_sequence() { + return Ok(Some(cp)); + } + if let Some(cp) = self.parse_unicode_escape_sequence(offset_start)? { + return Ok(Some(cp)); + } + + Ok(None) + } + + // ``` + // CharacterEscapeSequence :: + // SingleEscapeCharacter + // NonEscapeCharacter + // ``` + fn parse_character_escape_sequence(&mut self) -> Option { + if let Some(ch) = self.peek().filter(|&ch| is_single_escape_character(ch)) { + self.advance(); + return Some(ch as u32); + } + if let Some(ch) = self.peek().filter(|&ch| is_non_escape_character(ch)) { + self.advance(); + return Some(ch as u32); + } + + None + } + + // ``` + // LegacyOctalEscapeSequence :: + // 0 [lookahead ∈ { 8, 9 }] + // NonZeroOctalDigit [lookahead ∉ OctalDigit] + // ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + // FourToSeven OctalDigit + // ZeroToThree OctalDigit OctalDigit + // + // NonZeroOctalDigit :: + // OctalDigit but not 0 + // + // ZeroToThree :: one of + // 0 1 2 3 + // + // FourToSeven :: one of + // 4 5 6 7 + // ``` + fn parse_legacy_octal_escape_sequence(&mut self) -> Option { + if let Some(first) = self.consume_octal_digit() { + // 0 [lookahead ∈ { 8, 9 }] + if first == 0 && self.peek().filter(|&ch| !matches!(ch, '8' | '9')).is_some() { + return Some(first); + } + + if let Some(second) = self.consume_octal_digit() { + if let Some(third) = self.consume_octal_digit() { + // ZeroToThree OctalDigit OctalDigit + if first <= 3 { + return Some(first * 64 + second * 8 + third); + } + } + + // ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + // FourToSeven OctalDigit + return Some(first * 8 + second); + } + + // NonZeroOctalDigit [lookahead ∉ OctalDigit] + return Some(first); + } + + None + } + + // ``` + // NonOctalDecimalEscapeSequence :: one of + // 8 9 + // ``` + fn parse_non_octal_decimal_escape_sequence(&mut self) -> Option { + if self.eat('8') { + return Some('8' as u32); + } + if self.eat('9') { + return Some('9' as u32); + } + None + } + + // ``` + // HexEscapeSequence :: + // x HexDigit HexDigit + // ``` + fn parse_hex_escape_sequence(&mut self) -> Option { + let checkpoint = self.checkpoint(); + + if self.eat('x') { + if let Some(first) = self.consume_hex_digit() { + if let Some(second) = self.consume_hex_digit() { + return Some(first * 16 + second); + } + } + + self.rewind(checkpoint); + } + + None + } + + // ``` + // UnicodeEscapeSequence :: + // u Hex4Digits + // u{ CodePoint } + // ``` + fn parse_unicode_escape_sequence(&mut self, offset_start: u32) -> Result> { + let chckpoint = self.checkpoint(); + + if self.eat('u') { + if let Some(cp) = self.consume_hex4_digits() { + return Ok(Some(cp)); + } + self.rewind(chckpoint); + } + + if self.eat('u') { + if self.eat('{') { + if let Some(hex_digits) = self + .consume_hex_digits(offset_start)? + .filter(|&cp| cp <= 0x10_ffff) + { + if self.eat('}') { + return Ok(Some(hex_digits)); + } + } + } + self.rewind(chckpoint); + } + + Ok(None) + } + + // ``` + // LineContinuation :: + // \ LineTerminatorSequence + // + // LineTerminatorSequence :: + // + // [lookahead ≠ ] + // + // + // + // ``` + fn parse_line_terminator_sequence(&mut self) -> Option { + let checkpoint = self.checkpoint(); + + if self.eat('\\') { + if self.peek() == Some(LF) { + self.advance(); + return Some(LF as u32); + } + if self.peek() == Some(CR) && self.peek2() != Some(LF) { + self.advance(); + return Some(CR as u32); + } + if self.peek() == Some(LS) { + self.advance(); + return Some(LS as u32); + } + if self.peek() == Some(PS) { + self.advance(); + return Some(PS as u32); + } + // NOTE: CR+LF can not represent as a single code point. + // I don't know the best way to handle this. + // To distinguish this from CR and LF, structural change is needed... + if self.peek() == Some(CR) && self.peek2() == Some(LF) { + self.advance(); + self.advance(); + return Some(LF as u32); + } + } + + self.rewind(checkpoint); + None + } + + // --- + + fn consume_hex_digit(&mut self) -> Option { + if let Some(ch) = self.peek().filter(char::is_ascii_hexdigit) { + self.advance(); + return ch.to_digit(16); + } + + None + } + + fn consume_octal_digit(&mut self) -> Option { + if let Some(ch) = self + .peek() + .filter(char::is_ascii_digit) + .filter(|&ch| ch < '8') + { + self.advance(); + // `- '0' as u32`: convert code point to digit + return Some(ch as u32 - '0' as u32); + } + + None + } + + // ``` + // Hex4Digits :: + // HexDigit HexDigit HexDigit HexDigit + // ``` + fn consume_hex4_digits(&mut self) -> Option { + let checkpoint = self.checkpoint(); + + let mut value = 0; + for _ in 0..4 { + let Some(hex) = self + .peek() + .filter(char::is_ascii_hexdigit) + .and_then(|ch| ch.to_digit(16)) + else { + self.rewind(checkpoint); + return None; + }; + + value = (16 * value) + hex; + self.advance(); + } + + Some(value) + } + + fn consume_hex_digits(&mut self, offset_start: u32) -> Result> { + let checkpoint = self.checkpoint(); + + let mut value: u32 = 0; + while let Some(hex) = self + .peek() + .filter(char::is_ascii_hexdigit) + .and_then(|ch| ch.to_digit(16)) + { + // To prevent panic on overflow cases like `\u{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}` + if let Some(v) = value.checked_mul(16).and_then(|v| v.checked_add(hex)) { + value = v; + self.advance(); + } else { + return Err(diagnostics::too_large_unicode_escape_sequence( + SpanFactory::span_from_u32( + self.options.span_offset + offset_start, + self.options.span_offset + self.offset(), + ), + )); + } + } + + if self.checkpoint() != checkpoint { + return Ok(Some(value)); + } + + Ok(None) + } + + // --- + + fn checkpoint(&self) -> (usize, u32) { + (self.index, self.offset) + } + + fn rewind(&mut self, checkpoint: (usize, u32)) { + self.index = checkpoint.0; + self.offset = checkpoint.1; + } + + fn advance(&mut self) { + if let Some(ch) = self.chars.get(self.index) { + #[expect(clippy::cast_possible_truncation)] + let len = ch.len_utf8() as u32; + self.offset += len; + self.index += 1; + } + } + + fn eat(&mut self, ch: char) -> bool { + if self.peek() == Some(ch) { + self.advance(); + return true; + } + false + } + + fn offset(&self) -> u32 { + self.offset + } + + fn peek_nth(&self, n: usize) -> Option { + let nth = self.index + n; + self.chars.get(nth).copied() + } + + fn peek(&self) -> Option { + self.peek_nth(0) + } + + fn peek2(&self) -> Option { + self.peek_nth(1) + } +} diff --git a/crates/swc_ecma_regexp/src/parser/span_factory.rs b/crates/swc_ecma_regexp/src/parser/span_factory.rs new file mode 100644 index 000000000000..993af2980732 --- /dev/null +++ b/crates/swc_ecma_regexp/src/parser/span_factory.rs @@ -0,0 +1,21 @@ +use swc_common::{BytePos, Span}; + +pub struct SpanFactory { + span_offset: u32, +} + +impl SpanFactory { + pub fn new(span_offset: u32) -> Self { + Self { span_offset } + } + + /// Add base offset to `Span`. + /// Span { start: 4, end: 12 } => Span { start: 4 + N, end: 12 + N } + pub fn create(&self, start: u32, end: u32) -> Span { + Self::span_from_u32(start + self.span_offset, end + self.span_offset) + } + + pub fn span_from_u32(start: u32, end: u32) -> Span { + Span::new(BytePos(start), BytePos(end)) + } +} diff --git a/crates/swc_ecma_regexp/src/surrogate_pair.rs b/crates/swc_ecma_regexp/src/surrogate_pair.rs new file mode 100644 index 000000000000..6433ae482f15 --- /dev/null +++ b/crates/swc_ecma_regexp/src/surrogate_pair.rs @@ -0,0 +1 @@ +pub use swc_ecma_regexp_common::*; diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml new file mode 100644 index 000000000000..6e54d5a2edd5 --- /dev/null +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -0,0 +1,29 @@ +[package] +authors = ["강동윤 ", "magic-akari "] +description = "AST definitions of ECMAScript regular expressions" +documentation = "https://rustdoc.swc.rs/swc_ecma_regexp_ast/" +edition = { workspace = true } +license = { workspace = true } +name = "swc_ecma_regexp_ast" +repository = { workspace = true } +version = "0.0.0" + +[lib] +bench = false + +[features] +__rkyv = [] +default = [] +rkyv-impl = [] +serde-impl = ["serde"] + +[dependencies] +bitflags = { workspace = true } +bytecheck = { workspace = true, optional = true } +is-macro = { workspace = true } +rancor = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"], optional = true } + +swc_atoms = { version = "5.0.0", path = "../swc_atoms" } +swc_common = { version = "11.0.0", path = "../swc_common" } +swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_ast/README.md b/crates/swc_ecma_regexp_ast/README.md new file mode 100644 index 000000000000..b71bb8c35f7a --- /dev/null +++ b/crates/swc_ecma_regexp_ast/README.md @@ -0,0 +1,3 @@ +# References + +https://github.com/oxc-project/oxc/blob/3efc25fdebe4e02331f47767a74855f1d0d2bb15/crates/oxc_regular_expression diff --git a/crates/swc_ecma_regexp_ast/src/display.rs b/crates/swc_ecma_regexp_ast/src/display.rs new file mode 100644 index 000000000000..27a1d06e958e --- /dev/null +++ b/crates/swc_ecma_regexp_ast/src/display.rs @@ -0,0 +1,407 @@ +use std::{ + borrow::Cow, + fmt::{self, Display}, + iter::Peekable, +}; + +use swc_ecma_regexp_common::{combine_surrogate_pair, is_lead_surrogate, is_trail_surrogate}; + +use super::*; + +impl Display for Pattern { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.body.fmt(f) + } +} + +impl Display for Disjunction { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write_join(f, "|", &self.body) + } +} + +impl Display for Alternative { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn as_character(term: &Term) -> Option<&Character> { + if let Term::Character(ch) = term { + Some(ch) + } else { + None + } + } + + write_join_with(f, "", &self.body, |iter| { + let next = iter.next()?; + let Some(next) = as_character(next) else { + return Some(Cow::Owned(next.to_string())); + }; + + let peek = iter.peek().and_then(|it| as_character(it)); + let (result, eat) = character_to_string(next, peek); + if eat { + iter.next(); + } + + Some(result) + }) + } +} + +impl Display for Term { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Self::BoundaryAssertion(it) => it.fmt(f), + Self::LookAroundAssertion(it) => it.fmt(f), + Self::Quantifier(it) => it.fmt(f), + Self::Character(it) => it.fmt(f), + Self::Dot(it) => it.fmt(f), + Self::CharacterClassEscape(it) => it.fmt(f), + Self::UnicodePropertyEscape(it) => it.fmt(f), + Self::CharacterClass(it) => it.fmt(f), + Self::CapturingGroup(it) => it.fmt(f), + Self::IgnoreGroup(it) => it.fmt(f), + Self::IndexedReference(it) => it.fmt(f), + Self::NamedReference(it) => it.fmt(f), + } + } +} + +impl Display for BoundaryAssertion { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.kind.fmt(f) + } +} + +impl Display for BoundaryAssertionKind { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let s = match self { + Self::Start => "^", + Self::End => "$", + Self::Boundary => r"\b", + Self::NegativeBoundary => r"\B", + }; + f.write_str(s) + } +} + +impl Display for LookAroundAssertion { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "({}{})", self.kind, self.body) + } +} + +impl Display for LookAroundAssertionKind { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let s = match self { + Self::Lookahead => "?=", + Self::NegativeLookahead => "?!", + Self::Lookbehind => "?<=", + Self::NegativeLookbehind => "? fmt::Result { + self.body.fmt(f)?; + + match (self.min, self.max) { + (0, None) => f.write_str("*")?, + (1, None) => f.write_str("+")?, + (0, Some(1)) => f.write_str("?")?, + (min, Some(max)) if min == max => write!(f, "{{{min}}}",)?, + (min, Some(max)) => { + write!(f, "{{{min},{max}}}",)?; + } + (min, None) => { + write!(f, "{{{min},}}",)?; + } + } + + if !self.greedy { + f.write_str("?")?; + } + + Ok(()) + } +} + +impl Display for Character { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (string, _) = character_to_string(self, None); + string.fmt(f) + } +} + +impl Display for Dot { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(".") + } +} + +impl Display for CharacterClassEscape { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.kind.fmt(f) + } +} + +impl Display for CharacterClassEscapeKind { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let escape = match self { + Self::D => r"\d", + Self::NegativeD => r"\D", + Self::S => r"\s", + Self::NegativeS => r"\S", + Self::W => r"\w", + Self::NegativeW => r"\W", + }; + f.write_str(escape) + } +} + +impl Display for UnicodePropertyEscape { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(if self.negative { r"\P{" } else { r"\p{" })?; + match (&self.name, &self.value) { + (name, Some(value)) if name == "General_Category" => value.fmt(f), + (name, Some(value)) => write!(f, "{name}={value}"), + (name, _) => name.fmt(f), + }?; + f.write_str("}") + } +} + +impl Display for CharacterClass { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn as_character(content: &CharacterClassContents) -> Option<&Character> { + if let CharacterClassContents::Character(ch) = content { + Some(ch) + } else { + None + } + } + + f.write_str("[")?; + if self.negative { + f.write_str("^")?; + } + + if !self.body.is_empty() { + let sep = match self.kind { + CharacterClassContentsKind::Union => "", + CharacterClassContentsKind::Subtraction => "--", + CharacterClassContentsKind::Intersection => "&&", + }; + + write_join_with(f, sep, &self.body, |iter| { + let next = iter.next()?; + let Some(next) = as_character(next) else { + return Some(Cow::Owned(next.to_string())); + }; + + let peek = iter.peek().and_then(|it| as_character(it)); + let (result, eat) = character_to_string(next, peek); + if eat { + iter.next(); + } + + Some(result) + })?; + } + + f.write_str("]") + } +} + +impl Display for CharacterClassContents { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Self::CharacterClassRange(it) => it.fmt(f), + Self::CharacterClassEscape(it) => it.fmt(f), + Self::UnicodePropertyEscape(it) => it.fmt(f), + Self::Character(it) => it.fmt(f), + Self::NestedCharacterClass(it) => it.fmt(f), + Self::ClassStringDisjunction(it) => it.fmt(f), + } + } +} + +impl Display for CharacterClassRange { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}-{}", self.min, self.max) + } +} + +impl Display for ClassStringDisjunction { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(r"\q{")?; + write_join(f, "|", &self.body)?; + f.write_str("}") + } +} + +impl Display for ClassString { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write_join(f, "", &self.body) + } +} + +impl Display for CapturingGroup { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str("(")?; + if let Some(name) = &self.name { + write!(f, "?<{name}>")?; + } + write!(f, "{})", &self.body) + } +} + +impl Display for IgnoreGroup { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn write_flags(f: &mut fmt::Formatter, flags: Modifier) -> fmt::Result { + if flags.contains(Modifier::I) { + f.write_str("i")?; + } + if flags.contains(Modifier::M) { + f.write_str("m")?; + } + if flags.contains(Modifier::S) { + f.write_str("s")?; + } + Ok(()) + } + + f.write_str("(?")?; + + if let Some(modifiers) = &self.modifiers { + if !modifiers.enabling.is_empty() { + write_flags(f, modifiers.enabling)?; + } + if !modifiers.disabling.is_empty() { + f.write_str("-")?; + write_flags(f, modifiers.disabling)?; + } + } + + write!(f, ":{})", self.body) + } +} + +impl Display for IndexedReference { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, r"\{}", self.index) + } +} + +impl Display for NamedReference { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, r"\k<{}>", self.name) + } +} + +// --- + +fn character_to_string( + this: &Character, + peek: Option<&Character>, +) -> ( + /* result */ Cow<'static, str>, + /* true of peek should be consumed */ bool, +) { + let cp = this.value; + + if matches!( + this.kind, + CharacterKind::Symbol | CharacterKind::UnicodeEscape + ) { + // Trail only + if is_trail_surrogate(cp) { + return (Cow::Owned(format!(r"\u{cp:X}")), false); + } + + if is_lead_surrogate(cp) { + if let Some(peek) = peek.filter(|peek| is_trail_surrogate(peek.value)) { + // Lead+Trail + let cp = combine_surrogate_pair(cp, peek.value); + let ch = char::from_u32(cp).expect("Invalid surrogate pair `Character`!"); + return (Cow::Owned(format!("{ch}")), true); + } + + // Lead only + return (Cow::Owned(format!(r"\u{cp:X}")), false); + } + } + + let ch = char::from_u32(cp).expect("Invalid `Character`!"); + let result = match this.kind { + // Not a surrogate, like BMP, or all units in unicode mode + CharacterKind::Symbol => Cow::Owned(ch.to_string()), + CharacterKind::ControlLetter => match ch { + '\n' => Cow::Borrowed(r"\cJ"), + '\r' => Cow::Borrowed(r"\cM"), + '\t' => Cow::Borrowed(r"\cI"), + '\u{0019}' => Cow::Borrowed(r"\cY"), + _ => Cow::Owned(format!(r"\c{ch}")), + }, + CharacterKind::Identifier => Cow::Owned(format!(r"\{ch}")), + CharacterKind::SingleEscape => match ch { + '\n' => Cow::Borrowed(r"\n"), + '\r' => Cow::Borrowed(r"\r"), + '\t' => Cow::Borrowed(r"\t"), + '\u{b}' => Cow::Borrowed(r"\v"), + '\u{c}' => Cow::Borrowed(r"\f"), + '\u{8}' => Cow::Borrowed(r"\b"), + '\u{2D}' => Cow::Borrowed(r"\-"), + _ => Cow::Owned(format!(r"\{ch}")), + }, + CharacterKind::Null => Cow::Borrowed(r"\0"), + CharacterKind::UnicodeEscape => { + let hex = &format!("{cp:04X}"); + if hex.len() <= 4 { + Cow::Owned(format!(r"\u{hex}")) + } else { + Cow::Owned(format!(r"\u{{{hex}}}")) + } + } + CharacterKind::HexadecimalEscape => Cow::Owned(format!(r"\x{cp:02X}")), + CharacterKind::Octal1 => Cow::Owned(format!(r"\{cp:o}")), + CharacterKind::Octal2 => Cow::Owned(format!(r"\{cp:02o}")), + CharacterKind::Octal3 => Cow::Owned(format!(r"\{cp:03o}")), + }; + + (result, false) +} + +// --- + +fn write_join(f: &mut fmt::Formatter, sep: S, items: I) -> fmt::Result +where + S: AsRef, + E: Display, + I: IntoIterator, +{ + write_join_with(f, sep, items, |iter| iter.next().map(|it| it.to_string())) +} + +fn write_join_with(f: &mut fmt::Formatter, sep: S, items: I, next: F) -> fmt::Result +where + S: AsRef, + E: Display, + I: IntoIterator, + F: Fn(&mut Peekable) -> Option, + D: Display, +{ + let sep = sep.as_ref(); + let iter = &mut items.into_iter().peekable(); + + if let Some(first) = next(iter) { + first.fmt(f)?; + } + + while let Some(it) = next(iter) { + write!(f, "{sep}{it}")?; + } + + Ok(()) +} diff --git a/crates/swc_ecma_regexp_ast/src/lib.rs b/crates/swc_ecma_regexp_ast/src/lib.rs new file mode 100644 index 000000000000..df083f2936d9 --- /dev/null +++ b/crates/swc_ecma_regexp_ast/src/lib.rs @@ -0,0 +1,348 @@ +use bitflags::bitflags; +use is_macro::Is; +use swc_atoms::Atom; +use swc_common::{ast_node, EqIgnoreSpan, Span}; + +mod display; + +/// The root of the `PatternParser` result. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Pattern { + pub span: Span, + pub body: Disjunction, +} + +/// Pile of [`Alternative`]s separated by `|`. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Disjunction { + pub span: Span, + pub body: Vec, +} + +/// Single unit of `|` separated alternatives. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Alternative { + pub span: Span, + pub body: Vec, +} + +/// Single unit of [`Alternative`], containing various kinds. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan, Is)] +pub enum Term { + // Assertion + // QuantifiableAssertion + #[tag("BoundaryAssertion")] + BoundaryAssertion(Box), + + #[tag("LookAroundAssertion")] + LookAroundAssertion(Box), + + #[tag("Quantifier")] + Quantifier(Box), + + // Atom + // ExtendedAtom + #[tag("Character")] + Character(Box), + + #[tag("CharacterClassEscape")] + Dot(Dot), + + #[tag("CharacterClassEscape")] + CharacterClassEscape(Box), + + #[tag("UnicodePropertyEscape")] + UnicodePropertyEscape(Box), + + #[tag("ClassStringDisjunction")] + CharacterClass(Box), + + #[tag("ClassStringDisjunction")] + CapturingGroup(Box), + + #[tag("ClassStringDisjunction")] + IgnoreGroup(Box), + + #[tag("ClassStringDisjunction")] + IndexedReference(Box), + + #[tag("ClassStringDisjunction")] + NamedReference(Box), +} + +/// Simple form of assertion. +/// e.g. `^`, `$`, `\b`, `\B` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct BoundaryAssertion { + pub span: Span, + #[use_eq] + pub kind: BoundaryAssertionKind, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum BoundaryAssertionKind { + Start = 0, + End = 1, + Boundary = 2, + NegativeBoundary = 3, +} + +/// Lookaround assertion. +/// e.g. `(?=...)`, `(?!...)`, `(?<=...)`, `(?, + pub greedy: bool, + pub body: Term, +} + +/// Single character. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Character { + /// This will be invalid position when `UnicodeMode` is disabled and `value` + /// is a surrogate pair. + pub span: Span, + #[use_eq] + pub kind: CharacterKind, + /// Unicode code point or UTF-16 code unit. + pub value: u32, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum CharacterKind { + ControlLetter = 0, + HexadecimalEscape = 1, + Identifier = 2, + Null = 3, + // To distinguish leading 0 cases like `\00` and `\000` + Octal1 = 4, + Octal2 = 5, + Octal3 = 6, + SingleEscape = 7, + Symbol = 8, + UnicodeEscape = 9, +} + +/// Character class. +/// e.g. `\d`, `\D`, `\s`, `\S`, `\w`, `\W` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct CharacterClassEscape { + pub span: Span, + #[use_eq] + pub kind: CharacterClassEscapeKind, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum CharacterClassEscapeKind { + D = 0, + NegativeD = 1, + S = 2, + NegativeS = 3, + W = 4, + NegativeW = 5, +} + +/// Unicode property. +/// e.g. `\p{ASCII}`, `\P{ASCII}`, `\p{sc=Hiragana}`, `\P{sc=Hiragana}` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct UnicodePropertyEscape { + pub span: Span, + pub negative: bool, + /// `true` if `UnicodeSetsMode` and `name` matches unicode property of + /// strings. + pub strings: bool, + pub name: Atom, + pub value: Option, +} + +/// The `.`. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Dot { + pub span: Span, +} + +/// Character class wrapped by `[]`. +/// e.g. `[a-z]`, `[^A-Z]`, `[abc]`, `[a&&b&&c]`, `[[a-z]--x--y]` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct CharacterClass { + pub span: Span, + pub negative: bool, + /// `true` if: + /// - `body` contains [`UnicodePropertyEscape`], nested [`CharacterClass`] + /// or [`ClassStringDisjunction`] which `strings` is `true` + /// - and matches each logic depends on `kind` + pub strings: bool, + #[use_eq] + pub kind: CharacterClassContentsKind, + pub body: Vec, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum CharacterClassContentsKind { + Union = 0, + /// `UnicodeSetsMode` only. + Intersection = 1, + /// `UnicodeSetsMode` only. + Subtraction = 2, +} + +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan, Is)] +pub enum CharacterClassContents { + #[tag("CharacterClassRange")] + CharacterClassRange(Box), + + #[tag("CharacterClassEscape")] + CharacterClassEscape(Box), + + #[tag("UnicodePropertyEscape")] + UnicodePropertyEscape(Box), + + #[tag("Character")] + Character(Box), + + /// `UnicodeSetsMode` only + #[tag("NestedCharacterClass")] + NestedCharacterClass(Box), + + /// `UnicodeSetsMode` only + #[tag("ClassStringDisjunction")] + ClassStringDisjunction(Box), +} + +/// `-` separated range of characters. +/// e.g. `a-z`, `A-Z`, `0-9` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct CharacterClassRange { + pub span: Span, + pub min: Character, + pub max: Character, +} + +/// `|` separated string of characters wrapped by `\q{}`. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct ClassStringDisjunction { + pub span: Span, + /// `true` if body is empty or contains [`ClassString`] which `strings` is + /// `true`. + pub strings: bool, + pub body: Vec, +} + +/// Single unit of [`ClassStringDisjunction`]. +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct ClassString { + pub span: Span, + /// `true` if body is empty or contain 2 more characters. + pub strings: bool, + pub body: Vec, +} + +/// Named or unnamed capturing group. +/// e.g. `(...)`, `(?...)` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct CapturingGroup { + pub span: Span, + /// Group name to be referenced by [`NamedReference`]. + pub name: Option, + pub body: Disjunction, +} + +/// Pseudo-group for ignoring. +/// e.g. `(?:...)` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct IgnoreGroup { + pub span: Span, + pub modifiers: Option, + pub body: Disjunction, +} + +/// Modifiers in [`IgnoreGroup`]. +/// e.g. `i` in `(?i:...)`, `-s` in `(?-s:...)` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct Modifiers { + pub span: Span, + #[use_eq] + pub enabling: Modifier, + #[use_eq] + pub disabling: Modifier, +} + +bitflags! { + /// Each part of modifier in [`Modifiers`]. + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub struct Modifier: u8 { + /// Ignore case flag + const I = 1 << 0; + /// Multiline flag + const M = 1 << 1; + /// DotAll flag + const S = 1 << 2; + } +} + +/// Backreference by index. +/// e.g. `\1`, `\2`, `\3` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct IndexedReference { + pub span: Span, + pub index: u32, +} + +/// Backreference by name. +/// e.g. `\k` +#[ast_node] +#[derive(Eq, Hash, EqIgnoreSpan)] +pub struct NamedReference { + pub span: Span, + pub name: Atom, +} + +#[cfg(target_pointer_width = "64")] +#[test] +fn size_asserts() { + use std::mem::size_of; + + assert!(size_of::() == 16); + assert!(size_of::() == 16); +} diff --git a/crates/swc_ecma_regexp_common/Cargo.toml b/crates/swc_ecma_regexp_common/Cargo.toml new file mode 100644 index 000000000000..a58c4db29238 --- /dev/null +++ b/crates/swc_ecma_regexp_common/Cargo.toml @@ -0,0 +1,13 @@ +[package] +authors = ["강동윤 ", "magic-akari "] +description = "Commons for ECMAScript regular expressions" +documentation = "https://rustdoc.swc.rs/swc_ecma_regexp_common/" +edition = "2021" +include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] +license = { workspace = true } +name = "swc_ecma_regexp_common" +repository = "https://github.com/swc-project/swc.git" +version = "0.0.0" + +[lib] +bench = false diff --git a/crates/swc_ecma_regexp_common/README.md b/crates/swc_ecma_regexp_common/README.md new file mode 100644 index 000000000000..b71bb8c35f7a --- /dev/null +++ b/crates/swc_ecma_regexp_common/README.md @@ -0,0 +1,3 @@ +# References + +https://github.com/oxc-project/oxc/blob/3efc25fdebe4e02331f47767a74855f1d0d2bb15/crates/oxc_regular_expression diff --git a/crates/swc_ecma_regexp_common/src/lib.rs b/crates/swc_ecma_regexp_common/src/lib.rs new file mode 100644 index 000000000000..f1bd8ac52e44 --- /dev/null +++ b/crates/swc_ecma_regexp_common/src/lib.rs @@ -0,0 +1,3 @@ +mod surrogate_pair; + +pub use crate::surrogate_pair::*; diff --git a/crates/swc_ecma_regexp_common/src/surrogate_pair.rs b/crates/swc_ecma_regexp_common/src/surrogate_pair.rs new file mode 100644 index 000000000000..30a54d2f59a9 --- /dev/null +++ b/crates/swc_ecma_regexp_common/src/surrogate_pair.rs @@ -0,0 +1,11 @@ +pub fn is_lead_surrogate(cp: u32) -> bool { + (0xd800..=0xdbff).contains(&cp) +} + +pub fn is_trail_surrogate(cp: u32) -> bool { + (0xdc00..=0xdfff).contains(&cp) +} + +pub fn combine_surrogate_pair(lead: u32, trail: u32) -> u32 { + (lead - 0xd800) * 0x400 + trail - 0xdc00 + 0x10000 +} diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml new file mode 100644 index 000000000000..55b1fe75c7e1 --- /dev/null +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -0,0 +1,26 @@ +[package] +authors = ["강동윤 ", "magic-akari "] +description = "Visitor for ECMAScript regular expressions" +documentation = "https://rustdoc.swc.rs/swc_ecma_regexp_visit/" +edition = { workspace = true } +license = { workspace = true } +name = "swc_ecma_regexp_visit" +repository = { workspace = true } +version = "0.0.0" + +[lib] +bench = false + +[features] +default = ["serde"] +path = [] +serde-impl = ["serde"] + +[dependencies] +serde = { workspace = true, optional = true, features = ["derive"] } + +swc_atoms = { version = "5.0.0", path = "../swc_atoms" } +swc_common = { version = "11.0.0", path = "../swc_common" } +swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } +swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } +swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_regexp_visit/src/generated.rs b/crates/swc_ecma_regexp_visit/src/generated.rs new file mode 100644 index 000000000000..e98c21a77b1b --- /dev/null +++ b/crates/swc_ecma_regexp_visit/src/generated.rs @@ -0,0 +1,17337 @@ +#![doc = r" This file is generated by `tools/generate-code`. DO NOT MODIFY."] +#![allow(unused_variables)] +#![allow(clippy::all)] +pub use ::swc_visit::All; +use swc_ecma_regexp_ast::*; +#[doc = r" A visitor trait for traversing the AST."] +pub trait Visit { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_alternative(&mut self, node: &Alternative) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_alternatives(&mut self, node: &[Alternative]) { + <[Alternative] as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_atom(&mut self, node: &swc_atoms::Atom) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_character(&mut self, node: &Character) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_character_class(&mut self, node: &CharacterClass) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_character_class_contents(&mut self, node: &CharacterClassContents) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::visit_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::visit_children_with`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) { + <[CharacterClassContents] as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::visit_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_character_class_range(&mut self, node: &CharacterClassRange) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_character_kind(&mut self, node: &CharacterKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_characters(&mut self, node: &[Character]) { + <[Character] as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_class_string(&mut self, node: &ClassString) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_class_strings(&mut self, node: &[ClassString]) { + <[ClassString] as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_disjunction(&mut self, node: &Disjunction) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::visit_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn visit_dot(&mut self, node: &Dot) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_ignore_group(&mut self, node: &IgnoreGroup) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_indexed_reference(&mut self, node: &IndexedReference) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_modifier(&mut self, node: &Modifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_modifiers(&mut self, node: &Modifiers) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_named_reference(&mut self, node: &NamedReference) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::visit_children_with`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_opt_atom(&mut self, node: &Option) { + as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_opt_modifiers(&mut self, node: &Option) { + as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_pattern(&mut self, node: &Pattern) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_quantifier(&mut self, node: &Quantifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_span(&mut self, node: &swc_common::Span) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::visit_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn visit_term(&mut self, node: &Term) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::visit_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn visit_terms(&mut self, node: &[Term]) { + <[Term] as VisitWith>::visit_children_with(node, self) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) { + >::visit_children_with(node, self) + } +} +impl Visit for &mut V +where + V: ?Sized + Visit, +{ + #[inline] + fn visit_alternative(&mut self, node: &Alternative) { + ::visit_alternative(&mut **self, node) + } + + #[inline] + fn visit_alternatives(&mut self, node: &[Alternative]) { + ::visit_alternatives(&mut **self, node) + } + + #[inline] + fn visit_atom(&mut self, node: &swc_atoms::Atom) { + ::visit_atom(&mut **self, node) + } + + #[inline] + fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) { + ::visit_boundary_assertion(&mut **self, node) + } + + #[inline] + fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) { + ::visit_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + ::visit_capturing_group(&mut **self, node) + } + + #[inline] + fn visit_character(&mut self, node: &Character) { + ::visit_character(&mut **self, node) + } + + #[inline] + fn visit_character_class(&mut self, node: &CharacterClass) { + ::visit_character_class(&mut **self, node) + } + + #[inline] + fn visit_character_class_contents(&mut self, node: &CharacterClassContents) { + ::visit_character_class_contents(&mut **self, node) + } + + #[inline] + fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) { + ::visit_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) { + ::visit_character_class_contentss(&mut **self, node) + } + + #[inline] + fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) { + ::visit_character_class_escape(&mut **self, node) + } + + #[inline] + fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) { + ::visit_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn visit_character_class_range(&mut self, node: &CharacterClassRange) { + ::visit_character_class_range(&mut **self, node) + } + + #[inline] + fn visit_character_kind(&mut self, node: &CharacterKind) { + ::visit_character_kind(&mut **self, node) + } + + #[inline] + fn visit_characters(&mut self, node: &[Character]) { + ::visit_characters(&mut **self, node) + } + + #[inline] + fn visit_class_string(&mut self, node: &ClassString) { + ::visit_class_string(&mut **self, node) + } + + #[inline] + fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) { + ::visit_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn visit_class_strings(&mut self, node: &[ClassString]) { + ::visit_class_strings(&mut **self, node) + } + + #[inline] + fn visit_disjunction(&mut self, node: &Disjunction) { + ::visit_disjunction(&mut **self, node) + } + + #[inline] + fn visit_dot(&mut self, node: &Dot) { + ::visit_dot(&mut **self, node) + } + + #[inline] + fn visit_ignore_group(&mut self, node: &IgnoreGroup) { + ::visit_ignore_group(&mut **self, node) + } + + #[inline] + fn visit_indexed_reference(&mut self, node: &IndexedReference) { + ::visit_indexed_reference(&mut **self, node) + } + + #[inline] + fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) { + ::visit_look_around_assertion(&mut **self, node) + } + + #[inline] + fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) { + ::visit_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_modifier(&mut self, node: &Modifier) { + ::visit_modifier(&mut **self, node) + } + + #[inline] + fn visit_modifiers(&mut self, node: &Modifiers) { + ::visit_modifiers(&mut **self, node) + } + + #[inline] + fn visit_named_reference(&mut self, node: &NamedReference) { + ::visit_named_reference(&mut **self, node) + } + + #[inline] + fn visit_opt_atom(&mut self, node: &Option) { + ::visit_opt_atom(&mut **self, node) + } + + #[inline] + fn visit_opt_modifiers(&mut self, node: &Option) { + ::visit_opt_modifiers(&mut **self, node) + } + + #[inline] + fn visit_pattern(&mut self, node: &Pattern) { + ::visit_pattern(&mut **self, node) + } + + #[inline] + fn visit_quantifier(&mut self, node: &Quantifier) { + ::visit_quantifier(&mut **self, node) + } + + #[inline] + fn visit_span(&mut self, node: &swc_common::Span) { + ::visit_span(&mut **self, node) + } + + #[inline] + fn visit_term(&mut self, node: &Term) { + ::visit_term(&mut **self, node) + } + + #[inline] + fn visit_terms(&mut self, node: &[Term]) { + ::visit_terms(&mut **self, node) + } + + #[inline] + fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) { + ::visit_unicode_property_escape(&mut **self, node) + } +} +impl Visit for Box +where + V: ?Sized + Visit, +{ + #[inline] + fn visit_alternative(&mut self, node: &Alternative) { + ::visit_alternative(&mut **self, node) + } + + #[inline] + fn visit_alternatives(&mut self, node: &[Alternative]) { + ::visit_alternatives(&mut **self, node) + } + + #[inline] + fn visit_atom(&mut self, node: &swc_atoms::Atom) { + ::visit_atom(&mut **self, node) + } + + #[inline] + fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) { + ::visit_boundary_assertion(&mut **self, node) + } + + #[inline] + fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) { + ::visit_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + ::visit_capturing_group(&mut **self, node) + } + + #[inline] + fn visit_character(&mut self, node: &Character) { + ::visit_character(&mut **self, node) + } + + #[inline] + fn visit_character_class(&mut self, node: &CharacterClass) { + ::visit_character_class(&mut **self, node) + } + + #[inline] + fn visit_character_class_contents(&mut self, node: &CharacterClassContents) { + ::visit_character_class_contents(&mut **self, node) + } + + #[inline] + fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) { + ::visit_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) { + ::visit_character_class_contentss(&mut **self, node) + } + + #[inline] + fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) { + ::visit_character_class_escape(&mut **self, node) + } + + #[inline] + fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) { + ::visit_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn visit_character_class_range(&mut self, node: &CharacterClassRange) { + ::visit_character_class_range(&mut **self, node) + } + + #[inline] + fn visit_character_kind(&mut self, node: &CharacterKind) { + ::visit_character_kind(&mut **self, node) + } + + #[inline] + fn visit_characters(&mut self, node: &[Character]) { + ::visit_characters(&mut **self, node) + } + + #[inline] + fn visit_class_string(&mut self, node: &ClassString) { + ::visit_class_string(&mut **self, node) + } + + #[inline] + fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) { + ::visit_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn visit_class_strings(&mut self, node: &[ClassString]) { + ::visit_class_strings(&mut **self, node) + } + + #[inline] + fn visit_disjunction(&mut self, node: &Disjunction) { + ::visit_disjunction(&mut **self, node) + } + + #[inline] + fn visit_dot(&mut self, node: &Dot) { + ::visit_dot(&mut **self, node) + } + + #[inline] + fn visit_ignore_group(&mut self, node: &IgnoreGroup) { + ::visit_ignore_group(&mut **self, node) + } + + #[inline] + fn visit_indexed_reference(&mut self, node: &IndexedReference) { + ::visit_indexed_reference(&mut **self, node) + } + + #[inline] + fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) { + ::visit_look_around_assertion(&mut **self, node) + } + + #[inline] + fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) { + ::visit_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_modifier(&mut self, node: &Modifier) { + ::visit_modifier(&mut **self, node) + } + + #[inline] + fn visit_modifiers(&mut self, node: &Modifiers) { + ::visit_modifiers(&mut **self, node) + } + + #[inline] + fn visit_named_reference(&mut self, node: &NamedReference) { + ::visit_named_reference(&mut **self, node) + } + + #[inline] + fn visit_opt_atom(&mut self, node: &Option) { + ::visit_opt_atom(&mut **self, node) + } + + #[inline] + fn visit_opt_modifiers(&mut self, node: &Option) { + ::visit_opt_modifiers(&mut **self, node) + } + + #[inline] + fn visit_pattern(&mut self, node: &Pattern) { + ::visit_pattern(&mut **self, node) + } + + #[inline] + fn visit_quantifier(&mut self, node: &Quantifier) { + ::visit_quantifier(&mut **self, node) + } + + #[inline] + fn visit_span(&mut self, node: &swc_common::Span) { + ::visit_span(&mut **self, node) + } + + #[inline] + fn visit_term(&mut self, node: &Term) { + ::visit_term(&mut **self, node) + } + + #[inline] + fn visit_terms(&mut self, node: &[Term]) { + ::visit_terms(&mut **self, node) + } + + #[inline] + fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) { + ::visit_unicode_property_escape(&mut **self, node) + } +} +impl Visit for ::swc_visit::Either +where + A: Visit, + B: Visit, +{ + #[inline] + fn visit_alternative(&mut self, node: &Alternative) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_alternative(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_alternative(visitor, node), + } + } + + #[inline] + fn visit_alternatives(&mut self, node: &[Alternative]) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_alternatives(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_alternatives(visitor, node), + } + } + + #[inline] + fn visit_atom(&mut self, node: &swc_atoms::Atom) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_atom(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_atom(visitor, node), + } + } + + #[inline] + fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_boundary_assertion(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_boundary_assertion(visitor, node), + } + } + + #[inline] + fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_boundary_assertion_kind(visitor, node), + swc_visit::Either::Right(visitor) => { + Visit::visit_boundary_assertion_kind(visitor, node) + } + } + } + + #[inline] + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_capturing_group(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_capturing_group(visitor, node), + } + } + + #[inline] + fn visit_character(&mut self, node: &Character) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_character(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_character(visitor, node), + } + } + + #[inline] + fn visit_character_class(&mut self, node: &CharacterClass) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_character_class(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_character_class(visitor, node), + } + } + + #[inline] + fn visit_character_class_contents(&mut self, node: &CharacterClassContents) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_character_class_contents(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_character_class_contents(visitor, node) + } + } + } + + #[inline] + fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_character_class_contents_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_character_class_contents_kind(visitor, node) + } + } + } + + #[inline] + fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_character_class_contentss(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_character_class_contentss(visitor, node) + } + } + } + + #[inline] + fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_character_class_escape(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_character_class_escape(visitor, node), + } + } + + #[inline] + fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_character_class_escape_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_character_class_escape_kind(visitor, node) + } + } + } + + #[inline] + fn visit_character_class_range(&mut self, node: &CharacterClassRange) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_character_class_range(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_character_class_range(visitor, node), + } + } + + #[inline] + fn visit_character_kind(&mut self, node: &CharacterKind) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_character_kind(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_character_kind(visitor, node), + } + } + + #[inline] + fn visit_characters(&mut self, node: &[Character]) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_characters(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_characters(visitor, node), + } + } + + #[inline] + fn visit_class_string(&mut self, node: &ClassString) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_class_string(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_class_string(visitor, node), + } + } + + #[inline] + fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_class_string_disjunction(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_class_string_disjunction(visitor, node) + } + } + } + + #[inline] + fn visit_class_strings(&mut self, node: &[ClassString]) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_class_strings(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_class_strings(visitor, node), + } + } + + #[inline] + fn visit_disjunction(&mut self, node: &Disjunction) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_disjunction(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_disjunction(visitor, node), + } + } + + #[inline] + fn visit_dot(&mut self, node: &Dot) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_dot(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_dot(visitor, node), + } + } + + #[inline] + fn visit_ignore_group(&mut self, node: &IgnoreGroup) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_ignore_group(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_ignore_group(visitor, node), + } + } + + #[inline] + fn visit_indexed_reference(&mut self, node: &IndexedReference) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_indexed_reference(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_indexed_reference(visitor, node), + } + } + + #[inline] + fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_look_around_assertion(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_look_around_assertion(visitor, node), + } + } + + #[inline] + fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) { + match self { + swc_visit::Either::Left(visitor) => { + Visit::visit_look_around_assertion_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Visit::visit_look_around_assertion_kind(visitor, node) + } + } + } + + #[inline] + fn visit_modifier(&mut self, node: &Modifier) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_modifier(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_modifier(visitor, node), + } + } + + #[inline] + fn visit_modifiers(&mut self, node: &Modifiers) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_modifiers(visitor, node), + } + } + + #[inline] + fn visit_named_reference(&mut self, node: &NamedReference) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_named_reference(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_named_reference(visitor, node), + } + } + + #[inline] + fn visit_opt_atom(&mut self, node: &Option) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_opt_atom(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_opt_atom(visitor, node), + } + } + + #[inline] + fn visit_opt_modifiers(&mut self, node: &Option) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_opt_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_opt_modifiers(visitor, node), + } + } + + #[inline] + fn visit_pattern(&mut self, node: &Pattern) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_pattern(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_pattern(visitor, node), + } + } + + #[inline] + fn visit_quantifier(&mut self, node: &Quantifier) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_quantifier(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_quantifier(visitor, node), + } + } + + #[inline] + fn visit_span(&mut self, node: &swc_common::Span) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_span(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_span(visitor, node), + } + } + + #[inline] + fn visit_term(&mut self, node: &Term) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_term(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_term(visitor, node), + } + } + + #[inline] + fn visit_terms(&mut self, node: &[Term]) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_terms(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_terms(visitor, node), + } + } + + #[inline] + fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_unicode_property_escape(visitor, node), + swc_visit::Either::Right(visitor) => { + Visit::visit_unicode_property_escape(visitor, node) + } + } + } +} +impl Visit for ::swc_visit::Optional +where + V: Visit, +{ + #[inline] + fn visit_alternative(&mut self, node: &Alternative) { + if self.enabled { + ::visit_alternative(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_alternatives(&mut self, node: &[Alternative]) { + if self.enabled { + ::visit_alternatives(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_atom(&mut self, node: &swc_atoms::Atom) { + if self.enabled { + ::visit_atom(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) { + if self.enabled { + ::visit_boundary_assertion(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) { + if self.enabled { + ::visit_boundary_assertion_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_capturing_group(&mut self, node: &CapturingGroup) { + if self.enabled { + ::visit_capturing_group(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character(&mut self, node: &Character) { + if self.enabled { + ::visit_character(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class(&mut self, node: &CharacterClass) { + if self.enabled { + ::visit_character_class(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_contents(&mut self, node: &CharacterClassContents) { + if self.enabled { + ::visit_character_class_contents(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) { + if self.enabled { + ::visit_character_class_contents_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) { + if self.enabled { + ::visit_character_class_contentss(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) { + if self.enabled { + ::visit_character_class_escape(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) { + if self.enabled { + ::visit_character_class_escape_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_class_range(&mut self, node: &CharacterClassRange) { + if self.enabled { + ::visit_character_class_range(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_character_kind(&mut self, node: &CharacterKind) { + if self.enabled { + ::visit_character_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_characters(&mut self, node: &[Character]) { + if self.enabled { + ::visit_characters(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_class_string(&mut self, node: &ClassString) { + if self.enabled { + ::visit_class_string(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) { + if self.enabled { + ::visit_class_string_disjunction(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_class_strings(&mut self, node: &[ClassString]) { + if self.enabled { + ::visit_class_strings(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_disjunction(&mut self, node: &Disjunction) { + if self.enabled { + ::visit_disjunction(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_dot(&mut self, node: &Dot) { + if self.enabled { + ::visit_dot(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_ignore_group(&mut self, node: &IgnoreGroup) { + if self.enabled { + ::visit_ignore_group(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_indexed_reference(&mut self, node: &IndexedReference) { + if self.enabled { + ::visit_indexed_reference(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) { + if self.enabled { + ::visit_look_around_assertion(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) { + if self.enabled { + ::visit_look_around_assertion_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_modifier(&mut self, node: &Modifier) { + if self.enabled { + ::visit_modifier(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_modifiers(&mut self, node: &Modifiers) { + if self.enabled { + ::visit_modifiers(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_named_reference(&mut self, node: &NamedReference) { + if self.enabled { + ::visit_named_reference(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_opt_atom(&mut self, node: &Option) { + if self.enabled { + ::visit_opt_atom(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_opt_modifiers(&mut self, node: &Option) { + if self.enabled { + ::visit_opt_modifiers(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_pattern(&mut self, node: &Pattern) { + if self.enabled { + ::visit_pattern(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_quantifier(&mut self, node: &Quantifier) { + if self.enabled { + ::visit_quantifier(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_span(&mut self, node: &swc_common::Span) { + if self.enabled { + ::visit_span(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_term(&mut self, node: &Term) { + if self.enabled { + ::visit_term(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_terms(&mut self, node: &[Term]) { + if self.enabled { + ::visit_terms(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) { + if self.enabled { + ::visit_unicode_property_escape(&mut self.visitor, node) + } else { + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +pub trait VisitWith { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn visit_with(&self, visitor: &mut V); + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn visit_children_with(&self, visitor: &mut V); +} +impl VisitWith for Alternative { + #[doc = "Calls [Visit`::visit_alternative`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_alternative(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Alternative { span, body } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for BoundaryAssertion { + #[doc = "Calls [Visit`::visit_boundary_assertion`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_boundary_assertion(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + BoundaryAssertion { span, kind } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(kind, visitor) + }; + } + } + } +} +impl VisitWith for BoundaryAssertionKind { + #[doc = "Calls [Visit`::visit_boundary_assertion_kind`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_boundary_assertion_kind(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + BoundaryAssertionKind::Start => {} + BoundaryAssertionKind::End => {} + BoundaryAssertionKind::Boundary => {} + BoundaryAssertionKind::NegativeBoundary => {} + } + } +} +impl VisitWith for CapturingGroup { + #[doc = "Calls [Visit`::visit_capturing_group`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_capturing_group(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CapturingGroup { span, name, body } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(name, visitor) + }; + { + >::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for Character { + #[doc = "Calls [Visit`::visit_character`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Character { span, kind, value } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(kind, visitor) + }; + } + } + } +} +impl VisitWith for CharacterClass { + #[doc = "Calls [Visit`::visit_character_class`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(kind, visitor) + }; + { + as VisitWith>::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for CharacterClassContents { + #[doc = "Calls [Visit`::visit_character_class_contents`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_contents(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + CharacterClassContents::Character { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + } + } +} +impl VisitWith for CharacterClassContentsKind { + #[doc = "Calls [Visit`::visit_character_class_contents_kind`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_contents_kind(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClassContentsKind::Union => {} + CharacterClassContentsKind::Intersection => {} + CharacterClassContentsKind::Subtraction => {} + } + } +} +impl VisitWith for CharacterClassEscape { + #[doc = "Calls [Visit`::visit_character_class_escape`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_escape(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClassEscape { span, kind } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(kind, visitor) + }; + } + } + } +} +impl VisitWith for CharacterClassEscapeKind { + #[doc = "Calls [Visit`::visit_character_class_escape_kind`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_escape_kind(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClassEscapeKind::D => {} + CharacterClassEscapeKind::NegativeD => {} + CharacterClassEscapeKind::S => {} + CharacterClassEscapeKind::NegativeS => {} + CharacterClassEscapeKind::W => {} + CharacterClassEscapeKind::NegativeW => {} + } + } +} +impl VisitWith for CharacterClassRange { + #[doc = "Calls [Visit`::visit_character_class_range`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_range(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterClassRange { span, min, max } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(min, visitor) + }; + { + >::visit_with(max, visitor) + }; + } + } + } +} +impl VisitWith for CharacterKind { + #[doc = "Calls [Visit`::visit_character_kind`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_kind(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + CharacterKind::ControlLetter => {} + CharacterKind::HexadecimalEscape => {} + CharacterKind::Identifier => {} + CharacterKind::Null => {} + CharacterKind::Octal1 => {} + CharacterKind::Octal2 => {} + CharacterKind::Octal3 => {} + CharacterKind::SingleEscape => {} + CharacterKind::Symbol => {} + CharacterKind::UnicodeEscape => {} + } + } +} +impl VisitWith for ClassString { + #[doc = "Calls [Visit`::visit_class_string`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_class_string(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ClassString { + span, + strings, + body, + } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for ClassStringDisjunction { + #[doc = "Calls [Visit`::visit_class_string_disjunction`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_class_string_disjunction(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for Disjunction { + #[doc = "Calls [Visit`::visit_disjunction`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_disjunction(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Disjunction { span, body } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for Dot { + #[doc = "Calls [Visit`::visit_dot`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_dot(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Dot { span } => { + { + >::visit_with(span, visitor) + }; + } + } + } +} +impl VisitWith for IgnoreGroup { + #[doc = "Calls [Visit`::visit_ignore_group`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_ignore_group(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(modifiers, visitor) + }; + { + >::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for IndexedReference { + #[doc = "Calls [Visit`::visit_indexed_reference`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_indexed_reference(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + IndexedReference { span, index } => { + { + >::visit_with(span, visitor) + }; + } + } + } +} +impl VisitWith for LookAroundAssertion { + #[doc = "Calls [Visit`::visit_look_around_assertion`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_look_around_assertion(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + LookAroundAssertion { span, kind, body } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(kind, visitor) + }; + { + >::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for LookAroundAssertionKind { + #[doc = "Calls [Visit`::visit_look_around_assertion_kind`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_look_around_assertion_kind(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + LookAroundAssertionKind::Lookahead => {} + LookAroundAssertionKind::NegativeLookahead => {} + LookAroundAssertionKind::Lookbehind => {} + LookAroundAssertionKind::NegativeLookbehind => {} + } + } +} +impl VisitWith for Modifiers { + #[doc = "Calls [Visit`::visit_modifiers`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_modifiers(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(enabling, visitor) + }; + { + >::visit_with(disabling, visitor) + }; + } + } + } +} +impl VisitWith for NamedReference { + #[doc = "Calls [Visit`::visit_named_reference`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_named_reference(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + NamedReference { span, name } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(name, visitor) + }; + } + } + } +} +impl VisitWith for Pattern { + #[doc = "Calls [Visit`::visit_pattern`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_pattern(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Pattern { span, body } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for Quantifier { + #[doc = "Calls [Visit`::visit_quantifier`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_quantifier(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(body, visitor) + }; + } + } + } +} +impl VisitWith for Term { + #[doc = "Calls [Visit`::visit_term`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_term(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::LookAroundAssertion { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::Quantifier { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::Character { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::Dot { 0: _field_0 } => { + >::visit_with(_field_0, visitor); + } + Term::CharacterClassEscape { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::CharacterClass { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::CapturingGroup { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::IgnoreGroup { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::IndexedReference { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + Term::NamedReference { 0: _field_0 } => { + as VisitWith>::visit_with(_field_0, visitor); + } + } + } +} +impl VisitWith for UnicodePropertyEscape { + #[doc = "Calls [Visit`::visit_unicode_property_escape`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_unicode_property_escape(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(name, visitor) + }; + { + as VisitWith>::visit_with(value, visitor) + }; + } + } + } +} +impl VisitWith for [Alternative] { + #[doc = "Calls [Visit`::visit_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_alternatives(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + self.iter() + .for_each(|item| >::visit_with(item, visitor)) + } +} +impl VisitWith for swc_atoms::Atom { + #[doc = "Calls [Visit`::visit_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_atom(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + {} + } +} +impl VisitWith for [CharacterClassContents] { + #[doc = "Calls [Visit`::visit_character_class_contentss`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_character_class_contentss(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + self.iter() + .for_each(|item| >::visit_with(item, visitor)) + } +} +impl VisitWith for [Character] { + #[doc = "Calls [Visit`::visit_characters`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_characters(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + self.iter() + .for_each(|item| >::visit_with(item, visitor)) + } +} +impl VisitWith for [ClassString] { + #[doc = "Calls [Visit`::visit_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_class_strings(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + self.iter() + .for_each(|item| >::visit_with(item, visitor)) + } +} +impl VisitWith for Modifier { + #[doc = "Calls [Visit`::visit_modifier`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_modifier(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + {} + } +} +impl VisitWith for Option { + #[doc = "Calls [Visit`::visit_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_opt_atom(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + match self { + Some(inner) => >::visit_with(inner, visitor), + None => {} + } + } +} +impl VisitWith for Option { + #[doc = "Calls [Visit`::visit_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_opt_modifiers(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + match self { + Some(inner) => >::visit_with(inner, visitor), + None => {} + } + } +} +impl VisitWith for swc_common::Span { + #[doc = "Calls [Visit`::visit_span`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_span(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + {} + } +} +impl VisitWith for [Term] { + #[doc = "Calls [Visit`::visit_terms`] with `self`. (Extra impl)"] + #[inline] + fn visit_with(&self, visitor: &mut V) { + ::visit_terms(visitor, self) + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + self.iter() + .for_each(|item| >::visit_with(item, visitor)) + } +} +impl VisitWith for std::boxed::Box +where + V: ?Sized + Visit, + T: VisitWith, +{ + #[inline] + fn visit_with(&self, visitor: &mut V) { + let v = >::visit_with(&**self, visitor); + v + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + let v = >::visit_children_with(&**self, visitor); + v + } +} +impl VisitWith for std::vec::Vec +where + V: ?Sized + Visit, + [T]: VisitWith, +{ + #[inline] + fn visit_with(&self, visitor: &mut V) { + let v = <[T] as VisitWith>::visit_with(self, visitor); + v + } + + #[inline] + fn visit_children_with(&self, visitor: &mut V) { + let v = <[T] as VisitWith>::visit_children_with(self, visitor); + v + } +} +#[doc = r" A visitor trait for traversing the AST."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait VisitAstPath { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_alternative<'ast: 'r, 'r>( + &mut self, + node: &'ast Alternative, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_alternatives<'ast: 'r, 'r>( + &mut self, + node: &'ast [Alternative], + __ast_path: &mut AstNodePath<'r>, + ) { + <[Alternative] as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_atoms::Atom, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_boundary_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_boundary_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_capturing_group<'ast: 'r, 'r>( + &mut self, + node: &'ast CapturingGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::visit_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_character<'ast: 'r, 'r>( + &mut self, + node: &'ast Character, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_character_class<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClass, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_character_class_contents<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContents, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::visit_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_character_class_contents_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContentsKind, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::visit_children_with_ast_path`]. If you want \ + to recurse, you need to call it manually."] + #[inline] + fn visit_character_class_contentss<'ast: 'r, 'r>( + &mut self, + node: &'ast [CharacterClassContents], + __ast_path: &mut AstNodePath<'r>, + ) { + <[CharacterClassContents] as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_character_class_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::visit_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_character_class_escape_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscapeKind, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_character_class_range<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassRange, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_character_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterKind, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::visit_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_characters<'ast: 'r, 'r>( + &mut self, + node: &'ast [Character], + __ast_path: &mut AstNodePath<'r>, + ) { + <[Character] as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_class_string<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassString, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_class_string_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassStringDisjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_class_strings<'ast: 'r, 'r>( + &mut self, + node: &'ast [ClassString], + __ast_path: &mut AstNodePath<'r>, + ) { + <[ClassString] as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast Disjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::visit_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_ignore_group<'ast: 'r, 'r>( + &mut self, + node: &'ast IgnoreGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_indexed_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast IndexedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_look_around_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::visit_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_look_around_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::visit_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_modifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifier, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::visit_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifiers, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_named_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast NamedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::visit_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_opt_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_opt_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + as VisitWithAstPath>::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::visit_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_pattern<'ast: 'r, 'r>( + &mut self, + node: &'ast Pattern, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_quantifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Quantifier, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_span<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_common::Span, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::visit_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) { + >::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::visit_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) { + <[Term] as VisitWithAstPath>::visit_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_unicode_property_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast UnicodePropertyEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitAstPath for &mut V +where + V: ?Sized + VisitAstPath, +{ + #[inline] + fn visit_alternative<'ast: 'r, 'r>( + &mut self, + node: &'ast Alternative, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_alternatives<'ast: 'r, 'r>( + &mut self, + node: &'ast [Alternative], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_atoms::Atom, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_boundary_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_boundary_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_capturing_group<'ast: 'r, 'r>( + &mut self, + node: &'ast CapturingGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character<'ast: 'r, 'r>( + &mut self, + node: &'ast Character, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClass, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contents<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContents, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contents_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContentsKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contentss<'ast: 'r, 'r>( + &mut self, + node: &'ast [CharacterClassContents], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_escape_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscapeKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_range<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassRange, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_characters<'ast: 'r, 'r>( + &mut self, + node: &'ast [Character], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_string<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassString, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_string_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassStringDisjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_strings<'ast: 'r, 'r>( + &mut self, + node: &'ast [ClassString], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast Disjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) { + ::visit_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_ignore_group<'ast: 'r, 'r>( + &mut self, + node: &'ast IgnoreGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_indexed_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast IndexedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_look_around_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_look_around_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_modifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifier, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifiers, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_named_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast NamedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_opt_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_opt_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_pattern<'ast: 'r, 'r>( + &mut self, + node: &'ast Pattern, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_quantifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Quantifier, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_span<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_common::Span, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_span(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) { + ::visit_term(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) { + ::visit_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_unicode_property_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast UnicodePropertyEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitAstPath for Box +where + V: ?Sized + VisitAstPath, +{ + #[inline] + fn visit_alternative<'ast: 'r, 'r>( + &mut self, + node: &'ast Alternative, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_alternatives<'ast: 'r, 'r>( + &mut self, + node: &'ast [Alternative], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_atoms::Atom, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_boundary_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_boundary_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_capturing_group<'ast: 'r, 'r>( + &mut self, + node: &'ast CapturingGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character<'ast: 'r, 'r>( + &mut self, + node: &'ast Character, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClass, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contents<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContents, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contents_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContentsKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_contentss<'ast: 'r, 'r>( + &mut self, + node: &'ast [CharacterClassContents], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_escape_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscapeKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_class_range<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassRange, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_character_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_characters<'ast: 'r, 'r>( + &mut self, + node: &'ast [Character], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_string<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassString, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_string_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassStringDisjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_class_strings<'ast: 'r, 'r>( + &mut self, + node: &'ast [ClassString], + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast Disjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) { + ::visit_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_ignore_group<'ast: 'r, 'r>( + &mut self, + node: &'ast IgnoreGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_indexed_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast IndexedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_look_around_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_look_around_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_modifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifier, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifiers, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_named_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast NamedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_opt_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_opt_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_pattern<'ast: 'r, 'r>( + &mut self, + node: &'ast Pattern, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_quantifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Quantifier, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_span<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_common::Span, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_span(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) { + ::visit_term(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) { + ::visit_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_unicode_property_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast UnicodePropertyEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitAstPath for ::swc_visit::Either +where + A: VisitAstPath, + B: VisitAstPath, +{ + #[inline] + fn visit_alternative<'ast: 'r, 'r>( + &mut self, + node: &'ast Alternative, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_alternative(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_alternative(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_alternatives<'ast: 'r, 'r>( + &mut self, + node: &'ast [Alternative], + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_alternatives(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_alternatives(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_atoms::Atom, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => VisitAstPath::visit_atom(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_atom(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_boundary_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_boundary_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_boundary_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_boundary_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_boundary_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_boundary_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_capturing_group<'ast: 'r, 'r>( + &mut self, + node: &'ast CapturingGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_capturing_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_capturing_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character<'ast: 'r, 'r>( + &mut self, + node: &'ast Character, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClass, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_contents<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContents, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_contents(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_contents(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_contents_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContentsKind, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_contents_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_contents_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_contentss<'ast: 'r, 'r>( + &mut self, + node: &'ast [CharacterClassContents], + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_contentss(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_contentss(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_escape(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_escape_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscapeKind, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_escape_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_escape_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_class_range<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassRange, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_class_range(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_class_range(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_character_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterKind, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_character_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_character_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_characters<'ast: 'r, 'r>( + &mut self, + node: &'ast [Character], + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_characters(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_characters(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_class_string<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassString, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_class_string(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_class_string(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_class_string_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassStringDisjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_class_string_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_class_string_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_class_strings<'ast: 'r, 'r>( + &mut self, + node: &'ast [ClassString], + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_class_strings(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_class_strings(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast Disjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) { + match self { + swc_visit::Either::Left(visitor) => VisitAstPath::visit_dot(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => VisitAstPath::visit_dot(visitor, node, __ast_path), + } + } + + #[inline] + fn visit_ignore_group<'ast: 'r, 'r>( + &mut self, + node: &'ast IgnoreGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_ignore_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_ignore_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_indexed_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast IndexedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_indexed_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_indexed_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_look_around_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_look_around_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_look_around_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_look_around_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_look_around_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_look_around_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_modifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifier, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_modifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_modifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifiers, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_named_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast NamedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_named_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_named_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_opt_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_opt_atom(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_opt_atom(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_opt_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_opt_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_opt_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_pattern<'ast: 'r, 'r>( + &mut self, + node: &'ast Pattern, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_pattern(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_pattern(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_quantifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Quantifier, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_quantifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_quantifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_span<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_common::Span, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => VisitAstPath::visit_span(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_span(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) { + match self { + swc_visit::Either::Left(visitor) => VisitAstPath::visit_term(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_term(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_terms(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_terms(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_unicode_property_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast UnicodePropertyEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_unicode_property_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_unicode_property_escape(visitor, node, __ast_path) + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitAstPath for ::swc_visit::Optional +where + V: VisitAstPath, +{ + #[inline] + fn visit_alternative<'ast: 'r, 'r>( + &mut self, + node: &'ast Alternative, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_alternative(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_alternatives<'ast: 'r, 'r>( + &mut self, + node: &'ast [Alternative], + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_alternatives(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_atoms::Atom, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_atom(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_boundary_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_boundary_assertion(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_boundary_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast BoundaryAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_boundary_assertion_kind(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_capturing_group<'ast: 'r, 'r>( + &mut self, + node: &'ast CapturingGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_capturing_group(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character<'ast: 'r, 'r>( + &mut self, + node: &'ast Character, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character_class<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClass, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character_class_contents<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContents, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_contents(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character_class_contents_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassContentsKind, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_contents_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_character_class_contentss<'ast: 'r, 'r>( + &mut self, + node: &'ast [CharacterClassContents], + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_contentss( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_character_class_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_escape(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character_class_escape_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassEscapeKind, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_escape_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_character_class_range<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterClassRange, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_class_range(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_character_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast CharacterKind, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_character_kind(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_characters<'ast: 'r, 'r>( + &mut self, + node: &'ast [Character], + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_characters(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_class_string<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassString, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_class_string(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_class_string_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast ClassStringDisjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_class_string_disjunction(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_class_strings<'ast: 'r, 'r>( + &mut self, + node: &'ast [ClassString], + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_class_strings(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_disjunction<'ast: 'r, 'r>( + &mut self, + node: &'ast Disjunction, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_disjunction(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) { + if self.enabled { + ::visit_dot(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_ignore_group<'ast: 'r, 'r>( + &mut self, + node: &'ast IgnoreGroup, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_ignore_group(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_indexed_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast IndexedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_indexed_reference(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_look_around_assertion<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertion, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_look_around_assertion(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_look_around_assertion_kind<'ast: 'r, 'r>( + &mut self, + node: &'ast LookAroundAssertionKind, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_look_around_assertion_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_modifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifier, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_modifier(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Modifiers, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_modifiers(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_named_reference<'ast: 'r, 'r>( + &mut self, + node: &'ast NamedReference, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_named_reference(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_opt_atom<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_opt_atom(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_opt_modifiers<'ast: 'r, 'r>( + &mut self, + node: &'ast Option, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_opt_modifiers(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_pattern<'ast: 'r, 'r>( + &mut self, + node: &'ast Pattern, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_pattern(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_quantifier<'ast: 'r, 'r>( + &mut self, + node: &'ast Quantifier, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_quantifier(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_span<'ast: 'r, 'r>( + &mut self, + node: &'ast swc_common::Span, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_span(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) { + if self.enabled { + ::visit_term(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) { + if self.enabled { + ::visit_terms(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_unicode_property_escape<'ast: 'r, 'r>( + &mut self, + node: &'ast UnicodePropertyEscape, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_unicode_property_escape(&mut self.visitor, node, __ast_path) + } else { + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait VisitWithAstPath { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ); + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ); +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Alternative { + #[doc = "Calls [VisitAstPath`::visit_alternative`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternative(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Alternative { span, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Alternative( + self, + self::fields::AlternativeField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Alternative( + self, + self::fields::AlternativeField::Body(usize::MAX), + )); + as VisitWithAstPath>::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for BoundaryAssertion { + #[doc = "Calls [VisitAstPath`::visit_boundary_assertion`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + BoundaryAssertion { span, kind } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::BoundaryAssertion( + self, + self::fields::BoundaryAssertionField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::BoundaryAssertion( + self, + self::fields::BoundaryAssertionField::Kind, + )); + >::visit_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for BoundaryAssertionKind { + #[doc = "Calls [VisitAstPath`::visit_boundary_assertion_kind`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_boundary_assertion_kind(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + BoundaryAssertionKind::Start => {} + BoundaryAssertionKind::End => {} + BoundaryAssertionKind::Boundary => {} + BoundaryAssertionKind::NegativeBoundary => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CapturingGroup { + #[doc = "Calls [VisitAstPath`::visit_capturing_group`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_capturing_group(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CapturingGroup { span, name, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup( + self, + self::fields::CapturingGroupField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup( + self, + self::fields::CapturingGroupField::Name, + )); + as VisitWithAstPath>::visit_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup( + self, + self::fields::CapturingGroupField::Body, + )); + >::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Character { + #[doc = "Calls [VisitAstPath`::visit_character`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Character { span, kind, value } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Character( + self, + self::fields::CharacterField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Character( + self, + self::fields::CharacterField::Kind, + )); + >::visit_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClass { + #[doc = "Calls [VisitAstPath`::visit_character_class`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass( + self, + self::fields::CharacterClassField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass( + self, + self::fields::CharacterClassField::Kind, + )); + >::visit_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass( + self, + self::fields::CharacterClassField::Body(usize::MAX), + )); + as VisitWithAstPath>::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClassContents { + #[doc = "Calls [VisitAstPath`::visit_character_class_contents`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::CharacterClassRange, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::CharacterClassEscape, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::UnicodePropertyEscape, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::Character { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::Character, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::NestedCharacterClass, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassContents( + self, + self::fields::CharacterClassContentsField::ClassStringDisjunction, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClassContentsKind { + #[doc = "Calls [VisitAstPath`::visit_character_class_contents_kind`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contents_kind(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClassContentsKind::Union => {} + CharacterClassContentsKind::Intersection => {} + CharacterClassContentsKind::Subtraction => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClassEscape { + #[doc = "Calls [VisitAstPath`::visit_character_class_escape`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClassEscape { span, kind } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassEscape( + self, + self::fields::CharacterClassEscapeField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassEscape( + self, + self::fields::CharacterClassEscapeField::Kind, + )); + >::visit_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClassEscapeKind { + #[doc = "Calls [VisitAstPath`::visit_character_class_escape_kind`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_escape_kind(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClassEscapeKind::D => {} + CharacterClassEscapeKind::NegativeD => {} + CharacterClassEscapeKind::S => {} + CharacterClassEscapeKind::NegativeS => {} + CharacterClassEscapeKind::W => {} + CharacterClassEscapeKind::NegativeW => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterClassRange { + #[doc = "Calls [VisitAstPath`::visit_character_class_range`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_range(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterClassRange { span, min, max } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassRange( + self, + self::fields::CharacterClassRangeField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassRange( + self, + self::fields::CharacterClassRangeField::Min, + )); + >::visit_with_ast_path( + min, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::CharacterClassRange( + self, + self::fields::CharacterClassRangeField::Max, + )); + >::visit_with_ast_path( + max, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for CharacterKind { + #[doc = "Calls [VisitAstPath`::visit_character_kind`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_kind(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + CharacterKind::ControlLetter => {} + CharacterKind::HexadecimalEscape => {} + CharacterKind::Identifier => {} + CharacterKind::Null => {} + CharacterKind::Octal1 => {} + CharacterKind::Octal2 => {} + CharacterKind::Octal3 => {} + CharacterKind::SingleEscape => {} + CharacterKind::Symbol => {} + CharacterKind::UnicodeEscape => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ClassString { + #[doc = "Calls [VisitAstPath`::visit_class_string`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ClassString { + span, + strings, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ClassString( + self, + self::fields::ClassStringField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ClassString( + self, + self::fields::ClassStringField::Body(usize::MAX), + )); + as VisitWithAstPath>::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ClassStringDisjunction { + #[doc = "Calls [VisitAstPath`::visit_class_string_disjunction`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_string_disjunction(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ClassStringDisjunction( + self, + self::fields::ClassStringDisjunctionField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ClassStringDisjunction( + self, + self::fields::ClassStringDisjunctionField::Body(usize::MAX), + )); + as VisitWithAstPath>::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Disjunction { + #[doc = "Calls [VisitAstPath`::visit_disjunction`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_disjunction(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Disjunction { span, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Disjunction( + self, + self::fields::DisjunctionField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Disjunction( + self, + self::fields::DisjunctionField::Body(usize::MAX), + )); + as VisitWithAstPath>::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Dot { + #[doc = "Calls [VisitAstPath`::visit_dot`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_dot(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Dot { span } => { + { + let mut __ast_path = __ast_path + .with_guard(AstParentNodeRef::Dot(self, self::fields::DotField::Span)); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for IgnoreGroup { + #[doc = "Calls [VisitAstPath`::visit_ignore_group`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_ignore_group(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup( + self, + self::fields::IgnoreGroupField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup( + self, + self::fields::IgnoreGroupField::Modifiers, + )); + as VisitWithAstPath>::visit_with_ast_path( + modifiers, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup( + self, + self::fields::IgnoreGroupField::Body, + )); + >::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for IndexedReference { + #[doc = "Calls [VisitAstPath`::visit_indexed_reference`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_indexed_reference(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + IndexedReference { span, index } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IndexedReference( + self, + self::fields::IndexedReferenceField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for LookAroundAssertion { + #[doc = "Calls [VisitAstPath`::visit_look_around_assertion`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + LookAroundAssertion { span, kind, body } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion( + self, + self::fields::LookAroundAssertionField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion( + self, + self::fields::LookAroundAssertionField::Kind, + )); + >::visit_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion( + self, + self::fields::LookAroundAssertionField::Body, + )); + >::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for LookAroundAssertionKind { + #[doc = "Calls [VisitAstPath`::visit_look_around_assertion_kind`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_look_around_assertion_kind(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + LookAroundAssertionKind::Lookahead => {} + LookAroundAssertionKind::NegativeLookahead => {} + LookAroundAssertionKind::Lookbehind => {} + LookAroundAssertionKind::NegativeLookbehind => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Modifiers { + #[doc = "Calls [VisitAstPath`::visit_modifiers`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifiers(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers( + self, + self::fields::ModifiersField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers( + self, + self::fields::ModifiersField::Enabling, + )); + >::visit_with_ast_path( + enabling, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers( + self, + self::fields::ModifiersField::Disabling, + )); + >::visit_with_ast_path( + disabling, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for NamedReference { + #[doc = "Calls [VisitAstPath`::visit_named_reference`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_named_reference(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + NamedReference { span, name } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::NamedReference( + self, + self::fields::NamedReferenceField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::NamedReference( + self, + self::fields::NamedReferenceField::Name, + )); + >::visit_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Pattern { + #[doc = "Calls [VisitAstPath`::visit_pattern`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_pattern(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Pattern { span, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Pattern( + self, + self::fields::PatternField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Pattern( + self, + self::fields::PatternField::Body, + )); + >::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Quantifier { + #[doc = "Calls [VisitAstPath`::visit_quantifier`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_quantifier(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Quantifier( + self, + self::fields::QuantifierField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Quantifier( + self, + self::fields::QuantifierField::Body, + )); + >::visit_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Term { + #[doc = "Calls [VisitAstPath`::visit_term`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_term(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::BoundaryAssertion, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::LookAroundAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::LookAroundAssertion, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Quantifier { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::Quantifier, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Character { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::Character, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Dot { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentNodeRef::Term(self, self::fields::TermField::Dot)); + >::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::CharacterClassEscape, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::UnicodePropertyEscape, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CharacterClass { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::CharacterClass, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CapturingGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::CapturingGroup, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::IgnoreGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::IgnoreGroup, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::IndexedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::IndexedReference, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::NamedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term( + self, + self::fields::TermField::NamedReference, + )); + as VisitWithAstPath>::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for UnicodePropertyEscape { + #[doc = "Calls [VisitAstPath`::visit_unicode_property_escape`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_unicode_property_escape(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape( + self, + self::fields::UnicodePropertyEscapeField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape( + self, + self::fields::UnicodePropertyEscapeField::Name, + )); + >::visit_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape( + self, + self::fields::UnicodePropertyEscapeField::Value, + )); + as VisitWithAstPath>::visit_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for [Alternative] { + #[doc = "Calls [VisitAstPath`::visit_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_alternatives(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + self.iter().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for swc_atoms::Atom { + #[doc = "Calls [VisitAstPath`::visit_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_atom(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for [CharacterClassContents] { + #[doc = "Calls [VisitAstPath`::visit_character_class_contentss`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_character_class_contentss(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + self.iter().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for [Character] { + #[doc = "Calls [VisitAstPath`::visit_characters`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_characters(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + self.iter().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_with_ast_path(item, visitor, &mut *__ast_path) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for [ClassString] { + #[doc = "Calls [VisitAstPath`::visit_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_class_strings(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + self.iter().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Modifier { + #[doc = "Calls [VisitAstPath`::visit_modifier`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_modifier(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Option { + #[doc = "Calls [VisitAstPath`::visit_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_atom(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Some(inner) => >::visit_with_ast_path( + inner, visitor, __ast_path, + ), + None => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for Option { + #[doc = "Calls [VisitAstPath`::visit_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_opt_modifiers(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + Some(inner) => { + >::visit_with_ast_path(inner, visitor, __ast_path) + } + None => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for swc_common::Span { + #[doc = "Calls [VisitAstPath`::visit_span`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_span(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for [Term] { + #[doc = "Calls [VisitAstPath`::visit_terms`] with `self`. (Extra impl)"] + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_terms(visitor, self, __ast_path) + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + self.iter().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_with_ast_path(item, visitor, &mut *__ast_path) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for std::boxed::Box +where + V: ?Sized + VisitAstPath, + T: VisitWithAstPath, +{ + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + let v = >::visit_with_ast_path(&**self, visitor, __ast_path); + v + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + let v = + >::visit_children_with_ast_path(&**self, visitor, __ast_path); + v + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for std::vec::Vec +where + V: ?Sized + VisitAstPath, + [T]: VisitWithAstPath, +{ + #[inline] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + let v = <[T] as VisitWithAstPath>::visit_with_ast_path(self, visitor, __ast_path); + v + } + + #[inline] + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + let v = + <[T] as VisitWithAstPath>::visit_children_with_ast_path(self, visitor, __ast_path); + v + } +} +#[doc = r" A visitor trait for traversing the AST."] +pub trait VisitMut { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_alternatives(&mut self, node: &mut Vec) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::visit_mut_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_character(&mut self, node: &mut Character) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::visit_mut_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_character_class(&mut self, node: &mut CharacterClass) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::visit_mut_children_with`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::visit_mut_children_with`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_mut_character_class_contentss(&mut self, node: &mut Vec) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::visit_mut_children_with`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::visit_mut_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_class_strings(&mut self, node: &mut Vec) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::visit_mut_children_with`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::visit_mut_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_named_reference(&mut self, node: &mut NamedReference) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::visit_mut_children_with`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_opt_atom(&mut self, node: &mut Option) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_opt_modifiers(&mut self, node: &mut Option) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::visit_mut_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_term(&mut self, node: &mut Term) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::visit_mut_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec) { + as VisitMutWith>::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) { + >::visit_mut_children_with(node, self) + } +} +impl VisitMut for &mut V +where + V: ?Sized + VisitMut, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative) { + ::visit_mut_alternative(&mut **self, node) + } + + #[inline] + fn visit_mut_alternatives(&mut self, node: &mut Vec) { + ::visit_mut_alternatives(&mut **self, node) + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) { + ::visit_mut_atom(&mut **self, node) + } + + #[inline] + fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) { + ::visit_mut_boundary_assertion(&mut **self, node) + } + + #[inline] + fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) { + ::visit_mut_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) { + ::visit_mut_capturing_group(&mut **self, node) + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character) { + ::visit_mut_character(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class(&mut self, node: &mut CharacterClass) { + ::visit_mut_character_class(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) { + ::visit_mut_character_class_contents(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) { + ::visit_mut_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contentss(&mut self, node: &mut Vec) { + ::visit_mut_character_class_contentss(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) { + ::visit_mut_character_class_escape(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) { + ::visit_mut_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) { + ::visit_mut_character_class_range(&mut **self, node) + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) { + ::visit_mut_character_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec) { + ::visit_mut_characters(&mut **self, node) + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString) { + ::visit_mut_class_string(&mut **self, node) + } + + #[inline] + fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) { + ::visit_mut_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn visit_mut_class_strings(&mut self, node: &mut Vec) { + ::visit_mut_class_strings(&mut **self, node) + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction) { + ::visit_mut_disjunction(&mut **self, node) + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot) { + ::visit_mut_dot(&mut **self, node) + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) { + ::visit_mut_ignore_group(&mut **self, node) + } + + #[inline] + fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) { + ::visit_mut_indexed_reference(&mut **self, node) + } + + #[inline] + fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) { + ::visit_mut_look_around_assertion(&mut **self, node) + } + + #[inline] + fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) { + ::visit_mut_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier) { + ::visit_mut_modifier(&mut **self, node) + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers) { + ::visit_mut_modifiers(&mut **self, node) + } + + #[inline] + fn visit_mut_named_reference(&mut self, node: &mut NamedReference) { + ::visit_mut_named_reference(&mut **self, node) + } + + #[inline] + fn visit_mut_opt_atom(&mut self, node: &mut Option) { + ::visit_mut_opt_atom(&mut **self, node) + } + + #[inline] + fn visit_mut_opt_modifiers(&mut self, node: &mut Option) { + ::visit_mut_opt_modifiers(&mut **self, node) + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern) { + ::visit_mut_pattern(&mut **self, node) + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier) { + ::visit_mut_quantifier(&mut **self, node) + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span) { + ::visit_mut_span(&mut **self, node) + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term) { + ::visit_mut_term(&mut **self, node) + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec) { + ::visit_mut_terms(&mut **self, node) + } + + #[inline] + fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) { + ::visit_mut_unicode_property_escape(&mut **self, node) + } +} +impl VisitMut for Box +where + V: ?Sized + VisitMut, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative) { + ::visit_mut_alternative(&mut **self, node) + } + + #[inline] + fn visit_mut_alternatives(&mut self, node: &mut Vec) { + ::visit_mut_alternatives(&mut **self, node) + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) { + ::visit_mut_atom(&mut **self, node) + } + + #[inline] + fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) { + ::visit_mut_boundary_assertion(&mut **self, node) + } + + #[inline] + fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) { + ::visit_mut_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) { + ::visit_mut_capturing_group(&mut **self, node) + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character) { + ::visit_mut_character(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class(&mut self, node: &mut CharacterClass) { + ::visit_mut_character_class(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) { + ::visit_mut_character_class_contents(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) { + ::visit_mut_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_contentss(&mut self, node: &mut Vec) { + ::visit_mut_character_class_contentss(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) { + ::visit_mut_character_class_escape(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) { + ::visit_mut_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) { + ::visit_mut_character_class_range(&mut **self, node) + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) { + ::visit_mut_character_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec) { + ::visit_mut_characters(&mut **self, node) + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString) { + ::visit_mut_class_string(&mut **self, node) + } + + #[inline] + fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) { + ::visit_mut_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn visit_mut_class_strings(&mut self, node: &mut Vec) { + ::visit_mut_class_strings(&mut **self, node) + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction) { + ::visit_mut_disjunction(&mut **self, node) + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot) { + ::visit_mut_dot(&mut **self, node) + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) { + ::visit_mut_ignore_group(&mut **self, node) + } + + #[inline] + fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) { + ::visit_mut_indexed_reference(&mut **self, node) + } + + #[inline] + fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) { + ::visit_mut_look_around_assertion(&mut **self, node) + } + + #[inline] + fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) { + ::visit_mut_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier) { + ::visit_mut_modifier(&mut **self, node) + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers) { + ::visit_mut_modifiers(&mut **self, node) + } + + #[inline] + fn visit_mut_named_reference(&mut self, node: &mut NamedReference) { + ::visit_mut_named_reference(&mut **self, node) + } + + #[inline] + fn visit_mut_opt_atom(&mut self, node: &mut Option) { + ::visit_mut_opt_atom(&mut **self, node) + } + + #[inline] + fn visit_mut_opt_modifiers(&mut self, node: &mut Option) { + ::visit_mut_opt_modifiers(&mut **self, node) + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern) { + ::visit_mut_pattern(&mut **self, node) + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier) { + ::visit_mut_quantifier(&mut **self, node) + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span) { + ::visit_mut_span(&mut **self, node) + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term) { + ::visit_mut_term(&mut **self, node) + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec) { + ::visit_mut_terms(&mut **self, node) + } + + #[inline] + fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) { + ::visit_mut_unicode_property_escape(&mut **self, node) + } +} +impl VisitMut for ::swc_visit::Either +where + A: VisitMut, + B: VisitMut, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_alternative(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_alternative(visitor, node), + } + } + + #[inline] + fn visit_mut_alternatives(&mut self, node: &mut Vec) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_alternatives(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_alternatives(visitor, node), + } + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_atom(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_atom(visitor, node), + } + } + + #[inline] + fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_boundary_assertion(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_boundary_assertion(visitor, node) + } + } + } + + #[inline] + fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_boundary_assertion_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_boundary_assertion_kind(visitor, node) + } + } + } + + #[inline] + fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_capturing_group(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_capturing_group(visitor, node), + } + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character(visitor, node), + } + } + + #[inline] + fn visit_mut_character_class(&mut self, node: &mut CharacterClass) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character_class(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character_class(visitor, node), + } + } + + #[inline] + fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_contents(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_contents(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_contents_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_contents_kind(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_class_contentss(&mut self, node: &mut Vec) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_contentss(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_contentss(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_escape(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_escape(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_escape_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_escape_kind(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_character_class_range(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_character_class_range(visitor, node) + } + } + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character_kind(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character_kind(visitor, node), + } + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_characters(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_characters(visitor, node), + } + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_class_string(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_class_string(visitor, node), + } + } + + #[inline] + fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_class_string_disjunction(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_class_string_disjunction(visitor, node) + } + } + } + + #[inline] + fn visit_mut_class_strings(&mut self, node: &mut Vec) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_class_strings(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_class_strings(visitor, node), + } + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_disjunction(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_disjunction(visitor, node), + } + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_dot(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_dot(visitor, node), + } + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_ignore_group(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_ignore_group(visitor, node), + } + } + + #[inline] + fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_indexed_reference(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_indexed_reference(visitor, node) + } + } + } + + #[inline] + fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_look_around_assertion(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_look_around_assertion(visitor, node) + } + } + } + + #[inline] + fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_look_around_assertion_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_look_around_assertion_kind(visitor, node) + } + } + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_modifier(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_modifier(visitor, node), + } + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_modifiers(visitor, node), + } + } + + #[inline] + fn visit_mut_named_reference(&mut self, node: &mut NamedReference) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_named_reference(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_named_reference(visitor, node), + } + } + + #[inline] + fn visit_mut_opt_atom(&mut self, node: &mut Option) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_opt_atom(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_opt_atom(visitor, node), + } + } + + #[inline] + fn visit_mut_opt_modifiers(&mut self, node: &mut Option) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_opt_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_opt_modifiers(visitor, node), + } + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_pattern(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_pattern(visitor, node), + } + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_quantifier(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_quantifier(visitor, node), + } + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_span(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_span(visitor, node), + } + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_term(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_term(visitor, node), + } + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_terms(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_terms(visitor, node), + } + } + + #[inline] + fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_unicode_property_escape(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_unicode_property_escape(visitor, node) + } + } + } +} +impl VisitMut for ::swc_visit::Optional +where + V: VisitMut, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative) { + if self.enabled { + ::visit_mut_alternative(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_alternatives(&mut self, node: &mut Vec) { + if self.enabled { + ::visit_mut_alternatives(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) { + if self.enabled { + ::visit_mut_atom(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) { + if self.enabled { + ::visit_mut_boundary_assertion(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) { + if self.enabled { + ::visit_mut_boundary_assertion_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) { + if self.enabled { + ::visit_mut_capturing_group(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character) { + if self.enabled { + ::visit_mut_character(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class(&mut self, node: &mut CharacterClass) { + if self.enabled { + ::visit_mut_character_class(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) { + if self.enabled { + ::visit_mut_character_class_contents(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) { + if self.enabled { + ::visit_mut_character_class_contents_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contentss(&mut self, node: &mut Vec) { + if self.enabled { + ::visit_mut_character_class_contentss(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) { + if self.enabled { + ::visit_mut_character_class_escape(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) { + if self.enabled { + ::visit_mut_character_class_escape_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) { + if self.enabled { + ::visit_mut_character_class_range(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) { + if self.enabled { + ::visit_mut_character_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec) { + if self.enabled { + ::visit_mut_characters(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString) { + if self.enabled { + ::visit_mut_class_string(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) { + if self.enabled { + ::visit_mut_class_string_disjunction(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_class_strings(&mut self, node: &mut Vec) { + if self.enabled { + ::visit_mut_class_strings(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction) { + if self.enabled { + ::visit_mut_disjunction(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot) { + if self.enabled { + ::visit_mut_dot(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) { + if self.enabled { + ::visit_mut_ignore_group(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) { + if self.enabled { + ::visit_mut_indexed_reference(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) { + if self.enabled { + ::visit_mut_look_around_assertion(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) { + if self.enabled { + ::visit_mut_look_around_assertion_kind(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier) { + if self.enabled { + ::visit_mut_modifier(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers) { + if self.enabled { + ::visit_mut_modifiers(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_named_reference(&mut self, node: &mut NamedReference) { + if self.enabled { + ::visit_mut_named_reference(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_opt_atom(&mut self, node: &mut Option) { + if self.enabled { + ::visit_mut_opt_atom(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_opt_modifiers(&mut self, node: &mut Option) { + if self.enabled { + ::visit_mut_opt_modifiers(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern) { + if self.enabled { + ::visit_mut_pattern(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier) { + if self.enabled { + ::visit_mut_quantifier(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span) { + if self.enabled { + ::visit_mut_span(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term) { + if self.enabled { + ::visit_mut_term(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec) { + if self.enabled { + ::visit_mut_terms(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) { + if self.enabled { + ::visit_mut_unicode_property_escape(&mut self.visitor, node) + } else { + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +pub trait VisitMutWith { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn visit_mut_with(&mut self, visitor: &mut V); + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn visit_mut_children_with(&mut self, visitor: &mut V); +} +impl VisitMutWith for Alternative { + #[doc = "Calls [VisitMut`::visit_mut_alternative`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_alternative(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Alternative { span, body } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for BoundaryAssertion { + #[doc = "Calls [VisitMut`::visit_mut_boundary_assertion`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_boundary_assertion(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + BoundaryAssertion { span, kind } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(kind, visitor) + }; + } + } + } +} +impl VisitMutWith for BoundaryAssertionKind { + #[doc = "Calls [VisitMut`::visit_mut_boundary_assertion_kind`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_boundary_assertion_kind(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + BoundaryAssertionKind::Start => {} + BoundaryAssertionKind::End => {} + BoundaryAssertionKind::Boundary => {} + BoundaryAssertionKind::NegativeBoundary => {} + } + } +} +impl VisitMutWith for CapturingGroup { + #[doc = "Calls [VisitMut`::visit_mut_capturing_group`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_capturing_group(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CapturingGroup { span, name, body } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(name, visitor) + }; + { + >::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for Character { + #[doc = "Calls [VisitMut`::visit_mut_character`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Character { span, kind, value } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(kind, visitor) + }; + } + } + } +} +impl VisitMutWith for CharacterClass { + #[doc = "Calls [VisitMut`::visit_mut_character_class`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(kind, visitor) + }; + { + as VisitMutWith>::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for CharacterClassContents { + #[doc = "Calls [VisitMut`::visit_mut_character_class_contents`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_contents(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + CharacterClassContents::Character { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + } + } +} +impl VisitMutWith for CharacterClassContentsKind { + #[doc = "Calls [VisitMut`::visit_mut_character_class_contents_kind`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_contents_kind(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClassContentsKind::Union => {} + CharacterClassContentsKind::Intersection => {} + CharacterClassContentsKind::Subtraction => {} + } + } +} +impl VisitMutWith for CharacterClassEscape { + #[doc = "Calls [VisitMut`::visit_mut_character_class_escape`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_escape(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClassEscape { span, kind } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(kind, visitor) + }; + } + } + } +} +impl VisitMutWith for CharacterClassEscapeKind { + #[doc = "Calls [VisitMut`::visit_mut_character_class_escape_kind`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_escape_kind(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClassEscapeKind::D => {} + CharacterClassEscapeKind::NegativeD => {} + CharacterClassEscapeKind::S => {} + CharacterClassEscapeKind::NegativeS => {} + CharacterClassEscapeKind::W => {} + CharacterClassEscapeKind::NegativeW => {} + } + } +} +impl VisitMutWith for CharacterClassRange { + #[doc = "Calls [VisitMut`::visit_mut_character_class_range`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_range(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterClassRange { span, min, max } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(min, visitor) + }; + { + >::visit_mut_with(max, visitor) + }; + } + } + } +} +impl VisitMutWith for CharacterKind { + #[doc = "Calls [VisitMut`::visit_mut_character_kind`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_kind(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + CharacterKind::ControlLetter => {} + CharacterKind::HexadecimalEscape => {} + CharacterKind::Identifier => {} + CharacterKind::Null => {} + CharacterKind::Octal1 => {} + CharacterKind::Octal2 => {} + CharacterKind::Octal3 => {} + CharacterKind::SingleEscape => {} + CharacterKind::Symbol => {} + CharacterKind::UnicodeEscape => {} + } + } +} +impl VisitMutWith for ClassString { + #[doc = "Calls [VisitMut`::visit_mut_class_string`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_class_string(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ClassString { + span, + strings, + body, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for ClassStringDisjunction { + #[doc = "Calls [VisitMut`::visit_mut_class_string_disjunction`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_class_string_disjunction(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for Disjunction { + #[doc = "Calls [VisitMut`::visit_mut_disjunction`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_disjunction(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Disjunction { span, body } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for Dot { + #[doc = "Calls [VisitMut`::visit_mut_dot`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_dot(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Dot { span } => { + { + >::visit_mut_with(span, visitor) + }; + } + } + } +} +impl VisitMutWith for IgnoreGroup { + #[doc = "Calls [VisitMut`::visit_mut_ignore_group`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_ignore_group(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(modifiers, visitor) + }; + { + >::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for IndexedReference { + #[doc = "Calls [VisitMut`::visit_mut_indexed_reference`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_indexed_reference(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + IndexedReference { span, index } => { + { + >::visit_mut_with(span, visitor) + }; + } + } + } +} +impl VisitMutWith for LookAroundAssertion { + #[doc = "Calls [VisitMut`::visit_mut_look_around_assertion`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_look_around_assertion(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + LookAroundAssertion { span, kind, body } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(kind, visitor) + }; + { + >::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for LookAroundAssertionKind { + #[doc = "Calls [VisitMut`::visit_mut_look_around_assertion_kind`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_look_around_assertion_kind(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + LookAroundAssertionKind::Lookahead => {} + LookAroundAssertionKind::NegativeLookahead => {} + LookAroundAssertionKind::Lookbehind => {} + LookAroundAssertionKind::NegativeLookbehind => {} + } + } +} +impl VisitMutWith for Modifiers { + #[doc = "Calls [VisitMut`::visit_mut_modifiers`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_modifiers(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(enabling, visitor) + }; + { + >::visit_mut_with(disabling, visitor) + }; + } + } + } +} +impl VisitMutWith for NamedReference { + #[doc = "Calls [VisitMut`::visit_mut_named_reference`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_named_reference(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + NamedReference { span, name } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(name, visitor) + }; + } + } + } +} +impl VisitMutWith for Pattern { + #[doc = "Calls [VisitMut`::visit_mut_pattern`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_pattern(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Pattern { span, body } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for Quantifier { + #[doc = "Calls [VisitMut`::visit_mut_quantifier`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_quantifier(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(body, visitor) + }; + } + } + } +} +impl VisitMutWith for Term { + #[doc = "Calls [VisitMut`::visit_mut_term`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_term(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::LookAroundAssertion { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::Quantifier { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::Character { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::Dot { 0: _field_0 } => { + >::visit_mut_with(_field_0, visitor); + } + Term::CharacterClassEscape { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::CharacterClass { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::CapturingGroup { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::IgnoreGroup { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::IndexedReference { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + Term::NamedReference { 0: _field_0 } => { + as VisitMutWith>::visit_mut_with(_field_0, visitor); + } + } + } +} +impl VisitMutWith for UnicodePropertyEscape { + #[doc = "Calls [VisitMut`::visit_mut_unicode_property_escape`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_unicode_property_escape(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(name, visitor) + }; + { + as VisitMutWith>::visit_mut_with(value, visitor) + }; + } + } + } +} +impl VisitMutWith for Vec { + #[doc = "Calls [VisitMut`::visit_mut_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_alternatives(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + self.iter_mut() + .for_each(|item| >::visit_mut_with(item, visitor)) + } +} +impl VisitMutWith for swc_atoms::Atom { + #[doc = "Calls [VisitMut`::visit_mut_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_atom(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + {} + } +} +impl VisitMutWith for Vec { + #[doc = "Calls [VisitMut`::visit_mut_character_class_contentss`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_character_class_contentss(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + self.iter_mut().for_each(|item| { + >::visit_mut_with(item, visitor) + }) + } +} +impl VisitMutWith for Vec { + #[doc = "Calls [VisitMut`::visit_mut_characters`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_characters(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + self.iter_mut() + .for_each(|item| >::visit_mut_with(item, visitor)) + } +} +impl VisitMutWith for Vec { + #[doc = "Calls [VisitMut`::visit_mut_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_class_strings(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + self.iter_mut() + .for_each(|item| >::visit_mut_with(item, visitor)) + } +} +impl VisitMutWith for Modifier { + #[doc = "Calls [VisitMut`::visit_mut_modifier`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_modifier(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + {} + } +} +impl VisitMutWith for Option { + #[doc = "Calls [VisitMut`::visit_mut_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_opt_atom(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Some(inner) => >::visit_mut_with(inner, visitor), + None => {} + } + } +} +impl VisitMutWith for Option { + #[doc = "Calls [VisitMut`::visit_mut_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_opt_modifiers(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + Some(inner) => >::visit_mut_with(inner, visitor), + None => {} + } + } +} +impl VisitMutWith for swc_common::Span { + #[doc = "Calls [VisitMut`::visit_mut_span`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_span(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + {} + } +} +impl VisitMutWith for Vec { + #[doc = "Calls [VisitMut`::visit_mut_terms`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_terms(visitor, self) + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + self.iter_mut() + .for_each(|item| >::visit_mut_with(item, visitor)) + } +} +impl VisitMutWith for std::boxed::Box +where + V: ?Sized + VisitMut, + T: VisitMutWith, +{ + #[inline] + fn visit_mut_with(&mut self, visitor: &mut V) { + let v = >::visit_mut_with(&mut **self, visitor); + v + } + + #[inline] + fn visit_mut_children_with(&mut self, visitor: &mut V) { + let v = >::visit_mut_children_with(&mut **self, visitor); + v + } +} +#[doc = r" A visitor trait for traversing the AST."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait VisitMutAstPath { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_alternatives( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_boundary_assertion( + &mut self, + node: &mut BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_boundary_assertion_kind( + &mut self, + node: &mut BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_capturing_group( + &mut self, + node: &mut CapturingGroup, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_character_class( + &mut self, + node: &mut CharacterClass, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_character_class_contents( + &mut self, + node: &mut CharacterClassContents, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::visit_mut_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_mut_character_class_contents_kind( + &mut self, + node: &mut CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::visit_mut_children_with_ast_path`]. If you \ + want to recurse, you need to call it manually."] + #[inline] + fn visit_mut_character_class_contentss( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_character_class_escape( + &mut self, + node: &mut CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::visit_mut_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_mut_character_class_escape_kind( + &mut self, + node: &mut CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_character_class_range( + &mut self, + node: &mut CharacterClassRange, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_class_string_disjunction( + &mut self, + node: &mut ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_class_strings( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_indexed_reference( + &mut self, + node: &mut IndexedReference, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_look_around_assertion( + &mut self, + node: &mut LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::visit_mut_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_mut_look_around_assertion_kind( + &mut self, + node: &mut LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_named_reference( + &mut self, + node: &mut NamedReference, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::visit_mut_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn visit_mut_opt_atom( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_opt_modifiers( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + as VisitMutWithAstPath>::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_unicode_property_escape( + &mut self, + node: &mut UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutAstPath for &mut V +where + V: ?Sized + VisitMutAstPath, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) { + ::visit_mut_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_alternatives( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) { + ::visit_mut_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_boundary_assertion( + &mut self, + node: &mut BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_boundary_assertion_kind( + &mut self, + node: &mut BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_capturing_group( + &mut self, + node: &mut CapturingGroup, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) { + ::visit_mut_character(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class( + &mut self, + node: &mut CharacterClass, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_contents( + &mut self, + node: &mut CharacterClassContents, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_contents_kind( + &mut self, + node: &mut CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contents_kind( + &mut **self, + node, + __ast_path, + ) + } + + #[inline] + fn visit_mut_character_class_contentss( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_escape( + &mut self, + node: &mut CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_escape_kind( + &mut self, + node: &mut CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_range( + &mut self, + node: &mut CharacterClassRange, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) { + ::visit_mut_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + ::visit_mut_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) { + ::visit_mut_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_string_disjunction( + &mut self, + node: &mut ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_strings( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) { + ::visit_mut_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) { + ::visit_mut_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) { + ::visit_mut_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_indexed_reference( + &mut self, + node: &mut IndexedReference, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_look_around_assertion( + &mut self, + node: &mut LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_look_around_assertion_kind( + &mut self, + node: &mut LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) { + ::visit_mut_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) { + ::visit_mut_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_named_reference( + &mut self, + node: &mut NamedReference, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_opt_atom( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_opt_modifiers( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) { + ::visit_mut_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) { + ::visit_mut_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) { + ::visit_mut_span(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) { + ::visit_mut_term(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + ::visit_mut_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_unicode_property_escape( + &mut self, + node: &mut UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutAstPath for Box +where + V: ?Sized + VisitMutAstPath, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) { + ::visit_mut_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_alternatives( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) { + ::visit_mut_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_boundary_assertion( + &mut self, + node: &mut BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_boundary_assertion_kind( + &mut self, + node: &mut BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_capturing_group( + &mut self, + node: &mut CapturingGroup, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) { + ::visit_mut_character(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class( + &mut self, + node: &mut CharacterClass, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_contents( + &mut self, + node: &mut CharacterClassContents, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_contents_kind( + &mut self, + node: &mut CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contents_kind( + &mut **self, + node, + __ast_path, + ) + } + + #[inline] + fn visit_mut_character_class_contentss( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_escape( + &mut self, + node: &mut CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_escape_kind( + &mut self, + node: &mut CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_class_range( + &mut self, + node: &mut CharacterClassRange, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) { + ::visit_mut_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + ::visit_mut_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) { + ::visit_mut_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_string_disjunction( + &mut self, + node: &mut ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_class_strings( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) { + ::visit_mut_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) { + ::visit_mut_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) { + ::visit_mut_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_indexed_reference( + &mut self, + node: &mut IndexedReference, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_look_around_assertion( + &mut self, + node: &mut LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_look_around_assertion_kind( + &mut self, + node: &mut LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) { + ::visit_mut_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) { + ::visit_mut_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_named_reference( + &mut self, + node: &mut NamedReference, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_opt_atom( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_opt_modifiers( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) { + ::visit_mut_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) { + ::visit_mut_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) { + ::visit_mut_span(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) { + ::visit_mut_term(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + ::visit_mut_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_unicode_property_escape( + &mut self, + node: &mut UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutAstPath for ::swc_visit::Either +where + A: VisitMutAstPath, + B: VisitMutAstPath, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_alternative(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_alternative(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_alternatives( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_alternatives(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_alternatives(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_atom(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_atom(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_boundary_assertion( + &mut self, + node: &mut BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_boundary_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_boundary_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_boundary_assertion_kind( + &mut self, + node: &mut BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_boundary_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_boundary_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_capturing_group( + &mut self, + node: &mut CapturingGroup, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_capturing_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_capturing_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class( + &mut self, + node: &mut CharacterClass, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_contents( + &mut self, + node: &mut CharacterClassContents, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_contents(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_contents(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_contents_kind( + &mut self, + node: &mut CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_contents_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_contents_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_contentss( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_contentss(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_contentss(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_escape( + &mut self, + node: &mut CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_escape(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_escape_kind( + &mut self, + node: &mut CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_escape_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_escape_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_class_range( + &mut self, + node: &mut CharacterClassRange, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_class_range(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_class_range(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_character_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_character_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_characters(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_characters(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_class_string(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_class_string(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_class_string_disjunction( + &mut self, + node: &mut ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_class_string_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_class_string_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_class_strings( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_class_strings(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_class_strings(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_dot(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_dot(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_ignore_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_ignore_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_indexed_reference( + &mut self, + node: &mut IndexedReference, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_indexed_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_indexed_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_look_around_assertion( + &mut self, + node: &mut LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_look_around_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_look_around_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_look_around_assertion_kind( + &mut self, + node: &mut LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_look_around_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_look_around_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_modifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_modifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_named_reference( + &mut self, + node: &mut NamedReference, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_named_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_named_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_opt_atom( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_opt_atom(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_opt_atom(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_opt_modifiers( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_opt_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_opt_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_pattern(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_pattern(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_quantifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_quantifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_span(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_span(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_term(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_term(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_terms(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_terms(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_unicode_property_escape( + &mut self, + node: &mut UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_unicode_property_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_unicode_property_escape(visitor, node, __ast_path) + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutAstPath for ::swc_visit::Optional +where + V: VisitMutAstPath, +{ + #[inline] + fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_alternative(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_alternatives( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_alternatives(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_atom(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_boundary_assertion( + &mut self, + node: &mut BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_boundary_assertion( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_boundary_assertion_kind( + &mut self, + node: &mut BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_boundary_assertion_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_capturing_group( + &mut self, + node: &mut CapturingGroup, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_capturing_group(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_character(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_character_class( + &mut self, + node: &mut CharacterClass, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contents( + &mut self, + node: &mut CharacterClassContents, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_contents( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contents_kind( + &mut self, + node: &mut CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_contents_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_class_contentss( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_contentss( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_class_escape( + &mut self, + node: &mut CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_escape( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_class_escape_kind( + &mut self, + node: &mut CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_escape_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_class_range( + &mut self, + node: &mut CharacterClassRange, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_character_class_range( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_character_kind(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_characters(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_characters(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_class_string(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_class_string_disjunction( + &mut self, + node: &mut ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_class_string_disjunction( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_class_strings( + &mut self, + node: &mut Vec, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_class_strings(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_disjunction(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_dot(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_ignore_group(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_indexed_reference( + &mut self, + node: &mut IndexedReference, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_indexed_reference(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_look_around_assertion( + &mut self, + node: &mut LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_look_around_assertion( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_look_around_assertion_kind( + &mut self, + node: &mut LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_look_around_assertion_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_modifier(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_modifiers(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_named_reference( + &mut self, + node: &mut NamedReference, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_named_reference(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_opt_atom( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_opt_atom(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_opt_modifiers( + &mut self, + node: &mut Option, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_opt_modifiers(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_pattern(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_quantifier(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_span(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_term(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_terms(&mut self, node: &mut Vec, __ast_path: &mut AstKindPath) { + if self.enabled { + ::visit_mut_terms(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_unicode_property_escape( + &mut self, + node: &mut UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_unicode_property_escape( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait VisitMutWithAstPath { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath); + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath); +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Alternative { + #[doc = "Calls [VisitMutAstPath`::visit_mut_alternative`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_alternative(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Alternative { span, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative( + self::fields::AlternativeField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative( + self::fields::AlternativeField::Body(usize::MAX), + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for BoundaryAssertion { + #[doc = "Calls [VisitMutAstPath`::visit_mut_boundary_assertion`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_boundary_assertion(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + BoundaryAssertion { span, kind } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion( + self::fields::BoundaryAssertionField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion( + self::fields::BoundaryAssertionField::Kind, + )); + >::visit_mut_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for BoundaryAssertionKind { + #[doc = "Calls [VisitMutAstPath`::visit_mut_boundary_assertion_kind`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_boundary_assertion_kind(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + BoundaryAssertionKind::Start => {} + BoundaryAssertionKind::End => {} + BoundaryAssertionKind::Boundary => {} + BoundaryAssertionKind::NegativeBoundary => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CapturingGroup { + #[doc = "Calls [VisitMutAstPath`::visit_mut_capturing_group`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_capturing_group(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CapturingGroup { span, name, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Name, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Body, + )); + >::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Character { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Character { span, kind, value } => { + { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Character(self::fields::CharacterField::Span)); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Character(self::fields::CharacterField::Kind)); + >::visit_mut_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClass { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Kind, + )); + >::visit_mut_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Body(usize::MAX), + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClassContents { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contents`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_contents(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::CharacterClassRange, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::CharacterClassEscape, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::UnicodePropertyEscape, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::Character { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::Character, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::NestedCharacterClass, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::ClassStringDisjunction, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClassContentsKind { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contents_kind`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_contents_kind(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClassContentsKind::Union => {} + CharacterClassContentsKind::Intersection => {} + CharacterClassContentsKind::Subtraction => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClassEscape { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_escape`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_escape(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClassEscape { span, kind } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::CharacterClassEscape( + self::fields::CharacterClassEscapeField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::CharacterClassEscape( + self::fields::CharacterClassEscapeField::Kind, + )); + >::visit_mut_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClassEscapeKind { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_escape_kind`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_escape_kind(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClassEscapeKind::D => {} + CharacterClassEscapeKind::NegativeD => {} + CharacterClassEscapeKind::S => {} + CharacterClassEscapeKind::NegativeS => {} + CharacterClassEscapeKind::W => {} + CharacterClassEscapeKind::NegativeW => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterClassRange { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_range`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_range(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterClassRange { span, min, max } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Min, + )); + >::visit_mut_with_ast_path( + min, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Max, + )); + >::visit_mut_with_ast_path( + max, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for CharacterKind { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_kind`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_kind(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + CharacterKind::ControlLetter => {} + CharacterKind::HexadecimalEscape => {} + CharacterKind::Identifier => {} + CharacterKind::Null => {} + CharacterKind::Octal1 => {} + CharacterKind::Octal2 => {} + CharacterKind::Octal3 => {} + CharacterKind::SingleEscape => {} + CharacterKind::Symbol => {} + CharacterKind::UnicodeEscape => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ClassString { + #[doc = "Calls [VisitMutAstPath`::visit_mut_class_string`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_class_string(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ClassString { + span, + strings, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString( + self::fields::ClassStringField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString( + self::fields::ClassStringField::Body(usize::MAX), + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ClassStringDisjunction { + #[doc = "Calls [VisitMutAstPath`::visit_mut_class_string_disjunction`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_class_string_disjunction(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ClassStringDisjunction( + self::fields::ClassStringDisjunctionField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ClassStringDisjunction( + self::fields::ClassStringDisjunctionField::Body(usize::MAX), + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Disjunction { + #[doc = "Calls [VisitMutAstPath`::visit_mut_disjunction`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_disjunction(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Disjunction { span, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction( + self::fields::DisjunctionField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction( + self::fields::DisjunctionField::Body(usize::MAX), + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Dot { + #[doc = "Calls [VisitMutAstPath`::visit_mut_dot`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_dot(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Dot { span } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Dot(self::fields::DotField::Span)); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for IgnoreGroup { + #[doc = "Calls [VisitMutAstPath`::visit_mut_ignore_group`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_ignore_group(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Modifiers, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + modifiers, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Body, + )); + >::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for IndexedReference { + #[doc = "Calls [VisitMutAstPath`::visit_mut_indexed_reference`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_indexed_reference(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + IndexedReference { span, index } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IndexedReference( + self::fields::IndexedReferenceField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for LookAroundAssertion { + #[doc = "Calls [VisitMutAstPath`::visit_mut_look_around_assertion`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_look_around_assertion(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + LookAroundAssertion { span, kind, body } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Kind, + )); + >::visit_mut_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Body, + )); + >::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for LookAroundAssertionKind { + #[doc = "Calls [VisitMutAstPath`::visit_mut_look_around_assertion_kind`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_look_around_assertion_kind(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + LookAroundAssertionKind::Lookahead => {} + LookAroundAssertionKind::NegativeLookahead => {} + LookAroundAssertionKind::Lookbehind => {} + LookAroundAssertionKind::NegativeLookbehind => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Modifiers { + #[doc = "Calls [VisitMutAstPath`::visit_mut_modifiers`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_modifiers(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Modifiers(self::fields::ModifiersField::Span)); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers( + self::fields::ModifiersField::Enabling, + )); + >::visit_mut_with_ast_path( + enabling, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers( + self::fields::ModifiersField::Disabling, + )); + >::visit_mut_with_ast_path( + disabling, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for NamedReference { + #[doc = "Calls [VisitMutAstPath`::visit_mut_named_reference`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_named_reference(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + NamedReference { span, name } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference( + self::fields::NamedReferenceField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference( + self::fields::NamedReferenceField::Name, + )); + >::visit_mut_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Pattern { + #[doc = "Calls [VisitMutAstPath`::visit_mut_pattern`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_pattern(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Pattern { span, body } => { + { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Pattern(self::fields::PatternField::Span)); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Pattern(self::fields::PatternField::Body)); + >::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Quantifier { + #[doc = "Calls [VisitMutAstPath`::visit_mut_quantifier`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_quantifier(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier( + self::fields::QuantifierField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier( + self::fields::QuantifierField::Body, + )); + >::visit_mut_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Term { + #[doc = "Calls [VisitMutAstPath`::visit_mut_term`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_term(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::BoundaryAssertion, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::LookAroundAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::LookAroundAssertion, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Quantifier { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Quantifier)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Character { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Character)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::Dot { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Dot)); + >::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::CharacterClassEscape, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::UnicodePropertyEscape, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CharacterClass { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::CharacterClass)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::CapturingGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::CapturingGroup)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::IgnoreGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::IgnoreGroup)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::IndexedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::IndexedReference, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + Term::NamedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::NamedReference)); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for UnicodePropertyEscape { + #[doc = "Calls [VisitMutAstPath`::visit_mut_unicode_property_escape`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_unicode_property_escape(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Name, + )); + >::visit_mut_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Value, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Vec { + #[doc = "Calls [VisitMutAstPath`::visit_mut_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_alternatives(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + self.iter_mut().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_mut_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for swc_atoms::Atom { + #[doc = "Calls [VisitMutAstPath`::visit_mut_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_atom(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Vec { + #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contentss`] with `self`. (Extra \ + impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_character_class_contentss(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + self.iter_mut().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_mut_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Vec { + #[doc = "Calls [VisitMutAstPath`::visit_mut_characters`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_characters(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + self.iter_mut().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_mut_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Vec { + #[doc = "Calls [VisitMutAstPath`::visit_mut_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_class_strings(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + self.iter_mut().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_mut_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Modifier { + #[doc = "Calls [VisitMutAstPath`::visit_mut_modifier`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_modifier(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Option { + #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_opt_atom(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Some(inner) => >::visit_mut_with_ast_path( + inner, visitor, __ast_path, + ), + None => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Option { + #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_opt_modifiers(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + Some(inner) => >::visit_mut_with_ast_path( + inner, visitor, __ast_path, + ), + None => {} + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for swc_common::Span { + #[doc = "Calls [VisitMutAstPath`::visit_mut_span`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_span(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + {} + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for Vec { + #[doc = "Calls [VisitMutAstPath`::visit_mut_terms`] with `self`. (Extra impl)"] + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_terms(visitor, self, __ast_path) + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + self.iter_mut().enumerate().for_each(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::visit_mut_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for std::boxed::Box +where + V: ?Sized + VisitMutAstPath, + T: VisitMutWithAstPath, +{ + #[inline] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + let v = >::visit_mut_with_ast_path( + &mut **self, + visitor, + __ast_path, + ); + v + } + + #[inline] + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + let v = >::visit_mut_children_with_ast_path( + &mut **self, + visitor, + __ast_path, + ); + v + } +} +#[doc = r" A visitor trait for traversing the AST."] +pub trait Fold { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_alternative(&mut self, node: Alternative) -> Alternative { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_alternatives(&mut self, node: Vec) -> Vec { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + ) -> BoundaryAssertionKind { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_character(&mut self, node: Character) -> Character { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + ) -> CharacterClassContents { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::fold_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + ) -> CharacterClassContentsKind { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::fold_children_with`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + ) -> Vec { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + ) -> CharacterClassEscapeKind { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_characters(&mut self, node: Vec) -> Vec { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_class_string(&mut self, node: ClassString) -> ClassString { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + ) -> ClassStringDisjunction { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_class_strings(&mut self, node: Vec) -> Vec { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::fold_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn fold_dot(&mut self, node: Dot) -> Dot { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + ) -> LookAroundAssertionKind { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_modifier(&mut self, node: Modifier) -> Modifier { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::fold_children_with`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_opt_atom(&mut self, node: Option) -> Option { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_opt_modifiers(&mut self, node: Option) -> Option { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::fold_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn fold_pattern(&mut self, node: Pattern) -> Pattern { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::fold_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn fold_term(&mut self, node: Term) -> Term { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::fold_children_with`]. If you want to recurse, you need to call it manually."] + #[inline] + fn fold_terms(&mut self, node: Vec) -> Vec { + as FoldWith>::fold_children_with(node, self) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + ) -> UnicodePropertyEscape { + >::fold_children_with(node, self) + } +} +impl Fold for &mut V +where + V: ?Sized + Fold, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative) -> Alternative { + ::fold_alternative(&mut **self, node) + } + + #[inline] + fn fold_alternatives(&mut self, node: Vec) -> Vec { + ::fold_alternatives(&mut **self, node) + } + + #[inline] + fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom { + ::fold_atom(&mut **self, node) + } + + #[inline] + fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion { + ::fold_boundary_assertion(&mut **self, node) + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + ) -> BoundaryAssertionKind { + ::fold_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup { + ::fold_capturing_group(&mut **self, node) + } + + #[inline] + fn fold_character(&mut self, node: Character) -> Character { + ::fold_character(&mut **self, node) + } + + #[inline] + fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass { + ::fold_character_class(&mut **self, node) + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + ) -> CharacterClassContents { + ::fold_character_class_contents(&mut **self, node) + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + ) -> CharacterClassContentsKind { + ::fold_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + ) -> Vec { + ::fold_character_class_contentss(&mut **self, node) + } + + #[inline] + fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape { + ::fold_character_class_escape(&mut **self, node) + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + ) -> CharacterClassEscapeKind { + ::fold_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange { + ::fold_character_class_range(&mut **self, node) + } + + #[inline] + fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind { + ::fold_character_kind(&mut **self, node) + } + + #[inline] + fn fold_characters(&mut self, node: Vec) -> Vec { + ::fold_characters(&mut **self, node) + } + + #[inline] + fn fold_class_string(&mut self, node: ClassString) -> ClassString { + ::fold_class_string(&mut **self, node) + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + ) -> ClassStringDisjunction { + ::fold_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn fold_class_strings(&mut self, node: Vec) -> Vec { + ::fold_class_strings(&mut **self, node) + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction { + ::fold_disjunction(&mut **self, node) + } + + #[inline] + fn fold_dot(&mut self, node: Dot) -> Dot { + ::fold_dot(&mut **self, node) + } + + #[inline] + fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup { + ::fold_ignore_group(&mut **self, node) + } + + #[inline] + fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference { + ::fold_indexed_reference(&mut **self, node) + } + + #[inline] + fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion { + ::fold_look_around_assertion(&mut **self, node) + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + ) -> LookAroundAssertionKind { + ::fold_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier) -> Modifier { + ::fold_modifier(&mut **self, node) + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers { + ::fold_modifiers(&mut **self, node) + } + + #[inline] + fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference { + ::fold_named_reference(&mut **self, node) + } + + #[inline] + fn fold_opt_atom(&mut self, node: Option) -> Option { + ::fold_opt_atom(&mut **self, node) + } + + #[inline] + fn fold_opt_modifiers(&mut self, node: Option) -> Option { + ::fold_opt_modifiers(&mut **self, node) + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern) -> Pattern { + ::fold_pattern(&mut **self, node) + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier { + ::fold_quantifier(&mut **self, node) + } + + #[inline] + fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span { + ::fold_span(&mut **self, node) + } + + #[inline] + fn fold_term(&mut self, node: Term) -> Term { + ::fold_term(&mut **self, node) + } + + #[inline] + fn fold_terms(&mut self, node: Vec) -> Vec { + ::fold_terms(&mut **self, node) + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + ) -> UnicodePropertyEscape { + ::fold_unicode_property_escape(&mut **self, node) + } +} +impl Fold for Box +where + V: ?Sized + Fold, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative) -> Alternative { + ::fold_alternative(&mut **self, node) + } + + #[inline] + fn fold_alternatives(&mut self, node: Vec) -> Vec { + ::fold_alternatives(&mut **self, node) + } + + #[inline] + fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom { + ::fold_atom(&mut **self, node) + } + + #[inline] + fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion { + ::fold_boundary_assertion(&mut **self, node) + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + ) -> BoundaryAssertionKind { + ::fold_boundary_assertion_kind(&mut **self, node) + } + + #[inline] + fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup { + ::fold_capturing_group(&mut **self, node) + } + + #[inline] + fn fold_character(&mut self, node: Character) -> Character { + ::fold_character(&mut **self, node) + } + + #[inline] + fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass { + ::fold_character_class(&mut **self, node) + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + ) -> CharacterClassContents { + ::fold_character_class_contents(&mut **self, node) + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + ) -> CharacterClassContentsKind { + ::fold_character_class_contents_kind(&mut **self, node) + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + ) -> Vec { + ::fold_character_class_contentss(&mut **self, node) + } + + #[inline] + fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape { + ::fold_character_class_escape(&mut **self, node) + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + ) -> CharacterClassEscapeKind { + ::fold_character_class_escape_kind(&mut **self, node) + } + + #[inline] + fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange { + ::fold_character_class_range(&mut **self, node) + } + + #[inline] + fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind { + ::fold_character_kind(&mut **self, node) + } + + #[inline] + fn fold_characters(&mut self, node: Vec) -> Vec { + ::fold_characters(&mut **self, node) + } + + #[inline] + fn fold_class_string(&mut self, node: ClassString) -> ClassString { + ::fold_class_string(&mut **self, node) + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + ) -> ClassStringDisjunction { + ::fold_class_string_disjunction(&mut **self, node) + } + + #[inline] + fn fold_class_strings(&mut self, node: Vec) -> Vec { + ::fold_class_strings(&mut **self, node) + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction { + ::fold_disjunction(&mut **self, node) + } + + #[inline] + fn fold_dot(&mut self, node: Dot) -> Dot { + ::fold_dot(&mut **self, node) + } + + #[inline] + fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup { + ::fold_ignore_group(&mut **self, node) + } + + #[inline] + fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference { + ::fold_indexed_reference(&mut **self, node) + } + + #[inline] + fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion { + ::fold_look_around_assertion(&mut **self, node) + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + ) -> LookAroundAssertionKind { + ::fold_look_around_assertion_kind(&mut **self, node) + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier) -> Modifier { + ::fold_modifier(&mut **self, node) + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers { + ::fold_modifiers(&mut **self, node) + } + + #[inline] + fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference { + ::fold_named_reference(&mut **self, node) + } + + #[inline] + fn fold_opt_atom(&mut self, node: Option) -> Option { + ::fold_opt_atom(&mut **self, node) + } + + #[inline] + fn fold_opt_modifiers(&mut self, node: Option) -> Option { + ::fold_opt_modifiers(&mut **self, node) + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern) -> Pattern { + ::fold_pattern(&mut **self, node) + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier { + ::fold_quantifier(&mut **self, node) + } + + #[inline] + fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span { + ::fold_span(&mut **self, node) + } + + #[inline] + fn fold_term(&mut self, node: Term) -> Term { + ::fold_term(&mut **self, node) + } + + #[inline] + fn fold_terms(&mut self, node: Vec) -> Vec { + ::fold_terms(&mut **self, node) + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + ) -> UnicodePropertyEscape { + ::fold_unicode_property_escape(&mut **self, node) + } +} +impl Fold for ::swc_visit::Either +where + A: Fold, + B: Fold, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative) -> Alternative { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_alternative(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_alternative(visitor, node), + } + } + + #[inline] + fn fold_alternatives(&mut self, node: Vec) -> Vec { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_alternatives(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_alternatives(visitor, node), + } + } + + #[inline] + fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_atom(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_atom(visitor, node), + } + } + + #[inline] + fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_boundary_assertion(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_boundary_assertion(visitor, node), + } + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + ) -> BoundaryAssertionKind { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_boundary_assertion_kind(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_boundary_assertion_kind(visitor, node), + } + } + + #[inline] + fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_capturing_group(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_capturing_group(visitor, node), + } + } + + #[inline] + fn fold_character(&mut self, node: Character) -> Character { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character(visitor, node), + } + } + + #[inline] + fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_class(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character_class(visitor, node), + } + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + ) -> CharacterClassContents { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_class_contents(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character_class_contents(visitor, node), + } + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + ) -> CharacterClassContentsKind { + match self { + swc_visit::Either::Left(visitor) => { + Fold::fold_character_class_contents_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Fold::fold_character_class_contents_kind(visitor, node) + } + } + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + ) -> Vec { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_class_contentss(visitor, node), + swc_visit::Either::Right(visitor) => { + Fold::fold_character_class_contentss(visitor, node) + } + } + } + + #[inline] + fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_class_escape(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character_class_escape(visitor, node), + } + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + ) -> CharacterClassEscapeKind { + match self { + swc_visit::Either::Left(visitor) => { + Fold::fold_character_class_escape_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Fold::fold_character_class_escape_kind(visitor, node) + } + } + } + + #[inline] + fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_class_range(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character_class_range(visitor, node), + } + } + + #[inline] + fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_character_kind(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_character_kind(visitor, node), + } + } + + #[inline] + fn fold_characters(&mut self, node: Vec) -> Vec { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_characters(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_characters(visitor, node), + } + } + + #[inline] + fn fold_class_string(&mut self, node: ClassString) -> ClassString { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_class_string(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_class_string(visitor, node), + } + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + ) -> ClassStringDisjunction { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_class_string_disjunction(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_class_string_disjunction(visitor, node), + } + } + + #[inline] + fn fold_class_strings(&mut self, node: Vec) -> Vec { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_class_strings(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_class_strings(visitor, node), + } + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_disjunction(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_disjunction(visitor, node), + } + } + + #[inline] + fn fold_dot(&mut self, node: Dot) -> Dot { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_dot(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_dot(visitor, node), + } + } + + #[inline] + fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_ignore_group(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_ignore_group(visitor, node), + } + } + + #[inline] + fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_indexed_reference(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_indexed_reference(visitor, node), + } + } + + #[inline] + fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_look_around_assertion(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_look_around_assertion(visitor, node), + } + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + ) -> LookAroundAssertionKind { + match self { + swc_visit::Either::Left(visitor) => { + Fold::fold_look_around_assertion_kind(visitor, node) + } + swc_visit::Either::Right(visitor) => { + Fold::fold_look_around_assertion_kind(visitor, node) + } + } + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier) -> Modifier { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_modifier(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_modifier(visitor, node), + } + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_modifiers(visitor, node), + } + } + + #[inline] + fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_named_reference(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_named_reference(visitor, node), + } + } + + #[inline] + fn fold_opt_atom(&mut self, node: Option) -> Option { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_opt_atom(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_opt_atom(visitor, node), + } + } + + #[inline] + fn fold_opt_modifiers(&mut self, node: Option) -> Option { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_opt_modifiers(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_opt_modifiers(visitor, node), + } + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern) -> Pattern { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_pattern(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_pattern(visitor, node), + } + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_quantifier(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_quantifier(visitor, node), + } + } + + #[inline] + fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_span(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_span(visitor, node), + } + } + + #[inline] + fn fold_term(&mut self, node: Term) -> Term { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_term(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_term(visitor, node), + } + } + + #[inline] + fn fold_terms(&mut self, node: Vec) -> Vec { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_terms(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_terms(visitor, node), + } + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + ) -> UnicodePropertyEscape { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_unicode_property_escape(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_unicode_property_escape(visitor, node), + } + } +} +impl Fold for ::swc_visit::Optional +where + V: Fold, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative) -> Alternative { + if self.enabled { + ::fold_alternative(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_alternatives(&mut self, node: Vec) -> Vec { + if self.enabled { + ::fold_alternatives(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom { + if self.enabled { + ::fold_atom(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion { + if self.enabled { + ::fold_boundary_assertion(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + ) -> BoundaryAssertionKind { + if self.enabled { + ::fold_boundary_assertion_kind(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup { + if self.enabled { + ::fold_capturing_group(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character(&mut self, node: Character) -> Character { + if self.enabled { + ::fold_character(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass { + if self.enabled { + ::fold_character_class(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + ) -> CharacterClassContents { + if self.enabled { + ::fold_character_class_contents(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + ) -> CharacterClassContentsKind { + if self.enabled { + ::fold_character_class_contents_kind(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + ) -> Vec { + if self.enabled { + ::fold_character_class_contentss(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape { + if self.enabled { + ::fold_character_class_escape(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + ) -> CharacterClassEscapeKind { + if self.enabled { + ::fold_character_class_escape_kind(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange { + if self.enabled { + ::fold_character_class_range(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind { + if self.enabled { + ::fold_character_kind(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_characters(&mut self, node: Vec) -> Vec { + if self.enabled { + ::fold_characters(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_class_string(&mut self, node: ClassString) -> ClassString { + if self.enabled { + ::fold_class_string(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + ) -> ClassStringDisjunction { + if self.enabled { + ::fold_class_string_disjunction(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_class_strings(&mut self, node: Vec) -> Vec { + if self.enabled { + ::fold_class_strings(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction { + if self.enabled { + ::fold_disjunction(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_dot(&mut self, node: Dot) -> Dot { + if self.enabled { + ::fold_dot(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup { + if self.enabled { + ::fold_ignore_group(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference { + if self.enabled { + ::fold_indexed_reference(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion { + if self.enabled { + ::fold_look_around_assertion(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + ) -> LookAroundAssertionKind { + if self.enabled { + ::fold_look_around_assertion_kind(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier) -> Modifier { + if self.enabled { + ::fold_modifier(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers { + if self.enabled { + ::fold_modifiers(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference { + if self.enabled { + ::fold_named_reference(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_opt_atom(&mut self, node: Option) -> Option { + if self.enabled { + ::fold_opt_atom(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_opt_modifiers(&mut self, node: Option) -> Option { + if self.enabled { + ::fold_opt_modifiers(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern) -> Pattern { + if self.enabled { + ::fold_pattern(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier { + if self.enabled { + ::fold_quantifier(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span { + if self.enabled { + ::fold_span(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_term(&mut self, node: Term) -> Term { + if self.enabled { + ::fold_term(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_terms(&mut self, node: Vec) -> Vec { + if self.enabled { + ::fold_terms(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + ) -> UnicodePropertyEscape { + if self.enabled { + ::fold_unicode_property_escape(&mut self.visitor, node) + } else { + node + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +pub trait FoldWith { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn fold_with(self, visitor: &mut V) -> Self; + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn fold_children_with(self, visitor: &mut V) -> Self; +} +impl FoldWith for Alternative { + #[doc = "Calls [Fold`::fold_alternative`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_alternative(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Alternative { span, body } => { + let span = { >::fold_with(span, visitor) }; + let body = { as FoldWith>::fold_with(body, visitor) }; + Alternative { span, body } + } + } + } +} +impl FoldWith for BoundaryAssertion { + #[doc = "Calls [Fold`::fold_boundary_assertion`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_boundary_assertion(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + BoundaryAssertion { span, kind } => { + let span = { >::fold_with(span, visitor) }; + let kind = { >::fold_with(kind, visitor) }; + BoundaryAssertion { span, kind } + } + } + } +} +impl FoldWith for BoundaryAssertionKind { + #[doc = "Calls [Fold`::fold_boundary_assertion_kind`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_boundary_assertion_kind(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + BoundaryAssertionKind::Start => BoundaryAssertionKind::Start, + BoundaryAssertionKind::End => BoundaryAssertionKind::End, + BoundaryAssertionKind::Boundary => BoundaryAssertionKind::Boundary, + BoundaryAssertionKind::NegativeBoundary => BoundaryAssertionKind::NegativeBoundary, + } + } +} +impl FoldWith for CapturingGroup { + #[doc = "Calls [Fold`::fold_capturing_group`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_capturing_group(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CapturingGroup { span, name, body } => { + let span = { >::fold_with(span, visitor) }; + let name = { as FoldWith>::fold_with(name, visitor) }; + let body = { >::fold_with(body, visitor) }; + CapturingGroup { span, name, body } + } + } + } +} +impl FoldWith for Character { + #[doc = "Calls [Fold`::fold_character`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Character { span, kind, value } => { + let span = { >::fold_with(span, visitor) }; + let kind = { >::fold_with(kind, visitor) }; + Character { span, kind, value } + } + } + } +} +impl FoldWith for CharacterClass { + #[doc = "Calls [Fold`::fold_character_class`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + let span = { >::fold_with(span, visitor) }; + let kind = + { >::fold_with(kind, visitor) }; + let body = + { as FoldWith>::fold_with(body, visitor) }; + CharacterClass { + span, + negative, + strings, + kind, + body, + } + } + } + } +} +impl FoldWith for CharacterClassContents { + #[doc = "Calls [Fold`::fold_character_class_contents`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_contents(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::CharacterClassRange { 0: _field_0 } + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::CharacterClassEscape { 0: _field_0 } + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } + } + CharacterClassContents::Character { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::Character { 0: _field_0 } + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::NestedCharacterClass { 0: _field_0 } + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } + } + } + } +} +impl FoldWith for CharacterClassContentsKind { + #[doc = "Calls [Fold`::fold_character_class_contents_kind`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_contents_kind(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClassContentsKind::Union => CharacterClassContentsKind::Union, + CharacterClassContentsKind::Intersection => CharacterClassContentsKind::Intersection, + CharacterClassContentsKind::Subtraction => CharacterClassContentsKind::Subtraction, + } + } +} +impl FoldWith for CharacterClassEscape { + #[doc = "Calls [Fold`::fold_character_class_escape`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_escape(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClassEscape { span, kind } => { + let span = { >::fold_with(span, visitor) }; + let kind = { >::fold_with(kind, visitor) }; + CharacterClassEscape { span, kind } + } + } + } +} +impl FoldWith for CharacterClassEscapeKind { + #[doc = "Calls [Fold`::fold_character_class_escape_kind`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_escape_kind(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClassEscapeKind::D => CharacterClassEscapeKind::D, + CharacterClassEscapeKind::NegativeD => CharacterClassEscapeKind::NegativeD, + CharacterClassEscapeKind::S => CharacterClassEscapeKind::S, + CharacterClassEscapeKind::NegativeS => CharacterClassEscapeKind::NegativeS, + CharacterClassEscapeKind::W => CharacterClassEscapeKind::W, + CharacterClassEscapeKind::NegativeW => CharacterClassEscapeKind::NegativeW, + } + } +} +impl FoldWith for CharacterClassRange { + #[doc = "Calls [Fold`::fold_character_class_range`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_range(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterClassRange { span, min, max } => { + let span = { >::fold_with(span, visitor) }; + let min = { >::fold_with(min, visitor) }; + let max = { >::fold_with(max, visitor) }; + CharacterClassRange { span, min, max } + } + } + } +} +impl FoldWith for CharacterKind { + #[doc = "Calls [Fold`::fold_character_kind`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_kind(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + CharacterKind::ControlLetter => CharacterKind::ControlLetter, + CharacterKind::HexadecimalEscape => CharacterKind::HexadecimalEscape, + CharacterKind::Identifier => CharacterKind::Identifier, + CharacterKind::Null => CharacterKind::Null, + CharacterKind::Octal1 => CharacterKind::Octal1, + CharacterKind::Octal2 => CharacterKind::Octal2, + CharacterKind::Octal3 => CharacterKind::Octal3, + CharacterKind::SingleEscape => CharacterKind::SingleEscape, + CharacterKind::Symbol => CharacterKind::Symbol, + CharacterKind::UnicodeEscape => CharacterKind::UnicodeEscape, + } + } +} +impl FoldWith for ClassString { + #[doc = "Calls [Fold`::fold_class_string`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_class_string(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ClassString { + span, + strings, + body, + } => { + let span = { >::fold_with(span, visitor) }; + let body = { as FoldWith>::fold_with(body, visitor) }; + ClassString { + span, + strings, + body, + } + } + } + } +} +impl FoldWith for ClassStringDisjunction { + #[doc = "Calls [Fold`::fold_class_string_disjunction`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_class_string_disjunction(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + let span = { >::fold_with(span, visitor) }; + let body = { as FoldWith>::fold_with(body, visitor) }; + ClassStringDisjunction { + span, + strings, + body, + } + } + } + } +} +impl FoldWith for Disjunction { + #[doc = "Calls [Fold`::fold_disjunction`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_disjunction(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Disjunction { span, body } => { + let span = { >::fold_with(span, visitor) }; + let body = { as FoldWith>::fold_with(body, visitor) }; + Disjunction { span, body } + } + } + } +} +impl FoldWith for Dot { + #[doc = "Calls [Fold`::fold_dot`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_dot(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Dot { span } => { + let span = { >::fold_with(span, visitor) }; + Dot { span } + } + } + } +} +impl FoldWith for IgnoreGroup { + #[doc = "Calls [Fold`::fold_ignore_group`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_ignore_group(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + let span = { >::fold_with(span, visitor) }; + let modifiers = + { as FoldWith>::fold_with(modifiers, visitor) }; + let body = { >::fold_with(body, visitor) }; + IgnoreGroup { + span, + modifiers, + body, + } + } + } + } +} +impl FoldWith for IndexedReference { + #[doc = "Calls [Fold`::fold_indexed_reference`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_indexed_reference(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + IndexedReference { span, index } => { + let span = { >::fold_with(span, visitor) }; + IndexedReference { span, index } + } + } + } +} +impl FoldWith for LookAroundAssertion { + #[doc = "Calls [Fold`::fold_look_around_assertion`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_look_around_assertion(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + LookAroundAssertion { span, kind, body } => { + let span = { >::fold_with(span, visitor) }; + let kind = { >::fold_with(kind, visitor) }; + let body = { >::fold_with(body, visitor) }; + LookAroundAssertion { span, kind, body } + } + } + } +} +impl FoldWith for LookAroundAssertionKind { + #[doc = "Calls [Fold`::fold_look_around_assertion_kind`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_look_around_assertion_kind(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + LookAroundAssertionKind::Lookahead => LookAroundAssertionKind::Lookahead, + LookAroundAssertionKind::NegativeLookahead => { + LookAroundAssertionKind::NegativeLookahead + } + LookAroundAssertionKind::Lookbehind => LookAroundAssertionKind::Lookbehind, + LookAroundAssertionKind::NegativeLookbehind => { + LookAroundAssertionKind::NegativeLookbehind + } + } + } +} +impl FoldWith for Modifiers { + #[doc = "Calls [Fold`::fold_modifiers`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_modifiers(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + let span = { >::fold_with(span, visitor) }; + let enabling = { >::fold_with(enabling, visitor) }; + let disabling = { >::fold_with(disabling, visitor) }; + Modifiers { + span, + enabling, + disabling, + } + } + } + } +} +impl FoldWith for NamedReference { + #[doc = "Calls [Fold`::fold_named_reference`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_named_reference(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + NamedReference { span, name } => { + let span = { >::fold_with(span, visitor) }; + let name = { >::fold_with(name, visitor) }; + NamedReference { span, name } + } + } + } +} +impl FoldWith for Pattern { + #[doc = "Calls [Fold`::fold_pattern`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_pattern(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Pattern { span, body } => { + let span = { >::fold_with(span, visitor) }; + let body = { >::fold_with(body, visitor) }; + Pattern { span, body } + } + } + } +} +impl FoldWith for Quantifier { + #[doc = "Calls [Fold`::fold_quantifier`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_quantifier(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + let span = { >::fold_with(span, visitor) }; + let body = { >::fold_with(body, visitor) }; + Quantifier { + span, + min, + max, + greedy, + body, + } + } + } + } +} +impl FoldWith for Term { + #[doc = "Calls [Fold`::fold_term`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_term(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + Term::BoundaryAssertion { 0: _field_0 } + } + Term::LookAroundAssertion { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + Term::LookAroundAssertion { 0: _field_0 } + } + Term::Quantifier { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::Quantifier { 0: _field_0 } + } + Term::Character { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::Character { 0: _field_0 } + } + Term::Dot { 0: _field_0 } => { + let _field_0 = >::fold_with(_field_0, visitor); + Term::Dot { 0: _field_0 } + } + Term::CharacterClassEscape { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + Term::CharacterClassEscape { 0: _field_0 } + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + let _field_0 = + as FoldWith>::fold_with(_field_0, visitor); + Term::UnicodePropertyEscape { 0: _field_0 } + } + Term::CharacterClass { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::CharacterClass { 0: _field_0 } + } + Term::CapturingGroup { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::CapturingGroup { 0: _field_0 } + } + Term::IgnoreGroup { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::IgnoreGroup { 0: _field_0 } + } + Term::IndexedReference { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::IndexedReference { 0: _field_0 } + } + Term::NamedReference { 0: _field_0 } => { + let _field_0 = as FoldWith>::fold_with(_field_0, visitor); + Term::NamedReference { 0: _field_0 } + } + } + } +} +impl FoldWith for UnicodePropertyEscape { + #[doc = "Calls [Fold`::fold_unicode_property_escape`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_unicode_property_escape(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + let span = { >::fold_with(span, visitor) }; + let name = { >::fold_with(name, visitor) }; + let value = { as FoldWith>::fold_with(value, visitor) }; + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } + } + } + } +} +impl FoldWith for Vec { + #[doc = "Calls [Fold`::fold_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_alternatives(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::move_map::MoveMap::move_map(self, |item| { + >::fold_with(item, visitor) + }) + } +} +impl FoldWith for swc_atoms::Atom { + #[doc = "Calls [Fold`::fold_atom`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_atom(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + self + } +} +impl FoldWith for Vec { + #[doc = "Calls [Fold`::fold_character_class_contentss`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_character_class_contentss(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::move_map::MoveMap::move_map(self, |item| { + >::fold_with(item, visitor) + }) + } +} +impl FoldWith for Vec { + #[doc = "Calls [Fold`::fold_characters`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_characters(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::move_map::MoveMap::move_map(self, |item| { + >::fold_with(item, visitor) + }) + } +} +impl FoldWith for Vec { + #[doc = "Calls [Fold`::fold_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_class_strings(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::move_map::MoveMap::move_map(self, |item| { + >::fold_with(item, visitor) + }) + } +} +impl FoldWith for Modifier { + #[doc = "Calls [Fold`::fold_modifier`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_modifier(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + self + } +} +impl FoldWith for Option { + #[doc = "Calls [Fold`::fold_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_opt_atom(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + self.map(|inner| >::fold_with(inner, visitor)) + } +} +impl FoldWith for Option { + #[doc = "Calls [Fold`::fold_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_opt_modifiers(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + self.map(|inner| >::fold_with(inner, visitor)) + } +} +impl FoldWith for swc_common::Span { + #[doc = "Calls [Fold`::fold_span`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_span(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + self + } +} +impl FoldWith for Vec { + #[doc = "Calls [Fold`::fold_terms`] with `self`. (Extra impl)"] + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_terms(visitor, self) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::move_map::MoveMap::move_map(self, |item| { + >::fold_with(item, visitor) + }) + } +} +impl FoldWith for std::boxed::Box +where + V: ?Sized + Fold, + T: FoldWith, +{ + #[inline] + fn fold_with(self, visitor: &mut V) -> Self { + swc_visit::util::map::Map::map(self, |inner| >::fold_with(inner, visitor)) + } + + #[inline] + fn fold_children_with(self, visitor: &mut V) -> Self { + swc_visit::util::map::Map::map(self, |inner| { + >::fold_children_with(inner, visitor) + }) + } +} +#[doc = r" A visitor trait for traversing the AST."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait FoldAstPath { + #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \ + [`Alternative::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \ + Alternative >::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_alternatives( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \ + [`swc_atoms :: Atom::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_atom( + &mut self, + node: swc_atoms::Atom, + __ast_path: &mut AstKindPath, + ) -> swc_atoms::Atom { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \ + [`BoundaryAssertion::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_boundary_assertion( + &mut self, + node: BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertion { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \ + [`BoundaryAssertionKind::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertionKind { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \ + [`CapturingGroup::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_capturing_group( + &mut self, + node: CapturingGroup, + __ast_path: &mut AstKindPath, + ) -> CapturingGroup { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \ + [`Character::fold_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \ + [`CharacterClass::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_character_class( + &mut self, + node: CharacterClass, + __ast_path: &mut AstKindPath, + ) -> CharacterClass { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \ + [`CharacterClassContents::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContents { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \ + [`CharacterClassContentsKind::fold_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContentsKind { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \ + calls [`Vec < CharacterClassContents >::fold_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \ + [`CharacterClassEscape::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_character_class_escape( + &mut self, + node: CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscape { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \ + [`CharacterClassEscapeKind::fold_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscapeKind { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \ + [`CharacterClassRange::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_character_class_range( + &mut self, + node: CharacterClassRange, + __ast_path: &mut AstKindPath, + ) -> CharacterClassRange { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \ + [`CharacterKind::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_character_kind( + &mut self, + node: CharacterKind, + __ast_path: &mut AstKindPath, + ) -> CharacterKind { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \ + Character >::fold_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_characters( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \ + [`ClassString::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_class_string( + &mut self, + node: ClassString, + __ast_path: &mut AstKindPath, + ) -> ClassString { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \ + [`ClassStringDisjunction::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) -> ClassStringDisjunction { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \ + ClassString >::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_class_strings( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \ + [`Disjunction::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \ + [`Dot::fold_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \ + [`IgnoreGroup::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_ignore_group( + &mut self, + node: IgnoreGroup, + __ast_path: &mut AstKindPath, + ) -> IgnoreGroup { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \ + [`IndexedReference::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_indexed_reference( + &mut self, + node: IndexedReference, + __ast_path: &mut AstKindPath, + ) -> IndexedReference { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \ + [`LookAroundAssertion::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_look_around_assertion( + &mut self, + node: LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertion { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \ + [`LookAroundAssertionKind::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertionKind { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \ + [`Modifier::fold_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \ + [`Modifiers::fold_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \ + [`NamedReference::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_named_reference( + &mut self, + node: NamedReference, + __ast_path: &mut AstKindPath, + ) -> NamedReference { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \ + [`Option < swc_atoms :: Atom >::fold_children_with_ast_path`]. If you want to \ + recurse, you need to call it manually."] + #[inline] + fn fold_opt_atom( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \ + [`Option < Modifiers >::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_opt_modifiers( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + as FoldWithAstPath>::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \ + [`Pattern::fold_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \ + [`Quantifier::fold_children_with_ast_path`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \ + [`swc_common :: Span::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_span( + &mut self, + node: swc_common::Span, + __ast_path: &mut AstKindPath, + ) -> swc_common::Span { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \ + [`Term::fold_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term { + >::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \ + >::fold_children_with_ast_path`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_terms(&mut self, node: Vec, __ast_path: &mut AstKindPath) -> Vec { + as FoldWithAstPath>::fold_children_with_ast_path(node, self, __ast_path) + } + #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \ + [`UnicodePropertyEscape::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) -> UnicodePropertyEscape { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldAstPath for &mut V +where + V: ?Sized + FoldAstPath, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative { + ::fold_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_alternatives( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_atom( + &mut self, + node: swc_atoms::Atom, + __ast_path: &mut AstKindPath, + ) -> swc_atoms::Atom { + ::fold_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_boundary_assertion( + &mut self, + node: BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertion { + ::fold_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertionKind { + ::fold_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_capturing_group( + &mut self, + node: CapturingGroup, + __ast_path: &mut AstKindPath, + ) -> CapturingGroup { + ::fold_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character { + ::fold_character(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class( + &mut self, + node: CharacterClass, + __ast_path: &mut AstKindPath, + ) -> CharacterClass { + ::fold_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContents { + ::fold_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContentsKind { + ::fold_character_class_contents_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_escape( + &mut self, + node: CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscape { + ::fold_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscapeKind { + ::fold_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_range( + &mut self, + node: CharacterClassRange, + __ast_path: &mut AstKindPath, + ) -> CharacterClassRange { + ::fold_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_kind( + &mut self, + node: CharacterKind, + __ast_path: &mut AstKindPath, + ) -> CharacterKind { + ::fold_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_characters( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_string( + &mut self, + node: ClassString, + __ast_path: &mut AstKindPath, + ) -> ClassString { + ::fold_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) -> ClassStringDisjunction { + ::fold_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_strings( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction { + ::fold_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot { + ::fold_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_ignore_group( + &mut self, + node: IgnoreGroup, + __ast_path: &mut AstKindPath, + ) -> IgnoreGroup { + ::fold_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_indexed_reference( + &mut self, + node: IndexedReference, + __ast_path: &mut AstKindPath, + ) -> IndexedReference { + ::fold_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_look_around_assertion( + &mut self, + node: LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertion { + ::fold_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertionKind { + ::fold_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier { + ::fold_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers { + ::fold_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_named_reference( + &mut self, + node: NamedReference, + __ast_path: &mut AstKindPath, + ) -> NamedReference { + ::fold_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_opt_atom( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + ::fold_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_opt_modifiers( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + ::fold_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern { + ::fold_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier { + ::fold_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_span( + &mut self, + node: swc_common::Span, + __ast_path: &mut AstKindPath, + ) -> swc_common::Span { + ::fold_span(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term { + ::fold_term(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_terms(&mut self, node: Vec, __ast_path: &mut AstKindPath) -> Vec { + ::fold_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) -> UnicodePropertyEscape { + ::fold_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldAstPath for Box +where + V: ?Sized + FoldAstPath, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative { + ::fold_alternative(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_alternatives( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_alternatives(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_atom( + &mut self, + node: swc_atoms::Atom, + __ast_path: &mut AstKindPath, + ) -> swc_atoms::Atom { + ::fold_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_boundary_assertion( + &mut self, + node: BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertion { + ::fold_boundary_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertionKind { + ::fold_boundary_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_capturing_group( + &mut self, + node: CapturingGroup, + __ast_path: &mut AstKindPath, + ) -> CapturingGroup { + ::fold_capturing_group(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character { + ::fold_character(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class( + &mut self, + node: CharacterClass, + __ast_path: &mut AstKindPath, + ) -> CharacterClass { + ::fold_character_class(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContents { + ::fold_character_class_contents(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContentsKind { + ::fold_character_class_contents_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_character_class_contentss(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_escape( + &mut self, + node: CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscape { + ::fold_character_class_escape(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscapeKind { + ::fold_character_class_escape_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_class_range( + &mut self, + node: CharacterClassRange, + __ast_path: &mut AstKindPath, + ) -> CharacterClassRange { + ::fold_character_class_range(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_character_kind( + &mut self, + node: CharacterKind, + __ast_path: &mut AstKindPath, + ) -> CharacterKind { + ::fold_character_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_characters( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_characters(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_string( + &mut self, + node: ClassString, + __ast_path: &mut AstKindPath, + ) -> ClassString { + ::fold_class_string(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) -> ClassStringDisjunction { + ::fold_class_string_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_class_strings( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + ::fold_class_strings(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction { + ::fold_disjunction(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot { + ::fold_dot(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_ignore_group( + &mut self, + node: IgnoreGroup, + __ast_path: &mut AstKindPath, + ) -> IgnoreGroup { + ::fold_ignore_group(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_indexed_reference( + &mut self, + node: IndexedReference, + __ast_path: &mut AstKindPath, + ) -> IndexedReference { + ::fold_indexed_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_look_around_assertion( + &mut self, + node: LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertion { + ::fold_look_around_assertion(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertionKind { + ::fold_look_around_assertion_kind(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier { + ::fold_modifier(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers { + ::fold_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_named_reference( + &mut self, + node: NamedReference, + __ast_path: &mut AstKindPath, + ) -> NamedReference { + ::fold_named_reference(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_opt_atom( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + ::fold_opt_atom(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_opt_modifiers( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + ::fold_opt_modifiers(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern { + ::fold_pattern(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier { + ::fold_quantifier(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_span( + &mut self, + node: swc_common::Span, + __ast_path: &mut AstKindPath, + ) -> swc_common::Span { + ::fold_span(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term { + ::fold_term(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_terms(&mut self, node: Vec, __ast_path: &mut AstKindPath) -> Vec { + ::fold_terms(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) -> UnicodePropertyEscape { + ::fold_unicode_property_escape(&mut **self, node, __ast_path) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldAstPath for ::swc_visit::Either +where + A: FoldAstPath, + B: FoldAstPath, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_alternative(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_alternative(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_alternatives( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_alternatives(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_alternatives(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_atom( + &mut self, + node: swc_atoms::Atom, + __ast_path: &mut AstKindPath, + ) -> swc_atoms::Atom { + match self { + swc_visit::Either::Left(visitor) => FoldAstPath::fold_atom(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => FoldAstPath::fold_atom(visitor, node, __ast_path), + } + } + + #[inline] + fn fold_boundary_assertion( + &mut self, + node: BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertion { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_boundary_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_boundary_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertionKind { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_boundary_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_boundary_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_capturing_group( + &mut self, + node: CapturingGroup, + __ast_path: &mut AstKindPath, + ) -> CapturingGroup { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_capturing_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_capturing_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class( + &mut self, + node: CharacterClass, + __ast_path: &mut AstKindPath, + ) -> CharacterClass { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContents { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_contents(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_contents(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContentsKind { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_contents_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_contents_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_contentss(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_contentss(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_escape( + &mut self, + node: CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscape { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_escape(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscapeKind { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_escape_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_escape_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_class_range( + &mut self, + node: CharacterClassRange, + __ast_path: &mut AstKindPath, + ) -> CharacterClassRange { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_class_range(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_class_range(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_character_kind( + &mut self, + node: CharacterKind, + __ast_path: &mut AstKindPath, + ) -> CharacterKind { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_character_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_character_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_characters( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_characters(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_characters(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_class_string( + &mut self, + node: ClassString, + __ast_path: &mut AstKindPath, + ) -> ClassString { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_class_string(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_class_string(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) -> ClassStringDisjunction { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_class_string_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_class_string_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_class_strings( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_class_strings(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_class_strings(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_disjunction(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_disjunction(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot { + match self { + swc_visit::Either::Left(visitor) => FoldAstPath::fold_dot(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => FoldAstPath::fold_dot(visitor, node, __ast_path), + } + } + + #[inline] + fn fold_ignore_group( + &mut self, + node: IgnoreGroup, + __ast_path: &mut AstKindPath, + ) -> IgnoreGroup { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_ignore_group(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_ignore_group(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_indexed_reference( + &mut self, + node: IndexedReference, + __ast_path: &mut AstKindPath, + ) -> IndexedReference { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_indexed_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_indexed_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_look_around_assertion( + &mut self, + node: LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertion { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_look_around_assertion(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_look_around_assertion(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertionKind { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_look_around_assertion_kind(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_look_around_assertion_kind(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_modifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_modifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_named_reference( + &mut self, + node: NamedReference, + __ast_path: &mut AstKindPath, + ) -> NamedReference { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_named_reference(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_named_reference(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_opt_atom( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_opt_atom(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_opt_atom(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_opt_modifiers( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_opt_modifiers(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_opt_modifiers(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_pattern(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_pattern(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_quantifier(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_quantifier(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_span( + &mut self, + node: swc_common::Span, + __ast_path: &mut AstKindPath, + ) -> swc_common::Span { + match self { + swc_visit::Either::Left(visitor) => FoldAstPath::fold_span(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => FoldAstPath::fold_span(visitor, node, __ast_path), + } + } + + #[inline] + fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term { + match self { + swc_visit::Either::Left(visitor) => FoldAstPath::fold_term(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => FoldAstPath::fold_term(visitor, node, __ast_path), + } + } + + #[inline] + fn fold_terms(&mut self, node: Vec, __ast_path: &mut AstKindPath) -> Vec { + match self { + swc_visit::Either::Left(visitor) => FoldAstPath::fold_terms(visitor, node, __ast_path), + swc_visit::Either::Right(visitor) => FoldAstPath::fold_terms(visitor, node, __ast_path), + } + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) -> UnicodePropertyEscape { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_unicode_property_escape(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_unicode_property_escape(visitor, node, __ast_path) + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldAstPath for ::swc_visit::Optional +where + V: FoldAstPath, +{ + #[inline] + fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative { + if self.enabled { + ::fold_alternative(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_alternatives( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + if self.enabled { + ::fold_alternatives(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_atom( + &mut self, + node: swc_atoms::Atom, + __ast_path: &mut AstKindPath, + ) -> swc_atoms::Atom { + if self.enabled { + ::fold_atom(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_boundary_assertion( + &mut self, + node: BoundaryAssertion, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertion { + if self.enabled { + ::fold_boundary_assertion(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_boundary_assertion_kind( + &mut self, + node: BoundaryAssertionKind, + __ast_path: &mut AstKindPath, + ) -> BoundaryAssertionKind { + if self.enabled { + ::fold_boundary_assertion_kind(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_capturing_group( + &mut self, + node: CapturingGroup, + __ast_path: &mut AstKindPath, + ) -> CapturingGroup { + if self.enabled { + ::fold_capturing_group(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character { + if self.enabled { + ::fold_character(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_class( + &mut self, + node: CharacterClass, + __ast_path: &mut AstKindPath, + ) -> CharacterClass { + if self.enabled { + ::fold_character_class(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_class_contents( + &mut self, + node: CharacterClassContents, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContents { + if self.enabled { + ::fold_character_class_contents(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_class_contents_kind( + &mut self, + node: CharacterClassContentsKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassContentsKind { + if self.enabled { + ::fold_character_class_contents_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + node + } + } + + #[inline] + fn fold_character_class_contentss( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + if self.enabled { + ::fold_character_class_contentss(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_class_escape( + &mut self, + node: CharacterClassEscape, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscape { + if self.enabled { + ::fold_character_class_escape(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_class_escape_kind( + &mut self, + node: CharacterClassEscapeKind, + __ast_path: &mut AstKindPath, + ) -> CharacterClassEscapeKind { + if self.enabled { + ::fold_character_class_escape_kind( + &mut self.visitor, + node, + __ast_path, + ) + } else { + node + } + } + + #[inline] + fn fold_character_class_range( + &mut self, + node: CharacterClassRange, + __ast_path: &mut AstKindPath, + ) -> CharacterClassRange { + if self.enabled { + ::fold_character_class_range(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_character_kind( + &mut self, + node: CharacterKind, + __ast_path: &mut AstKindPath, + ) -> CharacterKind { + if self.enabled { + ::fold_character_kind(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_characters( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + if self.enabled { + ::fold_characters(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_class_string( + &mut self, + node: ClassString, + __ast_path: &mut AstKindPath, + ) -> ClassString { + if self.enabled { + ::fold_class_string(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_class_string_disjunction( + &mut self, + node: ClassStringDisjunction, + __ast_path: &mut AstKindPath, + ) -> ClassStringDisjunction { + if self.enabled { + ::fold_class_string_disjunction(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_class_strings( + &mut self, + node: Vec, + __ast_path: &mut AstKindPath, + ) -> Vec { + if self.enabled { + ::fold_class_strings(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction { + if self.enabled { + ::fold_disjunction(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot { + if self.enabled { + ::fold_dot(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_ignore_group( + &mut self, + node: IgnoreGroup, + __ast_path: &mut AstKindPath, + ) -> IgnoreGroup { + if self.enabled { + ::fold_ignore_group(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_indexed_reference( + &mut self, + node: IndexedReference, + __ast_path: &mut AstKindPath, + ) -> IndexedReference { + if self.enabled { + ::fold_indexed_reference(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_look_around_assertion( + &mut self, + node: LookAroundAssertion, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertion { + if self.enabled { + ::fold_look_around_assertion(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_look_around_assertion_kind( + &mut self, + node: LookAroundAssertionKind, + __ast_path: &mut AstKindPath, + ) -> LookAroundAssertionKind { + if self.enabled { + ::fold_look_around_assertion_kind(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier { + if self.enabled { + ::fold_modifier(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers { + if self.enabled { + ::fold_modifiers(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_named_reference( + &mut self, + node: NamedReference, + __ast_path: &mut AstKindPath, + ) -> NamedReference { + if self.enabled { + ::fold_named_reference(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_opt_atom( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + if self.enabled { + ::fold_opt_atom(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_opt_modifiers( + &mut self, + node: Option, + __ast_path: &mut AstKindPath, + ) -> Option { + if self.enabled { + ::fold_opt_modifiers(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern { + if self.enabled { + ::fold_pattern(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier { + if self.enabled { + ::fold_quantifier(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_span( + &mut self, + node: swc_common::Span, + __ast_path: &mut AstKindPath, + ) -> swc_common::Span { + if self.enabled { + ::fold_span(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term { + if self.enabled { + ::fold_term(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_terms(&mut self, node: Vec, __ast_path: &mut AstKindPath) -> Vec { + if self.enabled { + ::fold_terms(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_unicode_property_escape( + &mut self, + node: UnicodePropertyEscape, + __ast_path: &mut AstKindPath, + ) -> UnicodePropertyEscape { + if self.enabled { + ::fold_unicode_property_escape(&mut self.visitor, node, __ast_path) + } else { + node + } + } +} +#[doc = r" A trait implemented for types that can be visited using a visitor."] +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +pub trait FoldWithAstPath { + #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self; + #[doc = r" Visit children nodes of `self`` with `visitor`."] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self; +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Alternative { + #[doc = "Calls [FoldAstPath`::fold_alternative`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_alternative(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Alternative { span, body } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative( + self::fields::AlternativeField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative( + self::fields::AlternativeField::Body(usize::MAX), + )); + as FoldWithAstPath>::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + Alternative { span, body } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for BoundaryAssertion { + #[doc = "Calls [FoldAstPath`::fold_boundary_assertion`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_boundary_assertion(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + BoundaryAssertion { span, kind } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion( + self::fields::BoundaryAssertionField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let kind = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion( + self::fields::BoundaryAssertionField::Kind, + )); + >::fold_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + BoundaryAssertion { span, kind } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for BoundaryAssertionKind { + #[doc = "Calls [FoldAstPath`::fold_boundary_assertion_kind`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_boundary_assertion_kind(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + BoundaryAssertionKind::Start => BoundaryAssertionKind::Start, + BoundaryAssertionKind::End => BoundaryAssertionKind::End, + BoundaryAssertionKind::Boundary => BoundaryAssertionKind::Boundary, + BoundaryAssertionKind::NegativeBoundary => BoundaryAssertionKind::NegativeBoundary, + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CapturingGroup { + #[doc = "Calls [FoldAstPath`::fold_capturing_group`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_capturing_group(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CapturingGroup { span, name, body } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let name = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Name, + )); + as FoldWithAstPath>::fold_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup( + self::fields::CapturingGroupField::Body, + )); + >::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + CapturingGroup { span, name, body } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Character { + #[doc = "Calls [FoldAstPath`::fold_character`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Character { span, kind, value } => { + let span = { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Character(self::fields::CharacterField::Span)); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let kind = { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Character(self::fields::CharacterField::Kind)); + >::fold_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + Character { span, kind, value } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClass { + #[doc = "Calls [FoldAstPath`::fold_character_class`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClass { + span, + negative, + strings, + kind, + body, + } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let kind = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Kind, + )); + >::fold_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass( + self::fields::CharacterClassField::Body(usize::MAX), + )); + as FoldWithAstPath>::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + CharacterClass { + span, + negative, + strings, + kind, + body, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClassContents { + #[doc = "Calls [FoldAstPath`::fold_character_class_contents`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_contents(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClassContents::CharacterClassRange { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::CharacterClassRange, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::CharacterClassRange { 0: _field_0 } + } + CharacterClassContents::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::CharacterClassEscape, + )); + let _field_0 = + as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::CharacterClassEscape { 0: _field_0 } + } + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::UnicodePropertyEscape, + )); + let _field_0 = + as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } + } + CharacterClassContents::Character { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::Character, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::Character { 0: _field_0 } + } + CharacterClassContents::NestedCharacterClass { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::NestedCharacterClass, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::NestedCharacterClass { 0: _field_0 } + } + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents( + self::fields::CharacterClassContentsField::ClassStringDisjunction, + )); + let _field_0 = + as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + CharacterClassContents::ClassStringDisjunction { 0: _field_0 } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClassContentsKind { + #[doc = "Calls [FoldAstPath`::fold_character_class_contents_kind`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_contents_kind(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClassContentsKind::Union => CharacterClassContentsKind::Union, + CharacterClassContentsKind::Intersection => CharacterClassContentsKind::Intersection, + CharacterClassContentsKind::Subtraction => CharacterClassContentsKind::Subtraction, + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClassEscape { + #[doc = "Calls [FoldAstPath`::fold_character_class_escape`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_escape(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClassEscape { span, kind } => { + let span = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::CharacterClassEscape( + self::fields::CharacterClassEscapeField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let kind = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::CharacterClassEscape( + self::fields::CharacterClassEscapeField::Kind, + )); + >::fold_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + CharacterClassEscape { span, kind } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClassEscapeKind { + #[doc = "Calls [FoldAstPath`::fold_character_class_escape_kind`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_escape_kind(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClassEscapeKind::D => CharacterClassEscapeKind::D, + CharacterClassEscapeKind::NegativeD => CharacterClassEscapeKind::NegativeD, + CharacterClassEscapeKind::S => CharacterClassEscapeKind::S, + CharacterClassEscapeKind::NegativeS => CharacterClassEscapeKind::NegativeS, + CharacterClassEscapeKind::W => CharacterClassEscapeKind::W, + CharacterClassEscapeKind::NegativeW => CharacterClassEscapeKind::NegativeW, + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterClassRange { + #[doc = "Calls [FoldAstPath`::fold_character_class_range`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_range(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterClassRange { span, min, max } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let min = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Min, + )); + >::fold_with_ast_path( + min, + visitor, + &mut *__ast_path, + ) + }; + let max = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange( + self::fields::CharacterClassRangeField::Max, + )); + >::fold_with_ast_path( + max, + visitor, + &mut *__ast_path, + ) + }; + CharacterClassRange { span, min, max } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for CharacterKind { + #[doc = "Calls [FoldAstPath`::fold_character_kind`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_kind(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + CharacterKind::ControlLetter => CharacterKind::ControlLetter, + CharacterKind::HexadecimalEscape => CharacterKind::HexadecimalEscape, + CharacterKind::Identifier => CharacterKind::Identifier, + CharacterKind::Null => CharacterKind::Null, + CharacterKind::Octal1 => CharacterKind::Octal1, + CharacterKind::Octal2 => CharacterKind::Octal2, + CharacterKind::Octal3 => CharacterKind::Octal3, + CharacterKind::SingleEscape => CharacterKind::SingleEscape, + CharacterKind::Symbol => CharacterKind::Symbol, + CharacterKind::UnicodeEscape => CharacterKind::UnicodeEscape, + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ClassString { + #[doc = "Calls [FoldAstPath`::fold_class_string`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_class_string(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ClassString { + span, + strings, + body, + } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString( + self::fields::ClassStringField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString( + self::fields::ClassStringField::Body(usize::MAX), + )); + as FoldWithAstPath>::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + ClassString { + span, + strings, + body, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ClassStringDisjunction { + #[doc = "Calls [FoldAstPath`::fold_class_string_disjunction`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_class_string_disjunction(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ClassStringDisjunction { + span, + strings, + body, + } => { + let span = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ClassStringDisjunction( + self::fields::ClassStringDisjunctionField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ClassStringDisjunction( + self::fields::ClassStringDisjunctionField::Body(usize::MAX), + )); + as FoldWithAstPath>::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + ClassStringDisjunction { + span, + strings, + body, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Disjunction { + #[doc = "Calls [FoldAstPath`::fold_disjunction`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_disjunction(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Disjunction { span, body } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction( + self::fields::DisjunctionField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction( + self::fields::DisjunctionField::Body(usize::MAX), + )); + as FoldWithAstPath>::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + Disjunction { span, body } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Dot { + #[doc = "Calls [FoldAstPath`::fold_dot`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_dot(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Dot { span } => { + let span = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Dot(self::fields::DotField::Span)); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + Dot { span } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for IgnoreGroup { + #[doc = "Calls [FoldAstPath`::fold_ignore_group`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_ignore_group(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + IgnoreGroup { + span, + modifiers, + body, + } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let modifiers = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Modifiers, + )); + as FoldWithAstPath>::fold_with_ast_path( + modifiers, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup( + self::fields::IgnoreGroupField::Body, + )); + >::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + IgnoreGroup { + span, + modifiers, + body, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for IndexedReference { + #[doc = "Calls [FoldAstPath`::fold_indexed_reference`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_indexed_reference(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + IndexedReference { span, index } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::IndexedReference( + self::fields::IndexedReferenceField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + IndexedReference { span, index } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for LookAroundAssertion { + #[doc = "Calls [FoldAstPath`::fold_look_around_assertion`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_look_around_assertion(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + LookAroundAssertion { span, kind, body } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let kind = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Kind, + )); + >::fold_with_ast_path( + kind, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion( + self::fields::LookAroundAssertionField::Body, + )); + >::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + LookAroundAssertion { span, kind, body } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for LookAroundAssertionKind { + #[doc = "Calls [FoldAstPath`::fold_look_around_assertion_kind`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_look_around_assertion_kind(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + LookAroundAssertionKind::Lookahead => LookAroundAssertionKind::Lookahead, + LookAroundAssertionKind::NegativeLookahead => { + LookAroundAssertionKind::NegativeLookahead + } + LookAroundAssertionKind::Lookbehind => LookAroundAssertionKind::Lookbehind, + LookAroundAssertionKind::NegativeLookbehind => { + LookAroundAssertionKind::NegativeLookbehind + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Modifiers { + #[doc = "Calls [FoldAstPath`::fold_modifiers`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_modifiers(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Modifiers { + span, + enabling, + disabling, + } => { + let span = { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Modifiers(self::fields::ModifiersField::Span)); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let enabling = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers( + self::fields::ModifiersField::Enabling, + )); + >::fold_with_ast_path( + enabling, + visitor, + &mut *__ast_path, + ) + }; + let disabling = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers( + self::fields::ModifiersField::Disabling, + )); + >::fold_with_ast_path( + disabling, + visitor, + &mut *__ast_path, + ) + }; + Modifiers { + span, + enabling, + disabling, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for NamedReference { + #[doc = "Calls [FoldAstPath`::fold_named_reference`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_named_reference(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + NamedReference { span, name } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference( + self::fields::NamedReferenceField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let name = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference( + self::fields::NamedReferenceField::Name, + )); + >::fold_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + NamedReference { span, name } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Pattern { + #[doc = "Calls [FoldAstPath`::fold_pattern`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_pattern(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Pattern { span, body } => { + let span = { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Pattern(self::fields::PatternField::Span)); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Pattern(self::fields::PatternField::Body)); + >::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + Pattern { span, body } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Quantifier { + #[doc = "Calls [FoldAstPath`::fold_quantifier`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_quantifier(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Quantifier { + span, + min, + max, + greedy, + body, + } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier( + self::fields::QuantifierField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let body = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier( + self::fields::QuantifierField::Body, + )); + >::fold_with_ast_path( + body, + visitor, + &mut *__ast_path, + ) + }; + Quantifier { + span, + min, + max, + greedy, + body, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Term { + #[doc = "Calls [FoldAstPath`::fold_term`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_term(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + Term::BoundaryAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::BoundaryAssertion, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::BoundaryAssertion { 0: _field_0 } + } + Term::LookAroundAssertion { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::LookAroundAssertion, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::LookAroundAssertion { 0: _field_0 } + } + Term::Quantifier { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Quantifier)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::Quantifier { 0: _field_0 } + } + Term::Character { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Character)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::Character { 0: _field_0 } + } + Term::Dot { 0: _field_0 } => { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Dot)); + let _field_0 = >::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::Dot { 0: _field_0 } + } + Term::CharacterClassEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::CharacterClassEscape, + )); + let _field_0 = + as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::CharacterClassEscape { 0: _field_0 } + } + Term::UnicodePropertyEscape { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::UnicodePropertyEscape, + )); + let _field_0 = + as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::UnicodePropertyEscape { 0: _field_0 } + } + Term::CharacterClass { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::CharacterClass)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::CharacterClass { 0: _field_0 } + } + Term::CapturingGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::CapturingGroup)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::CapturingGroup { 0: _field_0 } + } + Term::IgnoreGroup { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::IgnoreGroup)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::IgnoreGroup { 0: _field_0 } + } + Term::IndexedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Term( + self::fields::TermField::IndexedReference, + )); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::IndexedReference { 0: _field_0 } + } + Term::NamedReference { 0: _field_0 } => { + let mut __ast_path = __ast_path + .with_guard(AstParentKind::Term(self::fields::TermField::NamedReference)); + let _field_0 = as FoldWithAstPath>::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Term::NamedReference { 0: _field_0 } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for UnicodePropertyEscape { + #[doc = "Calls [FoldAstPath`::fold_unicode_property_escape`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_unicode_property_escape(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } => { + let span = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let name = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Name, + )); + >::fold_with_ast_path( + name, + visitor, + &mut *__ast_path, + ) + }; + let value = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::UnicodePropertyEscape( + self::fields::UnicodePropertyEscapeField::Value, + )); + as FoldWithAstPath>::fold_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + UnicodePropertyEscape { + span, + negative, + strings, + name, + value, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Vec { + #[doc = "Calls [FoldAstPath`::fold_alternatives`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_alternatives(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.into_iter() + .enumerate() + .map(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::fold_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + .collect() + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for swc_atoms::Atom { + #[doc = "Calls [FoldAstPath`::fold_atom`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_atom(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Vec { + #[doc = "Calls [FoldAstPath`::fold_character_class_contentss`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_character_class_contentss(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.into_iter() + .enumerate() + .map(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::fold_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + .collect() + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Vec { + #[doc = "Calls [FoldAstPath`::fold_characters`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_characters(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.into_iter() + .enumerate() + .map(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::fold_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + .collect() + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Vec { + #[doc = "Calls [FoldAstPath`::fold_class_strings`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_class_strings(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.into_iter() + .enumerate() + .map(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::fold_with_ast_path( + item, + visitor, + &mut *__ast_path, + ) + }) + .collect() + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Modifier { + #[doc = "Calls [FoldAstPath`::fold_modifier`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_modifier(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Option { + #[doc = "Calls [FoldAstPath`::fold_opt_atom`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_opt_atom(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.map(|inner| { + >::fold_with_ast_path(inner, visitor, __ast_path) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Option { + #[doc = "Calls [FoldAstPath`::fold_opt_modifiers`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_opt_modifiers(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.map(|inner| { + >::fold_with_ast_path(inner, visitor, __ast_path) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for swc_common::Span { + #[doc = "Calls [FoldAstPath`::fold_span`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_span(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for Vec { + #[doc = "Calls [FoldAstPath`::fold_terms`] with `self`. (Extra impl)"] + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_terms(visitor, self, __ast_path) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + self.into_iter() + .enumerate() + .map(|(__idx, item)| { + let mut __ast_path = __ast_path.with_index_guard(__idx); + >::fold_with_ast_path(item, visitor, &mut *__ast_path) + }) + .collect() + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for std::boxed::Box +where + V: ?Sized + FoldAstPath, + T: FoldWithAstPath, +{ + #[inline] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + swc_visit::util::map::Map::map(self, |inner| { + >::fold_with_ast_path(inner, visitor, __ast_path) + }) + } + + #[inline] + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + swc_visit::util::map::Map::map(self, |inner| { + >::fold_children_with_ast_path(inner, visitor, __ast_path) + }) + } +} +#[cfg(any(docsrs, feature = "path"))] +pub type AstKindPath = swc_visit::AstKindPath; +#[cfg(any(docsrs, feature = "path"))] +pub type AstNodePath<'ast> = swc_visit::AstNodePath>; +#[cfg(any(docsrs, feature = "path"))] +pub mod fields { + use swc_ecma_regexp_ast::*; + #[inline(always)] + fn assert_initial_index(idx: usize, index: usize) { + #[cfg(debug_assertions)] + if !(idx == usize::MAX || index == usize::MAX) { + { + panic!("Should be usize::MAX"); + } + } + } + impl AlternativeField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + Self::Body(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum AlternativeField { + #[doc = "Represents [`Alternative::span`]"] + Span, + #[doc = "Represents [`Alternative::body`]"] + Body(usize), + } + impl BoundaryAssertionField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum BoundaryAssertionField { + #[doc = "Represents [`BoundaryAssertion::span`]"] + Span, + #[doc = "Represents [`BoundaryAssertion::kind`]"] + Kind, + } + impl BoundaryAssertionKindField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum BoundaryAssertionKindField { + #[doc = "Represents [`BoundaryAssertionKind::Start`]"] + Start, + #[doc = "Represents [`BoundaryAssertionKind::End`]"] + End, + #[doc = "Represents [`BoundaryAssertionKind::Boundary`]"] + Boundary, + #[doc = "Represents [`BoundaryAssertionKind::NegativeBoundary`]"] + NegativeBoundary, + } + impl CapturingGroupField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CapturingGroupField { + #[doc = "Represents [`CapturingGroup::span`]"] + Span, + #[doc = "Represents [`CapturingGroup::name`]"] + Name, + #[doc = "Represents [`CapturingGroup::body`]"] + Body, + } + impl CharacterField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterField { + #[doc = "Represents [`Character::span`]"] + Span, + #[doc = "Represents [`Character::kind`]"] + Kind, + #[doc = "Represents [`Character::value`]"] + Value, + } + impl CharacterClassField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + Self::Body(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassField { + #[doc = "Represents [`CharacterClass::span`]"] + Span, + #[doc = "Represents [`CharacterClass::negative`]"] + Negative, + #[doc = "Represents [`CharacterClass::strings`]"] + Strings, + #[doc = "Represents [`CharacterClass::kind`]"] + Kind, + #[doc = "Represents [`CharacterClass::body`]"] + Body(usize), + } + impl CharacterClassContentsField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassContentsField { + #[doc = "Represents [`CharacterClassContents::CharacterClassRange`]"] + CharacterClassRange, + #[doc = "Represents [`CharacterClassContents::CharacterClassEscape`]"] + CharacterClassEscape, + #[doc = "Represents [`CharacterClassContents::UnicodePropertyEscape`]"] + UnicodePropertyEscape, + #[doc = "Represents [`CharacterClassContents::Character`]"] + Character, + #[doc = "Represents [`CharacterClassContents::NestedCharacterClass`]"] + NestedCharacterClass, + #[doc = "Represents [`CharacterClassContents::ClassStringDisjunction`]"] + ClassStringDisjunction, + } + impl CharacterClassContentsKindField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassContentsKindField { + #[doc = "Represents [`CharacterClassContentsKind::Union`]"] + Union, + #[doc = "Represents [`CharacterClassContentsKind::Intersection`]"] + Intersection, + #[doc = "Represents [`CharacterClassContentsKind::Subtraction`]"] + Subtraction, + } + impl CharacterClassEscapeField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassEscapeField { + #[doc = "Represents [`CharacterClassEscape::span`]"] + Span, + #[doc = "Represents [`CharacterClassEscape::kind`]"] + Kind, + } + impl CharacterClassEscapeKindField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassEscapeKindField { + #[doc = "Represents [`CharacterClassEscapeKind::D`]"] + D, + #[doc = "Represents [`CharacterClassEscapeKind::NegativeD`]"] + NegativeD, + #[doc = "Represents [`CharacterClassEscapeKind::S`]"] + S, + #[doc = "Represents [`CharacterClassEscapeKind::NegativeS`]"] + NegativeS, + #[doc = "Represents [`CharacterClassEscapeKind::W`]"] + W, + #[doc = "Represents [`CharacterClassEscapeKind::NegativeW`]"] + NegativeW, + } + impl CharacterClassRangeField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterClassRangeField { + #[doc = "Represents [`CharacterClassRange::span`]"] + Span, + #[doc = "Represents [`CharacterClassRange::min`]"] + Min, + #[doc = "Represents [`CharacterClassRange::max`]"] + Max, + } + impl CharacterKindField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum CharacterKindField { + #[doc = "Represents [`CharacterKind::ControlLetter`]"] + ControlLetter, + #[doc = "Represents [`CharacterKind::HexadecimalEscape`]"] + HexadecimalEscape, + #[doc = "Represents [`CharacterKind::Identifier`]"] + Identifier, + #[doc = "Represents [`CharacterKind::Null`]"] + Null, + #[doc = "Represents [`CharacterKind::Octal1`]"] + Octal1, + #[doc = "Represents [`CharacterKind::Octal2`]"] + Octal2, + #[doc = "Represents [`CharacterKind::Octal3`]"] + Octal3, + #[doc = "Represents [`CharacterKind::SingleEscape`]"] + SingleEscape, + #[doc = "Represents [`CharacterKind::Symbol`]"] + Symbol, + #[doc = "Represents [`CharacterKind::UnicodeEscape`]"] + UnicodeEscape, + } + impl ClassStringField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + Self::Body(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum ClassStringField { + #[doc = "Represents [`ClassString::span`]"] + Span, + #[doc = "Represents [`ClassString::strings`]"] + Strings, + #[doc = "Represents [`ClassString::body`]"] + Body(usize), + } + impl ClassStringDisjunctionField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + Self::Body(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum ClassStringDisjunctionField { + #[doc = "Represents [`ClassStringDisjunction::span`]"] + Span, + #[doc = "Represents [`ClassStringDisjunction::strings`]"] + Strings, + #[doc = "Represents [`ClassStringDisjunction::body`]"] + Body(usize), + } + impl DisjunctionField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + Self::Body(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum DisjunctionField { + #[doc = "Represents [`Disjunction::span`]"] + Span, + #[doc = "Represents [`Disjunction::body`]"] + Body(usize), + } + impl DotField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum DotField { + #[doc = "Represents [`Dot::span`]"] + Span, + } + impl IgnoreGroupField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum IgnoreGroupField { + #[doc = "Represents [`IgnoreGroup::span`]"] + Span, + #[doc = "Represents [`IgnoreGroup::modifiers`]"] + Modifiers, + #[doc = "Represents [`IgnoreGroup::body`]"] + Body, + } + impl IndexedReferenceField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum IndexedReferenceField { + #[doc = "Represents [`IndexedReference::span`]"] + Span, + #[doc = "Represents [`IndexedReference::index`]"] + Index, + } + impl LookAroundAssertionField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum LookAroundAssertionField { + #[doc = "Represents [`LookAroundAssertion::span`]"] + Span, + #[doc = "Represents [`LookAroundAssertion::kind`]"] + Kind, + #[doc = "Represents [`LookAroundAssertion::body`]"] + Body, + } + impl LookAroundAssertionKindField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum LookAroundAssertionKindField { + #[doc = "Represents [`LookAroundAssertionKind::Lookahead`]"] + Lookahead, + #[doc = "Represents [`LookAroundAssertionKind::NegativeLookahead`]"] + NegativeLookahead, + #[doc = "Represents [`LookAroundAssertionKind::Lookbehind`]"] + Lookbehind, + #[doc = "Represents [`LookAroundAssertionKind::NegativeLookbehind`]"] + NegativeLookbehind, + } + impl ModifiersField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum ModifiersField { + #[doc = "Represents [`Modifiers::span`]"] + Span, + #[doc = "Represents [`Modifiers::enabling`]"] + Enabling, + #[doc = "Represents [`Modifiers::disabling`]"] + Disabling, + } + impl NamedReferenceField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum NamedReferenceField { + #[doc = "Represents [`NamedReference::span`]"] + Span, + #[doc = "Represents [`NamedReference::name`]"] + Name, + } + impl PatternField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum PatternField { + #[doc = "Represents [`Pattern::span`]"] + Span, + #[doc = "Represents [`Pattern::body`]"] + Body, + } + impl QuantifierField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum QuantifierField { + #[doc = "Represents [`Quantifier::span`]"] + Span, + #[doc = "Represents [`Quantifier::min`]"] + Min, + #[doc = "Represents [`Quantifier::max`]"] + Max, + #[doc = "Represents [`Quantifier::greedy`]"] + Greedy, + #[doc = "Represents [`Quantifier::body`]"] + Body, + } + impl TermField { + #[inline(always)] + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum TermField { + #[doc = "Represents [`Term::BoundaryAssertion`]"] + BoundaryAssertion, + #[doc = "Represents [`Term::LookAroundAssertion`]"] + LookAroundAssertion, + #[doc = "Represents [`Term::Quantifier`]"] + Quantifier, + #[doc = "Represents [`Term::Character`]"] + Character, + #[doc = "Represents [`Term::Dot`]"] + Dot, + #[doc = "Represents [`Term::CharacterClassEscape`]"] + CharacterClassEscape, + #[doc = "Represents [`Term::UnicodePropertyEscape`]"] + UnicodePropertyEscape, + #[doc = "Represents [`Term::CharacterClass`]"] + CharacterClass, + #[doc = "Represents [`Term::CapturingGroup`]"] + CapturingGroup, + #[doc = "Represents [`Term::IgnoreGroup`]"] + IgnoreGroup, + #[doc = "Represents [`Term::IndexedReference`]"] + IndexedReference, + #[doc = "Represents [`Term::NamedReference`]"] + NamedReference, + } + impl UnicodePropertyEscapeField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum UnicodePropertyEscapeField { + #[doc = "Represents [`UnicodePropertyEscape::span`]"] + Span, + #[doc = "Represents [`UnicodePropertyEscape::negative`]"] + Negative, + #[doc = "Represents [`UnicodePropertyEscape::strings`]"] + Strings, + #[doc = "Represents [`UnicodePropertyEscape::name`]"] + Name, + #[doc = "Represents [`UnicodePropertyEscape::value`]"] + Value, + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))] + pub enum AstParentKind { + Alternative(AlternativeField), + BoundaryAssertion(BoundaryAssertionField), + BoundaryAssertionKind(BoundaryAssertionKindField), + CapturingGroup(CapturingGroupField), + Character(CharacterField), + CharacterClass(CharacterClassField), + CharacterClassContents(CharacterClassContentsField), + CharacterClassContentsKind(CharacterClassContentsKindField), + CharacterClassEscape(CharacterClassEscapeField), + CharacterClassEscapeKind(CharacterClassEscapeKindField), + CharacterClassRange(CharacterClassRangeField), + CharacterKind(CharacterKindField), + ClassString(ClassStringField), + ClassStringDisjunction(ClassStringDisjunctionField), + Disjunction(DisjunctionField), + Dot(DotField), + IgnoreGroup(IgnoreGroupField), + IndexedReference(IndexedReferenceField), + LookAroundAssertion(LookAroundAssertionField), + LookAroundAssertionKind(LookAroundAssertionKindField), + Modifiers(ModifiersField), + NamedReference(NamedReferenceField), + Pattern(PatternField), + Quantifier(QuantifierField), + Term(TermField), + UnicodePropertyEscape(UnicodePropertyEscapeField), + } + impl ::swc_visit::ParentKind for AstParentKind { + #[inline] + fn set_index(&mut self, index: usize) { + match self { + Self::Alternative(v) => v.set_index(index), + Self::BoundaryAssertion(v) => v.set_index(index), + Self::BoundaryAssertionKind(v) => v.set_index(index), + Self::CapturingGroup(v) => v.set_index(index), + Self::Character(v) => v.set_index(index), + Self::CharacterClass(v) => v.set_index(index), + Self::CharacterClassContents(v) => v.set_index(index), + Self::CharacterClassContentsKind(v) => v.set_index(index), + Self::CharacterClassEscape(v) => v.set_index(index), + Self::CharacterClassEscapeKind(v) => v.set_index(index), + Self::CharacterClassRange(v) => v.set_index(index), + Self::CharacterKind(v) => v.set_index(index), + Self::ClassString(v) => v.set_index(index), + Self::ClassStringDisjunction(v) => v.set_index(index), + Self::Disjunction(v) => v.set_index(index), + Self::Dot(v) => v.set_index(index), + Self::IgnoreGroup(v) => v.set_index(index), + Self::IndexedReference(v) => v.set_index(index), + Self::LookAroundAssertion(v) => v.set_index(index), + Self::LookAroundAssertionKind(v) => v.set_index(index), + Self::Modifiers(v) => v.set_index(index), + Self::NamedReference(v) => v.set_index(index), + Self::Pattern(v) => v.set_index(index), + Self::Quantifier(v) => v.set_index(index), + Self::Term(v) => v.set_index(index), + Self::UnicodePropertyEscape(v) => v.set_index(index), + } + } + } + #[derive(Debug, Clone, Copy)] + pub enum AstParentNodeRef<'ast> { + Alternative(&'ast Alternative, AlternativeField), + BoundaryAssertion(&'ast BoundaryAssertion, BoundaryAssertionField), + BoundaryAssertionKind(&'ast BoundaryAssertionKind, BoundaryAssertionKindField), + CapturingGroup(&'ast CapturingGroup, CapturingGroupField), + Character(&'ast Character, CharacterField), + CharacterClass(&'ast CharacterClass, CharacterClassField), + CharacterClassContents(&'ast CharacterClassContents, CharacterClassContentsField), + CharacterClassContentsKind( + &'ast CharacterClassContentsKind, + CharacterClassContentsKindField, + ), + CharacterClassEscape(&'ast CharacterClassEscape, CharacterClassEscapeField), + CharacterClassEscapeKind( + &'ast CharacterClassEscapeKind, + CharacterClassEscapeKindField, + ), + CharacterClassRange(&'ast CharacterClassRange, CharacterClassRangeField), + CharacterKind(&'ast CharacterKind, CharacterKindField), + ClassString(&'ast ClassString, ClassStringField), + ClassStringDisjunction(&'ast ClassStringDisjunction, ClassStringDisjunctionField), + Disjunction(&'ast Disjunction, DisjunctionField), + Dot(&'ast Dot, DotField), + IgnoreGroup(&'ast IgnoreGroup, IgnoreGroupField), + IndexedReference(&'ast IndexedReference, IndexedReferenceField), + LookAroundAssertion(&'ast LookAroundAssertion, LookAroundAssertionField), + LookAroundAssertionKind(&'ast LookAroundAssertionKind, LookAroundAssertionKindField), + Modifiers(&'ast Modifiers, ModifiersField), + NamedReference(&'ast NamedReference, NamedReferenceField), + Pattern(&'ast Pattern, PatternField), + Quantifier(&'ast Quantifier, QuantifierField), + Term(&'ast Term, TermField), + UnicodePropertyEscape(&'ast UnicodePropertyEscape, UnicodePropertyEscapeField), + } + impl<'ast> ::swc_visit::NodeRef for AstParentNodeRef<'ast> { + type ParentKind = AstParentKind; + + #[inline(always)] + fn kind(&self) -> AstParentKind { + self.kind() + } + + fn set_index(&mut self, index: usize) { + match self { + Self::Alternative(_, __field_kind) => __field_kind.set_index(index), + Self::BoundaryAssertion(_, __field_kind) => __field_kind.set_index(index), + Self::BoundaryAssertionKind(_, __field_kind) => __field_kind.set_index(index), + Self::CapturingGroup(_, __field_kind) => __field_kind.set_index(index), + Self::Character(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClass(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClassContents(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClassContentsKind(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClassEscape(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClassEscapeKind(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterClassRange(_, __field_kind) => __field_kind.set_index(index), + Self::CharacterKind(_, __field_kind) => __field_kind.set_index(index), + Self::ClassString(_, __field_kind) => __field_kind.set_index(index), + Self::ClassStringDisjunction(_, __field_kind) => __field_kind.set_index(index), + Self::Disjunction(_, __field_kind) => __field_kind.set_index(index), + Self::Dot(_, __field_kind) => __field_kind.set_index(index), + Self::IgnoreGroup(_, __field_kind) => __field_kind.set_index(index), + Self::IndexedReference(_, __field_kind) => __field_kind.set_index(index), + Self::LookAroundAssertion(_, __field_kind) => __field_kind.set_index(index), + Self::LookAroundAssertionKind(_, __field_kind) => __field_kind.set_index(index), + Self::Modifiers(_, __field_kind) => __field_kind.set_index(index), + Self::NamedReference(_, __field_kind) => __field_kind.set_index(index), + Self::Pattern(_, __field_kind) => __field_kind.set_index(index), + Self::Quantifier(_, __field_kind) => __field_kind.set_index(index), + Self::Term(_, __field_kind) => __field_kind.set_index(index), + Self::UnicodePropertyEscape(_, __field_kind) => __field_kind.set_index(index), + } + } + } + #[cfg(any(docsrs, feature = "path"))] + impl<'ast> AstParentNodeRef<'ast> { + #[inline] + pub fn kind(&self) -> AstParentKind { + match self { + Self::Alternative(_, __field_kind) => AstParentKind::Alternative(*__field_kind), + Self::BoundaryAssertion(_, __field_kind) => { + AstParentKind::BoundaryAssertion(*__field_kind) + } + Self::BoundaryAssertionKind(_, __field_kind) => { + AstParentKind::BoundaryAssertionKind(*__field_kind) + } + Self::CapturingGroup(_, __field_kind) => { + AstParentKind::CapturingGroup(*__field_kind) + } + Self::Character(_, __field_kind) => AstParentKind::Character(*__field_kind), + Self::CharacterClass(_, __field_kind) => { + AstParentKind::CharacterClass(*__field_kind) + } + Self::CharacterClassContents(_, __field_kind) => { + AstParentKind::CharacterClassContents(*__field_kind) + } + Self::CharacterClassContentsKind(_, __field_kind) => { + AstParentKind::CharacterClassContentsKind(*__field_kind) + } + Self::CharacterClassEscape(_, __field_kind) => { + AstParentKind::CharacterClassEscape(*__field_kind) + } + Self::CharacterClassEscapeKind(_, __field_kind) => { + AstParentKind::CharacterClassEscapeKind(*__field_kind) + } + Self::CharacterClassRange(_, __field_kind) => { + AstParentKind::CharacterClassRange(*__field_kind) + } + Self::CharacterKind(_, __field_kind) => AstParentKind::CharacterKind(*__field_kind), + Self::ClassString(_, __field_kind) => AstParentKind::ClassString(*__field_kind), + Self::ClassStringDisjunction(_, __field_kind) => { + AstParentKind::ClassStringDisjunction(*__field_kind) + } + Self::Disjunction(_, __field_kind) => AstParentKind::Disjunction(*__field_kind), + Self::Dot(_, __field_kind) => AstParentKind::Dot(*__field_kind), + Self::IgnoreGroup(_, __field_kind) => AstParentKind::IgnoreGroup(*__field_kind), + Self::IndexedReference(_, __field_kind) => { + AstParentKind::IndexedReference(*__field_kind) + } + Self::LookAroundAssertion(_, __field_kind) => { + AstParentKind::LookAroundAssertion(*__field_kind) + } + Self::LookAroundAssertionKind(_, __field_kind) => { + AstParentKind::LookAroundAssertionKind(*__field_kind) + } + Self::Modifiers(_, __field_kind) => AstParentKind::Modifiers(*__field_kind), + Self::NamedReference(_, __field_kind) => { + AstParentKind::NamedReference(*__field_kind) + } + Self::Pattern(_, __field_kind) => AstParentKind::Pattern(*__field_kind), + Self::Quantifier(_, __field_kind) => AstParentKind::Quantifier(*__field_kind), + Self::Term(_, __field_kind) => AstParentKind::Term(*__field_kind), + Self::UnicodePropertyEscape(_, __field_kind) => { + AstParentKind::UnicodePropertyEscape(*__field_kind) + } + } + } + } +} +impl<'ast> From<&'ast Alternative> for NodeRef<'ast> { + fn from(node: &'ast Alternative) -> Self { + NodeRef::Alternative(node) + } +} +impl<'ast> From<&'ast BoundaryAssertion> for NodeRef<'ast> { + fn from(node: &'ast BoundaryAssertion) -> Self { + NodeRef::BoundaryAssertion(node) + } +} +impl<'ast> From<&'ast BoundaryAssertionKind> for NodeRef<'ast> { + fn from(node: &'ast BoundaryAssertionKind) -> Self { + NodeRef::BoundaryAssertionKind(node) + } +} +impl<'ast> From<&'ast CapturingGroup> for NodeRef<'ast> { + fn from(node: &'ast CapturingGroup) -> Self { + NodeRef::CapturingGroup(node) + } +} +impl<'ast> From<&'ast Character> for NodeRef<'ast> { + fn from(node: &'ast Character) -> Self { + NodeRef::Character(node) + } +} +impl<'ast> From<&'ast CharacterClass> for NodeRef<'ast> { + fn from(node: &'ast CharacterClass) -> Self { + NodeRef::CharacterClass(node) + } +} +impl<'ast> From<&'ast CharacterClassContents> for NodeRef<'ast> { + fn from(node: &'ast CharacterClassContents) -> Self { + NodeRef::CharacterClassContents(node) + } +} +impl<'ast> From<&'ast CharacterClassContentsKind> for NodeRef<'ast> { + fn from(node: &'ast CharacterClassContentsKind) -> Self { + NodeRef::CharacterClassContentsKind(node) + } +} +impl<'ast> From<&'ast CharacterClassEscape> for NodeRef<'ast> { + fn from(node: &'ast CharacterClassEscape) -> Self { + NodeRef::CharacterClassEscape(node) + } +} +impl<'ast> From<&'ast CharacterClassEscapeKind> for NodeRef<'ast> { + fn from(node: &'ast CharacterClassEscapeKind) -> Self { + NodeRef::CharacterClassEscapeKind(node) + } +} +impl<'ast> From<&'ast CharacterClassRange> for NodeRef<'ast> { + fn from(node: &'ast CharacterClassRange) -> Self { + NodeRef::CharacterClassRange(node) + } +} +impl<'ast> From<&'ast CharacterKind> for NodeRef<'ast> { + fn from(node: &'ast CharacterKind) -> Self { + NodeRef::CharacterKind(node) + } +} +impl<'ast> From<&'ast ClassString> for NodeRef<'ast> { + fn from(node: &'ast ClassString) -> Self { + NodeRef::ClassString(node) + } +} +impl<'ast> From<&'ast ClassStringDisjunction> for NodeRef<'ast> { + fn from(node: &'ast ClassStringDisjunction) -> Self { + NodeRef::ClassStringDisjunction(node) + } +} +impl<'ast> From<&'ast Disjunction> for NodeRef<'ast> { + fn from(node: &'ast Disjunction) -> Self { + NodeRef::Disjunction(node) + } +} +impl<'ast> From<&'ast Dot> for NodeRef<'ast> { + fn from(node: &'ast Dot) -> Self { + NodeRef::Dot(node) + } +} +impl<'ast> From<&'ast IgnoreGroup> for NodeRef<'ast> { + fn from(node: &'ast IgnoreGroup) -> Self { + NodeRef::IgnoreGroup(node) + } +} +impl<'ast> From<&'ast IndexedReference> for NodeRef<'ast> { + fn from(node: &'ast IndexedReference) -> Self { + NodeRef::IndexedReference(node) + } +} +impl<'ast> From<&'ast LookAroundAssertion> for NodeRef<'ast> { + fn from(node: &'ast LookAroundAssertion) -> Self { + NodeRef::LookAroundAssertion(node) + } +} +impl<'ast> From<&'ast LookAroundAssertionKind> for NodeRef<'ast> { + fn from(node: &'ast LookAroundAssertionKind) -> Self { + NodeRef::LookAroundAssertionKind(node) + } +} +impl<'ast> From<&'ast Modifiers> for NodeRef<'ast> { + fn from(node: &'ast Modifiers) -> Self { + NodeRef::Modifiers(node) + } +} +impl<'ast> From<&'ast NamedReference> for NodeRef<'ast> { + fn from(node: &'ast NamedReference) -> Self { + NodeRef::NamedReference(node) + } +} +impl<'ast> From<&'ast Pattern> for NodeRef<'ast> { + fn from(node: &'ast Pattern) -> Self { + NodeRef::Pattern(node) + } +} +impl<'ast> From<&'ast Quantifier> for NodeRef<'ast> { + fn from(node: &'ast Quantifier) -> Self { + NodeRef::Quantifier(node) + } +} +impl<'ast> From<&'ast Term> for NodeRef<'ast> { + fn from(node: &'ast Term) -> Self { + NodeRef::Term(node) + } +} +impl<'ast> From<&'ast UnicodePropertyEscape> for NodeRef<'ast> { + fn from(node: &'ast UnicodePropertyEscape) -> Self { + NodeRef::UnicodePropertyEscape(node) + } +} +#[derive(Debug, Clone, Copy)] +pub enum NodeRef<'ast> { + Alternative(&'ast Alternative), + BoundaryAssertion(&'ast BoundaryAssertion), + BoundaryAssertionKind(&'ast BoundaryAssertionKind), + CapturingGroup(&'ast CapturingGroup), + Character(&'ast Character), + CharacterClass(&'ast CharacterClass), + CharacterClassContents(&'ast CharacterClassContents), + CharacterClassContentsKind(&'ast CharacterClassContentsKind), + CharacterClassEscape(&'ast CharacterClassEscape), + CharacterClassEscapeKind(&'ast CharacterClassEscapeKind), + CharacterClassRange(&'ast CharacterClassRange), + CharacterKind(&'ast CharacterKind), + ClassString(&'ast ClassString), + ClassStringDisjunction(&'ast ClassStringDisjunction), + Disjunction(&'ast Disjunction), + Dot(&'ast Dot), + IgnoreGroup(&'ast IgnoreGroup), + IndexedReference(&'ast IndexedReference), + LookAroundAssertion(&'ast LookAroundAssertion), + LookAroundAssertionKind(&'ast LookAroundAssertionKind), + Modifiers(&'ast Modifiers), + NamedReference(&'ast NamedReference), + Pattern(&'ast Pattern), + Quantifier(&'ast Quantifier), + Term(&'ast Term), + UnicodePropertyEscape(&'ast UnicodePropertyEscape), +} +impl<'ast> NodeRef<'ast> { + #[doc = r" This is not a part of semver-stable API. It is experimental and subject to change."] + #[allow(unreachable_patterns)] + pub fn experimental_raw_children<'a>(&'a self) -> Box>> { + match self { + NodeRef::Alternative(node) => { + let iterator = ::std::iter::empty::>().chain( + node.body + .iter() + .flat_map(|item| ::std::iter::once(NodeRef::Term(&item))), + ); + Box::new(iterator) + } + NodeRef::BoundaryAssertion(node) => { + let iterator = ::std::iter::empty::>().chain(::std::iter::once( + NodeRef::BoundaryAssertionKind(&node.kind), + )); + Box::new(iterator) + } + NodeRef::BoundaryAssertionKind(node) => match node { + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::CapturingGroup(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::Disjunction(&node.body))); + Box::new(iterator) + } + NodeRef::Character(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::CharacterKind(&node.kind))); + Box::new(iterator) + } + NodeRef::CharacterClass(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::CharacterClassContentsKind( + &node.kind, + ))) + .chain(node.body.iter().flat_map(|item| { + ::std::iter::once(NodeRef::CharacterClassContents(&item)) + })); + Box::new(iterator) + } + NodeRef::CharacterClassContents(node) => match node { + CharacterClassContents::CharacterClassRange(v0) => { + Box::new(::std::iter::once(NodeRef::CharacterClassRange(v0))) + } + CharacterClassContents::CharacterClassEscape(v0) => { + Box::new(::std::iter::once(NodeRef::CharacterClassEscape(v0))) + } + CharacterClassContents::UnicodePropertyEscape(v0) => { + Box::new(::std::iter::once(NodeRef::UnicodePropertyEscape(v0))) + } + CharacterClassContents::Character(v0) => { + Box::new(::std::iter::once(NodeRef::Character(v0))) + } + CharacterClassContents::NestedCharacterClass(v0) => { + Box::new(::std::iter::once(NodeRef::CharacterClass(v0))) + } + CharacterClassContents::ClassStringDisjunction(v0) => { + Box::new(::std::iter::once(NodeRef::ClassStringDisjunction(v0))) + } + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::CharacterClassContentsKind(node) => match node { + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::CharacterClassEscape(node) => { + let iterator = ::std::iter::empty::>().chain(::std::iter::once( + NodeRef::CharacterClassEscapeKind(&node.kind), + )); + Box::new(iterator) + } + NodeRef::CharacterClassEscapeKind(node) => match node { + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::CharacterClassRange(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::Character(&node.min))) + .chain(::std::iter::once(NodeRef::Character(&node.max))); + Box::new(iterator) + } + NodeRef::CharacterKind(node) => match node { + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::ClassString(node) => { + let iterator = ::std::iter::empty::>().chain( + node.body + .iter() + .flat_map(|item| ::std::iter::once(NodeRef::Character(&item))), + ); + Box::new(iterator) + } + NodeRef::ClassStringDisjunction(node) => { + let iterator = ::std::iter::empty::>().chain( + node.body + .iter() + .flat_map(|item| ::std::iter::once(NodeRef::ClassString(&item))), + ); + Box::new(iterator) + } + NodeRef::Disjunction(node) => { + let iterator = ::std::iter::empty::>().chain( + node.body + .iter() + .flat_map(|item| ::std::iter::once(NodeRef::Alternative(&item))), + ); + Box::new(iterator) + } + NodeRef::Dot(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::IgnoreGroup(node) => { + let iterator = ::std::iter::empty::>() + .chain( + node.modifiers + .iter() + .flat_map(|item| ::std::iter::once(NodeRef::Modifiers(&item))), + ) + .chain(::std::iter::once(NodeRef::Disjunction(&node.body))); + Box::new(iterator) + } + NodeRef::IndexedReference(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::LookAroundAssertion(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::LookAroundAssertionKind( + &node.kind, + ))) + .chain(::std::iter::once(NodeRef::Disjunction(&node.body))); + Box::new(iterator) + } + NodeRef::LookAroundAssertionKind(node) => match node { + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::Modifiers(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::NamedReference(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::Pattern(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::Disjunction(&node.body))); + Box::new(iterator) + } + NodeRef::Quantifier(node) => { + let iterator = ::std::iter::empty::>() + .chain(::std::iter::once(NodeRef::Term(&node.body))); + Box::new(iterator) + } + NodeRef::Term(node) => match node { + Term::BoundaryAssertion(v0) => { + Box::new(::std::iter::once(NodeRef::BoundaryAssertion(v0))) + } + Term::LookAroundAssertion(v0) => { + Box::new(::std::iter::once(NodeRef::LookAroundAssertion(v0))) + } + Term::Quantifier(v0) => Box::new(::std::iter::once(NodeRef::Quantifier(v0))), + Term::Character(v0) => Box::new(::std::iter::once(NodeRef::Character(v0))), + Term::Dot(v0) => Box::new(::std::iter::once(NodeRef::Dot(v0))), + Term::CharacterClassEscape(v0) => { + Box::new(::std::iter::once(NodeRef::CharacterClassEscape(v0))) + } + Term::UnicodePropertyEscape(v0) => { + Box::new(::std::iter::once(NodeRef::UnicodePropertyEscape(v0))) + } + Term::CharacterClass(v0) => { + Box::new(::std::iter::once(NodeRef::CharacterClass(v0))) + } + Term::CapturingGroup(v0) => { + Box::new(::std::iter::once(NodeRef::CapturingGroup(v0))) + } + Term::IgnoreGroup(v0) => Box::new(::std::iter::once(NodeRef::IgnoreGroup(v0))), + Term::IndexedReference(v0) => { + Box::new(::std::iter::once(NodeRef::IndexedReference(v0))) + } + Term::NamedReference(v0) => { + Box::new(::std::iter::once(NodeRef::NamedReference(v0))) + } + _ => Box::new(::std::iter::empty::>()), + }, + NodeRef::UnicodePropertyEscape(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + } + } +} +impl<'ast> NodeRef<'ast> { + #[doc = r" Visit all nodes in self in preorder."] + #[doc = r""] + #[doc = r" This is not a part of semver-stable API. It is"] + #[doc = r" experimental and subject to change."] + pub fn experimental_traverse(&'ast self) -> Box>> { + let mut queue = std::collections::VecDeque::>::new(); + queue.push_back(*self); + Box::new(std::iter::from_fn(move || { + let node: NodeRef<'ast> = queue.pop_front()?; + { + let children = node.experimental_raw_children(); + queue.extend(children); + } + Some(node) + })) + } +} +#[cfg(any(docsrs, feature = "path"))] +pub use self::fields::{AstParentKind, AstParentNodeRef}; diff --git a/crates/swc_ecma_regexp_visit/src/lib.rs b/crates/swc_ecma_regexp_visit/src/lib.rs new file mode 100644 index 000000000000..58736404d52c --- /dev/null +++ b/crates/swc_ecma_regexp_visit/src/lib.rs @@ -0,0 +1,7 @@ +#![cfg_attr(docsrs, feature(doc_cfg))] +#![deny(clippy::all)] +#![allow(clippy::ptr_arg)] + +pub use crate::generated::*; + +mod generated; diff --git a/tools/generate-code/src/main.rs b/tools/generate-code/src/main.rs index db1e702f2611..f75be2244ec5 100644 --- a/tools/generate-code/src/main.rs +++ b/tools/generate-code/src/main.rs @@ -133,6 +133,16 @@ fn test_ecmascript() { .unwrap(); } +#[test] +fn test_ecmascript_regexp() { + run_visitor_codegen( + Path::new("../../crates/swc_ecma_regexp_ast"), + Path::new("../../crates/swc_ecma_regexp_visit/src/generated.rs"), + &["Options".into()], + ) + .unwrap(); +} + #[test] fn test_css() { run_visitor_codegen( From c9cb0701094ae5e7859a468a1629379ff82eabf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 27 May 2025 06:04:27 -0700 Subject: [PATCH 018/209] chore: Publish crates with `swc_core` `v26.2.1` --- .changeset/poor-forks-heal.md | 6 ------ .changeset/real-monkeys-rhyme.md | 6 ------ .changeset/tame-rocks-shave.md | 6 ------ CHANGELOG-CORE.md | 26 +++++++++++++++++++++++--- CHANGELOG.md | 23 +++++++++++++++-------- Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- 18 files changed, 54 insertions(+), 45 deletions(-) delete mode 100644 .changeset/poor-forks-heal.md delete mode 100644 .changeset/real-monkeys-rhyme.md delete mode 100644 .changeset/tame-rocks-shave.md diff --git a/.changeset/poor-forks-heal.md b/.changeset/poor-forks-heal.md deleted file mode 100644 index 4d325ec9c13b..000000000000 --- a/.changeset/poor-forks-heal.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_core: patch ---- - -refactor(ecma/parser): less cmp when read logical diff --git a/.changeset/real-monkeys-rhyme.md b/.changeset/real-monkeys-rhyme.md deleted file mode 100644 index f1b0cfbd70b3..000000000000 --- a/.changeset/real-monkeys-rhyme.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_minifier: patch ---- - -refactor(ecma/minifier): less clone diff --git a/.changeset/tame-rocks-shave.md b/.changeset/tame-rocks-shave.md deleted file mode 100644 index 4f4c2cd4c08e..000000000000 --- a/.changeset/tame-rocks-shave.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_lexer: patch ---- - -refactor(ecma/parser): common parse str lit diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index f3599cd362e5..f133fd59b1e5 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,6 +1,29 @@ # Changelog ## [unreleased] +### Features + + + +- **(es/regexp)** Add crates for RegExp ([#10525](https://github.com/swc-project/swc/issues/10525)) ([4b3f924](https://github.com/swc-project/swc/commit/4b3f924edf996983e2a61cc29eb0c552cf71af7a)) + +### Performance + + + +- **(es/minifier)** Remove needless clone ([#10523](https://github.com/swc-project/swc/issues/10523)) ([1c02ef6](https://github.com/swc-project/swc/commit/1c02ef63aa48b239a43f359991af736071634a21)) + + +- **(es/parser)** Reduce comparison while reading logical ([#10526](https://github.com/swc-project/swc/issues/10526)) ([2bc551c](https://github.com/swc-project/swc/commit/2bc551cb39d99ecebd5d6f10fc94a93173b2aefa)) + +### Refactor + + + +- **(es/parser)** Share code for parsing strings ([#10522](https://github.com/swc-project/swc/issues/10522)) ([931a2d6](https://github.com/swc-project/swc/commit/931a2d6761bfec72cdda7eb875ad02dc217848b9)) + +## [swc_core@v26.2.0] - 2025-05-23 + ### Miscellaneous Tasks @@ -2389,9 +2412,6 @@ - **(es/parser)** Fix failure of TS instantiation followed by satisfies ([#9583](https://github.com/swc-project/swc/issues/9583)) ([77900d8](https://github.com/swc-project/swc/commit/77900d808e2a3be2e62b74022c88a81b26a73f86)) -- **(es/typescript)** Preserve more comments ([#9509](https://github.com/swc-project/swc/issues/9509)) ([3e253ec](https://github.com/swc-project/swc/commit/3e253ecc21f2028437572093b42df97ef5fe505e)) - - - **(es/typescript)** Handle enum in single statement ([#9532](https://github.com/swc-project/swc/issues/9532)) ([84b0043](https://github.com/swc-project/swc/commit/84b004387ba8f4135659e1d1f54e59bf1941a57a)) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9d07c925db2..2525d7a24b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) +### Features + + + +- **(es/regexp)** Add crates for RegExp ([#10525](https://github.com/swc-project/swc/issues/10525)) ([4b3f924](https://github.com/swc-project/swc/commit/4b3f924edf996983e2a61cc29eb0c552cf71af7a)) + ### Miscellaneous Tasks @@ -29,6 +35,12 @@ - **(es/minifier)** Merge `PropertyCollector` into usage analyzer ([#10514](https://github.com/swc-project/swc/issues/10514)) ([505bf54](https://github.com/swc-project/swc/commit/505bf542cd197afb2a5a5f7cd89ed97ac681a923)) +- **(es/minifier)** Remove needless clone ([#10523](https://github.com/swc-project/swc/issues/10523)) ([1c02ef6](https://github.com/swc-project/swc/commit/1c02ef63aa48b239a43f359991af736071634a21)) + + +- **(es/parser)** Reduce comparison while reading logical ([#10526](https://github.com/swc-project/swc/issues/10526)) ([2bc551c](https://github.com/swc-project/swc/commit/2bc551cb39d99ecebd5d6f10fc94a93173b2aefa)) + + - **(es/renamer)** Merge analyze/collect ([#10509](https://github.com/swc-project/swc/issues/10509)) ([7b47f66](https://github.com/swc-project/swc/commit/7b47f661dd6794f658023b649ebcdc153fe6e27c)) ### Refactor @@ -38,6 +50,9 @@ - **(es/codegen)** Migrate to `ryu-js` for numeric literal codegen ([#10503](https://github.com/swc-project/swc/issues/10503)) ([4bc4244](https://github.com/swc-project/swc/commit/4bc4244c195d3a364b588348657fd8a3d8c22079)) +- **(es/parser)** Share code for parsing strings ([#10522](https://github.com/swc-project/swc/issues/10522)) ([931a2d6](https://github.com/swc-project/swc/commit/931a2d6761bfec72cdda7eb875ad02dc217848b9)) + + - **(ts/fast-dts)** Derive computed flags from source code ([#10510](https://github.com/swc-project/swc/issues/10510)) ([a2d5664](https://github.com/swc-project/swc/commit/a2d56645cbf753770a2634e23423a59acaae6b84)) ## [1.11.29] - 2025-05-21 @@ -2069,12 +2084,4 @@ - **(es/minifier)** Iterate object properties in reverse direction while inlining property access ([#9507](https://github.com/swc-project/swc/issues/9507)) ([f584ef7](https://github.com/swc-project/swc/commit/f584ef76d75e86da15d0725ac94be35a88a1c946)) -## [1.7.21] - 2024-08-28 - -### Bug Fixes - - - -- **(es/typescript)** Preserve more comments ([#9509](https://github.com/swc-project/swc/issues/9509)) ([3e253ec](https://github.com/swc-project/swc/commit/3e253ecc21f2028437572093b42df97ef5fe505e)) - diff --git a/Cargo.lock b/Cargo.lock index 3feda3246704..b320617f3ef9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.2.0" +version = "26.2.1" dependencies = [ "anyhow", "binding_macros", @@ -5499,7 +5499,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.0" +version = "14.0.1" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -5581,7 +5581,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.2" +version = "20.0.3" dependencies = [ "ansi_term", "anyhow", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 2a373c18dd74..4835ff349bca 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -33,7 +33,7 @@ swc_common = { version = "11.0.0", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 4db7fd98bdfc..4813ef1f7cb1 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -88,7 +88,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 6ca09295c5b3..95ead66c24c8 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 2843fe966944..50f2d14e8d39 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.2.0", features = [ +swc_core = { version = "26.2.1", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 258194964824..9c2cad79f6e9 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -30,7 +30,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 6a505e91033c..b5f847f6edb8 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.2.0" +version = "26.2.1" [package.metadata.docs.rs] features = [ "allocator_node", @@ -368,7 +368,7 @@ swc_ecma_ast = { optional = true, version = "11.0.0", path = swc_ecma_codegen = { optional = true, version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.2", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "20.0.3", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "14.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 7a2a1c23d94a..a3e380190100 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.0" +version = "14.0.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 58ba3f535c05..816c3c7eba72 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.2" +version = "20.0.3" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 3b19fb1e88fe..3cbd9fa09c26 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -42,7 +42,7 @@ phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.0", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.1", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 52dc240b95a2..6561c19b226f 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,7 +40,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 30daad4ec424..21dc68f5f2f5 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -22,7 +22,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.0", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.1", path = "../swc_ecma_lexer" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 8132edcb6a1e..5eb532d805d1 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -42,7 +42,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.2", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } From 9d2762a00b35f507b14e58ed78029e0602bc3fc1 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 27 May 2025 13:36:06 +0000 Subject: [PATCH 019/209] chore: Publish `1.11.30-nightly-20250527.1` with `swc_core` `v26.2.1` --- bindings/Cargo.lock | 176 ++++++++++++------ bindings/Cargo.toml | 2 +- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../core/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../html/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- 39 files changed, 161 insertions(+), 91 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 42bb18b8987b..bf4af66fac9c 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -141,6 +141,15 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + [[package]] name = "atty" version = "0.2.14" @@ -236,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.10.5", "log", "prettyplease", "proc-macro2", @@ -272,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -360,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -400,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -973,6 +982,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-channel" version = "0.5.14" @@ -1709,9 +1724,9 @@ dependencies = [ [[package]] name = "hash32" -version = "0.3.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" dependencies = [ "byteorder", ] @@ -1752,11 +1767,14 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heapless" -version = "0.8.0" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ + "atomic-polyfill", "hash32", + "rustc_version 0.4.1", + "spin", "stable_deref_trait", ] @@ -3831,6 +3849,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + [[package]] name = "rustix" version = "0.37.28" @@ -3877,6 +3904,7 @@ version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -4336,7 +4364,7 @@ dependencies = [ "debugid", "if_chain", "rustc-hash 1.1.0", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde_json", "unicode-id-start", @@ -4361,6 +4389,15 @@ dependencies = [ "url", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "st-map" version = "0.2.4" @@ -4556,7 +4593,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.549" +version = "0.91.550" dependencies = [ "anyhow", "par-core", @@ -4680,9 +4717,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.1.1" +version = "26.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e938c75f4bc1af7cbf1b48584198b3614b32d8a2f376ae9e501b9b6a8e9f969e" +checksum = "a574c9d7f2c6577e0c1c606ada1c5598f97bd1ac7cf4d79527c86981e7d40059" dependencies = [ "binding_macros", "swc", @@ -5077,9 +5114,9 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.0" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602a6a5190cbb4adc134bdf9a525b845912a86039130c2b476ff20123b1aacd5" +checksum = "ae0f7ced6a34e4bd281c1dd43b658654b75c52e9416dfbfba87e95a6765e696e" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5145,9 +5182,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.1" +version = "20.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d5f44a9d7480710dadbcd33e8b8d436132f92d668999061d52b5f211a6d3b" +checksum = "5c43654113e9a75edf05fbe2c66b5232e149f563c97bef58ff1a896daa288092" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5475,9 +5512,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "16.0.0" +version = "16.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b1f2dccff9c6cde3f72a86babcc34b1213e0cef8c6e2f1a1da75eca7f5bbe73" +checksum = "f4061a34574b9431c94c21519948ad4421d7b28479a1a78bb94b878c67d9fac9" dependencies = [ "bitflags 2.9.0", "indexmap 2.8.0", @@ -6517,6 +6554,22 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", +] + [[package]] name = "url" version = "2.5.4" @@ -6624,8 +6677,9 @@ dependencies = [ [[package]] name = "virtual-fs" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558995609ae4e69538c3f1eec3ad1d195ee8a1ed9d39768713728a57ed4ba6fe" dependencies = [ "anyhow", "async-trait", @@ -6646,14 +6700,15 @@ dependencies = [ "thiserror 1.0.69", "tokio", "tracing", - "wasmer-package 0.600.1", + "wasmer-package 0.600.0", "webc 9.0.0", ] [[package]] name = "virtual-mio" version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5564ace0b5098d394f6ca9aa62046da4e2e5912703cc7fec71a79dd3ae76b5d" dependencies = [ "async-trait", "bytes", @@ -6668,7 +6723,8 @@ dependencies = [ [[package]] name = "virtual-net" version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b44e5bdba1d7f0223ee4f9e6aab55f993c610629503a855fc55fabd6c10f4e" dependencies = [ "anyhow", "async-trait", @@ -6678,6 +6734,7 @@ dependencies = [ "bytes", "derive_more 1.0.0", "futures-util", + "idna_adapter", "ipnet", "iprange", "libc", @@ -6907,8 +6964,9 @@ dependencies = [ [[package]] name = "wasmer" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b8204e4eb959d89b41d4a536e61ce73f5416bccc81c7d3b7fa993995538ee97" dependencies = [ "bindgen", "bytes", @@ -6927,6 +6985,7 @@ dependencies = [ "target-lexicon", "thiserror 1.0.69", "tracing", + "ureq", "wasm-bindgen", "wasmer-compiler", "wasmer-compiler-cranelift", @@ -6940,8 +6999,9 @@ dependencies = [ [[package]] name = "wasmer-cache" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3077ff8340cc09dcc53d4a140681ea7fb3d5525eb028f3853db1bc81434c3bad" dependencies = [ "blake3", "hex", @@ -6951,8 +7011,9 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "690827b8ec4f3858d8b001d96ddfc25c28a255cbfa984ba5bd1ed173f29ffc2a" dependencies = [ "backtrace", "bytes", @@ -6981,8 +7042,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a46a83b498a2f0dcdc2e97d611db9eae92a38f20fc5dac4709d645bdfd8d2d6" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -7022,8 +7084,9 @@ dependencies = [ [[package]] name = "wasmer-config" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51dab2fa03bfb28b8b8c2f546531f56b341743557305e51ea621b1d8f7075b29" dependencies = [ "anyhow", "bytesize", @@ -7044,8 +7107,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccaedaf20c22736904ad842127cdbe46432998dbcdd840b024dda856a8b52265" dependencies = [ "proc-macro-error2", "proc-macro2", @@ -7055,8 +7119,9 @@ dependencies = [ [[package]] name = "wasmer-journal" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd746264554197deae474fa069949c6352e2758dceb3157389af1436e121e9e" dependencies = [ "anyhow", "async-trait", @@ -7073,10 +7138,10 @@ dependencies = [ "shared-buffer", "thiserror 1.0.69", "tracing", - "virtual-fs 0.600.1", + "virtual-fs 0.600.0", "virtual-net", "wasmer", - "wasmer-config 0.600.1", + "wasmer-config 0.600.0", "wasmer-wasix-types", ] @@ -7108,8 +7173,9 @@ dependencies = [ [[package]] name = "wasmer-package" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20614419fe563480822cec9f67818aced0b1b2cc26f88e96372bbaec9fd14c0f" dependencies = [ "anyhow", "bytes", @@ -7128,15 +7194,16 @@ dependencies = [ "thiserror 1.0.69", "toml", "url", - "wasmer-config 0.600.1", + "wasmer-config 0.600.0", "wasmer-types", "webc 9.0.0", ] [[package]] name = "wasmer-types" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b45fd1274b21365d3232732afe53c220ecbcdb78946405087e7016e7b2369a0" dependencies = [ "bytecheck 0.6.12", "enum-iterator", @@ -7156,8 +7223,9 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "6.0.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac4e7cec7b509e70664773f03907e6122d1633c100cb28009da770786806e6db" dependencies = [ "backtrace", "cc", @@ -7182,8 +7250,9 @@ dependencies = [ [[package]] name = "wasmer-wasix" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc74d209309baed0338fda8310847a9641bb77c2aeb1ae25af309006c22153f" dependencies = [ "anyhow", "async-trait", @@ -7230,14 +7299,14 @@ dependencies = [ "tracing", "url", "urlencoding", - "virtual-fs 0.600.1", + "virtual-fs 0.600.0", "virtual-mio", "virtual-net", "waker-fn", "wasmer", - "wasmer-config 0.600.1", + "wasmer-config 0.600.0", "wasmer-journal", - "wasmer-package 0.600.1", + "wasmer-package 0.600.0", "wasmer-types", "wasmer-wasix-types", "webc 9.0.0", @@ -7248,8 +7317,9 @@ dependencies = [ [[package]] name = "wasmer-wasix-types" -version = "0.600.1" -source = "git+https://github.com/kdy1/wasmer?branch=build-deps#71b0e1366105c34e80aebdd45c1c3a9a10f751a8" +version = "0.600.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3732cc6f863b06ef80e066a3c2558c322de6fbe76caf704aefe9ca7ccaf25f10" dependencies = [ "anyhow", "bitflags 1.3.2", diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index d1d31f5383d0..4e71d533b102 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -41,7 +41,7 @@ resolver = "2" swc_common = "11.0.0" swc_compiler_base = "22.0.0" swc_config = "3.0.0" - swc_core = "26.1.1" + swc_core = "26.2.1" swc_css_ast = "11.0.0" swc_css_codegen = "11.0.0" swc_css_minifier = "11.0.0" diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 1ab70395a201..abc7d56be080 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 702abb5cbc7c..8f3849b348e4 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 4e5385832378..b306c7b5067d 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.11.29" +version = "1.11.30-nightly-20250527.1" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 21e9b59ca037..e6bd0525c403 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.549" +version = "0.91.550" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index 8204f850b93b..22dd12522ca3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index ddf463f24bd6..d2a3abe05091 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 4fd188cc43e6..2e377194311c 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index 29d810acfe14..54e688c4fc11 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index bb6e8085fedb..d62d17898ac9 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 6a82b01f2af1..132697a145c4 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 45a840a47632..4d88fc9c9430 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index d40fe538017e..287b95b1635d 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index 7877f536c6c2..f1e52623d72d 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 82176f389aff..680831c2d938 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index 197da3e09a44..ba07becc5dd7 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index f482441086b8..86feaf62c2f8 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index c352b8a1f864..51f44e99c620 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index 2b77c0fb3a35..e25b9b3fb36a 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index e79bc1faa08b..54984f0a5668 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 8983763bd239..6996f7c4e95a 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index 3fa6f068be19..43abff875951 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index eb424bf23639..f3b2c6cbd81a 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index e2afbb931e67..94b4ab8df707 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index b0c1bff54b02..3462790bbf91 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index 6e66b1b11542..caf9b9f2b80a 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index 661015f01d13..905bd3923c00 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 35180f8a5334..1fcc8c62eb26 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index 6653345fac12..c79b78d9d38f 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index 10b9703bdba9..dd425c3a6ccd 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index bce5436b1482..5ea6d457041e 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index 41e012039a74..caedca1cbe96 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 719d4ef2ac66..603aca64266d 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index a4cbd9bb6574..1a39e25a1ec4 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index 89f8fdf274d2..efb9cab49e6b 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index 486505450b17..f0222f92e81b 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index 07c8ea4aba94..b3cdac185480 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index a1de7b008bc9..286343296f5f 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.11.29", + "version": "1.11.30-nightly-20250527.1", "os": [ "win32" ], From ee4bef8179dcf4c59ec838b3683ac1a37759eca4 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 27 May 2025 13:36:08 +0000 Subject: [PATCH 020/209] chore: Update changelog --- CHANGELOG-CORE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index f133fd59b1e5..d17ded2a1709 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [swc_core@v26.2.1] - 2025-05-27 ### Features From 8dbdbef266f508e09f52ffe1cbe2e953e5039a3d Mon Sep 17 00:00:00 2001 From: magic-akari Date: Wed, 28 May 2025 00:00:21 +0800 Subject: [PATCH 021/209] fix(ts/fast-dts): Ensure correct emission of template literals and symbol-keyed properties (#10530) --- .changeset/cyan-humans-kick.md | 6 ++ crates/swc_typescript/src/fast_dts/types.rs | 59 +++++++++++++++---- .../tests/fixture/symbol-properties.snap | 2 +- .../tests/fixture/ts-property.snap | 2 + .../tests/fixture/ts-property.ts | 6 ++ 5 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 .changeset/cyan-humans-kick.md diff --git a/.changeset/cyan-humans-kick.md b/.changeset/cyan-humans-kick.md new file mode 100644 index 000000000000..ada65e417974 --- /dev/null +++ b/.changeset/cyan-humans-kick.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_typescript: patch +--- + +fix(ts/fast-dts): Align computed key emission with TypeScript diff --git a/crates/swc_typescript/src/fast_dts/types.rs b/crates/swc_typescript/src/fast_dts/types.rs index 5ee5fc90bc9b..a63e681e27de 100644 --- a/crates/swc_typescript/src/fast_dts/types.rs +++ b/crates/swc_typescript/src/fast_dts/types.rs @@ -1,11 +1,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; -use swc_common::{BytePos, Span, Spanned, DUMMY_SP}; +use swc_common::{BytePos, Span, Spanned, SyntaxContext, DUMMY_SP}; use swc_ecma_ast::{ - ArrayLit, ArrowExpr, Expr, Function, GetterProp, Lit, ObjectLit, Param, Pat, Prop, PropName, - PropOrSpread, Str, Tpl, TsFnOrConstructorType, TsFnParam, TsFnType, TsKeywordTypeKind, TsLit, - TsMethodSignature, TsPropertySignature, TsTupleElement, TsTupleType, TsType, TsTypeAnn, - TsTypeElement, TsTypeLit, TsTypeOperator, TsTypeOperatorOp, UnaryOp, + ArrayLit, ArrowExpr, Expr, Function, GetterProp, Lit, MemberExpr, ObjectLit, Param, Pat, Prop, + PropName, PropOrSpread, Str, Tpl, TsFnOrConstructorType, TsFnParam, TsFnType, + TsKeywordTypeKind, TsLit, TsMethodSignature, TsPropertySignature, TsTupleElement, TsTupleType, + TsType, TsTypeAnn, TsTypeElement, TsTypeLit, TsTypeOperator, TsTypeOperatorOp, UnaryOp, }; +use swc_ecma_utils::quote_ident; use super::{ inferrer::ReturnTypeInferrer, @@ -342,11 +343,48 @@ impl FastDts { pub(crate) fn transform_property_name_to_expr(&mut self, name: &PropName) -> Expr { match name { - PropName::Ident(ident) => Expr::Ident(ident.clone().into()), - PropName::Str(str_prop) => Lit::Str(str_prop.clone()).into(), - PropName::Num(num) => Lit::Num(num.clone()).into(), - PropName::Computed(computed) => *computed.expr.clone(), - PropName::BigInt(big_int) => Lit::BigInt(big_int.clone()).into(), + PropName::Ident(ident) => ident.clone().into(), + PropName::Str(str_prop) => str_prop.clone().into(), + PropName::Num(num) => num.clone().into(), + PropName::BigInt(big_int) => big_int.clone().into(), + PropName::Computed(computed) => { + if let Some(prop) = computed.expr.get_global_symbol_prop(self.unresolved_mark) { + let ctxt = SyntaxContext::empty().apply_mark(self.unresolved_mark); + let symbol = quote_ident!(ctxt, "Symbol"); + + return MemberExpr { + span: name.span(), + obj: symbol.into(), + prop: prop.clone(), + } + .into(); + } + + if let Expr::Tpl(Tpl { + span, + exprs, + quasis, + }) = computed.expr.as_ref() + { + if exprs.is_empty() { + let str_prop = quasis + .first() + .and_then(|el| el.cooked.as_ref()) + .unwrap() + .clone(); + + let str_prop = Str { + span: *span, + value: str_prop, + raw: None, + }; + + return str_prop.into(); + } + } + + computed.expr.as_ref().clone() + } } } @@ -410,6 +448,7 @@ impl FastDts { pub(crate) fn is_literal(expr: &Expr) -> bool { match expr { Expr::Lit(_) => true, + Expr::Tpl(tpl) => tpl.exprs.is_empty(), Expr::Unary(unary) => Self::can_infer_unary_expr(unary), _ => false, } diff --git a/crates/swc_typescript/tests/fixture/symbol-properties.snap b/crates/swc_typescript/tests/fixture/symbol-properties.snap index 7dcaa0f053d9..7842d49ccc4d 100644 --- a/crates/swc_typescript/tests/fixture/symbol-properties.snap +++ b/crates/swc_typescript/tests/fixture/symbol-properties.snap @@ -4,7 +4,7 @@ export declare const foo: { [Symbol.iterator]: () => void; [Symbol.asyncIterator]: () => Promise; - [globalThis.Symbol.iterator]: () => void; + [Symbol.iterator]: () => void; readonly [Symbol.toStringTag]: string; }; export declare abstract class Foo { diff --git a/crates/swc_typescript/tests/fixture/ts-property.snap b/crates/swc_typescript/tests/fixture/ts-property.snap index b22650ba66fe..ec97ce714b50 100644 --- a/crates/swc_typescript/tests/fixture/ts-property.snap +++ b/crates/swc_typescript/tests/fixture/ts-property.snap @@ -10,7 +10,9 @@ export declare const foo: { "foo"(): string; ["bar"](): string; 123(): string; + [456](): string; 1n(): string; + ["x\ny"](): string; }; export { }; diff --git a/crates/swc_typescript/tests/fixture/ts-property.ts b/crates/swc_typescript/tests/fixture/ts-property.ts index ff44253e3ec2..c24796a8faef 100644 --- a/crates/swc_typescript/tests/fixture/ts-property.ts +++ b/crates/swc_typescript/tests/fixture/ts-property.ts @@ -15,7 +15,13 @@ export const foo = { 123(): string { return "123"; }, + [456](): string { + return "456"; + }, 1n(): string { return "1n"; }, + [`x\ny`](): string { + return "x\ny"; + }, }; From 833a153789ba63ff6df0a2bd6e46dc17e0bcd0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 27 May 2025 09:01:34 -0700 Subject: [PATCH 022/209] chore: Publish crates with `swc_core` `v26.2.2` --- .changeset/cyan-humans-kick.md | 6 ------ CHANGELOG-CORE.md | 8 ++++++++ CHANGELOG.md | 3 +++ Cargo.lock | 8 ++++---- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_ecma_codegen/Cargo.toml | 2 +- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 4 ++-- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 4 ++-- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 4 ++-- 43 files changed, 60 insertions(+), 55 deletions(-) delete mode 100644 .changeset/cyan-humans-kick.md diff --git a/.changeset/cyan-humans-kick.md b/.changeset/cyan-humans-kick.md deleted file mode 100644 index ada65e417974..000000000000 --- a/.changeset/cyan-humans-kick.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_typescript: patch ---- - -fix(ts/fast-dts): Align computed key emission with TypeScript diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index d17ded2a1709..d583d4e3722a 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,4 +1,12 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(ts/fast-dts)** Ensure correct emission of template literals and symbol-keyed properties ([#10530](https://github.com/swc-project/swc/issues/10530)) ([8dbdbef](https://github.com/swc-project/swc/commit/8dbdbef266f508e09f52ffe1cbe2e953e5039a3d)) + ## [swc_core@v26.2.1] - 2025-05-27 ### Features diff --git a/CHANGELOG.md b/CHANGELOG.md index 2525d7a24b5a..74e53097fec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) + +- **(ts/fast-dts)** Ensure correct emission of template literals and symbol-keyed properties ([#10530](https://github.com/swc-project/swc/issues/10530)) ([8dbdbef](https://github.com/swc-project/swc/commit/8dbdbef266f508e09f52ffe1cbe2e953e5039a3d)) + ### Features diff --git a/Cargo.lock b/Cargo.lock index b320617f3ef9..dd0e5291d08d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.2.1" +version = "26.2.2" dependencies = [ "anyhow", "binding_macros", @@ -5499,7 +5499,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.1" +version = "14.0.2" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -5629,7 +5629,7 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "14.0.0" +version = "14.0.1" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -6522,7 +6522,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.2" +version = "14.0.3" dependencies = [ "bitflags 2.6.0", "petgraph 0.7.1", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 4835ff349bca..e6574bcfb604 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "concurrent", ] } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 5ba4d470d144..059c0d4b3d6d 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -27,5 +27,5 @@ anyhow = { workspace = true } dashmap = { workspace = true } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 4813ef1f7cb1..87ce96097f49 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -89,7 +89,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "tsc", ] } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", @@ -110,7 +110,7 @@ swc_plugin_proxy = { version = "11.0.0", path = "../swc_plugin_proxy", optional swc_plugin_runner = { version = "13.0.0", path = "../swc_plugin_runner", optional = true, default-features = false } swc_timer = { version = "1.0.0", path = "../swc_timer" } swc_transform_common = { version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { version = "14.0.2", path = "../swc_typescript" } +swc_typescript = { version = "14.0.3", path = "../swc_typescript" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dependencies.tokio] diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 95ead66c24c8..fb6c07dc2e7d 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -43,7 +43,7 @@ swc_common = { version = "11.0.0", path = "../swc_common" swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 50f2d14e8d39..0a9de4a30ded 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.2.1", features = [ +swc_core = { version = "26.2.2", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 9c2cad79f6e9..91e68b600d82 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -31,7 +31,7 @@ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index b5f847f6edb8..7f2e61e16aac 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.2.1" +version = "26.2.2" [package.metadata.docs.rs] features = [ "allocator_node", @@ -369,7 +369,7 @@ swc_ecma_codegen = { optional = true, version = "13.1.0", path = swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_minifier = { optional = true, version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { optional = true, version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { optional = true, version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } swc_ecma_react_compiler = { optional = true, version = "4.0.1", path = "../swc_ecma_react_compiler" } @@ -393,7 +393,7 @@ swc_plugin_proxy = { optional = true, version = "11.0.0", path = swc_plugin_runner = { optional = true, version = "13.0.0", path = "../swc_plugin_runner", default-features = false } swc_trace_macro = { optional = true, version = "2.0.1", path = "../swc_trace_macro" } swc_transform_common = { optional = true, version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { optional = true, version = "14.0.2", path = "../swc_typescript" } +swc_typescript = { optional = true, version = "14.0.3", path = "../swc_typescript" } testing = { optional = true, version = "12.0.0", path = "../testing" } [build-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index b417ed312aa7..b9f731ebce30 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -47,7 +47,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator" } swc_common = { version = "11.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index b657f96a853f..ac6185cf7440 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -24,5 +24,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 68a93c6b61ed..b33cb18b766d 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -36,5 +36,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index c14d22082136..86740e72a4b1 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -24,5 +24,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 665288226f99..3821b46ed172 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -26,5 +26,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index f6fe6eadb381..641433aad69e 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -27,5 +27,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 831f53305f1d..58c4a78e42ac 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -25,5 +25,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 2bef712f5a62..6db037728e73 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -25,5 +25,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 02dce7e8f98f..d27cff31b8c9 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -23,5 +23,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index a3e380190100..b84b15e5af0a 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.1" +version = "14.0.2" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 61ad5310a36c..c29112418595 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -38,7 +38,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 816c3c7eba72..b0eb50743153 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -63,7 +63,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 3cbd9fa09c26..afb69d549cc7 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_parser" repository = { workspace = true } -version = "14.0.0" +version = "14.0.1" [package.metadata.docs.rs] all-features = true @@ -42,7 +42,7 @@ phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.1", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.2", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index a393ec7f9d31..626b9bc4cd30 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -45,7 +45,7 @@ criterion = { workspace = true } pretty_assertions = { workspace = true } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } [[bench]] diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 9a6b182dbe69..763cfdfe4a84 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -22,5 +22,5 @@ syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index c54646d78cf5..ce85efaa8372 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -56,6 +56,6 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index c8eab935ef60..1ffcdf459f06 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 175d4e633266..22d7d5979339 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -56,6 +56,6 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } par-core = { workspace = true, features = ["chili"] } serde_json = { workspace = true } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 88acd69ffd08..533db7aa215f 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -34,7 +34,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ "node", ] } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 413b50c4516e..4ef01b30324d 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -35,7 +35,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index ee6554d50cb3..00f0df84f9a5 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } serde_json = { workspace = true } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index b491bad145d1..7aa2ac2d6fd5 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -33,7 +33,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index bcbcf08b4c97..073fedc9af5f 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -28,7 +28,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 28b70f612d9c..325a33dd68e1 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -34,7 +34,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 4038aed57dc9..ebba81d4d2ea 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -41,5 +41,5 @@ stacker = { version = "0.1.15", optional = true } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 6561c19b226f..3292fbc3cc69 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -41,7 +41,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", optional = true } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", optional = true } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index a5b3b8a23546..d32b485dd551 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -30,7 +30,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "tty-emitter", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_estree_ast = { version = "11.0.0", path = "../swc_estree_ast" } @@ -43,7 +43,7 @@ pretty_assertions = { workspace = true } swc = { version = "25.0.0", path = "../swc" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms/" } testing = { version = "12.0.0", path = "../testing" } walkdir = { workspace = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 21dc68f5f2f5..1630fb6fe91e 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -22,7 +22,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.1", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.2", path = "../swc_ecma_lexer" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 5eb532d805d1..4336d3dff2f4 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index a7b9e61de470..72032c0aaf95 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -41,7 +41,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 19e5a0683a6f..444227a41279 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -89,7 +89,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "rkyv-impl", ] } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index b7fd78235f1d..08fda5aee732 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_typescript" repository = { workspace = true } -version = "14.0.2" +version = "14.0.3" [dependencies] bitflags = {workspace = true } @@ -23,6 +23,6 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } testing = { version = "12.0.0", path = "../testing" } From a72092c13166fe80d494e49cf0c5ec04e93ee4eb Mon Sep 17 00:00:00 2001 From: bohan Date: Wed, 28 May 2025 22:08:46 +0800 Subject: [PATCH 023/209] refactor(es/lexer): Cleanup code for reading tokens (#10533) --- .changeset/yellow-bikes-complain.md | 6 + crates/swc_ecma_lexer/src/common/lexer/mod.rs | 181 ++++++------------ 2 files changed, 62 insertions(+), 125 deletions(-) create mode 100644 .changeset/yellow-bikes-complain.md diff --git a/.changeset/yellow-bikes-complain.md b/.changeset/yellow-bikes-complain.md new file mode 100644 index 000000000000..1e92bf3c1993 --- /dev/null +++ b/.changeset/yellow-bikes-complain.md @@ -0,0 +1,6 @@ +--- +swc_ecma_lexer: patch +swc_core: patch +--- + +refactor(ecma/lexer): cleanup read token diff --git a/crates/swc_ecma_lexer/src/common/lexer/mod.rs b/crates/swc_ecma_lexer/src/common/lexer/mod.rs index 7dec5274a9b6..36af1e535334 100644 --- a/crates/swc_ecma_lexer/src/common/lexer/mod.rs +++ b/crates/swc_ecma_lexer/src/common/lexer/mod.rs @@ -335,23 +335,20 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { while let Some(c) = self.cur() { if allow_num_separator && c == '_' { let is_allowed = |c: Option| { - if c.is_none() { + let Some(c) = c else { return false; - } - - let c = c.unwrap(); - + }; c.is_digit(RADIX as _) }; let is_forbidden = |c: Option| { - if c.is_none() { - return true; - } + let Some(c) = c else { + return false; + }; if RADIX == 16 { - matches!(c.unwrap(), '.' | 'X' | '_' | 'x') + matches!(c, '.' | 'X' | '_' | 'x') } else { - matches!(c.unwrap(), '.' | 'B' | 'E' | 'O' | '_' | 'b' | 'e' | 'o') + matches!(c, '.' | 'B' | 'E' | 'O' | '_' | 'b' | 'e' | 'o') } }; @@ -498,18 +495,14 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { ) -> LexResult, Atom)>> { debug_assert!(self.cur().is_some()); - if starts_with_dot { - debug_assert_eq!( - self.cur(), - Some('.'), - "read_number(starts_with_dot = true) expects current char to be '.'" - ); - } - let start = self.cur_pos(); let val = if starts_with_dot { // first char is '.' + debug_assert!( + self.cur().is_some_and(|c| c == '.'), + "read_number(starts_with_dot = true) expects current char to be '.'" + ); 0f64 } else { let starts_with_zero = self.cur().unwrap() == '0'; @@ -602,10 +595,8 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { if self.cur() == Some('.') { self.bump(); - if starts_with_dot { - debug_assert!(self.cur().is_some()); - debug_assert!(self.cur().unwrap().is_ascii_digit()); - } + // equal: if starts_with_dot { debug_assert!(xxxx) } + debug_assert!(!starts_with_dot || self.cur().is_some_and(|cur| cur.is_ascii_digit())); // Read numbers after dot self.read_int::<10>(0)?; @@ -732,15 +723,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { let start = self.cur_pos(); self.bump(); - - match self.input().cur() { - Some(..) => { - self.bump(); - } - _ => { - unreachable!(); - } - } + self.bump(); let (val, s, _) = self.read_number_no_dot_as_str::()?; @@ -856,12 +839,8 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { let mut s = SmartString::::default(); - let c = self.input().cur(); - debug_assert_eq!(c, Some('&')); - unsafe { - // Safety: cur() was Some('&') - self.input_mut().bump(); - } + debug_assert!(self.input().cur().is_some_and(|c| c == '&')); + self.bump(); let start_pos = self.input().cur_pos(); @@ -870,10 +849,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { Some(c) => c, None => break, }; - unsafe { - // Safety: cur() was Some(c) - self.input_mut().bump(); - } + self.bump(); if c == ';' { if let Some(stripped) = s.strip_prefix('#') { @@ -909,10 +885,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { fn read_jsx_new_line(&mut self, normalize_crlf: bool) -> LexResult> { debug_assert!(self.syntax().jsx()); let ch = self.input().cur().unwrap(); - unsafe { - // Safety: cur() was Some(ch) - self.input_mut().bump(); - } + self.bump(); let out = if ch == '\r' && self.input().cur() == Some('\n') { unsafe { @@ -1029,10 +1002,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { // it might be at the end of the file when // the string literal is unterminated if self.input().peek_ahead().is_some() { - unsafe { - // Safety: We called peek_ahead() which means cur() was Some - self.input_mut().bump(); - } + self.bump(); } let end = self.input().cur_pos(); @@ -1158,12 +1128,8 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { if self.input().cur() != Some('#') || self.input().peek() != Some('!') { return Ok(None); } - unsafe { - // Safety: cur() is Some('#') - self.input_mut().bump(); - // Safety: cur() is Some('!') - self.input_mut().bump(); - } + self.bump(); // `#` + self.bump(); // `!` let s = self.input_uncons_while(|c| !c.is_line_terminator()); Ok(Some(self.atom(s))) } @@ -1293,20 +1259,14 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { None => self.error_span(pos_span(start), SyntaxError::InvalidStrEscape)?, }; - macro_rules! push_c_and_ret { - ($c:expr) => {{ - $c - }}; - } - let c = match c { - '\\' => push_c_and_ret!('\\'), - 'n' => push_c_and_ret!('\n'), - 'r' => push_c_and_ret!('\r'), - 't' => push_c_and_ret!('\t'), - 'b' => push_c_and_ret!('\u{0008}'), - 'v' => push_c_and_ret!('\u{000b}'), - 'f' => push_c_and_ret!('\u{000c}'), + '\\' => '\\', + 'n' => '\n', + 'r' => '\r', + 't' => '\t', + 'b' => '\u{0008}', + 'v' => '\u{000b}', + 'f' => '\u{000c}', '\r' => { self.bump(); // remove '\r' @@ -1599,12 +1559,9 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// `#` fn read_token_number_sign(&mut self) -> LexResult> { - debug_assert!(self.cur().is_some()); + debug_assert!(self.cur().is_some_and(|c| c == '#')); - unsafe { - // Safety: cur() is Some('#') - self.input_mut().bump(); // '#' - } + self.bump(); // '#' // `#` can also be a part of shebangs, however they should have been // handled by `read_shebang()` @@ -1620,14 +1577,12 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_dot(&mut self) -> LexResult { + debug_assert!(self.cur().is_some_and(|c| c == '.')); // Check for eof let next = match self.input().peek() { Some(next) => next, None => { - unsafe { - // Safety: cur() is Some(',') - self.input_mut().bump(); - } + self.bump(); // '.' return Ok(Self::Token::DOT); } }; @@ -1638,19 +1593,11 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { }); } - unsafe { - // Safety: cur() is Some - // 1st `.` - self.input_mut().bump(); - } + self.bump(); // 1st `.` if next == '.' && self.input().peek() == Some('.') { - unsafe { - // Safety: peek() was Some - - self.input_mut().bump(); // 2nd `.` - self.input_mut().bump(); // 3rd `.` - } + self.bump(); // 2nd `.` + self.bump(); // 3rd `.` return Ok(Self::Token::DOTDOTDOT); } @@ -1663,29 +1610,16 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_question_mark(&mut self) -> LexResult { - match self.input().peek() { - Some('?') => { - unsafe { - // Safety: peek() was some - self.input_mut().bump(); - self.input_mut().bump(); - } - if self.input().cur() == Some('=') { - unsafe { - // Safety: cur() was some - self.input_mut().bump(); - } - return Ok(Self::Token::NULLISH_ASSIGN); - } + debug_assert!(self.cur().is_some_and(|c| c == '?')); + self.bump(); + if self.input_mut().eat_byte(b'?') { + if self.input_mut().eat_byte(b'=') { + Ok(Self::Token::NULLISH_ASSIGN) + } else { Ok(Self::Token::NULLISH_COALESCING) } - _ => { - unsafe { - // Safety: peek() is callable only if cur() is Some - self.input_mut().bump(); - } - Ok(Self::Token::QUESTION) - } + } else { + Ok(Self::Token::QUESTION) } } @@ -1694,10 +1628,8 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_colon(&mut self) -> LexResult { - unsafe { - // Safety: cur() is Some(':') - self.input_mut().bump(); - } + debug_assert!(self.cur().is_some_and(|c| c == ':')); + self.bump(); // ':' Ok(Self::Token::COLON) } @@ -1706,6 +1638,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_zero(&mut self) -> LexResult { + debug_assert_eq!(self.cur(), Some('0')); let next = self.input().peek(); let bigint = match next { @@ -1732,6 +1665,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { #[inline(never)] fn read_token_logical(&mut self) -> LexResult { debug_assert!(C == b'|' || C == b'&'); + let is_bit_and = C == b'&'; let had_line_break_before_last = self.had_line_break_before_last(); let start = self.cur_pos(); @@ -1739,7 +1673,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { // Safety: cur() is Some(c as char) self.input_mut().bump(); } - let token = if C == b'&' { + let token = if is_bit_and { Self::Token::BIT_AND } else { Self::Token::BIT_OR @@ -1747,7 +1681,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { // '|=', '&=' if self.input_mut().eat_byte(b'=') { - return Ok(if token.is_bit_and() { + return Ok(if is_bit_and { Self::Token::BIT_AND_EQ } else { debug_assert!(token.is_bit_or()); @@ -1768,7 +1702,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { self.input_mut().bump(); } - return Ok(if token.is_bit_and() { + return Ok(if is_bit_and { Self::Token::LOGICAL_AND_EQ } else { debug_assert!(token.is_bit_or()); @@ -1778,7 +1712,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { // ||||||| // ^ - if had_line_break_before_last && token.is_bit_or() && self.is_str("||||| ") { + if had_line_break_before_last && !is_bit_and && self.is_str("||||| ") { let span = fixed_len_span(start, 7); self.emit_error_span(span, SyntaxError::TS1185); self.skip_line_comment(5); @@ -1786,7 +1720,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { return self.error_span(span, SyntaxError::TS1185); } - return Ok(if token.is_bit_and() { + return Ok(if is_bit_and { Self::Token::LOGICAL_AND } else { debug_assert!(token.is_bit_or()); @@ -1802,10 +1736,8 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { /// This is extracted as a method to reduce size of `read_token`. #[inline(never)] fn read_token_mul_mod(&mut self, is_mul: bool) -> LexResult { - unsafe { - // Safety: cur() is Some(c) - self.input_mut().bump(); - } + debug_assert!(self.cur().is_some_and(|c| c == '*' || c == '%')); + self.bump(); let token = if is_mul { if self.input_mut().eat_byte(b'*') { // `**` @@ -1834,8 +1766,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { #[inline(never)] fn read_slash(&mut self) -> LexResult> { debug_assert_eq!(self.cur(), Some('/')); - // Divide operator - self.bump(); + self.bump(); // '/' Ok(Some(if self.eat(b'=') { Self::Token::DIV_EQ } else { @@ -1930,7 +1861,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { continue; } - if (c as char).is_line_break() { + if matches!(c, b'\r' | b'\n') { break; } From d9ba838df9b88d6c4108bc21dd9d6eebd406aacd Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 30 May 2025 01:21:12 +0800 Subject: [PATCH 024/209] fix(es/codegen): Improve comments handling (#10534) --- .changeset/modern-crews-glow.md | 6 +++ .../fixture/issues-5xxx/5272/1/output/a.map | 2 +- ...ExportedFunctionThatShareAName.1.normal.js | 6 +-- .../ES5SymbolProperty5.1.normal.js | 3 +- ...tDeclarationsPatterns_merging3.1.normal.js | 3 +- .../arraySpreadInCall.1.normal.js | 3 +- ...rsingAsAmbientExternalModule01.1.normal.js | 9 ++-- ...rsingAsAmbientExternalModule02.1.normal.js | 9 ++-- ...siPreventsParsingAsNamespace02.1.normal.js | 6 +-- ...rtyToPropertyDeclarationES2022.1.normal.js | 31 ++++------- ...rtyToPropertyDeclarationESNext.1.normal.js | 31 ++++------- ...gnaturesWithOptionalParameters.1.normal.js | 5 +- ...mpatWithGenericCallSignatures3.1.normal.js | 3 +- .../tsc-references/callOverload.1.normal.js | 3 +- .../callWithMissingVoid.1.normal.js | 42 +++++---------- .../callWithSpread2.1.normal.js | 3 +- .../classAbstractSuperCalls.1.normal.js | 3 +- ...classConstructorAccessibility2.1.normal.js | 12 ++--- ...classConstructorAccessibility5.1.normal.js | 6 +-- ...tructorParametersAccessibility.1.normal.js | 9 ++-- ...ructorParametersAccessibility2.1.normal.js | 9 ++-- ...risonOperatorWithNumberOperand.1.normal.js | 3 +- ...nditionalTypesExcessProperties.1.normal.js | 3 +- .../constructorFunctionsStrict.1.normal.js | 6 +-- ...torParameterShadowsOuterScopes.1.normal.js | 6 +-- ...lFlowInstanceofExtendsFunction.1.normal.js | 9 ++-- .../controlFlowStringIndex.1.normal.js | 6 +-- .../derivedClassTransitivity.1.normal.js | 6 +-- .../derivedClassTransitivity2.1.normal.js | 6 +-- .../derivedClassTransitivity3.1.normal.js | 6 +-- .../derivedClassTransitivity4.1.normal.js | 6 +-- .../tests/tsc-references/enumTag.1.normal.js | 9 ++-- .../exportNamespace12.1.normal.js | 6 +-- ...ionExpressionContextualTyping2.1.normal.js | 3 +- ...lobalThisBlockscopedProperties.1.normal.js | 24 +++------ .../globalThisReadonlyProperties.1.normal.js | 6 +-- ...eExpansionThroughTypeInference.1.normal.js | 3 +- ...erReferencingConstructorLocals.1.normal.js | 12 ++--- ...ferencingConstructorParameters.1.normal.js | 11 ++-- ...eMemberAssignsToClassPrototype.1.normal.js | 3 +- .../intersectionTypeReadonly.1.normal.js | 3 +- .../jsDeclarationsClassStatic.1.normal.js | 4 +- .../jsDeclarationsEnumTag.1.normal.js | 3 +- .../keyofAndIndexedAccess.1.normal.js | 3 +- .../keyofAndIndexedAccessErrors.1.normal.js | 6 +-- .../looseThisTypeInFunctions.1.normal.js | 3 +- .../moduleExportAssignment.1.normal.js | 6 +-- .../moduleExportAssignment2.1.normal.js | 3 +- .../moduleExportAssignment3.1.normal.js | 6 +-- ...xportPropertyAssignmentDefault.1.normal.js | 3 +- ...rtWithExportPropertyAssignment.1.normal.js | 3 +- ...tWithExportPropertyAssignment2.1.normal.js | 3 +- ...tWithExportPropertyAssignment3.1.normal.js | 6 +-- ...tWithExportPropertyAssignment4.1.normal.js | 3 +- .../tests/tsc-references/noInfer.1.normal.js | 18 +++---- ...ConstrainsPropertyDeclarations.1.normal.js | 3 +- .../tsc-references/override2.1.normal.js | 3 +- ...ramTagOnFunctionUsingArguments.1.normal.js | 3 +- ...arserArrowFunctionExpression10.1.normal.js | 5 +- ...arserArrowFunctionExpression12.1.normal.js | 5 +- ...arserArrowFunctionExpression15.1.normal.js | 3 +- ...arserArrowFunctionExpression16.1.normal.js | 3 +- ...arserArrowFunctionExpression17.1.normal.js | 3 +- ...parserArrowFunctionExpression9.1.normal.js | 5 +- .../parserRealSource12.1.normal.js | 3 +- .../privateNameCircularReference.1.normal.js | 3 +- .../privateNameMethod.1.normal.js | 6 +-- .../privateNameMethodAssignment.1.normal.js | 9 ++-- .../privateNameStaticMethod.1.normal.js | 6 +-- ...vateNameStaticMethodAssignment.1.normal.js | 9 ++-- ...sFieldsInEsNext(target=es2020).1.normal.js | 24 +++------ ...sFieldsInEsNext(target=esnext).1.normal.js | 24 +++------ .../privateNamesUseBeforeDef.1.normal.js | 16 +++--- ...ivateStaticMemberAccessibility.1.normal.js | 3 +- ...ropertyAndFunctionWithSameName.1.normal.js | 3 +- .../propertyOverridesAccessors3.1.normal.js | 6 +-- .../spellingUncheckedJS.1.normal.js | 21 +++----- .../staticIndexSignature7.1.normal.js | 6 +-- ...nsToConstructorFunctionMembers.1.normal.js | 3 +- .../strictPropertyInitialization.1.normal.js | 11 ++-- ...ConstrainsPropertyDeclarations.1.normal.js | 3 +- .../thisTypeInFunctions.1.normal.js | 18 +++---- .../thisTypeInFunctions2.1.normal.js | 9 ++-- .../tsNoCheckForTypescript.1.normal.js | 3 +- ...sNoCheckForTypescriptComments1.1.normal.js | 3 +- ...sNoCheckForTypescriptComments2.1.normal.js | 3 +- .../tsxDynamicTagName1.1.normal.js | 3 +- .../tsxDynamicTagName2.1.normal.js | 3 +- .../tsxDynamicTagName3.1.normal.js | 3 +- .../typeFromJSConstructor.1.normal.js | 33 ++++-------- .../typeFromPropertyAssignment22.1.normal.js | 3 +- .../typeFromPropertyAssignment36.1.normal.js | 3 +- .../typeFromPropertyAssignment37.1.normal.js | 6 +-- ...GuardsInFunctionAndModuleBlock.1.normal.js | 6 +-- .../typeGuardsWithInstanceOf.1.normal.js | 6 +-- .../typeOfThisInStaticMembers2.1.normal.js | 6 +-- .../typeTagNoErasure.1.normal.js | 6 +-- .../unionTypeReadonly.1.normal.js | 3 +- .../unionTypeWithIndexSignature.1.normal.js | 3 +- .../tests/tsc-references/witness.1.normal.js | 3 +- crates/swc_ecma_codegen/src/comments.rs | 27 ++++++++-- crates/swc_ecma_codegen/src/stmt.rs | 8 ++- crates/swc_ecma_codegen/src/tests.rs | 4 +- .../tests/test262/12d4b327a5e20850.js | 3 +- .../tests/test262/14fb22cf10e20236.js | 3 +- .../tests/test262/2dd810da4984502b.js | 2 +- .../tests/test262/366585381e4610b4.js | 3 +- .../tests/test262/40215319424a8227.js | 3 +- .../tests/test262/402c32920b1b9991.js | 2 +- .../tests/test262/402e8d30db64e5af.js | 3 +- .../tests/test262/5d0cbb3fb27c21b7.js | 3 +- .../tests/test262/771467ccdae93157.js | 2 +- .../tests/test262/776076cb09759e40.js | 2 +- .../tests/test262/9d0fd95dd43f59ec.js | 2 +- .../tests/test262/ae700e3f8ff82c6c.js | 3 +- .../tests/test262/e46f7944dd0d4eb4.js | 2 +- .../src/object_super.rs/do_not_transform.js | 3 +- .../tests/fixture/issues/6957/1/output.js | 51 +++++++------------ .../tests/fixture/issues/8324/output.js | 3 +- .../general/class-properties-loose/output.js | 3 +- .../general/class-properties/output.js | 3 +- .../src/transform.rs | 15 ++++-- .../tests/strip.rs/issue_960_1.js | 3 +- crates/swc_ecma_utils/src/factory.rs | 5 +- crates/swc_typescript/src/fast_dts/types.rs | 14 +++-- .../tests/fixture/simple-getter-setter.snap | 1 + 126 files changed, 342 insertions(+), 554 deletions(-) create mode 100644 .changeset/modern-crews-glow.md diff --git a/.changeset/modern-crews-glow.md b/.changeset/modern-crews-glow.md new file mode 100644 index 000000000000..0706b9dc3592 --- /dev/null +++ b/.changeset/modern-crews-glow.md @@ -0,0 +1,6 @@ +--- +swc_core: minor +swc_ecma_codegen: minor +--- + +fix(es/codegen): Improve comments handling diff --git a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map index dc5e796c74e5..f8b4fc489c6c 100644 --- a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map +++ b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map @@ -1,5 +1,5 @@ { - "mappings": ";;;+BACaA;;;eAAAA;;;;;;;oBADQ;AACd,IAAA,AAAMA,oBAAN;;gBAAMA;aAAAA;kCAAAA;eAAN,oBAAMA;;oBAAAA;;YACTC,KAAAA;mBAAAA,SAAAA;gBACI,OAAO,IAAI,IAAI,CAACC,GAAG;YACvB;;;WAHSF;EAAYG,UAAI", + "mappings": ";;;+BACaA;;;eAAAA;;;;;;;oBADQ;AACd,IAAA,AAAMA,oBAAN;;gBAAMA;aAAAA;kCAAAA;QAAN,OAAA,oBAAMA;;oBAAAA;;YACTC,KAAAA;mBAAAA,SAAAA;gBACI,OAAO,IAAI,IAAI,CAACC,GAAG;YACvB;;;WAHSF;EAAYG,UAAI", "names": [ "Foo", "bar", diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.1.normal.js index aa20f2a06ae1..b268791dcf09 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.1.normal.js @@ -12,8 +12,7 @@ var Point = /*#__PURE__*/ function() { x: 0, y: 0 }; - } // unexpected error here bug 840246 - ; + }; // unexpected error here bug 840246 return Point; }(); (function(Point) { @@ -35,8 +34,7 @@ var Point = /*#__PURE__*/ function() { x: 0, y: 0 }; - } // unexpected error here bug 840246 - ; + }; // unexpected error here bug 840246 return Point; }(); A.Point = Point; diff --git a/crates/swc/tests/tsc-references/ES5SymbolProperty5.1.normal.js b/crates/swc/tests/tsc-references/ES5SymbolProperty5.1.normal.js index 520a7ea53fa7..41dc033cd6a5 100644 --- a/crates/swc/tests/tsc-references/ES5SymbolProperty5.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5SymbolProperty5.1.normal.js @@ -10,5 +10,4 @@ var C = /*#__PURE__*/ function() { _proto[Symbol.iterator] = function() {}; return C; }(); -(new C)[Symbol.iterator](0) // Should error -; +(new C)[Symbol.iterator](0); // Should error diff --git a/crates/swc/tests/tsc-references/ambientDeclarationsPatterns_merging3.1.normal.js b/crates/swc/tests/tsc-references/ambientDeclarationsPatterns_merging3.1.normal.js index c029e96e0c7f..5e1f8113fc41 100644 --- a/crates/swc/tests/tsc-references/ambientDeclarationsPatterns_merging3.1.normal.js +++ b/crates/swc/tests/tsc-references/ambientDeclarationsPatterns_merging3.1.normal.js @@ -1,5 +1,4 @@ //// [types.ts] //// [test.ts] -ohno.a // oh no -; +ohno.a; // oh no export { }; diff --git a/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js b/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js index b030401b54b7..bfbb53f25ae8 100644 --- a/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js +++ b/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js @@ -105,5 +105,4 @@ var x44 = f4.apply(void 0, [ (_action = action).run.apply(_action, [ 100, 'foo' -] // error -); +]); // error diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule01.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule01.1.normal.js index 40f9f3ced31c..74adb67f80af 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule01.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule01.1.normal.js @@ -1,10 +1,7 @@ //// [asiPreventsParsingAsAmbientExternalModule01.ts] var declare; var module; -declare // this is the identifier 'declare' -; -module // this is the identifier 'module' -; -"my external module" // this is just a string -; +declare; // this is the identifier 'declare' +module; // this is the identifier 'module' +"my external module"; // this is just a string {} // this is a block body diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule02.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule02.1.normal.js index 3fde098d1c86..328c8ffb7905 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule02.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsAmbientExternalModule02.1.normal.js @@ -2,12 +2,9 @@ var declare; var module; (function(container) { - declare // this is the identifier 'declare' - ; - module // this is the identifier 'module' - ; - "my external module" // this is just a string - ; + declare; // this is the identifier 'declare' + module; // this is the identifier 'module' + "my external module"; // this is just a string {} })(container || (container = {})); var container; diff --git a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace02.1.normal.js b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace02.1.normal.js index fcfd31535787..f7ac75d4df7f 100644 --- a/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace02.1.normal.js +++ b/crates/swc/tests/tsc-references/asiPreventsParsingAsNamespace02.1.normal.js @@ -1,8 +1,6 @@ //// [asiPreventsParsingAsNamespace02.ts] var module; var m; -module // this is the identifier 'namespace' -; -m // this is the identifier 'm' -; +module; // this is the identifier 'namespace' +m; // this is the identifier 'm' {} // this is a block body diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js index 7c10007265c1..79f3e594bfd4 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js @@ -7,35 +7,26 @@ class C { quench; quanch; m1() { - this.foo // ok - ; + this.foo; // ok } m3; constructor(foo){ this.foo = foo; - this.qux = this.bar // should error - ; - this.bar = this.foo // should error - ; - this.quiz = this.bar // ok - ; - this.quench = this.m1() // ok - ; - this.quanch = this.m3() // should error - ; + this.qux = this.bar; // should error + this.bar = this.foo; // should error + this.quiz = this.bar; // ok + this.quench = this.m1(); // ok + this.quanch = this.m3(); // should error this.m3 = function() {}; - this.quim = this.baz // should error - ; - this.baz = this.foo; - this.quid = this.baz // ok - ; + this.quim = this.baz; // should error + this.baz = this.foo; // should error + this.quid = this.baz; // ok } quim; baz; quid; m2() { - this.foo // ok - ; + this.foo; // ok } } class D extends C { @@ -48,7 +39,7 @@ class E { foo1; constructor(foo2){ this.foo2 = foo2; - this.bar = ()=>this.foo1 + this.foo2; + this.bar = ()=>this.foo1 + this.foo2; // both ok this.foo1 = ''; } } diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js index f83b37cd3da0..5f25c99517f0 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js @@ -7,35 +7,26 @@ class C { quench; quanch; m1() { - this.foo // ok - ; + this.foo; // ok } m3; constructor(foo){ this.foo = foo; - this.qux = this.bar // should error - ; - this.bar = this.foo // should error - ; - this.quiz = this.bar // ok - ; - this.quench = this.m1() // ok - ; - this.quanch = this.m3() // should error - ; + this.qux = this.bar; // should error + this.bar = this.foo; // should error + this.quiz = this.bar; // ok + this.quench = this.m1(); // ok + this.quanch = this.m3(); // should error this.m3 = function() {}; - this.quim = this.baz // should error - ; - this.baz = this.foo; - this.quid = this.baz // ok - ; + this.quim = this.baz; // should error + this.baz = this.foo; // should error + this.quid = this.baz; // ok } quim; baz; quid; m2() { - this.foo // ok - ; + this.foo; // ok } } class D extends C { @@ -48,7 +39,7 @@ class E { foo1; constructor(foo2){ this.foo2 = foo2; - this.bar = ()=>this.foo1 + this.foo2; + this.bar = ()=>this.foo1 + this.foo2; // both ok this.foo1 = ''; } } diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignaturesWithOptionalParameters.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignaturesWithOptionalParameters.1.normal.js index 1d8121b8f0e6..ccc2e04aa69b 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignaturesWithOptionalParameters.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignaturesWithOptionalParameters.1.normal.js @@ -3,9 +3,8 @@ var b; var a; a = function() { - return 1 // ok, same number of required params - ; -}; + return 1; +}; // ok, same number of required params a = function(x) { return 1; }; // ok, same number of required params diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignatures3.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignatures3.1.normal.js index d75a50d5c9c7..8b35270ba842 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignatures3.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithGenericCallSignatures3.1.normal.js @@ -2,5 +2,4 @@ // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation var g; var h; -g = h // ok -; +g = h; // ok diff --git a/crates/swc/tests/tsc-references/callOverload.1.normal.js b/crates/swc/tests/tsc-references/callOverload.1.normal.js index 2abcadfeb2e3..6fec5b1c01d5 100644 --- a/crates/swc/tests/tsc-references/callOverload.1.normal.js +++ b/crates/swc/tests/tsc-references/callOverload.1.normal.js @@ -1,8 +1,7 @@ //// [callOverload.ts] import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; var n; -fn(1) // no error -; +fn(1); // no error fn(1, 2, 3, 4); takeTwo(1, 2, 3, 4); withRest.apply(void 0, [ diff --git a/crates/swc/tests/tsc-references/callWithMissingVoid.1.normal.js b/crates/swc/tests/tsc-references/callWithMissingVoid.1.normal.js index 0e27343c5662..9397add1380b 100644 --- a/crates/swc/tests/tsc-references/callWithMissingVoid.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithMissingVoid.1.normal.js @@ -14,18 +14,12 @@ var X = /*#__PURE__*/ function() { }; return X; }(); -x.f() // no error because f expects void -; -xUnion.f(42) // no error because f accepts number -; -xUnion.f() // no error because f accepts void -; -xAny.f() // error, any still expects an argument -; -xUnknown.f() // error, unknown still expects an argument -; -xNever.f() // error, never still expects an argument -; +x.f(); // no error because f expects void +xUnion.f(42); // no error because f accepts number +xUnion.f(); // no error because f accepts void +xAny.f(); // error, any still expects an argument +xUnknown.f(); // error, unknown still expects an argument +xNever.f(); // error, never still expects an argument // Promise has previously been updated to work without arguments, but to show this fixes the issue too. var MyPromise = function MyPromise(executor) { "use strict"; @@ -63,33 +57,25 @@ c(3); // ok c(); // ok call(function(x1, y) { return x1 + y; -}) // error -; +}); // error call(function(x1, y) { return x1 + y; -}, 4, 2) // ok -; +}, 4, 2); // ok call(function(x1, y) { return x1; -}, 4, void 0) // ok -; +}, 4, void 0); // ok call(function(x1, y) { return x1; -}, 4) // ok -; +}, 4); // ok call(function(x1, y) { return 42; -}) // ok -; +}); // ok call(function(x1, y) { return 42; -}) // ok -; +}); // ok call(function(x1, y) { return 42; -}, 4) // ok -; +}, 4); // ok call(function(x1, y) { return 42; -}, 4, 2) // ok -; +}, 4, 2); // ok diff --git a/crates/swc/tests/tsc-references/callWithSpread2.1.normal.js b/crates/swc/tests/tsc-references/callWithSpread2.1.normal.js index 6619a3128881..6617224ca62c 100644 --- a/crates/swc/tests/tsc-references/callWithSpread2.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpread2.1.normal.js @@ -31,8 +31,7 @@ rest.apply(void 0, [ rest.apply(void 0, [ "f" ].concat(_to_consumable_array(tuple))); -prefix.apply(void 0, _to_consumable_array(ns)) // required parameters are required -; +prefix.apply(void 0, _to_consumable_array(ns)); // required parameters are required prefix.apply(void 0, _to_consumable_array(mixed)); prefix.apply(void 0, _to_consumable_array(tuple)); prefix2.apply(void 0, [ diff --git a/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js b/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js index 22a5eb11fb1c..35002987c7c8 100644 --- a/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js +++ b/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js @@ -44,8 +44,7 @@ var C = /*#__PURE__*/ function(B) { }; _proto.qux = function qux() { return _get(_get_prototype_of(C.prototype), "foo", this).call(this) || _get(_get_prototype_of(C.prototype), "foo", this); - } // 2 errors, foo is abstract - ; + }; // 2 errors, foo is abstract _proto.norf = function norf() { return _get(_get_prototype_of(C.prototype), "bar", this).call(this); }; diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js index 21dbf3a27c16..f5e6786e2fc7 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js @@ -81,12 +81,10 @@ var DerivedB = /*#__PURE__*/ function(BaseB1) { }; _proto.createBaseInstance = function createBaseInstance() { new BaseB(8); - } // ok - ; + }; // ok DerivedB.staticBaseInstance = function staticBaseInstance() { new BaseB(9); - } // ok - ; + }; // ok return DerivedB; }(BaseB); var DerivedC = /*#__PURE__*/ function(BaseC1) { @@ -106,12 +104,10 @@ var DerivedC = /*#__PURE__*/ function(BaseC1) { }; _proto.createBaseInstance = function createBaseInstance() { new BaseC(10); - } // error - ; + }; // error DerivedC.staticBaseInstance = function staticBaseInstance() { new BaseC(11); - } // error - ; + }; // error return DerivedC; }(BaseC); var ba = new BaseA(1); diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js index b49a5d3863f6..96aa5006536d 100644 --- a/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js @@ -15,8 +15,7 @@ var Derived = /*#__PURE__*/ function(Base1) { } Derived.make = function make() { new Base(); - } // ok - ; + }; // ok return Derived; }(Base); var Unrelated = /*#__PURE__*/ function() { @@ -26,7 +25,6 @@ var Unrelated = /*#__PURE__*/ function() { } Unrelated.fake = function fake() { new Base(); - } // error - ; + }; // error return Unrelated; }(); diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js index d9b53accdc10..0a7db2b4da37 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js @@ -8,24 +8,21 @@ var C1 = function C1(x) { this.x = x; }; var c1; -c1.x // OK -; +c1.x; // OK var C2 = function C2(p) { "use strict"; _class_call_check(this, C2); this.p = p; }; var c2; -c2.p // private, error -; +c2.p; // private, error var C3 = function C3(p) { "use strict"; _class_call_check(this, C3); this.p = p; }; var c3; -c3.p // protected, error -; +c3.p; // protected, error var Derived = /*#__PURE__*/ function(C3) { "use strict"; _inherits(Derived, C3); diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js index 75a4caccedde..09bf627c540c 100644 --- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js +++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js @@ -8,24 +8,21 @@ var C1 = function C1(x) { this.x = x; }; var c1; -c1.x // OK -; +c1.x; // OK var C2 = function C2(p) { "use strict"; _class_call_check(this, C2); this.p = p; }; var c2; -c2.p // private, error -; +c2.p; // private, error var C3 = function C3(p) { "use strict"; _class_call_check(this, C3); this.p = p; }; var c3; -c3.p // protected, error -; +c3.p; // protected, error var Derived = /*#__PURE__*/ function(C3) { "use strict"; _inherits(Derived, C3); diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js index 4f5b0ecbbe78..e439ace35bad 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js @@ -1,4 +1,3 @@ //// [comparisonOperatorWithNumberOperand.ts] // repro #52036 -t1 >= 0 // error -; +t1 >= 0; // error diff --git a/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js b/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js index 07cbcd04ea26..bf9fbed00e55 100644 --- a/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js @@ -8,6 +8,5 @@ function testFunc2(a, sa) { test: 'bye', arg: a, arr: a - } // excess - ; + }; // excess } diff --git a/crates/swc/tests/tsc-references/constructorFunctionsStrict.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionsStrict.1.normal.js index 68eccdf341d5..5b30cf206d4f 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionsStrict.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctionsStrict.1.normal.js @@ -7,10 +7,8 @@ C.prototype.m = function() { this.y = 12; }; var c = new C(1); -c.x = undefined // should error -; -c.y = undefined // ok -; +c.x = undefined; // should error +c.y = undefined; // ok /** @param {number} x */ function A(x) { if (!_instanceof(this, A)) { return new A(x); diff --git a/crates/swc/tests/tsc-references/constructorParameterShadowsOuterScopes.1.normal.js b/crates/swc/tests/tsc-references/constructorParameterShadowsOuterScopes.1.normal.js index f76303b80d7a..7b3a66c0bf51 100644 --- a/crates/swc/tests/tsc-references/constructorParameterShadowsOuterScopes.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorParameterShadowsOuterScopes.1.normal.js @@ -8,15 +8,13 @@ var x = 1; var C = function C(x1) { "use strict"; _class_call_check(this, C); - this.b = x // error, evaluated in scope of constructor, cannot reference x - ; + this.b = x; // error, evaluated in scope of constructor, cannot reference x x1 = 2; // error, x is string }; var y = 1; var D = function D(x) { "use strict"; _class_call_check(this, D); - this.b = y // error, evaluated in scope of constructor, cannot reference y - ; + this.b = y; // error, evaluated in scope of constructor, cannot reference y var y1 = ""; }; diff --git a/crates/swc/tests/tsc-references/controlFlowInstanceofExtendsFunction.1.normal.js b/crates/swc/tests/tsc-references/controlFlowInstanceofExtendsFunction.1.normal.js index 16993cb411ee..358b0f4afd66 100644 --- a/crates/swc/tests/tsc-references/controlFlowInstanceofExtendsFunction.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowInstanceofExtendsFunction.1.normal.js @@ -20,12 +20,9 @@ var Y = function Y() { "use strict"; _class_call_check(this, Y); }; -console.log(X.now()) // works as expected -; -console.log(Y.now()) // works as expected -; +console.log(X.now()); // works as expected +console.log(Y.now()); // works as expected export var x = Math.random() > 0.5 ? new X() : 1; if (_instanceof(x, X)) { - x.why() // should compile - ; + x.why(); // should compile } diff --git a/crates/swc/tests/tsc-references/controlFlowStringIndex.1.normal.js b/crates/swc/tests/tsc-references/controlFlowStringIndex.1.normal.js index 1de16cf54f41..de34d26cced4 100644 --- a/crates/swc/tests/tsc-references/controlFlowStringIndex.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowStringIndex.1.normal.js @@ -1,8 +1,6 @@ //// [controlFlowStringIndex.ts] if (value.foo !== null) { value.foo.toExponential(); - value.other // should still be number | null - ; - value.bar // should still be number | null - ; + value.other; // should still be number | null + value.bar; // should still be number | null } diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js index 8e55bb23786c..06a0788abac1 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js @@ -20,8 +20,7 @@ var D = /*#__PURE__*/ function(C) { return _call_super(this, D, arguments); } var _proto = D.prototype; - _proto.foo = function foo() {} // ok to drop parameters - ; + _proto.foo = function foo() {}; // ok to drop parameters return D; }(C); var E = /*#__PURE__*/ function(D) { @@ -32,8 +31,7 @@ var E = /*#__PURE__*/ function(D) { return _call_super(this, E, arguments); } var _proto = E.prototype; - _proto.foo = function foo(x) {} // ok to add optional parameters - ; + _proto.foo = function foo(x) {}; // ok to add optional parameters return E; }(D); var c; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js index d4693e18548b..06d58ea86f11 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js @@ -20,8 +20,7 @@ var D = /*#__PURE__*/ function(C) { return _call_super(this, D, arguments); } var _proto = D.prototype; - _proto.foo = function foo(x) {} // ok to drop parameters - ; + _proto.foo = function foo(x) {}; // ok to drop parameters return D; }(C); var E = /*#__PURE__*/ function(D) { @@ -32,8 +31,7 @@ var E = /*#__PURE__*/ function(D) { return _call_super(this, E, arguments); } var _proto = E.prototype; - _proto.foo = function foo(x, y) {} // ok to add optional parameters - ; + _proto.foo = function foo(x, y) {}; // ok to add optional parameters return E; }(D); var c; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js index db167d03a26a..737006bb7b29 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js @@ -20,8 +20,7 @@ var D = /*#__PURE__*/ function(C) { return _call_super(this, D, arguments); } var _proto = D.prototype; - _proto.foo = function foo(x) {} // ok to drop parameters - ; + _proto.foo = function foo(x) {}; // ok to drop parameters return D; }(C); var E = /*#__PURE__*/ function(D) { @@ -32,8 +31,7 @@ var E = /*#__PURE__*/ function(D) { return _call_super(this, E, arguments); } var _proto = E.prototype; - _proto.foo = function foo(x, y) {} // ok to add optional parameters - ; + _proto.foo = function foo(x, y) {}; // ok to add optional parameters return E; }(D); var c; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js index 4ee2fff0a9d7..91015d8f7751 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js @@ -20,8 +20,7 @@ var D = /*#__PURE__*/ function(C) { return _call_super(this, D, arguments); } var _proto = D.prototype; - _proto.foo = function foo() {} // ok to drop parameters - ; + _proto.foo = function foo() {}; // ok to drop parameters return D; }(C); var E = /*#__PURE__*/ function(D) { @@ -32,8 +31,7 @@ var E = /*#__PURE__*/ function(D) { return _call_super(this, E, arguments); } var _proto = E.prototype; - _proto.foo = function foo(x) {} // ok to add optional parameters - ; + _proto.foo = function foo(x) {}; // ok to add optional parameters return E; }(D); var c; diff --git a/crates/swc/tests/tsc-references/enumTag.1.normal.js b/crates/swc/tests/tsc-references/enumTag.1.normal.js index 39cccda0bd6a..f789107795b3 100644 --- a/crates/swc/tests/tsc-references/enumTag.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTag.1.normal.js @@ -30,12 +30,9 @@ /** @type {number} */ var num = s; /** @type {(n: number) => number} */ var fun = f; /** @type {Target} */ var v = Target.START; - v = Target.UNKNOWN // error, can't find 'UNKNOWN' - ; - v = Second.MISTAKE // meh..ok, I guess? - ; - v = 'something else' // allowed, like Typescript's classic enums and unlike its string enums - ; + v = Target.UNKNOWN; // error, can't find 'UNKNOWN' + v = Second.MISTAKE; // meh..ok, I guess? + v = 'something else'; // allowed, like Typescript's classic enums and unlike its string enums } /** @param {string} s */ function ff(s) { // element access with arbitrary string is an error only with noImplicitAny diff --git a/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js index 96ee10309ea9..7dfe27597b84 100644 --- a/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js @@ -1,10 +1,8 @@ //// [main.ts] import { c } from './types'; import * as types from './types'; -console.log(c) // Fails as expected, import is still allowed though. -; -console.log(types.c) // Expected an error here. -; +console.log(c); // Fails as expected, import is still allowed though. +console.log(types.c); // Expected an error here. //// [types.ts] export { }; //// [values.ts] diff --git a/crates/swc/tests/tsc-references/functionExpressionContextualTyping2.1.normal.js b/crates/swc/tests/tsc-references/functionExpressionContextualTyping2.1.normal.js index 4cca3e615eae..32277394b817 100644 --- a/crates/swc/tests/tsc-references/functionExpressionContextualTyping2.1.normal.js +++ b/crates/swc/tests/tsc-references/functionExpressionContextualTyping2.1.normal.js @@ -10,5 +10,4 @@ var a0; var a1; a1 = function(foo, bar) { return true; -} // Error -; +}; // Error diff --git a/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js b/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js index d01f9885b43c..535565c9f840 100644 --- a/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js @@ -2,19 +2,11 @@ var x = 1; var y = 2; var z = 3; -globalThis.x // ok -; -globalThis.y // should error, no property 'y' -; -globalThis.z // should error, no property 'z' -; -globalThis['x'] // ok -; -globalThis['y'] // should error, no property 'y' -; -globalThis['z'] // should error, no property 'z' -; -globalThis.Float64Array // ok -; -globalThis.Infinity // ok -; +globalThis.x; // ok +globalThis.y; // should error, no property 'y' +globalThis.z; // should error, no property 'z' +globalThis['x']; // ok +globalThis['y']; // should error, no property 'y' +globalThis['z']; // should error, no property 'z' +globalThis.Float64Array; // ok +globalThis.Infinity; // ok diff --git a/crates/swc/tests/tsc-references/globalThisReadonlyProperties.1.normal.js b/crates/swc/tests/tsc-references/globalThisReadonlyProperties.1.normal.js index 05222c4293a7..fc54ee42d61b 100644 --- a/crates/swc/tests/tsc-references/globalThisReadonlyProperties.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisReadonlyProperties.1.normal.js @@ -1,8 +1,6 @@ //// [globalThisReadonlyProperties.ts] -globalThis.globalThis = 1 // should error -; +globalThis.globalThis = 1; // should error var x = 1; var y = 2; globalThis.x = 3; -globalThis.y = 4 // should error -; +globalThis.y = 4; // should error diff --git a/crates/swc/tests/tsc-references/infiniteExpansionThroughTypeInference.1.normal.js b/crates/swc/tests/tsc-references/infiniteExpansionThroughTypeInference.1.normal.js index d94201743f0c..8add6329729b 100644 --- a/crates/swc/tests/tsc-references/infiniteExpansionThroughTypeInference.1.normal.js +++ b/crates/swc/tests/tsc-references/infiniteExpansionThroughTypeInference.1.normal.js @@ -1,5 +1,4 @@ //// [infiniteExpansionThroughTypeInference.ts] function ff(g) { - ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely - ; + ff(g); // when infering T here we need to make sure to not descend into the structure of G infinitely } diff --git a/crates/swc/tests/tsc-references/initializerReferencingConstructorLocals.1.normal.js b/crates/swc/tests/tsc-references/initializerReferencingConstructorLocals.1.normal.js index a8209d94dfa3..336a125364f4 100644 --- a/crates/swc/tests/tsc-references/initializerReferencingConstructorLocals.1.normal.js +++ b/crates/swc/tests/tsc-references/initializerReferencingConstructorLocals.1.normal.js @@ -4,18 +4,14 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C(x) { "use strict"; _class_call_check(this, C); - this.a = z // error - ; - this.c = this.z // error - ; + this.a = z; // error + this.c = this.z; // error z = 1; }; var D = function D(x) { "use strict"; _class_call_check(this, D); - this.a = z // error - ; - this.c = this.z // error - ; + this.a = z; // error + this.c = this.z; // error z = 1; }; diff --git a/crates/swc/tests/tsc-references/initializerReferencingConstructorParameters.1.normal.js b/crates/swc/tests/tsc-references/initializerReferencingConstructorParameters.1.normal.js index 5559941076aa..28c5f74e4691 100644 --- a/crates/swc/tests/tsc-references/initializerReferencingConstructorParameters.1.normal.js +++ b/crates/swc/tests/tsc-references/initializerReferencingConstructorParameters.1.normal.js @@ -4,25 +4,24 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C(x1) { "use strict"; _class_call_check(this, C); - this.a = x // error - ; + this.a = x; // error }; var D = function D(x1) { "use strict"; _class_call_check(this, D); this.x = x1; - this.a = x; + this.a = x; // error }; var E = function E(x1) { "use strict"; _class_call_check(this, E); this.x = x1; - this.a = this.x; + this.a = this.x; // ok }; var F = function F(x1) { "use strict"; _class_call_check(this, F); this.x = x1; - this.a = this.x; - this.b = x; + this.a = this.x; // ok + this.b = x; // error }; diff --git a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype.1.normal.js b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype.1.normal.js index 30dc5e364056..3f29b5642b1d 100644 --- a/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceMemberAssignsToClassPrototype.1.normal.js @@ -10,8 +10,7 @@ var C = /*#__PURE__*/ function() { C.prototype.foo = function() {}; }; _proto.bar = function bar(x) { - C.prototype.bar = function() {} // error - ; + C.prototype.bar = function() {}; // error C.prototype.bar = function(x) { return x; }; // ok diff --git a/crates/swc/tests/tsc-references/intersectionTypeReadonly.1.normal.js b/crates/swc/tests/tsc-references/intersectionTypeReadonly.1.normal.js index 27a9ba2948a9..b026cb895790 100644 --- a/crates/swc/tests/tsc-references/intersectionTypeReadonly.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionTypeReadonly.1.normal.js @@ -1,7 +1,6 @@ //// [intersectionTypeReadonly.ts] var base; -base.value = 12 // error, lhs can't be a readonly property -; +base.value = 12; // error, lhs can't be a readonly property var identical; identical.value = 12; // error, lhs can't be a readonly property var mutable; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic.1.normal.js index d88a5e440789..509ab6d0ad37 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic.1.normal.js @@ -24,8 +24,8 @@ var Strings = { b: "B" }; module.exports = Handler; -module.exports.Strings = Strings /** +module.exports.Strings = Strings; /** * @typedef {Object} HandlerOptions * @property {String} name * Should be able to export a type alias at the same time. - */ ; + */ diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js index ffab14735de0..f96ea531d27c 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js @@ -29,8 +29,7 @@ /** @type {number} */ var num = s; /** @type {(n: number) => number} */ var fun = f; /** @type {Target} */ var v = Target.START; - v = 'something else' // allowed, like Typescript's classic enums and unlike its string enums - ; + v = 'something else'; // allowed, like Typescript's classic enums and unlike its string enums } /** @param {string} s */ export function ff(s) { // element access with arbitrary string is an error only with noImplicitAny diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js index 2381955ae890..1c31626063e8 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js @@ -514,8 +514,7 @@ new AnotherSampleClass({}); // Positive repro from #17166 function f3(t, k, tk) { for(var key in t){ - key = k // ok, K ==> keyof T - ; + key = k; // ok, K ==> keyof T t[key] = tk; // ok, T[K] ==> T[keyof T] } } diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js index 2d999a74d94e..8f74030eb46b 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js @@ -43,10 +43,8 @@ function f20(x, y, k1, k2, k3, k4) { // Repro from #17166 function f3(t, k, tk, u, j, uk, tj, uj) { for(var key in t){ - key = k // ok, K ==> keyof T - ; - k = key // error, keyof T =/=> K - ; + key = k; // ok, K ==> keyof T + k = key; // error, keyof T =/=> K t[key] = tk; // ok, T[K] ==> T[keyof T] tk = t[key]; // error, T[keyof T] =/=> T[K] } diff --git a/crates/swc/tests/tsc-references/looseThisTypeInFunctions.1.normal.js b/crates/swc/tests/tsc-references/looseThisTypeInFunctions.1.normal.js index 83debefedd6f..7e2049caf5a3 100644 --- a/crates/swc/tests/tsc-references/looseThisTypeInFunctions.1.normal.js +++ b/crates/swc/tests/tsc-references/looseThisTypeInFunctions.1.normal.js @@ -40,8 +40,7 @@ var n = x(12); // callee:void doesn't match this:I var u; var y = u.implicitNoThis; n = y(12); // ok, callee:void matches this:any -c.explicitVoid = c.implicitThis // ok, implicitThis(this:any) -; +c.explicitVoid = c.implicitThis; // ok, implicitThis(this:any) o.implicitThis = c.implicitThis; // ok, implicitThis(this:any) o.implicitThis = c.explicitThis; // ok, implicitThis(this:any) is assignable to explicitThis(this: this) o.implicitThis = i.explicitThis; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js index 1da8839cb89c..35f854f5cc01 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js @@ -10,10 +10,8 @@ var EE = /*#__PURE__*/ function() { return EE; }(); var npmlog = module.exports = new EE(); -npmlog.on('hi') // both references should see EE.on -; -module.exports.on('hi') // here too -; +npmlog.on('hi'); // both references should see EE.on +module.exports.on('hi'); // here too npmlog.x = 1; module.exports.y = 2; npmlog.y; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment2.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment2.1.normal.js index 66f3040c8b6e..05c375bdd744 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment2.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment2.1.normal.js @@ -1,7 +1,6 @@ //// [npm.js] var npm = module.exports = function npm(tree) {}; module.exports.asReadInstalled = function(tree) { - npm(tree) // both references should be callable - ; + npm(tree); // both references should be callable module.exports(tree); }; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js index 7a465ad6b40e..0aa84857ad6f 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js @@ -1,8 +1,6 @@ //// [mod.js] module.exports = function x() {}; -module.exports() // should be callable -; +module.exports(); // should be callable //// [npm.js] var mod = require('./mod'); -mod() // should be callable from here too -; +mod(); // should be callable from here too diff --git a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault.1.normal.js b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault.1.normal.js index 09b8efd8acb9..cf98eab1cecb 100644 --- a/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportPropertyAssignmentDefault.1.normal.js @@ -1,5 +1,4 @@ //// [axios.js] var axios = {}; -module.exports = axios // both assignments should be ok -; +module.exports = axios; // both assignments should be ok module.exports.default = axios; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js index 45678d1e73ba..9b9ce0045b60 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js @@ -7,5 +7,4 @@ module.exports = function() {}; /// var mod1 = require('./mod1'); mod1(); -mod1.f() // error, not enough arguments -; +mod1.f(); // error, not enough arguments diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js index dfc76e78141c..dac2672c4600 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js @@ -7,5 +7,4 @@ module.exports.f = function() {}; /// var mod1 = require('./mod1'); mod1.toFixed(12); -mod1.f() // error, 'f' is not a property on 'number' -; +mod1.f(); // error, 'f' is not a property on 'number' diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js index 1b95b1a269d2..ff7db3828e5e 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js @@ -13,8 +13,6 @@ module.exports.justProperty = 'string'; /// var mod1 = require('./mod1'); mod1.justExport.toFixed(); -mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' -; -mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' -; +mod1.bothBefore.toFixed(); // error, 'toFixed' not on 'string | number' +mod1.bothAfter.toFixed(); // error, 'toFixed' not on 'string | number' mod1.justProperty.length; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js index b75a35d9cb37..2d46d0b8e0ae 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js @@ -15,7 +15,6 @@ module.exports.justProperty = 'string'; /// var mod1 = require('./mod1'); mod1.justExport.toFixed(); -mod1.bothBefore.toFixed() // error -; +mod1.bothBefore.toFixed(); // error mod1.bothAfter.toFixed(); mod1.justProperty.length; diff --git a/crates/swc/tests/tsc-references/noInfer.1.normal.js b/crates/swc/tests/tsc-references/noInfer.1.normal.js index 1d1c3aebe84e..dd8eb7c33cb1 100644 --- a/crates/swc/tests/tsc-references/noInfer.1.normal.js +++ b/crates/swc/tests/tsc-references/noInfer.1.normal.js @@ -2,26 +2,20 @@ // NoInfer is erased for primitives import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; -foo1('foo', 'foo') // ok -; -foo1('foo', 'bar') // error -; +foo1('foo', 'foo'); // ok +foo1('foo', 'bar'); // error foo2('foo', [ 'bar' -]) // error -; +]); // error foo3('foo', [ 'bar' -]) // error -; +]); // error foo4('foo', { x: 'bar' -}) // error -; +}); // error foo5('foo', { x: 'bar' -}) // error -; +}); // error doSomething(new Animal(), function() { return new Animal(); }); // ok diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js index 7170a5287af1..ab5a4a9dc52c 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js @@ -11,8 +11,7 @@ var C = /*#__PURE__*/ function() { _proto.foo = function foo() { return ''; }; - C.foo = function foo() {} // ok - ; + C.foo = function foo() {}; // ok _create_class(C, [ { key: "X", diff --git a/crates/swc/tests/tsc-references/override2.1.normal.js b/crates/swc/tests/tsc-references/override2.1.normal.js index f4d684cdeb16..750fb1898e57 100644 --- a/crates/swc/tests/tsc-references/override2.1.normal.js +++ b/crates/swc/tests/tsc-references/override2.1.normal.js @@ -32,8 +32,7 @@ var AD3 = /*#__PURE__*/ function(AB) { return _call_super(this, AD3, arguments); } var _proto = AD3.prototype; - _proto.foo = function foo(v) {} // need override? - ; + _proto.foo = function foo(v) {}; // need override? _proto.baz = function baz() {}; return AD3; }(AB); diff --git a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js index b1e83217fd2c..b0e3cc6cfd27 100644 --- a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js @@ -14,5 +14,4 @@ */ function correct() { arguments; } -correct(1, 2, 3) // oh no -; +correct(1, 2, 3); // oh no diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.1.normal.js index 9120f0eeaa5e..acfdbdc73963 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.1.normal.js @@ -1,7 +1,6 @@ //// [parserArrowFunctionExpression10.ts] //// [fileJs.js] -a ? (b)=>d : (e)=>f // Not legal JS; "Unexpected token ':'" at last colon - // Not legal JS; "Unexpected token ':'" at last colon -; +a ? (b)=>d : (e)=>f; // Not legal JS; "Unexpected token ':'" at last colon + // Not legal JS; "Unexpected token ':'" at last colon //// [fileTs.ts] a ? (b)=>d : (e)=>f; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.1.normal.js index 3e44c07136ab..f2e15071639b 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.1.normal.js @@ -1,7 +1,6 @@ //// [parserArrowFunctionExpression12.ts] //// [fileJs.js] -a ? (b)=>c : (d)=>e // Legal JS - // Legal JS -; +a ? (b)=>c : (d)=>e; // Legal JS + // Legal JS //// [fileTs.ts] a ? (b)=>c : (d)=>e; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression15.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression15.1.normal.js index ff216a6d741b..29bc85572a82 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression15.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression15.1.normal.js @@ -1,6 +1,5 @@ //// [parserArrowFunctionExpression15.ts] //// [fileJs.js] -false ? (param)=>param : null // Not legal JS; "Unexpected token ':'" at last colon -; +false ? (param)=>param : null; // Not legal JS; "Unexpected token ':'" at last colon //// [fileTs.ts] false ? (param)=>param : null; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression16.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression16.1.normal.js index b8e84a8b22dc..97805ec6ca42 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression16.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression16.1.normal.js @@ -1,6 +1,5 @@ //// [parserArrowFunctionExpression16.ts] //// [fileJs.js] -true ? false ? (param)=>param : null : null // Not legal JS; "Unexpected token ':'" at last colon -; +true ? false ? (param)=>param : null : null; // Not legal JS; "Unexpected token ':'" at last colon //// [fileTs.ts] true ? false ? (param)=>param : null : null; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.1.normal.js index d5d624018e29..b6f28bbd609d 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.1.normal.js @@ -1,6 +1,5 @@ //// [parserArrowFunctionExpression17.ts] //// [fileJs.js] -a ? b : (c)=>e // Not legal JS; "Unexpected token ':'" at last colon -; +a ? b : (c)=>e; // Not legal JS; "Unexpected token ':'" at last colon //// [fileTs.ts] a ? b : (c)=>e; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.1.normal.js index 922e889b1458..a84a1f4a9236 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.1.normal.js @@ -1,7 +1,6 @@ //// [parserArrowFunctionExpression9.ts] //// [fileJs.js] -b ? c : (d)=>e // Legal JS - // Legal JS -; +b ? c : (d)=>e; // Legal JS + // Legal JS //// [fileTs.ts] b ? c : (d)=>e; diff --git a/crates/swc/tests/tsc-references/parserRealSource12.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource12.1.normal.js index b73099c7dc2b..73758de7251c 100644 --- a/crates/swc/tests/tsc-references/parserRealSource12.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource12.1.normal.js @@ -10,8 +10,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; _class_call_check(this, AstWalkOptions); this.goChildren = true; this.goNextSibling = true; - this.reverseSiblings = false // visit siblings in reverse execution order - ; + this.reverseSiblings = false; // visit siblings in reverse execution order } var _proto = AstWalkOptions.prototype; _proto.stopWalk = function stopWalk() { diff --git a/crates/swc/tests/tsc-references/privateNameCircularReference.1.normal.js b/crates/swc/tests/tsc-references/privateNameCircularReference.1.normal.js index e20366f7213a..9cf1301bf523 100644 --- a/crates/swc/tests/tsc-references/privateNameCircularReference.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameCircularReference.1.normal.js @@ -15,7 +15,6 @@ class A { }); _class_private_field_set(this, _foo, _class_private_field_get(this, _bar)); _class_private_field_set(this, _bar, _class_private_field_get(this, _foo)); - this["#baz"] = this["#baz"] // Error (should *not* be private name error) - ; + this["#baz"] = this["#baz"]; // Error (should *not* be private name error) } } diff --git a/crates/swc/tests/tsc-references/privateNameMethod.1.normal.js b/crates/swc/tests/tsc-references/privateNameMethod.1.normal.js index 0e3a4517ac54..226c15ba8c11 100644 --- a/crates/swc/tests/tsc-references/privateNameMethod.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameMethod.1.normal.js @@ -6,10 +6,8 @@ class A1 { constructor(name){ _class_private_method_init(this, _method); _class_private_method_get(this, _method, method).call(this, ""); - _class_private_method_get(this, _method, method).call(this, 1) // Error - ; - _class_private_method_get(this, _method, method).call(this) // Error - ; + _class_private_method_get(this, _method, method).call(this, 1); // Error + _class_private_method_get(this, _method, method).call(this); // Error } } function method(param) { diff --git a/crates/swc/tests/tsc-references/privateNameMethodAssignment.1.normal.js b/crates/swc/tests/tsc-references/privateNameMethodAssignment.1.normal.js index 6b023d86fe47..f037370bf934 100644 --- a/crates/swc/tests/tsc-references/privateNameMethodAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameMethodAssignment.1.normal.js @@ -8,17 +8,14 @@ var _method = /*#__PURE__*/ new WeakSet(); class A3 { constructor(a, b){ _class_private_method_init(this, _method); - this, _read_only_error("#method") // Error, not writable - ; + this, _read_only_error("#method"); // Error, not writable a, _read_only_error("#method"); // Error, not writable - b, _read_only_error("#method") //Error, not writable - ; + b, _read_only_error("#method"); //Error, not writable ({ x: _class_private_field_destructure(this, _method).value } = { x: ()=>{} }); //Error, not writable let x = _class_private_method_get(this, _method, method); - _class_private_field_update(b, _method).value++ //Error, not writable - ; + _class_private_field_update(b, _method).value++; //Error, not writable } } function method() {} diff --git a/crates/swc/tests/tsc-references/privateNameStaticMethod.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticMethod.1.normal.js index 7a98d74c886b..d6dd82d8de00 100644 --- a/crates/swc/tests/tsc-references/privateNameStaticMethod.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameStaticMethod.1.normal.js @@ -3,10 +3,8 @@ import { _ as _class_static_private_method_get } from "@swc/helpers/_/_class_sta class A1 { constructor(){ _class_static_private_method_get(A1, A1, method).call(A1, ""); - _class_static_private_method_get(A1, A1, method).call(A1, 1) // Error - ; - _class_static_private_method_get(A1, A1, method).call(A1) // Error - ; + _class_static_private_method_get(A1, A1, method).call(A1, 1); // Error + _class_static_private_method_get(A1, A1, method).call(A1); // Error } } function method(param) { diff --git a/crates/swc/tests/tsc-references/privateNameStaticMethodAssignment.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticMethodAssignment.1.normal.js index 3cc1a7d3a721..fd6b1429085b 100644 --- a/crates/swc/tests/tsc-references/privateNameStaticMethodAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameStaticMethodAssignment.1.normal.js @@ -5,17 +5,14 @@ import { _ as _class_static_private_field_destructure } from "@swc/helpers/_/_cl import { _ as _class_static_private_method_get } from "@swc/helpers/_/_class_static_private_method_get"; class A3 { constructor(a, b){ - _class_static_private_field_spec_set(A3, A3, _method, ()=>{} // Error, not writable - ); + _class_static_private_field_spec_set(A3, A3, _method, ()=>{}); // Error, not writable _class_static_private_field_spec_set(a, A3, _method, ()=>{}); // Error, not writable - _class_static_private_field_spec_set(b, A3, _method, ()=>{} //Error, not writable - ); + _class_static_private_field_spec_set(b, A3, _method, ()=>{}); //Error, not writable ({ x: _class_static_private_field_destructure(A3, A3, _method).value } = { x: ()=>{} }); //Error, not writable let x = _class_static_private_method_get(A3, A3, method); - _class_static_private_field_update(b, A3, _method).value++ //Error, not writable - ; + _class_static_private_field_update(b, A3, _method).value++; //Error, not writable } } function method() {} diff --git a/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js b/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js index db8bdbcb5251..cfb97ee2f1a6 100644 --- a/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js @@ -13,20 +13,17 @@ class TestWithStatics { _class_private_field_set(this, _prop, 0); } } -TestWithStatics.dd = _class_private_field_get(_ref = new TestWithStatics(), _prop) // OK -; +TestWithStatics.dd = _class_private_field_get(_ref = new TestWithStatics(), _prop); // OK TestWithStatics["X_ z_ zz"] = (_foo = /*#__PURE__*/ new WeakMap(), _Inner = class Inner { m() { var _ref; - _class_private_field_get(_ref = new TestWithStatics(), _prop // OK - ); + _class_private_field_get(_ref = new TestWithStatics(), _prop); // OK } static M() { return class { m() { var _ref, _ref1; - _class_private_field_get(_ref = new TestWithStatics(), _prop // OK - ); + _class_private_field_get(_ref = new TestWithStatics(), _prop); // OK _class_private_field_get(_ref1 = new Inner(), _foo); // OK } }; @@ -41,8 +38,7 @@ TestWithStatics["X_ z_ zz"] = (_foo = /*#__PURE__*/ new WeakMap(), _Inner = clas }, _Inner.C = class InnerInner { m() { var _ref, _ref1; - _class_private_field_get(_ref = new TestWithStatics(), _prop // OK - ); + _class_private_field_get(_ref = new TestWithStatics(), _prop); // OK _class_private_field_get(_ref1 = new _Inner(), _foo); // OK } }, _Inner); @@ -56,20 +52,17 @@ class TestNonStatics { }); var _foo; _class_private_field_set(this, _prop1, 0); - this.dd = _class_private_field_get(_ref = new TestNonStatics(), _prop1) // OK - ; + this.dd = _class_private_field_get(_ref = new TestNonStatics(), _prop1); // OK this["X_ z_ zz"] = (_foo = /*#__PURE__*/ new WeakMap(), class Inner { m() { var _ref; - _class_private_field_get(_ref = new TestNonStatics(), _prop1 // Ok - ); + _class_private_field_get(_ref = new TestNonStatics(), _prop1); // Ok } static M() { return class { m() { var _ref, _ref1; - _class_private_field_get(_ref = new TestNonStatics(), _prop1 // OK - ); + _class_private_field_get(_ref = new TestNonStatics(), _prop1); // OK _class_private_field_get(_ref1 = new Inner(), _foo); // OK } }; @@ -83,8 +76,7 @@ class TestNonStatics { this.C = class InnerInner { m() { var _ref, _ref1; - _class_private_field_get(_ref = new TestNonStatics(), _prop1 // Ok - ); + _class_private_field_get(_ref = new TestNonStatics(), _prop1); // Ok _class_private_field_get(_ref1 = new Inner(), _foo); // Ok } }; diff --git a/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=esnext).1.normal.js b/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=esnext).1.normal.js index 0263ed9ebb6e..a3e02087107d 100644 --- a/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=esnext).1.normal.js +++ b/crates/swc/tests/tsc-references/privateNameWhenNotUseDefineForClassFieldsInEsNext(target=esnext).1.normal.js @@ -2,21 +2,18 @@ class TestWithStatics { #prop; static{ - this.dd = new TestWithStatics().#prop // OK - ; + this.dd = new TestWithStatics().#prop; // OK } static{ this["X_ z_ zz"] = class Inner { #foo; m() { - new TestWithStatics().#prop // OK - ; + new TestWithStatics().#prop; // OK } static{ this.C = class InnerInner { m() { - new TestWithStatics().#prop // OK - ; + new TestWithStatics().#prop; // OK new Inner().#foo; // OK } }; @@ -24,8 +21,7 @@ class TestWithStatics { static M() { return class { m() { - new TestWithStatics().#prop // OK - ; + new TestWithStatics().#prop; // OK new Inner().#foo; // OK } }; @@ -43,19 +39,16 @@ class TestNonStatics { #prop; constructor(){ this.#prop = 0; - this.dd = new TestNonStatics().#prop // OK - ; + this.dd = new TestNonStatics().#prop; // OK this["X_ z_ zz"] = class Inner { #foo; m() { - new TestNonStatics().#prop // Ok - ; + new TestNonStatics().#prop; // Ok } static M() { return class { m() { - new TestNonStatics().#prop // OK - ; + new TestNonStatics().#prop; // OK new Inner().#foo; // OK } }; @@ -64,8 +57,7 @@ class TestNonStatics { this.#foo = 10; this.C = class InnerInner { m() { - new TestNonStatics().#prop // Ok - ; + new TestNonStatics().#prop; // Ok new Inner().#foo; // Ok } }; diff --git a/crates/swc/tests/tsc-references/privateNamesUseBeforeDef.1.normal.js b/crates/swc/tests/tsc-references/privateNamesUseBeforeDef.1.normal.js index 24a8abb34fd3..03991965c278 100644 --- a/crates/swc/tests/tsc-references/privateNamesUseBeforeDef.1.normal.js +++ b/crates/swc/tests/tsc-references/privateNamesUseBeforeDef.1.normal.js @@ -9,8 +9,8 @@ class A { constructor(){ _class_private_field_init(this, _foo, { writable: true, - value: void 0 // Error - }); + value: void 0 + }); // Error _class_private_field_init(this, _bar, { writable: true, value: void 0 @@ -25,8 +25,8 @@ class A2 { _class_private_method_init(this, _bar1); _class_private_field_init(this, _foo1, { writable: true, - value: void 0 // No Error - }); + value: void 0 + }); // No Error _class_private_field_set(this, _foo1, _class_private_method_get(this, _bar1, bar).call(this)); } } @@ -42,8 +42,8 @@ class A3 { }); _class_private_field_init(this, _foo2, { writable: true, - value: void 0 // No Error - }); + value: void 0 + }); // No Error _class_private_field_set(this, _foo2, _class_private_field_get(this, _bar2)); } } @@ -55,8 +55,8 @@ class B { constructor(){ _class_private_field_init(this, _foo3, { writable: true, - value: void 0 // Error - }); + value: void 0 + }); // Error _class_private_field_init(this, _bar3, { writable: true, value: void 0 diff --git a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js index e50560e46196..bcaf7d524865 100644 --- a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js +++ b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js @@ -20,5 +20,4 @@ var Derived = /*#__PURE__*/ function(Base1) { } return Derived; }(Base); -Derived.bar = Base.foo // error -; +Derived.bar = Base.foo; // error diff --git a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName.1.normal.js b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName.1.normal.js index 130634075213..795eccd3b239 100644 --- a/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAndFunctionWithSameName.1.normal.js @@ -17,7 +17,6 @@ var D = /*#__PURE__*/ function() { _class_call_check(this, D); } var _proto = D.prototype; - _proto.x = function x(v) {} // error - ; + _proto.x = function x(v) {}; // error return D; }(); diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors3.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors3.1.normal.js index 734f02114ee3..1266c9e08ae0 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors3.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors3.1.normal.js @@ -12,12 +12,10 @@ class Animal { } } const a = new Animal; -a.makeSound() // 'rustling noise in the bushes' -; +a.makeSound(); // 'rustling noise in the bushes' class Lion extends Animal { sound = 'RAWR!' // error here ; } const lion = new Lion; -lion.makeSound() // with [[Define]]: Expected "RAWR!" but got "rustling noise in the bushes" -; +lion.makeSound(); // with [[Define]]: Expected "RAWR!" but got "rustling noise in the bushes" diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js index fef2de1debaf..9e5f62561ecc 100644 --- a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js +++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js @@ -44,29 +44,22 @@ var Derivee = /*#__PURE__*/ function(Classe) { var object = { spaaace: 3 }; -object.spaaaace // error on read -; -object.spaace = 12 // error on write -; -object.fresh = 12 // OK -; -other.puuuce // OK, from another file -; -new Date().getGMTDate() // OK, from another file -; +object.spaaaace; // error on read +object.spaace = 12; // error on write +object.fresh = 12; // OK +other.puuuce; // OK, from another file +new Date().getGMTDate(); // OK, from another file // No suggestions for globals from other files var atoc = setIntegral(function() { return console.log('ok'); }, 500); -AudioBuffin // etc -; +AudioBuffin; // etc Jimmy; Jon; //// [other.js] var Jimmy = 1; var John = 2; -Jon // error, it's from the same file -; +Jon; // error, it's from the same file var other = { puuce: 4 }; diff --git a/crates/swc/tests/tsc-references/staticIndexSignature7.1.normal.js b/crates/swc/tests/tsc-references/staticIndexSignature7.1.normal.js index 1b05153213aa..1d6f729f4b44 100644 --- a/crates/swc/tests/tsc-references/staticIndexSignature7.1.normal.js +++ b/crates/swc/tests/tsc-references/staticIndexSignature7.1.normal.js @@ -4,14 +4,12 @@ var X = function X() { "use strict"; _class_call_check(this, X); }; -X.x = 12 // Should error, incompatible with index signature -; +X.x = 12; // Should error, incompatible with index signature var Y = /*#__PURE__*/ function() { "use strict"; function Y() { _class_call_check(this, Y); } - Y.foo = function foo() {} // should error, incompatible with index signature - ; + Y.foo = function foo() {}; // should error, incompatible with index signature return Y; }(); diff --git a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers.1.normal.js b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers.1.normal.js index 6e98870c065a..4fd40a71709f 100644 --- a/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/staticMemberAssignsToConstructorFunctionMembers.1.normal.js @@ -9,8 +9,7 @@ var C = /*#__PURE__*/ function() { C.foo = function() {}; }; C.bar = function bar(x) { - C.bar = function() {} // error - ; + C.bar = function() {}; // error C.bar = function(x) { return x; }; // ok diff --git a/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js b/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js index e48a785d53a3..5014c8b041cd 100644 --- a/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js +++ b/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js @@ -8,16 +8,16 @@ class C1 { constructor(){ _class_private_field_init(this, _f, { writable: true, - value: void 0 //Error - }); + value: void 0 + }); //Error _class_private_field_init(this, _g, { writable: true, value: void 0 }); _class_private_field_init(this, _h, { writable: true, - value: void 0 //Error - }); + value: void 0 + }); //Error _class_private_field_init(this, _i, { writable: true, value: void 0 @@ -111,8 +111,7 @@ class C10 { }); let x = this.a; // Error this.a = this.b; // Error - this.b = _class_private_field_get(this, _d1 //Error - ); + this.b = _class_private_field_get(this, _d1); //Error this.b = x; _class_private_field_set(this, _d1, x); let y = this.c; diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js index eac909e07e9e..53b93b72dad7 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js @@ -11,8 +11,7 @@ var C = /*#__PURE__*/ function() { _proto.foo = function foo() { return ''; }; - C.foo = function foo() {} // ok - ; + C.foo = function foo() {}; // ok _create_class(C, [ { key: "X", diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js index 8f979ad319bd..1e9f203059a0 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js @@ -246,19 +246,13 @@ var b1 = new Base1(); var b2 = new Base2(); var d1 = new Derived1(); var d2 = new Derived2(); -d2.polymorphic = d1.polymorphic // ok, 'x' and 'y' in { x, y } -; -d1.polymorphic = d2.polymorphic // ok, 'x' and 'y' in { x, y } -; +d2.polymorphic = d1.polymorphic; // ok, 'x' and 'y' in { x, y } +d1.polymorphic = d2.polymorphic; // ok, 'x' and 'y' in { x, y } // bivariance-allowed cases -d1.polymorphic = b2.polymorphic // ok, 'y' in D: { x, y } -; -d2.polymorphic = d1.explicit // ok, 'y' in { x, y } -; -b1.polymorphic = d2.polymorphic // ok, 'x' and 'y' not in Base1: { x } -; -b1.explicit = d2.polymorphic // ok, 'x' and 'y' not in Base1: { x } -; +d1.polymorphic = b2.polymorphic; // ok, 'y' in D: { x, y } +d2.polymorphic = d1.explicit; // ok, 'y' in { x, y } +b1.polymorphic = d2.polymorphic; // ok, 'x' and 'y' not in Base1: { x } +b1.explicit = d2.polymorphic; // ok, 'x' and 'y' not in Base1: { x } ////// use this-type for construction with new //// function InterfaceThis() { this.a = 12; diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions2.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions2.1.normal.js index 1e0d579f92bf..f0860e14233c 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions2.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions2.1.normal.js @@ -1,8 +1,7 @@ //// [thisTypeInFunctions2.ts] extend1({ init: function init() { - this // this: IndexedWithThis because of contextual typing. - ; + this; // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy; }, @@ -14,14 +13,12 @@ extend1({ }); extend2({ init: function init() { - this // this: IndexedWithoutThis because of contextual typing - ; + this; // this: IndexedWithoutThis because of contextual typing this.mine; }, mine: 13, foo: function foo() { - this // this: IndexedWithoutThis because of contextual typing - ; + this; // this: IndexedWithoutThis because of contextual typing this.mine; } }); diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescript.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescript.1.normal.js index b7de3a45aed5..25aabd23e158 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescript.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescript.1.normal.js @@ -5,6 +5,5 @@ export var a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied export var Bet = function Bet() { "use strict"; _class_call_check(this, Bet); - this.q = "lol" // And so will this implements error - ; + this.q = "lol"; // And so will this implements error }; diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js index 8005e02e9095..8f685024ddd6 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js @@ -5,6 +5,5 @@ export var a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied export var Bet = function Bet() { "use strict"; _class_call_check(this, Bet); - this.q = 'lol' // And so will this implements error - ; + this.q = 'lol'; // And so will this implements error }; diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments2.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments2.1.normal.js index 75c3e8740443..2ba4e38033df 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments2.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments2.1.normal.js @@ -5,6 +5,5 @@ export var a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied export var Bet = function Bet() { "use strict"; _class_call_check(this, Bet); - this.q = "lol" // And so will this implements error - ; + this.q = "lol"; // And so will this implements error }; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName1.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName1.1.normal.js index ba2a6eafc153..a27c9d7779c4 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName1.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName1.1.normal.js @@ -1,4 +1,3 @@ //// [tsxDynamicTagName1.tsx] var CustomTag = "h1"; -/*#__PURE__*/ React.createElement(CustomTag, null, " Hello World ") // No error -; +/*#__PURE__*/ React.createElement(CustomTag, null, " Hello World "); // No error diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName2.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName2.1.normal.js index 90617ef25d32..9963f5d89785 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName2.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName2.1.normal.js @@ -1,4 +1,3 @@ //// [tsxDynamicTagName2.tsx] var customTag = "h1"; -/*#__PURE__*/ React.createElement("customTag", null, " Hello World ") // This should be an error. The lower-case is look up as an intrinsic element name -; +/*#__PURE__*/ React.createElement("customTag", null, " Hello World "); // This should be an error. The lower-case is look up as an intrinsic element name diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName3.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName3.1.normal.js index 040ddc54f5ad..743b60397e8f 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName3.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName3.1.normal.js @@ -1,4 +1,3 @@ //// [tsxDynamicTagName3.tsx] var CustomTag = "h1"; -/*#__PURE__*/ React.createElement(CustomTag, null, " Hello World ") // This should be an error. we will try look up string literal type in JSX.IntrinsicElements -; +/*#__PURE__*/ React.createElement(CustomTag, null, " Hello World "); // This should be an error. we will try look up string literal type in JSX.IntrinsicElements diff --git a/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js index 44a7d9caf9c9..9218e98b38c4 100644 --- a/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js @@ -12,30 +12,19 @@ function Installer() { this.twices = null; } Installer.prototype.first = function() { - this.arg = 'hi' // error - ; - this.unknown = 'hi' // ok - ; - this.newProperty = 1 // ok: number | boolean - ; - this.twice = undefined // ok - ; - this.twice = 'hi' // ok - ; + this.arg = 'hi'; // error + this.unknown = 'hi'; // ok + this.newProperty = 1; // ok: number | boolean + this.twice = undefined; // ok + this.twice = 'hi'; // ok }; Installer.prototype.second = function() { - this.arg = false // error - ; - this.unknown = false // ok - ; - this.newProperty = false // ok - ; - this.twice = null // error - ; - this.twice = false // error - ; - this.twices.push(1) // error: Object is possibly null - ; + this.arg = false; // error + this.unknown = false; // ok + this.newProperty = false; // ok + this.twice = null; // error + this.twice = false; // error + this.twices.push(1); // error: Object is possibly null if (this.twices != null) { this.twices.push('hi'); } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js index 151ed2e2d112..8d45fc6899f1 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js @@ -11,5 +11,4 @@ Installer.prototype.loadArgMetadata = function(next) { }); }; var i = new Installer(); -i.newProperty = i.args // ok, number ==> number | undefined -; +i.newProperty = i.args; // ok, number ==> number | undefined diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js index bfcfc85ef584..ca526008043c 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js @@ -51,8 +51,7 @@ var g = function g() {}; if (!!false) { g.expando = 1; } -g.expando // error -; +g.expando; // error if (!!false) { g.both = 'hi'; } else { diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js index af98fb5622dd..cbf4a2f16dd8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js @@ -6,8 +6,6 @@ if (!!false) { //// [use.js] var util = require('./mod'); function n() { - util.existy // no error - ; + util.existy; // no error } -util.existy // no error -; +util.existy; // no error diff --git a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock.1.normal.js index fbbe22b67c28..f9ba528c11ed 100644 --- a/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsInFunctionAndModuleBlock.1.normal.js @@ -43,8 +43,7 @@ function foo5(x) { var b = x; // new scope - number | boolean | string var y; if (typeof x === "string") { - y = x // string; - ; + y = x; // string; } else { y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number @@ -59,8 +58,7 @@ function foo5(x) { var b = x; // new scope - number | boolean | string var y; if (typeof x === "string") { - y = x // string; - ; + y = x; // string; } else { y = typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number diff --git a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf.1.normal.js index ae80e7d34b0d..c5e147fc1b31 100644 --- a/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsWithInstanceOf.1.normal.js @@ -20,11 +20,9 @@ var C = /*#__PURE__*/ function() { function foo() { var v = null; if (_instanceof(v, C)) { - v // Validator & Partial & C - ; + v; // Validator & Partial & C } - v // Validator & Partial via subtype reduction - ; + v; // Validator & Partial via subtype reduction // In 4.1, we introduced a change which _fixed_ a bug with CFA // correctly setting this to be the right object. With 4.2, // we reverted that fix in #42231 which brought behavior back to diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers2.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers2.1.normal.js index 5b28714164ee..22f4273d32e9 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers2.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers2.1.normal.js @@ -4,11 +4,9 @@ var C = function C() { "use strict"; _class_call_check(this, C); }; -C.foo = C // ok -; +C.foo = C; // ok var C2 = function C2() { "use strict"; _class_call_check(this, C2); }; -C2.foo = C2 // ok -; +C2.foo = C2; // ok diff --git a/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js b/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js index f14d1d7336f9..7a1b7a7970cc 100644 --- a/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js @@ -2,7 +2,5 @@ /** @template T @typedef {(data: T1) => T1} Test */ /** @type {Test} */ var test = function(dibbity) { return dibbity; }; -test(1) // ok, T=1 -; -test('hi') // error, T=number -; +test(1); // ok, T=1 +test('hi'); // error, T=number diff --git a/crates/swc/tests/tsc-references/unionTypeReadonly.1.normal.js b/crates/swc/tests/tsc-references/unionTypeReadonly.1.normal.js index e5f1dd98b74d..0c715fb7d837 100644 --- a/crates/swc/tests/tsc-references/unionTypeReadonly.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeReadonly.1.normal.js @@ -1,7 +1,6 @@ //// [unionTypeReadonly.ts] var base; -base.value = 12 // error, lhs can't be a readonly property -; +base.value = 12; // error, lhs can't be a readonly property var identical; identical.value = 12; // error, lhs can't be a readonly property var mutable; diff --git a/crates/swc/tests/tsc-references/unionTypeWithIndexSignature.1.normal.js b/crates/swc/tests/tsc-references/unionTypeWithIndexSignature.1.normal.js index 8eba64b30110..06f18447622a 100644 --- a/crates/swc/tests/tsc-references/unionTypeWithIndexSignature.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeWithIndexSignature.1.normal.js @@ -10,7 +10,6 @@ num['0'] = 'ok'; const sym = Symbol(); both['s'] = 'ok'; both[0] = 1; -both[1] = 0 // not ok -; +both[1] = 0; // not ok both[0] = 'not ok'; both[sym] = 'not ok'; diff --git a/crates/swc/tests/tsc-references/witness.1.normal.js b/crates/swc/tests/tsc-references/witness.1.normal.js index 5bb3cc7ff512..b947374e26c9 100644 --- a/crates/swc/tests/tsc-references/witness.1.normal.js +++ b/crates/swc/tests/tsc-references/witness.1.normal.js @@ -118,8 +118,7 @@ var propAcc1; var C2 = function C2() { "use strict"; _class_call_check(this, C2); - this.n = this.n // n: any - ; + this.n = this.n; // n: any }; var c2inst = new C2().n; var c2inst; diff --git a/crates/swc_ecma_codegen/src/comments.rs b/crates/swc_ecma_codegen/src/comments.rs index f8d40843c6df..71bf8d1d1c90 100644 --- a/crates/swc_ecma_codegen/src/comments.rs +++ b/crates/swc_ecma_codegen/src/comments.rs @@ -65,18 +65,35 @@ where prefix_space: bool, _is_hi: bool, ) -> Result { + let cmts = self.take_trailing_comments_of_pos(pos); + + write_comments!(self, prefix_space, &cmts) + } + + pub(super) fn emit_trailing_comments_of_pos_with( + &mut self, + pos: BytePos, + prefix_space: bool, + callback: impl FnOnce(&mut Self) -> Result, + ) -> Result { + let cmts = self.take_trailing_comments_of_pos(pos); + + callback(self)?; + + write_comments!(self, prefix_space, &cmts) + } + + fn take_trailing_comments_of_pos(&mut self, pos: BytePos) -> Option> { if pos.is_dummy() { - return Ok(()); + return None; } let comments = match self.comments { Some(ref comments) => comments, - None => return Ok(()), + None => return None, }; - let cmts = comments.take_trailing(pos); - - write_comments!(self, prefix_space, &cmts) + comments.take_trailing(pos) } pub(super) fn emit_leading_comments(&mut self, mut pos: BytePos, is_hi: bool) -> Result { diff --git a/crates/swc_ecma_codegen/src/stmt.rs b/crates/swc_ecma_codegen/src/stmt.rs index 91b8b094ee98..9f28b5f1fb7d 100644 --- a/crates/swc_ecma_codegen/src/stmt.rs +++ b/crates/swc_ecma_codegen/src/stmt.rs @@ -76,9 +76,13 @@ impl MacroNode for ExprStmt { fn emit(&mut self, emitter: &mut Macro) -> Result { emitter.emit_leading_comments_of_span(self.span, false)?; - emit!(self.expr); + emitter.emit_trailing_comments_of_pos_with(self.span.hi, true, |emitter| { + emit!(self.expr); - semi!(emitter); + semi!(emitter); + + Ok(()) + })?; Ok(()) } diff --git a/crates/swc_ecma_codegen/src/tests.rs b/crates/swc_ecma_codegen/src/tests.rs index 457713e4ac02..108b89cf80e9 100644 --- a/crates/swc_ecma_codegen/src/tests.rs +++ b/crates/swc_ecma_codegen/src/tests.rs @@ -200,7 +200,7 @@ a;", #[test] fn comment_2() { - test_from_to("a // foo", "a // foo\n;\n"); + test_from_to("a // foo", "a; // foo"); } #[test] @@ -211,7 +211,7 @@ fn comment_3() { a // foo b // bar", - "// foo\n// bar\na;\n// foo\nb // bar\n;\n", + "// foo\n// bar\na;\n// foo\nb; // bar", ); } diff --git a/crates/swc_ecma_codegen/tests/test262/12d4b327a5e20850.js b/crates/swc_ecma_codegen/tests/test262/12d4b327a5e20850.js index 6a8d5fc75a6e..8f6d3e35d800 100644 --- a/crates/swc_ecma_codegen/tests/test262/12d4b327a5e20850.js +++ b/crates/swc_ecma_codegen/tests/test262/12d4b327a5e20850.js @@ -1,4 +1,3 @@ if (a) { - b() // Some comment - ; + b(); // Some comment } diff --git a/crates/swc_ecma_codegen/tests/test262/14fb22cf10e20236.js b/crates/swc_ecma_codegen/tests/test262/14fb22cf10e20236.js index f366b1e526c3..79b6ac433fe1 100644 --- a/crates/swc_ecma_codegen/tests/test262/14fb22cf10e20236.js +++ b/crates/swc_ecma_codegen/tests/test262/14fb22cf10e20236.js @@ -1,2 +1 @@ -typeof (1, a) // Don't transform to 0,typeof ident -; +typeof (1, a); // Don't transform to 0,typeof ident diff --git a/crates/swc_ecma_codegen/tests/test262/2dd810da4984502b.js b/crates/swc_ecma_codegen/tests/test262/2dd810da4984502b.js index 555ec37d2add..612802d3bd8d 100644 --- a/crates/swc_ecma_codegen/tests/test262/2dd810da4984502b.js +++ b/crates/swc_ecma_codegen/tests/test262/2dd810da4984502b.js @@ -1 +1 @@ -1 /* the * answer */ ; +1; /* the * answer */ diff --git a/crates/swc_ecma_codegen/tests/test262/366585381e4610b4.js b/crates/swc_ecma_codegen/tests/test262/366585381e4610b4.js index 7d9a9d44a462..3d2c27b5a9d4 100644 --- a/crates/swc_ecma_codegen/tests/test262/366585381e4610b4.js +++ b/crates/swc_ecma_codegen/tests/test262/366585381e4610b4.js @@ -1,2 +1 @@ -a + (b(), c(), d()) // do not transform because of global getter -; +a + (b(), c(), d()); // do not transform because of global getter diff --git a/crates/swc_ecma_codegen/tests/test262/40215319424a8227.js b/crates/swc_ecma_codegen/tests/test262/40215319424a8227.js index e12f14ed752d..0b29a4f81061 100644 --- a/crates/swc_ecma_codegen/tests/test262/40215319424a8227.js +++ b/crates/swc_ecma_codegen/tests/test262/40215319424a8227.js @@ -1,2 +1 @@ -a //b -; +a; //b diff --git a/crates/swc_ecma_codegen/tests/test262/402c32920b1b9991.js b/crates/swc_ecma_codegen/tests/test262/402c32920b1b9991.js index 48f75490c795..b4b0aded7e7f 100644 --- a/crates/swc_ecma_codegen/tests/test262/402c32920b1b9991.js +++ b/crates/swc_ecma_codegen/tests/test262/402c32920b1b9991.js @@ -1 +1 @@ -1 /**/ ; +1; /**/ diff --git a/crates/swc_ecma_codegen/tests/test262/402e8d30db64e5af.js b/crates/swc_ecma_codegen/tests/test262/402e8d30db64e5af.js index 66ecf65ddc52..89d6e0d65ff7 100644 --- a/crates/swc_ecma_codegen/tests/test262/402e8d30db64e5af.js +++ b/crates/swc_ecma_codegen/tests/test262/402e8d30db64e5af.js @@ -1,2 +1 @@ -1 // line comment -; +1; // line comment diff --git a/crates/swc_ecma_codegen/tests/test262/5d0cbb3fb27c21b7.js b/crates/swc_ecma_codegen/tests/test262/5d0cbb3fb27c21b7.js index f8adad4ab567..31fe63096c45 100644 --- a/crates/swc_ecma_codegen/tests/test262/5d0cbb3fb27c21b7.js +++ b/crates/swc_ecma_codegen/tests/test262/5d0cbb3fb27c21b7.js @@ -3,7 +3,6 @@ for(;;){ if (b) { continue; } - c() // This should not removed and translation should not occur. - ; + c(); // This should not removed and translation should not occur. } } diff --git a/crates/swc_ecma_codegen/tests/test262/771467ccdae93157.js b/crates/swc_ecma_codegen/tests/test262/771467ccdae93157.js index 89d654fc14fc..05eb2ae970df 100644 --- a/crates/swc_ecma_codegen/tests/test262/771467ccdae93157.js +++ b/crates/swc_ecma_codegen/tests/test262/771467ccdae93157.js @@ -1 +1 @@ -1 /*the*/ /*answer*/ ; +1; /*the*/ /*answer*/ diff --git a/crates/swc_ecma_codegen/tests/test262/776076cb09759e40.js b/crates/swc_ecma_codegen/tests/test262/776076cb09759e40.js index 94274af79781..02742f1da191 100644 --- a/crates/swc_ecma_codegen/tests/test262/776076cb09759e40.js +++ b/crates/swc_ecma_codegen/tests/test262/776076cb09759e40.js @@ -1 +1 @@ -1 /*The*/ /*Answer*/ ; +1; /*The*/ /*Answer*/ diff --git a/crates/swc_ecma_codegen/tests/test262/9d0fd95dd43f59ec.js b/crates/swc_ecma_codegen/tests/test262/9d0fd95dd43f59ec.js index 3880e7d85991..0fd6dc768d7d 100644 --- a/crates/swc_ecma_codegen/tests/test262/9d0fd95dd43f59ec.js +++ b/crates/swc_ecma_codegen/tests/test262/9d0fd95dd43f59ec.js @@ -1 +1 @@ -1 /* The * answer */ ; +1; /* The * answer */ diff --git a/crates/swc_ecma_codegen/tests/test262/ae700e3f8ff82c6c.js b/crates/swc_ecma_codegen/tests/test262/ae700e3f8ff82c6c.js index bd2a6706bda6..013fc862378f 100644 --- a/crates/swc_ecma_codegen/tests/test262/ae700e3f8ff82c6c.js +++ b/crates/swc_ecma_codegen/tests/test262/ae700e3f8ff82c6c.js @@ -1,2 +1 @@ -a() + (b(), c(), d(), e()) // do not transform -; +a() + (b(), c(), d(), e()); // do not transform diff --git a/crates/swc_ecma_codegen/tests/test262/e46f7944dd0d4eb4.js b/crates/swc_ecma_codegen/tests/test262/e46f7944dd0d4eb4.js index 897ed9faff32..d2ad0cc0f459 100644 --- a/crates/swc_ecma_codegen/tests/test262/e46f7944dd0d4eb4.js +++ b/crates/swc_ecma_codegen/tests/test262/e46f7944dd0d4eb4.js @@ -1 +1 @@ -1 /* block comment 1 */ /* block comment 2 */ ; +1; /* block comment 1 */ /* block comment 2 */ diff --git a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/object_super.rs/do_not_transform.js b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/object_super.rs/do_not_transform.js index b846d7243afa..5da279a1ce96 100644 --- a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/object_super.rs/do_not_transform.js +++ b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/object_super.rs/do_not_transform.js @@ -2,8 +2,7 @@ let outer = { b: function b() { let inner = { d: function d() { - super.d() // should not transform - ; + super.d(); // should not transform } }; } diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/6957/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/6957/1/output.js index 5c14144486ee..c558aac6bf33 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/6957/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/6957/1/output.js @@ -1,38 +1,21 @@ // prettier-ignore export function foo() { // actual | expected - alert("1.0") // '1.0' '1.0' - ; - alert("0") // '0' '0' - ; - alert("0.0") // '0' '0.0' - ; - alert("0.00") // '0' '0.00' - ; - alert("0.000") // '0' '0.000' - ; - alert("10.0") // '10' '10.0' - ; - alert("20.00") // '20.0' '20.00' - ; - alert("30.000") // '30.00' '30.000' - ; - alert("100.0") // '100' '100.0' - ; - alert("100.00") // '100' '100.00' - ; - alert("100.000") // '100.0' '100.000' - ; - alert("110.0") // '110' '110.0' - ; - alert("110.00") // '110' '110.00' - ; - alert("110.000") // '110.0' '110.000' - ; - alert("110.0000") // '110.00' '110.000' - ; - alert("1110.0000") // '1110.0' '1110.0000' - ; - alert("11110.0000") // '11110' '11110.0000' - ; + alert("1.0"); // '1.0' '1.0' + alert("0"); // '0' '0' + alert("0.0"); // '0' '0.0' + alert("0.00"); // '0' '0.00' + alert("0.000"); // '0' '0.000' + alert("10.0"); // '10' '10.0' + alert("20.00"); // '20.0' '20.00' + alert("30.000"); // '30.00' '30.000' + alert("100.0"); // '100' '100.0' + alert("100.00"); // '100' '100.00' + alert("100.000"); // '100.0' '100.000' + alert("110.0"); // '110' '110.0' + alert("110.00"); // '110' '110.00' + alert("110.000"); // '110.0' '110.000' + alert("110.0000"); // '110.00' '110.000' + alert("1110.0000"); // '1110.0' '1110.0000' + alert("11110.0000"); // '11110' '11110.0000' } diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8324/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8324/output.js index e172c3586c5e..8717d0d4f24c 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/8324/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8324/output.js @@ -15,8 +15,7 @@ export async function bug() { return await window[s].promise // This line compressed to 'break'. I guess compressor intended jump to 23 line which is looks like same code. ; } finally{ - delete window.current // Above 'break' makes unintended delete - ; + delete window.current; // Above 'break' makes unintended delete } } } diff --git a/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties-loose/output.js b/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties-loose/output.js index 7bd1d4ff5a07..cbbe5d4d0dca 100644 --- a/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties-loose/output.js +++ b/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties-loose/output.js @@ -9,8 +9,7 @@ class Foo { var _class; this.Bar = (_class = class { constructor(){ - this.q = void 0 // should not replace - ; + this.q = void 0; // should not replace } }, _class.p = void 0, _class.p1 = class { constructor(){ diff --git a/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties/output.js b/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties/output.js index 2add8e990a23..081f35f2da7b 100644 --- a/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties/output.js +++ b/crates/swc_ecma_transforms_compat/tests/new-target/general/class-properties/output.js @@ -9,8 +9,7 @@ class Foo { var _class; this.Bar = (_class = class { constructor(){ - _define_property(this, "q", void 0) // should not replace - ; + _define_property(this, "q", void 0); // should not replace } }, _define_property(_class, "p", void 0), _define_property(_class, "p1", class { constructor(){ diff --git a/crates/swc_ecma_transforms_typescript/src/transform.rs b/crates/swc_ecma_transforms_typescript/src/transform.rs index 99ef7ad1fe27..50f0df8ae21d 100644 --- a/crates/swc_ecma_transforms_typescript/src/transform.rs +++ b/crates/swc_ecma_transforms_typescript/src/transform.rs @@ -1063,6 +1063,7 @@ impl Transform { key, value: value @ Some(..), is_static: false, + span, .. }) => { let key = match &mut *key { @@ -1083,18 +1084,22 @@ impl Transform { _ => key.clone(), }; - init_list.push(assign_value_to_this_prop(key, *value.take().unwrap())); + let mut init = assign_value_to_this_prop(key, *value.take().unwrap()); + init.set_span(*span); + + init_list.push(init); } ClassMember::PrivateProp(PrivateProp { key, value: value @ Some(..), is_static: false, + span, .. }) => { - init_list.push(assign_value_to_this_private_prop( - key.clone(), - *value.take().unwrap(), - )); + let mut init = + assign_value_to_this_private_prop(key.clone(), *value.take().unwrap()); + init.set_span(*span); + init_list.push(init); } _ => {} } diff --git a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_960_1.js b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_960_1.js index 858c04530b5e..9f4e7498968e 100644 --- a/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_960_1.js +++ b/crates/swc_ecma_transforms_typescript/tests/__swc_snapshots__/tests/strip.rs/issue_960_1.js @@ -10,8 +10,7 @@ class Base { } class Child extends Base { callApi() { - console.log(this.action) // undefined - ; + console.log(this.action); // undefined } } _ts_decorate([ diff --git a/crates/swc_ecma_utils/src/factory.rs b/crates/swc_ecma_utils/src/factory.rs index 494702b6607c..d82339a51cf5 100644 --- a/crates/swc_ecma_utils/src/factory.rs +++ b/crates/swc_ecma_utils/src/factory.rs @@ -45,9 +45,10 @@ pub trait ExprFactory: Into> { /// Creates an expression statement with `self`. #[cfg_attr(not(debug_assertions), inline(always))] fn into_stmt(self) -> Stmt { + let expr = self.into(); ExprStmt { - span: DUMMY_SP, - expr: self.into(), + span: expr.span(), + expr, } .into() } diff --git a/crates/swc_typescript/src/fast_dts/types.rs b/crates/swc_typescript/src/fast_dts/types.rs index a63e681e27de..b49e0062aa41 100644 --- a/crates/swc_typescript/src/fast_dts/types.rs +++ b/crates/swc_typescript/src/fast_dts/types.rs @@ -173,9 +173,10 @@ impl FastDts { self.inferred_type_of_expression(kv.value.span()); } + let span = kv.key.span().with_hi(kv.value.span_hi()); let key = self.transform_property_name_to_expr(&kv.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { - span: DUMMY_SP, + span, readonly: is_const, key: Box::new(key), computed: kv.key.is_computed(), @@ -208,9 +209,10 @@ impl FastDts { self.accessor_must_have_explicit_return_type(getter.span); } + let span = getter.span; let key = self.transform_property_name_to_expr(&getter.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { - span: DUMMY_SP, + span, readonly: !has_setter, key: Box::new(key), computed: getter.key.is_computed(), @@ -244,9 +246,10 @@ impl FastDts { self.accessor_must_have_explicit_return_type(setter.span); } + let span = setter.span; let key = self.transform_property_name_to_expr(&setter.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { - span: DUMMY_SP, + span, readonly: false, key: Box::new(key), computed: setter.key.is_computed(), @@ -259,10 +262,11 @@ impl FastDts { continue; } + let span = method.key.span().with_hi(method.function.span_hi()); if is_const { let key = self.transform_property_name_to_expr(&method.key); members.push(TsTypeElement::TsPropertySignature(TsPropertySignature { - span: DUMMY_SP, + span, readonly: is_const, key: Box::new(key), computed: method.key.is_computed(), @@ -278,7 +282,7 @@ impl FastDts { let return_type = self.infer_function_return_type(&method.function); let key = self.transform_property_name_to_expr(&method.key); members.push(TsTypeElement::TsMethodSignature(TsMethodSignature { - span: DUMMY_SP, + span, key: Box::new(key), computed: method.key.is_computed(), optional: false, diff --git a/crates/swc_typescript/tests/fixture/simple-getter-setter.snap b/crates/swc_typescript/tests/fixture/simple-getter-setter.snap index 7bd12e0ec702..c390c723d5d1 100644 --- a/crates/swc_typescript/tests/fixture/simple-getter-setter.snap +++ b/crates/swc_typescript/tests/fixture/simple-getter-setter.snap @@ -4,6 +4,7 @@ export declare const foo: { x: string; y: string; z: string; + // readonly readonly w: string; }; export declare class Foo { From 1b5b4f85d74221c41a83bc54737a0770f1d4ba1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Thu, 29 May 2025 10:21:26 -0700 Subject: [PATCH 025/209] chore: Publish crates with `swc_core` `v26.3.0` --- .changeset/modern-crews-glow.md | 6 ------ .changeset/yellow-bikes-complain.md | 6 ------ CHANGELOG-CORE.md | 17 ++++++++++++++--- CHANGELOG.md | 14 ++++++-------- Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_ecma_codegen/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- .../swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- 28 files changed, 48 insertions(+), 51 deletions(-) delete mode 100644 .changeset/modern-crews-glow.md delete mode 100644 .changeset/yellow-bikes-complain.md diff --git a/.changeset/modern-crews-glow.md b/.changeset/modern-crews-glow.md deleted file mode 100644 index 0706b9dc3592..000000000000 --- a/.changeset/modern-crews-glow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: minor -swc_ecma_codegen: minor ---- - -fix(es/codegen): Improve comments handling diff --git a/.changeset/yellow-bikes-complain.md b/.changeset/yellow-bikes-complain.md deleted file mode 100644 index 1e92bf3c1993..000000000000 --- a/.changeset/yellow-bikes-complain.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_core: patch ---- - -refactor(ecma/lexer): cleanup read token diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index d583d4e3722a..49f307a12e57 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,20 @@ +- **(es/codegen)** Improve comments handling ([#10534](https://github.com/swc-project/swc/issues/10534)) ([d9ba838](https://github.com/swc-project/swc/commit/d9ba838df9b88d6c4108bc21dd9d6eebd406aacd)) + +### Refactor + + + +- **(es/lexer)** Cleanup code for reading tokens ([#10533](https://github.com/swc-project/swc/issues/10533)) ([a72092c](https://github.com/swc-project/swc/commit/a72092c13166fe80d494e49cf0c5ec04e93ee4eb)) + +## [swc_core@v26.2.2] - 2025-05-27 + +### Bug Fixes + + + - **(ts/fast-dts)** Ensure correct emission of template literals and symbol-keyed properties ([#10530](https://github.com/swc-project/swc/issues/10530)) ([8dbdbef](https://github.com/swc-project/swc/commit/8dbdbef266f508e09f52ffe1cbe2e953e5039a3d)) ## [swc_core@v26.2.1] - 2025-05-27 @@ -2393,9 +2407,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Iterate object properties in reverse direction while inlining property access ([#9507](https://github.com/swc-project/swc/issues/9507)) ([f584ef7](https://github.com/swc-project/swc/commit/f584ef76d75e86da15d0725ac94be35a88a1c946)) - - - **(es/minifier)** Fix name mangler ([#9524](https://github.com/swc-project/swc/issues/9524)) ([5fd68f9](https://github.com/swc-project/swc/commit/5fd68f9a3a9eeef0e61627a821c52ace69a89696)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e53097fec5..8ef0540470a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ +- **(es/codegen)** Improve comments handling ([#10534](https://github.com/swc-project/swc/issues/10534)) ([d9ba838](https://github.com/swc-project/swc/commit/d9ba838df9b88d6c4108bc21dd9d6eebd406aacd)) + + - **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) @@ -53,6 +56,9 @@ - **(es/codegen)** Migrate to `ryu-js` for numeric literal codegen ([#10503](https://github.com/swc-project/swc/issues/10503)) ([4bc4244](https://github.com/swc-project/swc/commit/4bc4244c195d3a364b588348657fd8a3d8c22079)) +- **(es/lexer)** Cleanup code for reading tokens ([#10533](https://github.com/swc-project/swc/issues/10533)) ([a72092c](https://github.com/swc-project/swc/commit/a72092c13166fe80d494e49cf0c5ec04e93ee4eb)) + + - **(es/parser)** Share code for parsing strings ([#10522](https://github.com/swc-project/swc/issues/10522)) ([931a2d6](https://github.com/swc-project/swc/commit/931a2d6761bfec72cdda7eb875ad02dc217848b9)) @@ -2079,12 +2085,4 @@ - **(es/utils)** Rewrite inject_after_super ([#9496](https://github.com/swc-project/swc/issues/9496)) ([c562cfa](https://github.com/swc-project/swc/commit/c562cfa8af1163a4946ef79cb025d461c7e2e5e0)) -## [1.7.22] - 2024-08-30 - -### Bug Fixes - - - -- **(es/minifier)** Iterate object properties in reverse direction while inlining property access ([#9507](https://github.com/swc-project/swc/issues/9507)) ([f584ef7](https://github.com/swc-project/swc/commit/f584ef76d75e86da15d0725ac94be35a88a1c946)) - diff --git a/Cargo.lock b/Cargo.lock index dd0e5291d08d..0ab47f112d90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.2.2" +version = "26.3.0" dependencies = [ "anyhow", "binding_macros", @@ -5256,7 +5256,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.1.0" +version = "13.2.0" dependencies = [ "ascii", "base64 0.22.1", @@ -5499,7 +5499,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.2" +version = "14.0.3" dependencies = [ "arrayvec", "bitflags 2.6.0", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index e6574bcfb604..856601171d7e 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -32,7 +32,7 @@ swc_common = { version = "11.0.0", features = [ "tty-emitter", ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ "concurrent", ] } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 87ce96097f49..7706c3bb061b 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -80,7 +80,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ swc_compiler_base = { version = "22.0.0", path = "../swc_compiler_base" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_ext_transforms = { version = "15.0.0", path = "../swc_ecma_ext_transforms" } swc_ecma_lints = { version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index fb6c07dc2e7d..39660edf9609 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -41,7 +41,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 0a9de4a30ded..9e4ae05f85b2 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.2.2", features = [ +swc_core = { version = "26.3.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 91e68b600d82..1cb95f305354 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -29,7 +29,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ ] } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 7f2e61e16aac..e09a0e99c0e3 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.2.2" +version = "26.3.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -365,7 +365,7 @@ swc_css_prefixer = { optional = true, version = "13.0.0", path = swc_css_utils = { optional = true, version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { optional = true, version = "11.0.0", path = "../swc_css_visit" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { optional = true, version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { optional = true, version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_minifier = { optional = true, version = "20.0.3", path = "../swc_ecma_minifier" } diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index b9f731ebce30..7eb92514039e 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_codegen" repository = { workspace = true } -version = "13.1.0" +version = "13.2.0" [features] # This does not enable serde for ast nodes. diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index b84b15e5af0a..3eebb8ab1850 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.2" +version = "14.0.3" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index c29112418595..b87b55b04718 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -37,7 +37,7 @@ anyhow = { workspace = true } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index b0eb50743153..8d784f7b9569 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -62,7 +62,7 @@ swc_config = { version = "3.0.0", path = "../swc_config", features = [ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index afb69d549cc7..dd32b8947edd 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -42,7 +42,7 @@ phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.2", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 626b9bc4cd30..0ab21dae8f12 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -44,7 +44,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index ce85efaa8372..59a4eb4ac9ec 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -55,7 +55,7 @@ pretty_assertions = { workspace = true } sourcemap = { workspace = true } tempfile = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 1ffcdf459f06..568c6a5a1d3e 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -42,7 +42,7 @@ criterion = { workspace = true } par-core = { workspace = true, features = ["chili"] } rayon = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 00f0df84f9a5..482032e16ec8 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -35,7 +35,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] serde_json = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 7aa2ac2d6fd5..2d8c823d5080 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -40,7 +40,7 @@ swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen/" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen/" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat/" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 073fedc9af5f..32eb5f7f7c53 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -27,7 +27,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 325a33dd68e1..5f8830fe4d21 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -33,7 +33,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 3292fbc3cc69..94d2f23fb1b5 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -39,7 +39,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", optional = true } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", optional = true } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 1630fb6fe91e..1ea6fd411e47 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -21,8 +21,8 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.2", path = "../swc_ecma_lexer" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } +swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 4336d3dff2f4..3dbc1080f099 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -39,7 +39,7 @@ swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = swc_css_minifier = { version = "11.0.0", path = "../swc_css_minifier", optional = true } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser", optional = true } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen", features = [ +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 72032c0aaf95..08f11e313d78 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -39,7 +39,7 @@ swc_common = { version = "11.0.0", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 08fda5aee732..19287d46b3ab 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -22,7 +22,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.1.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } testing = { version = "12.0.0", path = "../testing" } From 9403ce2e7372dbcd579e2710480f2ffc78d8bcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 30 May 2025 08:19:48 -0700 Subject: [PATCH 026/209] fix(react-compiler): Fix fast check (#10538) --- .changeset/nice-grapes-mix.md | 6 + Cargo.lock | 2 + crates/swc_ecma_react_compiler/Cargo.toml | 4 + .../swc_ecma_react_compiler/src/fast_check.rs | 222 +++++++++++++++--- 4 files changed, 207 insertions(+), 27 deletions(-) create mode 100644 .changeset/nice-grapes-mix.md diff --git a/.changeset/nice-grapes-mix.md b/.changeset/nice-grapes-mix.md new file mode 100644 index 000000000000..7118c161f094 --- /dev/null +++ b/.changeset/nice-grapes-mix.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_react_compiler: patch +--- + +fix(react-compiler): Fix fast check diff --git a/Cargo.lock b/Cargo.lock index 0ab47f112d90..c13bd9a8d9be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5722,7 +5722,9 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_parser", "swc_ecma_visit", + "testing", ] [[package]] diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 830c8b8d5f63..5331fe0d1c0a 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -17,3 +17,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.0.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } + +[dev-dependencies] +swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_react_compiler/src/fast_check.rs b/crates/swc_ecma_react_compiler/src/fast_check.rs index 2402dc91ad8d..38ff98e10a32 100644 --- a/crates/swc_ecma_react_compiler/src/fast_check.rs +++ b/crates/swc_ecma_react_compiler/src/fast_check.rs @@ -1,4 +1,7 @@ -use swc_ecma_ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, Stmt, VarDeclarator}; +use swc_ecma_ast::{ + Callee, ExportDefaultDecl, ExportDefaultExpr, Expr, FnDecl, FnExpr, Pat, Program, Stmt, + VarDeclarator, +}; use swc_ecma_visit::{Visit, VisitWith}; pub fn is_required(program: &Program) -> bool { let mut finder = Finder::default(); @@ -31,18 +34,40 @@ impl Visit for Finder { node.visit_children_with(self); } + fn visit_export_default_decl(&mut self, node: &ExportDefaultDecl) { + let old = self.is_interested; + + self.is_interested = true; + + node.visit_children_with(self); + + self.is_interested = old; + } + + fn visit_export_default_expr(&mut self, node: &ExportDefaultExpr) { + let old = self.is_interested; + + self.is_interested = true; + + node.visit_children_with(self); + + self.is_interested = old; + } + fn visit_expr(&mut self, node: &Expr) { if self.found { return; } - if matches!( - node, - Expr::JSXMember(..) - | Expr::JSXNamespacedName(..) - | Expr::JSXEmpty(..) - | Expr::JSXElement(..) - | Expr::JSXFragment(..) - ) { + if self.is_interested + && matches!( + node, + Expr::JSXMember(..) + | Expr::JSXNamespacedName(..) + | Expr::JSXEmpty(..) + | Expr::JSXElement(..) + | Expr::JSXFragment(..) + ) + { self.found = true; return; } @@ -52,6 +77,7 @@ impl Visit for Finder { fn visit_fn_decl(&mut self, node: &FnDecl) { let old = self.is_interested; + self.is_interested = node.ident.sym.starts_with("use") || node.ident.sym.starts_with(|c: char| c.is_ascii_uppercase()); @@ -72,19 +98,6 @@ impl Visit for Finder { self.is_interested = old; } - fn visit_return_stmt(&mut self, node: &ReturnStmt) { - if self.is_interested { - if let Some(Expr::JSXElement(..) | Expr::JSXEmpty(..) | Expr::JSXFragment(..)) = - node.arg.as_deref() - { - self.found = true; - return; - } - } - - node.visit_children_with(self); - } - fn visit_stmt(&mut self, node: &Stmt) { if self.found { return; @@ -95,11 +108,13 @@ impl Visit for Finder { fn visit_var_declarator(&mut self, node: &VarDeclarator) { let old = self.is_interested; - if let Pat::Ident(ident) = &node.name { - self.is_interested = ident.sym.starts_with("use") - || ident.sym.starts_with(|c: char| c.is_ascii_uppercase()); - } else { - self.is_interested = false; + if matches!(node.init.as_deref(), Some(Expr::Fn(..) | Expr::Arrow(..))) { + if let Pat::Ident(ident) = &node.name { + self.is_interested = ident.sym.starts_with("use") + || ident.sym.starts_with(|c: char| c.is_ascii_uppercase()); + } else { + self.is_interested = false; + } } node.visit_children_with(self); @@ -107,3 +122,156 @@ impl Visit for Finder { self.is_interested = old; } } + +#[cfg(test)] +mod tests { + use swc_common::FileName; + use swc_ecma_parser::{parse_file_as_program, EsSyntax, Syntax}; + use testing::run_test2; + + use super::*; + + fn assert_required(code: &str, required: bool) { + run_test2(false, |cm, _| { + let fm = cm.new_source_file(FileName::Custom("test.tsx".into()).into(), code.into()); + + let program = parse_file_as_program( + &fm, + Syntax::Es(EsSyntax { + jsx: true, + ..Default::default() + }), + Default::default(), + Default::default(), + &mut vec![], + ) + .unwrap(); + + assert_eq!(is_required(&program), required); + + Ok(()) + }) + .unwrap(); + } + + #[test] + fn lazy_return() { + assert_required( + " + function Foo() { + const a =
Hello
; + + return a + } + ", + true, + ); + + assert_required( + " + function Foo() { + ", + false, + ); + } + + #[test] + fn return_jsx() { + assert_required( + " + function Foo() { + return
Hello
; + } + ", + true, + ); + } + + #[test] + fn use_hooks() { + assert_required( + " + function Foo(props) { + const [a, b] = useState(0); + + return props.children; + } + ", + true, + ); + } + + #[test] + fn arrow_function() { + assert_required( + " + const Foo = () =>
Hello
; + ", + true, + ); + + assert_required( + " + const Foo = () => { + return
Hello
; + }; + ", + true, + ); + } + + #[test] + fn export_const_arrow_function() { + assert_required( + " + export const Foo = () =>
Hello
; + ", + true, + ); + + assert_required( + " + export const Foo = () => { + return
Hello
; + }; + ", + true, + ); + } + + #[test] + fn normal_arrow_function() { + assert_required( + " + const Foo = () => { + const a = 1; + console.log(a); + }; + ", + false, + ); + } + + #[test] + fn export_default_arrow_function() { + assert_required( + " + export default () =>
Hello
; + ", + true, + ); + } + + #[test] + fn not_required_arrow_function() { + assert_required( + " + export default () => { + const a = 1; + console.log(a); + }; + ", + false, + ); + } +} From 729aae9d1d6c8725dbe47e1a55fb04f4f1ffe997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 30 May 2025 09:04:48 -0700 Subject: [PATCH 027/209] chore: Publish crates with `swc_core` `v26.3.1` --- .changeset/nice-grapes-mix.md | 6 ------ CHANGELOG-CORE.md | 8 ++++++++ CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 .changeset/nice-grapes-mix.md diff --git a/.changeset/nice-grapes-mix.md b/.changeset/nice-grapes-mix.md deleted file mode 100644 index 7118c161f094..000000000000 --- a/.changeset/nice-grapes-mix.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_react_compiler: patch ---- - -fix(react-compiler): Fix fast check diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 49f307a12e57..e1273f25eec8 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,14 @@ +- **(react-compiler)** Fix fast check ([#10538](https://github.com/swc-project/swc/issues/10538)) ([9403ce2](https://github.com/swc-project/swc/commit/9403ce2e7372dbcd579e2710480f2ffc78d8bcca)) + +## [swc_core@v26.3.0] - 2025-05-29 + +### Bug Fixes + + + - **(es/codegen)** Improve comments handling ([#10534](https://github.com/swc-project/swc/issues/10534)) ([d9ba838](https://github.com/swc-project/swc/commit/d9ba838df9b88d6c4108bc21dd9d6eebd406aacd)) ### Refactor diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ef0540470a6..dd20abef16a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ - **(es/utils)** Fix `extract_var_ids` ([#10511](https://github.com/swc-project/swc/issues/10511)) ([5644372](https://github.com/swc-project/swc/commit/56443727dd195a2a3500014b8f54b9a18e14e484)) +- **(react-compiler)** Fix fast check ([#10538](https://github.com/swc-project/swc/issues/10538)) ([9403ce2](https://github.com/swc-project/swc/commit/9403ce2e7372dbcd579e2710480f2ffc78d8bcca)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) diff --git a/Cargo.lock b/Cargo.lock index c13bd9a8d9be..12ac071179cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.3.0" +version = "26.3.1" dependencies = [ "anyhow", "binding_macros", @@ -5717,7 +5717,7 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.1" +version = "4.0.2" dependencies = [ "swc_atoms", "swc_common", diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 9e4ae05f85b2..212053fc19a9 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.3.0", features = [ +swc_core = { version = "26.3.1", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index e09a0e99c0e3..3727979e07b5 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.3.0" +version = "26.3.1" [package.metadata.docs.rs] features = [ "allocator_node", @@ -372,7 +372,7 @@ swc_ecma_minifier = { optional = true, version = "20.0.3", path = swc_ecma_parser = { optional = true, version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } -swc_ecma_react_compiler = { optional = true, version = "4.0.1", path = "../swc_ecma_react_compiler" } +swc_ecma_react_compiler = { optional = true, version = "4.0.2", path = "../swc_ecma_react_compiler" } swc_ecma_transforms_base = { optional = true, version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_module = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_module" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 5331fe0d1c0a..5496022f49ce 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_react_compiler" repository = { workspace = true } -version = "4.0.1" +version = "4.0.2" [package.metadata.docs.rs] From 39f30b066fe4d91f8df641fe59aba86acb10d645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 2 Jun 2025 07:45:37 -0700 Subject: [PATCH 028/209] feat(swc_common): Add `Globals::clone_data` (#10543) **Description:** This would help preserve immutability. --- .changeset/rude-moose-repair.md | 6 ++++++ crates/swc_common/src/syntax_pos.rs | 11 +++++++++++ crates/swc_common/src/syntax_pos/hygiene.rs | 5 ++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .changeset/rude-moose-repair.md diff --git a/.changeset/rude-moose-repair.md b/.changeset/rude-moose-repair.md new file mode 100644 index 000000000000..b029dc030bc3 --- /dev/null +++ b/.changeset/rude-moose-repair.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +feat(swc_common): Add `Globals::clone_data` diff --git a/crates/swc_common/src/syntax_pos.rs b/crates/swc_common/src/syntax_pos.rs index 5602198e4bfa..1c30ceb1c59a 100644 --- a/crates/swc_common/src/syntax_pos.rs +++ b/crates/swc_common/src/syntax_pos.rs @@ -124,6 +124,17 @@ impl Globals { dummy_cnt: AtomicU32::new(DUMMY_RESERVE), } } + + /// Clone the data from the current globals. + /// + /// Do not use this unless you know what you are doing. + pub fn clone_data(&self) -> Self { + Globals { + hygiene_data: Mutex::new(self.hygiene_data.lock().clone()), + marks: Mutex::new(self.marks.lock().clone()), + dummy_cnt: AtomicU32::new(self.dummy_cnt.load(std::sync::atomic::Ordering::SeqCst)), + } + } } better_scoped_tls::scoped_tls!( diff --git a/crates/swc_common/src/syntax_pos/hygiene.rs b/crates/swc_common/src/syntax_pos/hygiene.rs index 804273f958a9..ed8e18b4323a 100644 --- a/crates/swc_common/src/syntax_pos/hygiene.rs +++ b/crates/swc_common/src/syntax_pos/hygiene.rs @@ -79,7 +79,7 @@ struct SyntaxContextData { pub struct Mark(u32); #[allow(unused)] -#[derive(Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub(crate) struct MarkData { pub(crate) parent: Mark, } @@ -267,8 +267,7 @@ impl Mark { } } -#[allow(unused)] -#[derive(Debug)] +#[derive(Clone, Debug)] pub(crate) struct HygieneData { syntax_contexts: Vec, markings: FxHashMap<(SyntaxContext, Mark), SyntaxContext>, From 3d68d06cce4b8e53a188925141d74db00cac348b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Jun 2025 07:45:48 -0700 Subject: [PATCH 029/209] chore: Publish crates with `swc_core` `v26.3.2` --- .changeset/rude-moose-repair.md | 6 ------ CHANGELOG-CORE.md | 8 ++++++++ CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 84 files changed, 98 insertions(+), 93 deletions(-) delete mode 100644 .changeset/rude-moose-repair.md diff --git a/.changeset/rude-moose-repair.md b/.changeset/rude-moose-repair.md deleted file mode 100644 index b029dc030bc3..000000000000 --- a/.changeset/rude-moose-repair.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -feat(swc_common): Add `Globals::clone_data` diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index e1273f25eec8..ab49636d40e8 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,6 +1,14 @@ # Changelog ## [unreleased] +### Features + + + +- **(swc_common)** Add `Globals::clone_data` ([#10543](https://github.com/swc-project/swc/issues/10543)) ([39f30b0](https://github.com/swc-project/swc/commit/39f30b066fe4d91f8df641fe59aba86acb10d645)) + +## [swc_core@v26.3.1] - 2025-05-30 + ### Bug Fixes diff --git a/CHANGELOG.md b/CHANGELOG.md index dd20abef16a0..3d151ae1254b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ - **(es/regexp)** Add crates for RegExp ([#10525](https://github.com/swc-project/swc/issues/10525)) ([4b3f924](https://github.com/swc-project/swc/commit/4b3f924edf996983e2a61cc29eb0c552cf71af7a)) + +- **(swc_common)** Add `Globals::clone_data` ([#10543](https://github.com/swc-project/swc/issues/10543)) ([39f30b0](https://github.com/swc-project/swc/commit/39f30b066fe4d91f8df641fe59aba86acb10d645)) + ### Miscellaneous Tasks diff --git a/Cargo.lock b/Cargo.lock index 12ac071179cf..64b672cfc954 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.0.0" +version = "11.0.1" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.3.1" +version = "26.3.2" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 2a74634f8827..708f2e2ea8a2 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.0.0", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 856601171d7e..6892a06ddbd8 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", features = [ +swc_common = { version = "11.0.1", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 059c0d4b3d6d..83422f657ca4 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 7706c3bb061b..1372d4fb79c7 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 39660edf9609..e27cf36483b7 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 212053fc19a9..22db762472fb 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.3.1", features = [ +swc_core = { version = "26.3.2", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index ac2e45eb76f8..d707606058a3 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.0.0" +version = "11.0.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 1cb95f305354..acc2a1686765 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 3727979e07b5..3853221b030a 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.3.1" +version = "26.3.2" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.0.0", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.1", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 3b45a15d08a8..27916ca00bd1 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index 0279d4ba167f..fffb8a17df09 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index f2ce2b4c4163..8fa61935b9d8 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index bf6bb0dfc822..f204dfb0270a 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index c816e9fbcb90..b75fa099e70c 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 7e071fc15cc1..68ccebf2b0a1 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 2c34294820ca..98340bd41589 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 3ceb7d9ff504..cc1a33497fb0 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index ec907c7bbe58..bb23c977ef06 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 91a913e35c7b..930917cfa928 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 276409a42091..8ec3cb0cdcaf 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 7eb92514039e..c04ff30568e5 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index ac6185cf7440..7cc8d11c40dd 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index c4b09aeef921..ff6cfc9dfcd3 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index b33cb18b766d..378d6d835b42 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 86740e72a4b1..5a3d4d0aed33 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 3821b46ed172..bc98b72abe80 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 641433aad69e..e40e797cb4fd 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 58c4a78e42ac..0dde9bce8576 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 6db037728e73..6f3207d43690 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 80cadb007051..8baa7f88e6e9 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 6acc4ad077c3..8229b5216973 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index d27cff31b8c9..2b53606f898d 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 2cc215d9a4bf..c78877b2423d 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 3eebb8ab1850..a1b37aeae51b 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index b87b55b04718..29c046fbfb40 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index e074fe7da9fd..b48b478ac2a6 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 8d784f7b9569..a32e5af9c930 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index dd32b8947edd..82456a831765 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 0ab21dae8f12..8f45368f7993 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 056528877ae9..70e9c4668b94 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 763cfdfe4a84..ec70b8729c4d 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 5496022f49ce..f478e5cdf2b6 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index a2d77c15c1ae..dc63578d1f99 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 6e54d5a2edd5..a257c968c7ad 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 55b1fe75c7e1..3e6a933925da 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 59a4eb4ac9ec..df907b82c1c2 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 568c6a5a1d3e..e235c7109f57 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index f5b33e013a37..e3b9f183dee6 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 22d7d5979339..4da96ddc2b51 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 533db7aa215f..7875d802d08a 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 4ef01b30324d..28c3916082c0 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 482032e16ec8..4a742b1b352a 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 2d8c823d5080..6a30c1135cef 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,7 +30,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 32eb5f7f7c53..6b15baa52048 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 5f8830fe4d21..d73c0212a802 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index af8a230a01a8..7e29ec588fe1 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index ebba81d4d2ea..cc73bf210473 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 12b5af1b35cc..671ade2334fd 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 0030c292c881..d73f9f84c640 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 550f5d18b790..e7abd7fd95f9 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index d32b485dd551..389a01612554 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 1ea6fd411e47..33fe2cbf7425 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,7 +17,7 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 5b54f14c51c0..d8d2f064220c 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.0.0", path = "../swc_common/" } +swc_common = { version = "11.0.1", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index afa42db621ae..6ca80cf1893a 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index c33708846631..c45897443d65 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 3dbc1080f099..1df5c9e55144 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index d791e95a31ed..f1ae1a30c495 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 4640a659aca6..619b9bc06583 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 50d7d87053f3..ff9467ae15dc 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 08f11e313d78..e76399574a5a 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 4e4fc9d5c271..7898a8a22240 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index 2962add05c97..7410936d1b3e 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 444227a41279..ffdf3f2976bc 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index 16e7e660eb6d..67fa139d8a25 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 19287d46b3ab..c910a7acee38 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 8d2e26416d24..fa1cf506d23c 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 7b9320450b20..c6e6a02cf08d 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index c617c262f6c9..284083c9ed22 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index 9fa4bd534051..218c8585fc7c 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.0", path = "../swc_common" } +swc_common = { version = "11.0.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index 1aabf6e566c0..b202c0652500 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.0.0", path = "../swc_common", features = [ +swc_common = { version = "11.0.1", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From 2ed934d4a1b2c85d6cc04c038aaee3e09c189e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 2 Jun 2025 07:53:15 -0700 Subject: [PATCH 030/209] fix(swc_common): Fix build (#10544) --- .changeset/famous-trainers-run.md | 6 ++++++ crates/swc_common/src/syntax_pos.rs | 10 +++------- crates/swc_common/src/syntax_pos/hygiene.rs | 8 -------- 3 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 .changeset/famous-trainers-run.md diff --git a/.changeset/famous-trainers-run.md b/.changeset/famous-trainers-run.md new file mode 100644 index 000000000000..7b49b4e26bd6 --- /dev/null +++ b/.changeset/famous-trainers-run.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +fix(swc_common): Fix build diff --git a/crates/swc_common/src/syntax_pos.rs b/crates/swc_common/src/syntax_pos.rs index 1c30ceb1c59a..b92c26c751f4 100644 --- a/crates/swc_common/src/syntax_pos.rs +++ b/crates/swc_common/src/syntax_pos.rs @@ -1,16 +1,12 @@ -#[cfg(not(feature = "parking_lot"))] -use std::sync::Mutex; use std::{ borrow::Cow, cmp, fmt, hash::{Hash, Hasher}, ops::{Add, Sub}, path::PathBuf, - sync::atomic::AtomicU32, + sync::{atomic::AtomicU32, Mutex}, }; -#[cfg(feature = "parking_lot")] -use parking_lot::Mutex; use serde::{Deserialize, Serialize}; use url::Url; @@ -130,8 +126,8 @@ impl Globals { /// Do not use this unless you know what you are doing. pub fn clone_data(&self) -> Self { Globals { - hygiene_data: Mutex::new(self.hygiene_data.lock().clone()), - marks: Mutex::new(self.marks.lock().clone()), + hygiene_data: Mutex::new(self.hygiene_data.lock().unwrap().clone()), + marks: Mutex::new(self.marks.lock().unwrap().clone()), dummy_cnt: AtomicU32::new(self.dummy_cnt.load(std::sync::atomic::Ordering::SeqCst)), } } diff --git a/crates/swc_common/src/syntax_pos/hygiene.rs b/crates/swc_common/src/syntax_pos/hygiene.rs index ed8e18b4323a..15b01ea902c2 100644 --- a/crates/swc_common/src/syntax_pos/hygiene.rs +++ b/crates/swc_common/src/syntax_pos/hygiene.rs @@ -293,10 +293,6 @@ impl HygieneData { fn with T>(f: F) -> T { GLOBALS.with(|globals| { - #[cfg(feature = "parking_lot")] - return f(&mut globals.hygiene_data.lock()); - - #[cfg(not(feature = "parking_lot"))] return f(&mut globals.hygiene_data.lock().unwrap()); }) } @@ -306,10 +302,6 @@ impl HygieneData { #[allow(unused)] pub(crate) fn with_marks) -> T>(f: F) -> T { GLOBALS.with(|globals| { - #[cfg(feature = "parking_lot")] - return f(&mut globals.marks.lock()); - - #[cfg(not(feature = "parking_lot"))] return f(&mut globals.marks.lock().unwrap()); }) } From d76fbc0bec099b62f9fd7b4c4efa87a1e1f11187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Jun 2025 07:53:33 -0700 Subject: [PATCH 031/209] chore: Publish crates with `swc_core` `v26.3.3` --- .changeset/famous-trainers-run.md | 6 ------ CHANGELOG-CORE.md | 8 ++++++++ CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 84 files changed, 98 insertions(+), 93 deletions(-) delete mode 100644 .changeset/famous-trainers-run.md diff --git a/.changeset/famous-trainers-run.md b/.changeset/famous-trainers-run.md deleted file mode 100644 index 7b49b4e26bd6..000000000000 --- a/.changeset/famous-trainers-run.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -fix(swc_common): Fix build diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index ab49636d40e8..95e25660e59d 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,6 +1,14 @@ # Changelog ## [unreleased] +### Bug Fixes + + + +- **(swc_common)** Fix build ([#10544](https://github.com/swc-project/swc/issues/10544)) ([2ed934d](https://github.com/swc-project/swc/commit/2ed934d4a1b2c85d6cc04c038aaee3e09c189e8b)) + +## [swc_core@v26.3.2] - 2025-06-02 + ### Features diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d151ae1254b..9f1b2e6a4045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ - **(react-compiler)** Fix fast check ([#10538](https://github.com/swc-project/swc/issues/10538)) ([9403ce2](https://github.com/swc-project/swc/commit/9403ce2e7372dbcd579e2710480f2ffc78d8bcca)) +- **(swc_common)** Fix build ([#10544](https://github.com/swc-project/swc/issues/10544)) ([2ed934d](https://github.com/swc-project/swc/commit/2ed934d4a1b2c85d6cc04c038aaee3e09c189e8b)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) diff --git a/Cargo.lock b/Cargo.lock index 64b672cfc954..b2639895d5a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.0.1" +version = "11.0.2" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.3.2" +version = "26.3.3" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 708f2e2ea8a2..2bdc8b7adaa1 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.0.1", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 6892a06ddbd8..18bb6a7be40c 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", features = [ +swc_common = { version = "11.0.2", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 83422f657ca4..dfda7bf3f6bc 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 1372d4fb79c7..d3cdae6d0212 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index e27cf36483b7..8db785a996ac 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 22db762472fb..1e6339a45f50 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.3.2", features = [ +swc_core = { version = "26.3.3", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index d707606058a3..7ad6ef7197a0 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.0.1" +version = "11.0.2" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index acc2a1686765..9bdfe031d2fd 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 3853221b030a..27d8deb3b225 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.3.2" +version = "26.3.3" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.0.1", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.2", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 27916ca00bd1..c2290616ef92 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index fffb8a17df09..d2931fbadaf0 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index 8fa61935b9d8..c4642edf353c 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index f204dfb0270a..4a4a50c2c823 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index b75fa099e70c..7e27cc859ed7 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 68ccebf2b0a1..0e6570371def 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 98340bd41589..715312ecd446 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index cc1a33497fb0..568f092ceabe 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index bb23c977ef06..431bf6a9f3e2 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 930917cfa928..8ccd4195602a 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 8ec3cb0cdcaf..c00fdb21cd1a 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index c04ff30568e5..a7ade1ed7ff4 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 7cc8d11c40dd..d1e2f8926ddb 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index ff6cfc9dfcd3..99ce22a81a0e 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 378d6d835b42..9a6e23589da0 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 5a3d4d0aed33..4d2eeb604eb3 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index bc98b72abe80..3eadeb4d35fd 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index e40e797cb4fd..5513d9a41095 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 0dde9bce8576..4753d96c419e 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 6f3207d43690..03e662861dbc 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 8baa7f88e6e9..6e8d8bdc0edd 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 8229b5216973..a4738a64a3eb 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 2b53606f898d..79047358d90b 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index c78877b2423d..8c2a26af2ebe 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index a1b37aeae51b..3db7fb5bf0ad 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 29c046fbfb40..8bf1d8f58bae 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index b48b478ac2a6..b68ebf9eb6c1 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index a32e5af9c930..ded1631af5c1 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 82456a831765..372d7aebf3ef 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 8f45368f7993..bf9651e8e6c1 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 70e9c4668b94..0e72c98b4b68 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index ec70b8729c4d..ea34be79977e 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index f478e5cdf2b6..7d763430fb23 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index dc63578d1f99..b91150a0efb7 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index a257c968c7ad..84802aa0fbf0 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 3e6a933925da..388bb3aae3c8 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index df907b82c1c2..21b13de6174e 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index e235c7109f57..6fa74a86927e 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index e3b9f183dee6..0719c7466ab0 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 4da96ddc2b51..57670efbf356 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 7875d802d08a..c3a33b8377cf 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 28c3916082c0..fffa9b747614 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 4a742b1b352a..9fb0a6e967f5 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 6a30c1135cef..5b3ea4000fa7 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,7 +30,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 6b15baa52048..52d88c57f16a 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index d73c0212a802..fba65fa0d5d0 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 7e29ec588fe1..81a56482479f 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index cc73bf210473..703e88b5f236 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 671ade2334fd..7c660688607f 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index d73f9f84c640..84539fc02774 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index e7abd7fd95f9..fd53e1c406c7 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 389a01612554..4c29d66b5f76 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 33fe2cbf7425..ac6b0fc83d11 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,7 +17,7 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index d8d2f064220c..e8d2f97481b3 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.0.1", path = "../swc_common/" } +swc_common = { version = "11.0.2", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 6ca80cf1893a..d98c560e1c39 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index c45897443d65..683baaec2c07 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 1df5c9e55144..63fee08c6494 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index f1ae1a30c495..eb89ef6f36fd 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 619b9bc06583..01478c665e3c 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index ff9467ae15dc..a43ea7a287a3 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index e76399574a5a..f9c8c37412a9 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 7898a8a22240..27fb91743c7c 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index 7410936d1b3e..c2bff351d3e6 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index ffdf3f2976bc..d085c298c319 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index 67fa139d8a25..bb60ae20eedd 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index c910a7acee38..22e91e4b61e8 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index fa1cf506d23c..42cfbc1c09f6 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index c6e6a02cf08d..76821194a91f 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index 284083c9ed22..859114a98d54 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index 218c8585fc7c..c62d5bc260c4 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.1", path = "../swc_common" } +swc_common = { version = "11.0.2", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index b202c0652500..6cce9029ece3 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.0.1", path = "../swc_common", features = [ +swc_common = { version = "11.0.2", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From 51507bcfa24fcdc202e5bbf255a24feb1665a395 Mon Sep 17 00:00:00 2001 From: bohan Date: Mon, 2 Jun 2025 23:17:16 +0800 Subject: [PATCH 032/209] perf(swc_common): Remove `char_indices` calls (#10541) --- .changeset/silly-humans-design.md | 6 +++++ crates/swc_common/src/input.rs | 40 ++++++++++++++++++------------- 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 .changeset/silly-humans-design.md diff --git a/.changeset/silly-humans-design.md b/.changeset/silly-humans-design.md new file mode 100644 index 000000000000..3d04271e7751 --- /dev/null +++ b/.changeset/silly-humans-design.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +perf(swc/common): rm char_indices diff --git a/crates/swc_common/src/input.rs b/crates/swc_common/src/input.rs index 32cbad246972..45cffd67397b 100644 --- a/crates/swc_common/src/input.rs +++ b/crates/swc_common/src/input.rs @@ -155,16 +155,19 @@ impl<'a> Input<'a> for StringInput<'a> { where F: FnMut(char) -> bool, { - let s = self.iter.as_str(); - let mut last = 0; - - for (i, c) in s.char_indices() { - if pred(c) { - last = i + c.len_utf8(); - } else { - break; + let last = { + let mut last = 0; + for c in self.iter.clone() { + if pred(c) { + last += c.len_utf8(); + } else { + break; + } } - } + last + }; + + let s = self.iter.as_str(); debug_assert!(last <= s.len()); let ret = unsafe { s.get_unchecked(..last) }; @@ -178,19 +181,22 @@ impl<'a> Input<'a> for StringInput<'a> { where F: FnMut(char) -> bool, { - let s = self.iter.as_str(); - let mut last = 0; - - for (i, c) in s.char_indices() { - if pred(c) { - last = i + c.len_utf8(); - break; + let last = { + let mut last = 0; + for c in self.iter.clone() { + last += c.len_utf8(); + if pred(c) { + break; + } } - } + last + }; + if last == 0 { return None; } + let s = self.iter.as_str(); debug_assert!(last <= s.len()); self.last_pos = self.last_pos + BytePos(last as _); From 1291b4a78c51512fb0c699f3409275f4065bbc0b Mon Sep 17 00:00:00 2001 From: magic-akari Date: Tue, 3 Jun 2025 01:38:56 +0800 Subject: [PATCH 033/209] fix(es/parser): Emit syntax errors for strict mode in non-module or scripts (#10545) **Related issue:** - Closes https://github.com/swc-project/swc/issues/10529 --- .changeset/selfish-zebras-matter.md | 6 ++++++ crates/swc_ecma_lexer/src/common/parser/mod.rs | 4 ++++ crates/swc_ecma_parser/tests/errors.rs | 17 ++++++++++++++++- .../tests/errors/issue-10529/input.cjs | 3 +++ .../errors/issue-10529/input.cjs.swc-stderr | 7 +++++++ .../fail/37cb7557997d4fd6.js.swc-stderr | 5 +++++ .../fail/d17d3aebb6a3cf43.js.swc-stderr | 5 +++++ 7 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .changeset/selfish-zebras-matter.md create mode 100644 crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs create mode 100644 crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs.swc-stderr diff --git a/.changeset/selfish-zebras-matter.md b/.changeset/selfish-zebras-matter.md new file mode 100644 index 000000000000..497acfbe9522 --- /dev/null +++ b/.changeset/selfish-zebras-matter.md @@ -0,0 +1,6 @@ +--- +swc_ecma_lexer: patch +swc_core: patch +--- + +fix(es/parser): Emit syntax errors for strict mode in non-module or scripts diff --git a/crates/swc_ecma_lexer/src/common/parser/mod.rs b/crates/swc_ecma_lexer/src/common/parser/mod.rs index e1421cc86e52..b822846d3461 100644 --- a/crates/swc_ecma_lexer/src/common/parser/mod.rs +++ b/crates/swc_ecma_lexer/src/common/parser/mod.rs @@ -167,6 +167,10 @@ pub trait Parser<'a>: Sized + Clone { return; } let error = crate::error::Error::new(span, error); + if self.ctx().contains(Context::Strict) { + self.input().iter().add_error(error); + return; + } self.input().iter().add_module_mode_error(error); } diff --git a/crates/swc_ecma_parser/tests/errors.rs b/crates/swc_ecma_parser/tests/errors.rs index 172172ebbf05..15bad2591cbc 100644 --- a/crates/swc_ecma_parser/tests/errors.rs +++ b/crates/swc_ecma_parser/tests/errors.rs @@ -16,6 +16,10 @@ fn parse_module(cm: Lrc, handler: &Handler, file_name: &Path) -> Resu with_parser(cm, handler, file_name, |p| p.parse_module()) } +fn parse_script(cm: Lrc, handler: &Handler, file_name: &Path) -> Result { + with_parser(cm, handler, file_name, |p| p.parse_script()) +} + fn with_parser( cm: Lrc, handler: &Handler, @@ -64,6 +68,7 @@ where } #[cfg(feature = "verify")] +#[testing::fixture("tests/errors/**/*.cjs")] #[testing::fixture("tests/errors/**/*.js")] #[testing::fixture("tests/errors/**/*.mjs")] #[testing::fixture("tests/errors/**/*.ts")] @@ -71,6 +76,11 @@ where fn error(entry: PathBuf) { let input = read_to_string(&entry).unwrap(); + let is_module = entry + .extension() + .map(|ext| ext != "cjs") + .unwrap_or_default(); + eprintln!( "\n\n========== Running error reporting test \nSource:\n{}\n", input @@ -83,7 +93,12 @@ fn error(entry: PathBuf) { } // Parse source - let _ = parse_module(cm, handler, &entry); + if is_module { + parse_module(cm.clone(), handler, &entry); + } else { + parse_script(cm.clone(), handler, &entry); + } + if !handler.has_errors() { panic!("should emit error, but parsed without error") } diff --git a/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs b/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs new file mode 100644 index 000000000000..40710009f85e --- /dev/null +++ b/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs @@ -0,0 +1,3 @@ +class A { + constructor(static) { } +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs.swc-stderr b/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs.swc-stderr new file mode 100644 index 000000000000..543056d7cb12 --- /dev/null +++ b/crates/swc_ecma_parser/tests/errors/issue-10529/input.cjs.swc-stderr @@ -0,0 +1,7 @@ + x `static` cannot be used as an identifier in strict mode + ,-[$DIR/tests/errors/issue-10529/input.cjs:2:1] + 1 | class A { + 2 | constructor(static) { } + : ^^^^^^ + 3 | } + `---- diff --git a/crates/swc_ecma_parser/tests/test262-error-references/fail/37cb7557997d4fd6.js.swc-stderr b/crates/swc_ecma_parser/tests/test262-error-references/fail/37cb7557997d4fd6.js.swc-stderr index 44b435582d73..b714083f1559 100644 --- a/crates/swc_ecma_parser/tests/test262-error-references/fail/37cb7557997d4fd6.js.swc-stderr +++ b/crates/swc_ecma_parser/tests/test262-error-references/fail/37cb7557997d4fd6.js.swc-stderr @@ -3,3 +3,8 @@ 1 | "use strict"; for (let [a = let];;) {} : ^^^^^^^^^ `---- + x `let` cannot be used as an identifier in strict mode + ,-[$DIR/tests/test262-parser/fail/37cb7557997d4fd6.js:1:1] + 1 | "use strict"; for (let [a = let];;) {} + : ^^^ + `---- diff --git a/crates/swc_ecma_parser/tests/test262-error-references/fail/d17d3aebb6a3cf43.js.swc-stderr b/crates/swc_ecma_parser/tests/test262-error-references/fail/d17d3aebb6a3cf43.js.swc-stderr index 9ce0d8d296ad..69f53972609b 100644 --- a/crates/swc_ecma_parser/tests/test262-error-references/fail/d17d3aebb6a3cf43.js.swc-stderr +++ b/crates/swc_ecma_parser/tests/test262-error-references/fail/d17d3aebb6a3cf43.js.swc-stderr @@ -3,3 +3,8 @@ 1 | "use strict"; for (let {a: b = let};;) {} : ^^^^^^^^^^^^ `---- + x `let` cannot be used as an identifier in strict mode + ,-[$DIR/tests/test262-parser/fail/d17d3aebb6a3cf43.js:1:1] + 1 | "use strict"; for (let {a: b = let};;) {} + : ^^^ + `---- From 7bae1b8404e56fc35deb6952f9978cfbf3b10bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Jun 2025 16:18:21 -0700 Subject: [PATCH 034/209] chore: Publish crates with `swc_core` `v26.3.4` --- .changeset/selfish-zebras-matter.md | 6 ----- .changeset/silly-humans-design.md | 6 ----- CHANGELOG-CORE.md | 23 +++++++++++-------- CHANGELOG.md | 15 +++++------- Cargo.lock | 6 ++--- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 4 ++-- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 4 ++-- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- .../swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 4 ++-- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 85 files changed, 111 insertions(+), 121 deletions(-) delete mode 100644 .changeset/selfish-zebras-matter.md delete mode 100644 .changeset/silly-humans-design.md diff --git a/.changeset/selfish-zebras-matter.md b/.changeset/selfish-zebras-matter.md deleted file mode 100644 index 497acfbe9522..000000000000 --- a/.changeset/selfish-zebras-matter.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_core: patch ---- - -fix(es/parser): Emit syntax errors for strict mode in non-module or scripts diff --git a/.changeset/silly-humans-design.md b/.changeset/silly-humans-design.md deleted file mode 100644 index 3d04271e7751..000000000000 --- a/.changeset/silly-humans-design.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -perf(swc/common): rm char_indices diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 95e25660e59d..0d7b3dda4f80 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,20 @@ +- **(es/parser)** Emit syntax errors for strict mode in non-module or scripts ([#10545](https://github.com/swc-project/swc/issues/10545)) ([1291b4a](https://github.com/swc-project/swc/commit/1291b4a78c51512fb0c699f3409275f4065bbc0b)) + +### Performance + + + +- **(swc_common)** Remove `char_indices` calls ([#10541](https://github.com/swc-project/swc/issues/10541)) ([51507bc](https://github.com/swc-project/swc/commit/51507bcfa24fcdc202e5bbf255a24feb1665a395)) + +## [swc_core@v26.3.3] - 2025-06-02 + +### Bug Fixes + + + - **(swc_common)** Fix build ([#10544](https://github.com/swc-project/swc/issues/10544)) ([2ed934d](https://github.com/swc-project/swc/commit/2ed934d4a1b2c85d6cc04c038aaee3e09c189e8b)) ## [swc_core@v26.3.2] - 2025-06-02 @@ -2478,15 +2492,6 @@ - **(es)** Add helpers ([#9586](https://github.com/swc-project/swc/issues/9586)) ([b94a0e1](https://github.com/swc-project/swc/commit/b94a0e1fd2b900b05c5f18d3d993a74ff9cc6e7d)) -### Performance - - - -- **(es/compat)** Reimplement constructor transform ([#9519](https://github.com/swc-project/swc/issues/9519)) ([4b85a92](https://github.com/swc-project/swc/commit/4b85a92170576f194c2b1ad3b3ec624c4839e215)) - - -- **(es/utils)** Rewrite inject_after_super ([#9496](https://github.com/swc-project/swc/issues/9496)) ([c562cfa](https://github.com/swc-project/swc/commit/c562cfa8af1163a4946ef79cb025d461c7e2e5e0)) - ### Testing diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1b2e6a4045..0d7ad49630da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ - **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) +- **(es/parser)** Emit syntax errors for strict mode in non-module or scripts ([#10545](https://github.com/swc-project/swc/issues/10545)) ([1291b4a](https://github.com/swc-project/swc/commit/1291b4a78c51512fb0c699f3409275f4065bbc0b)) + + - **(es/react-compiler)** Fix usefulness detection ([#10506](https://github.com/swc-project/swc/issues/10506)) ([41075a1](https://github.com/swc-project/swc/commit/41075a1c8776b62d7c2fc6436677d5d6b083a2f8)) @@ -58,6 +61,9 @@ - **(es/renamer)** Merge analyze/collect ([#10509](https://github.com/swc-project/swc/issues/10509)) ([7b47f66](https://github.com/swc-project/swc/commit/7b47f661dd6794f658023b649ebcdc153fe6e27c)) + +- **(swc_common)** Remove `char_indices` calls ([#10541](https://github.com/swc-project/swc/issues/10541)) ([51507bc](https://github.com/swc-project/swc/commit/51507bcfa24fcdc202e5bbf255a24feb1665a395)) + ### Refactor @@ -2085,13 +2091,4 @@ - **(es/minifier)** Fix name mangler ([#9524](https://github.com/swc-project/swc/issues/9524)) ([5fd68f9](https://github.com/swc-project/swc/commit/5fd68f9a3a9eeef0e61627a821c52ace69a89696)) -### Performance - - - -- **(es/compat)** Reimplement constructor transform ([#9519](https://github.com/swc-project/swc/issues/9519)) ([4b85a92](https://github.com/swc-project/swc/commit/4b85a92170576f194c2b1ad3b3ec624c4839e215)) - - -- **(es/utils)** Rewrite inject_after_super ([#9496](https://github.com/swc-project/swc/issues/9496)) ([c562cfa](https://github.com/swc-project/swc/commit/c562cfa8af1163a4946ef79cb025d461c7e2e5e0)) - diff --git a/Cargo.lock b/Cargo.lock index b2639895d5a5..930d74afe0cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.0.2" +version = "11.0.3" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.3.3" +version = "26.3.4" dependencies = [ "anyhow", "binding_macros", @@ -5499,7 +5499,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.3" +version = "14.0.4" dependencies = [ "arrayvec", "bitflags 2.6.0", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 2bdc8b7adaa1..bb327cabe4b6 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.0.2", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 18bb6a7be40c..d707b2136bda 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", features = [ +swc_common = { version = "11.0.3", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index dfda7bf3f6bc..0b81189456b0 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index d3cdae6d0212..fd744aba9d17 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 8db785a996ac..1df03a662917 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 1e6339a45f50..df1280237f2f 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.3.3", features = [ +swc_core = { version = "26.3.4", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 7ad6ef7197a0..afc399788e9c 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.0.2" +version = "11.0.3" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 9bdfe031d2fd..53d76a028599 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 27d8deb3b225..b59de97e45a9 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.3.3" +version = "26.3.4" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.0.2", path = "../swc_common" } +swc_common = { optional = true, version = "11.0.3", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index c2290616ef92..39d9f3510b5f 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index d2931fbadaf0..62613581d6f9 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index c4642edf353c..3c7b2f1aa689 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 4a4a50c2c823..40fd93d1e2c6 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index 7e27cc859ed7..27106b8ba6fb 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 0e6570371def..6d53e48deda0 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 715312ecd446..22a040adcefb 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 568f092ceabe..65e25c3108c5 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index 431bf6a9f3e2..bd574c84275f 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 8ccd4195602a..916f19d8f244 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index c00fdb21cd1a..ac7cdf376908 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index a7ade1ed7ff4..6355cdfe8bb5 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index d1e2f8926ddb..4d87713fe282 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 99ce22a81a0e..42598906c47a 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 9a6e23589da0..30e2f27453a8 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 4d2eeb604eb3..26c228769313 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 3eadeb4d35fd..b2d3c40b5d68 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 5513d9a41095..0365e16bf785 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 4753d96c419e..2ce4eaa529a0 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 03e662861dbc..cf26c163863a 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 6e8d8bdc0edd..65dad7b9cae7 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index a4738a64a3eb..f41e30e0a1fb 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 79047358d90b..546329c59ec5 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 8c2a26af2ebe..c948f025124a 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 3db7fb5bf0ad..c2e9d69a73d8 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.3" +version = "14.0.4" [package.metadata.docs.rs] all-features = true @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 8bf1d8f58bae..f3f8f135ff21 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index b68ebf9eb6c1..c089c5630de3 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index ded1631af5c1..d242c1284970 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 372d7aebf3ef..2bd451e40e07 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,9 +40,9 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.4", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index bf9651e8e6c1..ad3c9ca396d4 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 0e72c98b4b68..a8104332f4f9 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index ea34be79977e..2e4a31f4ac48 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 7d763430fb23..5784facf606f 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index b91150a0efb7..faeb7e266750 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 84802aa0fbf0..2bfce18cec69 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 388bb3aae3c8..49344da49a39 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 21b13de6174e..e1b602048130 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 6fa74a86927e..8553d5b45bce 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 0719c7466ab0..5b9e4014eeb0 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 57670efbf356..ea91a620debf 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index c3a33b8377cf..9739cf897fec 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index fffa9b747614..a1b66fb10178 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 9fb0a6e967f5..2dacb94bf2d6 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 5b3ea4000fa7..57f218acab52 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,7 +30,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 52d88c57f16a..b6c0dd0430ce 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index fba65fa0d5d0..ab5a9b0abc42 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 81a56482479f..db571e155c17 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 703e88b5f236..9bb70138ca3f 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 7c660688607f..c169663dd642 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 84539fc02774..435b7958e231 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index fd53e1c406c7..ad01cd90b913 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 4c29d66b5f76..a94faea41a90 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index ac6b0fc83d11..f32557f8223d 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,12 +17,12 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.3", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.4", path = "../swc_ecma_lexer" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index e8d2f97481b3..5e655495fc4c 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.0.2", path = "../swc_common/" } +swc_common = { version = "11.0.3", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index d98c560e1c39..d9c89fb76667 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index 683baaec2c07..82bf4f6b5ff4 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 63fee08c6494..465c83efbd76 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index eb89ef6f36fd..dd43e5b83535 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 01478c665e3c..149624c29c65 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index a43ea7a287a3..821a733559ea 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index f9c8c37412a9..d1ac77444889 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 27fb91743c7c..d1ad6ae41028 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index c2bff351d3e6..4197274da6a4 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index d085c298c319..336363e1dff5 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index bb60ae20eedd..cf268bfe37f6 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 22e91e4b61e8..98f1b51c3b60 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 42cfbc1c09f6..8a8b7a365aef 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 76821194a91f..405c7a6537c5 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index 859114a98d54..e4f8823598e0 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index c62d5bc260c4..c69ed6783698 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.2", path = "../swc_common" } +swc_common = { version = "11.0.3", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index 6cce9029ece3..9a4e78b8b745 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.0.2", path = "../swc_common", features = [ +swc_common = { version = "11.0.3", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From b101a87771d287b8e3bd9ae60a94b39de192718b Mon Sep 17 00:00:00 2001 From: bohan Date: Tue, 3 Jun 2025 23:44:00 +0800 Subject: [PATCH 035/209] refactor(es/lexer): Share `skip_block_comment` (#10549) This change may introduce minor regression, but I consider it acceptable. --- .changeset/fresh-insects-crash.md | 7 + crates/swc_ecma_lexer/src/common/lexer/mod.rs | 123 +++++++++++++++++- .../swc_ecma_lexer/src/common/lexer/state.rs | 2 +- .../swc_ecma_lexer/src/common/parser/pat.rs | 2 +- crates/swc_ecma_lexer/src/lexer/mod.rs | 6 - crates/swc_ecma_lexer/src/lexer/state.rs | 4 +- crates/swc_ecma_lexer/src/lexer/util.rs | 121 ----------------- crates/swc_ecma_parser/src/lexer/mod.rs | 6 - crates/swc_ecma_parser/src/lexer/state.rs | 4 +- crates/swc_ecma_parser/src/lexer/util.rs | 119 ----------------- 10 files changed, 130 insertions(+), 264 deletions(-) create mode 100644 .changeset/fresh-insects-crash.md delete mode 100644 crates/swc_ecma_lexer/src/lexer/util.rs delete mode 100644 crates/swc_ecma_parser/src/lexer/util.rs diff --git a/.changeset/fresh-insects-crash.md b/.changeset/fresh-insects-crash.md new file mode 100644 index 000000000000..00dcfee38f7c --- /dev/null +++ b/.changeset/fresh-insects-crash.md @@ -0,0 +1,7 @@ +--- +swc_ecma_lexer: patch +swc_ecma_parser: patch +swc_core: patch +--- + +refactor(ecma/lexer): common `skip_block_comment` diff --git a/crates/swc_ecma_lexer/src/common/lexer/mod.rs b/crates/swc_ecma_lexer/src/common/lexer/mod.rs index 36af1e535334..a815dfb7a288 100644 --- a/crates/swc_ecma_lexer/src/common/lexer/mod.rs +++ b/crates/swc_ecma_lexer/src/common/lexer/mod.rs @@ -1,6 +1,7 @@ use std::borrow::Cow; use char::{Char, CharExt}; +use comments_buffer::{BufferedComment, BufferedCommentKind}; use either::Either::{self, Left, Right}; use num_bigint::BigInt as BigIntValue; use num_traits::{Num as NumTrait, ToPrimitive}; @@ -9,6 +10,7 @@ use smartstring::{LazyCompact, SmartString}; use state::State; use swc_atoms::Atom; use swc_common::{ + comments::{Comment, CommentKind}, input::{Input, StringInput}, BytePos, Span, }; @@ -49,8 +51,6 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { fn atom<'b>(&self, s: impl Into>) -> swc_atoms::Atom; fn push_error(&self, error: crate::error::Error); fn buf(&self) -> std::rc::Rc>; - // TODO: invest why there has regression if implement this by trait - fn skip_block_comment(&mut self); #[inline(always)] #[allow(clippy::misnamed_getters)] @@ -198,14 +198,14 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { while idx < len { let b = *unsafe { bytes.get_unchecked(idx) }; if b == b'\r' || b == b'\n' { - self.state_mut().set_had_line_break(true); + self.state_mut().mark_had_line_break(); break; } else if b > 127 { // non-ASCII case: Check for Unicode line termination characters let s = unsafe { input_str.get_unchecked(idx..) }; if let Some(first_char) = s.chars().next() { if first_char == '\u{2028}' || first_char == '\u{2029}' { - self.state_mut().set_had_line_break(true); + self.state_mut().mark_had_line_break(); break; } idx += first_char.len_utf8() - 1; // `-1` will incrumented @@ -250,6 +250,117 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { } } + /// Expects current char to be '/' and next char to be '*'. + fn skip_block_comment(&mut self) { + let start = self.cur_pos(); + + debug_assert_eq!(self.cur(), Some('/')); + debug_assert_eq!(self.peek(), Some('*')); + + self.input_mut().bump_bytes(2); + + // jsdoc + let slice_start = self.cur_pos(); + + // Check if there's an asterisk at the beginning (JSDoc style) + let mut was_star = if self.input().is_byte(b'*') { + self.bump(); + true + } else { + false + }; + + let mut is_for_next = + self.state().had_line_break() || !self.state().can_have_trailing_comment(); + + // Optimization for finding block comment end position + let input_str = self.input().as_str(); + let bytes = input_str.as_bytes(); + let mut pos = 0; + let len = bytes.len(); + let mut should_mark_had_line_break = false; + + // Byte-based scanning for faster search + while pos < len { + let b = *unsafe { bytes.get_unchecked(pos) }; + + if was_star && b == b'/' { + if should_mark_had_line_break { + self.state_mut().mark_had_line_break(); + } + // Found comment end: "*/" + self.input_mut().bump_bytes(pos + 1); + + let end = self.cur_pos(); + + self.skip_space::(); + + // Check if this is a comment before semicolon + if !self.state().had_line_break() && self.input().is_byte(b';') { + is_for_next = false; + } + + if self.comments_buffer().is_some() { + let src = unsafe { + // Safety: We got slice_start and end from self.input so those are valid. + self.input_mut().slice(slice_start, end) + }; + let s = &src[..src.len() - 2]; + let cmt = Comment { + kind: CommentKind::Block, + span: Span::new(start, end), + text: self.atom(s), + }; + + let _ = self.input().peek(); + if is_for_next { + self.comments_buffer_mut() + .unwrap() + .push_pending_leading(cmt); + } else { + let pos = self.state().prev_hi(); + self.comments_buffer_mut().unwrap().push(BufferedComment { + kind: BufferedCommentKind::Trailing, + pos, + comment: cmt, + }); + } + } + + return; + } + + // Check for line break characters - ASCII case + if b == b'\r' || b == b'\n' { + should_mark_had_line_break = true; + } + // Check for Unicode line breaks (rare case) + else if b > 127 { + let remaining = &input_str[pos..]; + if let Some(c) = remaining.chars().next() { + if c == '\u{2028}' || c == '\u{2029}' { + should_mark_had_line_break = true; + } + // Skip multibyte characters + pos += c.len_utf8() - 1; // `-1` will incrumented below + } + } + + was_star = b == b'*'; + pos += 1; + } + + if should_mark_had_line_break { + self.state_mut().mark_had_line_break(); + } + + // If we reached here, it's an unterminated block comment + self.input_mut().bump_bytes(len); // skip remaining + let end = self.input().end_pos(); + let span = Span::new(end, end); + self.emit_error_span(span, SyntaxError::UnterminatedBlockComment) + } + /// Skip comments or whitespaces. /// /// See https://tc39.github.io/ecma262/#sec-white-space @@ -270,7 +381,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { self.input_mut().bump_bytes(offset as usize); if newline { - self.state_mut().set_had_line_break(true); + self.state_mut().mark_had_line_break(); } if LEX_COMMENTS && self.input().is_byte(b'/') { @@ -1213,7 +1324,7 @@ pub trait Lexer<'a, TokenAndSpan>: Tokens + Sized { cooked_slice_start = self.cur_pos(); } else if c.is_line_terminator() { - self.state_mut().set_had_line_break(true); + self.state_mut().mark_had_line_break(); consume_cooked!(); diff --git a/crates/swc_ecma_lexer/src/common/lexer/state.rs b/crates/swc_ecma_lexer/src/common/lexer/state.rs index cda4fd80df9e..27ceaf069114 100644 --- a/crates/swc_ecma_lexer/src/common/lexer/state.rs +++ b/crates/swc_ecma_lexer/src/common/lexer/state.rs @@ -53,7 +53,7 @@ pub trait State: Clone { fn set_is_expr_allowed(&mut self, is_expr_allowed: bool); fn set_next_regexp(&mut self, start: Option); fn had_line_break(&self) -> bool; - fn set_had_line_break(&mut self, had_line_break: bool); + fn mark_had_line_break(&mut self); fn had_line_break_before_last(&self) -> bool; fn token_contexts(&self) -> &crate::TokenContexts; fn mut_token_contexts(&mut self) -> &mut crate::TokenContexts; diff --git a/crates/swc_ecma_lexer/src/common/parser/pat.rs b/crates/swc_ecma_lexer/src/common/parser/pat.rs index aa16d1f3fa8f..e0a4248778ae 100644 --- a/crates/swc_ecma_lexer/src/common/parser/pat.rs +++ b/crates/swc_ecma_lexer/src/common/parser/pat.rs @@ -775,7 +775,7 @@ pub fn parse_unique_formal_params<'a>(p: &mut impl Parser<'a>) -> PResult>( +pub(super) fn parse_paren_items_as_params<'a, P: Parser<'a>>( p: &mut P, mut exprs: Vec, trailing_comma: Option, diff --git a/crates/swc_ecma_lexer/src/lexer/mod.rs b/crates/swc_ecma_lexer/src/lexer/mod.rs index e25abb54b2e0..4f78b3ab06ef 100644 --- a/crates/swc_ecma_lexer/src/lexer/mod.rs +++ b/crates/swc_ecma_lexer/src/lexer/mod.rs @@ -32,7 +32,6 @@ mod state; mod table; #[cfg(test)] mod tests; -pub mod util; #[derive(Clone)] pub struct Lexer<'a> { @@ -119,11 +118,6 @@ impl<'a> crate::common::lexer::Lexer<'a, TokenAndSpan> for Lexer<'a> { self.atoms.atom(s) } - #[inline(always)] - fn skip_block_comment(&mut self) { - self.skip_block_comment(); - } - #[inline(always)] fn buf(&self) -> std::rc::Rc> { self.buf.clone() diff --git a/crates/swc_ecma_lexer/src/lexer/state.rs b/crates/swc_ecma_lexer/src/lexer/state.rs index c3fc4e38fbc0..30b9f351e31d 100644 --- a/crates/swc_ecma_lexer/src/lexer/state.rs +++ b/crates/swc_ecma_lexer/src/lexer/state.rs @@ -70,8 +70,8 @@ impl common::lexer::state::State for State { } #[inline(always)] - fn set_had_line_break(&mut self, had_line_break: bool) { - self.had_line_break = had_line_break; + fn mark_had_line_break(&mut self) { + self.had_line_break = true; } #[inline(always)] diff --git a/crates/swc_ecma_lexer/src/lexer/util.rs b/crates/swc_ecma_lexer/src/lexer/util.rs deleted file mode 100644 index acbb196bf174..000000000000 --- a/crates/swc_ecma_lexer/src/lexer/util.rs +++ /dev/null @@ -1,121 +0,0 @@ -//! Ported from [babylon/util/identifier.js][] -//! -//! -//! [babylon/util/identifier.js]:https://github.com/babel/babel/blob/master/packages/babylon/src/util/identifier.js - -use swc_common::{ - comments::{Comment, CommentKind}, - input::Input, - Span, -}; - -use super::{Lexer, LexerTrait}; -use crate::{ - common::lexer::{ - comments_buffer::{BufferedComment, BufferedCommentKind}, - state::State, - }, - error::SyntaxError, -}; - -impl Lexer<'_> { - /// Expects current char to be '/' and next char to be '*'. - #[inline(never)] - pub(super) fn skip_block_comment(&mut self) { - let start = self.cur_pos(); - - debug_assert_eq!(self.cur(), Some('/')); - debug_assert_eq!(self.peek(), Some('*')); - - self.input.bump_bytes(2); - - // jsdoc - let slice_start = self.cur_pos(); - - // Check if there's an asterisk at the beginning (JSDoc style) - let mut was_star = if self.input.is_byte(b'*') { - self.bump(); - true - } else { - false - }; - - let mut is_for_next = self.state.had_line_break || !self.state.can_have_trailing_comment(); - - // Optimization for finding block comment end position - let input_str = self.input.as_str(); - let bytes = input_str.as_bytes(); - let mut pos = 0; - let len = bytes.len(); - - // Byte-based scanning for faster search - while pos < len { - let b = bytes[pos]; - - if was_star && b == b'/' { - // Found comment end: "*/" - self.input.bump_bytes(pos + 1); - - let end = self.cur_pos(); - - self.skip_space::(); - - // Check if this is a comment before semicolon - if !self.state.had_line_break && self.input.is_byte(b';') { - is_for_next = false; - } - - if let Some(comments) = self.comments_buffer.as_mut() { - let src = unsafe { - // Safety: We got slice_start and end from self.input so those are valid. - self.input.slice(slice_start, end) - }; - let s = &src[..src.len() - 2]; - let cmt = Comment { - kind: CommentKind::Block, - span: Span::new(start, end), - text: self.atoms.atom(s), - }; - - let _ = self.input.peek(); - if is_for_next { - comments.push_pending_leading(cmt); - } else { - comments.push(BufferedComment { - kind: BufferedCommentKind::Trailing, - pos: self.state.prev_hi, - comment: cmt, - }); - } - } - - return; - } - - // Check for line break characters - ASCII case - if b == b'\r' || b == b'\n' { - self.state.had_line_break = true; - } - // Check for Unicode line breaks (rare case) - else if b > 127 { - let remaining = &input_str[pos..]; - if let Some(c) = remaining.chars().next() { - if c == '\u{2028}' || c == '\u{2029}' { - self.state.had_line_break = true; - } - // Skip multibyte characters - pos += c.len_utf8() - 1; // `-1` will incrumented below - } - } - - was_star = b == b'*'; - pos += 1; - } - - // If we reached here, it's an unterminated block comment - self.input.bump_bytes(len); // skip remaining - let end = self.input.end_pos(); - let span = Span::new(end, end); - self.emit_error_span(span, SyntaxError::UnterminatedBlockComment) - } -} diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index b73146761f64..befb3ac52578 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -24,7 +24,6 @@ mod jsx; mod state; mod table; mod token; -pub mod util; pub(crate) use token::{NextTokenAndSpan, Token, TokenAndSpan, TokenValue}; @@ -115,11 +114,6 @@ impl<'a> swc_ecma_lexer::common::lexer::Lexer<'a, TokenAndSpan> for Lexer<'a> { self.atoms.atom(s) } - #[inline(always)] - fn skip_block_comment(&mut self) { - self.skip_block_comment(); - } - #[inline(always)] fn buf(&self) -> std::rc::Rc> { self.buf.clone() diff --git a/crates/swc_ecma_parser/src/lexer/state.rs b/crates/swc_ecma_parser/src/lexer/state.rs index ed66f37b1cba..5c4221026648 100644 --- a/crates/swc_ecma_parser/src/lexer/state.rs +++ b/crates/swc_ecma_parser/src/lexer/state.rs @@ -349,8 +349,8 @@ impl swc_ecma_lexer::common::lexer::state::State for State { } #[inline(always)] - fn set_had_line_break(&mut self, had_line_break: bool) { - self.had_line_break = had_line_break; + fn mark_had_line_break(&mut self) { + self.had_line_break = true; } #[inline(always)] diff --git a/crates/swc_ecma_parser/src/lexer/util.rs b/crates/swc_ecma_parser/src/lexer/util.rs deleted file mode 100644 index ef35d85dd213..000000000000 --- a/crates/swc_ecma_parser/src/lexer/util.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! Ported from [babylon/util/identifier.js][] -//! -//! -//! [babylon/util/identifier.js]:https://github.com/babel/babel/blob/master/packages/babylon/src/util/identifier.js - -use swc_common::{ - comments::{Comment, CommentKind}, - input::Input, - Span, -}; -use swc_ecma_lexer::common::lexer::{ - comments_buffer::{BufferedComment, BufferedCommentKind}, - state::State, -}; - -use super::{Lexer, LexerTrait}; -use crate::error::SyntaxError; - -impl Lexer<'_> { - /// Expects current char to be '/' and next char to be '*'. - #[inline(never)] - pub(super) fn skip_block_comment(&mut self) { - let start = self.cur_pos(); - - debug_assert_eq!(self.cur(), Some('/')); - debug_assert_eq!(self.peek(), Some('*')); - - self.input.bump_bytes(2); - - // jsdoc - let slice_start = self.cur_pos(); - - // Check if there's an asterisk at the beginning (JSDoc style) - let mut was_star = if self.input.is_byte(b'*') { - self.bump(); - true - } else { - false - }; - - let mut is_for_next = self.state.had_line_break || !self.state.can_have_trailing_comment(); - - // Optimization for finding block comment end position - let input_str = self.input.as_str(); - let bytes = input_str.as_bytes(); - let mut pos = 0; - let len = bytes.len(); - - // Byte-based scanning for faster search - while pos < len { - let b = bytes[pos]; - - if was_star && b == b'/' { - // Found comment end: "*/" - self.input.bump_bytes(pos + 1); - - let end = self.cur_pos(); - - self.skip_space::(); - - // Check if this is a comment before semicolon - if !self.state.had_line_break && self.input.is_byte(b';') { - is_for_next = false; - } - - if let Some(comments) = self.comments_buffer.as_mut() { - let src = unsafe { - // Safety: We got slice_start and end from self.input so those are valid. - self.input.slice(slice_start, end) - }; - let s = &src[..src.len() - 2]; - let cmt = Comment { - kind: CommentKind::Block, - span: Span::new(start, end), - text: self.atoms.atom(s), - }; - - let _ = self.input.peek(); - if is_for_next { - comments.push_pending_leading(cmt); - } else { - comments.push(BufferedComment { - kind: BufferedCommentKind::Trailing, - pos: self.state.prev_hi, - comment: cmt, - }); - } - } - - return; - } - - // Check for line break characters - ASCII case - if b == b'\r' || b == b'\n' { - self.state.had_line_break = true; - } - // Check for Unicode line breaks (rare case) - else if b > 127 { - let remaining = &input_str[pos..]; - if let Some(c) = remaining.chars().next() { - if c == '\u{2028}' || c == '\u{2029}' { - self.state.had_line_break = true; - } - // Skip multibyte characters - pos += c.len_utf8() - 1; // `-1` will incrumented below - } - } - - was_star = b == b'*'; - pos += 1; - } - - // If we reached here, it's an unterminated block comment - self.input.bump_bytes(len); // skip remaining - let end = self.input.end_pos(); - let span = Span::new(end, end); - self.emit_error_span(span, SyntaxError::UnterminatedBlockComment) - } -} From e554381bffa3602d7ce9ee156652cf654bac507f Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Tue, 3 Jun 2025 23:46:03 +0800 Subject: [PATCH 036/209] fix(es/minifier): Inline object of member if prop is an ident (#10548) **Description:** Currently, if there's an object ident in a member with a computed ident prop, it won't be inlined. So add this case. **Related issue:** - Closes https://github.com/swc-project/swc/issues/10532 --- .changeset/light-ties-argue.md | 6 ++++++ .../src/compress/optimize/util.rs | 1 + .../tests/fixture/issues/10532/input.js | 14 ++++++++++++++ .../tests/fixture/issues/10532/output.js | 8 ++++++++ 4 files changed, 29 insertions(+) create mode 100644 .changeset/light-ties-argue.md create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10532/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10532/output.js diff --git a/.changeset/light-ties-argue.md b/.changeset/light-ties-argue.md new file mode 100644 index 000000000000..5678b978cf02 --- /dev/null +++ b/.changeset/light-ties-argue.md @@ -0,0 +1,6 @@ +--- +swc_ecma_minifier: patch +swc_core: patch +--- + +fix(es/minifier): inline object of member if prop is an ident diff --git a/crates/swc_ecma_minifier/src/compress/optimize/util.rs b/crates/swc_ecma_minifier/src/compress/optimize/util.rs index f85b1997e6cb..137929d65d3e 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/util.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/util.rs @@ -351,6 +351,7 @@ impl VisitMut for Finalizer<'_> { let sym = match &e.prop { MemberProp::Ident(i) => &i.sym, MemberProp::Computed(e) => match &*e.expr { + Expr::Ident(ident) => &ident.sym, Expr::Lit(Lit::Str(s)) => &s.value, _ => return, }, diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10532/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/10532/input.js new file mode 100644 index 000000000000..2671872e8aa2 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10532/input.js @@ -0,0 +1,14 @@ +(function () { + function WL(t) { + var n = (console.log(), t); + Object.keys(n).forEach(function (t) { + console.log(n); + console.log(t); + console.log(n[t]); + }); + } + try { + t = { a: 1 }; + WL(t); + } catch {} +})(); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10532/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/10532/output.js new file mode 100644 index 000000000000..3f3298205dc0 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10532/output.js @@ -0,0 +1,8 @@ +try { + var t1; + t1 = t = { + a: 1 + }, console.log(), Object.keys(t1).forEach(function(t2) { + console.log(t1), console.log(t2), console.log(t1[t2]); + }); +} catch {} From 3e9728e70c77139a770717f87a9e54920e4a58c9 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Wed, 4 Jun 2025 01:11:34 +0800 Subject: [PATCH 037/209] fix(es/minifier): Add side effect check for test expr when compressing IfStmt (#10550) **Description:** The minimization result of IfStmt compressing is wrong if test exprs modifies some variables that are used in the common args of cons and alt. For example: ```js // From (a = 1) ? f(a, true) : f(a, false) // To f(a, a = 1 ? true : false) ``` **Related issue:** - Closes https://github.com/swc-project/swc/issues/10473 --- .changeset/perfect-planets-kick.md | 6 ++ .../src/compress/optimize/conditionals.rs | 35 ++++--- .../tests/fixture/issues/10473/input.js | 92 +++++++++++++++++++ .../tests/fixture/issues/10473/output.js | 49 ++++++++++ crates/swc_ecma_utils/src/lib.rs | 5 + 5 files changed, 174 insertions(+), 13 deletions(-) create mode 100644 .changeset/perfect-planets-kick.md create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10473/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/10473/output.js diff --git a/.changeset/perfect-planets-kick.md b/.changeset/perfect-planets-kick.md new file mode 100644 index 000000000000..aa34bb477fb6 --- /dev/null +++ b/.changeset/perfect-planets-kick.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_minifier: patch +--- + +fix(es/minifier): add side effect check for test expr when compressing IfStmt diff --git a/crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs b/crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs index e1bc8453dc4e..39eaa67ab73e 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/conditionals.rs @@ -381,6 +381,12 @@ impl Optimizer<'_> { match (cons, alt) { (Expr::Call(cons), Expr::Call(alt)) => { + // Test expr may change the variables that cons and alt **may use** in their + // common args. For example: + // from (a = 1) ? f(a, true) : f(a, false) + // to f(a, a = 1 ? true : false) + let side_effects_in_test = test.may_have_side_effects(self.ctx.expr_ctx); + if self.data.contains_unresolved(test) { return None; } @@ -411,24 +417,28 @@ impl Optimizer<'_> { && cons.args.iter().all(|arg| arg.spread.is_none()) && alt.args.iter().all(|arg| arg.spread.is_none()) { - let diff_count = cons - .args - .iter() - .zip(alt.args.iter()) - .filter(|(cons, alt)| !cons.eq_ignore_span(alt)) - .count(); + let mut diff_count = 0; + let mut diff_idx = None; + + for (idx, (cons, alt)) in cons.args.iter().zip(alt.args.iter()).enumerate() { + if !cons.eq_ignore_span(alt) { + diff_count += 1; + diff_idx = Some(idx); + } else { + // See the comments for `side_effects_in_test` + if side_effects_in_test && !cons.expr.is_pure(self.ctx.expr_ctx) { + return None; + } + } + } if diff_count == 1 { + let diff_idx = diff_idx.unwrap(); + report_change!( "conditionals: Merging cons and alt as only one argument differs" ); self.changed = true; - let diff_idx = cons - .args - .iter() - .zip(alt.args.iter()) - .position(|(cons, alt)| !cons.eq_ignore_span(alt)) - .unwrap(); let mut new_args = Vec::new(); @@ -446,7 +456,6 @@ impl Optimizer<'_> { .into(), }) } else { - // new_args.push(arg) } } diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10473/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/10473/input.js new file mode 100644 index 000000000000..28952a3fb55c --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10473/input.js @@ -0,0 +1,92 @@ +"use strict"; + +function _typeof(e) { + return (_typeof = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (e) { + return typeof e; + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : typeof e; + })(e); +} + +function ownKeys(t, e) { + var o, + r = Object.keys(t); + return ( + Object.getOwnPropertySymbols && + ((o = Object.getOwnPropertySymbols(t)), + e && + (o = o.filter(function (e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), + r.push.apply(r, o)), + r + ); +} + +function _objectSpread(t) { + for (var e = 1; e < arguments.length; e++) { + var o = null != arguments[e] ? arguments[e] : {}; + e % 2 + ? ownKeys(Object(o), !0).forEach(function (e) { + _defineProperty(t, e, o[e]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) + : ownKeys(Object(o)).forEach(function (e) { + Object.defineProperty( + t, + e, + Object.getOwnPropertyDescriptor(o, e) + ); + }); + } + return t; +} + +function _defineProperty(e, t, o) { + return ( + (t = _toPropertyKey(t)) in e + ? Object.defineProperty(e, t, { + value: o, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = o), + e + ); +} + +function _toPropertyKey(e) { + e = _toPrimitive(e, "string"); + return "symbol" == _typeof(e) ? e : e + ""; +} + +function _toPrimitive(e, t) { + if ("object" != _typeof(e) || !e) return e; + var o = e[Symbol.toPrimitive]; + if (void 0 === o) return ("string" === t ? String : Number)(e); + o = o.call(e, t || "default"); + if ("object" != _typeof(o)) return o; + throw new TypeError("@@toPrimitive must return a primitive value."); +} + +var cmConfig = (cmConfig = { + isToutiao: "Toutiao" === Math.random(), + appid: "xxx", + version: "5.8.20", + }).isToutiao + ? _objectSpread(_objectSpread({}, cmConfig), { name: "toutiao" }) + : _objectSpread(_objectSpread({}, cmConfig), { name: "douyin" }), + // config should equal { ...cmConfig, ...douyin } + config = (exports.config = cmConfig); + +console.log(config); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10473/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/10473/output.js new file mode 100644 index 000000000000..2fc970d2e611 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/10473/output.js @@ -0,0 +1,49 @@ +"use strict"; +function _typeof(e) { + return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { + return typeof e; + } : function(e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; + })(e); +} +function ownKeys(t, e) { + var o, r = Object.keys(t); + return Object.getOwnPropertySymbols && (o = Object.getOwnPropertySymbols(t), e && (o = o.filter(function(e) { + return Object.getOwnPropertyDescriptor(t, e).enumerable; + })), r.push.apply(r, o)), r; +} +function _objectSpread(t) { + for(var e = 1; e < arguments.length; e++){ + var o = null != arguments[e] ? arguments[e] : {}; + e % 2 ? ownKeys(Object(o), !0).forEach(function(e) { + !function(e, t, o) { + var e1; + (e1 = function(e, t) { + if ("object" != _typeof(e) || !e) return e; + var o = e[Symbol.toPrimitive]; + if (void 0 === o) return ("string" === t ? String : Number)(e); + if (o = o.call(e, t || "default"), "object" != _typeof(o)) return o; + throw TypeError("@@toPrimitive must return a primitive value."); + }(e1 = t, "string"), (t = "symbol" == _typeof(e1) ? e1 : e1 + "") in e) ? Object.defineProperty(e, t, { + value: o, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[t] = o; + }(t, e, o[e]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function(e) { + Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(o, e)); + }); + } + return t; +} +var cmConfig = (cmConfig = { + isToutiao: "Toutiao" === Math.random(), + appid: "xxx", + version: "5.8.20" +}).isToutiao ? _objectSpread(_objectSpread({}, cmConfig), { + name: "toutiao" +}) : _objectSpread(_objectSpread({}, cmConfig), { + name: "douyin" +}); +console.log(exports.config = cmConfig); diff --git a/crates/swc_ecma_utils/src/lib.rs b/crates/swc_ecma_utils/src/lib.rs index 88ba9f14f306..315a1cfb09cd 100644 --- a/crates/swc_ecma_utils/src/lib.rs +++ b/crates/swc_ecma_utils/src/lib.rs @@ -721,6 +721,11 @@ pub trait ExprExt { is_one_of_global_ref_to(self.as_expr(), ctx, ids) } + #[inline(always)] + fn is_pure(&self, ctx: ExprCtx) -> bool { + self.as_pure_bool(ctx).is_known() + } + /// Get bool value of `self` if it does not have any side effects. #[inline(always)] fn as_pure_bool(&self, ctx: ExprCtx) -> BoolValue { From 963ac9efb23d4613932bcb6a29b94b9ac5d13860 Mon Sep 17 00:00:00 2001 From: bohan Date: Wed, 4 Jun 2025 22:32:36 +0800 Subject: [PATCH 038/209] refactor(es/parser): Cleanup (#10559) --- .changeset/six-pillows-brake.md | 7 ++++++ .../swc_ecma_lexer/src/common/parser/expr.rs | 24 +++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .changeset/six-pillows-brake.md diff --git a/.changeset/six-pillows-brake.md b/.changeset/six-pillows-brake.md new file mode 100644 index 000000000000..a415a8ef255d --- /dev/null +++ b/.changeset/six-pillows-brake.md @@ -0,0 +1,7 @@ +--- +swc_ecma_lexer: patch +swc_ecma_parser: patch +swc_core: patch +--- + +refactor(ecma/parser): cleanup diff --git a/crates/swc_ecma_lexer/src/common/parser/expr.rs b/crates/swc_ecma_lexer/src/common/parser/expr.rs index c9a44fc09fb7..c98f1f88612b 100644 --- a/crates/swc_ecma_lexer/src/common/parser/expr.rs +++ b/crates/swc_ecma_lexer/src/common/parser/expr.rs @@ -1530,10 +1530,9 @@ pub(super) fn parse_unary_expr<'a, P: Parser<'a>>(p: &mut P) -> PResult>(p: &mut P) -> PResult {} - Expr::OptChain(OptChainExpr { base, .. }) - if matches!(&**base, OptChainBase::Member(..)) => {} - - expr => { - p.emit_err(expr.span(), SyntaxError::TS2703); + if p.input().syntax().typescript() { + match arg.unwrap_parens() { + Expr::Member(..) => {} + Expr::OptChain(OptChainExpr { base, .. }) + if matches!(&**base, OptChainBase::Member(..)) => {} + + expr => { + p.emit_err(expr.span(), SyntaxError::TS2703); + } } } } From a303941a36a59db19fe376b7601378fdc3830212 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Wed, 4 Jun 2025 09:35:49 -0500 Subject: [PATCH 039/209] fix(es/minifier): Fix typo in an option name (#10554) **Description:** Fix `wrap_iife` typo (`warp_iife`) https://terser.org/docs/options/#format-options --- .changeset/breezy-cherries-hear.md | 6 ++++++ crates/swc_ecma_minifier/src/js.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/breezy-cherries-hear.md diff --git a/.changeset/breezy-cherries-hear.md b/.changeset/breezy-cherries-hear.md new file mode 100644 index 000000000000..8c330ea82226 --- /dev/null +++ b/.changeset/breezy-cherries-hear.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_minifier: patch +--- + +Fix wrap_iife typo diff --git a/crates/swc_ecma_minifier/src/js.rs b/crates/swc_ecma_minifier/src/js.rs index 735a78abbe04..5bd006ffc9fc 100644 --- a/crates/swc_ecma_minifier/src/js.rs +++ b/crates/swc_ecma_minifier/src/js.rs @@ -186,7 +186,7 @@ pub struct JsMinifyFormatOptions { pub webkit: bool, /// Not implemented yet. - #[serde(default, alias = "warp_iife")] + #[serde(default, alias = "wrap_iife")] pub wrap_iife: bool, /// Not implemented yet. From 71224c365335e970f6dd12a47b4524da6d861bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 4 Jun 2025 07:39:01 -0700 Subject: [PATCH 040/209] feat(swc_common): Add `map_raw_pos` to `Files` (#10560) **Description:** To make multi-file source map generation practically usable, we also need this change. --- .changeset/big-knives-flow.md | 6 ++++++ crates/swc_common/src/source_map.rs | 23 ++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .changeset/big-knives-flow.md diff --git a/.changeset/big-knives-flow.md b/.changeset/big-knives-flow.md new file mode 100644 index 000000000000..2f1f26ab1707 --- /dev/null +++ b/.changeset/big-knives-flow.md @@ -0,0 +1,6 @@ +--- +swc_core: minor +swc_common: minor +--- + +feat(swc_common): Add `map_raw_pos` to `Files` diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 999c400410a2..05bdab3e0a3d 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1235,8 +1235,21 @@ fn calc_utf16_offset(file: &SourceFile, bpos: BytePos, state: &mut ByteToCharPos } pub trait Files { - fn try_lookup_source_file(&self, pos: BytePos) - -> Result, SourceMapLookupError>; + /// This function is called to change the [BytePos] in AST into an unmapped, + /// real value. + /// + /// By default, it returns the raw value because by default, the AST stores + /// original values. + fn map_raw_pos(&self, raw_pos: BytePos) -> BytePos { + raw_pos + } + + /// `raw_pos` is the [BytePos] in the AST. It's the raw value passed to + /// the source map generator. + fn try_lookup_source_file( + &self, + raw_pos: BytePos, + ) -> Result, SourceMapLookupError>; } impl Files for SourceMap { @@ -1271,8 +1284,8 @@ pub fn build_source_map( let mut ch_state = ByteToCharPosState::default(); let mut line_state = ByteToCharPosState::default(); - for (pos, lc) in mappings.iter() { - let pos = *pos; + for (orig_pos, lc) in mappings.iter() { + let pos = files.map_raw_pos(*orig_pos); if pos.is_reserved_for_comments() { continue; @@ -1295,7 +1308,7 @@ pub fn build_source_map( let f = match cur_file { Some(ref f) if f.start_pos <= pos && pos < f.end_pos => f, _ => { - f = files.try_lookup_source_file(pos).unwrap(); + f = files.try_lookup_source_file(*orig_pos).unwrap(); if config.skip(&f.name) { continue; } From 340bf16507ba261d4a2952193b5cd9b961a4da3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 07:39:22 -0700 Subject: [PATCH 041/209] chore: Publish crates with `swc_core` `v26.4.0` --- .changeset/big-knives-flow.md | 6 ---- .changeset/breezy-cherries-hear.md | 6 ---- .changeset/fresh-insects-crash.md | 7 ---- .changeset/light-ties-argue.md | 6 ---- .changeset/perfect-planets-kick.md | 6 ---- .changeset/six-pillows-brake.md | 7 ---- CHANGELOG-CORE.md | 32 +++++++++++++++++-- CHANGELOG.md | 26 ++++++++++----- Cargo.lock | 10 +++--- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 6 ++-- crates/jsdoc/Cargo.toml | 4 +-- crates/swc/Cargo.toml | 6 ++-- crates/swc_bundler/Cargo.toml | 6 ++-- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 6 ++-- crates/swc_core/Cargo.toml | 8 ++--- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 +-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 6 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 4 +-- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2016/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2017/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2018/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2019/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2020/Cargo.toml | 4 +-- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 4 +-- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 4 +-- crates/swc_ecma_lints/Cargo.toml | 4 +-- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 6 ++-- crates/swc_ecma_parser/Cargo.toml | 6 ++-- crates/swc_ecma_preset_env/Cargo.toml | 4 +-- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 4 +-- crates/swc_ecma_react_compiler/Cargo.toml | 4 +-- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 4 +-- crates/swc_ecma_transforms_base/Cargo.toml | 4 +-- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 4 +-- crates/swc_ecma_transforms_module/Cargo.toml | 4 +-- .../Cargo.toml | 4 +-- .../swc_ecma_transforms_proposal/Cargo.toml | 4 +-- crates/swc_ecma_transforms_react/Cargo.toml | 4 +-- crates/swc_ecma_transforms_testing/Cargo.toml | 4 +-- .../swc_ecma_transforms_typescript/Cargo.toml | 4 +-- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 4 +-- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 4 +-- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 6 ++-- crates/swc_fast_ts_strip/Cargo.toml | 4 +-- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 +-- crates/swc_html_minifier/Cargo.toml | 6 ++-- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 4 +-- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 4 +-- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 4 +-- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 +-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 90 files changed, 186 insertions(+), 188 deletions(-) delete mode 100644 .changeset/big-knives-flow.md delete mode 100644 .changeset/breezy-cherries-hear.md delete mode 100644 .changeset/fresh-insects-crash.md delete mode 100644 .changeset/light-ties-argue.md delete mode 100644 .changeset/perfect-planets-kick.md delete mode 100644 .changeset/six-pillows-brake.md diff --git a/.changeset/big-knives-flow.md b/.changeset/big-knives-flow.md deleted file mode 100644 index 2f1f26ab1707..000000000000 --- a/.changeset/big-knives-flow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: minor -swc_common: minor ---- - -feat(swc_common): Add `map_raw_pos` to `Files` diff --git a/.changeset/breezy-cherries-hear.md b/.changeset/breezy-cherries-hear.md deleted file mode 100644 index 8c330ea82226..000000000000 --- a/.changeset/breezy-cherries-hear.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_minifier: patch ---- - -Fix wrap_iife typo diff --git a/.changeset/fresh-insects-crash.md b/.changeset/fresh-insects-crash.md deleted file mode 100644 index 00dcfee38f7c..000000000000 --- a/.changeset/fresh-insects-crash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_ecma_parser: patch -swc_core: patch ---- - -refactor(ecma/lexer): common `skip_block_comment` diff --git a/.changeset/light-ties-argue.md b/.changeset/light-ties-argue.md deleted file mode 100644 index 5678b978cf02..000000000000 --- a/.changeset/light-ties-argue.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_minifier: patch -swc_core: patch ---- - -fix(es/minifier): inline object of member if prop is an ident diff --git a/.changeset/perfect-planets-kick.md b/.changeset/perfect-planets-kick.md deleted file mode 100644 index aa34bb477fb6..000000000000 --- a/.changeset/perfect-planets-kick.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_minifier: patch ---- - -fix(es/minifier): add side effect check for test expr when compressing IfStmt diff --git a/.changeset/six-pillows-brake.md b/.changeset/six-pillows-brake.md deleted file mode 100644 index a415a8ef255d..000000000000 --- a/.changeset/six-pillows-brake.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_ecma_parser: patch -swc_core: patch ---- - -refactor(ecma/parser): cleanup diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 0d7b3dda4f80..671d88e3097d 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,35 @@ +- **(es/minifier)** Inline object of member if prop is an ident ([#10548](https://github.com/swc-project/swc/issues/10548)) ([e554381](https://github.com/swc-project/swc/commit/e554381bffa3602d7ce9ee156652cf654bac507f)) + + +- **(es/minifier)** Add side effect check for test expr when compressing IfStmt ([#10550](https://github.com/swc-project/swc/issues/10550)) ([3e9728e](https://github.com/swc-project/swc/commit/3e9728e70c77139a770717f87a9e54920e4a58c9)) + + +- **(es/minifier)** Fix typo in an option name ([#10554](https://github.com/swc-project/swc/issues/10554)) ([a303941](https://github.com/swc-project/swc/commit/a303941a36a59db19fe376b7601378fdc3830212)) + +### Features + + + +- **(swc_common)** Add `map_raw_pos` to `Files` ([#10560](https://github.com/swc-project/swc/issues/10560)) ([71224c3](https://github.com/swc-project/swc/commit/71224c365335e970f6dd12a47b4524da6d861bb3)) + +### Refactor + + + +- **(es/lexer)** Share `skip_block_comment` ([#10549](https://github.com/swc-project/swc/issues/10549)) ([b101a87](https://github.com/swc-project/swc/commit/b101a87771d287b8e3bd9ae60a94b39de192718b)) + + +- **(es/parser)** Cleanup ([#10559](https://github.com/swc-project/swc/issues/10559)) ([963ac9e](https://github.com/swc-project/swc/commit/963ac9efb23d4613932bcb6a29b94b9ac5d13860)) + +## [swc_core@v26.3.4] - 2025-06-02 + +### Bug Fixes + + + - **(es/parser)** Emit syntax errors for strict mode in non-module or scripts ([#10545](https://github.com/swc-project/swc/issues/10545)) ([1291b4a](https://github.com/swc-project/swc/commit/1291b4a78c51512fb0c699f3409275f4065bbc0b)) ### Performance @@ -2445,9 +2474,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Fix name mangler ([#9524](https://github.com/swc-project/swc/issues/9524)) ([5fd68f9](https://github.com/swc-project/swc/commit/5fd68f9a3a9eeef0e61627a821c52ace69a89696)) - - - **(es/minifier)** `typeof` class should be `function` ([#9522](https://github.com/swc-project/swc/issues/9522)) ([c7fdd6b](https://github.com/swc-project/swc/commit/c7fdd6b69b129a11465125d4e11a898326b7e884)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d7ad49630da..1fc594c9bedc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ - **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) +- **(es/minifier)** Inline object of member if prop is an ident ([#10548](https://github.com/swc-project/swc/issues/10548)) ([e554381](https://github.com/swc-project/swc/commit/e554381bffa3602d7ce9ee156652cf654bac507f)) + + +- **(es/minifier)** Add side effect check for test expr when compressing IfStmt ([#10550](https://github.com/swc-project/swc/issues/10550)) ([3e9728e](https://github.com/swc-project/swc/commit/3e9728e70c77139a770717f87a9e54920e4a58c9)) + + +- **(es/minifier)** Fix typo in an option name ([#10554](https://github.com/swc-project/swc/issues/10554)) ([a303941](https://github.com/swc-project/swc/commit/a303941a36a59db19fe376b7601378fdc3830212)) + + - **(es/parser)** Emit syntax errors for strict mode in non-module or scripts ([#10545](https://github.com/swc-project/swc/issues/10545)) ([1291b4a](https://github.com/swc-project/swc/commit/1291b4a78c51512fb0c699f3409275f4065bbc0b)) @@ -40,6 +49,9 @@ - **(swc_common)** Add `Globals::clone_data` ([#10543](https://github.com/swc-project/swc/issues/10543)) ([39f30b0](https://github.com/swc-project/swc/commit/39f30b066fe4d91f8df641fe59aba86acb10d645)) + +- **(swc_common)** Add `map_raw_pos` to `Files` ([#10560](https://github.com/swc-project/swc/issues/10560)) ([71224c3](https://github.com/swc-project/swc/commit/71224c365335e970f6dd12a47b4524da6d861bb3)) + ### Miscellaneous Tasks @@ -74,9 +86,15 @@ - **(es/lexer)** Cleanup code for reading tokens ([#10533](https://github.com/swc-project/swc/issues/10533)) ([a72092c](https://github.com/swc-project/swc/commit/a72092c13166fe80d494e49cf0c5ec04e93ee4eb)) +- **(es/lexer)** Share `skip_block_comment` ([#10549](https://github.com/swc-project/swc/issues/10549)) ([b101a87](https://github.com/swc-project/swc/commit/b101a87771d287b8e3bd9ae60a94b39de192718b)) + + - **(es/parser)** Share code for parsing strings ([#10522](https://github.com/swc-project/swc/issues/10522)) ([931a2d6](https://github.com/swc-project/swc/commit/931a2d6761bfec72cdda7eb875ad02dc217848b9)) +- **(es/parser)** Cleanup ([#10559](https://github.com/swc-project/swc/issues/10559)) ([963ac9e](https://github.com/swc-project/swc/commit/963ac9efb23d4613932bcb6a29b94b9ac5d13860)) + + - **(ts/fast-dts)** Derive computed flags from source code ([#10510](https://github.com/swc-project/swc/issues/10510)) ([a2d5664](https://github.com/swc-project/swc/commit/a2d56645cbf753770a2634e23423a59acaae6b84)) ## [1.11.29] - 2025-05-21 @@ -2083,12 +2101,4 @@ - **(es/typescript)** Handle enum in single statement ([#9532](https://github.com/swc-project/swc/issues/9532)) ([84b0043](https://github.com/swc-project/swc/commit/84b004387ba8f4135659e1d1f54e59bf1941a57a)) -## [1.7.23] - 2024-09-02 - -### Bug Fixes - - - -- **(es/minifier)** Fix name mangler ([#9524](https://github.com/swc-project/swc/issues/9524)) ([5fd68f9](https://github.com/swc-project/swc/commit/5fd68f9a3a9eeef0e61627a821c52ace69a89696)) - diff --git a/Cargo.lock b/Cargo.lock index 930d74afe0cf..c90d3919fd3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.0.3" +version = "11.1.0" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.3.4" +version = "26.4.0" dependencies = [ "anyhow", "binding_macros", @@ -5499,7 +5499,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.4" +version = "14.0.5" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -5581,7 +5581,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.3" +version = "20.0.4" dependencies = [ "ansi_term", "anyhow", @@ -5629,7 +5629,7 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "14.0.1" +version = "14.0.2" dependencies = [ "arrayvec", "bitflags 2.6.0", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index bb327cabe4b6..39c34f2d7106 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.0.3", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index d707b2136bda..3488b02c7291 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,16 +27,16 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", features = [ +swc_common = { version = "11.1.0", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ "concurrent", ] } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 0b81189456b0..8908cd5e8f50 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,12 +20,12 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } dashmap = { workspace = true } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index fd744aba9d17..49381587ef57 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } @@ -88,8 +88,8 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 1df03a662917..dabe7ef4f3c4 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,11 +39,11 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index df1280237f2f..81eb11c272d8 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.3.4", features = [ +swc_core = { version = "26.4.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index afc399788e9c..4cca9e0ca77f 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.0.3" +version = "11.1.0" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 53d76a028599..b96fec99e7bd 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,14 +24,14 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index b59de97e45a9..f0ad563f22c5 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.3.4" +version = "26.4.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.0.3", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.0", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } @@ -368,8 +368,8 @@ swc_ecma_ast = { optional = true, version = "11.0.0", path = swc_ecma_codegen = { optional = true, version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.3", path = "../swc_ecma_minifier" } -swc_ecma_parser = { optional = true, version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_minifier = { optional = true, version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_parser = { optional = true, version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } swc_ecma_react_compiler = { optional = true, version = "4.0.2", path = "../swc_ecma_react_compiler" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 39d9f3510b5f..7e7f7624ef0f 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index 62613581d6f9..aeb1f943fa14 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index 3c7b2f1aa689..0d062564b327 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 40fd93d1e2c6..435ddad8409c 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index 27106b8ba6fb..39ac650c65e2 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 6d53e48deda0..3e332fe156c5 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 22a040adcefb..1336a26c26de 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 65e25c3108c5..16784bb780e7 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index bd574c84275f..0c4e3e12cc57 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 916f19d8f244..d0908b092f63 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index ac7cdf376908..59078abc3b00 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 6355cdfe8bb5..7fa65767ac4b 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,10 +44,10 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 4d87713fe282..a23ef46da7d3 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } @@ -24,5 +24,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 42598906c47a..690a9b4ccfab 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 30e2f27453a8..744a9e4c7940 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } @@ -36,5 +36,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 26c228769313..8ea8c7513f47 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } @@ -24,5 +24,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index b2d3c40b5d68..d65a250d175f 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } @@ -26,5 +26,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 0365e16bf785..ab7ca0faf11e 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } @@ -27,5 +27,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 2ce4eaa529a0..28aa952ac392 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } @@ -25,5 +25,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index cf26c163863a..d2067b62816b 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } @@ -25,5 +25,5 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 65dad7b9cae7..6014dd38fe77 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index f41e30e0a1fb..1a8696cff0a3 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 546329c59ec5..1a2d41244313 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } @@ -23,5 +23,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index c948f025124a..0198e73c28ec 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index c2e9d69a73d8..c9e3e8bfe197 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.4" +version = "14.0.5" [package.metadata.docs.rs] all-features = true @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index f3f8f135ff21..4fa7679994ff 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } @@ -38,7 +38,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index c089c5630de3..e2920af188e0 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index d242c1284970..2b53c0509996 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.3" +version = "20.0.4" [package.metadata.docs.rs] all-features = true @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", @@ -63,7 +63,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 2bd451e40e07..30d619cdf395 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_parser" repository = { workspace = true } -version = "14.0.1" +version = "14.0.2" [package.metadata.docs.rs] all-features = true @@ -40,9 +40,9 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.4", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index ad3c9ca396d4..a010896a645a 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", @@ -45,7 +45,7 @@ criterion = { workspace = true } pretty_assertions = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } [[bench]] diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index a8104332f4f9..14b70d33c099 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 2e4a31f4ac48..a16d1ad96691 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 5784facf606f..44f6c5cab90f 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,10 +14,10 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.0", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index faeb7e266750..32c89b6c0275 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 2bfce18cec69..91bb679f01d7 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 49344da49a39..ca842752d688 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index e1b602048130..17935057b010 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } @@ -56,6 +56,6 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 8553d5b45bce..20a3b3ce7417 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,9 +30,9 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 5b9e4014eeb0..fd369bc24266 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index ea91a620debf..952876a90b74 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } @@ -56,6 +56,6 @@ swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } par-core = { workspace = true, features = ["chili"] } serde_json = { workspace = true } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 9739cf897fec..18ef36c7dbeb 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } @@ -34,7 +34,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ "node", ] } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index a1b66fb10178..31e46e32b78d 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,9 +33,9 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 2dacb94bf2d6..9e7c56c03fbf 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } @@ -36,7 +36,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } serde_json = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 57f218acab52..662899c609f9 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,10 +30,10 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index b6c0dd0430ce..86ef68a74019 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,12 +23,12 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index ab5a9b0abc42..2d031b47b90d 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } @@ -34,7 +34,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index db571e155c17..079feda103ad 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 9bb70138ca3f..14a3af64690d 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } @@ -41,5 +41,5 @@ stacker = { version = "0.1.15", optional = true } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index c169663dd642..42b5dacf0470 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 94d2f23fb1b5..f2b9f227cbc0 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,8 +40,8 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", optional = true } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser", optional = true, default-features = false } +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", optional = true } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", optional = true } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 435b7958e231..5a460360e7a4 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index ad01cd90b913..2eb6e186c247 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index a94faea41a90..512906941348 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,12 +25,12 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_estree_ast = { version = "11.0.0", path = "../swc_estree_ast" } @@ -43,7 +43,7 @@ pretty_assertions = { workspace = true } swc = { version = "25.0.0", path = "../swc" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms/" } testing = { version = "12.0.0", path = "../testing" } walkdir = { workspace = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index f32557f8223d..7ff4c3090945 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,12 +17,12 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.4", path = "../swc_ecma_lexer" } +swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 5e655495fc4c..1b9611e1ae00 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.0.3", path = "../swc_common/" } +swc_common = { version = "11.1.0", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index d9c89fb76667..055294cb7220 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index 82bf4f6b5ff4..3ded898ed2f8 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 465c83efbd76..e959dd2bf7a3 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } @@ -42,10 +42,10 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.3", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index dd43e5b83535..013244692675 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 149624c29c65..0b69dd242217 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 821a733559ea..ed8d4f9d7d97 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index d1ac77444889..c09093847a1c 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,13 +35,13 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index d1ad6ae41028..c63120ce5547 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index 4197274da6a4..dec9d079dbe6 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 336363e1dff5..e91b8b2cc79c 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } @@ -89,7 +89,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "rkyv-impl", ] } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index cf268bfe37f6..ec971346ad1d 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 98f1b51c3b60..451b4fcc86f4 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } @@ -23,6 +23,6 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.1", path = "../swc_ecma_parser" } +swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 8a8b7a365aef..57e01fb76266 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 405c7a6537c5..ecda237bda2c 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index e4f8823598e0..f9fcb2298d3a 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index c69ed6783698..b050d8ba4065 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.0.3", path = "../swc_common" } +swc_common = { version = "11.1.0", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index 9a4e78b8b745..60bd278e3082 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.0.3", path = "../swc_common", features = [ +swc_common = { version = "11.1.0", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From 6ee69741058100643b0c879edc2f5e3ae4896f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 07:57:00 -0700 Subject: [PATCH 042/209] chore: Publish crates with `swc_core` `v26.4.1` --- CHANGELOG-CORE.md | 2 +- Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 4 ++-- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 4 ++-- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- 40 files changed, 48 insertions(+), 48 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 671d88e3097d..f6b90b317723 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [swc_core@v26.4.0] - 2025-06-04 ### Bug Fixes diff --git a/Cargo.lock b/Cargo.lock index c90d3919fd3f..700d9237909f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.0" +version = "26.4.1" dependencies = [ "anyhow", "binding_macros", @@ -5581,7 +5581,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.4" +version = "20.0.5" dependencies = [ "ansi_term", "anyhow", @@ -6086,7 +6086,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.1" +version = "15.0.2" dependencies = [ "indexmap 2.7.1", "num_cpus", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 3488b02c7291..95828b53ecad 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -33,7 +33,7 @@ swc_common = { version = "11.1.0", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 49381587ef57..aa9937668ad5 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -88,7 +88,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ @@ -102,7 +102,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } swc_node_comments = { version = "11.0.0", path = "../swc_node_comments" } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index dabe7ef4f3c4..83c35a2171b4 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -46,7 +46,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loa swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_graph_analyzer = { version = "12.0.0", path = "../swc_graph_analyzer/" } @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 81eb11c272d8..aade4387933d 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.0", features = [ +swc_core = { version = "26.4.1", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index b96fec99e7bd..2053dae8b81b 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -30,7 +30,7 @@ swc_common = { version = "11.1.0", path = "../swc_common", features = [ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index f0ad563f22c5..319dcc897629 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.0" +version = "26.4.1" [package.metadata.docs.rs] features = [ "allocator_node", @@ -368,7 +368,7 @@ swc_ecma_ast = { optional = true, version = "11.0.0", path = swc_ecma_codegen = { optional = true, version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.4", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "20.0.5", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } @@ -382,7 +382,7 @@ swc_ecma_transforms_react = { optional = true, version = "17.0.0", path = swc_ecma_transforms_testing = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_testing" } swc_ecma_transforms_typescript = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_usage_analyzer = { optional = true, version = "16.0.1", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { optional = true, version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { optional = true, version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "1.2.3", path = "../swc_malloc" } swc_node_bundler = { optional = true, version = "26.0.0", path = "../swc_node_bundler" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index a23ef46da7d3..609a3adec4f4 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -19,7 +19,7 @@ swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 690a9b4ccfab..49fdad097cef 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -14,6 +14,6 @@ version = "15.0.0" [dependencies] swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 744a9e4c7940..b72fca02d064 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -30,7 +30,7 @@ swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_c swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 8ea8c7513f47..cd18ab6f961d 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -18,7 +18,7 @@ swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index d65a250d175f..1cad8bb8804c 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -21,7 +21,7 @@ swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index ab7ca0faf11e..f839d9f02a9d 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -22,7 +22,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 28aa952ac392..dc573f8b8368 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -20,7 +20,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index d2067b62816b..c94488466df3 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -19,7 +19,7 @@ swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 6014dd38fe77..172e9e0c0dec 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -19,6 +19,6 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 1a8696cff0a3..d458efb5a817 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -24,6 +24,6 @@ swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_c swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 1a2d41244313..20b4b8ce0294 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 0198e73c28ec..94d3c824d9d0 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -17,5 +17,5 @@ phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 4fa7679994ff..eea05c2396fd 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -29,7 +29,7 @@ swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 2b53c0509996..d0b15267c14a 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.4" +version = "20.0.5" [package.metadata.docs.rs] all-features = true @@ -67,7 +67,7 @@ swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index a010896a645a..8599ec8706d7 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea "compat", "proposal", ] } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 17935057b010..ea36e9c42fcc 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_tra swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal", optional = true } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react", optional = true } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript", optional = true } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 20a3b3ce7417..9a33206f1639 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -33,7 +33,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index fd369bc24266..326f02f148c4 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -16,5 +16,5 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 952876a90b74..5a1ebf323527 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -48,7 +48,7 @@ swc_ecma_compat_es3 = { version = "15.0.0", path = "../swc_ecma_compat_e swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 18ef36c7dbeb..49cf1058113e 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 31e46e32b78d..c48e07ccd6ce 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -38,7 +38,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 9e7c56c03fbf..31348b416039 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -29,7 +29,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 662899c609f9..71dc192f2c8f 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 86ef68a74019..dfd18e863eee 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -31,6 +31,6 @@ swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 2d031b47b90d..90684bb81ed5 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -26,7 +26,7 @@ swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 079feda103ad..f63126b13b4b 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -31,6 +31,6 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 14a3af64690d..3be74c69ba3f 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_utils" repository = { workspace = true } -version = "15.0.1" +version = "15.0.2" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index f2b9f227cbc0..c04c410b064f 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,12 +40,12 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", optional = true } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils", optional = true } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils", optional = true } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } [dev-dependencies] diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 512906941348..8418fd0b8e37 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -31,7 +31,7 @@ swc_common = { version = "11.1.0", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_estree_ast = { version = "11.0.0", path = "../swc_estree_ast" } swc_node_comments = { version = "11.0.0", path = "../swc_node_comments/" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index e959dd2bf7a3..4a816ccf863e 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -42,7 +42,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.4", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index c09093847a1c..b7b004195c35 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -43,7 +43,7 @@ swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 451b4fcc86f4..0b55a4766f4d 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -17,7 +17,7 @@ thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.0", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.1", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } From cbee0dfa2b82ed470a387d06470e70617a6ee60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 4 Jun 2025 08:48:59 -0700 Subject: [PATCH 043/209] fix(swc_common): Fix skip condition for sourcemap (#10562) **Description:** We don't generate `BytePos(0)`, so it was not a big deal for us, but now it matters because external crates are now allowed to generate `BytePos` --- .changeset/moody-cows-sleep.md | 6 ++++++ crates/swc_common/src/source_map.rs | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/moody-cows-sleep.md diff --git a/.changeset/moody-cows-sleep.md b/.changeset/moody-cows-sleep.md new file mode 100644 index 000000000000..abeaede6e095 --- /dev/null +++ b/.changeset/moody-cows-sleep.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +fix(swc_common): Fix skip condition for sourcemap diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 05bdab3e0a3d..d41db2ce7525 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1284,8 +1284,8 @@ pub fn build_source_map( let mut ch_state = ByteToCharPosState::default(); let mut line_state = ByteToCharPosState::default(); - for (orig_pos, lc) in mappings.iter() { - let pos = files.map_raw_pos(*orig_pos); + for (raw_pos, lc) in mappings.iter() { + let pos = files.map_raw_pos(*raw_pos); if pos.is_reserved_for_comments() { continue; @@ -1293,7 +1293,7 @@ pub fn build_source_map( let lc = *lc; - // If pos is same as a DUMMY_SP (eg BytePos(0)) and if line and col are 0; + // If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0, // ignore the mapping. if lc.line == 0 && lc.col == 0 && pos.is_dummy() { continue; @@ -1308,7 +1308,7 @@ pub fn build_source_map( let f = match cur_file { Some(ref f) if f.start_pos <= pos && pos < f.end_pos => f, _ => { - f = files.try_lookup_source_file(*orig_pos).unwrap(); + f = files.try_lookup_source_file(*raw_pos).unwrap(); if config.skip(&f.name) { continue; } From a99005a4a3cef4d07475bd1e12000eec4edde624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 08:49:14 -0700 Subject: [PATCH 044/209] chore: Publish crates with `swc_core` `v26.4.2` --- .changeset/moody-cows-sleep.md | 6 ------ CHANGELOG-CORE.md | 14 ++++++++------ CHANGELOG.md | 9 +++------ Cargo.lock | 4 ++-- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 84 files changed, 98 insertions(+), 105 deletions(-) delete mode 100644 .changeset/moody-cows-sleep.md diff --git a/.changeset/moody-cows-sleep.md b/.changeset/moody-cows-sleep.md deleted file mode 100644 index abeaede6e095..000000000000 --- a/.changeset/moody-cows-sleep.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -fix(swc_common): Fix skip condition for sourcemap diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index f6b90b317723..9372eec386d6 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,4 +1,12 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(swc_common)** Fix skip condition for sourcemap ([#10562](https://github.com/swc-project/swc/issues/10562)) ([cbee0df](https://github.com/swc-project/swc/commit/cbee0dfa2b82ed470a387d06470e70617a6ee60a)) + ## [swc_core@v26.4.0] - 2025-06-04 ### Bug Fixes @@ -2474,9 +2482,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** `typeof` class should be `function` ([#9522](https://github.com/swc-project/swc/issues/9522)) ([c7fdd6b](https://github.com/swc-project/swc/commit/c7fdd6b69b129a11465125d4e11a898326b7e884)) - - - **(es/minifier)** Prevent removing side effects from accessing getter ([#9530](https://github.com/swc-project/swc/issues/9530)) ([8513816](https://github.com/swc-project/swc/commit/8513816139c6ceef12a906b03c1bcf9471ce0b07)) @@ -2495,9 +2500,6 @@ - **(es/parser)** Fix failure of TS instantiation followed by satisfies ([#9583](https://github.com/swc-project/swc/issues/9583)) ([77900d8](https://github.com/swc-project/swc/commit/77900d808e2a3be2e62b74022c88a81b26a73f86)) -- **(es/typescript)** Handle enum in single statement ([#9532](https://github.com/swc-project/swc/issues/9532)) ([84b0043](https://github.com/swc-project/swc/commit/84b004387ba8f4135659e1d1f54e59bf1941a57a)) - - - **(plugin)** Don't panic when ast byte not match ([#9562](https://github.com/swc-project/swc/issues/9562)) ([c36871a](https://github.com/swc-project/swc/commit/c36871a84826cc125c3c10a78ee2d7a435373154)) ### Features diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fc594c9bedc..fb6c0bd4ee53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ - **(swc_common)** Fix build ([#10544](https://github.com/swc-project/swc/issues/10544)) ([2ed934d](https://github.com/swc-project/swc/commit/2ed934d4a1b2c85d6cc04c038aaee3e09c189e8b)) +- **(swc_common)** Fix skip condition for sourcemap ([#10562](https://github.com/swc-project/swc/issues/10562)) ([cbee0df](https://github.com/swc-project/swc/commit/cbee0dfa2b82ed470a387d06470e70617a6ee60a)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) @@ -2093,12 +2096,6 @@ - **(es/decorator)** Add support for private access expressions in legacy decorators ([#9535](https://github.com/swc-project/swc/issues/9535)) ([62ed065](https://github.com/swc-project/swc/commit/62ed0655e6d9be2f4a5c641a969b41b8c0e7f75a)) -- **(es/minifier)** `typeof` class should be `function` ([#9522](https://github.com/swc-project/swc/issues/9522)) ([c7fdd6b](https://github.com/swc-project/swc/commit/c7fdd6b69b129a11465125d4e11a898326b7e884)) - - - **(es/minifier)** Prevent removing side effects from accessing getter ([#9530](https://github.com/swc-project/swc/issues/9530)) ([8513816](https://github.com/swc-project/swc/commit/8513816139c6ceef12a906b03c1bcf9471ce0b07)) - -- **(es/typescript)** Handle enum in single statement ([#9532](https://github.com/swc-project/swc/issues/9532)) ([84b0043](https://github.com/swc-project/swc/commit/84b004387ba8f4135659e1d1f54e59bf1941a57a)) - diff --git a/Cargo.lock b/Cargo.lock index 700d9237909f..da7ee7e3c381 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.1.0" +version = "11.1.1" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.1" +version = "26.4.2" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 39c34f2d7106..1c7bc2a4a2bb 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.1.0", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 95828b53ecad..f7f0256bf20c 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", features = [ +swc_common = { version = "11.1.1", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 8908cd5e8f50..8170f571dd8a 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index aa9937668ad5..91cda1d4a413 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 83c35a2171b4..d8b9924baed5 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index aade4387933d..40a6d4c0b75c 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.1", features = [ +swc_core = { version = "26.4.2", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 4cca9e0ca77f..a7b3fc61afb6 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.1.0" +version = "11.1.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 2053dae8b81b..2931ea475770 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 319dcc897629..6a0472b61b33 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.1" +version = "26.4.2" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.1.0", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.1", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 7e7f7624ef0f..fcebfd121cae 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index aeb1f943fa14..3f9d7201fa95 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index 0d062564b327..196723172048 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 435ddad8409c..1bf036a21f75 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index 39ac650c65e2..4eb4686c2b32 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 3e332fe156c5..2aec58b3439d 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 1336a26c26de..59480dc9c2d4 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 16784bb780e7..67bee3e693db 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index 0c4e3e12cc57..527150d23c1c 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index d0908b092f63..cf884aaa1729 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 59078abc3b00..4e3101ec31e2 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 7fa65767ac4b..977d837b8a15 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 609a3adec4f4..be6b62914816 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 49fdad097cef..0115a55cd3fe 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index b72fca02d064..6ead4d535af6 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index cd18ab6f961d..21d83d9ba6ed 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 1cad8bb8804c..3f09fac89a23 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index f839d9f02a9d..47673a27e0f5 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index dc573f8b8368..9a83ab121d16 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index c94488466df3..043ebc6087ee 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 172e9e0c0dec..8cef7d130caa 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index d458efb5a817..1899c69cdf34 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 20b4b8ce0294..be0a32a9466e 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 94d3c824d9d0..26501383aa49 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index c9e3e8bfe197..b8d354ec7f1b 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index eea05c2396fd..d9bebb89b1fb 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index e2920af188e0..9ec8955731e4 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index d0b15267c14a..0ef6808b0024 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 30d619cdf395..f101f9320121 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 8599ec8706d7..a91592d2a556 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 14b70d33c099..9ec7ffa5afe9 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index a16d1ad96691..59ea3e20a260 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 44f6c5cab90f..def5ed7c4aa6 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index 32c89b6c0275..1dd325bfb9f4 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 91bb679f01d7..53845061a6bf 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index ca842752d688..dd63b2054716 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index ea36e9c42fcc..9a03bb2ed58e 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 9a33206f1639..9d2c6b3e71a4 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 326f02f148c4..63afd85fd951 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 5a1ebf323527..ea5cf557c7d3 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 49cf1058113e..8328699b2ab3 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index c48e07ccd6ce..8e8d88b35276 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 31348b416039..029fc64f5e87 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 71dc192f2c8f..aec309467848 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,7 +30,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index dfd18e863eee..58f916d5b2dd 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 90684bb81ed5..dbc020a83780 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index f63126b13b4b..d5264cbc0008 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 3be74c69ba3f..74bb2d329bfe 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 42b5dacf0470..43681db0f04c 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 5a460360e7a4..020ee7b2db11 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 2eb6e186c247..852e8eec699a 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 8418fd0b8e37..9692a71cb936 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 7ff4c3090945..8f1c1da1696c 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,7 +17,7 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 1b9611e1ae00..2ad2b3468012 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.1.0", path = "../swc_common/" } +swc_common = { version = "11.1.1", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 055294cb7220..0d872e795b11 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index 3ded898ed2f8..dfe28362f02d 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 4a816ccf863e..514c3dc01d02 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index 013244692675..11f5419f9938 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 0b69dd242217..4b540496b7f6 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index ed8d4f9d7d97..19888410ed70 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index b7b004195c35..675125c1dbb2 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index c63120ce5547..c44fb76900aa 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index dec9d079dbe6..7253e2509810 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index e91b8b2cc79c..4aff72258245 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index ec971346ad1d..7e39f639f6ab 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 0b55a4766f4d..dddd789b460a 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 57e01fb76266..426582f9082d 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index ecda237bda2c..6f8db0e30c5f 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index f9fcb2298d3a..2179725e193b 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index b050d8ba4065..8fc2dc0ffdfc 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.0", path = "../swc_common" } +swc_common = { version = "11.1.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index 60bd278e3082..e1b0a4340670 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.1.0", path = "../swc_common", features = [ +swc_common = { version = "11.1.1", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From 14feedb55286bbd811b4dfba26501bd1127067fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 4 Jun 2025 09:06:12 -0700 Subject: [PATCH 045/209] fix(swc_common): Fix skip condition for sourcemap, really (#10563) **Description:** Cursor removed my changes on the tab in the previous PR. --- .changeset/clever-donkeys-protect.md | 6 ++++++ crates/swc_common/src/source_map.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/clever-donkeys-protect.md diff --git a/.changeset/clever-donkeys-protect.md b/.changeset/clever-donkeys-protect.md new file mode 100644 index 000000000000..2f1dba134dc8 --- /dev/null +++ b/.changeset/clever-donkeys-protect.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +fix(swc_common): Fix skip condition for sourcemap, really diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index d41db2ce7525..984b8ddfb967 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1293,9 +1293,9 @@ pub fn build_source_map( let lc = *lc; - // If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0, + // If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0; // ignore the mapping. - if lc.line == 0 && lc.col == 0 && pos.is_dummy() { + if pos.is_dummy() || (lc.line == 0 && lc.col == 0) { continue; } From 680764332d690015b35ced0a2c617f9b1e34246f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 09:06:28 -0700 Subject: [PATCH 046/209] chore: Publish crates with `swc_core` `v26.4.3` --- .changeset/clever-donkeys-protect.md | 6 ------ CHANGELOG-CORE.md | 14 ++++++++------ CHANGELOG.md | 9 +++------ Cargo.lock | 4 ++-- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 84 files changed, 98 insertions(+), 105 deletions(-) delete mode 100644 .changeset/clever-donkeys-protect.md diff --git a/.changeset/clever-donkeys-protect.md b/.changeset/clever-donkeys-protect.md deleted file mode 100644 index 2f1dba134dc8..000000000000 --- a/.changeset/clever-donkeys-protect.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -fix(swc_common): Fix skip condition for sourcemap, really diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 9372eec386d6..73b77574fbed 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,14 @@ +- **(swc_common)** Fix skip condition for sourcemap, really ([#10563](https://github.com/swc-project/swc/issues/10563)) ([14feedb](https://github.com/swc-project/swc/commit/14feedb55286bbd811b4dfba26501bd1127067fe)) + +## [swc_core@v26.4.2] - 2025-06-04 + +### Bug Fixes + + + - **(swc_common)** Fix skip condition for sourcemap ([#10562](https://github.com/swc-project/swc/issues/10562)) ([cbee0df](https://github.com/swc-project/swc/commit/cbee0dfa2b82ed470a387d06470e70617a6ee60a)) ## [swc_core@v26.4.0] - 2025-06-04 @@ -2470,9 +2478,6 @@ - **(es/codegen)** Emit .d.ts when using --out-file ([#9582](https://github.com/swc-project/swc/issues/9582)) ([3d9d641](https://github.com/swc-project/swc/commit/3d9d641f8b49725014e7d7a72a6f0a5dfe01f42c)) -- **(es/compat)** Handle label block in constructor ([#9528](https://github.com/swc-project/swc/issues/9528)) ([c43dbad](https://github.com/swc-project/swc/commit/c43dbad028072396390029af44e31bc3292a342a)) - - - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) @@ -2482,9 +2487,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Prevent removing side effects from accessing getter ([#9530](https://github.com/swc-project/swc/issues/9530)) ([8513816](https://github.com/swc-project/swc/commit/8513816139c6ceef12a906b03c1bcf9471ce0b07)) - - - **(es/minifier)** Avoid decl name when mangle with eval ([#9546](https://github.com/swc-project/swc/issues/9546)) ([e2242c4](https://github.com/swc-project/swc/commit/e2242c41c4d648a32119eb8141dd9990b2c8c468)) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6c0bd4ee53..8f5cdde97b58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,9 @@ - **(swc_common)** Fix skip condition for sourcemap ([#10562](https://github.com/swc-project/swc/issues/10562)) ([cbee0df](https://github.com/swc-project/swc/commit/cbee0dfa2b82ed470a387d06470e70617a6ee60a)) +- **(swc_common)** Fix skip condition for sourcemap, really ([#10563](https://github.com/swc-project/swc/issues/10563)) ([14feedb](https://github.com/swc-project/swc/commit/14feedb55286bbd811b4dfba26501bd1127067fe)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) @@ -2090,12 +2093,6 @@ -- **(es/compat)** Handle label block in constructor ([#9528](https://github.com/swc-project/swc/issues/9528)) ([c43dbad](https://github.com/swc-project/swc/commit/c43dbad028072396390029af44e31bc3292a342a)) - - - **(es/decorator)** Add support for private access expressions in legacy decorators ([#9535](https://github.com/swc-project/swc/issues/9535)) ([62ed065](https://github.com/swc-project/swc/commit/62ed0655e6d9be2f4a5c641a969b41b8c0e7f75a)) - -- **(es/minifier)** Prevent removing side effects from accessing getter ([#9530](https://github.com/swc-project/swc/issues/9530)) ([8513816](https://github.com/swc-project/swc/commit/8513816139c6ceef12a906b03c1bcf9471ce0b07)) - diff --git a/Cargo.lock b/Cargo.lock index da7ee7e3c381..38a3028ce898 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.1.1" +version = "11.1.2" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.2" +version = "26.4.3" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 1c7bc2a4a2bb..d87260e2c8ae 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.1.1", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index f7f0256bf20c..aa6512fff85f 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", features = [ +swc_common = { version = "11.1.2", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 8170f571dd8a..4f5f3f3007cf 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 91cda1d4a413..0a7070a5f606 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index d8b9924baed5..67b0a8c46d80 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 40a6d4c0b75c..d66102405524 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.2", features = [ +swc_core = { version = "26.4.3", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index a7b3fc61afb6..3f0bc4a6d7a9 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.1.1" +version = "11.1.2" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 2931ea475770..238483a6f729 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 6a0472b61b33..5327968e378d 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.2" +version = "26.4.3" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.1.1", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.2", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index fcebfd121cae..1d8e336ca1f7 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index 3f9d7201fa95..6d33cc491e08 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index 196723172048..aa1e94dfff21 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 1bf036a21f75..7d4973d15fb6 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index 4eb4686c2b32..c697129a38bc 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 2aec58b3439d..be4de726a621 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 59480dc9c2d4..a0cb398505c0 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 67bee3e693db..86c31a0fe206 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index 527150d23c1c..3b8edf6e361a 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index cf884aaa1729..dd1c433cd126 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 4e3101ec31e2..393d128cf58a 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 977d837b8a15..4390198a65d5 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index be6b62914816..1219ce53cb7e 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 0115a55cd3fe..81055911ea38 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 6ead4d535af6..b45af9a13653 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 21d83d9ba6ed..6ce84269d8ab 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 3f09fac89a23..e7fa93ace6d9 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 47673a27e0f5..19614abfa182 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 9a83ab121d16..087750a43855 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 043ebc6087ee..37c8bb41b8c3 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 8cef7d130caa..35ed6760944c 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 1899c69cdf34..2297f5677a6c 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index be0a32a9466e..9373ed0e1414 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 26501383aa49..5aa7375b2dc4 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index b8d354ec7f1b..8075200a5b4a 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index d9bebb89b1fb..ec987f10e96c 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index 9ec8955731e4..9c4936ee409e 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 0ef6808b0024..b97c82bc8d58 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index f101f9320121..e821ff26593c 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index a91592d2a556..215b3df6a484 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 9ec7ffa5afe9..af8667614ba5 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 59ea3e20a260..1ace7cfd4c3d 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index def5ed7c4aa6..e1eabf89855b 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index 1dd325bfb9f4..e574d9e145af 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 53845061a6bf..37212b863a20 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index dd63b2054716..2c2ad4df2dea 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 9a03bb2ed58e..cb72c34951b8 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 9d2c6b3e71a4..4c2aee95dad1 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 63afd85fd951..8bd1749d2091 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index ea5cf557c7d3..e8b244daf31e 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 8328699b2ab3..bbe3742e96e0 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 8e8d88b35276..f8364d31bb8e 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 029fc64f5e87..5517dcbdfb39 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index aec309467848..f97bd5152063 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,7 +30,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 58f916d5b2dd..5a2c7959bed2 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index dbc020a83780..beb38f63ff40 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,7 +22,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index d5264cbc0008..210f0f410089 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 74bb2d329bfe..3f77aebdf62e 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 43681db0f04c..ae87af20e065 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 020ee7b2db11..7d4fe9c20a81 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 852e8eec699a..804d92a394c9 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 9692a71cb936..e5c30afb6ca4 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 8f1c1da1696c..871545bf4012 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,7 +17,7 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 2ad2b3468012..4312f1a055df 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.1.1", path = "../swc_common/" } +swc_common = { version = "11.1.2", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 0d872e795b11..c83e660c7f71 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index dfe28362f02d..432799ceac12 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 514c3dc01d02..b064adc1aa91 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index 11f5419f9938..7182bc26b427 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 4b540496b7f6..814c59533e8b 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 19888410ed70..ffd53045cbfc 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 675125c1dbb2..777f60918b16 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index c44fb76900aa..37bde13f6172 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index 7253e2509810..d28b2623516b 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 4aff72258245..3e0c90513f75 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index 7e39f639f6ab..7c0fabbbeafb 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index dddd789b460a..b7089ac43f4e 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 426582f9082d..fdc137b38ffa 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 6f8db0e30c5f..3bebc58d0746 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index 2179725e193b..0642a6408ab6 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index 8fc2dc0ffdfc..e24426b79df2 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.1", path = "../swc_common" } +swc_common = { version = "11.1.2", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index e1b0a4340670..b4c9c463e34f 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.1.1", path = "../swc_common", features = [ +swc_common = { version = "11.1.2", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From 9dfdfa62d3603586ff4279daf4e66443c024cdd6 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Wed, 4 Jun 2025 11:09:10 -0500 Subject: [PATCH 047/209] fix(es/fixer): Fix a bug with awaited arrow fn expression (#10555) **Description:** The minifier currently produces invalid syntax for awaited arrow expressions, for example: ```js await (() => { console.log("foo") }); ``` is minified into the following invalid syntax (missing wrapping parens): ```js await ()=>{ console.log("foo"); }; ``` https://play.swc.rs/?version=1.11.29&code=H4sIAAAAAAAAA0ssT8wsUdDQ0FSwtVOoVkjOzyvOz0nVy8lP11BKy89X0lSo1bQGAMCbrPQlAAAA&config=H4sIAAAAAAAAA1VPOw6DMAzdc4rIc4cKVR16hx7CSg0Kyk9xkBoh7k6AhJbN7%2Bdnz0JKGFnBS85lLCBgZIonLgxnl%2FBbGCBlkVXUIcGtqSNvUo%2BGaaeWQ4GEcaC0p7i7d4%2BaAOM9U0tUzmqn%2B%2FzfqbwNkZivxs2KbjB0bRS1Faz%2FTLtYf0k50HHBE36mVnYuBs3vlkxxIrGsmdxHnRcBAAA%3D --- .changeset/big-otters-crash.md | 6 ++++++ .../tests/fixture/simple/await-arrow/1/input.js | 7 +++++++ .../tests/fixture/simple/await-arrow/1/output.js | 3 +++ crates/swc_ecma_transforms_base/src/fixer.rs | 8 +++++--- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .changeset/big-otters-crash.md create mode 100644 crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/output.js diff --git a/.changeset/big-otters-crash.md b/.changeset/big-otters-crash.md new file mode 100644 index 000000000000..973901e15c4d --- /dev/null +++ b/.changeset/big-otters-crash.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_transforms_base: patch +--- + +Fix minifier bug with awaited arrow fn expression diff --git a/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/input.js b/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/input.js new file mode 100644 index 000000000000..d498580b6b7b --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/input.js @@ -0,0 +1,7 @@ +await (() => { + console.log("non-IIFE"); +}); + +await (() => { + console.log("IIFE"); +})(); diff --git a/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/output.js b/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/output.js new file mode 100644 index 000000000000..63a3c9da9dae --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/simple/await-arrow/1/output.js @@ -0,0 +1,3 @@ +await (()=>{ + console.log("non-IIFE"); +}), await void console.log("IIFE"); diff --git a/crates/swc_ecma_transforms_base/src/fixer.rs b/crates/swc_ecma_transforms_base/src/fixer.rs index aac91ff6c55e..8418785ced4f 100644 --- a/crates/swc_ecma_transforms_base/src/fixer.rs +++ b/crates/swc_ecma_transforms_base/src/fixer.rs @@ -213,9 +213,11 @@ impl VisitMut for Fixer<'_> { self.ctx = old; match &*expr.arg { - Expr::Cond(..) | Expr::Assign(..) | Expr::Bin(..) | Expr::Yield(..) => { - self.wrap(&mut expr.arg) - } + Expr::Cond(..) + | Expr::Assign(..) + | Expr::Bin(..) + | Expr::Yield(..) + | Expr::Arrow(..) => self.wrap(&mut expr.arg), _ => {} } } From 2a2b284f2522ee1bb04033a4aa787b853617823f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 4 Jun 2025 10:38:46 -0700 Subject: [PATCH 048/209] fix(swc_common): Revert skip condition patch (#10564) --- .changeset/twenty-nails-sniff.md | 6 ++++++ crates/swc_common/src/source_map.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/twenty-nails-sniff.md diff --git a/.changeset/twenty-nails-sniff.md b/.changeset/twenty-nails-sniff.md new file mode 100644 index 000000000000..5b5618ed9a64 --- /dev/null +++ b/.changeset/twenty-nails-sniff.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_common: patch +--- + +fix(swc_common): Revert skip condition patch diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 984b8ddfb967..d41db2ce7525 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1293,9 +1293,9 @@ pub fn build_source_map( let lc = *lc; - // If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0; + // If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0, // ignore the mapping. - if pos.is_dummy() || (lc.line == 0 && lc.col == 0) { + if lc.line == 0 && lc.col == 0 && pos.is_dummy() { continue; } From ea311edb66a0dcda0310651c16c4519d1b14336e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 10:39:27 -0700 Subject: [PATCH 049/209] chore: Publish crates with `swc_core` `v26.4.4` --- .changeset/big-otters-crash.md | 6 ------ .changeset/twenty-nails-sniff.md | 6 ------ CHANGELOG-CORE.md | 14 +++++++++++--- CHANGELOG.md | 14 ++++++-------- Cargo.lock | 6 +++--- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 4 ++-- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 4 ++-- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 4 ++-- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2016/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2017/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2018/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2019/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2020/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2021/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2022/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es3/Cargo.toml | 4 ++-- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 4 ++-- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_base/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_classes/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_compat/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_module/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_optimization/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_proposal/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_react/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_testing/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_typescript/Cargo.toml | 4 ++-- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 4 ++-- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 4 ++-- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 4 ++-- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 85 files changed, 134 insertions(+), 140 deletions(-) delete mode 100644 .changeset/big-otters-crash.md delete mode 100644 .changeset/twenty-nails-sniff.md diff --git a/.changeset/big-otters-crash.md b/.changeset/big-otters-crash.md deleted file mode 100644 index 973901e15c4d..000000000000 --- a/.changeset/big-otters-crash.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_transforms_base: patch ---- - -Fix minifier bug with awaited arrow fn expression diff --git a/.changeset/twenty-nails-sniff.md b/.changeset/twenty-nails-sniff.md deleted file mode 100644 index 5b5618ed9a64..000000000000 --- a/.changeset/twenty-nails-sniff.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_common: patch ---- - -fix(swc_common): Revert skip condition patch diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 73b77574fbed..ae1d52b0ad90 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,17 @@ +- **(es/fixer)** Fix a bug with awaited arrow fn expression ([#10555](https://github.com/swc-project/swc/issues/10555)) ([9dfdfa6](https://github.com/swc-project/swc/commit/9dfdfa62d3603586ff4279daf4e66443c024cdd6)) + + +- **(swc_common)** Revert skip condition patch ([#10564](https://github.com/swc-project/swc/issues/10564)) ([2a2b284](https://github.com/swc-project/swc/commit/2a2b284f2522ee1bb04033a4aa787b853617823f)) + +## [swc_core@v26.4.3] - 2025-06-04 + +### Bug Fixes + + + - **(swc_common)** Fix skip condition for sourcemap, really ([#10563](https://github.com/swc-project/swc/issues/10563)) ([14feedb](https://github.com/swc-project/swc/commit/14feedb55286bbd811b4dfba26501bd1127067fe)) ## [swc_core@v26.4.2] - 2025-06-04 @@ -2481,9 +2492,6 @@ - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) -- **(es/decorator)** Add support for private access expressions in legacy decorators ([#9535](https://github.com/swc-project/swc/issues/9535)) ([62ed065](https://github.com/swc-project/swc/commit/62ed0655e6d9be2f4a5c641a969b41b8c0e7f75a)) - - - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f5cdde97b58..cc79e1b0181d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - **(es/codegen)** Improve comments handling ([#10534](https://github.com/swc-project/swc/issues/10534)) ([d9ba838](https://github.com/swc-project/swc/commit/d9ba838df9b88d6c4108bc21dd9d6eebd406aacd)) +- **(es/fixer)** Fix a bug with awaited arrow fn expression ([#10555](https://github.com/swc-project/swc/issues/10555)) ([9dfdfa6](https://github.com/swc-project/swc/commit/9dfdfa62d3603586ff4279daf4e66443c024cdd6)) + + - **(es/minifier)** Fix missing variable ([#10478](https://github.com/swc-project/swc/issues/10478)) ([6de3ef6](https://github.com/swc-project/swc/commit/6de3ef65bc599679020de13a3085824f06e047a7)) @@ -41,6 +44,9 @@ - **(swc_common)** Fix skip condition for sourcemap, really ([#10563](https://github.com/swc-project/swc/issues/10563)) ([14feedb](https://github.com/swc-project/swc/commit/14feedb55286bbd811b4dfba26501bd1127067fe)) +- **(swc_common)** Revert skip condition patch ([#10564](https://github.com/swc-project/swc/issues/10564)) ([2a2b284](https://github.com/swc-project/swc/commit/2a2b284f2522ee1bb04033a4aa787b853617823f)) + + - **(ts/fast-dts)** Correctly emit Symbol-keyed accessors in declarations ([#10508](https://github.com/swc-project/swc/issues/10508)) ([1298e76](https://github.com/swc-project/swc/commit/1298e767e78d69ba02efb1cb3260266b5a2812c2)) @@ -2087,12 +2093,4 @@ - **(bindings/node)** Fix type definition ([64ec111](https://github.com/swc-project/swc/commit/64ec1117697029895284e248d79698f802cf1aa8)) -## [1.7.24] - 2024-09-08 - -### Bug Fixes - - - -- **(es/decorator)** Add support for private access expressions in legacy decorators ([#9535](https://github.com/swc-project/swc/issues/9535)) ([62ed065](https://github.com/swc-project/swc/commit/62ed0655e6d9be2f4a5c641a969b41b8c0e7f75a)) - diff --git a/Cargo.lock b/Cargo.lock index 38a3028ce898..0c0a04aecd67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4890,7 +4890,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.1.2" +version = "11.1.3" dependencies = [ "anyhow", "arbitrary", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.3" +version = "26.4.4" dependencies = [ "anyhow", "binding_macros", @@ -5814,7 +5814,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.1.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index d87260e2c8ae..763cdcdbe032 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.1.2", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index aa6512fff85f..fa06c08f1476 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", features = [ +swc_common = { version = "11.1.3", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } @@ -37,7 +37,7 @@ swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", feature "concurrent", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 4f5f3f3007cf..40847b2a38ea 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 0a7070a5f606..c38791684e06 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -73,7 +73,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } @@ -99,7 +99,7 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea "react", "typescript", ] } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 67b0a8c46d80..43c9e2f12230 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,12 +39,12 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index d66102405524..635fdb5b6a32 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.3", features = [ +swc_core = { version = "26.4.4", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 3f0bc4a6d7a9..b6aa52d3e7c3 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.1.2" +version = "11.1.3" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 238483a6f729..2a5add274309 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -24,7 +24,7 @@ sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 5327968e378d..6a27b0c566f1 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.3" +version = "26.4.4" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "25.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.1.2", path = "../swc_common" } +swc_common = { optional = true, version = "11.1.3", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } @@ -373,7 +373,7 @@ swc_ecma_parser = { optional = true, version = "14.0.2", path = swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } swc_ecma_react_compiler = { optional = true, version = "4.0.2", path = "../swc_ecma_react_compiler" } -swc_ecma_transforms_base = { optional = true, version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { optional = true, version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_module = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_module" } swc_ecma_transforms_optimization = { optional = true, version = "16.0.0", path = "../swc_ecma_transforms_optimization" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 1d8e336ca1f7..829c3d0b5cc9 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index 6d33cc491e08..b4c6e4a1d01c 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index aa1e94dfff21..ef6186f3f734 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 7d4973d15fb6..be35c7d1932c 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index c697129a38bc..ea883da4538d 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index be4de726a621..a29eed0964e8 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index a0cb398505c0..66808bc5208c 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 86c31a0fe206..fda5f05c5e12 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index 3b8edf6e361a..f09057756790 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index dd1c433cd126..e869d3f90b7a 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 393d128cf58a..fc8e701587c4 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 4390198a65d5..611c934a3900 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 1219ce53cb7e..ce1d0f72ac95 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,10 +15,10 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 81055911ea38..4071202c5d77 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "15.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index b45af9a13653..a226700841e9 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,11 +23,11 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 6ce84269d8ab..a987c15a6338 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,9 +14,9 @@ version = "15.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index e7fa93ace6d9..c92031728c20 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,9 +17,9 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 19614abfa182..2eadd8cf9fbd 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,10 +17,10 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 087750a43855..400b6fc732a8 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,9 +17,9 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 37c8bb41b8c3..6c56c3fddb09 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,10 +15,10 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 35ed6760944c..c134d15e1323 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,9 +16,9 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 2297f5677a6c..52d02d20ada5 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,10 +18,10 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 9373ed0e1414..7d090669e007 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,9 +15,9 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 5aa7375b2dc4..b1780cedf5f7 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 8075200a5b4a..11ee169c2a9d 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index ec987f10e96c..3a3e5e0efb16 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } @@ -40,7 +40,7 @@ pretty_assertions = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } testing = { version = "12.0.0", path = "../testing" } walkdir = { workspace = true } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index 9c4936ee409e..daf4ebe88ba8 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index b97c82bc8d58..755bedd47ec2 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", @@ -64,7 +64,7 @@ swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ ] } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index e821ff26593c..b70981aa790f 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 215b3df6a484..6528ca620d8c 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index af8667614ba5..a8e41d6432d6 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 1ace7cfd4c3d..ceca0e740393 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index e1eabf89855b..511792dc6558 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index e574d9e145af..198b2d601386 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 37212b863a20..7d69c04a1c57 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 2c2ad4df2dea..dcc8f3e0b2e1 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index cb72c34951b8..7f4b1ecb1108 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,9 +36,9 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } swc_ecma_transforms_module = { version = "17.0.0", path = "../swc_ecma_transforms_module", optional = true } swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 4c2aee95dad1..b27c1c1dc021 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.js"] license = { workspace = true } name = "swc_ecma_transforms_base" repository = { workspace = true } -version = "15.1.0" +version = "15.1.1" [lib] bench = false @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 8bd1749d2091..fd7c15e7a8a3 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,8 +13,8 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index e8b244daf31e..09b751daab95 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } @@ -45,7 +45,7 @@ swc_ecma_compat_es2020 = { version = "16.0.0", path = "../swc_ecma_compat_e swc_ecma_compat_es2021 = { version = "15.0.0", path = "../swc_ecma_compat_es2021" } swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_compat_es3 = { version = "15.0.0", path = "../swc_ecma_compat_es3" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index bbe3742e96e0..8827bb537d93 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } @@ -35,7 +35,7 @@ swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = "node", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index f8364d31bb8e..11e8e9cf7846 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -33,10 +33,10 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 5517dcbdfb39..b9bba8bbb168 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,10 +23,10 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index f97bd5152063..ff7e7fc24b15 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -30,11 +30,11 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 5a2c7959bed2..5b4931d3a3ad 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,14 +23,14 @@ sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index beb38f63ff40..0563b41f7b4b 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -22,9 +22,9 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 210f0f410089..15cc86c5cc6b 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 3f77aebdf62e..1ded05dc77b3 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index ae87af20e065..0eff0621b66a 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 7d4fe9c20a81..8be9fea3cde4 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 804d92a394c9..85511ad1b3dd 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index e5c30afb6ca4..bfe91100f4a0 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 871545bf4012..6716bf402115 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -17,13 +17,13 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 4312f1a055df..7218a81ae640 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.1.2", path = "../swc_common/" } +swc_common = { version = "11.1.3", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index c83e660c7f71..677fc1ba918c 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index 432799ceac12..c8937de844c1 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index b064adc1aa91..07214b7942cb 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } @@ -46,7 +46,7 @@ swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", feature "extra-serde", ] } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_codegen = { version = "11.0.0", path = "../swc_html_codegen" } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index 7182bc26b427..46414024886e 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 814c59533e8b..bb6f647b5998 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index ffd53045cbfc..6b915a36b125 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 777f60918b16..e89148400d44 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 37bde13f6172..47f7090ab09e 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index d28b2623516b..f749b7db5f73 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 3e0c90513f75..6bb4ec1a7c3a 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index 7c0fabbbeafb..2dd8a48ce4dd 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index b7089ac43f4e..4858cbaf1a00 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } @@ -24,5 +24,5 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } [dev-dependencies] swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } testing = { version = "12.0.0", path = "../testing" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index fdc137b38ffa..9fc6df11ebd5 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 3bebc58d0746..b3768d957179 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index 0642a6408ab6..960a2d329342 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index e24426b79df2..c0e20e638e4f 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.2", path = "../swc_common" } +swc_common = { version = "11.1.3", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index b4c9c463e34f..c589530d42b7 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.1.2", path = "../swc_common", features = [ +swc_common = { version = "11.1.3", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } From ef856402515758196f5d925bcfb8213bf0ca18fd Mon Sep 17 00:00:00 2001 From: Joshua Hannaford Date: Wed, 4 Jun 2025 17:47:07 -0400 Subject: [PATCH 050/209] fix(es/codegen): Exclude `constructor` from source map names (#10551) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description:** Previously, if an error was thrown from the constructor, the sourcemap callstack would show the error coming from `at new constructor`. This fix allows the error to be more specific and instead refer to the class name. i.e. if a class `ReactComponent` throws an error in `constructor`, the callstack will now say `at new ReactComponent`. ``` ~/sourcemapped-stackframes-playground/src/class-component.js:3 throw new Error("Boom"); ^ Error: Boom at new ReactComponent (/Users/joshuahannaford/work/sourcemapped-stackframes-playground/src/class-component.js:3:11) at new Component (~/work/sourcemapped-stackframes-playground/src/class-component.js:7:1) at Object. (~/work/sourcemapped-stackframes-playground/src/class-component.js:9:1) at Module._compile (node:internal/modules/cjs/loader:1554:14) ``` **Related issue:** - Closes https://github.com/swc-project/swc/issues/9748 This partially addresses the user report in this error. It fixes `constructor` being used as the method name rather than the class name as it should be. What this doesn't fix though is the mangled names being used instead of the original source names. With the settings that user is using, neither `terser`, `esbuild`, nor `babel` create sourcemaps that properly map between the original code and the mangled names. In order to get the expected behaviour, they would need to modify their configuration to not mangle top-level elements using `topLevel: false`. This PR makes our output consistent with other build systems with this configuration setup. --------- Co-authored-by: Donny/강동윤 --- .changeset/many-parrots-exercise.md | 6 ++++++ .../swc/tests/fixture/issues-4xxx/4006/1/output/index.map | 3 +-- .../fixture/sourcemap/011/output/CommentControlller.map | 3 +-- .../tests/fixture/sourcemap/012/output/CommentService.map | 3 +-- .../tests/fixture/sourcemap/013/output/PistController.map | 3 +-- .../tests/fixture/sourcemap/014/output/UserController.map | 3 +-- .../fixture/sourcemap/issue-3854/1-true/output/index.map | 5 ++--- .../fixture/sourcemap/issue-3854/2-inline/output/index.ts | 2 +- crates/swc/tests/stacktrace/issue-9742/output/stacks.txt | 2 +- crates/swc_compiler_base/src/lib.rs | 7 +++++++ 10 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 .changeset/many-parrots-exercise.md diff --git a/.changeset/many-parrots-exercise.md b/.changeset/many-parrots-exercise.md new file mode 100644 index 000000000000..0e73bd296a5c --- /dev/null +++ b/.changeset/many-parrots-exercise.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_compiler_base: patch +--- + +Fix sourcemap resolution for errors thrown from constructor diff --git a/crates/swc/tests/fixture/issues-4xxx/4006/1/output/index.map b/crates/swc/tests/fixture/issues-4xxx/4006/1/output/index.map index f5c725c00df4..372e09466fa9 100644 --- a/crates/swc/tests/fixture/issues-4xxx/4006/1/output/index.map +++ b/crates/swc/tests/fixture/issues-4xxx/4006/1/output/index.map @@ -1,5 +1,5 @@ { - "mappings": ";AAAA,SAASA,IAAI,EAAEC,GAAG,EAAEC,UAAU,QAAQ,MAAM;AAE5C,OAAO,MAAMC,YAAYD;IAkBrBE,SAAS;QACL,OAAOJ,IAAI,CAAC,UAAU,EAAE,IAAI,CAACK,IAAI,CAAC,KAAK,CAAC;IAC5C;IAPAC,aAAc;QACV,KAAK,IAbTD,uBAAAA,QAAAA,KAAAA;QAcI,IAAI,CAACA,IAAI,GAAG;IAChB;AAKJ;AAlBI,iBAHSF,KAGFI,UAASN,GAAG,CAAC;;;;IAIpB,CAAC;AAED,iBATSE,KASFK,cAAa;IAChBH,MAAM;QAAEI,MAAMC;IAAO;AACzB;AAWJC,eAAeC,MAAM,CAAC,OAAOT", + "mappings": ";AAAA,SAASA,IAAI,EAAEC,GAAG,EAAEC,UAAU,QAAQ,MAAM;AAE5C,OAAO,MAAMC,YAAYD;IAkBrBE,SAAS;QACL,OAAOJ,IAAI,CAAC,UAAU,EAAE,IAAI,CAACK,IAAI,CAAC,KAAK,CAAC;IAC5C;IAPA,aAAc;QACV,KAAK,IAbTA,uBAAAA,QAAAA,KAAAA;QAcI,IAAI,CAACA,IAAI,GAAG;IAChB;AAKJ;AAlBI,iBAHSF,KAGFG,UAASL,GAAG,CAAC;;;;IAIpB,CAAC;AAED,iBATSE,KASFI,cAAa;IAChBF,MAAM;QAAEG,MAAMC;IAAO;AACzB;AAWJC,eAAeC,MAAM,CAAC,OAAOR", "names": [ "html", "css", @@ -7,7 +7,6 @@ "App", "render", "name", - "constructor", "styles", "properties", "type", diff --git a/crates/swc/tests/fixture/sourcemap/011/output/CommentControlller.map b/crates/swc/tests/fixture/sourcemap/011/output/CommentControlller.map index 36051ed206d9..cbd5851f6e53 100644 --- a/crates/swc/tests/fixture/sourcemap/011/output/CommentControlller.map +++ b/crates/swc/tests/fixture/sourcemap/011/output/CommentControlller.map @@ -1,5 +1,5 @@ { - "mappings": ";;;AAAA,SAASA,IAAI,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAEC,SAAS,EAAEC,eAAe,QAAQ,iBAAiB;AAElG,SACIC,wBAAwB,EACxBC,uBAAuB,EACvBC,uBAAuB,QACpB,gCAAgC;AACvC,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASC,OAAO,QAAQ,wCAAwC;AAChE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,gBAAgB,QAAQ,uCAAuC;AAIxE,OAAO,MAAMC;IACTC,YAAY,AAAQC,cAA8B,CAAE;aAAhCA,iBAAAA;IAAkC;IAI/CC,cACH,AAAaC,EAAU,EACvB,AAAQC,gBAAkC,EAC1C,AAAQC,IAAc,EACxB;QACE,OAAO,IAAI,CAACJ,cAAc,CAACK,MAAM,CAACH,IAAIC,kBAAkBC,KAAKF,EAAE;IACnE;IAIOI,cAAc,AAAaJ,EAAU,EAAE,AAAQE,IAAc,EAAE;QAClE,OAAO,IAAI,CAACJ,cAAc,CAACO,MAAM,CAACL,IAAIE,KAAKF,EAAE;IACjD;AACJ", + "mappings": ";;;AAAA,SAASA,IAAI,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAEC,SAAS,EAAEC,eAAe,QAAQ,iBAAiB;AAElG,SACIC,wBAAwB,EACxBC,uBAAuB,EACvBC,uBAAuB,QACpB,gCAAgC;AACvC,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASC,OAAO,QAAQ,wCAAwC;AAChE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,gBAAgB,QAAQ,uCAAuC;AAIxE,OAAO,MAAMC;IACT,YAAY,AAAQC,cAA8B,CAAE;aAAhCA,iBAAAA;IAAkC;IAI/CC,cACH,AAAaC,EAAU,EACvB,AAAQC,gBAAkC,EAC1C,AAAQC,IAAc,EACxB;QACE,OAAO,IAAI,CAACJ,cAAc,CAACK,MAAM,CAACH,IAAIC,kBAAkBC,KAAKF,EAAE;IACnE;IAIOI,cAAc,AAAaJ,EAAU,EAAE,AAAQE,IAAc,EAAE;QAClE,OAAO,IAAI,CAACJ,cAAc,CAACO,MAAM,CAACL,IAAIE,KAAKF,EAAE;IACjD;AACJ", "names": [ "Body", "Controller", @@ -19,7 +19,6 @@ "UserType", "UpdateCommentDto", "CommentController", - "constructor", "commentService", "updateComment", "id", diff --git a/crates/swc/tests/fixture/sourcemap/012/output/CommentService.map b/crates/swc/tests/fixture/sourcemap/012/output/CommentService.map index 2449a93b4bb4..c718cf394b56 100644 --- a/crates/swc/tests/fixture/sourcemap/012/output/CommentService.map +++ b/crates/swc/tests/fixture/sourcemap/012/output/CommentService.map @@ -1,5 +1,5 @@ { - "mappings": ";;;AAAA,SAASA,KAAK,EAAEC,cAAcC,kBAAkB,QAAQ,WAAW;AACnE,SACEC,kBAAkB,EAClBC,UAAU,EACVC,4BAA4B,EAC5BC,iBAAiB,QACZ,iBAAiB;AACxB,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,mBAAmB;AAEjE,SAASC,OAAO,QAAyB,wCAAwC;AAGjF,SAASC,IAAI,QAAsB,kCAAkC;AAGrE,OAAO,MAAMC;IACXC,YACE,AAAmCC,YAAoC,EACvE,AAAgCC,SAA8B,EAC9D,AAAqCC,UAA8B,CACnE;aAHmCF,eAAAA;aACHC,YAAAA;aACKC,aAAAA;IACpC;IAEH,MAAMC,QAAQC,SAAiB,EAA4B;QACzD,MAAMC,UAAU,MAAM,IAAI,CAACL,YAAY,CAACM,QAAQ,CAACF;QAEjD,IAAI,CAACC,SAAS;YACZ,MAAM,IAAIZ;QACZ;QAEA,OAAOY,QAAQE,QAAQ,CAAC;IAC1B;IAEA,MAAMC,OACJH,OAAyB,EACzBI,MAAc,EACdC,MAAc,EACY;QAC1B,MAAMC,UAAU,MAAM,IAAI,CAACT,UAAU,CAACU,YAAY;QAElDD,QAAQE,gBAAgB;QAExB,IAAI;YACF,MAAMC,iBAAiB,MAAM,IAAI,CAACd,YAAY,CAACQ,MAAM,CAAC;gBACpD,GAAGH,OAAO;gBACVU,QAAQL;gBACRD;YACF;YAEA,IAAI,CAACK,gBAAgB;gBACnB,MAAM,IAAItB,6BAA6B;YACzC;YAEA,MAAM,EAAEwB,aAAa,EAAE,GAAG,MAAM,IAAI,CAACf,SAAS,CAACgB,SAAS,CACtD;gBAAEC,KAAKJ,eAAeL,MAAM;YAAC,GAC7B;gBACEU,OAAO;oBAAEC,UAAUN,eAAeO,EAAE;gBAAC;YACvC,GACA;gBAAEC,kBAAkB;YAAM;YAG5B,IAAIN,kBAAkB,GAAG;gBACvB,MAAM,IAAIxB,6BAA6B;YACzC;YAEA,MAAMmB,QAAQY,iBAAiB;YAE/B,OAAOT,eAAeP,QAAQ,CAAC;QACjC,EAAE,OAAOiB,OAAO;YACd,MAAMb,QAAQc,gBAAgB;YAE9B,MAAMD;QACR,SAAU;YACRb,QAAQe,UAAU;QACpB;IACF;IAEA,MAAMC,OACJvB,SAAiB,EACjBC,OAAyB,EACzBK,MAAc,EACY;QAC1B,MAAM,EAAEK,MAAM,EAAE,GAAG,MAAM,IAAI,CAACZ,OAAO,CAACC;QAEtC,IAAIW,OAAOM,EAAE,KAAKX,QAAQ;YACxB,MAAM,IAAIpB;QACZ;QAEA,MAAMsC,iBAAiB,MAAM,IAAI,CAAC5B,YAAY,CAAC6B,iBAAiB,CAACzB,WAAWC,SAAS;YACnFyB,KAAK;QACP;QAEA,IAAI,CAACF,gBAAgB;YACnB,MAAM,IAAIpC,6BAA6B;QACzC;QAEA,OAAOoC,eAAerB,QAAQ,CAAC;IACjC;IAEA,MAAMwB,OAAO3B,SAAiB,EAAEM,MAAc,EAAiB;QAC7D,MAAMC,UAAU,MAAM,IAAI,CAACT,UAAU,CAACU,YAAY;QAElDD,QAAQE,gBAAgB;QAExB,IAAI;YACF,MAAM,EAAEE,MAAM,EAAEN,MAAM,EAAE,GAAG,MAAM,IAAI,CAACN,OAAO,CAACC;YAE9C,IAAIW,OAAOM,EAAE,KAAKX,QAAQ;gBACxB,MAAM,IAAIpB;YACZ;YAEA,MAAM,EAAE0C,YAAY,EAAE,GAAG,MAAM,IAAI,CAAChC,YAAY,CAACiC,SAAS,CAAC;gBAAEf,KAAKd;YAAU;YAE5E,MAAM,EAAEY,aAAa,EAAE,GAAG,MAAM,IAAI,CAACf,SAAS,CAACgB,SAAS,CACtD;gBAAEC,KAAKT;YAAO,GACd;gBACEyB,OAAO;oBAAEd,UAAUhB;gBAAU;YAC/B,GACA;gBAAEkB,kBAAkB;YAAM;YAG5B,IAAIU,iBAAiB,KAAKhB,kBAAkB,GAAG;gBAC7C,MAAM,IAAIxB,6BAA6B;YACzC;YAEA,MAAMmB,QAAQY,iBAAiB;QACjC,EAAE,OAAOC,OAAO;YACd,MAAMb,QAAQc,gBAAgB;YAE9B,MAAMD;QACR,SAAU;YACRb,QAAQe,UAAU;QACpB;IACF;AACF;;;qCApHyBS;kCACHA", + "mappings": ";;;AAAA,SAASA,KAAK,EAAEC,cAAcC,kBAAkB,QAAQ,WAAW;AACnE,SACEC,kBAAkB,EAClBC,UAAU,EACVC,4BAA4B,EAC5BC,iBAAiB,QACZ,iBAAiB;AACxB,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,mBAAmB;AAEjE,SAASC,OAAO,QAAyB,wCAAwC;AAGjF,SAASC,IAAI,QAAsB,kCAAkC;AAGrE,OAAO,MAAMC;IACX,YACE,AAAmCC,YAAoC,EACvE,AAAgCC,SAA8B,EAC9D,AAAqCC,UAA8B,CACnE;aAHmCF,eAAAA;aACHC,YAAAA;aACKC,aAAAA;IACpC;IAEH,MAAMC,QAAQC,SAAiB,EAA4B;QACzD,MAAMC,UAAU,MAAM,IAAI,CAACL,YAAY,CAACM,QAAQ,CAACF;QAEjD,IAAI,CAACC,SAAS;YACZ,MAAM,IAAIX;QACZ;QAEA,OAAOW,QAAQE,QAAQ,CAAC;IAC1B;IAEA,MAAMC,OACJH,OAAyB,EACzBI,MAAc,EACdC,MAAc,EACY;QAC1B,MAAMC,UAAU,MAAM,IAAI,CAACT,UAAU,CAACU,YAAY;QAElDD,QAAQE,gBAAgB;QAExB,IAAI;YACF,MAAMC,iBAAiB,MAAM,IAAI,CAACd,YAAY,CAACQ,MAAM,CAAC;gBACpD,GAAGH,OAAO;gBACVU,QAAQL;gBACRD;YACF;YAEA,IAAI,CAACK,gBAAgB;gBACnB,MAAM,IAAIrB,6BAA6B;YACzC;YAEA,MAAM,EAAEuB,aAAa,EAAE,GAAG,MAAM,IAAI,CAACf,SAAS,CAACgB,SAAS,CACtD;gBAAEC,KAAKJ,eAAeL,MAAM;YAAC,GAC7B;gBACEU,OAAO;oBAAEC,UAAUN,eAAeO,EAAE;gBAAC;YACvC,GACA;gBAAEC,kBAAkB;YAAM;YAG5B,IAAIN,kBAAkB,GAAG;gBACvB,MAAM,IAAIvB,6BAA6B;YACzC;YAEA,MAAMkB,QAAQY,iBAAiB;YAE/B,OAAOT,eAAeP,QAAQ,CAAC;QACjC,EAAE,OAAOiB,OAAO;YACd,MAAMb,QAAQc,gBAAgB;YAE9B,MAAMD;QACR,SAAU;YACRb,QAAQe,UAAU;QACpB;IACF;IAEA,MAAMC,OACJvB,SAAiB,EACjBC,OAAyB,EACzBK,MAAc,EACY;QAC1B,MAAM,EAAEK,MAAM,EAAE,GAAG,MAAM,IAAI,CAACZ,OAAO,CAACC;QAEtC,IAAIW,OAAOM,EAAE,KAAKX,QAAQ;YACxB,MAAM,IAAInB;QACZ;QAEA,MAAMqC,iBAAiB,MAAM,IAAI,CAAC5B,YAAY,CAAC6B,iBAAiB,CAACzB,WAAWC,SAAS;YACnFyB,KAAK;QACP;QAEA,IAAI,CAACF,gBAAgB;YACnB,MAAM,IAAInC,6BAA6B;QACzC;QAEA,OAAOmC,eAAerB,QAAQ,CAAC;IACjC;IAEA,MAAMwB,OAAO3B,SAAiB,EAAEM,MAAc,EAAiB;QAC7D,MAAMC,UAAU,MAAM,IAAI,CAACT,UAAU,CAACU,YAAY;QAElDD,QAAQE,gBAAgB;QAExB,IAAI;YACF,MAAM,EAAEE,MAAM,EAAEN,MAAM,EAAE,GAAG,MAAM,IAAI,CAACN,OAAO,CAACC;YAE9C,IAAIW,OAAOM,EAAE,KAAKX,QAAQ;gBACxB,MAAM,IAAInB;YACZ;YAEA,MAAM,EAAEyC,YAAY,EAAE,GAAG,MAAM,IAAI,CAAChC,YAAY,CAACiC,SAAS,CAAC;gBAAEf,KAAKd;YAAU;YAE5E,MAAM,EAAEY,aAAa,EAAE,GAAG,MAAM,IAAI,CAACf,SAAS,CAACgB,SAAS,CACtD;gBAAEC,KAAKT;YAAO,GACd;gBACEyB,OAAO;oBAAEd,UAAUhB;gBAAU;YAC/B,GACA;gBAAEkB,kBAAkB;YAAM;YAG5B,IAAIU,iBAAiB,KAAKhB,kBAAkB,GAAG;gBAC7C,MAAM,IAAIvB,6BAA6B;YACzC;YAEA,MAAMkB,QAAQY,iBAAiB;QACjC,EAAE,OAAOC,OAAO;YACd,MAAMb,QAAQc,gBAAgB;YAE9B,MAAMD;QACR,SAAU;YACRb,QAAQe,UAAU;QACpB;IACF;AACF;;;qCApHyBS;kCACHA", "names": [ "Model", "Connection", @@ -13,7 +13,6 @@ "Comment", "Post", "CommentService", - "constructor", "commentModel", "postModel", "connection", diff --git a/crates/swc/tests/fixture/sourcemap/013/output/PistController.map b/crates/swc/tests/fixture/sourcemap/013/output/PistController.map index 9676fc46e5e5..5f98525e123c 100644 --- a/crates/swc/tests/fixture/sourcemap/013/output/PistController.map +++ b/crates/swc/tests/fixture/sourcemap/013/output/PistController.map @@ -1,5 +1,5 @@ { - "mappings": ";;;AAAA,SACIA,IAAI,EACJC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,KAAK,EACLC,IAAI,EACJC,GAAG,EACHC,SAAS,EACTC,eAAe,QACZ,iBAAiB;AAExB,SACIC,qBAAqB,EACrBC,oBAAoB,EACpBC,qBAAqB,EACrBC,iBAAiB,EACjBC,4BAA4B,EAC5BC,oBAAoB,EACpBC,oBAAoB,QACjB,gCAAgC;AACvC,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASX,QAAQY,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,gBAAgB,QAAQ,uCAAuC;AACxE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,OAAO,QAAQ,wCAAwC;AAIhE,OAAO,MAAMC;IACTC,YAAY,AAAQC,WAAwB,EAAE,AAAQC,cAA8B,CAAE;aAAlED,cAAAA;aAAkCC,iBAAAA;IAAkC;IAGjFC,WAAW;QACd,OAAO,IAAI,CAACF,WAAW,CAACG,MAAM;IAClC;IAGOC,QAAQ,AAAaC,EAAU,EAAE;QACpC,OAAO,IAAI,CAACL,WAAW,CAACM,OAAO,CAACD;IACpC;IAIOE,WAAW,AAAQC,aAA4B,EAAE,AAAQC,IAAc,EAAE;QAC5E,OAAO,IAAI,CAACT,WAAW,CAACU,MAAM,CAACF,eAAeC,KAAKJ,EAAE;IACzD;IAIOM,WACH,AAAaN,EAAU,EACvB,AAAQO,aAA4B,EACpC,AAAQH,IAAc,EACxB;QACE,OAAO,IAAI,CAACT,WAAW,CAACa,MAAM,CAACR,IAAIO,eAAeH,KAAKJ,EAAE;IAC7D;IAIOS,WAAW,AAAaT,EAAU,EAAE,AAAQI,IAAc,EAAE;QAC/D,OAAO,IAAI,CAACT,WAAW,CAACe,MAAM,CAACV,IAAII,KAAKJ,EAAE;IAC9C;IAKOW,kBACH,AAAaX,EAAU,EACvB,AAAQY,gBAAkC,EAC1C,AAAQR,IAAc,EACxB;QACE,OAAO,IAAI,CAACR,cAAc,CAACS,MAAM,CAACO,kBAAkBZ,IAAII,KAAKJ,EAAE;IACnE;AACJ", + "mappings": ";;;AAAA,SACIA,IAAI,EACJC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,KAAK,EACLC,IAAI,EACJC,GAAG,EACHC,SAAS,EACTC,eAAe,QACZ,iBAAiB;AAExB,SACIC,qBAAqB,EACrBC,oBAAoB,EACpBC,qBAAqB,EACrBC,iBAAiB,EACjBC,4BAA4B,EAC5BC,oBAAoB,EACpBC,oBAAoB,QACjB,gCAAgC;AACvC,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASX,QAAQY,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,gBAAgB,QAAQ,uCAAuC;AACxE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,OAAO,QAAQ,wCAAwC;AAIhE,OAAO,MAAMC;IACT,YAAY,AAAQC,WAAwB,EAAE,AAAQC,cAA8B,CAAE;aAAlED,cAAAA;aAAkCC,iBAAAA;IAAkC;IAGjFC,WAAW;QACd,OAAO,IAAI,CAACF,WAAW,CAACG,MAAM;IAClC;IAGOC,QAAQ,AAAaC,EAAU,EAAE;QACpC,OAAO,IAAI,CAACL,WAAW,CAACM,OAAO,CAACD;IACpC;IAIOE,WAAW,AAAQC,aAA4B,EAAE,AAAQC,IAAc,EAAE;QAC5E,OAAO,IAAI,CAACT,WAAW,CAACU,MAAM,CAACF,eAAeC,KAAKJ,EAAE;IACzD;IAIOM,WACH,AAAaN,EAAU,EACvB,AAAQO,aAA4B,EACpC,AAAQH,IAAc,EACxB;QACE,OAAO,IAAI,CAACT,WAAW,CAACa,MAAM,CAACR,IAAIO,eAAeH,KAAKJ,EAAE;IAC7D;IAIOS,WAAW,AAAaT,EAAU,EAAE,AAAQI,IAAc,EAAE;QAC/D,OAAO,IAAI,CAACT,WAAW,CAACe,MAAM,CAACV,IAAII,KAAKJ,EAAE;IAC9C;IAKOW,kBACH,AAAaX,EAAU,EACvB,AAAQY,gBAAkC,EAC1C,AAAQR,IAAc,EACxB;QACE,OAAO,IAAI,CAACR,cAAc,CAACS,MAAM,CAACO,kBAAkBZ,IAAII,KAAKJ,EAAE;IACnE;AACJ", "names": [ "Body", "Controller", @@ -28,7 +28,6 @@ "CommentService", "Comment", "PostController", - "constructor", "postService", "commentService", "getPosts", diff --git a/crates/swc/tests/fixture/sourcemap/014/output/UserController.map b/crates/swc/tests/fixture/sourcemap/014/output/UserController.map index a27fa1b8c5b2..696fec455ac5 100644 --- a/crates/swc/tests/fixture/sourcemap/014/output/UserController.map +++ b/crates/swc/tests/fixture/sourcemap/014/output/UserController.map @@ -1,5 +1,5 @@ { - "mappings": ";;;AAAA,SACIA,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,IAAI,EACJC,GAAG,EACHC,KAAK,EACLC,kBAAkB,EAClBC,eAAe,QACZ,iBAAiB;AAExB,SACIC,qBAAqB,EACrBC,oBAAoB,EACpBC,oBAAoB,QACjB,gCAAgC;AACvC,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASC,WAAW,QAAQ,2BAA2B;AAIvD,OAAO,MAAMC;IACTC,YAAY,AAAQC,WAAwB,CAAE;aAA1BA,cAAAA;IAA4B;IAEhD,MACMC,OAAO,AAAQC,aAA4B,EAAE;QAC/C,OAAO,IAAI,CAACF,WAAW,CAACG,MAAM,CAACD;IACnC;IAEA,MAEME,OACF,AAAaC,MAAc,EAC3B,AAAQC,aAA4B,EACpC,AAAQC,IAAc,EACxB;QACE,IAAIA,KAAKC,EAAE,KAAKH,QAAQ;YACpB,MAAM,IAAInB;QACd;QAEA,OAAO,IAAI,CAACc,WAAW,CAACI,MAAM,CAACC,QAAQC;IAC3C;AACJ", + "mappings": ";;;AAAA,SACIA,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,IAAI,EACJC,GAAG,EACHC,KAAK,EACLC,kBAAkB,EAClBC,eAAe,QACZ,iBAAiB;AAExB,SACIC,qBAAqB,EACrBC,oBAAoB,EACpBC,oBAAoB,QACjB,gCAAgC;AACvC,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SAASC,IAAI,QAAQ,mCAAmC;AACxD,SAASA,QAAQC,QAAQ,QAAQ,kCAAkC;AACnE,SAASC,kCAAkC,QAAQ,0DAA0D;AAC7G,SAASC,WAAW,QAAQ,2BAA2B;AAIvD,OAAO,MAAMC;IACT,YAAY,AAAQC,WAAwB,CAAE;aAA1BA,cAAAA;IAA4B;IAEhD,MACMC,OAAO,AAAQC,aAA4B,EAAE;QAC/C,OAAO,IAAI,CAACF,WAAW,CAACG,MAAM,CAACD;IACnC;IAEA,MAEME,OACF,AAAaC,MAAc,EAC3B,AAAQC,aAA4B,EACpC,AAAQC,IAAc,EACxB;QACE,IAAIA,KAAKC,EAAE,KAAKH,QAAQ;YACpB,MAAM,IAAIlB;QACd;QAEA,OAAO,IAAI,CAACa,WAAW,CAACI,MAAM,CAACC,QAAQC;IAC3C;AACJ", "names": [ "Controller", "Post", @@ -20,7 +20,6 @@ "MongooseClassSerializerInterceptor", "UserService", "UserController", - "constructor", "userService", "signup", "createUserDto", diff --git a/crates/swc/tests/fixture/sourcemap/issue-3854/1-true/output/index.map b/crates/swc/tests/fixture/sourcemap/issue-3854/1-true/output/index.map index 92fc75a5b521..da9362b40866 100644 --- a/crates/swc/tests/fixture/sourcemap/issue-3854/1-true/output/index.map +++ b/crates/swc/tests/fixture/sourcemap/issue-3854/1-true/output/index.map @@ -1,5 +1,5 @@ { - "mappings": ";;;;;;;;;;;QA6BaA;eAAAA;;QAMAC;eAAAA;;QARDC;;;QAKCC;eAAAA;;QAaAC;eAAAA;;QARAC;eAAAA;;QAKAC;eAAAA;;QATAC;eAAAA;;QAHAC;eAAAA;;;;;;;;kCA9BuC;8BACJ;gCAC1B;2FAwBR;AAGP,MAAMR,SAAqC,IAAM,IAAIS;AACrD,MAAMD,WAA2C,IACpD,IAAIE;AACD,MAAMP,SAAuC,IAAM,IAAIQ;AACvD,MAAMJ,QAAyC,IAClD,IAAIK;AACD,MAAMX,SAA2C,IACpD,IAAIY;AACD,MAAMR,SAGT,CAACS,QAAkC,EAAE,GACrC,IAAIC,wBAAwBD;AACzB,MAAMR,UAAgD,IACzD,IAAIU;AAED,MAAMZ,MAAM;IACfG,OAAQ,IACJ,IAAIU;IACRZ,QAAS,IACL,IAAIa;AACZ;IAGI,uCACA,yCACA,2CACA;AAJJ,MAAMT,oBAAoBU,iCAAe;IAMrCC,OAAO,GAAGA,MAA4B,EAAQ;yCACrC,SAAUA,OAAOC,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAd,SAASA,QAA6B,EAAQ;yCACrC,WAAYc,IAAAA,yBAAW,EAACd;QAC7B,OAAO,IAAI;IACf;IAEAe,WAAWA,UAAqC,EAAQ;yCAC/C,aAAcA,YAAYF,IAAIC,yBAAW;QAC9C,OAAO,IAAI;IACf;IAEAE,eAAeA,cAAyC,EAAQ;yCACvD,iBAAkBF,IAAAA,yBAAW,EAACE;QACnC,OAAO,IAAI;IACf;IAEAC,QAAc;QACV,OAAO;YACHL,MAAM,6BAAE,IAAI,EAAC;YACbZ,QAAQ,6BAAE,IAAI,EAAC;YACfe,UAAU,6BAAE,IAAI,EAAC;YACjBC,cAAc,6BAAE,IAAI,EAAC;QACzB;IACJ;;QAjCJ,gBACI,kCAAA;;mBAAuB,EAAE;YACzB,kCAAA;;mBAAuBE;YACvB,kCAAA;;mBAAgCA;YAChC,kCAAA;;mBAAmCA;;;AA8BvC;IAGI,sCACA;AAFJ,MAAMhB,wBAAwBS,iCAAe;IAIzCL,MAAMA,KAA+B,EAAQ;yCACpC,QAASA,MAAMO,GAAG,CAACC,yBAAW;QACnC,OAAO,IAAI;IACf;IAEAK,OAAOA,MAAgC,EAAQ;yCACtC,SAAUA,OAAON,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAG,QAAkB;QACd,OAAO;YACHX,KAAK,6BAAE,IAAI,EAAC;YACZa,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAA0B,EAAE;YAC5B,kCAAA;;mBAA2B,EAAE;;;AAkBjC;IAGI;AADJ,MAAMhB,sBAAsBQ,iCAAe;IAGvCS,QAAQA,OAAoC,EAAQ;yCAC3C,UAAWN,IAAAA,yBAAW,EAACM;QAC5B,OAAO,IAAI;IACf;IAEAH,QAAgB;QACZ,OAAO;YACHG,OAAO,6BAAE,IAAI,EAAC;QAClB;IACJ;;QAZJ,gBACI,kCAAA;;mBAA8BC,IAAAA,qBAAK,IAAGJ,KAAK;;;AAY/C;IAGI,uCACA,uCACA,2CACA;AAJJ,MAAMR,4BAA4Ba,oCAAkB;IAMhDhB,MAAMA,KAA2C,EAAQ;yCAChD,SAASA,MAAMO,GAAG,CAACU,0BAAY;QACpC,OAAO,IAAI;IACf;IAEA9B,OAAOA,MAAyC,EAAQ;yCAC/C,SAAU8B,IAAAA,0BAAY,EAAC9B,UAAU,EAAE;QACxC,OAAO,IAAI;IACf;IAEA+B,WAAWA,UAAsD,EAAQ;yCAChE,aAAcA,WAAWX,GAAG,CAACU,0BAAY;QAC9C,OAAO,IAAI;IACf;IAEAE,sBACIA,qBAA2D,EACvD;yCACC,wBAAyBA,sBAAsBZ,GAAG,CAACU,0BAAY;QACpE,OAAO,IAAI;IACf;IAEAG,cAAcC,cAAuC,EAAa;QAC9D,OAAO;YACHC,IAAIC,IAAAA,kBAAI,EACJ,wCACA,IAAI,EAAC,qCACL,IAAI,EAAC,yCACL,IAAI,EAAC,oDACL,IAAI,EAAC;YAETvB,OAAOqB,eAAeG,KAAK,4BAAC,IAAI,EAAC;YACjCrC,QAAQkC,eAAeI,KAAK,4BAAC,IAAI,EAAC;YAClCP,YAAYG,eAAeG,KAAK,4BAAC,IAAI,EAAC;YACtCL,uBAAuBE,eAAeG,KAAK,4BACvC,IAAI,EAAC;QAEb;IACJ;;QA5CJ,gBACI,kCAAA;;mBAAsC,EAAE;YACxC,kCAAA;;mBAAmCZ;YACnC,kCAAA;;mBAAiD,EAAE;YACnD,kCAAA;;mBAAsD,EAAE;;;AAyC5D;IAGI;AADJ,MAAMd,yBAAyBO,iCAAe;IAG1CL,MAAMA,KAA+B,EAAQ;QACzC,2BAAA,IAAI,EAAC,aAAYA,KAAK,CAAC;YAACA;SAAM;QAC9B,OAAO,IAAI;IACf;IAEAb,OAAOA,MAA6B,EAAQ;QACxC,IAAIA,QAAQ;YACR,2BAAA,IAAI,EAAC,aAAYA,MAAM,CAAC;gBAACA;aAAO;QACpC;QACA,OAAO,IAAI;IACf;IAEA+B,WAAWA,UAA0C,EAAQ;QACzD,2BAAA,IAAI,EAAC,aAAYA,UAAU,CAAC;YAACA;SAAW;QACxC,OAAO,IAAI;IACf;IAEAC,sBACIA,qBAA+C,EAC3C;QACJ,2BAAA,IAAI,EAAC,aAAYA,qBAAqB,CAAC;YAACA;SAAsB;QAC9D,OAAO,IAAI;IACf;IAEAR,QAAmB;QACf,OAAO,2BAAA,IAAI,EAAC,aAAYA,KAAK;IACjC;;QA7BJ,gBACI,kCAAA;;mBAAmC,IAAIR;;;AA6B3C;IAGI,wCACA;AAFJ,MAAMJ,0BAA0BM,iCAAe;IAI3CqB,QAAQA,OAA8B,EAAQ;yCACrC,UAAWA;QAChB,OAAO,IAAI;IACf;IAEArC,OAAOA,MAAwB,EAAQ;yCAC9B,SAAUmB,IAAAA,yBAAW,EAACnB;QAC3B,OAAO,IAAI;IACf;IAEAsB,QAAoB;QAChB,OAAO;YACHe,OAAO,6BAAE,IAAI,EAAC;YACdrC,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAAkC;YAClC,kCAAA;;mBAAmBuB;;;AAkBvB;IAGI;AADJ,MAAMR,gCAAgCY,oCAAkB;IAGpDhB,MAAMA,KAA2C,EAAQ;yCAChD,SAASA,MAAMO,GAAG,CAACU,0BAAY;QACpC,OAAO,IAAI;IACf;IAEAG,cAAcC,cAAuC,EAAiB;QAClE,MAAMC,KAAKC,IAAAA,kBAAI,EAAC,6CAAkB,IAAI,EAAC;QACvC,OAAO;YACHD;YACAtB,OAAOqB,eAAeG,KAAK,4BAAC,IAAI,EAAC;QACrC;IACJ;;QAdJ,gBACI,kCAAA;;mBAAsC,EAAE;;;AAc5C;IAGI;AADJ,MAAMvB,6BAA6BI,iCAAe;IAQ9CL,MAAM,GAAGA,KAA+B,EAAQ;QAC5C,2BAAA,IAAI,EAAC,cAAYA,KAAK,CAAC;YAACA;SAAM;QAC9B,OAAO,IAAI;IACf;IAEAW,QAAuB;QACnB,OAAO,2BAAA,IAAI,EAAC,cAAYA,KAAK;IACjC;IAZAgB,YAAY,GAAG3B,KAA+B,CAAE;QAC5C,KAAK,IAHT,kCAAA;;mBAAuC,IAAII;;QAIvC,IAAI,CAACJ,KAAK,IAAIA;IAClB;AAUJ;IAGI,uCACA;AAFJ,MAAME,8BAA8BG,iCAAe;IAI/CL,MAAM,GAAGA,KAA+B,EAAQ;yCACvC,SAASA,MAAMO,GAAG,CAACC,yBAAW;QACnC,OAAO,IAAI;IACf;IAEAK,OAAO,GAAGA,MAAgC,EAAQ;yCACzC,UAAUA,OAAON,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAG,QAAwB;QACpB,OAAO;YACHX,KAAK,6BAAE,IAAI,EAAC;YACZa,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAA0B,EAAE;YAC5B,kCAAA;;mBAA2B,EAAE;;;AAkBjC", + "mappings": ";;;;;;;;;;;QA6BaA;eAAAA;;QAMAC;eAAAA;;QARDC;;;QAKCC;eAAAA;;QAaAC;eAAAA;;QARAC;eAAAA;;QAKAC;eAAAA;;QATAC;eAAAA;;QAHAC;eAAAA;;;;;;;;kCA9BuC;8BACJ;gCAC1B;2FAwBR;AAGP,MAAMR,SAAqC,IAAM,IAAIS;AACrD,MAAMD,WAA2C,IACpD,IAAIE;AACD,MAAMP,SAAuC,IAAM,IAAIQ;AACvD,MAAMJ,QAAyC,IAClD,IAAIK;AACD,MAAMX,SAA2C,IACpD,IAAIY;AACD,MAAMR,SAGT,CAACS,QAAkC,EAAE,GACrC,IAAIC,wBAAwBD;AACzB,MAAMR,UAAgD,IACzD,IAAIU;AAED,MAAMZ,MAAM;IACfG,OAAQ,IACJ,IAAIU;IACRZ,QAAS,IACL,IAAIa;AACZ;IAGI,uCACA,yCACA,2CACA;AAJJ,MAAMT,oBAAoBU,iCAAe;IAMrCC,OAAO,GAAGA,MAA4B,EAAQ;yCACrC,SAAUA,OAAOC,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAd,SAASA,QAA6B,EAAQ;yCACrC,WAAYc,IAAAA,yBAAW,EAACd;QAC7B,OAAO,IAAI;IACf;IAEAe,WAAWA,UAAqC,EAAQ;yCAC/C,aAAcA,YAAYF,IAAIC,yBAAW;QAC9C,OAAO,IAAI;IACf;IAEAE,eAAeA,cAAyC,EAAQ;yCACvD,iBAAkBF,IAAAA,yBAAW,EAACE;QACnC,OAAO,IAAI;IACf;IAEAC,QAAc;QACV,OAAO;YACHL,MAAM,6BAAE,IAAI,EAAC;YACbZ,QAAQ,6BAAE,IAAI,EAAC;YACfe,UAAU,6BAAE,IAAI,EAAC;YACjBC,cAAc,6BAAE,IAAI,EAAC;QACzB;IACJ;;QAjCJ,gBACI,kCAAA;;mBAAuB,EAAE;YACzB,kCAAA;;mBAAuBE;YACvB,kCAAA;;mBAAgCA;YAChC,kCAAA;;mBAAmCA;;;AA8BvC;IAGI,sCACA;AAFJ,MAAMhB,wBAAwBS,iCAAe;IAIzCL,MAAMA,KAA+B,EAAQ;yCACpC,QAASA,MAAMO,GAAG,CAACC,yBAAW;QACnC,OAAO,IAAI;IACf;IAEAK,OAAOA,MAAgC,EAAQ;yCACtC,SAAUA,OAAON,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAG,QAAkB;QACd,OAAO;YACHX,KAAK,6BAAE,IAAI,EAAC;YACZa,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAA0B,EAAE;YAC5B,kCAAA;;mBAA2B,EAAE;;;AAkBjC;IAGI;AADJ,MAAMhB,sBAAsBQ,iCAAe;IAGvCS,QAAQA,OAAoC,EAAQ;yCAC3C,UAAWN,IAAAA,yBAAW,EAACM;QAC5B,OAAO,IAAI;IACf;IAEAH,QAAgB;QACZ,OAAO;YACHG,OAAO,6BAAE,IAAI,EAAC;QAClB;IACJ;;QAZJ,gBACI,kCAAA;;mBAA8BC,IAAAA,qBAAK,IAAGJ,KAAK;;;AAY/C;IAGI,uCACA,uCACA,2CACA;AAJJ,MAAMR,4BAA4Ba,oCAAkB;IAMhDhB,MAAMA,KAA2C,EAAQ;yCAChD,SAASA,MAAMO,GAAG,CAACU,0BAAY;QACpC,OAAO,IAAI;IACf;IAEA9B,OAAOA,MAAyC,EAAQ;yCAC/C,SAAU8B,IAAAA,0BAAY,EAAC9B,UAAU,EAAE;QACxC,OAAO,IAAI;IACf;IAEA+B,WAAWA,UAAsD,EAAQ;yCAChE,aAAcA,WAAWX,GAAG,CAACU,0BAAY;QAC9C,OAAO,IAAI;IACf;IAEAE,sBACIA,qBAA2D,EACvD;yCACC,wBAAyBA,sBAAsBZ,GAAG,CAACU,0BAAY;QACpE,OAAO,IAAI;IACf;IAEAG,cAAcC,cAAuC,EAAa;QAC9D,OAAO;YACHC,IAAIC,IAAAA,kBAAI,EACJ,wCACA,IAAI,EAAC,qCACL,IAAI,EAAC,yCACL,IAAI,EAAC,oDACL,IAAI,EAAC;YAETvB,OAAOqB,eAAeG,KAAK,4BAAC,IAAI,EAAC;YACjCrC,QAAQkC,eAAeI,KAAK,4BAAC,IAAI,EAAC;YAClCP,YAAYG,eAAeG,KAAK,4BAAC,IAAI,EAAC;YACtCL,uBAAuBE,eAAeG,KAAK,4BACvC,IAAI,EAAC;QAEb;IACJ;;QA5CJ,gBACI,kCAAA;;mBAAsC,EAAE;YACxC,kCAAA;;mBAAmCZ;YACnC,kCAAA;;mBAAiD,EAAE;YACnD,kCAAA;;mBAAsD,EAAE;;;AAyC5D;IAGI;AADJ,MAAMd,yBAAyBO,iCAAe;IAG1CL,MAAMA,KAA+B,EAAQ;QACzC,2BAAA,IAAI,EAAC,aAAYA,KAAK,CAAC;YAACA;SAAM;QAC9B,OAAO,IAAI;IACf;IAEAb,OAAOA,MAA6B,EAAQ;QACxC,IAAIA,QAAQ;YACR,2BAAA,IAAI,EAAC,aAAYA,MAAM,CAAC;gBAACA;aAAO;QACpC;QACA,OAAO,IAAI;IACf;IAEA+B,WAAWA,UAA0C,EAAQ;QACzD,2BAAA,IAAI,EAAC,aAAYA,UAAU,CAAC;YAACA;SAAW;QACxC,OAAO,IAAI;IACf;IAEAC,sBACIA,qBAA+C,EAC3C;QACJ,2BAAA,IAAI,EAAC,aAAYA,qBAAqB,CAAC;YAACA;SAAsB;QAC9D,OAAO,IAAI;IACf;IAEAR,QAAmB;QACf,OAAO,2BAAA,IAAI,EAAC,aAAYA,KAAK;IACjC;;QA7BJ,gBACI,kCAAA;;mBAAmC,IAAIR;;;AA6B3C;IAGI,wCACA;AAFJ,MAAMJ,0BAA0BM,iCAAe;IAI3CqB,QAAQA,OAA8B,EAAQ;yCACrC,UAAWA;QAChB,OAAO,IAAI;IACf;IAEArC,OAAOA,MAAwB,EAAQ;yCAC9B,SAAUmB,IAAAA,yBAAW,EAACnB;QAC3B,OAAO,IAAI;IACf;IAEAsB,QAAoB;QAChB,OAAO;YACHe,OAAO,6BAAE,IAAI,EAAC;YACdrC,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAAkC;YAClC,kCAAA;;mBAAmBuB;;;AAkBvB;IAGI;AADJ,MAAMR,gCAAgCY,oCAAkB;IAGpDhB,MAAMA,KAA2C,EAAQ;yCAChD,SAASA,MAAMO,GAAG,CAACU,0BAAY;QACpC,OAAO,IAAI;IACf;IAEAG,cAAcC,cAAuC,EAAiB;QAClE,MAAMC,KAAKC,IAAAA,kBAAI,EAAC,6CAAkB,IAAI,EAAC;QACvC,OAAO;YACHD;YACAtB,OAAOqB,eAAeG,KAAK,4BAAC,IAAI,EAAC;QACrC;IACJ;;QAdJ,gBACI,kCAAA;;mBAAsC,EAAE;;;AAc5C;IAGI;AADJ,MAAMvB,6BAA6BI,iCAAe;IAQ9CL,MAAM,GAAGA,KAA+B,EAAQ;QAC5C,2BAAA,IAAI,EAAC,cAAYA,KAAK,CAAC;YAACA;SAAM;QAC9B,OAAO,IAAI;IACf;IAEAW,QAAuB;QACnB,OAAO,2BAAA,IAAI,EAAC,cAAYA,KAAK;IACjC;IAZA,YAAY,GAAGX,KAA+B,CAAE;QAC5C,KAAK,IAHT,kCAAA;;mBAAuC,IAAII;;QAIvC,IAAI,CAACJ,KAAK,IAAIA;IAClB;AAUJ;IAGI,uCACA;AAFJ,MAAME,8BAA8BG,iCAAe;IAI/CL,MAAM,GAAGA,KAA+B,EAAQ;yCACvC,SAASA,MAAMO,GAAG,CAACC,yBAAW;QACnC,OAAO,IAAI;IACf;IAEAK,OAAO,GAAGA,MAAgC,EAAQ;yCACzC,UAAUA,OAAON,GAAG,CAACC,yBAAW;QACrC,OAAO,IAAI;IACf;IAEAG,QAAwB;QACpB,OAAO;YACHX,KAAK,6BAAE,IAAI,EAAC;YACZa,MAAM,6BAAE,IAAI,EAAC;QACjB;IACJ;;QAnBJ,gBACI,kCAAA;;mBAA0B,EAAE;YAC5B,kCAAA;;mBAA2B,EAAE;;;AAkBjC", "names": [ "create", "header", @@ -41,8 +41,7 @@ "hash", "array", "maybe", - "variant", - "constructor" + "variant" ], "sources": [ "../../input/index.ts" diff --git a/crates/swc/tests/fixture/sourcemap/issue-3854/2-inline/output/index.ts b/crates/swc/tests/fixture/sourcemap/issue-3854/2-inline/output/index.ts index 27274b4f1c8e..ecf77d2410f1 100644 --- a/crates/swc/tests/fixture/sourcemap/issue-3854/2-inline/output/index.ts +++ b/crates/swc/tests/fixture/sourcemap/issue-3854/2-inline/output/index.ts @@ -316,4 +316,4 @@ class ArticleSourcesBuilder extends _AbstractBuilders.AbstractBuilder { } } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2lucHV0L2luZGV4LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFic3RyYWN0QnVpbGRlciwgQWJzdHJhY3RTZXFCdWlsZGVyIH0gZnJvbSBcIi4vQWJzdHJhY3RCdWlsZGVyc1wiO1xuaW1wb3J0IHsgaGFzaCwgbWFwQnVpbGRBcmcsIG1hcEJ1aWxkQXJncyB9IGZyb20gXCIuL0J1aWxkZXIudXRpbHNcIjtcbmltcG9ydCB7IGltYWdlIH0gZnJvbSBcIi4vRWxlbWVudEJ1aWxkZXJcIjtcblxuaW1wb3J0IHR5cGUge1xuICAgIEJvZHksXG4gICAgQm9keVN0YWdlLFxuICAgIFRydXN0Qm94LFxuICAgIFJpY2hUZXh0LFxuICAgIE9wZW5lcixcbiAgICBCb2R5SGVhZGVyLFxuICAgIFN0YWdlLFxuICAgIEFydGljbGVTb3VyY2UsXG4gICAgQXJ0aWNsZVNvdXJjZXMsXG59IGZyb20gXCJAcGFwZXIvbW9kZWxzXCI7XG5pbXBvcnQgdHlwZSB7XG4gICAgQnVpbGRBcmcsXG4gICAgQnVpbGRBcmdzLFxuICAgIENyZWF0ZUJ1aWxkZXIsXG4gICAgU2VxRWxlbWVudCxcbiAgICBTZXFOZXh0RWxlbWVudENvbnZlcnRlcixcbn0gZnJvbSBcIi4vdHlwZXNcIjtcblxuLyoqXG4gKiBAZGVwcmVjYXRlZCB1c2Uge0J1aWxkZXIuYm9keS5ub2RlLmltZygpfVxuICovXG5leHBvcnQgKiBmcm9tIFwiLi9Cb2R5Tm9kZXNCdWlsZGVyXCI7XG5leHBvcnQgKiBhcyBub2RlIGZyb20gXCIuL0JvZHlOb2Rlc0J1aWxkZXJcIjtcblxuZXhwb3J0IGNvbnN0IGNyZWF0ZTogQ3JlYXRlQnVpbGRlcjxCb2R5QnVpbGRlcj4gPSAoKSA9PiBuZXcgQm9keUJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCB0cnVzdEJveDogQ3JlYXRlQnVpbGRlcjxUcnVzdEJveEJ1aWxkZXI+ID0gKCkgPT5cbiAgICBuZXcgVHJ1c3RCb3hCdWlsZGVyKCk7XG5leHBvcnQgY29uc3Qgb3BlbmVyOiBDcmVhdGVCdWlsZGVyPE9wZW5lckJ1aWxkZXI+ID0gKCkgPT4gbmV3IE9wZW5lckJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBzdGFnZTogQ3JlYXRlQnVpbGRlcjxCb2R5U3RhZ2VCdWlsZGVyPiA9ICgpID0+XG4gICAgbmV3IEJvZHlTdGFnZUJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBoZWFkZXI6IENyZWF0ZUJ1aWxkZXI8Qm9keUhlYWRlckJ1aWxkZXI+ID0gKCkgPT5cbiAgICBuZXcgQm9keUhlYWRlckJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBzb3VyY2U6IENyZWF0ZUJ1aWxkZXI8XG4gICAgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIsXG4gICAgQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+XG4+ID0gKG5vZGVzOiBCdWlsZEFyZ3M8UmljaFRleHQuTm9kZT4gPSBbXSkgPT5cbiAgICBuZXcgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIoLi4ubm9kZXMpO1xuZXhwb3J0IGNvbnN0IHNvdXJjZXM6IENyZWF0ZUJ1aWxkZXI8QXJ0aWNsZVNvdXJjZXNCdWlsZGVyPiA9ICgpID0+XG4gICAgbmV3IEFydGljbGVTb3VyY2VzQnVpbGRlcigpO1xuXG5leHBvcnQgY29uc3Qgc2VxID0ge1xuICAgIHN0YWdlOiAoKCkgPT5cbiAgICAgICAgbmV3IEJvZHlTdGFnZVNlcUJ1aWxkZXIoKSkgYXMgQ3JlYXRlQnVpbGRlcjxCb2R5U3RhZ2VTZXFCdWlsZGVyPixcbiAgICBzb3VyY2U6ICgoKSA9PlxuICAgICAgICBuZXcgQXJ0aWNsZVNvdXJjZVNlcUJ1aWxkZXIoKSkgYXMgQ3JlYXRlQnVpbGRlcjxBcnRpY2xlU291cmNlU2VxQnVpbGRlcj4sXG59IGFzIGNvbnN0O1xuXG5jbGFzcyBCb2R5QnVpbGRlciBleHRlbmRzIEFic3RyYWN0QnVpbGRlcjxCb2R5PiB7XG4gICAgI3N0YWdlczogQm9keVN0YWdlW10gPSBbXTtcbiAgICAjdHJ1c3RCb3g/OiBUcnVzdEJveCA9IHVuZGVmaW5lZDtcbiAgICAjZGlzY2xhaW1lcj86IFJpY2hUZXh0Lk5vZGVbXSA9IHVuZGVmaW5lZDtcbiAgICAjYXJ0aWNsZVNvdXJjZXM/OiBBcnRpY2xlU291cmNlcyA9IHVuZGVmaW5lZDtcblxuICAgIHN0YWdlcyguLi5zdGFnZXM6IEJ1aWxkQXJnczxCb2R5U3RhZ2U+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI3N0YWdlcyA9IHN0YWdlcy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICB0cnVzdEJveCh0cnVzdEJveD86IEJ1aWxkQXJnPFRydXN0Qm94Pik6IHRoaXMge1xuICAgICAgICB0aGlzLiN0cnVzdEJveCA9IG1hcEJ1aWxkQXJnKHRydXN0Qm94KTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZGlzY2xhaW1lcihkaXNjbGFpbWVyPzogQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI2Rpc2NsYWltZXIgPSBkaXNjbGFpbWVyPy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBhcnRpY2xlU291cmNlcyhhcnRpY2xlU291cmNlcz86IEJ1aWxkQXJnPEFydGljbGVTb3VyY2VzPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNhcnRpY2xlU291cmNlcyA9IG1hcEJ1aWxkQXJnKGFydGljbGVTb3VyY2VzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogQm9keSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzdGFnZXM6IHRoaXMuI3N0YWdlcyxcbiAgICAgICAgICAgIHRydXN0Qm94OiB0aGlzLiN0cnVzdEJveCxcbiAgICAgICAgICAgIGRpc2NsYWltZXI6IHRoaXMuI2Rpc2NsYWltZXIsXG4gICAgICAgICAgICBhcnRpY2xlU291cmNlczogdGhpcy4jYXJ0aWNsZVNvdXJjZXMsXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBUcnVzdEJveEJ1aWxkZXIgZXh0ZW5kcyBBYnN0cmFjdEJ1aWxkZXI8VHJ1c3RCb3g+IHtcbiAgICAjbm9kZXM6IFJpY2hUZXh0Lk5vZGVbXSA9IFtdO1xuICAgICNoaWRkZW46IFJpY2hUZXh0Lk5vZGVbXSA9IFtdO1xuXG4gICAgbm9kZXMobm9kZXM6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNub2RlcyA9IG5vZGVzLm1hcChtYXBCdWlsZEFyZyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGhpZGRlbihoaWRkZW46IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNoaWRkZW4gPSBoaWRkZW4ubWFwKG1hcEJ1aWxkQXJnKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogVHJ1c3RCb3gge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbm9kZXM6IHRoaXMuI25vZGVzLFxuICAgICAgICAgICAgaGlkZGVuOiB0aGlzLiNoaWRkZW4sXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBPcGVuZXJCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPE9wZW5lcj4ge1xuICAgICNlbGVtZW50OiBPcGVuZXJbXCJlbGVtZW50XCJdID0gaW1hZ2UoKS5idWlsZCgpO1xuXG4gICAgZWxlbWVudChlbGVtZW50OiBCdWlsZEFyZzxPcGVuZXJbXCJlbGVtZW50XCJdPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNlbGVtZW50ID0gbWFwQnVpbGRBcmcoZWxlbWVudCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IE9wZW5lciB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBlbGVtZW50OiB0aGlzLiNlbGVtZW50LFxuICAgICAgICB9O1xuICAgIH1cbn1cblxuY2xhc3MgQm9keVN0YWdlU2VxQnVpbGRlciBleHRlbmRzIEFic3RyYWN0U2VxQnVpbGRlcjxCb2R5U3RhZ2U+IHtcbiAgICAjbm9kZXM6IFNlcUVsZW1lbnQ8UmljaFRleHQuTm9kZVtdPiA9IFtdO1xuICAgICNoZWFkZXI/OiBTZXFFbGVtZW50PEJvZHlIZWFkZXI+ID0gdW5kZWZpbmVkO1xuICAgICNjb21wYW5pb25zOiBTZXFFbGVtZW50PFN0YWdlLkNvbXBhbmlvbkl0ZW1bXT4gPSBbXTtcbiAgICAjY29tbWVyY2lhbHNFbmRPZlN0YWdlOiBTZXFFbGVtZW50PFJpY2hUZXh0Lk5vZGVbXT4gPSBbXTtcblxuICAgIG5vZGVzKG5vZGVzOiBTZXFFbGVtZW50PEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgaGVhZGVyKGhlYWRlcj86IFNlcUVsZW1lbnQ8QnVpbGRBcmc8Qm9keUhlYWRlcj4+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI2hlYWRlciA9IG1hcEJ1aWxkQXJncyhoZWFkZXIgPz8gW10pO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBjb21wYW5pb25zKGNvbXBhbmlvbnM6IFNlcUVsZW1lbnQ8QnVpbGRBcmdzPFN0YWdlLkNvbXBhbmlvbkl0ZW0+Pik6IHRoaXMge1xuICAgICAgICB0aGlzLiNjb21wYW5pb25zID0gY29tcGFuaW9ucy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlKFxuICAgICAgICBjb21tZXJjaWFsc0VuZE9mU3RhZ2U6IFNlcUVsZW1lbnQ8QnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+PlxuICAgICk6IHRoaXMge1xuICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2UgPSBjb21tZXJjaWFsc0VuZE9mU3RhZ2UubWFwKG1hcEJ1aWxkQXJncyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkTGlzdEl0ZW0oc2VxTmV4dEVsZW1lbnQ6IFNlcU5leHRFbGVtZW50Q29udmVydGVyKTogQm9keVN0YWdlIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGlkOiBoYXNoKFxuICAgICAgICAgICAgICAgIFwiYm9keVN0YWdlXCIsXG4gICAgICAgICAgICAgICAgdGhpcy4jbm9kZXMsXG4gICAgICAgICAgICAgICAgdGhpcy4jY29tcGFuaW9ucyxcbiAgICAgICAgICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2UsXG4gICAgICAgICAgICAgICAgdGhpcy4jaGVhZGVyXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgbm9kZXM6IHNlcU5leHRFbGVtZW50LmFycmF5KHRoaXMuI25vZGVzKSxcbiAgICAgICAgICAgIGhlYWRlcjogc2VxTmV4dEVsZW1lbnQubWF5YmUodGhpcy4jaGVhZGVyKSxcbiAgICAgICAgICAgIGNvbXBhbmlvbnM6IHNlcU5leHRFbGVtZW50LmFycmF5KHRoaXMuI2NvbXBhbmlvbnMpLFxuICAgICAgICAgICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlOiBzZXFOZXh0RWxlbWVudC5hcnJheShcbiAgICAgICAgICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2VcbiAgICAgICAgICAgICksXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBCb2R5U3RhZ2VCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPEJvZHlTdGFnZT4ge1xuICAgICNzZXFCdWlsZGVyOiBCb2R5U3RhZ2VTZXFCdWlsZGVyID0gbmV3IEJvZHlTdGFnZVNlcUJ1aWxkZXIoKTtcblxuICAgIG5vZGVzKG5vZGVzOiBCdWlsZEFyZ3M8UmljaFRleHQuTm9kZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jc2VxQnVpbGRlci5ub2Rlcyhbbm9kZXNdKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgaGVhZGVyKGhlYWRlcj86IEJ1aWxkQXJnPEJvZHlIZWFkZXI+KTogdGhpcyB7XG4gICAgICAgIGlmIChoZWFkZXIpIHtcbiAgICAgICAgICAgIHRoaXMuI3NlcUJ1aWxkZXIuaGVhZGVyKFtoZWFkZXJdKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBjb21wYW5pb25zKGNvbXBhbmlvbnM6IEJ1aWxkQXJnczxTdGFnZS5Db21wYW5pb25JdGVtPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNzZXFCdWlsZGVyLmNvbXBhbmlvbnMoW2NvbXBhbmlvbnNdKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlKFxuICAgICAgICBjb21tZXJjaWFsc0VuZE9mU3RhZ2U6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPlxuICAgICk6IHRoaXMge1xuICAgICAgICB0aGlzLiNzZXFCdWlsZGVyLmNvbW1lcmNpYWxzRW5kT2ZTdGFnZShbY29tbWVyY2lhbHNFbmRPZlN0YWdlXSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEJvZHlTdGFnZSB7XG4gICAgICAgIHJldHVybiB0aGlzLiNzZXFCdWlsZGVyLmJ1aWxkKCk7XG4gICAgfVxufVxuXG5jbGFzcyBCb2R5SGVhZGVyQnVpbGRlciBleHRlbmRzIEFic3RyYWN0QnVpbGRlcjxCb2R5SGVhZGVyPiB7XG4gICAgI3ZhcmlhbnQ6IEJvZHlIZWFkZXJbXCJ2YXJpYW50XCJdID0gXCJmdWxsXCI7XG4gICAgI29wZW5lcj86IE9wZW5lciA9IHVuZGVmaW5lZDtcblxuICAgIHZhcmlhbnQodmFyaWFudDogQm9keUhlYWRlcltcInZhcmlhbnRcIl0pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jdmFyaWFudCA9IHZhcmlhbnQ7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG9wZW5lcihvcGVuZXI6IEJ1aWxkQXJnPE9wZW5lcj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jb3BlbmVyID0gbWFwQnVpbGRBcmcob3BlbmVyKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogQm9keUhlYWRlciB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB2YXJpYW50OiB0aGlzLiN2YXJpYW50LFxuICAgICAgICAgICAgb3BlbmVyOiB0aGlzLiNvcGVuZXIsXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBBcnRpY2xlU291cmNlU2VxQnVpbGRlciBleHRlbmRzIEFic3RyYWN0U2VxQnVpbGRlcjxBcnRpY2xlU291cmNlPiB7XG4gICAgI25vZGVzOiBTZXFFbGVtZW50PFJpY2hUZXh0Lk5vZGVbXT4gPSBbXTtcblxuICAgIG5vZGVzKG5vZGVzOiBTZXFFbGVtZW50PEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGRMaXN0SXRlbShzZXFOZXh0RWxlbWVudDogU2VxTmV4dEVsZW1lbnRDb252ZXJ0ZXIpOiBBcnRpY2xlU291cmNlIHtcbiAgICAgICAgY29uc3QgaWQgPSBoYXNoKFwiYXJ0aWNsZS1zb3VyY2VcIiwgdGhpcy4jbm9kZXMpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaWQsXG4gICAgICAgICAgICBub2Rlczogc2VxTmV4dEVsZW1lbnQuYXJyYXkodGhpcy4jbm9kZXMpLFxuICAgICAgICB9O1xuICAgIH1cbn1cblxuY2xhc3MgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIgZXh0ZW5kcyBBYnN0cmFjdEJ1aWxkZXI8QXJ0aWNsZVNvdXJjZT4ge1xuICAgICNzZXFCdWlsZGVyOiBBcnRpY2xlU291cmNlU2VxQnVpbGRlciA9IG5ldyBBcnRpY2xlU291cmNlU2VxQnVpbGRlcigpO1xuXG4gICAgY29uc3RydWN0b3IoLi4ubm9kZXM6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLm5vZGVzKC4uLm5vZGVzKTtcbiAgICB9XG5cbiAgICBub2RlcyguLi5ub2RlczogQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI3NlcUJ1aWxkZXIubm9kZXMoW25vZGVzXSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEFydGljbGVTb3VyY2Uge1xuICAgICAgICByZXR1cm4gdGhpcy4jc2VxQnVpbGRlci5idWlsZCgpO1xuICAgIH1cbn1cblxuY2xhc3MgQXJ0aWNsZVNvdXJjZXNCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPEFydGljbGVTb3VyY2VzPiB7XG4gICAgI25vZGVzOiBBcnRpY2xlU291cmNlW10gPSBbXTtcbiAgICAjaGlkZGVuOiBBcnRpY2xlU291cmNlW10gPSBbXTtcblxuICAgIG5vZGVzKC4uLm5vZGVzOiBCdWlsZEFyZ3M8QXJ0aWNsZVNvdXJjZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBoaWRkZW4oLi4uaGlkZGVuOiBCdWlsZEFyZ3M8QXJ0aWNsZVNvdXJjZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jaGlkZGVuID0gaGlkZGVuLm1hcChtYXBCdWlsZEFyZyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEFydGljbGVTb3VyY2VzIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIG5vZGVzOiB0aGlzLiNub2RlcyxcbiAgICAgICAgICAgIGhpZGRlbjogdGhpcy4jaGlkZGVuLFxuICAgICAgICB9O1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6WyJjcmVhdGUiLCJoZWFkZXIiLCJub2RlIiwib3BlbmVyIiwic2VxIiwic291cmNlIiwic291cmNlcyIsInN0YWdlIiwidHJ1c3RCb3giLCJCb2R5QnVpbGRlciIsIlRydXN0Qm94QnVpbGRlciIsIk9wZW5lckJ1aWxkZXIiLCJCb2R5U3RhZ2VCdWlsZGVyIiwiQm9keUhlYWRlckJ1aWxkZXIiLCJub2RlcyIsIkFydGljbGVTb3VyY2VCdWlsZGVyIiwiQXJ0aWNsZVNvdXJjZXNCdWlsZGVyIiwiQm9keVN0YWdlU2VxQnVpbGRlciIsIkFydGljbGVTb3VyY2VTZXFCdWlsZGVyIiwiQWJzdHJhY3RCdWlsZGVyIiwic3RhZ2VzIiwibWFwIiwibWFwQnVpbGRBcmciLCJkaXNjbGFpbWVyIiwiYXJ0aWNsZVNvdXJjZXMiLCJidWlsZCIsInVuZGVmaW5lZCIsImhpZGRlbiIsImVsZW1lbnQiLCJpbWFnZSIsIkFic3RyYWN0U2VxQnVpbGRlciIsIm1hcEJ1aWxkQXJncyIsImNvbXBhbmlvbnMiLCJjb21tZXJjaWFsc0VuZE9mU3RhZ2UiLCJidWlsZExpc3RJdGVtIiwic2VxTmV4dEVsZW1lbnQiLCJpZCIsImhhc2giLCJhcnJheSIsIm1heWJlIiwidmFyaWFudCIsImNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztRQTZCYUE7ZUFBQUE7O1FBTUFDO2VBQUFBOztRQVJEQzs7O1FBS0NDO2VBQUFBOztRQWFBQztlQUFBQTs7UUFSQUM7ZUFBQUE7O1FBS0FDO2VBQUFBOztRQVRBQztlQUFBQTs7UUFIQUM7ZUFBQUE7Ozs7Ozs7O2tDQTlCdUM7OEJBQ0o7Z0NBQzFCOzJGQXdCUjtBQUdQLE1BQU1SLFNBQXFDLElBQU0sSUFBSVM7QUFDckQsTUFBTUQsV0FBMkMsSUFDcEQsSUFBSUU7QUFDRCxNQUFNUCxTQUF1QyxJQUFNLElBQUlRO0FBQ3ZELE1BQU1KLFFBQXlDLElBQ2xELElBQUlLO0FBQ0QsTUFBTVgsU0FBMkMsSUFDcEQsSUFBSVk7QUFDRCxNQUFNUixTQUdULENBQUNTLFFBQWtDLEVBQUUsR0FDckMsSUFBSUMsd0JBQXdCRDtBQUN6QixNQUFNUixVQUFnRCxJQUN6RCxJQUFJVTtBQUVELE1BQU1aLE1BQU07SUFDZkcsT0FBUSxJQUNKLElBQUlVO0lBQ1JaLFFBQVMsSUFDTCxJQUFJYTtBQUNaO0lBR0ksdUNBQ0EseUNBQ0EsMkNBQ0E7QUFKSixNQUFNVCxvQkFBb0JVLGlDQUFlO0lBTXJDQyxPQUFPLEdBQUdBLE1BQTRCLEVBQVE7eUNBQ3JDLFNBQVVBLE9BQU9DLEdBQUcsQ0FBQ0MseUJBQVc7UUFDckMsT0FBTyxJQUFJO0lBQ2Y7SUFFQWQsU0FBU0EsUUFBNkIsRUFBUTt5Q0FDckMsV0FBWWMsSUFBQUEseUJBQVcsRUFBQ2Q7UUFDN0IsT0FBTyxJQUFJO0lBQ2Y7SUFFQWUsV0FBV0EsVUFBcUMsRUFBUTt5Q0FDL0MsYUFBY0EsWUFBWUYsSUFBSUMseUJBQVc7UUFDOUMsT0FBTyxJQUFJO0lBQ2Y7SUFFQUUsZUFBZUEsY0FBeUMsRUFBUTt5Q0FDdkQsaUJBQWtCRixJQUFBQSx5QkFBVyxFQUFDRTtRQUNuQyxPQUFPLElBQUk7SUFDZjtJQUVBQyxRQUFjO1FBQ1YsT0FBTztZQUNITCxNQUFNLDZCQUFFLElBQUksRUFBQztZQUNiWixRQUFRLDZCQUFFLElBQUksRUFBQztZQUNmZSxVQUFVLDZCQUFFLElBQUksRUFBQztZQUNqQkMsY0FBYyw2QkFBRSxJQUFJLEVBQUM7UUFDekI7SUFDSjs7UUFqQ0osZ0JBQ0ksa0NBQUE7O21CQUF1QixFQUFFO1lBQ3pCLGtDQUFBOzttQkFBdUJFO1lBQ3ZCLGtDQUFBOzttQkFBZ0NBO1lBQ2hDLGtDQUFBOzttQkFBbUNBOzs7QUE4QnZDO0lBR0ksc0NBQ0E7QUFGSixNQUFNaEIsd0JBQXdCUyxpQ0FBZTtJQUl6Q0wsTUFBTUEsS0FBK0IsRUFBUTt5Q0FDcEMsUUFBU0EsTUFBTU8sR0FBRyxDQUFDQyx5QkFBVztRQUNuQyxPQUFPLElBQUk7SUFDZjtJQUVBSyxPQUFPQSxNQUFnQyxFQUFRO3lDQUN0QyxTQUFVQSxPQUFPTixHQUFHLENBQUNDLHlCQUFXO1FBQ3JDLE9BQU8sSUFBSTtJQUNmO0lBRUFHLFFBQWtCO1FBQ2QsT0FBTztZQUNIWCxLQUFLLDZCQUFFLElBQUksRUFBQztZQUNaYSxNQUFNLDZCQUFFLElBQUksRUFBQztRQUNqQjtJQUNKOztRQW5CSixnQkFDSSxrQ0FBQTs7bUJBQTBCLEVBQUU7WUFDNUIsa0NBQUE7O21CQUEyQixFQUFFOzs7QUFrQmpDO0lBR0k7QUFESixNQUFNaEIsc0JBQXNCUSxpQ0FBZTtJQUd2Q1MsUUFBUUEsT0FBb0MsRUFBUTt5Q0FDM0MsVUFBV04sSUFBQUEseUJBQVcsRUFBQ007UUFDNUIsT0FBTyxJQUFJO0lBQ2Y7SUFFQUgsUUFBZ0I7UUFDWixPQUFPO1lBQ0hHLE9BQU8sNkJBQUUsSUFBSSxFQUFDO1FBQ2xCO0lBQ0o7O1FBWkosZ0JBQ0ksa0NBQUE7O21CQUE4QkMsSUFBQUEscUJBQUssSUFBR0osS0FBSzs7O0FBWS9DO0lBR0ksdUNBQ0EsdUNBQ0EsMkNBQ0E7QUFKSixNQUFNUiw0QkFBNEJhLG9DQUFrQjtJQU1oRGhCLE1BQU1BLEtBQTJDLEVBQVE7eUNBQ2hELFNBQVNBLE1BQU1PLEdBQUcsQ0FBQ1UsMEJBQVk7UUFDcEMsT0FBTyxJQUFJO0lBQ2Y7SUFFQTlCLE9BQU9BLE1BQXlDLEVBQVE7eUNBQy9DLFNBQVU4QixJQUFBQSwwQkFBWSxFQUFDOUIsVUFBVSxFQUFFO1FBQ3hDLE9BQU8sSUFBSTtJQUNmO0lBRUErQixXQUFXQSxVQUFzRCxFQUFRO3lDQUNoRSxhQUFjQSxXQUFXWCxHQUFHLENBQUNVLDBCQUFZO1FBQzlDLE9BQU8sSUFBSTtJQUNmO0lBRUFFLHNCQUNJQSxxQkFBMkQsRUFDdkQ7eUNBQ0Msd0JBQXlCQSxzQkFBc0JaLEdBQUcsQ0FBQ1UsMEJBQVk7UUFDcEUsT0FBTyxJQUFJO0lBQ2Y7SUFFQUcsY0FBY0MsY0FBdUMsRUFBYTtRQUM5RCxPQUFPO1lBQ0hDLElBQUlDLElBQUFBLGtCQUFJLEVBQ0osd0NBQ0EsSUFBSSxFQUFDLHFDQUNMLElBQUksRUFBQyx5Q0FDTCxJQUFJLEVBQUMsb0RBQ0wsSUFBSSxFQUFDO1lBRVR2QixPQUFPcUIsZUFBZUcsS0FBSyw0QkFBQyxJQUFJLEVBQUM7WUFDakNyQyxRQUFRa0MsZUFBZUksS0FBSyw0QkFBQyxJQUFJLEVBQUM7WUFDbENQLFlBQVlHLGVBQWVHLEtBQUssNEJBQUMsSUFBSSxFQUFDO1lBQ3RDTCx1QkFBdUJFLGVBQWVHLEtBQUssNEJBQ3ZDLElBQUksRUFBQztRQUViO0lBQ0o7O1FBNUNKLGdCQUNJLGtDQUFBOzttQkFBc0MsRUFBRTtZQUN4QyxrQ0FBQTs7bUJBQW1DWjtZQUNuQyxrQ0FBQTs7bUJBQWlELEVBQUU7WUFDbkQsa0NBQUE7O21CQUFzRCxFQUFFOzs7QUF5QzVEO0lBR0k7QUFESixNQUFNZCx5QkFBeUJPLGlDQUFlO0lBRzFDTCxNQUFNQSxLQUErQixFQUFRO1FBQ3pDLDJCQUFBLElBQUksRUFBQyxhQUFZQSxLQUFLLENBQUM7WUFBQ0E7U0FBTTtRQUM5QixPQUFPLElBQUk7SUFDZjtJQUVBYixPQUFPQSxNQUE2QixFQUFRO1FBQ3hDLElBQUlBLFFBQVE7WUFDUiwyQkFBQSxJQUFJLEVBQUMsYUFBWUEsTUFBTSxDQUFDO2dCQUFDQTthQUFPO1FBQ3BDO1FBQ0EsT0FBTyxJQUFJO0lBQ2Y7SUFFQStCLFdBQVdBLFVBQTBDLEVBQVE7UUFDekQsMkJBQUEsSUFBSSxFQUFDLGFBQVlBLFVBQVUsQ0FBQztZQUFDQTtTQUFXO1FBQ3hDLE9BQU8sSUFBSTtJQUNmO0lBRUFDLHNCQUNJQSxxQkFBK0MsRUFDM0M7UUFDSiwyQkFBQSxJQUFJLEVBQUMsYUFBWUEscUJBQXFCLENBQUM7WUFBQ0E7U0FBc0I7UUFDOUQsT0FBTyxJQUFJO0lBQ2Y7SUFFQVIsUUFBbUI7UUFDZixPQUFPLDJCQUFBLElBQUksRUFBQyxhQUFZQSxLQUFLO0lBQ2pDOztRQTdCSixnQkFDSSxrQ0FBQTs7bUJBQW1DLElBQUlSOzs7QUE2QjNDO0lBR0ksd0NBQ0E7QUFGSixNQUFNSiwwQkFBMEJNLGlDQUFlO0lBSTNDcUIsUUFBUUEsT0FBOEIsRUFBUTt5Q0FDckMsVUFBV0E7UUFDaEIsT0FBTyxJQUFJO0lBQ2Y7SUFFQXJDLE9BQU9BLE1BQXdCLEVBQVE7eUNBQzlCLFNBQVVtQixJQUFBQSx5QkFBVyxFQUFDbkI7UUFDM0IsT0FBTyxJQUFJO0lBQ2Y7SUFFQXNCLFFBQW9CO1FBQ2hCLE9BQU87WUFDSGUsT0FBTyw2QkFBRSxJQUFJLEVBQUM7WUFDZHJDLE1BQU0sNkJBQUUsSUFBSSxFQUFDO1FBQ2pCO0lBQ0o7O1FBbkJKLGdCQUNJLGtDQUFBOzttQkFBa0M7WUFDbEMsa0NBQUE7O21CQUFtQnVCOzs7QUFrQnZCO0lBR0k7QUFESixNQUFNUixnQ0FBZ0NZLG9DQUFrQjtJQUdwRGhCLE1BQU1BLEtBQTJDLEVBQVE7eUNBQ2hELFNBQVNBLE1BQU1PLEdBQUcsQ0FBQ1UsMEJBQVk7UUFDcEMsT0FBTyxJQUFJO0lBQ2Y7SUFFQUcsY0FBY0MsY0FBdUMsRUFBaUI7UUFDbEUsTUFBTUMsS0FBS0MsSUFBQUEsa0JBQUksRUFBQyw2Q0FBa0IsSUFBSSxFQUFDO1FBQ3ZDLE9BQU87WUFDSEQ7WUFDQXRCLE9BQU9xQixlQUFlRyxLQUFLLDRCQUFDLElBQUksRUFBQztRQUNyQztJQUNKOztRQWRKLGdCQUNJLGtDQUFBOzttQkFBc0MsRUFBRTs7O0FBYzVDO0lBR0k7QUFESixNQUFNdkIsNkJBQTZCSSxpQ0FBZTtJQVE5Q0wsTUFBTSxHQUFHQSxLQUErQixFQUFRO1FBQzVDLDJCQUFBLElBQUksRUFBQyxjQUFZQSxLQUFLLENBQUM7WUFBQ0E7U0FBTTtRQUM5QixPQUFPLElBQUk7SUFDZjtJQUVBVyxRQUF1QjtRQUNuQixPQUFPLDJCQUFBLElBQUksRUFBQyxjQUFZQSxLQUFLO0lBQ2pDO0lBWkFnQixZQUFZLEdBQUczQixLQUErQixDQUFFO1FBQzVDLEtBQUssSUFIVCxrQ0FBQTs7bUJBQXVDLElBQUlJOztRQUl2QyxJQUFJLENBQUNKLEtBQUssSUFBSUE7SUFDbEI7QUFVSjtJQUdJLHVDQUNBO0FBRkosTUFBTUUsOEJBQThCRyxpQ0FBZTtJQUkvQ0wsTUFBTSxHQUFHQSxLQUErQixFQUFRO3lDQUN2QyxTQUFTQSxNQUFNTyxHQUFHLENBQUNDLHlCQUFXO1FBQ25DLE9BQU8sSUFBSTtJQUNmO0lBRUFLLE9BQU8sR0FBR0EsTUFBZ0MsRUFBUTt5Q0FDekMsVUFBVUEsT0FBT04sR0FBRyxDQUFDQyx5QkFBVztRQUNyQyxPQUFPLElBQUk7SUFDZjtJQUVBRyxRQUF3QjtRQUNwQixPQUFPO1lBQ0hYLEtBQUssNkJBQUUsSUFBSSxFQUFDO1lBQ1phLE1BQU0sNkJBQUUsSUFBSSxFQUFDO1FBQ2pCO0lBQ0o7O1FBbkJKLGdCQUNJLGtDQUFBOzttQkFBMEIsRUFBRTtZQUM1QixrQ0FBQTs7bUJBQTJCLEVBQUU7OztBQWtCakMifQ== +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2lucHV0L2luZGV4LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFic3RyYWN0QnVpbGRlciwgQWJzdHJhY3RTZXFCdWlsZGVyIH0gZnJvbSBcIi4vQWJzdHJhY3RCdWlsZGVyc1wiO1xuaW1wb3J0IHsgaGFzaCwgbWFwQnVpbGRBcmcsIG1hcEJ1aWxkQXJncyB9IGZyb20gXCIuL0J1aWxkZXIudXRpbHNcIjtcbmltcG9ydCB7IGltYWdlIH0gZnJvbSBcIi4vRWxlbWVudEJ1aWxkZXJcIjtcblxuaW1wb3J0IHR5cGUge1xuICAgIEJvZHksXG4gICAgQm9keVN0YWdlLFxuICAgIFRydXN0Qm94LFxuICAgIFJpY2hUZXh0LFxuICAgIE9wZW5lcixcbiAgICBCb2R5SGVhZGVyLFxuICAgIFN0YWdlLFxuICAgIEFydGljbGVTb3VyY2UsXG4gICAgQXJ0aWNsZVNvdXJjZXMsXG59IGZyb20gXCJAcGFwZXIvbW9kZWxzXCI7XG5pbXBvcnQgdHlwZSB7XG4gICAgQnVpbGRBcmcsXG4gICAgQnVpbGRBcmdzLFxuICAgIENyZWF0ZUJ1aWxkZXIsXG4gICAgU2VxRWxlbWVudCxcbiAgICBTZXFOZXh0RWxlbWVudENvbnZlcnRlcixcbn0gZnJvbSBcIi4vdHlwZXNcIjtcblxuLyoqXG4gKiBAZGVwcmVjYXRlZCB1c2Uge0J1aWxkZXIuYm9keS5ub2RlLmltZygpfVxuICovXG5leHBvcnQgKiBmcm9tIFwiLi9Cb2R5Tm9kZXNCdWlsZGVyXCI7XG5leHBvcnQgKiBhcyBub2RlIGZyb20gXCIuL0JvZHlOb2Rlc0J1aWxkZXJcIjtcblxuZXhwb3J0IGNvbnN0IGNyZWF0ZTogQ3JlYXRlQnVpbGRlcjxCb2R5QnVpbGRlcj4gPSAoKSA9PiBuZXcgQm9keUJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCB0cnVzdEJveDogQ3JlYXRlQnVpbGRlcjxUcnVzdEJveEJ1aWxkZXI+ID0gKCkgPT5cbiAgICBuZXcgVHJ1c3RCb3hCdWlsZGVyKCk7XG5leHBvcnQgY29uc3Qgb3BlbmVyOiBDcmVhdGVCdWlsZGVyPE9wZW5lckJ1aWxkZXI+ID0gKCkgPT4gbmV3IE9wZW5lckJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBzdGFnZTogQ3JlYXRlQnVpbGRlcjxCb2R5U3RhZ2VCdWlsZGVyPiA9ICgpID0+XG4gICAgbmV3IEJvZHlTdGFnZUJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBoZWFkZXI6IENyZWF0ZUJ1aWxkZXI8Qm9keUhlYWRlckJ1aWxkZXI+ID0gKCkgPT5cbiAgICBuZXcgQm9keUhlYWRlckJ1aWxkZXIoKTtcbmV4cG9ydCBjb25zdCBzb3VyY2U6IENyZWF0ZUJ1aWxkZXI8XG4gICAgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIsXG4gICAgQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+XG4+ID0gKG5vZGVzOiBCdWlsZEFyZ3M8UmljaFRleHQuTm9kZT4gPSBbXSkgPT5cbiAgICBuZXcgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIoLi4ubm9kZXMpO1xuZXhwb3J0IGNvbnN0IHNvdXJjZXM6IENyZWF0ZUJ1aWxkZXI8QXJ0aWNsZVNvdXJjZXNCdWlsZGVyPiA9ICgpID0+XG4gICAgbmV3IEFydGljbGVTb3VyY2VzQnVpbGRlcigpO1xuXG5leHBvcnQgY29uc3Qgc2VxID0ge1xuICAgIHN0YWdlOiAoKCkgPT5cbiAgICAgICAgbmV3IEJvZHlTdGFnZVNlcUJ1aWxkZXIoKSkgYXMgQ3JlYXRlQnVpbGRlcjxCb2R5U3RhZ2VTZXFCdWlsZGVyPixcbiAgICBzb3VyY2U6ICgoKSA9PlxuICAgICAgICBuZXcgQXJ0aWNsZVNvdXJjZVNlcUJ1aWxkZXIoKSkgYXMgQ3JlYXRlQnVpbGRlcjxBcnRpY2xlU291cmNlU2VxQnVpbGRlcj4sXG59IGFzIGNvbnN0O1xuXG5jbGFzcyBCb2R5QnVpbGRlciBleHRlbmRzIEFic3RyYWN0QnVpbGRlcjxCb2R5PiB7XG4gICAgI3N0YWdlczogQm9keVN0YWdlW10gPSBbXTtcbiAgICAjdHJ1c3RCb3g/OiBUcnVzdEJveCA9IHVuZGVmaW5lZDtcbiAgICAjZGlzY2xhaW1lcj86IFJpY2hUZXh0Lk5vZGVbXSA9IHVuZGVmaW5lZDtcbiAgICAjYXJ0aWNsZVNvdXJjZXM/OiBBcnRpY2xlU291cmNlcyA9IHVuZGVmaW5lZDtcblxuICAgIHN0YWdlcyguLi5zdGFnZXM6IEJ1aWxkQXJnczxCb2R5U3RhZ2U+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI3N0YWdlcyA9IHN0YWdlcy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICB0cnVzdEJveCh0cnVzdEJveD86IEJ1aWxkQXJnPFRydXN0Qm94Pik6IHRoaXMge1xuICAgICAgICB0aGlzLiN0cnVzdEJveCA9IG1hcEJ1aWxkQXJnKHRydXN0Qm94KTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZGlzY2xhaW1lcihkaXNjbGFpbWVyPzogQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI2Rpc2NsYWltZXIgPSBkaXNjbGFpbWVyPy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBhcnRpY2xlU291cmNlcyhhcnRpY2xlU291cmNlcz86IEJ1aWxkQXJnPEFydGljbGVTb3VyY2VzPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNhcnRpY2xlU291cmNlcyA9IG1hcEJ1aWxkQXJnKGFydGljbGVTb3VyY2VzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogQm9keSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzdGFnZXM6IHRoaXMuI3N0YWdlcyxcbiAgICAgICAgICAgIHRydXN0Qm94OiB0aGlzLiN0cnVzdEJveCxcbiAgICAgICAgICAgIGRpc2NsYWltZXI6IHRoaXMuI2Rpc2NsYWltZXIsXG4gICAgICAgICAgICBhcnRpY2xlU291cmNlczogdGhpcy4jYXJ0aWNsZVNvdXJjZXMsXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBUcnVzdEJveEJ1aWxkZXIgZXh0ZW5kcyBBYnN0cmFjdEJ1aWxkZXI8VHJ1c3RCb3g+IHtcbiAgICAjbm9kZXM6IFJpY2hUZXh0Lk5vZGVbXSA9IFtdO1xuICAgICNoaWRkZW46IFJpY2hUZXh0Lk5vZGVbXSA9IFtdO1xuXG4gICAgbm9kZXMobm9kZXM6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNub2RlcyA9IG5vZGVzLm1hcChtYXBCdWlsZEFyZyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGhpZGRlbihoaWRkZW46IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNoaWRkZW4gPSBoaWRkZW4ubWFwKG1hcEJ1aWxkQXJnKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogVHJ1c3RCb3gge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbm9kZXM6IHRoaXMuI25vZGVzLFxuICAgICAgICAgICAgaGlkZGVuOiB0aGlzLiNoaWRkZW4sXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBPcGVuZXJCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPE9wZW5lcj4ge1xuICAgICNlbGVtZW50OiBPcGVuZXJbXCJlbGVtZW50XCJdID0gaW1hZ2UoKS5idWlsZCgpO1xuXG4gICAgZWxlbWVudChlbGVtZW50OiBCdWlsZEFyZzxPcGVuZXJbXCJlbGVtZW50XCJdPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNlbGVtZW50ID0gbWFwQnVpbGRBcmcoZWxlbWVudCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IE9wZW5lciB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBlbGVtZW50OiB0aGlzLiNlbGVtZW50LFxuICAgICAgICB9O1xuICAgIH1cbn1cblxuY2xhc3MgQm9keVN0YWdlU2VxQnVpbGRlciBleHRlbmRzIEFic3RyYWN0U2VxQnVpbGRlcjxCb2R5U3RhZ2U+IHtcbiAgICAjbm9kZXM6IFNlcUVsZW1lbnQ8UmljaFRleHQuTm9kZVtdPiA9IFtdO1xuICAgICNoZWFkZXI/OiBTZXFFbGVtZW50PEJvZHlIZWFkZXI+ID0gdW5kZWZpbmVkO1xuICAgICNjb21wYW5pb25zOiBTZXFFbGVtZW50PFN0YWdlLkNvbXBhbmlvbkl0ZW1bXT4gPSBbXTtcbiAgICAjY29tbWVyY2lhbHNFbmRPZlN0YWdlOiBTZXFFbGVtZW50PFJpY2hUZXh0Lk5vZGVbXT4gPSBbXTtcblxuICAgIG5vZGVzKG5vZGVzOiBTZXFFbGVtZW50PEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgaGVhZGVyKGhlYWRlcj86IFNlcUVsZW1lbnQ8QnVpbGRBcmc8Qm9keUhlYWRlcj4+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI2hlYWRlciA9IG1hcEJ1aWxkQXJncyhoZWFkZXIgPz8gW10pO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBjb21wYW5pb25zKGNvbXBhbmlvbnM6IFNlcUVsZW1lbnQ8QnVpbGRBcmdzPFN0YWdlLkNvbXBhbmlvbkl0ZW0+Pik6IHRoaXMge1xuICAgICAgICB0aGlzLiNjb21wYW5pb25zID0gY29tcGFuaW9ucy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlKFxuICAgICAgICBjb21tZXJjaWFsc0VuZE9mU3RhZ2U6IFNlcUVsZW1lbnQ8QnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+PlxuICAgICk6IHRoaXMge1xuICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2UgPSBjb21tZXJjaWFsc0VuZE9mU3RhZ2UubWFwKG1hcEJ1aWxkQXJncyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkTGlzdEl0ZW0oc2VxTmV4dEVsZW1lbnQ6IFNlcU5leHRFbGVtZW50Q29udmVydGVyKTogQm9keVN0YWdlIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGlkOiBoYXNoKFxuICAgICAgICAgICAgICAgIFwiYm9keVN0YWdlXCIsXG4gICAgICAgICAgICAgICAgdGhpcy4jbm9kZXMsXG4gICAgICAgICAgICAgICAgdGhpcy4jY29tcGFuaW9ucyxcbiAgICAgICAgICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2UsXG4gICAgICAgICAgICAgICAgdGhpcy4jaGVhZGVyXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgbm9kZXM6IHNlcU5leHRFbGVtZW50LmFycmF5KHRoaXMuI25vZGVzKSxcbiAgICAgICAgICAgIGhlYWRlcjogc2VxTmV4dEVsZW1lbnQubWF5YmUodGhpcy4jaGVhZGVyKSxcbiAgICAgICAgICAgIGNvbXBhbmlvbnM6IHNlcU5leHRFbGVtZW50LmFycmF5KHRoaXMuI2NvbXBhbmlvbnMpLFxuICAgICAgICAgICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlOiBzZXFOZXh0RWxlbWVudC5hcnJheShcbiAgICAgICAgICAgICAgICB0aGlzLiNjb21tZXJjaWFsc0VuZE9mU3RhZ2VcbiAgICAgICAgICAgICksXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBCb2R5U3RhZ2VCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPEJvZHlTdGFnZT4ge1xuICAgICNzZXFCdWlsZGVyOiBCb2R5U3RhZ2VTZXFCdWlsZGVyID0gbmV3IEJvZHlTdGFnZVNlcUJ1aWxkZXIoKTtcblxuICAgIG5vZGVzKG5vZGVzOiBCdWlsZEFyZ3M8UmljaFRleHQuTm9kZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jc2VxQnVpbGRlci5ub2Rlcyhbbm9kZXNdKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgaGVhZGVyKGhlYWRlcj86IEJ1aWxkQXJnPEJvZHlIZWFkZXI+KTogdGhpcyB7XG4gICAgICAgIGlmIChoZWFkZXIpIHtcbiAgICAgICAgICAgIHRoaXMuI3NlcUJ1aWxkZXIuaGVhZGVyKFtoZWFkZXJdKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBjb21wYW5pb25zKGNvbXBhbmlvbnM6IEJ1aWxkQXJnczxTdGFnZS5Db21wYW5pb25JdGVtPik6IHRoaXMge1xuICAgICAgICB0aGlzLiNzZXFCdWlsZGVyLmNvbXBhbmlvbnMoW2NvbXBhbmlvbnNdKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgY29tbWVyY2lhbHNFbmRPZlN0YWdlKFxuICAgICAgICBjb21tZXJjaWFsc0VuZE9mU3RhZ2U6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPlxuICAgICk6IHRoaXMge1xuICAgICAgICB0aGlzLiNzZXFCdWlsZGVyLmNvbW1lcmNpYWxzRW5kT2ZTdGFnZShbY29tbWVyY2lhbHNFbmRPZlN0YWdlXSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEJvZHlTdGFnZSB7XG4gICAgICAgIHJldHVybiB0aGlzLiNzZXFCdWlsZGVyLmJ1aWxkKCk7XG4gICAgfVxufVxuXG5jbGFzcyBCb2R5SGVhZGVyQnVpbGRlciBleHRlbmRzIEFic3RyYWN0QnVpbGRlcjxCb2R5SGVhZGVyPiB7XG4gICAgI3ZhcmlhbnQ6IEJvZHlIZWFkZXJbXCJ2YXJpYW50XCJdID0gXCJmdWxsXCI7XG4gICAgI29wZW5lcj86IE9wZW5lciA9IHVuZGVmaW5lZDtcblxuICAgIHZhcmlhbnQodmFyaWFudDogQm9keUhlYWRlcltcInZhcmlhbnRcIl0pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jdmFyaWFudCA9IHZhcmlhbnQ7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG9wZW5lcihvcGVuZXI6IEJ1aWxkQXJnPE9wZW5lcj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jb3BlbmVyID0gbWFwQnVpbGRBcmcob3BlbmVyKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKTogQm9keUhlYWRlciB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB2YXJpYW50OiB0aGlzLiN2YXJpYW50LFxuICAgICAgICAgICAgb3BlbmVyOiB0aGlzLiNvcGVuZXIsXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5jbGFzcyBBcnRpY2xlU291cmNlU2VxQnVpbGRlciBleHRlbmRzIEFic3RyYWN0U2VxQnVpbGRlcjxBcnRpY2xlU291cmNlPiB7XG4gICAgI25vZGVzOiBTZXFFbGVtZW50PFJpY2hUZXh0Lk5vZGVbXT4gPSBbXTtcblxuICAgIG5vZGVzKG5vZGVzOiBTZXFFbGVtZW50PEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPj4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmdzKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGRMaXN0SXRlbShzZXFOZXh0RWxlbWVudDogU2VxTmV4dEVsZW1lbnRDb252ZXJ0ZXIpOiBBcnRpY2xlU291cmNlIHtcbiAgICAgICAgY29uc3QgaWQgPSBoYXNoKFwiYXJ0aWNsZS1zb3VyY2VcIiwgdGhpcy4jbm9kZXMpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaWQsXG4gICAgICAgICAgICBub2Rlczogc2VxTmV4dEVsZW1lbnQuYXJyYXkodGhpcy4jbm9kZXMpLFxuICAgICAgICB9O1xuICAgIH1cbn1cblxuY2xhc3MgQXJ0aWNsZVNvdXJjZUJ1aWxkZXIgZXh0ZW5kcyBBYnN0cmFjdEJ1aWxkZXI8QXJ0aWNsZVNvdXJjZT4ge1xuICAgICNzZXFCdWlsZGVyOiBBcnRpY2xlU291cmNlU2VxQnVpbGRlciA9IG5ldyBBcnRpY2xlU291cmNlU2VxQnVpbGRlcigpO1xuXG4gICAgY29uc3RydWN0b3IoLi4ubm9kZXM6IEJ1aWxkQXJnczxSaWNoVGV4dC5Ob2RlPikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLm5vZGVzKC4uLm5vZGVzKTtcbiAgICB9XG5cbiAgICBub2RlcyguLi5ub2RlczogQnVpbGRBcmdzPFJpY2hUZXh0Lk5vZGU+KTogdGhpcyB7XG4gICAgICAgIHRoaXMuI3NlcUJ1aWxkZXIubm9kZXMoW25vZGVzXSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEFydGljbGVTb3VyY2Uge1xuICAgICAgICByZXR1cm4gdGhpcy4jc2VxQnVpbGRlci5idWlsZCgpO1xuICAgIH1cbn1cblxuY2xhc3MgQXJ0aWNsZVNvdXJjZXNCdWlsZGVyIGV4dGVuZHMgQWJzdHJhY3RCdWlsZGVyPEFydGljbGVTb3VyY2VzPiB7XG4gICAgI25vZGVzOiBBcnRpY2xlU291cmNlW10gPSBbXTtcbiAgICAjaGlkZGVuOiBBcnRpY2xlU291cmNlW10gPSBbXTtcblxuICAgIG5vZGVzKC4uLm5vZGVzOiBCdWlsZEFyZ3M8QXJ0aWNsZVNvdXJjZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jbm9kZXMgPSBub2Rlcy5tYXAobWFwQnVpbGRBcmcpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBoaWRkZW4oLi4uaGlkZGVuOiBCdWlsZEFyZ3M8QXJ0aWNsZVNvdXJjZT4pOiB0aGlzIHtcbiAgICAgICAgdGhpcy4jaGlkZGVuID0gaGlkZGVuLm1hcChtYXBCdWlsZEFyZyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGJ1aWxkKCk6IEFydGljbGVTb3VyY2VzIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIG5vZGVzOiB0aGlzLiNub2RlcyxcbiAgICAgICAgICAgIGhpZGRlbjogdGhpcy4jaGlkZGVuLFxuICAgICAgICB9O1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6WyJjcmVhdGUiLCJoZWFkZXIiLCJub2RlIiwib3BlbmVyIiwic2VxIiwic291cmNlIiwic291cmNlcyIsInN0YWdlIiwidHJ1c3RCb3giLCJCb2R5QnVpbGRlciIsIlRydXN0Qm94QnVpbGRlciIsIk9wZW5lckJ1aWxkZXIiLCJCb2R5U3RhZ2VCdWlsZGVyIiwiQm9keUhlYWRlckJ1aWxkZXIiLCJub2RlcyIsIkFydGljbGVTb3VyY2VCdWlsZGVyIiwiQXJ0aWNsZVNvdXJjZXNCdWlsZGVyIiwiQm9keVN0YWdlU2VxQnVpbGRlciIsIkFydGljbGVTb3VyY2VTZXFCdWlsZGVyIiwiQWJzdHJhY3RCdWlsZGVyIiwic3RhZ2VzIiwibWFwIiwibWFwQnVpbGRBcmciLCJkaXNjbGFpbWVyIiwiYXJ0aWNsZVNvdXJjZXMiLCJidWlsZCIsInVuZGVmaW5lZCIsImhpZGRlbiIsImVsZW1lbnQiLCJpbWFnZSIsIkFic3RyYWN0U2VxQnVpbGRlciIsIm1hcEJ1aWxkQXJncyIsImNvbXBhbmlvbnMiLCJjb21tZXJjaWFsc0VuZE9mU3RhZ2UiLCJidWlsZExpc3RJdGVtIiwic2VxTmV4dEVsZW1lbnQiLCJpZCIsImhhc2giLCJhcnJheSIsIm1heWJlIiwidmFyaWFudCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7UUE2QmFBO2VBQUFBOztRQU1BQztlQUFBQTs7UUFSREM7OztRQUtDQztlQUFBQTs7UUFhQUM7ZUFBQUE7O1FBUkFDO2VBQUFBOztRQUtBQztlQUFBQTs7UUFUQUM7ZUFBQUE7O1FBSEFDO2VBQUFBOzs7Ozs7OztrQ0E5QnVDOzhCQUNKO2dDQUMxQjsyRkF3QlI7QUFHUCxNQUFNUixTQUFxQyxJQUFNLElBQUlTO0FBQ3JELE1BQU1ELFdBQTJDLElBQ3BELElBQUlFO0FBQ0QsTUFBTVAsU0FBdUMsSUFBTSxJQUFJUTtBQUN2RCxNQUFNSixRQUF5QyxJQUNsRCxJQUFJSztBQUNELE1BQU1YLFNBQTJDLElBQ3BELElBQUlZO0FBQ0QsTUFBTVIsU0FHVCxDQUFDUyxRQUFrQyxFQUFFLEdBQ3JDLElBQUlDLHdCQUF3QkQ7QUFDekIsTUFBTVIsVUFBZ0QsSUFDekQsSUFBSVU7QUFFRCxNQUFNWixNQUFNO0lBQ2ZHLE9BQVEsSUFDSixJQUFJVTtJQUNSWixRQUFTLElBQ0wsSUFBSWE7QUFDWjtJQUdJLHVDQUNBLHlDQUNBLDJDQUNBO0FBSkosTUFBTVQsb0JBQW9CVSxpQ0FBZTtJQU1yQ0MsT0FBTyxHQUFHQSxNQUE0QixFQUFRO3lDQUNyQyxTQUFVQSxPQUFPQyxHQUFHLENBQUNDLHlCQUFXO1FBQ3JDLE9BQU8sSUFBSTtJQUNmO0lBRUFkLFNBQVNBLFFBQTZCLEVBQVE7eUNBQ3JDLFdBQVljLElBQUFBLHlCQUFXLEVBQUNkO1FBQzdCLE9BQU8sSUFBSTtJQUNmO0lBRUFlLFdBQVdBLFVBQXFDLEVBQVE7eUNBQy9DLGFBQWNBLFlBQVlGLElBQUlDLHlCQUFXO1FBQzlDLE9BQU8sSUFBSTtJQUNmO0lBRUFFLGVBQWVBLGNBQXlDLEVBQVE7eUNBQ3ZELGlCQUFrQkYsSUFBQUEseUJBQVcsRUFBQ0U7UUFDbkMsT0FBTyxJQUFJO0lBQ2Y7SUFFQUMsUUFBYztRQUNWLE9BQU87WUFDSEwsTUFBTSw2QkFBRSxJQUFJLEVBQUM7WUFDYlosUUFBUSw2QkFBRSxJQUFJLEVBQUM7WUFDZmUsVUFBVSw2QkFBRSxJQUFJLEVBQUM7WUFDakJDLGNBQWMsNkJBQUUsSUFBSSxFQUFDO1FBQ3pCO0lBQ0o7O1FBakNKLGdCQUNJLGtDQUFBOzttQkFBdUIsRUFBRTtZQUN6QixrQ0FBQTs7bUJBQXVCRTtZQUN2QixrQ0FBQTs7bUJBQWdDQTtZQUNoQyxrQ0FBQTs7bUJBQW1DQTs7O0FBOEJ2QztJQUdJLHNDQUNBO0FBRkosTUFBTWhCLHdCQUF3QlMsaUNBQWU7SUFJekNMLE1BQU1BLEtBQStCLEVBQVE7eUNBQ3BDLFFBQVNBLE1BQU1PLEdBQUcsQ0FBQ0MseUJBQVc7UUFDbkMsT0FBTyxJQUFJO0lBQ2Y7SUFFQUssT0FBT0EsTUFBZ0MsRUFBUTt5Q0FDdEMsU0FBVUEsT0FBT04sR0FBRyxDQUFDQyx5QkFBVztRQUNyQyxPQUFPLElBQUk7SUFDZjtJQUVBRyxRQUFrQjtRQUNkLE9BQU87WUFDSFgsS0FBSyw2QkFBRSxJQUFJLEVBQUM7WUFDWmEsTUFBTSw2QkFBRSxJQUFJLEVBQUM7UUFDakI7SUFDSjs7UUFuQkosZ0JBQ0ksa0NBQUE7O21CQUEwQixFQUFFO1lBQzVCLGtDQUFBOzttQkFBMkIsRUFBRTs7O0FBa0JqQztJQUdJO0FBREosTUFBTWhCLHNCQUFzQlEsaUNBQWU7SUFHdkNTLFFBQVFBLE9BQW9DLEVBQVE7eUNBQzNDLFVBQVdOLElBQUFBLHlCQUFXLEVBQUNNO1FBQzVCLE9BQU8sSUFBSTtJQUNmO0lBRUFILFFBQWdCO1FBQ1osT0FBTztZQUNIRyxPQUFPLDZCQUFFLElBQUksRUFBQztRQUNsQjtJQUNKOztRQVpKLGdCQUNJLGtDQUFBOzttQkFBOEJDLElBQUFBLHFCQUFLLElBQUdKLEtBQUs7OztBQVkvQztJQUdJLHVDQUNBLHVDQUNBLDJDQUNBO0FBSkosTUFBTVIsNEJBQTRCYSxvQ0FBa0I7SUFNaERoQixNQUFNQSxLQUEyQyxFQUFRO3lDQUNoRCxTQUFTQSxNQUFNTyxHQUFHLENBQUNVLDBCQUFZO1FBQ3BDLE9BQU8sSUFBSTtJQUNmO0lBRUE5QixPQUFPQSxNQUF5QyxFQUFRO3lDQUMvQyxTQUFVOEIsSUFBQUEsMEJBQVksRUFBQzlCLFVBQVUsRUFBRTtRQUN4QyxPQUFPLElBQUk7SUFDZjtJQUVBK0IsV0FBV0EsVUFBc0QsRUFBUTt5Q0FDaEUsYUFBY0EsV0FBV1gsR0FBRyxDQUFDVSwwQkFBWTtRQUM5QyxPQUFPLElBQUk7SUFDZjtJQUVBRSxzQkFDSUEscUJBQTJELEVBQ3ZEO3lDQUNDLHdCQUF5QkEsc0JBQXNCWixHQUFHLENBQUNVLDBCQUFZO1FBQ3BFLE9BQU8sSUFBSTtJQUNmO0lBRUFHLGNBQWNDLGNBQXVDLEVBQWE7UUFDOUQsT0FBTztZQUNIQyxJQUFJQyxJQUFBQSxrQkFBSSxFQUNKLHdDQUNBLElBQUksRUFBQyxxQ0FDTCxJQUFJLEVBQUMseUNBQ0wsSUFBSSxFQUFDLG9EQUNMLElBQUksRUFBQztZQUVUdkIsT0FBT3FCLGVBQWVHLEtBQUssNEJBQUMsSUFBSSxFQUFDO1lBQ2pDckMsUUFBUWtDLGVBQWVJLEtBQUssNEJBQUMsSUFBSSxFQUFDO1lBQ2xDUCxZQUFZRyxlQUFlRyxLQUFLLDRCQUFDLElBQUksRUFBQztZQUN0Q0wsdUJBQXVCRSxlQUFlRyxLQUFLLDRCQUN2QyxJQUFJLEVBQUM7UUFFYjtJQUNKOztRQTVDSixnQkFDSSxrQ0FBQTs7bUJBQXNDLEVBQUU7WUFDeEMsa0NBQUE7O21CQUFtQ1o7WUFDbkMsa0NBQUE7O21CQUFpRCxFQUFFO1lBQ25ELGtDQUFBOzttQkFBc0QsRUFBRTs7O0FBeUM1RDtJQUdJO0FBREosTUFBTWQseUJBQXlCTyxpQ0FBZTtJQUcxQ0wsTUFBTUEsS0FBK0IsRUFBUTtRQUN6QywyQkFBQSxJQUFJLEVBQUMsYUFBWUEsS0FBSyxDQUFDO1lBQUNBO1NBQU07UUFDOUIsT0FBTyxJQUFJO0lBQ2Y7SUFFQWIsT0FBT0EsTUFBNkIsRUFBUTtRQUN4QyxJQUFJQSxRQUFRO1lBQ1IsMkJBQUEsSUFBSSxFQUFDLGFBQVlBLE1BQU0sQ0FBQztnQkFBQ0E7YUFBTztRQUNwQztRQUNBLE9BQU8sSUFBSTtJQUNmO0lBRUErQixXQUFXQSxVQUEwQyxFQUFRO1FBQ3pELDJCQUFBLElBQUksRUFBQyxhQUFZQSxVQUFVLENBQUM7WUFBQ0E7U0FBVztRQUN4QyxPQUFPLElBQUk7SUFDZjtJQUVBQyxzQkFDSUEscUJBQStDLEVBQzNDO1FBQ0osMkJBQUEsSUFBSSxFQUFDLGFBQVlBLHFCQUFxQixDQUFDO1lBQUNBO1NBQXNCO1FBQzlELE9BQU8sSUFBSTtJQUNmO0lBRUFSLFFBQW1CO1FBQ2YsT0FBTywyQkFBQSxJQUFJLEVBQUMsYUFBWUEsS0FBSztJQUNqQzs7UUE3QkosZ0JBQ0ksa0NBQUE7O21CQUFtQyxJQUFJUjs7O0FBNkIzQztJQUdJLHdDQUNBO0FBRkosTUFBTUosMEJBQTBCTSxpQ0FBZTtJQUkzQ3FCLFFBQVFBLE9BQThCLEVBQVE7eUNBQ3JDLFVBQVdBO1FBQ2hCLE9BQU8sSUFBSTtJQUNmO0lBRUFyQyxPQUFPQSxNQUF3QixFQUFRO3lDQUM5QixTQUFVbUIsSUFBQUEseUJBQVcsRUFBQ25CO1FBQzNCLE9BQU8sSUFBSTtJQUNmO0lBRUFzQixRQUFvQjtRQUNoQixPQUFPO1lBQ0hlLE9BQU8sNkJBQUUsSUFBSSxFQUFDO1lBQ2RyQyxNQUFNLDZCQUFFLElBQUksRUFBQztRQUNqQjtJQUNKOztRQW5CSixnQkFDSSxrQ0FBQTs7bUJBQWtDO1lBQ2xDLGtDQUFBOzttQkFBbUJ1Qjs7O0FBa0J2QjtJQUdJO0FBREosTUFBTVIsZ0NBQWdDWSxvQ0FBa0I7SUFHcERoQixNQUFNQSxLQUEyQyxFQUFRO3lDQUNoRCxTQUFTQSxNQUFNTyxHQUFHLENBQUNVLDBCQUFZO1FBQ3BDLE9BQU8sSUFBSTtJQUNmO0lBRUFHLGNBQWNDLGNBQXVDLEVBQWlCO1FBQ2xFLE1BQU1DLEtBQUtDLElBQUFBLGtCQUFJLEVBQUMsNkNBQWtCLElBQUksRUFBQztRQUN2QyxPQUFPO1lBQ0hEO1lBQ0F0QixPQUFPcUIsZUFBZUcsS0FBSyw0QkFBQyxJQUFJLEVBQUM7UUFDckM7SUFDSjs7UUFkSixnQkFDSSxrQ0FBQTs7bUJBQXNDLEVBQUU7OztBQWM1QztJQUdJO0FBREosTUFBTXZCLDZCQUE2QkksaUNBQWU7SUFROUNMLE1BQU0sR0FBR0EsS0FBK0IsRUFBUTtRQUM1QywyQkFBQSxJQUFJLEVBQUMsY0FBWUEsS0FBSyxDQUFDO1lBQUNBO1NBQU07UUFDOUIsT0FBTyxJQUFJO0lBQ2Y7SUFFQVcsUUFBdUI7UUFDbkIsT0FBTywyQkFBQSxJQUFJLEVBQUMsY0FBWUEsS0FBSztJQUNqQztJQVpBLFlBQVksR0FBR1gsS0FBK0IsQ0FBRTtRQUM1QyxLQUFLLElBSFQsa0NBQUE7O21CQUF1QyxJQUFJSTs7UUFJdkMsSUFBSSxDQUFDSixLQUFLLElBQUlBO0lBQ2xCO0FBVUo7SUFHSSx1Q0FDQTtBQUZKLE1BQU1FLDhCQUE4QkcsaUNBQWU7SUFJL0NMLE1BQU0sR0FBR0EsS0FBK0IsRUFBUTt5Q0FDdkMsU0FBU0EsTUFBTU8sR0FBRyxDQUFDQyx5QkFBVztRQUNuQyxPQUFPLElBQUk7SUFDZjtJQUVBSyxPQUFPLEdBQUdBLE1BQWdDLEVBQVE7eUNBQ3pDLFVBQVVBLE9BQU9OLEdBQUcsQ0FBQ0MseUJBQVc7UUFDckMsT0FBTyxJQUFJO0lBQ2Y7SUFFQUcsUUFBd0I7UUFDcEIsT0FBTztZQUNIWCxLQUFLLDZCQUFFLElBQUksRUFBQztZQUNaYSxNQUFNLDZCQUFFLElBQUksRUFBQztRQUNqQjtJQUNKOztRQW5CSixnQkFDSSxrQ0FBQTs7bUJBQTBCLEVBQUU7WUFDNUIsa0NBQUE7O21CQUEyQixFQUFFOzs7QUFrQmpDIn0= diff --git a/crates/swc/tests/stacktrace/issue-9742/output/stacks.txt b/crates/swc/tests/stacktrace/issue-9742/output/stacks.txt index 8f71bc24637a..aee795ef4258 100644 --- a/crates/swc/tests/stacktrace/issue-9742/output/stacks.txt +++ b/crates/swc/tests/stacktrace/issue-9742/output/stacks.txt @@ -4,6 +4,6 @@ $DIR/tests/stacktrace/issue-9742/input/index.js:3 Error: foo - at new constructor ($DIR/tests/stacktrace/issue-9742/input/index.js:3:15) + at new Parent ($DIR/tests/stacktrace/issue-9742/input/index.js:3:15) at new Parent ($DIR/tests/stacktrace/issue-9742/input/index.js:7:1) at Object. ($DIR/tests/stacktrace/issue-9742/input/index.js:11:1) diff --git a/crates/swc_compiler_base/src/lib.rs b/crates/swc_compiler_base/src/lib.rs index e461e23d96cd..042deaf160a5 100644 --- a/crates/swc_compiler_base/src/lib.rs +++ b/crates/swc_compiler_base/src/lib.rs @@ -449,6 +449,13 @@ impl Visit for IdentCollector { } fn visit_ident_name(&mut self, ident: &IdentName) { + // We don't want to specifically include the constructor name in the source map + // so that the source map name in thrown errors refers to the class name + // instead of the constructor name. + if ident.sym == "constructor" { + return; + } + self.names.insert(ident.span.lo, ident.sym.clone()); } } From dbaab4597d1d5028f567bd877b8931b106abb2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 18:18:46 -0700 Subject: [PATCH 051/209] chore: Publish crates with `swc_core` `v26.4.5` --- .changeset/many-parrots-exercise.md | 6 ------ CHANGELOG-CORE.md | 8 ++++++++ CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- crates/swc/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 2 +- 8 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 .changeset/many-parrots-exercise.md diff --git a/.changeset/many-parrots-exercise.md b/.changeset/many-parrots-exercise.md deleted file mode 100644 index 0e73bd296a5c..000000000000 --- a/.changeset/many-parrots-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_compiler_base: patch ---- - -Fix sourcemap resolution for errors thrown from constructor diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index ae1d52b0ad90..88cc1bcd4628 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,14 @@ +- **(es/codegen)** Exclude `constructor` from source map names ([#10551](https://github.com/swc-project/swc/issues/10551)) ([ef85640](https://github.com/swc-project/swc/commit/ef856402515758196f5d925bcfb8213bf0ca18fd)) + +## [swc_core@v26.4.4] - 2025-06-04 + +### Bug Fixes + + + - **(es/fixer)** Fix a bug with awaited arrow fn expression ([#10555](https://github.com/swc-project/swc/issues/10555)) ([9dfdfa6](https://github.com/swc-project/swc/commit/9dfdfa62d3603586ff4279daf4e66443c024cdd6)) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc79e1b0181d..0ff628ca8046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - **(es/codegen)** Improve comments handling ([#10534](https://github.com/swc-project/swc/issues/10534)) ([d9ba838](https://github.com/swc-project/swc/commit/d9ba838df9b88d6c4108bc21dd9d6eebd406aacd)) +- **(es/codegen)** Exclude `constructor` from source map names ([#10551](https://github.com/swc-project/swc/issues/10551)) ([ef85640](https://github.com/swc-project/swc/commit/ef856402515758196f5d925bcfb8213bf0ca18fd)) + + - **(es/fixer)** Fix a bug with awaited arrow fn expression ([#10555](https://github.com/swc-project/swc/issues/10555)) ([9dfdfa6](https://github.com/swc-project/swc/commit/9dfdfa62d3603586ff4279daf4e66443c024cdd6)) diff --git a/Cargo.lock b/Cargo.lock index 0c0a04aecd67..b551ceb3b1f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4927,7 +4927,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "22.0.0" +version = "22.0.1" dependencies = [ "anyhow", "base64 0.22.1", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.4" +version = "26.4.5" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index c38791684e06..2a30bdca67fa 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -77,7 +77,7 @@ swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } -swc_compiler_base = { version = "22.0.0", path = "../swc_compiler_base" } +swc_compiler_base = { version = "22.0.1", path = "../swc_compiler_base" } swc_config = { version = "3.0.0", path = "../swc_config" } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 635fdb5b6a32..749a36db3055 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.4", features = [ +swc_core = { version = "26.4.5", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 2a5add274309..cf42716d2122 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_compiler_base" repository = { workspace = true } -version = "22.0.0" +version = "22.0.1" [features] node = ["napi", "napi-derive"] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 6a27b0c566f1..69c8f5f5cca6 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.4" +version = "26.4.5" [package.metadata.docs.rs] features = [ "allocator_node", From b132c2c079af28f08a0da6187ddc98966be1aadb Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 01:27:37 +0000 Subject: [PATCH 052/209] chore: Publish `1.11.31-nightly-20250605.1` with `swc_core` `v26.4.5` --- bindings/Cargo.lock | 54 +++++++++---------- bindings/Cargo.toml | 8 +-- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../core/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../html/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- 39 files changed, 68 insertions(+), 68 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index bf4af66fac9c..0aa0a44b6285 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -4593,7 +4593,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.550" +version = "0.91.551" dependencies = [ "anyhow", "par-core", @@ -4626,9 +4626,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.0.0" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209e700a12f0fccd72db3bac7a751e631ef777d543c9e86247e9366b11e30a27" +checksum = "44c332906667b0fa98622f19a19e43afa5aa63b652813f80645dd0f33eca1fbb" dependencies = [ "anyhow", "ast_node", @@ -4658,9 +4658,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "22.0.0" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aef98ee955eac3339cb3a8152c64746196bd14919b41afdf2cc410c06e6cfee" +checksum = "3993329d52eab041a7123fc25c76a54ead1488cb24114b5c7b56f0d1f9d2a210" dependencies = [ "anyhow", "base64", @@ -4717,9 +4717,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.2.1" +version = "26.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a574c9d7f2c6577e0c1c606ada1c5598f97bd1ac7cf4d79527c86981e7d40059" +checksum = "083af217e9715a7c1b020f7c9e71e4961285adb0333ee3f0e5e92962a0494a11" dependencies = [ "binding_macros", "swc", @@ -4867,9 +4867,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.1.0" +version = "13.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f929a62c96d50fc87fb54cf2135ecaec2d343d6df461f82462b8aed12da8cb" +checksum = "005b9e6e4cdd15c4c437d6662e4fc6dc93f60bd1c5159a1afcf6cd9eea6fb24f" dependencies = [ "ascii", "compact_str", @@ -5114,9 +5114,9 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.1" +version = "14.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0f7ced6a34e4bd281c1dd43b658654b75c52e9416dfbfba87e95a6765e696e" +checksum = "bb339d30ba6ee93da5d5638982faaa79586cd429fe331648abf42afa0eb0a7b5" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5182,9 +5182,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.3" +version = "20.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c43654113e9a75edf05fbe2c66b5232e149f563c97bef58ff1a896daa288092" +checksum = "cf26b860e6a0e23807c70b03175d0e09082cfe256130c4759fdf9372020d3a3f" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5220,9 +5220,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "14.0.0" +version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebfd62dc0ffe6b80bedcd049f1c949133de6d524d12d2edbb0b6fb64896cefb" +checksum = "60e07e6ecd47f748988902976d09c4022b1147772f88ad8a95852a20722ac7dc" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5271,9 +5271,9 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e537bf1ae5e982275ab538f4171d292032a354b30be5115c82e91745c7fe355" +checksum = "28ce240709428417c997bbaf0db62fd297f634d7225fd3e74afa89e62ba461a9" dependencies = [ "swc_atoms", "swc_common", @@ -5304,9 +5304,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.1.0" +version = "15.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb01eeec1de9e2cfd089e3afcf3db60df10c812f97a42d953d094eba32e9d26f" +checksum = "49c0a76bff24b9fa13d5451e7a664d18158849c45434d863e0553e29fb31170b" dependencies = [ "better_scoped_tls", "bitflags 2.9.0", @@ -5530,9 +5530,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.1" +version = "15.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199e2f048c1998d550ebe5296e0876a3e5b2f963d75a925c2208466071edb9d8" +checksum = "7d2c29dbfc54e02c14975aff9d2c75ae6fff0808d860d9971a493d37870e282f" dependencies = [ "indexmap 2.8.0", "num_cpus", @@ -5905,9 +5905,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.2" +version = "14.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cd2a925ff8cf74f64a2efe3aaf9b63bfc5458b62620878a9444b2b18cf5fc4" +checksum = "520693e220391e003179bed5d1c8e183e7673fb67a446eac8ad650493c279619" dependencies = [ "bitflags 2.9.0", "petgraph 0.7.1", diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 4e71d533b102..0dd1aad8d55c 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -38,15 +38,15 @@ resolver = "2" sourcemap = "8.0.1" swc_atoms = "5.0.0" swc_cli_impl = "26.0.0" - swc_common = "11.0.0" - swc_compiler_base = "22.0.0" + swc_common = "11.1.3" + swc_compiler_base = "22.0.1" swc_config = "3.0.0" - swc_core = "26.2.1" + swc_core = "26.4.5" swc_css_ast = "11.0.0" swc_css_codegen = "11.0.0" swc_css_minifier = "11.0.0" swc_css_parser = "11.0.0" - swc_ecma_react_compiler = "4.0.1" + swc_ecma_react_compiler = "4.0.2" swc_error_reporters = "13.0.0" swc_fast_ts_strip = "19.0.0" swc_html = "20.0.0" diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index abc7d56be080..9ef474a7a7a4 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 8f3849b348e4..c74f847bc743 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index b306c7b5067d..60caac07889c 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.11.30-nightly-20250527.1" +version = "1.11.31-nightly-20250605.1" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index e6bd0525c403..810dd556bc39 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.550" +version = "0.91.551" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index 22dd12522ca3..9fd046e33b52 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index d2a3abe05091..1666b082ce98 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 2e377194311c..ef461aaae72c 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index 54e688c4fc11..a978ff0c7bf0 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index d62d17898ac9..241b2fc7212c 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 132697a145c4..57c9f314b547 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 4d88fc9c9430..2977866a5a93 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index 287b95b1635d..46c5a62e7625 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index f1e52623d72d..b16213a09867 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 680831c2d938..9b692edbcc9b 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index ba07becc5dd7..8d32626c5549 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index 86feaf62c2f8..bc6cf5fbebd6 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index 51f44e99c620..ae0101ae2a1b 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index e25b9b3fb36a..8cf2b18499d4 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index 54984f0a5668..295b999886f8 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 6996f7c4e95a..3122c223606b 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index 43abff875951..0589f15b4e69 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index f3b2c6cbd81a..c9cd108cabce 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index 94b4ab8df707..228a05f3dd82 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index 3462790bbf91..a08c84135645 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index caf9b9f2b80a..b5ff6d1ba888 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index 905bd3923c00..d21d027172bf 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 1fcc8c62eb26..1861ac31a7db 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index c79b78d9d38f..4fbb93464370 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index dd425c3a6ccd..60501f03b619 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index 5ea6d457041e..4e7ed2b09cb5 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index caedca1cbe96..cd0e78226dac 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 603aca64266d..55680682db6d 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index 1a39e25a1ec4..551ad099aa56 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index efb9cab49e6b..dd6df61d8c93 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index f0222f92e81b..6e6bc57ac360 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index b3cdac185480..d8a781b0a465 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index 286343296f5f..ce4d0e2d17dd 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.11.30-nightly-20250527.1", + "version": "1.11.31-nightly-20250605.1", "os": [ "win32" ], From 7a849aa9222a95f7c737852ef02f338fc7a7b995 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 01:27:38 +0000 Subject: [PATCH 053/209] chore: Update changelog --- CHANGELOG-CORE.md | 8 +------- CHANGELOG.md | 6 ------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 88cc1bcd4628..bba134cbb8be 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [swc_core@v26.4.5] - 2025-06-05 ### Bug Fixes @@ -2520,12 +2520,6 @@ - **(plugin)** Don't panic when ast byte not match ([#9562](https://github.com/swc-project/swc/issues/9562)) ([c36871a](https://github.com/swc-project/swc/commit/c36871a84826cc125c3c10a78ee2d7a435373154)) -### Features - - - -- **(es/common)** Introduce pure `Span` and `BytePos` to handle `#__PURE__` ([#9539](https://github.com/swc-project/swc/issues/9539)) ([f63a481](https://github.com/swc-project/swc/commit/f63a481833ebe9b5eae0708ee69b6a50b946ee28)) - ### Miscellaneous Tasks diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ff628ca8046..11f2cf107906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2084,12 +2084,6 @@ - **(es/codegen)** Ensure decorators are emitted first in TS paramters ([#9545](https://github.com/swc-project/swc/issues/9545)) ([47ef38d](https://github.com/swc-project/swc/commit/47ef38dc1d53918604481fd078c76554b012a82b)) -### Features - - - -- **(es/common)** Introduce pure `Span` and `BytePos` to handle `#__PURE__` ([#9539](https://github.com/swc-project/swc/issues/9539)) ([f63a481](https://github.com/swc-project/swc/commit/f63a481833ebe9b5eae0708ee69b6a50b946ee28)) - ### Miscellaneous Tasks From 2b284e1930bd9aab88d74bef0f7453bf23e2ddfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 4 Jun 2025 19:52:07 -0700 Subject: [PATCH 054/209] chore(ecosystem-ci): Exclude `ts-node` --- .github/swc-ecosystem-ci/tests/ts-node.ts | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/swc-ecosystem-ci/tests/ts-node.ts diff --git a/.github/swc-ecosystem-ci/tests/ts-node.ts b/.github/swc-ecosystem-ci/tests/ts-node.ts deleted file mode 100644 index 7d1329ac5411..000000000000 --- a/.github/swc-ecosystem-ci/tests/ts-node.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { runInRepo } from "../utils.js"; -import { RunOptions } from "../types.js"; - -export async function test(options: RunOptions) { - await runInRepo({ - ...options, - repo: "TypeStrong/ts-node", - branch: "main", - build: "build", - test: "test ^ci-node-and-ts-versions", - }); -} From 7fc30308168321590c8bf5da73bdcf1782748bd8 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 02:58:09 +0000 Subject: [PATCH 055/209] chore: Publish `1.11.31-nightly-20250605.2` with `swc_core` `v26.4.5` --- bindings/Cargo.lock | 10 +++++----- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- packages/core/scripts/npm/darwin-arm64/package.json | 2 +- packages/core/scripts/npm/darwin-x64/package.json | 2 +- .../core/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/core/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../core/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/core/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/core/scripts/npm/linux-x64-musl/package.json | 2 +- .../core/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/core/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/core/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- packages/html/scripts/npm/darwin-arm64/package.json | 2 +- packages/html/scripts/npm/darwin-x64/package.json | 2 +- .../html/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/html/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../html/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/html/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/html/scripts/npm/linux-x64-musl/package.json | 2 +- .../html/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/html/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/html/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../minifier/scripts/npm/darwin-arm64/package.json | 2 +- packages/minifier/scripts/npm/darwin-x64/package.json | 2 +- .../scripts/npm/linux-arm-gnueabihf/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-musl/package.json | 2 +- .../minifier/scripts/npm/linux-x64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-x64-musl/package.json | 2 +- .../minifier/scripts/npm/win32-arm64-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-ia32-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-x64-msvc/package.json | 2 +- 38 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 0aa0a44b6285..b3d9c66b5488 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.10.5", "log", "prettyplease", "proc-macro2", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -4593,7 +4593,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.551" +version = "0.91.552" dependencies = [ "anyhow", "par-core", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 9ef474a7a7a4..03d227beda72 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index c74f847bc743..7e81da94dc5a 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 60caac07889c..9edce2b28d38 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.1" +version = "1.11.31-nightly-20250605.2" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 810dd556bc39..c8cc6a6c0f29 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.551" +version = "0.91.552" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index 9fd046e33b52..c10300b444e2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index 1666b082ce98..990c1aa8c6c2 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index ef461aaae72c..50cb5227357f 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index a978ff0c7bf0..2aa02c959822 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index 241b2fc7212c..e1a0100c233c 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 57c9f314b547..d85e26234cc3 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 2977866a5a93..cefc82c93d71 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index 46c5a62e7625..6787a5216015 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index b16213a09867..6b9ddbbeaba8 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 9b692edbcc9b..0d67cc56ed20 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index 8d32626c5549..67eefdb3a61e 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index bc6cf5fbebd6..977f91c2021f 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index ae0101ae2a1b..0d6b409d732a 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index 8cf2b18499d4..1ab9b2498fec 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index 295b999886f8..256a7905d8b9 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 3122c223606b..0e12b4589a6a 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index 0589f15b4e69..b9b8a11a1874 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index c9cd108cabce..2675067d62c4 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index 228a05f3dd82..c474388187ac 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index a08c84135645..e888130dbab0 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index b5ff6d1ba888..1f698b8e123c 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index d21d027172bf..74e023d61c0a 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 1861ac31a7db..5fecc0ef0393 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index 4fbb93464370..f05a5952bb1b 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index 60501f03b619..0c9c88becfd1 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index 4e7ed2b09cb5..793e1e08971f 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index cd0e78226dac..d04c14563c14 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 55680682db6d..1797bf4e42a4 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index 551ad099aa56..d43a6f23ecdc 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index dd6df61d8c93..da9e1108a649 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index 6e6bc57ac360..336be7887d73 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index d8a781b0a465..1347b3e31156 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index ce4d0e2d17dd..1278ae34647b 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.1", + "version": "1.11.31-nightly-20250605.2", "os": [ "win32" ], From 1df4fc4db758a03b876a6bf451d0e2b00784ea4a Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 02:58:10 +0000 Subject: [PATCH 056/209] chore: Update changelog --- CHANGELOG-CORE.md | 11 ++++++++--- CHANGELOG.md | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index bba134cbb8be..d44d7aedf704 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,4 +1,12 @@ # Changelog +## [unreleased] + +### Miscellaneous Tasks + + + +- **(ecosystem-ci)** Exclude `ts-node` ([2b284e1](https://github.com/swc-project/swc/commit/2b284e1930bd9aab88d74bef0f7453bf23e2ddfe)) + ## [swc_core@v26.4.5] - 2025-06-05 ### Bug Fixes @@ -2485,9 +2493,6 @@ - **(cli)** Exclude non-files from get_files_list ([#9560](https://github.com/swc-project/swc/issues/9560)) ([85cc2bd](https://github.com/swc-project/swc/commit/85cc2bd79c3193cb0a8b54e4fce0efc1aa15b271)) -- **(es/codegen)** Handle minify number ([#9541](https://github.com/swc-project/swc/issues/9541)) ([8b1e442](https://github.com/swc-project/swc/commit/8b1e4428a3324dea76ba480a6d4cddf3865e41e8)) - - - **(es/codegen)** Ensure decorators are emitted first in TS paramters ([#9545](https://github.com/swc-project/swc/issues/9545)) ([47ef38d](https://github.com/swc-project/swc/commit/47ef38dc1d53918604481fd078c76554b012a82b)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11f2cf107906..23f57e741f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,9 @@ - **(bindings)** Use published versions of crates ([#10513](https://github.com/swc-project/swc/issues/10513)) ([f65f028](https://github.com/swc-project/swc/commit/f65f02831cb68245d5790a6c867ac3e997eedbfd)) + +- **(ecosystem-ci)** Exclude `ts-node` ([2b284e1](https://github.com/swc-project/swc/commit/2b284e1930bd9aab88d74bef0f7453bf23e2ddfe)) + ### Performance @@ -2079,9 +2082,6 @@ -- **(es/codegen)** Handle minify number ([#9541](https://github.com/swc-project/swc/issues/9541)) ([8b1e442](https://github.com/swc-project/swc/commit/8b1e4428a3324dea76ba480a6d4cddf3865e41e8)) - - - **(es/codegen)** Ensure decorators are emitted first in TS paramters ([#9545](https://github.com/swc-project/swc/issues/9545)) ([47ef38d](https://github.com/swc-project/swc/commit/47ef38dc1d53918604481fd078c76554b012a82b)) ### Miscellaneous Tasks From 400398dafdd3540817de06b89607431de3becd8b Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 04:04:24 +0000 Subject: [PATCH 057/209] chore: Publish `1.11.31` with `swc_core` `v26.4.5` --- bindings/Cargo.lock | 10 +++++----- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- packages/core/scripts/npm/darwin-arm64/package.json | 2 +- packages/core/scripts/npm/darwin-x64/package.json | 2 +- .../core/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/core/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../core/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/core/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/core/scripts/npm/linux-x64-musl/package.json | 2 +- .../core/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/core/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/core/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- packages/html/scripts/npm/darwin-arm64/package.json | 2 +- packages/html/scripts/npm/darwin-x64/package.json | 2 +- .../html/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/html/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../html/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/html/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/html/scripts/npm/linux-x64-musl/package.json | 2 +- .../html/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/html/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/html/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../minifier/scripts/npm/darwin-arm64/package.json | 2 +- packages/minifier/scripts/npm/darwin-x64/package.json | 2 +- .../scripts/npm/linux-arm-gnueabihf/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-musl/package.json | 2 +- .../minifier/scripts/npm/linux-x64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-x64-musl/package.json | 2 +- .../minifier/scripts/npm/win32-arm64-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-ia32-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-x64-msvc/package.json | 2 +- 38 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index b3d9c66b5488..11ff99e568d5 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -4593,7 +4593,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.552" +version = "0.91.553" dependencies = [ "anyhow", "par-core", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 03d227beda72..e619d91d2ae9 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 7e81da94dc5a..66b2afd7dbd7 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 9edce2b28d38..3c555a3f9de6 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.11.31-nightly-20250605.2" +version = "1.11.31" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index c8cc6a6c0f29..8f8f250aa6e4 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.552" +version = "0.91.553" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index c10300b444e2..329fd9705308 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index 990c1aa8c6c2..0680341d3882 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 50cb5227357f..143221eefac7 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index 2aa02c959822..edfa5564c061 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index e1a0100c233c..0c8d8247b2d3 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index d85e26234cc3..295f2b44d593 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index cefc82c93d71..39db4e0ae3d3 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index 6787a5216015..895a67d36113 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index 6b9ddbbeaba8..03019b5fc647 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 0d67cc56ed20..9f9038707ce5 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index 67eefdb3a61e..fecbc3d9da0a 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index 977f91c2021f..13f3ebcc3091 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index 0d6b409d732a..3eeb3170ebc1 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index 1ab9b2498fec..802242f669ce 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index 256a7905d8b9..cc23c37c6880 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 0e12b4589a6a..1ce5d70437ba 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index b9b8a11a1874..ceabe4f725e3 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index 2675067d62c4..ceec27a69cf3 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index c474388187ac..41a3d61d5fc1 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index e888130dbab0..bdd7db0e1b5f 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index 1f698b8e123c..be89b2eb7d04 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index 74e023d61c0a..996c914e38c8 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 5fecc0ef0393..51da3f524852 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index f05a5952bb1b..3e58c22de815 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index 0c9c88becfd1..1364cb9071ab 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index 793e1e08971f..038825181b30 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index d04c14563c14..efa61eedef20 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 1797bf4e42a4..c2cc9a86801e 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index d43a6f23ecdc..b40fecdeca3a 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index da9e1108a649..fc0152802a91 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index 336be7887d73..2d49c7643814 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index 1347b3e31156..460bcc1afcc6 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index 1278ae34647b..a6efb8a7cd9d 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.11.31-nightly-20250605.2", + "version": "1.11.31", "os": [ "win32" ], From 81fcd01680e8333154cbc1265d54d83b4b78eb02 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Thu, 5 Jun 2025 04:04:25 +0000 Subject: [PATCH 058/209] chore: Update changelog --- CHANGELOG-CORE.md | 6 ------ CHANGELOG.md | 16 +--------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index d44d7aedf704..ed95a09b2fe4 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -2493,9 +2493,6 @@ - **(cli)** Exclude non-files from get_files_list ([#9560](https://github.com/swc-project/swc/issues/9560)) ([85cc2bd](https://github.com/swc-project/swc/commit/85cc2bd79c3193cb0a8b54e4fce0efc1aa15b271)) -- **(es/codegen)** Ensure decorators are emitted first in TS paramters ([#9545](https://github.com/swc-project/swc/issues/9545)) ([47ef38d](https://github.com/swc-project/swc/commit/47ef38dc1d53918604481fd078c76554b012a82b)) - - - **(es/codegen)** Fix wrong sourcemap when there are new lines in tpl ([#9578](https://github.com/swc-project/swc/issues/9578)) ([cf74382](https://github.com/swc-project/swc/commit/cf74382ba0429c0d4f04428889cf53a5231fad7f)) @@ -2529,9 +2526,6 @@ -- **(bindings/node)** Fix type definition ([64ec111](https://github.com/swc-project/swc/commit/64ec1117697029895284e248d79698f802cf1aa8)) - - - **(es)** Update `wasmer` to `v4.3.7` ([#9557](https://github.com/swc-project/swc/issues/9557)) ([190d6f0](https://github.com/swc-project/swc/commit/190d6f06d9545e4206bdb53c0f1ba2d443a5a7ab)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f57e741f18..fec49a9af1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [1.11.31] - 2025-06-05 ### Bug Fixes @@ -2076,18 +2076,4 @@ - **(es)** Add tests for arm64 windows ([#9547](https://github.com/swc-project/swc/issues/9547)) ([9dd8f6f](https://github.com/swc-project/swc/commit/9dd8f6facf29817902ddf55ec0388061585cbf7d)) -## [1.7.25] - 2024-09-11 - -### Bug Fixes - - - -- **(es/codegen)** Ensure decorators are emitted first in TS paramters ([#9545](https://github.com/swc-project/swc/issues/9545)) ([47ef38d](https://github.com/swc-project/swc/commit/47ef38dc1d53918604481fd078c76554b012a82b)) - -### Miscellaneous Tasks - - - -- **(bindings/node)** Fix type definition ([64ec111](https://github.com/swc-project/swc/commit/64ec1117697029895284e248d79698f802cf1aa8)) - From 16e204d3fa44acfea087e2e8929b7989894cf7bc Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:22:09 +0200 Subject: [PATCH 059/209] fix(es/codegen): Don't call `cmt.get_leading` for dummy span (#10568) This was the only place where `Comments` were queried for dummy spans (`BytePos(0)`) --- .changeset/sixty-pans-help.md | 6 ++++++ crates/swc_ecma_codegen/src/lib.rs | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/sixty-pans-help.md diff --git a/.changeset/sixty-pans-help.md b/.changeset/sixty-pans-help.md new file mode 100644 index 000000000000..ca59346b7625 --- /dev/null +++ b/.changeset/sixty-pans-help.md @@ -0,0 +1,6 @@ +--- +swc_ecma_codegen: patch +swc_core: patch +--- + +Don't call `cmt.get_leading` for dummy span diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index dadd7a5d905c..3e599c0706f0 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -1382,6 +1382,10 @@ fn is_empty_comments(span: &Span, comments: &Option<&dyn Comments>) -> bool { fn span_has_leading_comment(cmt: &dyn Comments, span: Span) -> bool { let lo = span.lo; + if lo.is_dummy() { + return false; + } + // see #415 if let Some(cmt) = cmt.get_leading(lo) { if cmt.iter().any(|cmt| { From 649278679eab86e6cf167c170ecb49987559e26c Mon Sep 17 00:00:00 2001 From: bohan Date: Thu, 5 Jun 2025 22:59:47 +0800 Subject: [PATCH 060/209] refactor(es/parser): Extract `parse_jsx_attrs` (#10569) --- .../swc_ecma_lexer/src/common/parser/jsx.rs | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/crates/swc_ecma_lexer/src/common/parser/jsx.rs b/crates/swc_ecma_lexer/src/common/parser/jsx.rs index cf10b8b376bf..7e8ff5fbd550 100644 --- a/crates/swc_ecma_lexer/src/common/parser/jsx.rs +++ b/crates/swc_ecma_lexer/src/common/parser/jsx.rs @@ -242,6 +242,27 @@ fn parse_jsx_opening_element_at<'a, P: Parser<'a>>( parse_jsx_opening_element_after_name(p, start, name).map(Either::Right) } +#[inline(always)] +fn parse_jsx_attrs<'a, P: Parser<'a>>(p: &mut P) -> PResult> { + let mut attrs = Vec::with_capacity(8); + + while cur!(p, false).is_ok() { + trace_cur!(p, parse_jsx_opening__attrs_loop); + + if p.input_mut() + .cur() + .is_some_and(|cur| cur.is_slash() || cur.is_jsx_tag_end()) + { + break; + } + + let attr = parse_jsx_attr(p)?; + attrs.push(attr); + } + + Ok(attrs) +} + /// `jsxParseOpeningElementAfterName` fn parse_jsx_opening_element_after_name<'a, P: Parser<'a>>( p: &mut P, @@ -256,20 +277,8 @@ fn parse_jsx_opening_element_after_name<'a, P: Parser<'a>>( None }; - let mut attrs = Vec::new(); - while cur!(p, false).is_ok() { - trace_cur!(p, parse_jsx_opening__attrs_loop); - - if p.input_mut() - .cur() - .is_some_and(|cur| cur.is_slash() || cur.is_jsx_tag_end()) - { - break; - } + let attrs = parse_jsx_attrs(p)?; - let attr = parse_jsx_attr(p)?; - attrs.push(attr); - } let self_closing = p.input_mut().eat(&P::Token::DIV); if !p.input_mut().eat(&P::Token::JSX_TAG_END) & !(p.ctx().contains(Context::InForcedJsxContext) && p.input_mut().eat(&P::Token::GREATER)) From 3ac0a21288c780ef1267cfeba2662bc6a825b508 Mon Sep 17 00:00:00 2001 From: Joshua Hannaford Date: Thu, 5 Jun 2025 11:01:34 -0400 Subject: [PATCH 061/209] doc(contributing): Add a script to patch local projects (#10565) **Description:** This PR makes it easier to patch a local project with your local swc/core package. From the root project directory of `swc` you can now run ```bash ./scripts/patch-project.sh ``` This will then patch your local `Cargo.toml` and `Cargo.lock` files for you and if you have already added `@swc/core` to your package.json file, it will patch it to use your local path. --- CONTRIBUTING.md | 29 +++++++++++++++++ scripts/patch-project.sh | 69 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100755 scripts/patch-project.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 602d103dad3f..db3a31d537ad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -135,6 +135,35 @@ cargo test runner, e.g. cargo test -p swc_ecma_transforms --all-features ``` +### Overriding a local project's `@swc/core` package + +If you want to test your changes to SWC with a local project that uses `@swc/core`, you can use the `scripts/patch-project.sh` script to override the project's `@swc/core` dependency with your local version. + +Run the patch script from the repo root, providing the path to your project as the only argument: + + ```bash + ./scripts/patch-project.sh /path/to/your/project + ``` + +The script will: + +- Add necessary patches to `bindings/Cargo.toml` +- Update Cargo dependencies +- Build the project +- Update your project's `package.json` to use the local `@swc/core` + +If `@swc/core` is not found in your project's dependencies, the script will provide instructions for adding it based on your package manager (yarn, npm, or pnpm). + +To revert the changes: + +1. Restore the original Cargo files in this repository: + + ```bash + git restore bindings/Cargo.toml bindings/Cargo.lock + ``` + +2. Update your overriden project's `package.json` to use the published version of `@swc/core` + ## Pull requests After the pull request is made, one of the SWC project developers will review your code. diff --git a/scripts/patch-project.sh b/scripts/patch-project.sh new file mode 100755 index 000000000000..529dbef6b3c6 --- /dev/null +++ b/scripts/patch-project.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +set -eu + +# Check if path argument is provided +if [ $# -eq 0 ]; then + echo -e "\033[31mError\033[0m: Please provide a path to the directory containing \033[33mpackage.json\033[0m whose \033[33m@swc/core\033[0m dependency you want to patch" + exit 1 +fi + +TARGET_DIR="$1" +CURRENT_DIR=$(pwd) + +# Validate target directory exists +if [ ! -d "$TARGET_DIR" ]; then + echo -e "\033[31mError\033[0m: Directory \033[33m$TARGET_DIR\033[0m does not exist" + exit 1 +fi + +# Add patch section to Cargo.toml +echo '[patch.crates-io]' >> bindings/Cargo.toml +./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + +# Update cargo dependencies +(cd bindings && cargo update -p swc_core -p swc_fast_ts_strip) + +# Build the project +yarn build:dev + +# Check if package.json exists in target directory +if [ ! -f "$TARGET_DIR/package.json" ]; then + echo -e "\033[31mError\033[0m: \033[33mpackage.json\033[0m not found in \033[33m$TARGET_DIR\033[0m" + exit 1 +fi + +# Check if @swc/core exists in package.json +if ! grep -q '"@swc/core"' "$TARGET_DIR/package.json"; then + echo + echo -e "\033[31mError\033[0m: \033[33m@swc/core\033[0m not found in \033[33mpackage.json\033[0m" + echo + echo "Please run the following commands:" + echo + if [ -f "$TARGET_DIR/yarn.lock" ]; then + echo -e " \033[32m$\033[0m cd $TARGET_DIR" + echo -e " \033[32m$\033[0m yarn add -D \033[33m@swc/core\033[0m" + elif [ -f "$TARGET_DIR/package-lock.json" ]; then + echo -e " \033[32m$\033[0m cd $TARGET_DIR" + echo -e " \033[32m$\033[0m npm install --save-dev \033[33m@swc/core\033[0m" + elif [ -f "$TARGET_DIR/pnpm-lock.yaml" ]; then + echo -e " \033[32m$\033[0m cd $TARGET_DIR" + echo -e " \033[32m$\033[0m pnpm add -D @swc/core" + else + echo -e " Please add \033[33m@swc/core\033[0m to your devDependencies and install using your package manager" + fi + echo + echo "Then run:" + echo + echo -e " \033[32m$\033[0m cd $CURRENT_DIR" + echo -e " \033[32m$\033[0m git restore bindings/Cargo.toml bindings/Cargo.lock" + echo + echo "After that, you can run this script again." + exit 1 +fi + +# Update @swc/core in package.json +TEMP_FILE=$(mktemp) +sed 's#"@swc/core": "[^"]*"#"@swc/core": "'"$CURRENT_DIR"'/packages/core"#' "$TARGET_DIR/package.json" > "$TEMP_FILE" +mv "$TEMP_FILE" "$TARGET_DIR/package.json" + +echo "Successfully patched @swc/core in $TARGET_DIR/package.json" \ No newline at end of file From 72b1efeaec0931b17c9a7b0acd52be8de77d07dc Mon Sep 17 00:00:00 2001 From: bohan Date: Fri, 6 Jun 2025 00:05:21 +0800 Subject: [PATCH 062/209] test(es/parser): Enable jsx test (#10566) --- crates/swc_ecma_parser/src/parser/jsx/mod.rs | 120 ++++++++++++++++++ .../swc_ecma_parser/src/parser/jsx/tests.rs | 117 ----------------- crates/swc_ecma_parser/src/parser/mod.rs | 1 + 3 files changed, 121 insertions(+), 117 deletions(-) create mode 100644 crates/swc_ecma_parser/src/parser/jsx/mod.rs delete mode 100644 crates/swc_ecma_parser/src/parser/jsx/tests.rs diff --git a/crates/swc_ecma_parser/src/parser/jsx/mod.rs b/crates/swc_ecma_parser/src/parser/jsx/mod.rs new file mode 100644 index 000000000000..ca95138f8eb9 --- /dev/null +++ b/crates/swc_ecma_parser/src/parser/jsx/mod.rs @@ -0,0 +1,120 @@ +#[cfg(test)] +mod tests { + use swc_common::DUMMY_SP as span; + use swc_ecma_visit::assert_eq_ignore_span; + + use super::super::*; + + fn jsx(src: &'static str) -> Box { + test_parser( + src, + crate::Syntax::Es(crate::EsSyntax { + jsx: true, + ..Default::default() + }), + |p| p.parse_expr(), + ) + } + + #[test] + fn self_closing_01() { + assert_eq_ignore_span!( + jsx("
"), + Box::new(Expr::JSXElement(Box::new(JSXElement { + span, + opening: JSXOpeningElement { + span, + name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), + self_closing: true, + attrs: Vec::new(), + type_args: None, + }, + children: Vec::new(), + closing: None, + }))) + ); + } + + #[test] + fn normal_01() { + assert_eq_ignore_span!( + jsx("foo"), + Box::new(Expr::JSXElement(Box::new(JSXElement { + span, + opening: JSXOpeningElement { + span, + name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), + self_closing: false, + attrs: Vec::new(), + type_args: None, + }, + children: vec![JSXElementChild::JSXText(JSXText { + span, + raw: "foo".into(), + value: "foo".into(), + })], + closing: Some(JSXClosingElement { + span, + name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), + }) + }))) + ); + } + + #[test] + fn escape_in_attr() { + assert_eq_ignore_span!( + jsx(r#"
;"#), + Box::new(Expr::JSXElement(Box::new(JSXElement { + span, + opening: JSXOpeningElement { + span, + attrs: vec![JSXAttrOrSpread::JSXAttr(JSXAttr { + span, + name: JSXAttrName::Ident(IdentName::new("id".into(), span)), + value: Some(JSXAttrValue::Lit(Lit::Str(Str { + span, + value: "w < w".into(), + raw: Some("\"w < w\"".into()), + }))), + })], + name: JSXElementName::Ident(Ident::new_no_ctxt("div".into(), span)), + self_closing: true, + type_args: None, + }, + children: Vec::new(), + closing: None + }))) + ); + } + + #[test] + fn issue_584() { + assert_eq_ignore_span!( + jsx(r#";"#), + Box::new(Expr::JSXElement(Box::new(JSXElement { + span, + opening: JSXOpeningElement { + span, + name: JSXElementName::Ident(Ident::new_no_ctxt("test".into(), span)), + attrs: vec![JSXAttrOrSpread::JSXAttr(JSXAttr { + span, + name: JSXAttrName::Ident(IdentName::new("other".into(), span)), + value: Some(JSXAttrValue::JSXExprContainer(JSXExprContainer { + span, + expr: JSXExpr::Expr(Box::new(Expr::Lit(Lit::Num(Number { + span, + value: 4.0, + raw: Some("4".into()) + })))) + })), + })], + self_closing: true, + type_args: None, + }, + children: Vec::new(), + closing: None + }))) + ); + } +} diff --git a/crates/swc_ecma_parser/src/parser/jsx/tests.rs b/crates/swc_ecma_parser/src/parser/jsx/tests.rs deleted file mode 100644 index ef9c9bdc0165..000000000000 --- a/crates/swc_ecma_parser/src/parser/jsx/tests.rs +++ /dev/null @@ -1,117 +0,0 @@ -use swc_common::DUMMY_SP as span; -use swc_ecma_visit::assert_eq_ignore_span; - -use super::*; - -fn jsx(src: &'static str) -> Box { - test_parser( - src, - crate::Syntax::Es(crate::EsSyntax { - jsx: true, - ..Default::default() - }), - |p| p.parse_expr(), - ) -} - -#[test] -fn self_closing_01() { - assert_eq_ignore_span!( - jsx(""), - Box::new(Expr::JSXElement(Box::new(JSXElement { - span, - opening: JSXOpeningElement { - span, - name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), - self_closing: true, - attrs: Vec::new(), - type_args: None, - }, - children: Vec::new(), - closing: None, - }))) - ); -} - -#[test] -fn normal_01() { - assert_eq_ignore_span!( - jsx("foo"), - Box::new(Expr::JSXElement(Box::new(JSXElement { - span, - opening: JSXOpeningElement { - span, - name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), - self_closing: false, - attrs: Vec::new(), - type_args: None, - }, - children: vec![JSXElementChild::JSXText(JSXText { - span, - raw: "foo".into(), - value: "foo".into(), - })], - closing: Some(JSXClosingElement { - span, - name: JSXElementName::Ident(Ident::new_no_ctxt("a".into(), span)), - }) - }))) - ); -} - -#[test] -fn escape_in_attr() { - assert_eq_ignore_span!( - jsx(r#"
;"#), - Box::new(Expr::JSXElement(Box::new(JSXElement { - span, - opening: JSXOpeningElement { - span, - attrs: vec![JSXAttrOrSpread::JSXAttr(JSXAttr { - span, - name: JSXAttrName::Ident(IdentName::new("id".into(), span)), - value: Some(JSXAttrValue::Lit(Lit::Str(Str { - span, - value: "w < w".into(), - raw: Some("\"w < w\"".into()), - }))), - })], - name: JSXElementName::Ident(Ident::new_no_ctxt("div".into(), span)), - self_closing: true, - type_args: None, - }, - children: Vec::new(), - closing: None - }))) - ); -} - -#[test] -fn issue_584() { - assert_eq_ignore_span!( - jsx(r#";"#), - Box::new(Expr::JSXElement(Box::new(JSXElement { - span, - opening: JSXOpeningElement { - span, - name: JSXElementName::Ident(Ident::new_no_ctxt("test".into(), span)), - attrs: vec![JSXAttrOrSpread::JSXAttr(JSXAttr { - span, - name: JSXAttrName::Ident(IdentName::new("other".into(), span)), - value: Some(JSXAttrValue::JSXExprContainer(JSXExprContainer { - span, - expr: JSXExpr::Expr(Box::new(Expr::Lit(Lit::Num(Number { - span, - value: 4.0, - raw: Some("4".into()) - })))) - })), - })], - self_closing: true, - type_args: None, - }, - children: Vec::new(), - closing: None - }))) - ); -} diff --git a/crates/swc_ecma_parser/src/parser/mod.rs b/crates/swc_ecma_parser/src/parser/mod.rs index 5278f251a17f..81ae8aefd52e 100644 --- a/crates/swc_ecma_parser/src/parser/mod.rs +++ b/crates/swc_ecma_parser/src/parser/mod.rs @@ -27,6 +27,7 @@ mod macros; mod class_and_fn; mod expr; pub mod input; +mod jsx; mod pat; mod stmt; #[cfg(test)] From 26b41e86cb103fd6e9b76dcc9ed6625ef73ef9d0 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 6 Jun 2025 00:08:20 +0800 Subject: [PATCH 063/209] fix(@swc/types): Add `jsc.output.charset` (#10567) **Description:** Add TypeScript definition for `jsc.output.charset` Ref: - https://swc.rs/docs/configuration/compilation#jscoutputcharset - https://github.com/swc-project/swc/pull/4708 - https://github.com/swc-project/swc/pull/7258 --- bindings/binding_core_wasm/src/types.rs | 9 +++++++++ bindings/binding_minifier_wasm/src/types.rs | 9 +++++++++ packages/types/index.ts | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/bindings/binding_core_wasm/src/types.rs b/bindings/binding_core_wasm/src/types.rs index 5bb0c0a8b6bb..493309310a95 100644 --- a/bindings/binding_core_wasm/src/types.rs +++ b/bindings/binding_core_wasm/src/types.rs @@ -684,6 +684,15 @@ export interface JscConfig { minify?: JsMinifyOptions; preserveAllComments?: boolean; + + output?: { + /** + * This can be used to keep the output ascii-only. + * If this option is set, `minify.format.asciiOnly` will be ignored. + * @default 'utf8' + */ + charset?: 'utf8' | 'ascii'; + } } export type JscTarget = diff --git a/bindings/binding_minifier_wasm/src/types.rs b/bindings/binding_minifier_wasm/src/types.rs index 8ac051b02525..4f8c29dcf060 100644 --- a/bindings/binding_minifier_wasm/src/types.rs +++ b/bindings/binding_minifier_wasm/src/types.rs @@ -684,6 +684,15 @@ export interface JscConfig { minify?: JsMinifyOptions; preserveAllComments?: boolean; + + output?: { + /** + * This can be used to keep the output ascii-only. + * If this option is set, `minify.format.asciiOnly` will be ignored. + * @default 'utf8' + */ + charset?: 'utf8' | 'ascii'; + } } export type JscTarget = diff --git a/packages/types/index.ts b/packages/types/index.ts index 3146b66d8d82..e8e7fb279e88 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -704,6 +704,15 @@ export interface JscConfig { minify?: JsMinifyOptions; preserveAllComments?: boolean; + + output?: { + /** + * This can be used to keep the output ascii-only. + * If this option is set, `minify.format.asciiOnly` will be ignored. + * @default 'utf8' + */ + charset?: 'utf8' | 'ascii'; + } } export type JscTarget = From 41a572fdfd32b01b76ee0957a1ccd3d0f2d44d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Thu, 5 Jun 2025 09:08:55 -0700 Subject: [PATCH 064/209] chore: Publish `@swc/types@0.1.22` --- packages/types/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/package.json b/packages/types/package.json index 8fba84bc56c0..2aef023a4421 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,7 +1,7 @@ { "name": "@swc/types", "packageManager": "yarn@4.0.2", - "version": "0.1.21", + "version": "0.1.22", "description": "Typings for the swc project.", "types": "./index.d.ts", "sideEffects": false, From 7e4cd9ad4fcd28bc179c75020acb9a596d405efb Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 6 Jun 2025 03:53:35 +0800 Subject: [PATCH 065/209] fix(es/typescript): Pass `native_class_properties` (#10561) **Related issue:** - Closes: #10436 - Closes: #10536 --- .changeset/itchy-tables-hide.md | 6 + .../binding_core_wasm/__tests__/simple.js | 24 +- crates/swc/src/builder.rs | 274 +----------------- crates/swc/src/config/mod.rs | 205 +++++++++---- crates/swc/src/lib.rs | 3 +- .../2022_TS/output/index.ts | 6 +- .../rspack-10260/es2020_default/input/.swcrc | 8 + .../es2020_default/input/index.ts | 4 + .../es2020_default/output/index.ts | 9 + .../rspack-10260/es2020_set/input/.swcrc | 11 + .../rspack-10260/es2020_set/input/index.ts | 4 + .../rspack-10260/es2020_set/output/index.ts | 6 + .../rspack-10260/es2022_default/input/.swcrc | 8 + .../es2022_default/input/index.ts | 4 + .../es2022_default/output/index.ts | 7 + .../rspack-10260/es2022_define/input/.swcrc | 11 + .../rspack-10260/es2022_define/input/index.ts | 4 + .../es2022_define/output/index.ts | 7 + .../rspack-10260/es2022_set/input/.swcrc | 11 + .../rspack-10260/es2022_set/input/index.ts | 4 + .../rspack-10260/es2022_set/output/index.ts | 6 + ...rtyToPropertyDeclarationES2022.1.normal.js | 57 ++-- ...yToPropertyDeclarationES2022.2.minified.js | 9 + ...rtyToPropertyDeclarationESNext.1.normal.js | 57 ++-- ...yToPropertyDeclarationESNext.2.minified.js | 9 + .../defineProperty(target=esnext).1.normal.js | 19 +- .../nodeModulesAtTypesPriority.1.normal.js | 2 +- .../nodeModulesAtTypesPriority.2.minified.js | 2 +- .../redefinedPararameterProperty.1.normal.js | 4 +- .../src/config.rs | 2 +- 30 files changed, 361 insertions(+), 422 deletions(-) create mode 100644 .changeset/itchy-tables-hide.md create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_default/input/.swcrc create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_default/input/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_default/output/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_set/input/.swcrc create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_set/input/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2020_set/output/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_default/input/.swcrc create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_default/input/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_default/output/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_define/input/.swcrc create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_define/input/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_define/output/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_set/input/.swcrc create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_set/input/index.ts create mode 100644 crates/swc/tests/fixture/rspack-10260/es2022_set/output/index.ts diff --git a/.changeset/itchy-tables-hide.md b/.changeset/itchy-tables-hide.md new file mode 100644 index 000000000000..60bb13bdd5bd --- /dev/null +++ b/.changeset/itchy-tables-hide.md @@ -0,0 +1,6 @@ +--- +swc: major +swc_ecma_transforms_typescript: patch +--- + +fix(es/typescript): Pass `native_class_properties` diff --git a/bindings/binding_core_wasm/__tests__/simple.js b/bindings/binding_core_wasm/__tests__/simple.js index 63f7c7e35ef8..f521ee1d9f61 100644 --- a/bindings/binding_core_wasm/__tests__/simple.js +++ b/bindings/binding_core_wasm/__tests__/simple.js @@ -113,8 +113,8 @@ describe("parse", () => { "ctxt": 2, "optional": false, "span": { - "end": 289, - "start": 286, + "end": 254, + "start": 251, }, "type": "Identifier", "value": "Foo", @@ -122,8 +122,8 @@ describe("parse", () => { "implements": [], "isAbstract": false, "span": { - "end": 292, - "start": 280, + "end": 257, + "start": 245, }, "superClass": null, "superTypeParams": null, @@ -133,8 +133,8 @@ describe("parse", () => { ], "interpreter": null, "span": { - "end": 292, - "start": 280, + "end": 257, + "start": 245, }, "type": "Module", } @@ -159,8 +159,8 @@ describe("parse", () => { "ctxt": 2, "optional": false, "span": { - "end": 302, - "start": 299, + "end": 267, + "start": 264, }, "type": "Identifier", "value": "Foo", @@ -168,8 +168,8 @@ describe("parse", () => { "implements": [], "isAbstract": false, "span": { - "end": 305, - "start": 293, + "end": 270, + "start": 258, }, "superClass": null, "superTypeParams": null, @@ -179,8 +179,8 @@ describe("parse", () => { ], "interpreter": null, "span": { - "end": 305, - "start": 293, + "end": 270, + "start": 258, }, "type": "Module", } diff --git a/crates/swc/src/builder.rs b/crates/swc/src/builder.rs index efc58c916a8b..dedd235d72c0 100644 --- a/crates/swc/src/builder.rs +++ b/crates/swc/src/builder.rs @@ -1,270 +1,16 @@ -use std::sync::Arc; - -use compat::es2015::regenerator; -use either::Either; -use rustc_hash::FxHashMap; -use swc_atoms::Atom; -use swc_common::{ - comments::Comments, errors::Handler, sync::Lrc, util::take::Take, FileName, Mark, SourceMap, -}; -use swc_ecma_ast::{EsVersion, Module, Pass, Script}; +use swc_common::{comments::Comments, sync::Lrc, util::take::Take, Mark, SourceMap}; +use swc_ecma_ast::{Module, Script}; use swc_ecma_minifier::option::{terser::TerserTopLevelOptions, MinifyOptions}; -use swc_ecma_parser::Syntax; -use swc_ecma_preset_env::Caniuse; -use swc_ecma_transforms::{ - compat, - fixer::{fixer, paren_remover}, - helpers, - hygiene::{self, hygiene_with_config}, - modules::{self, path::ImportResolver}, - optimization::const_modules, - resolver, Assumptions, -}; -use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}; -use swc_visit::Optional; - -use crate::config::{GlobalPassOption, JsMinifyOptions, ModuleConfig}; - -/// Builder is used to create a high performance `Compiler`. -pub struct PassBuilder<'a, 'b, P: Pass> { - cm: &'a Arc, - handler: &'b Handler, - env: Option, - pass: P, - /// [Mark] for top level bindings . - top_level_mark: Mark, - - /// [Mark] for unresolved refernces. - unresolved_mark: Mark, - - target: EsVersion, - loose: bool, - assumptions: Assumptions, - hygiene: Option, - fixer: bool, - inject_helpers: bool, - minify: Option, - regenerator: regenerator::Config, -} +use swc_ecma_transforms::{hygiene::hygiene_with_config, resolver}; +use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith}; -impl<'a, 'b, P: Pass> PassBuilder<'a, 'b, P> { - pub fn new( - cm: &'a Arc, - handler: &'b Handler, - loose: bool, - assumptions: Assumptions, - top_level_mark: Mark, - unresolved_mark: Mark, - pass: P, - ) -> Self { - PassBuilder { - cm, - handler, - env: None, - pass, - top_level_mark, - unresolved_mark, - target: EsVersion::Es5, - loose, - assumptions, - hygiene: Some(Default::default()), - fixer: true, - inject_helpers: true, - minify: None, - regenerator: Default::default(), - } - } - - pub fn then(self, next: N) -> PassBuilder<'a, 'b, (P, N)> - where - N: Pass, - { - let pass = (self.pass, next); - PassBuilder { - cm: self.cm, - handler: self.handler, - env: self.env, - pass, - top_level_mark: self.top_level_mark, - unresolved_mark: self.unresolved_mark, - target: self.target, - loose: self.loose, - assumptions: self.assumptions, - hygiene: self.hygiene, - fixer: self.fixer, - inject_helpers: self.inject_helpers, - minify: self.minify, - regenerator: self.regenerator, - } - } - - pub fn skip_helper_injection(mut self, skip: bool) -> Self { - self.inject_helpers = !skip; - self - } - - pub fn minify(mut self, options: Option) -> Self { - self.minify = options; - self - } - - /// Note: fixer is enabled by default. - pub fn fixer(mut self, enable: bool) -> Self { - self.fixer = enable; - self - } - - /// Note: hygiene is enabled by default. - /// - /// If you pass [None] to this method, the `hygiene` pass will be disabled. - pub fn hygiene(mut self, config: Option) -> Self { - self.hygiene = config; - self - } - - pub fn const_modules( - self, - globals: FxHashMap>, - ) -> PassBuilder<'a, 'b, (P, impl Pass)> { - let cm = self.cm.clone(); - self.then(const_modules(cm, globals)) - } - - pub fn inline_globals(self, c: GlobalPassOption) -> PassBuilder<'a, 'b, (P, impl Pass)> { - let pass = c.build(self.cm, self.handler, self.unresolved_mark); - self.then(pass) - } - - pub fn target(mut self, target: EsVersion) -> Self { - self.target = target; - self - } - - pub fn preset_env(mut self, env: Option) -> Self { - self.env = env.map(Into::into); - self - } - - pub fn regenerator(mut self, config: regenerator::Config) -> Self { - self.regenerator = config; - self - } - - /// # Arguments - /// ## module - /// - Use `None` if you want swc to emit import statements. - /// - /// - /// Returned pass includes - /// - /// - compatibility helper - /// - module handler - /// - helper injector - /// - identifier hygiene handler if enabled - /// - fixer if enabled - pub fn finalize<'cmt>( - self, - _syntax: Syntax, - module: Option, - comments: Option<&'cmt dyn Comments>, - resolver: Option<(FileName, Arc)>, - ) -> impl 'cmt + Pass - where - P: 'cmt, - { - let (need_analyzer, import_interop, ignore_dynamic) = match module { - Some(ModuleConfig::CommonJs(ref c)) => (true, c.import_interop(), c.ignore_dynamic), - Some(ModuleConfig::Amd(ref c)) => { - (true, c.config.import_interop(), c.config.ignore_dynamic) - } - Some(ModuleConfig::Umd(ref c)) => { - (true, c.config.import_interop(), c.config.ignore_dynamic) - } - Some(ModuleConfig::SystemJs(_)) - | Some(ModuleConfig::Es6(..)) - | Some(ModuleConfig::NodeNext(..)) - | None => (false, true.into(), true), - }; - - let feature_config = self.env.as_ref().map(|e| e.get_feature_config()); - - // compat - let compat_pass = { - if let Some(env_config) = self.env { - Either::Left(swc_ecma_preset_env::transform_from_env( - self.unresolved_mark, - comments, - env_config, - self.assumptions, - )) - } else { - Either::Right(swc_ecma_preset_env::transform_from_es_version( - self.unresolved_mark, - comments, - self.target, - self.assumptions, - self.loose, - )) - } - }; - - let is_mangler_enabled = self - .minify - .as_ref() - .map(|v| v.mangle.is_obj() || v.mangle.is_true()) - .unwrap_or(false); - - ( - self.pass, - Optional::new( - paren_remover(comments.map(|v| v as &dyn Comments)), - self.fixer, - ), - compat_pass, - // module / helper - Optional::new( - modules::import_analysis::import_analyzer(import_interop, ignore_dynamic), - need_analyzer, - ), - Optional::new( - helpers::inject_helpers(self.unresolved_mark), - self.inject_helpers, - ), - ModuleConfig::build( - self.cm.clone(), - comments, - module, - self.unresolved_mark, - resolver, - |f| { - feature_config - .as_ref() - .map_or_else(|| self.target.caniuse(f), |env| env.caniuse(f)) - }, - ), - visit_mut_pass(MinifierPass { - options: self.minify, - cm: self.cm.clone(), - comments, - top_level_mark: self.top_level_mark, - }), - Optional::new( - hygiene_with_config(swc_ecma_transforms_base::hygiene::Config { - top_level_mark: self.top_level_mark, - ..self.hygiene.clone().unwrap_or_default() - }), - self.hygiene.is_some() && !is_mangler_enabled, - ), - Optional::new(fixer(comments.map(|v| v as &dyn Comments)), self.fixer), - ) - } -} +use crate::config::JsMinifyOptions; -struct MinifierPass<'a> { - options: Option, - cm: Lrc, - comments: Option<&'a dyn Comments>, - top_level_mark: Mark, +pub struct MinifierPass<'a> { + pub options: Option, + pub cm: Lrc, + pub comments: Option<&'a dyn Comments>, + pub top_level_mark: Mark, } impl VisitMut for MinifierPass<'_> { diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index cefa8b4720b5..9d3112be234f 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -7,6 +7,7 @@ use std::{ use anyhow::{bail, Context, Error}; use dashmap::DashMap; +use either::Either; use indexmap::IndexMap; use once_cell::sync::Lazy; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; @@ -38,10 +39,12 @@ use swc_ecma_loader::resolvers::{ pub use swc_ecma_minifier::js::*; use swc_ecma_minifier::option::terser::TerserTopLevelOptions; use swc_ecma_parser::{parse_file_as_expr, Syntax, TsSyntax}; -use swc_ecma_preset_env::Feature; +use swc_ecma_preset_env::{Caniuse, Feature}; pub use swc_ecma_transforms::proposals::DecoratorVersion; use swc_ecma_transforms::{ - hygiene, + fixer::{fixer, paren_remover}, + helpers, + hygiene::{self, hygiene_with_config}, modules::{ self, path::{ImportResolver, NodeImportResolver, Resolver}, @@ -65,12 +68,13 @@ use swc_ecma_transforms_optimization::{ GlobalExprMap, }; use swc_ecma_utils::NodeIgnoringSpan; -use swc_ecma_visit::VisitMutWith; +use swc_ecma_visit::{visit_mut_pass, VisitMutWith}; use swc_visit::Optional; pub use crate::plugin::PluginConfig; use crate::{ - builder::PassBuilder, dropped_comments_preserver::dropped_comments_preserver, SwcImportResolver, + builder::MinifierPass, dropped_comments_preserver::dropped_comments_preserver, + SwcImportResolver, }; #[cfg(test)] @@ -427,8 +431,6 @@ impl Options { }); } - let regenerator = transform.regenerator.clone(); - let preserve_comments = if preserve_all_comments { BoolOr::Bool(true) } else { @@ -550,34 +552,102 @@ impl Options { let paths = paths.into_iter().collect(); let resolver = ModuleConfig::get_resolver(&base_url, paths, base, cfg.module.as_ref()); - let pass = PassBuilder::new( - cm, - handler, - loose, - assumptions, - top_level_mark, - unresolved_mark, - pass, - ) - .target(es_version) - .skip_helper_injection(self.skip_helper_injection) - .minify(js_minify) - .hygiene(if self.disable_hygiene { + let target = es_version; + let inject_helpers = !self.skip_helper_injection; + let fixer_enabled = !self.disable_fixer; + let hygiene_config = if self.disable_hygiene { None } else { Some(hygiene::Config { keep_class_names, ..Default::default() }) - }) - .fixer(!self.disable_fixer) - .preset_env(cfg.env) - .regenerator(regenerator) - .finalize( - syntax, - cfg.module, - comments.map(|v| v as _), - resolver.clone(), + }; + let env = cfg.env.map(Into::into); + + // Implementing finalize logic directly + let (need_analyzer, import_interop, ignore_dynamic) = match cfg.module { + Some(ModuleConfig::CommonJs(ref c)) => (true, c.import_interop(), c.ignore_dynamic), + Some(ModuleConfig::Amd(ref c)) => { + (true, c.config.import_interop(), c.config.ignore_dynamic) + } + Some(ModuleConfig::Umd(ref c)) => { + (true, c.config.import_interop(), c.config.ignore_dynamic) + } + Some(ModuleConfig::SystemJs(_)) + | Some(ModuleConfig::Es6(..)) + | Some(ModuleConfig::NodeNext(..)) + | None => (false, true.into(), true), + }; + + let feature_config = env + .as_ref() + .map(|e: &swc_ecma_preset_env::EnvConfig| e.get_feature_config()); + + // compat + let compat_pass = { + if let Some(env_config) = env { + Either::Left(swc_ecma_preset_env::transform_from_env( + unresolved_mark, + comments.map(|v| v as &dyn Comments), + env_config, + assumptions, + )) + } else { + Either::Right(swc_ecma_preset_env::transform_from_es_version( + unresolved_mark, + comments.map(|v| v as &dyn Comments), + target, + assumptions, + loose, + )) + } + }; + + let is_mangler_enabled = js_minify + .as_ref() + .map(|v| v.mangle.is_obj() || v.mangle.is_true()) + .unwrap_or(false); + + let built_pass = ( + pass, + Optional::new( + paren_remover(comments.map(|v| v as &dyn Comments)), + fixer_enabled, + ), + compat_pass, + // module / helper + Optional::new( + modules::import_analysis::import_analyzer(import_interop, ignore_dynamic), + need_analyzer, + ), + Optional::new(helpers::inject_helpers(unresolved_mark), inject_helpers), + ModuleConfig::build( + cm.clone(), + comments.map(|v| v as &dyn Comments), + cfg.module, + unresolved_mark, + resolver.clone(), + |f| { + feature_config + .as_ref() + .map_or_else(|| target.caniuse(f), |env| env.caniuse(f)) + }, + ), + visit_mut_pass(MinifierPass { + options: js_minify, + cm: cm.clone(), + comments: comments.map(|v| v as &dyn Comments), + top_level_mark, + }), + Optional::new( + hygiene_with_config(swc_ecma_transforms_base::hygiene::Config { + top_level_mark, + ..hygiene_config.clone().unwrap_or_default() + }), + hygiene_config.is_some() && !is_mangler_enabled, + ), + Optional::new(fixer(comments.map(|v| v as &dyn Comments)), fixer_enabled), ); let keep_import_attributes = experimental.keep_import_attributes.into_bool(); @@ -630,7 +700,7 @@ impl Options { skipped. Refer https://github.com/swc-project/swc/issues/3934 for the details.", ); - Box::new(noop()) + Box::new(noop_pass()) } }; @@ -695,36 +765,53 @@ impl Options { // keep_import_assertions is false. ( Optional::new(import_attributes(), !keep_import_attributes), - Optional::new( - typescript::tsx::>( - cm.clone(), - typescript::Config { - import_export_assign_config, - verbatim_module_syntax, - ..Default::default() - }, - typescript::TsxConfig { - pragma: Some( - transform - .react - .pragma - .clone() - .unwrap_or_else(default_pragma), - ), - pragma_frag: Some( - transform - .react - .pragma_frag - .clone() - .unwrap_or_else(default_pragma_frag), + { + let native_class_properties = !assumptions.set_public_class_fields + && feature_config.as_ref().map_or_else( + || target.caniuse(Feature::ClassProperties), + |env| env.caniuse(Feature::ClassProperties), + ); + + let ts_config = typescript::Config { + import_export_assign_config, + verbatim_module_syntax, + native_class_properties, + ..Default::default() + }; + + ( + Optional::new( + typescript::typescript(ts_config, unresolved_mark, top_level_mark), + syntax.typescript() && !syntax.jsx(), + ), + Optional::new( + typescript::tsx::>( + cm.clone(), + ts_config, + typescript::TsxConfig { + pragma: Some( + transform + .react + .pragma + .clone() + .unwrap_or_else(default_pragma), + ), + pragma_frag: Some( + transform + .react + .pragma_frag + .clone() + .unwrap_or_else(default_pragma_frag), + ), + }, + comments.map(|v| v as _), + unresolved_mark, + top_level_mark, ), - }, - comments.map(|v| v as _), - unresolved_mark, - top_level_mark, - ), - syntax.typescript(), - ), + syntax.typescript() && syntax.jsx(), + ), + ) + }, ), ( plugin_transforms.take(), @@ -740,7 +827,7 @@ impl Options { ), syntax.jsx(), ), - pass, + built_pass, Optional::new(jest::jest(), transform.hidden.jest.into_bool()), Optional::new( dropped_comments_preserver(comments.cloned()), diff --git a/crates/swc/src/lib.rs b/crates/swc/src/lib.rs index 2b86c1b1f4bb..b048f8629999 100644 --- a/crates/swc/src/lib.rs +++ b/crates/swc/src/lib.rs @@ -160,7 +160,6 @@ use swc_typescript::fast_dts::FastDts; use tracing::warn; use url::Url; -pub use crate::builder::PassBuilder; use crate::config::{ BuiltInput, Config, ConfigFile, InputSourceMap, IsModule, JsMinifyCommentOption, JsMinifyOptions, Options, OutputCharset, Rc, RootMode, SourceMapsConfig, @@ -939,7 +938,7 @@ impl Compiler { /// You can use custom pass with this method. /// - /// There exists a [PassBuilder] to help building custom passes. + /// Pass building logic has been inlined into the configuration system. #[tracing::instrument(skip_all)] pub fn process_js( &self, diff --git a/crates/swc/tests/fixture/issues-6xxx/6985/useDefineForClassFields/2022_TS/output/index.ts b/crates/swc/tests/fixture/issues-6xxx/6985/useDefineForClassFields/2022_TS/output/index.ts index 6596a36a174b..5ee574068538 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6985/useDefineForClassFields/2022_TS/output/index.ts +++ b/crates/swc/tests/fixture/issues-6xxx/6985/useDefineForClassFields/2022_TS/output/index.ts @@ -1,12 +1,10 @@ class Foo { foo; - a; - #b; + a = 1; + #b = 2; static c = 3; static #d = 4; constructor(foo){ this.foo = foo; - this.a = 1; - this.#b = 2; } } diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_default/input/.swcrc b/crates/swc/tests/fixture/rspack-10260/es2020_default/input/.swcrc new file mode 100644 index 000000000000..4361eaf8926a --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_default/input/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2020" + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_default/input/index.ts b/crates/swc/tests/fixture/rspack-10260/es2020_default/input/index.ts new file mode 100644 index 000000000000..5af135118ab2 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_default/input/index.ts @@ -0,0 +1,4 @@ +new class Foo { + a = (console.log(1), 1); + constructor(public b = (console.log(2), 2)) {} +}; \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_default/output/index.ts b/crates/swc/tests/fixture/rspack-10260/es2020_default/output/index.ts new file mode 100644 index 000000000000..2b805aaab4e8 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_default/output/index.ts @@ -0,0 +1,9 @@ +var _define_property = require("@swc/helpers/_/_define_property"); +new class Foo { + constructor(b = (console.log(2), 2)){ + _define_property._(this, "b", void 0); + _define_property._(this, "a", void 0); + this.b = b; + this.a = (console.log(1), 1); + } +}; diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_set/input/.swcrc b/crates/swc/tests/fixture/rspack-10260/es2020_set/input/.swcrc new file mode 100644 index 000000000000..c69a2684de51 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_set/input/.swcrc @@ -0,0 +1,11 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2020", + "transform": { + "useDefineForClassFields": false + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_set/input/index.ts b/crates/swc/tests/fixture/rspack-10260/es2020_set/input/index.ts new file mode 100644 index 000000000000..5af135118ab2 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_set/input/index.ts @@ -0,0 +1,4 @@ +new class Foo { + a = (console.log(1), 1); + constructor(public b = (console.log(2), 2)) {} +}; \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2020_set/output/index.ts b/crates/swc/tests/fixture/rspack-10260/es2020_set/output/index.ts new file mode 100644 index 000000000000..94dbc9211c1d --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2020_set/output/index.ts @@ -0,0 +1,6 @@ +new class Foo { + constructor(b = (console.log(2), 2)){ + this.b = b; + this.a = (console.log(1), 1); + } +}; diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_default/input/.swcrc b/crates/swc/tests/fixture/rspack-10260/es2022_default/input/.swcrc new file mode 100644 index 000000000000..04308912f261 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_default/input/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2022" + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_default/input/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_default/input/index.ts new file mode 100644 index 000000000000..5af135118ab2 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_default/input/index.ts @@ -0,0 +1,4 @@ +new class Foo { + a = (console.log(1), 1); + constructor(public b = (console.log(2), 2)) {} +}; \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_default/output/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_default/output/index.ts new file mode 100644 index 000000000000..d99c11308aa0 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_default/output/index.ts @@ -0,0 +1,7 @@ +new class Foo { + b; + a = (console.log(1), 1); + constructor(b = (console.log(2), 2)){ + this.b = b; + } +}; diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_define/input/.swcrc b/crates/swc/tests/fixture/rspack-10260/es2022_define/input/.swcrc new file mode 100644 index 000000000000..d9fc163c2415 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_define/input/.swcrc @@ -0,0 +1,11 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2022", + "transform": { + "useDefineForClassFields": true + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_define/input/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_define/input/index.ts new file mode 100644 index 000000000000..5af135118ab2 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_define/input/index.ts @@ -0,0 +1,4 @@ +new class Foo { + a = (console.log(1), 1); + constructor(public b = (console.log(2), 2)) {} +}; \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_define/output/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_define/output/index.ts new file mode 100644 index 000000000000..d99c11308aa0 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_define/output/index.ts @@ -0,0 +1,7 @@ +new class Foo { + b; + a = (console.log(1), 1); + constructor(b = (console.log(2), 2)){ + this.b = b; + } +}; diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_set/input/.swcrc b/crates/swc/tests/fixture/rspack-10260/es2022_set/input/.swcrc new file mode 100644 index 000000000000..ecc47f44ec91 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_set/input/.swcrc @@ -0,0 +1,11 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2022", + "transform": { + "useDefineForClassFields": false + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_set/input/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_set/input/index.ts new file mode 100644 index 000000000000..5af135118ab2 --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_set/input/index.ts @@ -0,0 +1,4 @@ +new class Foo { + a = (console.log(1), 1); + constructor(public b = (console.log(2), 2)) {} +}; \ No newline at end of file diff --git a/crates/swc/tests/fixture/rspack-10260/es2022_set/output/index.ts b/crates/swc/tests/fixture/rspack-10260/es2022_set/output/index.ts new file mode 100644 index 000000000000..94dbc9211c1d --- /dev/null +++ b/crates/swc/tests/fixture/rspack-10260/es2022_set/output/index.ts @@ -0,0 +1,6 @@ +new class Foo { + constructor(b = (console.log(2), 2)){ + this.b = b; + this.a = (console.log(1), 1); + } +}; diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js index 79f3e594bfd4..4be280e33f56 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.1.normal.js @@ -1,30 +1,28 @@ //// [assignParameterPropertyToPropertyDeclarationES2022.ts] class C { foo; - qux; - bar; - quiz; - quench; - quanch; + qux = this.bar // should error + ; + bar = this.foo // should error + ; + quiz = this.bar // ok + ; + quench = this.m1() // ok + ; + quanch = this.m3() // should error + ; m1() { this.foo; // ok } - m3; + m3 = function() {}; constructor(foo){ this.foo = foo; - this.qux = this.bar; // should error - this.bar = this.foo; // should error - this.quiz = this.bar; // ok - this.quench = this.m1(); // ok - this.quanch = this.m3(); // should error - this.m3 = function() {}; - this.quim = this.baz; // should error - this.baz = this.foo; // should error - this.quid = this.baz; // ok } - quim; - baz; - quid; + quim = this.baz // should error + ; + baz = this.foo; + quid = this.baz // ok + ; m2() { this.foo; // ok } @@ -35,12 +33,10 @@ class D extends C { } class E { foo2; - bar; - foo1; + bar = ()=>this.foo1 + this.foo2; + foo1 = ''; constructor(foo2){ this.foo2 = foo2; - this.bar = ()=>this.foo1 + this.foo2; // both ok - this.foo1 = ''; } } class F { @@ -51,23 +47,20 @@ class F { } class G { p1; - Inner; + Inner = class extends G { + p2 = this.p1; + }; constructor(p1){ this.p1 = p1; - this.Inner = class extends G { - p2 = this.p1; - }; } } class H { p1; constructor(p1){ this.p1 = p1; - this.p2 = ()=>{ - return this.p1.foo; - }; - this.p3 = ()=>this.p1.foo; } - p2; - p3; + p2 = ()=>{ + return this.p1.foo; + }; + p3 = ()=>this.p1.foo; } diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.2.minified.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.2.minified.js index 657075a7f928..8ccbcf96e6ec 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.2.minified.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationES2022.2.minified.js @@ -5,3 +5,12 @@ class F { }; p1 = 0; } +class G { + p1; + Inner = class extends G { + p2 = this.p1; + }; + constructor(p1){ + this.p1 = p1; + } +} diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js index 5f25c99517f0..60c3d81ac0d8 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.1.normal.js @@ -1,30 +1,28 @@ //// [assignParameterPropertyToPropertyDeclarationESNext.ts] class C { foo; - qux; - bar; - quiz; - quench; - quanch; + qux = this.bar // should error + ; + bar = this.foo // should error + ; + quiz = this.bar // ok + ; + quench = this.m1() // ok + ; + quanch = this.m3() // should error + ; m1() { this.foo; // ok } - m3; + m3 = function() {}; constructor(foo){ this.foo = foo; - this.qux = this.bar; // should error - this.bar = this.foo; // should error - this.quiz = this.bar; // ok - this.quench = this.m1(); // ok - this.quanch = this.m3(); // should error - this.m3 = function() {}; - this.quim = this.baz; // should error - this.baz = this.foo; // should error - this.quid = this.baz; // ok } - quim; - baz; - quid; + quim = this.baz // should error + ; + baz = this.foo; + quid = this.baz // ok + ; m2() { this.foo; // ok } @@ -35,12 +33,10 @@ class D extends C { } class E { foo2; - bar; - foo1; + bar = ()=>this.foo1 + this.foo2; + foo1 = ''; constructor(foo2){ this.foo2 = foo2; - this.bar = ()=>this.foo1 + this.foo2; // both ok - this.foo1 = ''; } } class F { @@ -51,23 +47,20 @@ class F { } class G { p1; - Inner; + Inner = class extends G { + p2 = this.p1; + }; constructor(p1){ this.p1 = p1; - this.Inner = class extends G { - p2 = this.p1; - }; } } class H { p1; constructor(p1){ this.p1 = p1; - this.p2 = ()=>{ - return this.p1.foo; - }; - this.p3 = ()=>this.p1.foo; } - p2; - p3; + p2 = ()=>{ + return this.p1.foo; + }; + p3 = ()=>this.p1.foo; } diff --git a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.2.minified.js b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.2.minified.js index e4bc0fec0bd7..3a46a0775afd 100644 --- a/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.2.minified.js +++ b/crates/swc/tests/tsc-references/assignParameterPropertyToPropertyDeclarationESNext.2.minified.js @@ -5,3 +5,12 @@ class F { }; p1 = 0; } +class G { + p1; + Inner = class extends G { + p2 = this.p1; + }; + constructor(p1){ + this.p1 = p1; + } +} diff --git a/crates/swc/tests/tsc-references/defineProperty(target=esnext).1.normal.js b/crates/swc/tests/tsc-references/defineProperty(target=esnext).1.normal.js index f1938acbf349..293bac39f731 100644 --- a/crates/swc/tests/tsc-references/defineProperty(target=esnext).1.normal.js +++ b/crates/swc/tests/tsc-references/defineProperty(target=esnext).1.normal.js @@ -2,30 +2,25 @@ var x = "p"; class A { y; - a; + a = this.y; b; c; - ["computed"]; - [_x = x]; + ["computed"] = 13; + [x] = 14; m() {} constructor(y){ this.y = y; - this.a = this.y; - this["computed"] = 13; - this[_x] = 14; - this.z = this.y; } - z; + z = this.y; } class B { a; } class C extends B { ka; - z; + z = this.ka; constructor(ka){ - super(), this.ka = ka, this.z = this.ka, this.ki = this.ka; + super(), this.ka = ka; } - ki; + ki = this.ka; } -var _x; diff --git a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js index bca1bdea4ff2..0aa9067e18af 100644 --- a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js +++ b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js @@ -16,4 +16,4 @@ export { }; //// [/packages/a/node_modules/redux/index.js] module.exports = {}; //// [/packages/a/index.ts] -import React from "react"; +export { }; diff --git a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js index c8a396e2dceb..0aa9067e18af 100644 --- a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js +++ b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js @@ -16,4 +16,4 @@ export { }; //// [/packages/a/node_modules/redux/index.js] module.exports = {}; //// [/packages/a/index.ts] -import "react"; +export { }; diff --git a/crates/swc/tests/tsc-references/redefinedPararameterProperty.1.normal.js b/crates/swc/tests/tsc-references/redefinedPararameterProperty.1.normal.js index 66f23bd42c35..09407871a987 100644 --- a/crates/swc/tests/tsc-references/redefinedPararameterProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/redefinedPararameterProperty.1.normal.js @@ -4,8 +4,8 @@ class Base { } class Derived extends Base { a; - b; + b = this.a /*undefined*/ ; constructor(a){ - super(), this.a = a, this.b = this.a /*undefined*/ ; + super(), this.a = a; } } diff --git a/crates/swc_ecma_transforms_typescript/src/config.rs b/crates/swc_ecma_transforms_typescript/src/config.rs index 4cb495713ccc..6eee8d077047 100644 --- a/crates/swc_ecma_transforms_typescript/src/config.rs +++ b/crates/swc_ecma_transforms_typescript/src/config.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use swc_common::sync::Lrc; -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, Copy)] #[serde(rename_all = "camelCase")] pub struct Config { /// https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax From 494cef9982b7b9f93601ed8c0f49978a7d260259 Mon Sep 17 00:00:00 2001 From: bohan Date: Fri, 6 Jun 2025 05:08:56 +0800 Subject: [PATCH 066/209] refactor(swc_common): Remove `Input::find` (#10542) --- .changeset/wet-clouds-develop.md | 5 +++ crates/swc_common/src/input.rs | 55 +++++++------------------------- 2 files changed, 16 insertions(+), 44 deletions(-) create mode 100644 .changeset/wet-clouds-develop.md diff --git a/.changeset/wet-clouds-develop.md b/.changeset/wet-clouds-develop.md new file mode 100644 index 000000000000..64efb5a72a64 --- /dev/null +++ b/.changeset/wet-clouds-develop.md @@ -0,0 +1,5 @@ +--- +swc_common: major +--- + +refactor(common): rm Input/find diff --git a/crates/swc_common/src/input.rs b/crates/swc_common/src/input.rs index 45cffd67397b..b1e069cfc286 100644 --- a/crates/swc_common/src/input.rs +++ b/crates/swc_common/src/input.rs @@ -177,34 +177,6 @@ impl<'a> Input<'a> for StringInput<'a> { ret } - fn find(&mut self, mut pred: F) -> Option - where - F: FnMut(char) -> bool, - { - let last = { - let mut last = 0; - for c in self.iter.clone() { - last += c.len_utf8(); - if pred(c) { - break; - } - } - last - }; - - if last == 0 { - return None; - } - - let s = self.iter.as_str(); - debug_assert!(last <= s.len()); - - self.last_pos = self.last_pos + BytePos(last as _); - self.iter = unsafe { s.get_unchecked(last..) }.chars(); - - Some(self.last_pos) - } - #[inline] unsafe fn reset_to(&mut self, to: BytePos) { let orig = self.orig; @@ -284,11 +256,6 @@ pub trait Input<'a>: Clone { where F: FnMut(char) -> bool; - /// This method modifies [last_pos()] and [cur_pos()]. - fn find(&mut self, f: F) -> Option - where - F: FnMut(char) -> bool; - /// # Safety /// /// - `to` be in the valid range of input. @@ -397,17 +364,17 @@ mod tests { }); } - #[test] - fn src_input_find_01() { - with_test_sess("foo/d", |mut i| { - assert_eq!(i.cur_pos(), BytePos(1)); - assert_eq!(i.last_pos, BytePos(1)); - - assert_eq!(i.find(|c| c == '/'), Some(BytePos(5))); - assert_eq!(i.last_pos, BytePos(5)); - assert_eq!(i.cur(), Some('d')); - }); - } + // #[test] + // fn src_input_find_01() { + // with_test_sess("foo/d", |mut i| { + // assert_eq!(i.cur_pos(), BytePos(1)); + // assert_eq!(i.last_pos, BytePos(1)); + + // assert_eq!(i.find(|c| c == '/'), Some(BytePos(5))); + // assert_eq!(i.last_pos, BytePos(5)); + // assert_eq!(i.cur(), Some('d')); + // }); + // } // #[test] // fn src_input_smoke_02() { From 2daa17f110910eae14412bbb29e8fdcf61265d13 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 6 Jun 2025 22:44:37 +0800 Subject: [PATCH 067/209] fix(es/typescript): Handle `export declare var` in namespace (#10579) **Related issue:** - Closes https://github.com/swc-project/swc/issues/9821 --- .changeset/smart-wombats-share.md | 6 ++++ .../9821/case-default/input/.swcrc | 8 ++++++ .../9821/case-default/input/index.ts | 22 +++++++++++++++ .../9821/case-default/output/index.ts | 15 ++++++++++ .../case-verbatimModuleSyntax/input/.swcrc | 11 ++++++++ .../case-verbatimModuleSyntax/input/index.ts | 22 +++++++++++++++ .../case-verbatimModuleSyntax/output/index.ts | 15 ++++++++++ .../src/strip_type.rs | 28 ++++++++++++++++--- 8 files changed, 123 insertions(+), 4 deletions(-) create mode 100644 .changeset/smart-wombats-share.md create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/index.ts create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-default/output/index.ts create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/index.ts create mode 100644 crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/output/index.ts diff --git a/.changeset/smart-wombats-share.md b/.changeset/smart-wombats-share.md new file mode 100644 index 000000000000..8e76d76ff54b --- /dev/null +++ b/.changeset/smart-wombats-share.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_transforms_typescript: patch +--- + +fix(es/typescript): Handle `export declare var` in namespace diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/.swcrc new file mode 100644 index 000000000000..8d18ac08a759 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "target": "es2022", + "parser": { + "syntax": "typescript" + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/index.ts b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/index.ts new file mode 100644 index 000000000000..cbacc6bd7a35 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/input/index.ts @@ -0,0 +1,22 @@ +export namespace ns { + export declare let a: number; + a = 1; +} + +export namespace ns2 { + a = 1; + export declare let a: number; +} + +export namespace ns3 { + export let b = a; + export declare const a: number; +} + +export namespace ns4 { + export namespace ns5 { + export let b = a; + } + + export declare const a: number; +} diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-default/output/index.ts b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/output/index.ts new file mode 100644 index 000000000000..ace586cb7cb7 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-default/output/index.ts @@ -0,0 +1,15 @@ +(function(ns) { + ns.a = 1; +})(ns || (ns = {})); +(function(ns2) { + ns2.a = 1; +})(ns2 || (ns2 = {})); +(function(ns3) { + ns3.b = ns3.a; +})(ns3 || (ns3 = {})); +(function(ns4) { + (function(ns5) { + ns5.b = ns4.a; + })(ns4.ns5 || (ns4.ns5 = {})); +})(ns4 || (ns4 = {})); +export var ns, ns2, ns3, ns4; diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/.swcrc new file mode 100644 index 000000000000..10097fbac225 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/.swcrc @@ -0,0 +1,11 @@ +{ + "jsc": { + "target": "es2022", + "parser": { + "syntax": "typescript" + }, + "transform": { + "verbatimModuleSyntax": true + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/index.ts b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/index.ts new file mode 100644 index 000000000000..cbacc6bd7a35 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/input/index.ts @@ -0,0 +1,22 @@ +export namespace ns { + export declare let a: number; + a = 1; +} + +export namespace ns2 { + a = 1; + export declare let a: number; +} + +export namespace ns3 { + export let b = a; + export declare const a: number; +} + +export namespace ns4 { + export namespace ns5 { + export let b = a; + } + + export declare const a: number; +} diff --git a/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/output/index.ts b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/output/index.ts new file mode 100644 index 000000000000..ace586cb7cb7 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9821/case-verbatimModuleSyntax/output/index.ts @@ -0,0 +1,15 @@ +(function(ns) { + ns.a = 1; +})(ns || (ns = {})); +(function(ns2) { + ns2.a = 1; +})(ns2 || (ns2 = {})); +(function(ns3) { + ns3.b = ns3.a; +})(ns3 || (ns3 = {})); +(function(ns4) { + (function(ns5) { + ns5.b = ns4.a; + })(ns4.ns5 || (ns4.ns5 = {})); +})(ns4 || (ns4 = {})); +export var ns, ns2, ns3, ns4; diff --git a/crates/swc_ecma_transforms_typescript/src/strip_type.rs b/crates/swc_ecma_transforms_typescript/src/strip_type.rs index 2c7a5a65506b..c0b099278e2e 100644 --- a/crates/swc_ecma_transforms_typescript/src/strip_type.rs +++ b/crates/swc_ecma_transforms_typescript/src/strip_type.rs @@ -1,3 +1,5 @@ +use std::mem; + use swc_common::util::take::Take; use swc_ecma_ast::*; use swc_ecma_utils::stack_size::maybe_grow_default; @@ -10,9 +12,13 @@ pub fn strip_type() -> impl VisitMut { } /// This Module will strip all types/generics/interface/declares -/// and type import/export +/// and type import/export. +/// +/// `export declare var` in a namespace will be retained. #[derive(Default)] -pub(crate) struct StripType {} +pub(crate) struct StripType { + in_namespace: bool, +} impl VisitMut for StripType { noop_visit_mut_type!(fail); @@ -144,8 +150,14 @@ impl VisitMut for StripType { n.retain(|s| !matches!(s, ImportSpecifier::Named(named) if named.is_type_only)); } + fn visit_mut_ts_module_block(&mut self, node: &mut TsModuleBlock) { + let in_namespace = mem::replace(&mut self.in_namespace, true); + node.visit_mut_children_with(self); + self.in_namespace = in_namespace; + } + fn visit_mut_module_items(&mut self, n: &mut Vec) { - n.retain(should_retain_module_item); + n.retain(|item| should_retain_module_item(item, self.in_namespace)); n.visit_mut_children_with(self); } @@ -228,15 +240,23 @@ impl VisitMut for StripType { } } -fn should_retain_module_item(module_item: &ModuleItem) -> bool { +fn should_retain_module_item(module_item: &ModuleItem, in_namespace: bool) -> bool { match module_item { ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(export_decl)) => { + // https://github.com/swc-project/swc/issues/9821 + // `export declare var` in namespace should be retained + // This will help the following transforms to work correctly + if in_namespace && export_decl.decl.is_var() { + return true; + } + should_retain_decl(&export_decl.decl) } ModuleItem::Stmt(stmt) => should_retain_stmt(stmt), _ => module_item.is_concrete(), } } + fn should_retain_stmt(stmt: &Stmt) -> bool { match stmt { Stmt::Decl(decl) => should_retain_decl(decl), From 49d15df1b4d2f5e07d10e10c75dcbeb637b2528d Mon Sep 17 00:00:00 2001 From: bohan Date: Fri, 6 Jun 2025 22:46:21 +0800 Subject: [PATCH 068/209] refactor(es/lexer): Remove unnecessary result wrap (#10578) --- .../swc_ecma_lexer/src/common/parser/expr.rs | 5 +---- .../swc_ecma_lexer/src/common/parser/jsx.rs | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/swc_ecma_lexer/src/common/parser/expr.rs b/crates/swc_ecma_lexer/src/common/parser/expr.rs index c98f1f88612b..d61d6885e23f 100644 --- a/crates/swc_ecma_lexer/src/common/parser/expr.rs +++ b/crates/swc_ecma_lexer/src/common/parser/expr.rs @@ -1688,10 +1688,7 @@ pub fn parse_lhs_expr<'a, P: Parser<'a>>(p: &mut P) -> PResult> { } let cur = cur!(p, true); if cur.is_jsx_text() { - return parse_jsx_text(p) - .map(Lit::JSXText) - .map(Expr::Lit) - .map(Box::new); + return Ok(Box::new(Expr::Lit(Lit::JSXText(parse_jsx_text(p))))); } else if cur.is_jsx_tag_start() { return parse_jsx_element(p).map(into_expr); } diff --git a/crates/swc_ecma_lexer/src/common/parser/jsx.rs b/crates/swc_ecma_lexer/src/common/parser/jsx.rs index 7e8ff5fbd550..8d3743756e5c 100644 --- a/crates/swc_ecma_lexer/src/common/parser/jsx.rs +++ b/crates/swc_ecma_lexer/src/common/parser/jsx.rs @@ -48,7 +48,7 @@ fn parse_jsx_expr_container<'a, P: Parser<'a>>(p: &mut P, _: BytePos) -> PResult let start = p.input_mut().cur_pos(); p.bump(); let expr = if p.input_mut().is(&P::Token::RBRACE) { - parse_jsx_empty_expr(p).map(JSXExpr::JSXEmptyExpr)? + JSXExpr::JSXEmptyExpr(parse_jsx_empty_expr(p)) } else { p.input_mut().eat(&P::Token::DOTDOTDOT); p.parse_expr().map(JSXExpr::Expr)? @@ -122,21 +122,21 @@ fn parse_jsx_element_name<'a, P: Parser<'a>>(p: &mut P) -> PResult(p: &mut impl Parser<'a>) -> PResult { +fn parse_jsx_empty_expr<'a>(p: &mut impl Parser<'a>) -> JSXEmptyExpr { debug_assert!(p.input().syntax().jsx()); let start = p.input_mut().cur_pos(); - Ok(JSXEmptyExpr { + JSXEmptyExpr { span: Span::new(start, start), - }) + } } -pub fn parse_jsx_text<'a>(p: &mut impl Parser<'a>) -> PResult { +pub fn parse_jsx_text<'a>(p: &mut impl Parser<'a>) -> JSXText { debug_assert!(p.input().syntax().jsx()); debug_assert!(cur!(p, false).is_ok_and(|t| t.is_jsx_text())); let token = p.bump(); let span = p.input().prev_span(); let (value, raw) = token.take_jsx_text(p.input_mut()); - Ok(JSXText { span, value, raw }) + JSXText { span, value, raw } } /// Parses any type of JSX attribute value. @@ -243,7 +243,7 @@ fn parse_jsx_opening_element_at<'a, P: Parser<'a>>( } #[inline(always)] -fn parse_jsx_attrs<'a, P: Parser<'a>>(p: &mut P) -> PResult> { +pub fn parse_jsx_attrs<'a, P: Parser<'a>>(p: &mut P) -> PResult> { let mut attrs = Vec::with_capacity(8); while cur!(p, false).is_ok() { @@ -348,7 +348,7 @@ fn parse_jsx_element_at<'a, P: Parser<'a>>( Either::Right(e) => JSXElementChild::from(Box::new(e)), })?); } else if cur.is_jsx_text() { - children.push(parse_jsx_text(p).map(JSXElementChild::from)?) + children.push(JSXElementChild::from(parse_jsx_text(p))) } else if cur.is_lbrace() { let start = p.cur_pos(); if peek!(p).is_some_and(|peek| peek.is_dotdotdot()) { @@ -414,7 +414,9 @@ fn parse_jsx_element_at<'a, P: Parser<'a>>( /// Parses entire JSX element from current position. /// /// babel: `jsxParseElement` -pub fn parse_jsx_element<'a, P: Parser<'a>>(p: &mut P) -> PResult> { +pub(crate) fn parse_jsx_element<'a, P: Parser<'a>>( + p: &mut P, +) -> PResult> { trace_cur!(p, parse_jsx_element); debug_assert!(p.input().syntax().jsx()); From e6d4da219530744171ba46bfa44a06076080e7c2 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Fri, 6 Jun 2025 22:47:44 +0800 Subject: [PATCH 069/209] fix(ts/isolated-dts): Add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports (#10577) **Description:** We should add edges for all three possible namespaces because there's no mechanism to merge SymbolFlags with the same IDs. For example: ```ts const a = 1 // SymbolFlags::Value type a = number // SymbolFlags::Type class A {} // SymbolFlags::all() export { a, A } ``` Ideally, we should merge two `a`s with `SymbolFlags::all`. But it's not efficient to merge nodes in the real time. So when exporting symbols, we add edges for all possible cases. **Related issue:** - Closes https://github.com/swc-project/swc/issues/10576 --- .changeset/weak-shirts-count.md | 6 ++++++ .../src/fast_dts/visitors/type_usage.rs | 12 +++++++++++- .../swc_typescript/tests/fixture/issues/10576.snap | 9 +++++++++ crates/swc_typescript/tests/fixture/issues/10576.ts | 7 +++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .changeset/weak-shirts-count.md create mode 100644 crates/swc_typescript/tests/fixture/issues/10576.snap create mode 100644 crates/swc_typescript/tests/fixture/issues/10576.ts diff --git a/.changeset/weak-shirts-count.md b/.changeset/weak-shirts-count.md new file mode 100644 index 000000000000..08f0f4d4e794 --- /dev/null +++ b/.changeset/weak-shirts-count.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_typescript: patch +--- + +fix(isolated_declarations): add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports diff --git a/crates/swc_typescript/src/fast_dts/visitors/type_usage.rs b/crates/swc_typescript/src/fast_dts/visitors/type_usage.rs index ad5700e38dc8..9cbc139e44dc 100644 --- a/crates/swc_typescript/src/fast_dts/visitors/type_usage.rs +++ b/crates/swc_typescript/src/fast_dts/visitors/type_usage.rs @@ -326,7 +326,13 @@ impl Visit for TypeUsageAnalyzer<'_> { for specifier in &node.specifiers { if let Some(name) = specifier.as_named() { if let ModuleExportName::Ident(ident) = &name.orig { - this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::all()), true); + // We should add egdes for all three possible namespaces because there's no + // mechanism to merge SymbolFlags with same Ids + this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::Type), true); + if !node.type_only { + this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::Value), true); + this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::all()), true); + } } } } @@ -342,6 +348,10 @@ impl Visit for TypeUsageAnalyzer<'_> { fn visit_export_default_expr(&mut self, node: &ExportDefaultExpr) { self.with_source(self.source, |this| { if let Some(ident) = node.expr.as_ident() { + // We should add egdes for all three possible namespaces because there's no + // mechanism to merge SymbolFlags with same Ids + this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::Type), true); + this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::Value), true); this.add_edge(Symbol::new(ident.to_id(), SymbolFlags::all()), true); } node.visit_children_with(this); diff --git a/crates/swc_typescript/tests/fixture/issues/10576.snap b/crates/swc_typescript/tests/fixture/issues/10576.snap new file mode 100644 index 000000000000..c88b0fffb249 --- /dev/null +++ b/crates/swc_typescript/tests/fixture/issues/10576.snap @@ -0,0 +1,9 @@ +```==================== .D.TS ==================== + +import type Animal from "the/jungle/book"; +interface King extends Animal { + isLouie(): boolean; +} +export type { King as default }; + + diff --git a/crates/swc_typescript/tests/fixture/issues/10576.ts b/crates/swc_typescript/tests/fixture/issues/10576.ts new file mode 100644 index 000000000000..f9f33a3b2613 --- /dev/null +++ b/crates/swc_typescript/tests/fixture/issues/10576.ts @@ -0,0 +1,7 @@ +import type Animal from "the/jungle/book"; + +interface King extends Animal { + isLouie(): boolean; +} + +export type { King as default }; From e441df50105a99c4725277278059e9b6100a95d0 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Fri, 6 Jun 2025 23:14:18 +0800 Subject: [PATCH 070/209] feat(es/minifier): Regex support for `format.comments` (#10571) **Description:** Use [regress](https://github.com/ridiculousfish/regress) because it is compatible with EcmaScript Syntax. So the users can easily migrate from `terser`. I will also update the docs. **Related issue:** - Closes https://github.com/swc-project/swc/issues/9674 --- Cargo.lock | 22 ++++++ Cargo.toml | 1 + bindings/binding_core_wasm/src/types.rs | 3 +- bindings/binding_minifier_wasm/src/types.rs | 3 +- .../fixture/issues-9xxx/9674/input/.swcrc | 17 +++++ .../fixture/issues-9xxx/9674/input/index.js | 7 ++ .../fixture/issues-9xxx/9674/output/index.js | 3 + crates/swc_compiler_base/src/lib.rs | 14 ++++ crates/swc_config/Cargo.toml | 2 + crates/swc_config/src/lib.rs | 4 + crates/swc_config/src/regex_js.rs | 76 +++++++++++++++++++ crates/swc_ecma_minifier/Cargo.toml | 1 + crates/swc_ecma_minifier/src/js.rs | 6 +- packages/types/index.ts | 3 +- 14 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 crates/swc/tests/fixture/issues-9xxx/9674/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-9xxx/9674/input/index.js create mode 100644 crates/swc/tests/fixture/issues-9xxx/9674/output/index.js create mode 100644 crates/swc_config/src/regex_js.rs diff --git a/Cargo.lock b/Cargo.lock index b551ceb3b1f2..dcff81ebe67e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,6 +1573,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1885,6 +1891,11 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "heapless" @@ -3914,6 +3925,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "regress" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ef7fa9ed0256d64a688a3747d0fef7a88851c18a5e1d57f115f38ec2e09366" +dependencies = [ + "hashbrown 0.15.2", + "memchr", +] + [[package]] name = "relative-path" version = "1.9.2" @@ -4961,6 +4982,7 @@ dependencies = [ "indexmap 2.7.1", "once_cell", "regex", + "regress", "rustc-hash 2.1.1", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 767bb1119c9d..5a5df3773f64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,6 +89,7 @@ resolver = "2" rand = "0.8.5" rayon = "1.7.0" regex = "1.5.4" + regress = "0.10.3" relative-path = "1.6.1" reqwest = "0.11.14" rustc-hash = "2" diff --git a/bindings/binding_core_wasm/src/types.rs b/bindings/binding_core_wasm/src/types.rs index 493309310a95..ec261e83fd35 100644 --- a/bindings/binding_core_wasm/src/types.rs +++ b/bindings/binding_core_wasm/src/types.rs @@ -97,9 +97,10 @@ export interface JsFormatOptions { * - `false`: removes all comments * - `'some'`: preserves some comments * - `'all'`: preserves all comments + * - `{ regex: string }`: preserves comments that match the regex * @default false */ - comments?: false | 'some' | 'all' + comments?: false | "some" | "all" | { regex: string }; /** * Currently noop. diff --git a/bindings/binding_minifier_wasm/src/types.rs b/bindings/binding_minifier_wasm/src/types.rs index 4f8c29dcf060..a0a98e98cf4b 100644 --- a/bindings/binding_minifier_wasm/src/types.rs +++ b/bindings/binding_minifier_wasm/src/types.rs @@ -97,9 +97,10 @@ export interface JsFormatOptions { * - `false`: removes all comments * - `'some'`: preserves some comments * - `'all'`: preserves all comments + * - `{ regex: string }`: preserves comments that match the regex * @default false */ - comments?: false | 'some' | 'all' + comments?: false | "some" | "all" | { regex: string }; /** * Currently noop. diff --git a/crates/swc/tests/fixture/issues-9xxx/9674/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9674/input/.swcrc new file mode 100644 index 000000000000..8df6c7057244 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9674/input/.swcrc @@ -0,0 +1,17 @@ +{ + "$schema": "https://swc.rs/schema.json", + "module": { + "type": "es6" + }, + "jsc": { + "target": "es2015", + "parser": { + "syntax": "ecmascript" + }, + "minify": { + "format": { + "comments": { "regex": "^!" } + } + } + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-9xxx/9674/input/index.js b/crates/swc/tests/fixture/issues-9xxx/9674/input/index.js new file mode 100644 index 000000000000..5598503c263e --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9674/input/index.js @@ -0,0 +1,7 @@ +/*!one\n2\n3*/ +//comment +function f(x) { + if (x) + //comment + return 3; +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-9xxx/9674/output/index.js b/crates/swc/tests/fixture/issues-9xxx/9674/output/index.js new file mode 100644 index 000000000000..84be11a626ae --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9674/output/index.js @@ -0,0 +1,3 @@ +/*!one\n2\n3*/ function f(x) { + if (x) return 3; +} diff --git a/crates/swc_compiler_base/src/lib.rs b/crates/swc_compiler_base/src/lib.rs index 042deaf160a5..665664b63ff2 100644 --- a/crates/swc_compiler_base/src/lib.rs +++ b/crates/swc_compiler_base/src/lib.rs @@ -403,6 +403,20 @@ pub fn minify_file_comments( t.retain(preserve_excl); } + BoolOr::Data(JsMinifyCommentOption::PreserveRegexComments { regex }) => { + let preserve_excl = |_: &BytePos, vc: &mut std::vec::Vec| -> bool { + // Preserve comments that match the regex + // + // See https://github.com/terser/terser/blob/798135e04baddd94fea403cfaab4ba8b22b1b524/lib/output.js#L286 + vc.retain(|c: &Comment| regex.find(&c.text).is_some()); + !vc.is_empty() + }; + let (mut l, mut t) = comments.borrow_all_mut(); + + l.retain(preserve_excl); + t.retain(preserve_excl); + } + BoolOr::Bool(false) => { let (mut l, mut t) = comments.borrow_all_mut(); l.clear(); diff --git a/crates/swc_config/Cargo.toml b/crates/swc_config/Cargo.toml index 7220566934b1..9f5ebe8276a9 100644 --- a/crates/swc_config/Cargo.toml +++ b/crates/swc_config/Cargo.toml @@ -18,6 +18,7 @@ version = "3.0.0" file_pattern = ["glob", "regex"] glob = ["dep:globset", "dep:dashmap", "dep:rustc-hash", "dep:once_cell"] regex = ["dep:regex", "dep:dashmap", "dep:rustc-hash", "dep:once_cell"] +regex_js = ["dep:regress"] sourcemap = ["dep:sourcemap"] [dependencies] @@ -27,6 +28,7 @@ globset = { workspace = true, optional = true } indexmap = { workspace = true } once_cell = { workspace = true, optional = true } regex = { workspace = true, optional = true } +regress = { workspace = true, optional = true } rustc-hash = { workspace = true, optional = true } serde = { workspace = true, features = ["derive", "rc"] } serde_json = { workspace = true } diff --git a/crates/swc_config/src/lib.rs b/crates/swc_config/src/lib.rs index 7f71378a34e4..8fd2800ffa91 100644 --- a/crates/swc_config/src/lib.rs +++ b/crates/swc_config/src/lib.rs @@ -13,6 +13,10 @@ pub mod merge; #[cfg(feature = "regex")] pub mod regex; +#[cfg_attr(docsrs, doc(cfg(feature = "regex_js")))] +#[cfg(feature = "regex_js")] +pub mod regex_js; + #[cfg_attr(docsrs, doc(cfg(feature = "sourcemap")))] #[cfg(feature = "sourcemap")] pub mod source_map; diff --git a/crates/swc_config/src/regex_js.rs b/crates/swc_config/src/regex_js.rs new file mode 100644 index 000000000000..26e2188e8dd4 --- /dev/null +++ b/crates/swc_config/src/regex_js.rs @@ -0,0 +1,76 @@ +//! Regex cache + +use std::{ops::Deref, sync::Arc}; + +pub use anyhow::Error; +use anyhow::{Context, Result}; +use dashmap::DashMap; +use once_cell::sync::Lazy; +use regress::Regex; +use rustc_hash::FxBuildHasher; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone)] +pub struct CachedJsRegex { + regex: Arc, + source: String, +} + +impl Deref for CachedJsRegex { + type Target = Regex; + + fn deref(&self) -> &Self::Target { + &self.regex + } +} + +impl CachedJsRegex { + /// Get or create a cached regex. This will return the previous instance if + /// it's already cached. + pub fn new(source: String) -> Result { + static CACHE: Lazy, FxBuildHasher>> = + Lazy::new(Default::default); + + if let Some(cache) = CACHE.get(&source).as_deref().cloned() { + return Ok(Self { + regex: cache, + source, + }); + } + + let regex = + Regex::new(&source).with_context(|| format!("failed to parse `{source}` as regex"))?; + let regex = Arc::new(regex); + + CACHE.insert(source.to_owned(), regex.clone()); + + Ok(CachedJsRegex { regex, source }) + } + + pub fn source(&self) -> &str { + &self.source + } +} + +impl<'de> Deserialize<'de> for CachedJsRegex { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + use serde::de::Error; + + let s = String::deserialize(deserializer)?; + + Self::new(s).map_err(|err| D::Error::custom(err.to_string())) + } +} + +impl Serialize for CachedJsRegex { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let s = self.source(); + serializer.serialize_str(s) + } +} diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 755bedd47ec2..26d07141f198 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -58,6 +58,7 @@ swc_common = { version = "11.1.3", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", + "regex_js", ] } swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ "serde", diff --git a/crates/swc_ecma_minifier/src/js.rs b/crates/swc_ecma_minifier/src/js.rs index 5bd006ffc9fc..61ade8c30692 100644 --- a/crates/swc_ecma_minifier/src/js.rs +++ b/crates/swc_ecma_minifier/src/js.rs @@ -2,8 +2,8 @@ use serde::{Deserialize, Serialize}; use swc_config::{ - file_pattern::FilePattern, is_module::IsModule, source_map::SourceMapContent, - types::BoolOrDataConfig, + file_pattern::FilePattern, is_module::IsModule, regex_js::CachedJsRegex, + source_map::SourceMapContent, types::BoolOrDataConfig, }; use crate::option::{ @@ -215,6 +215,8 @@ pub enum JsMinifyCommentOption { PreserveSomeComments, #[serde(rename = "all")] PreserveAllComments, + #[serde(untagged)] + PreserveRegexComments { regex: CachedJsRegex }, } fn default_module() -> IsModule { diff --git a/packages/types/index.ts b/packages/types/index.ts index e8e7fb279e88..7a4cdf63f969 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -85,9 +85,10 @@ export interface JsFormatOptions { * - `false`: removes all comments * - `'some'`: preserves some comments * - `'all'`: preserves all comments + * - `{ regex: string }`: preserves comments that match the regex * @default false */ - comments?: false | "some" | "all"; + comments?: false | "some" | "all" | { regex: string }; /** * Currently noop. From e1f2597ce06fcce39cac142639e26c75f69abc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 6 Jun 2025 10:07:31 -0700 Subject: [PATCH 071/209] chore(ci): Fix publish action --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 925bdb48256b..a0575c05932f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -125,6 +125,7 @@ jobs: package: - core - html + - react-compiler needs: - run-ecosystem-ci-with-nightly - git-tag-stable From 8deba787bb7a210826be09ce065a7a40eef0d508 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Mon, 9 Jun 2025 22:37:15 +0800 Subject: [PATCH 072/209] fix(es/parser): Disallow spread operator(`...`) in JSX attribute values (#10587) **Related issue:** - Closes https://github.com/swc-project/swc/issues/10586 --- .changeset/tiny-melons-carry.md | 6 ++++++ crates/swc_ecma_lexer/src/common/parser/jsx.rs | 1 - .../swc_ecma_parser/tests/jsx/errors/issue-10586/input.js | 1 + .../tests/jsx/errors/issue-10586/input.js.swc-stderr | 5 +++++ .../tests/jsx/errors}/issue-6977/1/input.js | 0 .../tests/jsx/errors/issue-6977/1/input.js.swc-stderr | 6 ++++++ .../tests/jsx/errors}/issue-6977/2/input.js | 0 .../tests/jsx/errors/issue-6977/2/input.js.swc-stderr | 6 ++++++ .../tests/jsx/fixture/issue-6977/1/output.mjs | 8 -------- .../tests/jsx/fixture/issue-6977/2/output.mjs | 6 ------ 10 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 .changeset/tiny-melons-carry.md create mode 100644 crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js create mode 100644 crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js.swc-stderr rename crates/{swc_ecma_transforms_react/tests/jsx/fixture => swc_ecma_parser/tests/jsx/errors}/issue-6977/1/input.js (100%) create mode 100644 crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js.swc-stderr rename crates/{swc_ecma_transforms_react/tests/jsx/fixture => swc_ecma_parser/tests/jsx/errors}/issue-6977/2/input.js (100%) create mode 100644 crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js.swc-stderr delete mode 100644 crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/output.mjs delete mode 100644 crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/output.mjs diff --git a/.changeset/tiny-melons-carry.md b/.changeset/tiny-melons-carry.md new file mode 100644 index 000000000000..cabd3bfd48d3 --- /dev/null +++ b/.changeset/tiny-melons-carry.md @@ -0,0 +1,6 @@ +--- +swc_ecma_lexer: patch +swc_core: patch +--- + +fix(es/parser): disallow spread operator in JSX attribute values diff --git a/crates/swc_ecma_lexer/src/common/parser/jsx.rs b/crates/swc_ecma_lexer/src/common/parser/jsx.rs index 8d3743756e5c..6c51fbe5f0ae 100644 --- a/crates/swc_ecma_lexer/src/common/parser/jsx.rs +++ b/crates/swc_ecma_lexer/src/common/parser/jsx.rs @@ -50,7 +50,6 @@ fn parse_jsx_expr_container<'a, P: Parser<'a>>(p: &mut P, _: BytePos) -> PResult let expr = if p.input_mut().is(&P::Token::RBRACE) { JSXExpr::JSXEmptyExpr(parse_jsx_empty_expr(p)) } else { - p.input_mut().eat(&P::Token::DOTDOTDOT); p.parse_expr().map(JSXExpr::Expr)? }; expect!(p, &P::Token::RBRACE); diff --git a/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js b/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js new file mode 100644 index 000000000000..05460f2f5fac --- /dev/null +++ b/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js @@ -0,0 +1 @@ + diff --git a/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js.swc-stderr b/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js.swc-stderr new file mode 100644 index 000000000000..7517ba4fe4b3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/jsx/errors/issue-10586/input.js.swc-stderr @@ -0,0 +1,5 @@ + x Expression expected + ,-[$DIR/tests/jsx/errors/issue-10586/input.js:1:1] + 1 | + : ^^^ + `---- diff --git a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/input.js b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js similarity index 100% rename from crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/input.js rename to crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js diff --git a/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js.swc-stderr b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js.swc-stderr new file mode 100644 index 000000000000..5b8301535f36 --- /dev/null +++ b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/1/input.js.swc-stderr @@ -0,0 +1,6 @@ + x Expression expected + ,-[$DIR/tests/jsx/errors/issue-6977/1/input.js:4:1] + 3 | + 4 | + : ^^^ + `---- diff --git a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/input.js b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js similarity index 100% rename from crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/input.js rename to crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js diff --git a/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js.swc-stderr b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js.swc-stderr new file mode 100644 index 000000000000..cfcdf0adc188 --- /dev/null +++ b/crates/swc_ecma_parser/tests/jsx/errors/issue-6977/2/input.js.swc-stderr @@ -0,0 +1,6 @@ + x Expression expected + ,-[$DIR/tests/jsx/errors/issue-6977/2/input.js:4:1] + 3 | + 4 | + : ^^^ + `---- diff --git a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/output.mjs b/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/output.mjs deleted file mode 100644 index 6b74ab0b78ba..000000000000 --- a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/1/output.mjs +++ /dev/null @@ -1,8 +0,0 @@ -function Component(props) {} -/*#__PURE__*/ React.createElement(Component, { - x: [ - 1, - 2, - 3 - ] -}); diff --git a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/output.mjs b/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/output.mjs deleted file mode 100644 index e5a0d99a84c4..000000000000 --- a/crates/swc_ecma_transforms_react/tests/jsx/fixture/issue-6977/2/output.mjs +++ /dev/null @@ -1,6 +0,0 @@ -function Component(props) {} -/*#__PURE__*/ React.createElement(Component, { - x: { - a: x - } -}); From a00a0f2b77291bd38d22d5f2526e6604223eb5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 9 Jun 2025 09:00:55 -0700 Subject: [PATCH 073/209] chore(ci): Remove flaky benchmarks (#10590) **Description:** These benchmarks are not useful --- crates/swc_common/Cargo.toml | 4 -- crates/swc_common/benches/serde.rs | 69 ---------------------------- crates/swc_ecma_lints/benches/all.rs | 5 +- 3 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 crates/swc_common/benches/serde.rs diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index b6aa52d3e7c3..cea2cb8d42f1 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -74,7 +74,3 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } rayon = { workspace = true } serde_json = { workspace = true } - -[[bench]] -harness = false -name = "serde" diff --git a/crates/swc_common/benches/serde.rs b/crates/swc_common/benches/serde.rs deleted file mode 100644 index 98fbd2cf3346..000000000000 --- a/crates/swc_common/benches/serde.rs +++ /dev/null @@ -1,69 +0,0 @@ -#![allow(unexpected_cfgs)] - -use ast_node::ast_node; -use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion}; -use serde::{Deserialize, Serialize}; -use swc_common::{Span, DUMMY_SP}; - -#[derive(Serialize, Deserialize)] -pub struct SerdeStr { - span: Span, - value: String, -} - -#[ast_node("String")] -pub struct Str { - span: Span, - value: String, -} - -#[derive(Serialize, Deserialize)] -pub struct SerdeNum { - span: Span, - value: u64, -} - -#[ast_node("Number")] -pub struct Num { - span: Span, - value: u64, -} - -#[derive(Serialize, Deserialize)] -#[serde(tag = "type")] -pub enum Serde { - Number(SerdeNum), - String(SerdeStr), -} - -#[ast_node] -pub enum AstNode { - #[tag("Number")] - Number(Num), - #[tag("String")] - String(Str), -} - -fn bench_serde(c: &mut Criterion) { - let src = Serde::String(SerdeStr { - span: DUMMY_SP, - value: String::from("perf-diff"), - }); - - c.bench_function("serialization of serde", |b| { - b.iter(|| black_box(serde_json::to_string(&src).unwrap())); - }); - c.bench_function("deserialization of serde", |b| { - let src = serde_json::to_string(&Serde::String(SerdeStr { - span: DUMMY_SP, - value: String::from("perf-diff"), - })) - .unwrap(); - println!("{src}"); - - b.iter(|| black_box(serde_json::to_string(&src).unwrap())); - }); -} - -criterion_group!(benches, bench_serde); -criterion_main!(benches); diff --git a/crates/swc_ecma_lints/benches/all.rs b/crates/swc_ecma_lints/benches/all.rs index debb485046c8..57ddc85a085b 100644 --- a/crates/swc_ecma_lints/benches/all.rs +++ b/crates/swc_ecma_lints/benches/all.rs @@ -70,14 +70,15 @@ pub fn bench_files(c: &mut Criterion) { }); }; + // Some of these are too flaky bench_file("antd"); - bench_file("d3"); + // bench_file("d3"); bench_file("echarts"); bench_file("jquery"); bench_file("lodash"); bench_file("moment"); bench_file("react"); - bench_file("terser"); + // bench_file("terser"); bench_file("three"); bench_file("typescript"); bench_file("victory"); From 6f00973ba08b19f09adb1bc9b9dd9558be27247a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 9 Jun 2025 11:45:31 -0700 Subject: [PATCH 074/209] refactor(swc_common): Use `BytesStr` instead of `Lrc` (#10580) **Description:** This is more efficient variant of `Arc` **Related issue (if exists):** --- .changeset/warm-ghosts-try.md | 5 + .vscode/settings.json | 3 - Cargo.lock | 21 +- Cargo.toml | 1 + crates/binding_macros/src/wasm.rs | 6 +- crates/swc/Cargo.toml | 1 + crates/swc/benches/oxc.rs | 5 +- crates/swc/examples/transform_error.rs | 6 +- crates/swc/src/config/mod.rs | 3 +- crates/swc/tests/projects.rs | 6 +- crates/swc/tests/rust_api.rs | 15 +- crates/swc/tests/simple.rs | 2 +- crates/swc_bundler/src/bundler/helpers/mod.rs | 2 +- crates/swc_bundler/src/bundler/tests.rs | 7 +- crates/swc_common/Cargo.toml | 12 +- crates/swc_common/src/input.rs | 10 +- crates/swc_common/src/source_map.rs | 73 +- crates/swc_common/src/syntax_pos.rs | 84 +- crates/swc_common/tests/source_map.rs | 3 +- .../tests/fixture/stub_napi/Cargo.lock | 1147 +++++++++-------- .../tests/fixture/stub_wasm/Cargo.lock | 128 +- crates/swc_css_parser/benches/compare.rs | 2 +- crates/swc_css_parser/benches/lexer.rs | 2 +- crates/swc_css_parser/benches/parser.rs | 2 +- crates/swc_ecma_codegen/benches/bench.rs | 4 +- crates/swc_ecma_codegen/benches/with_parse.rs | 4 +- crates/swc_ecma_lexer/benches/lexer.rs | 2 +- crates/swc_ecma_lexer/examples/lexer.rs | 2 +- crates/swc_ecma_lexer/src/lib.rs | 2 +- crates/swc_ecma_minifier/benches/full.rs | 2 +- crates/swc_ecma_minifier/tests/exec.rs | 2 +- crates/swc_ecma_minifier/tests/format.rs | 2 +- crates/swc_ecma_minifier/tests/mangle.rs | 2 +- crates/swc_ecma_minifier/tests/size.rs | 2 +- crates/swc_ecma_parser/benches/compare.rs | 2 +- crates/swc_ecma_parser/benches/parser.rs | 2 +- crates/swc_ecma_parser/examples/typescript.rs | 2 +- crates/swc_ecma_parser/src/lib.rs | 4 +- crates/swc_ecma_parser/tests/js.rs | 2 +- crates/swc_ecma_parser/tests/typescript.rs | 2 +- .../swc_ecma_preset_env/benches/polyfills.rs | 2 +- .../swc_ecma_react_compiler/src/fast_check.rs | 3 +- .../swc_ecma_transforms_base/benches/base.rs | 2 +- .../benches/parallel.rs | 2 +- .../src/helpers/mod.rs | 2 +- crates/swc_ecma_transforms_base/src/tests.rs | 4 +- .../tests/path_node.rs | 2 +- .../Cargo.toml | 1 + .../src/const_modules.rs | 11 +- .../tests/const_modules.rs | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 1 + .../swc_ecma_transforms_react/src/jsx/mod.rs | 35 +- .../src/jsx/tests.rs | 6 +- .../src/pure_annotations/tests.rs | 2 +- crates/swc_ecma_transforms_testing/src/lib.rs | 2 +- .../swc_ecma_transforms_typescript/Cargo.toml | 1 + .../benches/compat.rs | 2 +- .../src/config.rs | 6 +- .../src/typescript.rs | 12 +- .../swc_error_reporters/examples/swc_try.rs | 4 +- crates/swc_error_reporters/tests/fixture.rs | 6 +- crates/swc_fast_ts_strip/Cargo.toml | 3 +- crates/swc_fast_ts_strip/src/lib.rs | 5 +- crates/swc_html_minifier/benches/full.rs | 4 +- crates/swc_html_parser/benches/compare.rs | 4 +- crates/swc_html_parser/benches/lexer.rs | 2 +- crates/swc_html_parser/benches/parser.rs | 4 +- .../css-plugins/swc_noop_plugin/Cargo.lock | 871 +++++++------ crates/swc_plugin_runner/tests/css_rkyv.rs | 2 +- .../tests/ecma_integration.rs | 4 +- crates/swc_plugin_runner/tests/ecma_rkyv.rs | 4 +- .../tests/fixture/issue_6404/Cargo.lock | 884 +++++++------ .../fixture/swc_internal_plugin/Cargo.lock | 835 +++++++----- .../tests/fixture/swc_noop_plugin/Cargo.lock | 880 +++++++------ 74 files changed, 2932 insertions(+), 2262 deletions(-) create mode 100644 .changeset/warm-ghosts-try.md diff --git a/.changeset/warm-ghosts-try.md b/.changeset/warm-ghosts-try.md new file mode 100644 index 000000000000..21c5e59a83bf --- /dev/null +++ b/.changeset/warm-ghosts-try.md @@ -0,0 +1,5 @@ +--- +swc_common: major +--- + +refactor(swc_common): Use `BytesStr` instead of `Lrc` diff --git a/.vscode/settings.json b/.vscode/settings.json index 401fbee7629f..93f2e2b5652c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,9 +24,6 @@ ], "eslint.enable": false, "rust-analyzer.check.command": "clippy", - "rust-analyzer.cargo.features": [ - "plugin" - ], // SWC project is too complex to use rust-analyzer "rust-analyzer.diagnostics.enable": false } \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index dcff81ebe67e..8d85586ce7f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,13 +489,24 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] +[[package]] +name = "bytes-str" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +dependencies = [ + "bytes", + "rkyv", + "serde", +] + [[package]] name = "bytesize" version = "1.3.0" @@ -4740,6 +4751,7 @@ dependencies = [ "ansi_term", "anyhow", "base64 0.22.1", + "bytes-str", "codspeed-criterion-compat", "criterion", "dashmap 5.5.3", @@ -4918,6 +4930,7 @@ dependencies = [ "ast_node", "better_scoped_tls", "bytecheck 0.8.1", + "bytes-str", "cfg-if", "codspeed-criterion-compat", "criterion", @@ -5960,6 +5973,7 @@ dependencies = [ name = "swc_ecma_transforms_optimization" version = "16.0.0" dependencies = [ + "bytes-str", "dashmap 5.5.3", "indexmap 2.7.1", "once_cell", @@ -6016,6 +6030,7 @@ name = "swc_ecma_transforms_react" version = "17.0.0" dependencies = [ "base64 0.22.1", + "bytes-str", "dashmap 5.5.3", "indexmap 2.7.1", "once_cell", @@ -6069,6 +6084,7 @@ dependencies = [ name = "swc_ecma_transforms_typescript" version = "17.0.0" dependencies = [ + "bytes-str", "codspeed-criterion-compat", "criterion", "once_cell", @@ -6224,6 +6240,7 @@ name = "swc_fast_ts_strip" version = "19.0.0" dependencies = [ "anyhow", + "bytes-str", "codspeed-criterion-compat", "criterion", "serde", diff --git a/Cargo.toml b/Cargo.toml index 5a5df3773f64..f37c504ae031 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ resolver = "2" bitflags = "2.5.0" browserslist-rs = "0.18.1" bumpalo = "3.16.0" + bytes-str = "0.2.3" cargo_metadata = "0.18.1" cfg-if = "1.0.0" changesets = "0.2.2" diff --git a/crates/binding_macros/src/wasm.rs b/crates/binding_macros/src/wasm.rs index 65f27a93f1e6..e16baf8adfc1 100644 --- a/crates/binding_macros/src/wasm.rs +++ b/crates/binding_macros/src/wasm.rs @@ -115,7 +115,7 @@ macro_rules! build_minify_sync { .map_err(|e| $crate::wasm::anyhow::anyhow!("failed to parse options: {}", e))? }; - let fm = c.cm.new_source_file($crate::wasm::FileName::Anon.into(), s.into()); + let fm = c.cm.new_source_file($crate::wasm::FileName::Anon.into(), String::from(s)); let program = $crate::wasm::anyhow::Context::context(c.minify(fm, handler, &opts, Default::default()), "failed to minify file")?; program @@ -171,7 +171,7 @@ macro_rules! build_parse_sync { .map_err(|e| $crate::wasm::anyhow::anyhow!("failed to parse options: {}", e))? }; - let fm = c.cm.new_source_file($crate::wasm::FileName::Anon.into(), s.into()); + let fm = c.cm.new_source_file($crate::wasm::FileName::Anon.into(), String::from(s)); let cmts = c.comments().clone(); let comments = if opts.comments { @@ -379,7 +379,7 @@ macro_rules! build_transform_sync { } else { $crate::wasm::FileName::Real(opts.filename.clone().into()).into() }, - s.into(), + String::from(s), ); let cm = c.cm.clone(); let file = fm.clone(); diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 2a30bdca67fa..ad2b3262b31d 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -53,6 +53,7 @@ manual-tokio-runtime = [] [dependencies] anyhow = { workspace = true } base64 = { workspace = true } +bytes-str = { workspace = true } dashmap = { workspace = true } either = { workspace = true } indexmap = { workspace = true, features = ["serde"] } diff --git a/crates/swc/benches/oxc.rs b/crates/swc/benches/oxc.rs index 929aa5432fe0..307b03a9e0c1 100644 --- a/crates/swc/benches/oxc.rs +++ b/crates/swc/benches/oxc.rs @@ -2,6 +2,7 @@ extern crate swc_malloc; use std::{fs, io::stderr, sync::Arc}; +use bytes_str::BytesStr; use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion}; use swc::config::{Config, JscConfig, Options, TransformConfig}; use swc_common::{errors::Handler, FileName, FilePathMapping, SourceMap, GLOBALS}; @@ -26,13 +27,13 @@ fn mk() -> swc::Compiler { fn bench_full(b: &mut Bencher, filename: &str, opts: &Options) { let c = mk(); - let source = Arc::new(fs::read_to_string(filename).unwrap()); + let source: BytesStr = fs::read_to_string(filename).unwrap().into(); b.iter(|| { GLOBALS.set(&Default::default(), || { let handler = Handler::with_emitter_writer(Box::new(stderr()), Some(c.cm.clone())); - let fm = c.cm.new_source_file_from( + let fm = c.cm.new_source_file( FileName::Real(filename.to_string().into()).into(), black_box(source.clone()), ); diff --git a/crates/swc/examples/transform_error.rs b/crates/swc/examples/transform_error.rs index ca5c627cfc22..82da9df7ceae 100644 --- a/crates/swc/examples/transform_error.rs +++ b/crates/swc/examples/transform_error.rs @@ -19,10 +19,8 @@ fn main() { skip_filename: false, }, |handler| { - let fm = cm.new_source_file( - FileName::Custom("foo.js".into()).into(), - "this ?= foo".into(), - ); + let fm = + cm.new_source_file(FileName::Custom("foo.js".into()).into(), "this ?= foo"); c.process_js_file(fm, handler, &Default::default()) .context("failed to process file") diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index 9d3112be234f..0686d5d677b7 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -6,6 +6,7 @@ use std::{ }; use anyhow::{bail, Context, Error}; +use bytes_str::BytesStr; use dashmap::DashMap; use either::Either; use indexmap::IndexMap; @@ -1569,7 +1570,7 @@ pub struct HiddenTransformConfig { #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct ConstModulesConfig { #[serde(default)] - pub globals: FxHashMap>, + pub globals: FxHashMap>, } #[derive(Debug, Default, Clone, Serialize, Deserialize, Merge)] diff --git a/crates/swc/tests/projects.rs b/crates/swc/tests/projects.rs index 5949c47d9525..8cd52d31f868 100644 --- a/crates/swc/tests/projects.rs +++ b/crates/swc/tests/projects.rs @@ -705,8 +705,7 @@ fn should_visit() { " import React from 'react'; const comp = () => ; - " - .into(), + ", ); let comments = SingleThreadedComments::default(); let config = c @@ -910,8 +909,7 @@ fn issue_1984() { ? new Set() : new Set(derivedHalfSelectedKeys); } - " - .into(), + ", ); c.minify( diff --git a/crates/swc/tests/rust_api.rs b/crates/swc/tests/rust_api.rs index b1a048f7c6a6..c952b36a2573 100644 --- a/crates/swc/tests/rust_api.rs +++ b/crates/swc/tests/rust_api.rs @@ -28,8 +28,7 @@ fn test_visit_mut() { FileName::Anon.into(), " console.log(5 as const) - " - .into(), + ", ); let res = c.process_js_with_custom_pass( @@ -74,8 +73,7 @@ fn shopify_1_check_filename() { const [i18n] = useI18n(); return

{i18n.translate('foo')}

} - " - .into(), + ", ); let res = c.process_js_with_custom_pass( @@ -173,8 +171,7 @@ fn shopify_2_same_opt() { const [i18n] = useI18n(); return

{i18n.translate('foo')}

} - " - .into(), + ", ); let res = c.process_js_with_custom_pass( @@ -241,8 +238,7 @@ fn shopify_3_reduce_defaults() { const [i18n] = useI18n(); return

{i18n.translate('foo')}

} - " - .into(), + ", ); let res = c.process_js_with_custom_pass( @@ -304,8 +300,7 @@ fn shopify_4_reduce_more() { const [i18n] = useI18n(); return

{i18n.translate('foo')}

} - " - .into(), + ", ); let res = c.process_js_with_custom_pass( diff --git a/crates/swc/tests/simple.rs b/crates/swc/tests/simple.rs index ac621d53910a..660d4a1cd5b7 100644 --- a/crates/swc/tests/simple.rs +++ b/crates/swc/tests/simple.rs @@ -12,7 +12,7 @@ fn compile(src: &str, options: Options) -> String { .print_errors(|cm, handler| { let c = Compiler::new(cm.clone()); - let fm = cm.new_source_file(FileName::Real("input.js".into()).into(), src.into()); + let fm = cm.new_source_file(FileName::Real("input.js".into()).into(), src.to_string()); let s = c.process_js_file(fm, &handler, &options); match s { diff --git a/crates/swc_bundler/src/bundler/helpers/mod.rs b/crates/swc_bundler/src/bundler/helpers/mod.rs index c275045bc595..d99629fae243 100644 --- a/crates/swc_bundler/src/bundler/helpers/mod.rs +++ b/crates/swc_bundler/src/bundler/helpers/mod.rs @@ -14,7 +14,7 @@ pub(crate) struct Helpers { fn parse(code: &'static str, name: &'static str) -> Vec { let cm = SourceMap::new(FilePathMapping::empty()); - let fm = cm.new_source_file(FileName::Custom(name.into()).into(), code.into()); + let fm = cm.new_source_file(FileName::Custom(name.into()).into(), code); parse_file_as_module( &fm, Default::default(), diff --git a/crates/swc_bundler/src/bundler/tests.rs b/crates/swc_bundler/src/bundler/tests.rs index ee889beb7a7d..7fe8e7250470 100644 --- a/crates/swc_bundler/src/bundler/tests.rs +++ b/crates/swc_bundler/src/bundler/tests.rs @@ -80,9 +80,10 @@ impl Tester<'_> { #[allow(dead_code)] pub fn parse(&self, s: &str) -> Module { - let fm = self - .cm - .new_source_file(FileName::Real(PathBuf::from("input.js")).into(), s.into()); + let fm = self.cm.new_source_file( + FileName::Real(PathBuf::from("input.js")).into(), + s.to_string(), + ); let lexer = Lexer::new( Default::default(), diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index cea2cb8d42f1..5909e5bd8a8c 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -32,8 +32,15 @@ plugin_transform_schema_vtest = [] tty-emitter = ["termcolor"] -__rkyv = [] -rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl", "bytecheck", "rancor"] +__rkyv = [] +rkyv-impl = [ + "__rkyv", + "rkyv", + "swc_atoms/rkyv-impl", + "bytes-str/rkyv", + "bytecheck", + "rancor", +] shrink-to-fit = ["dep:shrink-to-fit", "swc_atoms/shrink-to-fit"] @@ -42,6 +49,7 @@ shrink-to-fit = ["dep:shrink-to-fit", "swc_atoms/shrink-to-fit"] anyhow = { workspace = true } arbitrary = { workspace = true, features = ["derive"], optional = true } bytecheck = { workspace = true, optional = true } +bytes-str = { workspace = true, features = ["serde"] } cfg-if = { workspace = true } either = { workspace = true } new_debug_unreachable = { workspace = true } diff --git a/crates/swc_common/src/input.rs b/crates/swc_common/src/input.rs index b1e069cfc286..48aa4e2dab14 100644 --- a/crates/swc_common/src/input.rs +++ b/crates/swc_common/src/input.rs @@ -297,17 +297,15 @@ pub trait Input<'a>: Clone { #[cfg(test)] mod tests { - use std::sync::Arc; - use super::*; - use crate::{FileName, FilePathMapping, SourceMap}; + use crate::{sync::Lrc, FileName, FilePathMapping, SourceMap}; - fn with_test_sess(src: &str, f: F) + fn with_test_sess(src: &'static str, f: F) where F: FnOnce(StringInput<'_>), { - let cm = Arc::new(SourceMap::new(FilePathMapping::empty())); - let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src.into()); + let cm = Lrc::new(SourceMap::new(FilePathMapping::empty())); + let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src); f((&*fm).into()) } diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index d41db2ce7525..8955eb1f0443 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -27,6 +27,7 @@ use std::{ sync::atomic::{AtomicUsize, Ordering::SeqCst}, }; +use bytes_str::BytesStr; use once_cell::sync::Lazy; use rustc_hash::FxHashMap; #[cfg(feature = "sourcemap")] @@ -55,7 +56,7 @@ pub trait FileLoader { fn abs_path(&self, path: &Path) -> Option; /// Read the contents of an UTF-8 file into memory. - fn read_file(&self, path: &Path) -> io::Result; + fn read_file(&self, path: &Path) -> io::Result; } /// A FileLoader that uses std::fs to load real files. @@ -74,8 +75,14 @@ impl FileLoader for RealFileLoader { } } - fn read_file(&self, path: &Path) -> io::Result { - fs::read_to_string(path) + fn read_file(&self, path: &Path) -> io::Result { + let bytes = fs::read(path)?; + BytesStr::from_utf8(bytes.into()).map_err(|_| { + io::Error::new( + io::ErrorKind::InvalidData, + "Failed to convert bytes to UTF-8", + ) + }) } } @@ -203,23 +210,23 @@ impl SourceMap { self.start_pos.fetch_add(len + 1, SeqCst) } - /// Creates a new source_file. - /// This does not ensure that only one SourceFile exists per file name. - pub fn new_source_file(&self, filename: Lrc, mut src: String) -> Lrc { - remove_bom(&mut src); - - self.new_source_file_from(filename, Lrc::new(src)) - } - /// Creates a new source_file. /// This does not ensure that only one SourceFile exists per file name. /// - /// `src` should not have UTF8 BOM - pub fn new_source_file_from( + /// - `src` should not have UTF8 BOM + /// - `&'static str` and [String] implements `Into` + #[inline(always)] + pub fn new_source_file( &self, filename: Lrc, - src: Lrc, + src: impl Into, ) -> Lrc { + self.new_source_file_impl(filename, src.into()) + } + + fn new_source_file_impl(&self, filename: Lrc, mut src: BytesStr) -> Lrc { + remove_bom(&mut src); + // The path is used to determine the directory for loading submodules and // include files, so it must be before remapping. // Note that filename may not be a valid path, eg it may be `` etc, @@ -241,7 +248,7 @@ impl SourceMap { let start_pos = self.next_start_pos(src.len()); - let source_file = Lrc::new(SourceFile::new_from( + let source_file = Lrc::new(SourceFile::new( filename, was_remapped, unmapped_path, @@ -1180,6 +1187,13 @@ impl SourceMap { } } +/// Remove utf-8 BOM if any. +fn remove_bom(src: &mut BytesStr) { + if src.starts_with('\u{feff}') { + src.advance(3); + } +} + /// Calculates the number of excess chars seen in the UTF-8 encoding of a /// file compared with the UTF-16 encoding. fn calc_utf16_offset(file: &SourceFile, bpos: BytePos, state: &mut ByteToCharPosState) -> u32 { @@ -1567,12 +1581,12 @@ mod tests { let sm = SourceMap::new(FilePathMapping::empty()); sm.new_source_file( Lrc::new(PathBuf::from("blork.rs").into()), - "first line.\nsecond line".to_string(), + "first line.\nsecond line", ); - sm.new_source_file(Lrc::new(PathBuf::from("empty.rs").into()), String::new()); + sm.new_source_file(Lrc::new(PathBuf::from("empty.rs").into()), BytesStr::new()); sm.new_source_file( Lrc::new(PathBuf::from("blork2.rs").into()), - "first line.\nsecond line".to_string(), + "first line.\nsecond line", ); sm } @@ -1628,11 +1642,11 @@ mod tests { // € is a three byte utf8 char. sm.new_source_file( Lrc::new(PathBuf::from("blork.rs").into()), - "fir€st €€€€ line.\nsecond line".to_string(), + "fir€st €€€€ line.\nsecond line", ); sm.new_source_file( Lrc::new(PathBuf::from("blork2.rs").into()), - "first line€€.\n€ second line".to_string(), + "first line€€.\n€ second line", ); sm } @@ -1694,7 +1708,7 @@ mod tests { let selection = " \n ~~\n~~~\n~~~~~ \n \n"; sm.new_source_file( Lrc::new(Path::new("blork.rs").to_path_buf().into()), - inputtext.to_string(), + inputtext, ); let span = span_from_selection(inputtext, selection); @@ -1748,7 +1762,7 @@ mod tests { fn t10() { // Test span_to_lines for a span of empty file let sm = SourceMap::new(FilePathMapping::empty()); - sm.new_source_file(Lrc::new(PathBuf::from("blork.rs").into()), "".to_string()); + sm.new_source_file(Lrc::new(PathBuf::from("blork.rs").into()), ""); let span = Span::new(BytePos(1), BytePos(1)); let file_lines = sm.span_to_lines(span).unwrap(); @@ -1763,10 +1777,7 @@ mod tests { let inputtext = "bbbb BB\ncc CCC\n"; let selection1 = " ~~\n \n"; let selection2 = " \n ~~~\n"; - sm.new_source_file( - Lrc::new(Path::new("blork.rs").to_owned().into()), - inputtext.to_owned(), - ); + sm.new_source_file(Lrc::new(Path::new("blork.rs").to_owned().into()), inputtext); let span1 = span_from_selection(inputtext, selection1); let span2 = span_from_selection(inputtext, selection2); @@ -1777,10 +1788,7 @@ mod tests { fn test_calc_utf16_offset() { let input = "t¢e∆s💩t"; let sm = SourceMap::new(FilePathMapping::empty()); - let file = sm.new_source_file( - Lrc::new(PathBuf::from("blork.rs").into()), - input.to_string(), - ); + let file = sm.new_source_file(Lrc::new(PathBuf::from("blork.rs").into()), input); let mut state = ByteToCharPosState::default(); let mut bpos = file.start_pos; @@ -1808,10 +1816,7 @@ mod tests { fn bytepos_to_charpos() { let input = "t¢e∆s💩t"; let sm = SourceMap::new(FilePathMapping::empty()); - let file = sm.new_source_file( - Lrc::new(PathBuf::from("blork.rs").into()), - input.to_string(), - ); + let file = sm.new_source_file(Lrc::new(PathBuf::from("blork.rs").into()), input); let mut bpos = file.start_pos; let mut cpos = CharPos(0); diff --git a/crates/swc_common/src/syntax_pos.rs b/crates/swc_common/src/syntax_pos.rs index b92c26c751f4..1dabb9ca83bb 100644 --- a/crates/swc_common/src/syntax_pos.rs +++ b/crates/swc_common/src/syntax_pos.rs @@ -7,6 +7,7 @@ use std::{ sync::{atomic::AtomicU32, Mutex}, }; +use bytes_str::BytesStr; use serde::{Deserialize, Serialize}; use url::Url; @@ -773,57 +774,6 @@ impl Sub for NonNarrowChar { } } -/// This is not a public interface, workaround for https://github.com/swc-project/swc/issues/7238 -#[doc(hidden)] -#[cfg(feature = "rkyv-impl")] -#[derive(Debug, Clone, Copy)] -#[cfg_attr(feature = "rkyv-impl", derive(bytecheck::CheckBytes))] -#[cfg_attr(feature = "rkyv-impl", repr(C))] -pub struct EncodeArcString; - -#[cfg(feature = "rkyv-impl")] -impl rkyv::with::ArchiveWith> for EncodeArcString { - type Archived = rkyv::Archived; - type Resolver = rkyv::Resolver; - - fn resolve_with( - field: &Lrc, - resolver: Self::Resolver, - out: rkyv::Place, - ) { - let s = field.to_string(); - rkyv::Archive::resolve(&s, resolver, out); - } -} - -#[cfg(feature = "rkyv-impl")] -impl rkyv::with::SerializeWith, S> for EncodeArcString -where - S: ?Sized + rancor::Fallible + rkyv::ser::Writer, - S::Error: rancor::Source, -{ - fn serialize_with(field: &Lrc, serializer: &mut S) -> Result { - rkyv::string::ArchivedString::serialize_from_str(field, serializer) - } -} - -#[cfg(feature = "rkyv-impl")] -impl rkyv::with::DeserializeWith, Lrc, D> for EncodeArcString -where - D: ?Sized + rancor::Fallible, -{ - fn deserialize_with( - field: &rkyv::Archived, - deserializer: &mut D, - ) -> Result, D::Error> { - use rkyv::Deserialize; - - let s: String = field.deserialize(deserializer)?; - - Ok(s.into()) - } -} - /// A single source in the SourceMap. #[cfg_attr( any(feature = "rkyv-impl"), @@ -846,8 +796,7 @@ pub struct SourceFile { /// Indicates which crate this `SourceFile` was imported from. pub crate_of_origin: u32, /// The complete source code - #[cfg_attr(any(feature = "rkyv-impl"), rkyv(with = EncodeArcString))] - pub src: Lrc, + pub src: BytesStr, /// The source code's hash pub src_hash: u128, /// The start position of this source in the `SourceMap` @@ -883,30 +832,12 @@ impl fmt::Debug for SourceFile { } impl SourceFile { - pub fn new( - name: Lrc, - name_was_remapped: bool, - unmapped_path: Lrc, - mut src: String, - start_pos: BytePos, - ) -> SourceFile { - remove_bom(&mut src); - - Self::new_from( - name, - name_was_remapped, - unmapped_path, - Lrc::new(src), - start_pos, - ) - } - /// `src` should not have UTF8 BOM - pub fn new_from( + pub fn new( name: Lrc, name_was_remapped: bool, unmapped_path: Lrc, - src: Lrc, + src: BytesStr, start_pos: BytePos, ) -> SourceFile { debug_assert_ne!( @@ -1037,13 +968,6 @@ impl SourceFile { } } -/// Remove utf-8 BOM if any. -pub(super) fn remove_bom(src: &mut String) { - if src.starts_with('\u{feff}') { - src.drain(..3); - } -} - // _____________________________________________________________________________ // Pos, BytePos, CharPos // diff --git a/crates/swc_common/tests/source_map.rs b/crates/swc_common/tests/source_map.rs index ad358d8781ff..7a5609ad979e 100644 --- a/crates/swc_common/tests/source_map.rs +++ b/crates/swc_common/tests/source_map.rs @@ -31,8 +31,7 @@ export class Product extends TimestampedEntity { @OneToMany(() => Discount, (discount) => discount.product) public discounts!: Discount[]; -}" - .into(), +}", ); }) } diff --git a/crates/swc_core/tests/fixture/stub_napi/Cargo.lock b/crates/swc_core/tests/fixture/stub_napi/Cargo.lock index 73923f0ae7bf..5a0c2991c5a0 100644 --- a/crates/swc_core/tests/fixture/stub_napi/Cargo.lock +++ b/crates/swc_core/tests/fixture/stub_napi/Cargo.lock @@ -29,16 +29,16 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.2.15", + "getrandom 0.3.3", "once_cell", "serde", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -79,9 +79,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arbitrary" @@ -114,18 +114,18 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -139,13 +139,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -156,9 +156,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -207,7 +207,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "cexpr", "clang-sys", "itertools 0.13.0", @@ -218,7 +218,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -229,9 +229,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -247,16 +247,15 @@ dependencies = [ [[package]] name = "blake3" -version = "1.6.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "memmap2 0.9.5", ] [[package]] @@ -270,14 +269,14 @@ dependencies = [ [[package]] name = "browserslist-rs" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f95aff901882c66e4b642f3f788ceee152ef44f8a5ef12cb1ddee5479c483be" +checksum = "abf24e007a83ff1f58d2441b459fa26124aa1a7367da88948e9940f14e723d06" dependencies = [ "ahash", "chrono", "either", - "indexmap 2.7.1", + "indexmap 2.9.0", "itertools 0.13.0", "nom 7.1.3", "serde", @@ -287,9 +286,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "serde", @@ -297,9 +296,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] @@ -346,7 +345,7 @@ checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -357,27 +356,38 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] +[[package]] +name = "bytes-str" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +dependencies = [ + "bytes", + "rkyv", + "serde", +] + [[package]] name = "bytesize" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" dependencies = [ "serde", ] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -393,16 +403,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -416,9 +426,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.15" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -452,14 +462,14 @@ checksum = "1d001a06f3969c49af3bdf308e9aaa1a477e77d2460357ce9e1248c6a9dcc4c0" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -524,9 +534,9 @@ dependencies = [ [[package]] name = "console" -version = "0.15.10" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", "libc", @@ -573,9 +583,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "corosensei" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" +checksum = "5d1ea1c2a2f898d2a6ff149587b8a04f41ee708d248c723f01ac2f0f01edc0b3" dependencies = [ "autocfg", "cfg-if", @@ -714,9 +724,9 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crossbeam-channel" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] @@ -778,7 +788,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -793,12 +803,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core 0.20.11", + "darling_macro 0.20.11", ] [[package]] @@ -817,16 +827,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -842,13 +852,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.20.10", + "darling_core 0.20.11", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -880,9 +890,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debugid" @@ -896,9 +906,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -950,10 +960,10 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ - "darling 0.20.10", + "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -973,18 +983,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "derive_more" -version = "0.99.19" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1004,7 +1014,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", "unicode-xid", ] @@ -1026,7 +1036,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1046,15 +1056,15 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "either" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "encode_unicode" @@ -1084,23 +1094,23 @@ dependencies = [ [[package]] name = "enumset" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +checksum = "11a6b7c3d347de0a9f7bfd2f853be43fe32fa6fac30c70f6d6d67a1e936b87ee" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +checksum = "6da3ea9e1d1a3b1593e15781f930120e72aa7501610b2f82e5b6739c72e8eac5" dependencies = [ - "darling 0.20.10", + "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1111,9 +1121,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", "windows-sys 0.59.0", @@ -1157,9 +1167,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -1171,6 +1181,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1201,7 +1217,7 @@ version = "2.0.0" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1272,7 +1288,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1317,9 +1333,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", @@ -1330,16 +1346,16 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.13.3+wasi-0.2.2", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", "wasm-bindgen", - "windows-targets 0.52.6", ] [[package]] @@ -1349,7 +1365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator", - "indexmap 2.7.1", + "indexmap 2.9.0", "stable_deref_trait", ] @@ -1380,9 +1396,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", @@ -1424,9 +1440,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "heapless" @@ -1458,9 +1479,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -1482,9 +1503,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1541,11 +1562,10 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", @@ -1554,7 +1574,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots", + "webpki-roots 1.0.0", ] [[package]] @@ -1575,16 +1595,21 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ + "base64", "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", "socket2", "tokio", @@ -1594,14 +1619,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1656,9 +1682,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -1680,9 +1706,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -1701,9 +1727,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -1730,7 +1756,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1800,26 +1826,24 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.4", "rayon", "serde", ] [[package]] name = "insta" -version = "1.42.1" +version = "1.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c1b125e30d93896b365e156c33dadfffab45ee8400afcbba4752f59de08a86" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" dependencies = [ "console", - "linked-hash-map", "once_cell", - "pin-project", "regex", "serde", "similar", @@ -1840,6 +1864,16 @@ dependencies = [ "ipnet", ] +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is-macro" version = "0.3.7" @@ -1849,7 +1883,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -1872,9 +1906,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" @@ -1930,25 +1964,25 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.170" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] name = "libmimalloc-sys" -version = "0.1.39" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" +checksum = "ec9d6fac27761dabcd4ee73571cdb06b7022dc99089acbe5435691edffaac0f4" dependencies = [ "cc", "libc", @@ -1960,7 +1994,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "libc", "redox_syscall", ] @@ -2002,11 +2036,17 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "litrs" @@ -2016,9 +2056,9 @@ checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -2026,9 +2066,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -2039,6 +2079,12 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "lz4_flex" version = "0.11.3" @@ -2063,9 +2109,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb4bdc8b0ce69932332cf76d24af69c3a155242af95c226b2ab6c2e371ed1149" dependencies = [ - "thiserror 2.0.11", - "zerocopy 0.8.25", - "zerocopy-derive 0.8.25", + "thiserror 2.0.12", + "zerocopy", + "zerocopy-derive", ] [[package]] @@ -2098,15 +2144,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memmap2" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" -dependencies = [ - "libc", -] - [[package]] name = "memoffset" version = "0.9.1" @@ -2118,34 +2155,33 @@ dependencies = [ [[package]] name = "miette" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror 1.0.69", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "mimalloc" -version = "0.1.43" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" +checksum = "995942f432bbb4822a7e9c3faa87a695185b0d09273ba85f097b54f4e458f2af" dependencies = [ "libmimalloc-sys", ] @@ -2164,23 +2200,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2206,16 +2242,16 @@ checksum = "734799cf91479720b2f970c61a22850940dd91e27d4f02b1c6fc792778df2459" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "napi" -version = "2.16.16" +version = "2.16.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839ae2ee5e62c6348669c50098b187c08115bd3cced658c9c0bf945fca0fec83" +checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "ctor", "napi-derive", "napi-sys", @@ -2226,9 +2262,9 @@ dependencies = [ [[package]] name = "napi-build" -version = "2.1.4" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db836caddef23662b94e16bf1f26c40eceb09d6aee5d5b06a7ac199320b69b19" +checksum = "44e0e3177307063d3e7e55b7dd7b648cca9d7f46daa35422c0d98cc2bf48c2c1" [[package]] name = "napi-derive" @@ -2241,7 +2277,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2256,7 +2292,7 @@ dependencies = [ "quote", "regex", "semver", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2367,9 +2403,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -2414,7 +2450,7 @@ dependencies = [ "crc32fast", "flate2", "hashbrown 0.14.5", - "indexmap 2.7.1", + "indexmap 2.9.0", "memchr", "ruzstd", ] @@ -2430,17 +2466,17 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.72" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "cfg-if", "foreign-types", "libc", @@ -2457,7 +2493,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2468,9 +2504,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.108" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", @@ -2492,15 +2528,15 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.2.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" [[package]] name = "par-core" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b506ab63a8bd3cd38858c7bfc2d078a189dc3210c7f8c9be1bbaf50c082a0ae" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" dependencies = [ "chili", "once_cell", @@ -2518,9 +2554,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -2528,9 +2564,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -2576,7 +2612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.7.1", + "indexmap 2.9.0", ] [[package]] @@ -2586,7 +2622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset 0.5.7", - "indexmap 2.7.1", + "indexmap 2.9.0", ] [[package]] @@ -2619,7 +2655,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2633,22 +2669,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2665,9 +2701,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "powerfmt" @@ -2677,11 +2713,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -2702,12 +2738,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" dependencies = [ "proc-macro2", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2739,23 +2775,23 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -2797,7 +2833,7 @@ checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -2813,9 +2849,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" +checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", "cfg_aliases", @@ -2825,7 +2861,7 @@ dependencies = [ "rustc-hash 2.1.1", "rustls", "socket2", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "web-time", @@ -2833,19 +2869,20 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbafbbdbb0f638fe3f35f3c56739f77a8a1d070cb25603226c83339b391472b" +checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" dependencies = [ "bytes", - "getrandom 0.3.1", + "getrandom 0.3.3", + "lru-slab", "rand 0.9.1", "ring", "rustc-hash 2.1.1", "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.11", + "thiserror 2.0.12", "tinyvec", "tracing", "web-time", @@ -2862,18 +2899,24 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -2942,7 +2985,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -2951,7 +2994,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.3", ] [[package]] @@ -2976,11 +3019,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", ] [[package]] @@ -3052,6 +3095,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "regress" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ef7fa9ed0256d64a688a3747d0fef7a88851c18a5e1d57f115f38ec2e09366" +dependencies = [ + "hashbrown 0.15.4", + "memchr", +] + [[package]] name = "relative-path" version = "1.9.3" @@ -3069,15 +3122,15 @@ dependencies = [ [[package]] name = "replace_with" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" +checksum = "51743d3e274e2b18df81c4dc6caf8a5b8e15dbe799e0dca05c7617380094e884" [[package]] name = "reqwest" -version = "0.12.15" +version = "0.12.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +checksum = "a2f8e5513d63f2e5b386eb5106dc67eaf3f84e95258e210489136b8b92ad6119" dependencies = [ "base64", "bytes", @@ -3101,7 +3154,6 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", @@ -3113,25 +3165,25 @@ dependencies = [ "tokio-socks", "tokio-util", "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", - "windows-registry", + "webpki-roots 1.0.0", ] [[package]] name = "ring" -version = "0.17.11" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -3145,8 +3197,8 @@ checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ "bytecheck 0.8.1", "bytes", - "hashbrown 0.15.2", - "indexmap 2.7.1", + "hashbrown 0.15.4", + "indexmap 2.9.0", "munge", "ptr_meta 0.3.0", "rancor", @@ -3164,7 +3216,7 @@ checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -3200,18 +3252,31 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" dependencies = [ "log", "once_cell", @@ -3222,29 +3287,21 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ "web-time", + "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "ring", "rustls-pki-types", @@ -3253,9 +3310,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "rusty_pool" @@ -3277,15 +3334,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", - "derive_more 0.99.19", + "derive_more 0.99.20", "twox-hash", ] [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" @@ -3323,12 +3380,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", - "indexmap 2.7.1", + "indexmap 2.9.0", "schemars_derive", "serde", "serde_json", @@ -3337,14 +3394,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -3365,7 +3422,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "core-foundation", "core-foundation-sys", "libc", @@ -3384,24 +3441,24 @@ dependencies = [ [[package]] name = "self_cell" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" +checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749" [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -3419,13 +3476,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -3436,14 +3493,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -3453,9 +3510,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -3478,7 +3535,7 @@ version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59e2dd588bf1597a252c3b920e0143eb99b0f76e4e082f4c92ce34fbc9e71ddd" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.9.0", "itoa", "libyml", "memchr", @@ -3500,9 +3557,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -3525,7 +3582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ "bytes", - "memmap2 0.6.2", + "memmap2", ] [[package]] @@ -3584,9 +3641,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smartstring" @@ -3612,9 +3669,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3622,9 +3679,9 @@ dependencies = [ [[package]] name = "sourcemap" -version = "9.2.0" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd430118acc9fdd838557649b9b43fd0a78e3834d84a283b466f8e84720d6101" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", @@ -3665,9 +3722,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9156ebd5870ef293bfb43f91c7a74528d363ec0d424afe24160ed5a4343d08a" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" dependencies = [ "cc", "cfg-if", @@ -3684,7 +3741,7 @@ checksum = "710e9696ef338691287aeb937ee6ffe60022f579d3c8d2fd9d58973a9a10a466" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -3700,7 +3757,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -3744,13 +3801,14 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swc" -version = "22.0.0" +version = "25.0.0" dependencies = [ "anyhow", "base64", + "bytes-str", "dashmap 5.5.3", "either", - "indexmap 2.7.1", + "indexmap 2.9.0", "jsonc-parser", "lru", "napi", @@ -3823,12 +3881,12 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "16.0.0" +version = "19.0.0" dependencies = [ "anyhow", "crc", "dashmap 5.5.3", - "indexmap 2.7.1", + "indexmap 2.9.0", "is-macro", "once_cell", "parking_lot", @@ -3853,12 +3911,13 @@ dependencies = [ [[package]] name = "swc_common" -version = "9.1.0" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck 0.8.1", + "bytes-str", "cfg-if", "either", "from_variant", @@ -3883,7 +3942,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "19.0.0" +version = "22.0.1" dependencies = [ "anyhow", "base64", @@ -3909,14 +3968,15 @@ dependencies = [ [[package]] name = "swc_config" -version = "2.0.0" +version = "3.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", "globset", - "indexmap 2.7.1", + "indexmap 2.9.0", "once_cell", "regex", + "regress", "rustc-hash 2.1.1", "serde", "serde_json", @@ -3931,12 +3991,12 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_core" -version = "23.2.0" +version = "26.4.5" dependencies = [ "swc", "swc_allocator", @@ -3956,9 +4016,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "9.0.0" +version = "11.0.0" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "bytecheck 0.8.1", "is-macro", "num-bigint", @@ -3978,7 +4038,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "11.0.0" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -3987,6 +4047,7 @@ dependencies = [ "once_cell", "regex", "rustc-hash 2.1.1", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -4004,12 +4065,12 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_ecma_compat_bugfixes" -version = "13.0.0" +version = "16.0.0" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -4025,7 +4086,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4036,10 +4097,10 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "13.0.0" +version = "16.0.0" dependencies = [ "arrayvec", - "indexmap 2.7.1", + "indexmap 2.9.0", "is-macro", "rustc-hash 2.1.1", "serde", @@ -4061,7 +4122,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -4076,7 +4137,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "13.0.0" +version = "15.0.0" dependencies = [ "serde", "swc_atoms", @@ -4092,7 +4153,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "13.0.0" +version = "15.0.0" dependencies = [ "serde", "swc_atoms", @@ -4109,7 +4170,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -4123,7 +4184,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "14.0.0" +version = "16.0.0" dependencies = [ "serde", "swc_atoms", @@ -4139,7 +4200,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -4153,7 +4214,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "14.0.0" +version = "16.0.0" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -4171,7 +4232,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4184,7 +4245,7 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "13.0.0" +version = "15.0.0" dependencies = [ "phf", "swc_atoms", @@ -4196,10 +4257,10 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "12.0.0" +version = "14.0.5" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.1", "either", "new_debug_unreachable", "num-bigint", @@ -4219,7 +4280,7 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "13.0.0" +version = "16.0.0" dependencies = [ "auto_impl", "dashmap 5.5.3", @@ -4238,7 +4299,7 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "9.0.0" +version = "11.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -4258,11 +4319,11 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "17.0.0" +version = "20.0.5" dependencies = [ "arrayvec", - "bitflags 2.8.0", - "indexmap 2.7.1", + "bitflags 2.9.1", + "indexmap 2.9.0", "num-bigint", "num_cpus", "once_cell", @@ -4294,10 +4355,10 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "12.0.0" +version = "14.0.2" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.1", "either", "new_debug_unreachable", "num-bigint", @@ -4318,11 +4379,11 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "17.0.0" +version = "20.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", - "indexmap 2.7.1", + "indexmap 2.9.0", "once_cell", "preset_env_base", "rustc-hash 2.1.1", @@ -4341,7 +4402,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "16.0.0" +version = "19.0.0" dependencies = [ "par-core", "swc_atoms", @@ -4360,11 +4421,11 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "13.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", - "bitflags 2.8.0", - "indexmap 2.7.1", + "bitflags 2.9.1", + "indexmap 2.9.0", "once_cell", "par-core", "phf", @@ -4383,7 +4444,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -4395,10 +4456,10 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "14.0.0" +version = "17.0.0" dependencies = [ "arrayvec", - "indexmap 2.7.1", + "indexmap 2.9.0", "is-macro", "num-bigint", "par-core", @@ -4436,17 +4497,17 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_ecma_transforms_module" -version = "14.0.0" +version = "17.0.0" dependencies = [ "Inflector", "anyhow", - "bitflags 2.8.0", - "indexmap 2.7.1", + "bitflags 2.9.1", + "indexmap 2.9.0", "is-macro", "path-clean 1.0.1", "pathdiff", @@ -4467,10 +4528,11 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "13.0.0" +version = "16.0.0" dependencies = [ + "bytes-str", "dashmap 5.5.3", - "indexmap 2.7.1", + "indexmap 2.9.0", "once_cell", "par-core", "petgraph 0.7.1", @@ -4490,7 +4552,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "13.0.0" +version = "15.0.0" dependencies = [ "either", "rustc-hash 2.1.1", @@ -4508,11 +4570,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "14.0.0" +version = "17.0.0" dependencies = [ "base64", + "bytes-str", "dashmap 5.5.3", - "indexmap 2.7.1", + "indexmap 2.9.0", "once_cell", "rayon", "rustc-hash 2.1.1", @@ -4533,8 +4596,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "14.0.0" +version = "17.0.0" dependencies = [ + "bytes-str", "once_cell", "rustc-hash 2.1.1", "ryu-js", @@ -4550,10 +4614,10 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "14.0.0" +version = "16.0.1" dependencies = [ - "bitflags 2.8.0", - "indexmap 2.7.1", + "bitflags 2.9.1", + "indexmap 2.9.0", "rustc-hash 2.1.1", "swc_atoms", "swc_common", @@ -4566,9 +4630,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "13.0.0" +version = "15.0.2" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.9.0", "num_cpus", "once_cell", "par-core", @@ -4586,7 +4650,7 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "9.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -4603,12 +4667,12 @@ version = "1.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_error_reporters" -version = "11.0.0" +version = "13.0.0" dependencies = [ "anyhow", "miette", @@ -4622,7 +4686,7 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" -version = "10.0.0" +version = "12.0.0" dependencies = [ "auto_impl", "petgraph 0.7.1", @@ -4637,12 +4701,12 @@ version = "1.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_malloc" -version = "1.2.2" +version = "1.2.3" dependencies = [ "mimalloc", "tikv-jemallocator", @@ -4650,7 +4714,7 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "23.0.0" +version = "26.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -4678,7 +4742,7 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "9.0.0" +version = "11.0.0" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", @@ -4700,7 +4764,7 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "9.0.0" +version = "11.0.0" dependencies = [ "better_scoped_tls", "bytecheck 0.8.1", @@ -4715,7 +4779,7 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "11.1.0" +version = "13.0.0" dependencies = [ "anyhow", "enumset", @@ -4752,12 +4816,12 @@ version = "2.0.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "swc_transform_common" -version = "3.0.0" +version = "5.0.0" dependencies = [ "better_scoped_tls", "once_cell", @@ -4769,9 +4833,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "12.0.0" +version = "14.0.3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", "petgraph 0.7.1", "rustc-hash 2.1.1", "swc_atoms", @@ -4803,9 +4867,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -4823,13 +4887,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -4857,15 +4921,14 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.17.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.3", "once_cell", - "rustix", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -4875,7 +4938,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix", + "rustix 0.38.44", "windows-sys 0.48.0", ] @@ -4890,12 +4953,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.1.14", + "unicode-width 0.2.0", ] [[package]] @@ -4909,11 +4972,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -4924,18 +4987,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -4970,9 +5033,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -4987,15 +5050,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -5013,9 +5076,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -5028,9 +5091,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -5051,7 +5114,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -5100,9 +5163,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -5113,22 +5176,22 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.20" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.24", + "toml_edit 0.22.27", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] @@ -5139,24 +5202,31 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.9.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.3", + "toml_write", + "winnow 0.7.10", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "tower" version = "0.5.2" @@ -5172,6 +5242,24 @@ dependencies = [ "tower-service", ] +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags 2.9.1", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -5198,13 +5286,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] @@ -5220,9 +5308,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -5325,9 +5413,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -5387,7 +5475,7 @@ dependencies = [ "rustls", "rustls-pki-types", "url", - "webpki-roots", + "webpki-roots 0.26.11", ] [[package]] @@ -5422,9 +5510,13 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.14.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "valuable" @@ -5440,9 +5532,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "9.0.4" +version = "9.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d2f179f8075b805a43a2a21728a46f0cc2921b3c58695b28fa8817e103cd9a" +checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" dependencies = [ "anyhow", "cargo_metadata", @@ -5482,7 +5574,7 @@ dependencies = [ "derivative", "dunce", "futures", - "getrandom 0.2.15", + "getrandom 0.2.16", "indexmap 1.9.3", "lazy_static", "pin-project-lite", @@ -5510,8 +5602,8 @@ dependencies = [ "filetime", "fs_extra", "futures", - "getrandom 0.2.15", - "indexmap 2.7.1", + "getrandom 0.2.16", + "indexmap 2.9.0", "libc", "pin-project-lite", "replace_with", @@ -5526,9 +5618,9 @@ dependencies = [ [[package]] name = "virtual-mio" -version = "0.600.0" +version = "0.600.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e6226c62058843d3f5b23501911972042bb7a1bdc7042d74855d062870fa84" +checksum = "e5564ace0b5098d394f6ca9aa62046da4e2e5912703cc7fec71a79dd3ae76b5d" dependencies = [ "async-trait", "bytes", @@ -5542,9 +5634,9 @@ dependencies = [ [[package]] name = "virtual-net" -version = "0.600.0" +version = "0.600.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7a7d65a5652fb7e8db54676f523e489318228ee2a742db0728396b34b4a728" +checksum = "31b44e5bdba1d7f0223ee4f9e6aab55f993c610629503a855fc55fabd6c10f4e" dependencies = [ "anyhow", "async-trait", @@ -5554,6 +5646,7 @@ dependencies = [ "bytes", "derive_more 1.0.0", "futures-util", + "idna_adapter", "ipnet", "iprange", "libc", @@ -5674,9 +5767,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -5703,7 +5796,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", "wasm-bindgen-shared", ] @@ -5738,7 +5831,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5754,12 +5847,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.226.0" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d81b727619aec227dce83e7f7420d4e56c79acd044642a356ea045b98d4e13" +checksum = "9679ae3cf7cfa2ca3a327f7fab97f27f3294d402fd1a76ca8ab514e17973e4d3" dependencies = [ "leb128fmt", - "wasmparser 0.226.0", + "wasmparser 0.233.0", ] [[package]] @@ -5786,7 +5879,7 @@ dependencies = [ "cfg-if", "cmake", "derive_more 1.0.0", - "indexmap 2.7.1", + "indexmap 2.9.0", "js-sys", "more-asserts", "paste", @@ -5836,7 +5929,7 @@ dependencies = [ "leb128", "libc", "macho-unwind-info", - "memmap2 0.6.2", + "memmap2", "more-asserts", "object 0.32.2", "region", @@ -5884,7 +5977,7 @@ dependencies = [ "ciborium", "derive_builder 0.12.0", "hex", - "indexmap 2.7.1", + "indexmap 2.9.0", "schemars", "semver", "serde", @@ -5906,7 +5999,7 @@ dependencies = [ "ciborium", "derive_builder 0.12.0", "hex", - "indexmap 2.7.1", + "indexmap 2.9.0", "saffron", "schemars", "semver", @@ -6021,9 +6114,9 @@ dependencies = [ "bytecheck 0.6.12", "enum-iterator", "enumset", - "getrandom 0.2.15", + "getrandom 0.2.16", "hex", - "indexmap 2.7.1", + "indexmap 2.9.0", "more-asserts", "rkyv", "serde", @@ -6048,7 +6141,7 @@ dependencies = [ "dashmap 6.1.0", "enum-iterator", "fnv", - "indexmap 2.7.1", + "indexmap 2.9.0", "libc", "libunwind", "mach2", @@ -6079,7 +6172,7 @@ dependencies = [ "dashmap 6.1.0", "derive_more 1.0.0", "futures", - "getrandom 0.2.15", + "getrandom 0.2.16", "heapless", "hex", "http", @@ -6158,25 +6251,25 @@ version = "0.224.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f17a5917c2ddd3819e84c661fae0d6ba29d7b9c1f0e96c708c65a9c4188e11" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", ] [[package]] name = "wasmparser" -version = "0.226.0" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc28600dcb2ba68d7e5f1c3ba4195c2bddc918c0243fd702d0b6dbd05689b681" +checksum = "b51cb03afce7964bbfce46602d6cb358726f36430b6ba084ac6020d8ce5bc102" dependencies = [ - "bitflags 2.8.0", - "indexmap 2.7.1", + "bitflags 2.9.1", + "indexmap 2.9.0", "semver", ] [[package]] name = "wast" -version = "226.0.0" +version = "233.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb903956d0151eabb6c30a2304dd61e5c8d7182805226120c2b6d611fb09a26" +checksum = "2eaf4099d8d0c922b83bf3c90663f5666f0769db9e525184284ebbbdb1dd2180" dependencies = [ "bumpalo", "leb128fmt", @@ -6187,9 +6280,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.226.0" +version = "1.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89a90ef2c401b8b5b2b704020bfa7a7f69b93c3034c7a4b4a88e21e9966581" +checksum = "3d9bc80f5e4b25ea086ef41b91ccd244adde45d931c384d94a8ff64ab8bd7d87" dependencies = [ "wast", ] @@ -6227,7 +6320,7 @@ dependencies = [ "ciborium", "document-features", "ignore", - "indexmap 2.7.1", + "indexmap 2.9.0", "leb128", "lexical-sort", "libc", @@ -6255,7 +6348,7 @@ dependencies = [ "ciborium", "document-features", "ignore", - "indexmap 2.7.1", + "indexmap 2.9.0", "leb128", "lexical-sort", "libc", @@ -6272,18 +6365,27 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.8" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.0", +] + +[[package]] +name = "webpki-roots" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" dependencies = [ "rustls-pki-types", ] [[package]] name = "weezl" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" [[package]] name = "winapi" @@ -6318,44 +6420,59 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] -name = "windows-link" -version = "0.1.1" +name = "windows-implement" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] [[package]] -name = "windows-registry" -version = "0.4.0" +name = "windows-interface" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.53.0", + "proc-macro2", + "quote", + "syn 2.0.101", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link", ] @@ -6583,20 +6700,20 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.3" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.1", ] [[package]] @@ -6622,13 +6739,12 @@ dependencies = [ [[package]] name = "xattr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "rustix 1.0.7", ] [[package]] @@ -6657,38 +6773,17 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", "synstructure", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive 0.7.35", -] - [[package]] name = "zerocopy" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "zerocopy-derive 0.8.25", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", + "zerocopy-derive", ] [[package]] @@ -6699,27 +6794,27 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", "synstructure", ] @@ -6748,5 +6843,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.101", ] diff --git a/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock b/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock index cb845e07c63b..36f5b4e3f215 100644 --- a/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock +++ b/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock @@ -126,7 +126,7 @@ dependencies = [ [[package]] name = "binding_macros" -version = "22.0.0" +version = "25.0.0" dependencies = [ "anyhow", "console_error_panic_hook", @@ -210,6 +210,22 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +dependencies = [ + "bytes", + "serde", +] + [[package]] name = "camino" version = "1.1.9" @@ -468,6 +484,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -551,6 +573,11 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "heck" @@ -1222,6 +1249,16 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "regress" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ef7fa9ed0256d64a688a3747d0fef7a88851c18a5e1d57f115f38ec2e09366" +dependencies = [ + "hashbrown 0.15.2", + "memchr", +] + [[package]] name = "rustc-hash" version = "2.1.1" @@ -1462,10 +1499,11 @@ dependencies = [ [[package]] name = "swc" -version = "22.0.0" +version = "25.0.0" dependencies = [ "anyhow", "base64", + "bytes-str", "dashmap", "either", "indexmap", @@ -1533,11 +1571,12 @@ dependencies = [ [[package]] name = "swc_common" -version = "9.1.0" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", + "bytes-str", "cfg-if", "either", "from_variant", @@ -1560,7 +1599,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "19.0.0" +version = "22.0.1" dependencies = [ "anyhow", "base64", @@ -1584,7 +1623,7 @@ dependencies = [ [[package]] name = "swc_config" -version = "2.0.0" +version = "3.0.0" dependencies = [ "anyhow", "dashmap", @@ -1592,6 +1631,7 @@ dependencies = [ "indexmap", "once_cell", "regex", + "regress", "rustc-hash", "serde", "serde_json", @@ -1611,7 +1651,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "23.2.0" +version = "26.4.5" dependencies = [ "binding_macros", "swc", @@ -1627,7 +1667,7 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "9.0.0" +version = "11.0.0" dependencies = [ "bitflags", "is-macro", @@ -1646,7 +1686,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "11.0.0" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -1655,6 +1695,7 @@ dependencies = [ "once_cell", "regex", "rustc-hash", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -1677,7 +1718,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "13.0.0" +version = "16.0.0" dependencies = [ "rustc-hash", "swc_atoms", @@ -1693,7 +1734,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -1704,7 +1745,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "13.0.0" +version = "16.0.0" dependencies = [ "arrayvec", "indexmap", @@ -1729,7 +1770,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -1744,7 +1785,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "13.0.0" +version = "15.0.0" dependencies = [ "serde", "swc_atoms", @@ -1760,7 +1801,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "13.0.0" +version = "15.0.0" dependencies = [ "serde", "swc_atoms", @@ -1777,7 +1818,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -1791,7 +1832,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "14.0.0" +version = "16.0.0" dependencies = [ "serde", "swc_atoms", @@ -1807,7 +1848,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -1821,7 +1862,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "14.0.0" +version = "16.0.0" dependencies = [ "rustc-hash", "swc_atoms", @@ -1839,7 +1880,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -1852,7 +1893,7 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "13.0.0" +version = "15.0.0" dependencies = [ "phf", "swc_atoms", @@ -1864,7 +1905,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "12.0.0" +version = "14.0.5" dependencies = [ "arrayvec", "bitflags", @@ -1887,7 +1928,7 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "13.0.0" +version = "16.0.0" dependencies = [ "auto_impl", "dashmap", @@ -1906,7 +1947,7 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "9.0.0" +version = "11.0.0" dependencies = [ "anyhow", "dashmap", @@ -1926,7 +1967,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "17.0.0" +version = "20.0.5" dependencies = [ "arrayvec", "bitflags", @@ -1962,7 +2003,7 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "12.0.0" +version = "14.0.2" dependencies = [ "arrayvec", "bitflags", @@ -1986,7 +2027,7 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "17.0.0" +version = "20.0.0" dependencies = [ "anyhow", "dashmap", @@ -2009,7 +2050,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "16.0.0" +version = "19.0.0" dependencies = [ "par-core", "swc_atoms", @@ -2028,7 +2069,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "13.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags", @@ -2050,7 +2091,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "13.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -2062,7 +2103,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "14.0.0" +version = "17.0.0" dependencies = [ "arrayvec", "indexmap", @@ -2107,7 +2148,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "14.0.0" +version = "17.0.0" dependencies = [ "Inflector", "anyhow", @@ -2133,8 +2174,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "13.0.0" +version = "16.0.0" dependencies = [ + "bytes-str", "dashmap", "indexmap", "once_cell", @@ -2155,7 +2197,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "13.0.0" +version = "15.0.0" dependencies = [ "either", "rustc-hash", @@ -2173,9 +2215,10 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "14.0.0" +version = "17.0.0" dependencies = [ "base64", + "bytes-str", "dashmap", "indexmap", "once_cell", @@ -2197,8 +2240,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "14.0.0" +version = "17.0.0" dependencies = [ + "bytes-str", "once_cell", "rustc-hash", "ryu-js", @@ -2214,7 +2258,7 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "14.0.0" +version = "16.0.1" dependencies = [ "bitflags", "indexmap", @@ -2230,7 +2274,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "13.0.0" +version = "15.0.2" dependencies = [ "indexmap", "num_cpus", @@ -2249,7 +2293,7 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "9.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -2271,7 +2315,7 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "11.0.0" +version = "13.0.0" dependencies = [ "anyhow", "miette", @@ -2294,7 +2338,7 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "9.0.0" +version = "11.0.0" dependencies = [ "dashmap", "rustc-hash", @@ -2320,7 +2364,7 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "3.0.0" +version = "5.0.0" dependencies = [ "better_scoped_tls", "once_cell", @@ -2332,7 +2376,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "12.0.0" +version = "14.0.3" dependencies = [ "bitflags", "petgraph", diff --git a/crates/swc_css_parser/benches/compare.rs b/crates/swc_css_parser/benches/compare.rs index 67298eb67ef0..dc16490b5385 100644 --- a/crates/swc_css_parser/benches/compare.rs +++ b/crates/swc_css_parser/benches/compare.rs @@ -15,7 +15,7 @@ where let _ = ::testing::run_test(false, |cm, _| { let comments = SingleThreadedComments::default(); - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let lexer = Lexer::new(StringInput::from(&*fm), Some(&comments), Default::default()); let mut parser = Parser::new(lexer, Default::default()); diff --git a/crates/swc_css_parser/benches/lexer.rs b/crates/swc_css_parser/benches/lexer.rs index fc8b8c152047..4f3d1b81c7f4 100644 --- a/crates/swc_css_parser/benches/lexer.rs +++ b/crates/swc_css_parser/benches/lexer.rs @@ -6,7 +6,7 @@ use swc_css_parser::lexer::Lexer; fn bench_stylesheet(b: &mut Bencher, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let lexer = Lexer::new(StringInput::from(&*fm), None, Default::default()); diff --git a/crates/swc_css_parser/benches/parser.rs b/crates/swc_css_parser/benches/parser.rs index a31415b4c97b..f25adff45b57 100644 --- a/crates/swc_css_parser/benches/parser.rs +++ b/crates/swc_css_parser/benches/parser.rs @@ -6,7 +6,7 @@ use swc_css_parser::{lexer::Lexer, parser::Parser}; fn bench_stylesheet(b: &mut Bencher, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let _ = black_box({ diff --git a/crates/swc_ecma_codegen/benches/bench.rs b/crates/swc_ecma_codegen/benches/bench.rs index da4b86eae959..f64e405fdadc 100644 --- a/crates/swc_ecma_codegen/benches/bench.rs +++ b/crates/swc_ecma_codegen/benches/bench.rs @@ -79,9 +79,9 @@ module.exports = { const LARGE_PARTIAL_JS: &str = include_str!("large-partial.js"); -fn bench_emitter(b: &mut Bencher, s: &str) { +fn bench_emitter(b: &mut Bencher, s: &'static str) { let _ = ::testing::run_test(true, |cm, handler| { - let fm = cm.new_source_file(FileName::Anon.into(), s.into()); + let fm = cm.new_source_file(FileName::Anon.into(), s); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); let module = parser diff --git a/crates/swc_ecma_codegen/benches/with_parse.rs b/crates/swc_ecma_codegen/benches/with_parse.rs index aa4917f08c40..bcd327c7cb27 100644 --- a/crates/swc_ecma_codegen/benches/with_parse.rs +++ b/crates/swc_ecma_codegen/benches/with_parse.rs @@ -79,10 +79,10 @@ module.exports = { const LARGE_PARTIAL_JS: &str = include_str!("large-partial.js"); -fn bench_emitter(b: &mut Bencher, s: &str) { +fn bench_emitter(b: &mut Bencher, s: &'static str) { let _ = ::testing::run_test(true, |cm, handler| { b.iter(|| { - let fm = cm.new_source_file(FileName::Anon.into(), s.into()); + let fm = cm.new_source_file(FileName::Anon.into(), s); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); let module = parser .parse_module() diff --git a/crates/swc_ecma_lexer/benches/lexer.rs b/crates/swc_ecma_lexer/benches/lexer.rs index d5e24f35a0f1..cfd5849ffc94 100644 --- a/crates/swc_ecma_lexer/benches/lexer.rs +++ b/crates/swc_ecma_lexer/benches/lexer.rs @@ -6,7 +6,7 @@ use swc_ecma_lexer::{lexer::Lexer, Syntax, TsSyntax}; fn bench_module(b: &mut Bencher, syntax: Syntax, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let lexer = Lexer::new(syntax, Default::default(), StringInput::from(&*fm), None); diff --git a/crates/swc_ecma_lexer/examples/lexer.rs b/crates/swc_ecma_lexer/examples/lexer.rs index 63bc1cd8aabc..8d723cfc515d 100644 --- a/crates/swc_ecma_lexer/examples/lexer.rs +++ b/crates/swc_ecma_lexer/examples/lexer.rs @@ -17,7 +17,7 @@ fn main() { let fm = cm.new_source_file( FileName::Custom("test.js".into()).into(), - "function foo() {}".into(), + "function foo() {}", ); let l = Lexer::new( diff --git a/crates/swc_ecma_lexer/src/lib.rs b/crates/swc_ecma_lexer/src/lib.rs index 556d074514dd..81f097b89b4b 100644 --- a/crates/swc_ecma_lexer/src/lib.rs +++ b/crates/swc_ecma_lexer/src/lib.rs @@ -43,7 +43,7 @@ where use swc_common::FileName; ::testing::run_test(false, |cm, handler| { - let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src.into()); + let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src.to_string()); f(handler, (&*fm).into()) }) diff --git a/crates/swc_ecma_minifier/benches/full.rs b/crates/swc_ecma_minifier/benches/full.rs index 8bfbc0a0294e..115ec53e04f6 100644 --- a/crates/swc_ecma_minifier/benches/full.rs +++ b/crates/swc_ecma_minifier/benches/full.rs @@ -148,7 +148,7 @@ fn expand_dirs(dir: &Path) -> Vec { fn run(src: &str) { testing::run_test2(false, |cm, handler| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let unresolved_mark = Mark::new(); let top_level_mark = Mark::new(); diff --git a/crates/swc_ecma_minifier/tests/exec.rs b/crates/swc_ecma_minifier/tests/exec.rs index e6e0e6293dd3..7139e70f9003 100644 --- a/crates/swc_ecma_minifier/tests/exec.rs +++ b/crates/swc_ecma_minifier/tests/exec.rs @@ -100,7 +100,7 @@ fn run( ) -> Option { let compress_config = config.map(|config| parse_compressor_config(cm.clone(), config).1); - let fm = cm.new_source_file(FileName::Anon.into(), input.into()); + let fm = cm.new_source_file(FileName::Anon.into(), input.to_string()); let comments = SingleThreadedComments::default(); eprintln!("---- {} -----\n{}", Color::Green.paint("Input"), fm.src); diff --git a/crates/swc_ecma_minifier/tests/format.rs b/crates/swc_ecma_minifier/tests/format.rs index 6010807a5fa4..3bb1a9132241 100644 --- a/crates/swc_ecma_minifier/tests/format.rs +++ b/crates/swc_ecma_minifier/tests/format.rs @@ -33,7 +33,7 @@ fn print(cm: Lrc, m: &Module, config: Config) -> String { fn assert_format(src: &str, expected: &str, opts: Config) { testing::run_test2(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let program = parse_file_as_module( &fm, diff --git a/crates/swc_ecma_minifier/tests/mangle.rs b/crates/swc_ecma_minifier/tests/mangle.rs index 241217edaa55..2fdd6b4b1370 100644 --- a/crates/swc_ecma_minifier/tests/mangle.rs +++ b/crates/swc_ecma_minifier/tests/mangle.rs @@ -185,7 +185,7 @@ fn fixture(input: PathBuf) { #[track_caller] fn assert_mangled(src: &str, expected: &str, opts: MangleOptions) { testing::run_test2(false, |cm, handler| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let p = parse_fm(&handler, fm)?; diff --git a/crates/swc_ecma_minifier/tests/size.rs b/crates/swc_ecma_minifier/tests/size.rs index 566299482b7e..116e9e3caa17 100644 --- a/crates/swc_ecma_minifier/tests/size.rs +++ b/crates/swc_ecma_minifier/tests/size.rs @@ -133,7 +133,7 @@ impl Parallel for Worker { fn run(src: &str) -> FileSize { testing::run_test2(false, |cm, handler| { let comments = SingleThreadedComments::default(); - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let unresolved_mark = Mark::new(); let top_level_mark = Mark::new(); diff --git a/crates/swc_ecma_parser/benches/compare.rs b/crates/swc_ecma_parser/benches/compare.rs index 3b6deb6bfbd4..c13bd6567697 100644 --- a/crates/swc_ecma_parser/benches/compare.rs +++ b/crates/swc_ecma_parser/benches/compare.rs @@ -13,7 +13,7 @@ where F: FnMut(Module) -> Module, { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); let module = parser.parse_module().map_err(|_| ()).unwrap(); diff --git a/crates/swc_ecma_parser/benches/parser.rs b/crates/swc_ecma_parser/benches/parser.rs index d6c8bbe17e48..f31f64615ad7 100644 --- a/crates/swc_ecma_parser/benches/parser.rs +++ b/crates/swc_ecma_parser/benches/parser.rs @@ -7,7 +7,7 @@ use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax, TsSyntax}; fn bench_module(b: &mut Bencher, syntax: Syntax, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { let comments = SingleThreadedComments::default(); - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let _ = black_box({ diff --git a/crates/swc_ecma_parser/examples/typescript.rs b/crates/swc_ecma_parser/examples/typescript.rs index a4d7b675ee10..1cf1e47d8a38 100644 --- a/crates/swc_ecma_parser/examples/typescript.rs +++ b/crates/swc_ecma_parser/examples/typescript.rs @@ -16,7 +16,7 @@ fn main() { let fm = cm.new_source_file( FileName::Custom("test.ts".into()).into(), - "interface Foo {}".into(), + "interface Foo {}", ); let lexer = Lexer::new( diff --git a/crates/swc_ecma_parser/src/lib.rs b/crates/swc_ecma_parser/src/lib.rs index a834c5913668..70162c8bf782 100644 --- a/crates/swc_ecma_parser/src/lib.rs +++ b/crates/swc_ecma_parser/src/lib.rs @@ -59,7 +59,7 @@ //! // .expect("failed to load test.js"); //! let fm = cm.new_source_file( //! FileName::Custom("test.js".into()).into(), -//! "function foo() {}".into(), +//! "function foo() {}", //! ); //! let lexer = Lexer::new( //! // We want to parse ecmascript @@ -152,7 +152,7 @@ where use swc_common::FileName; ::testing::run_test(false, |cm, handler| { - let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src.into()); + let fm = cm.new_source_file(FileName::Real("testing".into()).into(), src.to_string()); f(handler, (&*fm).into()) }) diff --git a/crates/swc_ecma_parser/tests/js.rs b/crates/swc_ecma_parser/tests/js.rs index b06a06745c6b..2afca0b95259 100644 --- a/crates/swc_ecma_parser/tests/js.rs +++ b/crates/swc_ecma_parser/tests/js.rs @@ -79,7 +79,7 @@ where { ::testing::run_test(treat_error_as_bug, |cm, handler| { if shift { - cm.new_source_file(FileName::Anon.into(), "".into()); + cm.new_source_file(FileName::Anon.into(), ""); } let comments = SingleThreadedComments::default(); diff --git a/crates/swc_ecma_parser/tests/typescript.rs b/crates/swc_ecma_parser/tests/typescript.rs index d67cee2c0c94..a555564f449f 100644 --- a/crates/swc_ecma_parser/tests/typescript.rs +++ b/crates/swc_ecma_parser/tests/typescript.rs @@ -239,7 +239,7 @@ where ::testing::run_test(treat_error_as_bug, |cm, handler| { if shift { - cm.new_source_file(FileName::Anon.into(), "".into()); + cm.new_source_file(FileName::Anon.into(), ""); } let comments = SingleThreadedComments::default(); diff --git a/crates/swc_ecma_preset_env/benches/polyfills.rs b/crates/swc_ecma_preset_env/benches/polyfills.rs index df2668f5bbec..5da545362117 100644 --- a/crates/swc_ecma_preset_env/benches/polyfills.rs +++ b/crates/swc_ecma_preset_env/benches/polyfills.rs @@ -8,7 +8,7 @@ use swc_ecma_transforms::helpers::{Helpers, HELPERS}; fn run(b: &mut Bencher, src: &str, config: Config) { let _ = ::testing::run_test(false, |cm, handler| { HELPERS.set(&Helpers::new(true), || { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); let module = parser diff --git a/crates/swc_ecma_react_compiler/src/fast_check.rs b/crates/swc_ecma_react_compiler/src/fast_check.rs index 38ff98e10a32..31b59d25a9cf 100644 --- a/crates/swc_ecma_react_compiler/src/fast_check.rs +++ b/crates/swc_ecma_react_compiler/src/fast_check.rs @@ -133,7 +133,8 @@ mod tests { fn assert_required(code: &str, required: bool) { run_test2(false, |cm, _| { - let fm = cm.new_source_file(FileName::Custom("test.tsx".into()).into(), code.into()); + let fm = + cm.new_source_file(FileName::Custom("test.tsx".into()).into(), code.to_string()); let program = parse_file_as_program( &fm, diff --git a/crates/swc_ecma_transforms_base/benches/base.rs b/crates/swc_ecma_transforms_base/benches/base.rs index b263f3224faf..8e7791e18e7d 100644 --- a/crates/swc_ecma_transforms_base/benches/base.rs +++ b/crates/swc_ecma_transforms_base/benches/base.rs @@ -15,7 +15,7 @@ macro_rules! tr { ($b:expr, $tr:expr) => { let _ = ::testing::run_test(false, |cm, handler| { HANDLER.set(&handler, || { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let mut parser = Parser::new( Syntax::Typescript(Default::default()), diff --git a/crates/swc_ecma_transforms_base/benches/parallel.rs b/crates/swc_ecma_transforms_base/benches/parallel.rs index c1feae49c58c..fbe48a30a7db 100644 --- a/crates/swc_ecma_transforms_base/benches/parallel.rs +++ b/crates/swc_ecma_transforms_base/benches/parallel.rs @@ -15,7 +15,7 @@ static SOURCE: &str = include_str!("../../swc_ecma_minifier/benches/full/typescr macro_rules! tr { ($b:expr, $tr:expr) => { let _ = ::testing::run_test(false, |cm, handler| { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let mut parser = Parser::new( Syntax::Typescript(Default::default()), diff --git a/crates/swc_ecma_transforms_base/src/helpers/mod.rs b/crates/swc_ecma_transforms_base/src/helpers/mod.rs index f347a71d4037..50dd15661e25 100644 --- a/crates/swc_ecma_transforms_base/src/helpers/mod.rs +++ b/crates/swc_ecma_transforms_base/src/helpers/mod.rs @@ -23,7 +23,7 @@ fn parse(code: &str) -> Vec { let fm = cm.new_source_file( FileName::Custom(stringify!($name).into()).into(), - code.into(), + code.to_string(), ); swc_ecma_parser::parse_file_as_script( &fm, diff --git a/crates/swc_ecma_transforms_base/src/tests.rs b/crates/swc_ecma_transforms_base/src/tests.rs index d3148487fb2e..3ebbaae2735f 100644 --- a/crates/swc_ecma_transforms_base/src/tests.rs +++ b/crates/swc_ecma_transforms_base/src/tests.rs @@ -53,7 +53,7 @@ impl Tester<'_> { { let fm = self .cm - .new_source_file(FileName::Real(file_name.into()).into(), src.into()); + .new_source_file(FileName::Real(file_name.into()).into(), src.to_string()); let mut p = Parser::new(syntax, StringInput::from(&*fm), Some(&self.comments)); let res = op(&mut p).map_err(|e| e.into_diagnostic(self.handler).emit()); @@ -93,7 +93,7 @@ impl Tester<'_> { ) -> Result { let fm = self .cm - .new_source_file(FileName::Real(name.into()).into(), src.into()); + .new_source_file(FileName::Real(name.into()).into(), src.to_string()); let module = { let mut p = Parser::new(syntax, StringInput::from(&*fm), Some(&self.comments)); diff --git a/crates/swc_ecma_transforms_module/tests/path_node.rs b/crates/swc_ecma_transforms_module/tests/path_node.rs index 28582ddb95bb..d4dc3eea5dd6 100644 --- a/crates/swc_ecma_transforms_module/tests/path_node.rs +++ b/crates/swc_ecma_transforms_module/tests/path_node.rs @@ -22,7 +22,7 @@ fn node_modules() { let provider = TestProvider::default(); run_test2(false, |cm, _| { - let fm = cm.new_source_file(FileName::Real("foo".into()).into(), "".into()); + let fm = cm.new_source_file(FileName::Real("foo".into()).into(), ""); let resolved = provider .resolve_import(&fm.name, "core-js") diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 11e8e9cf7846..88186ce91a2a 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -22,6 +22,7 @@ concurrent = [ debug = [] [dependencies] +bytes-str = { workspace = true } dashmap = { workspace = true } indexmap = { workspace = true } once_cell = { workspace = true } diff --git a/crates/swc_ecma_transforms_optimization/src/const_modules.rs b/crates/swc_ecma_transforms_optimization/src/const_modules.rs index 77117d893b67..6cdc454856a5 100644 --- a/crates/swc_ecma_transforms_optimization/src/const_modules.rs +++ b/crates/swc_ecma_transforms_optimization/src/const_modules.rs @@ -3,6 +3,7 @@ use std::{ sync::Arc, }; +use bytes_str::BytesStr; use dashmap::DashMap; use once_cell::sync::Lazy; use rustc_hash::{FxBuildHasher, FxHashMap}; @@ -20,7 +21,7 @@ use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith pub fn const_modules( cm: Lrc, - globals: FxHashMap>, + globals: FxHashMap>, ) -> impl Pass { visit_mut_pass(ConstModules { globals: globals @@ -42,14 +43,14 @@ pub fn const_modules( }) } -fn parse_option(cm: &SourceMap, name: &str, src: String) -> Arc { - static CACHE: Lazy, FxBuildHasher>> = Lazy::new(DashMap::default); +fn parse_option(cm: &SourceMap, name: &str, src: BytesStr) -> Arc { + static CACHE: Lazy, FxBuildHasher>> = Lazy::new(DashMap::default); let fm = cm.new_source_file( FileName::Internal(format!("")).into(), src, ); - if let Some(expr) = CACHE.get(&**fm.src) { + if let Some(expr) = CACHE.get(&fm.src) { return expr.clone(); } @@ -75,7 +76,7 @@ fn parse_option(cm: &SourceMap, name: &str, src: String) -> Arc { let expr = Arc::new(*expr); - CACHE.insert((*fm.src).clone(), expr.clone()); + CACHE.insert(fm.src.clone(), expr.clone()); expr } diff --git a/crates/swc_ecma_transforms_optimization/tests/const_modules.rs b/crates/swc_ecma_transforms_optimization/tests/const_modules.rs index 6a7b45004ace..f27819cfcbd4 100644 --- a/crates/swc_ecma_transforms_optimization/tests/const_modules.rs +++ b/crates/swc_ecma_transforms_optimization/tests/const_modules.rs @@ -10,7 +10,7 @@ fn tr(t: &mut Tester<'_>, sources: &[(&str, &[(&str, &str)])]) -> impl Pass { for (src, values) in sources { let values = values .iter() - .map(|(k, v)| ((*k).into(), v.to_string())) + .map(|(k, v)| ((*k).into(), v.to_string().into())) .collect(); m.insert((*src).into(), values); diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index ff7e7fc24b15..3df89dd23afc 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -19,6 +19,7 @@ serde-impl = ["serde"] [dependencies] base64 = { workspace = true } +bytes-str = { workspace = true } dashmap = { workspace = true } indexmap = { workspace = true } once_cell = { workspace = true } diff --git a/crates/swc_ecma_transforms_react/src/jsx/mod.rs b/crates/swc_ecma_transforms_react/src/jsx/mod.rs index 397b0be039b9..73a0a15cc882 100644 --- a/crates/swc_ecma_transforms_react/src/jsx/mod.rs +++ b/crates/swc_ecma_transforms_react/src/jsx/mod.rs @@ -6,6 +6,7 @@ use std::{ sync::RwLock, }; +use bytes_str::BytesStr; use once_cell::sync::Lazy; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; @@ -65,9 +66,9 @@ pub struct Options { pub import_source: Option, #[serde(default)] - pub pragma: Option>, + pub pragma: Option, #[serde(default)] - pub pragma_frag: Option>, + pub pragma_frag: Option, #[serde(default)] pub throw_if_namespace: Option, @@ -102,7 +103,7 @@ pub struct Options { #[cfg(feature = "concurrent")] macro_rules! static_str { ($s:expr) => {{ - static VAL: Lazy> = Lazy::new(|| Lrc::new($s.into())); + static VAL: Lazy = Lazy::new(|| $s.into()); VAL.clone() }}; } @@ -110,7 +111,7 @@ macro_rules! static_str { #[cfg(not(feature = "concurrent"))] macro_rules! static_str { ($s:expr) => { - Lrc::new($s.into()) + $s.into() }; } @@ -118,11 +119,11 @@ pub fn default_import_source() -> Atom { atom!("react") } -pub fn default_pragma() -> Lrc { +pub fn default_pragma() -> BytesStr { static_str!("React.createElement") } -pub fn default_pragma_frag() -> Lrc { +pub fn default_pragma_frag() -> BytesStr { static_str!("React.Fragment") } @@ -134,10 +135,10 @@ fn default_throw_if_namespace() -> bool { pub fn parse_expr_for_jsx( cm: &SourceMap, name: &str, - src: Lrc, + src: BytesStr, top_level_mark: Mark, ) -> Box { - let fm = cm.new_source_file_from(cache_filename(name), src); + let fm = cm.new_source_file(cache_filename(name), src); parse_file_as_expr( &fm, @@ -420,13 +421,15 @@ fn cache_filename(name: &str) -> Lrc { #[cfg(not(feature = "concurrent"))] fn cache_filename(name: &str) -> Lrc { - Lrc::new(FileName::Internal(format!("jsx-config-{}.js", name))) + Lrc::new(FileName::Internal(format!("jsx-config-{name}.js"))) } #[cfg(feature = "concurrent")] -fn cache_source(src: &str) -> Lrc { - static CACHE: Lazy>>> = - Lazy::new(|| RwLock::new(FxHashMap::default())); +fn cache_source(src: &str) -> BytesStr { + use rustc_hash::FxHashSet; + + static CACHE: Lazy>> = + Lazy::new(|| RwLock::new(FxHashSet::default())); { let cache = CACHE.write().unwrap(); @@ -436,18 +439,18 @@ fn cache_source(src: &str) -> Lrc { } } - let cached = Lrc::new(src.to_string()); + let cached: BytesStr = src.to_string().into(); { let mut cache = CACHE.write().unwrap(); - cache.insert(src.to_string(), cached.clone()); + cache.insert(cached.clone()); } cached } #[cfg(not(feature = "concurrent"))] -fn cache_source(src: &str) -> Lrc { +fn cache_source(src: &str) -> BytesStr { // We cannot cache because Rc does not implement Send. - Lrc::new(src.to_string()) + src.to_string().into() } fn is_valid_for_pragma(s: &str) -> bool { diff --git a/crates/swc_ecma_transforms_react/src/jsx/tests.rs b/crates/swc_ecma_transforms_react/src/jsx/tests.rs index 0adaffe43157..ee4a2239db5c 100644 --- a/crates/swc_ecma_transforms_react/src/jsx/tests.rs +++ b/crates/swc_ecma_transforms_react/src/jsx/tests.rs @@ -337,7 +337,7 @@ test!( |t| tr( t, Options { - pragma: Some(Lrc::new("dom".into())), + pragma: Some("dom".into()), ..Default::default() }, Mark::fresh(Mark::root()) @@ -808,7 +808,7 @@ test!( |t| tr( t, Options { - pragma: Some(Lrc::new("h".into())), + pragma: Some("h".into()), throw_if_namespace: false.into(), ..Default::default() }, @@ -1110,7 +1110,7 @@ fn test_script(src: &str, output: &Path, options: Options) { Tester::run(|tester| { let fm = tester .cm - .new_source_file(FileName::Real("input.js".into()).into(), src.into()); + .new_source_file(FileName::Real("input.js".into()).into(), src.to_string()); let syntax = Syntax::Es(EsSyntax { jsx: true, diff --git a/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs b/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs index 672a4058de64..99c3c4f36d8b 100644 --- a/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs +++ b/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs @@ -15,7 +15,7 @@ fn parse( ..Default::default() }); let source_map = Lrc::new(SourceMap::default()); - let source_file = source_map.new_source_file(FileName::Anon.into(), src.into()); + let source_file = source_map.new_source_file(FileName::Anon.into(), src.to_string()); let comments = Lrc::new(SingleThreadedComments::default()); let program = { diff --git a/crates/swc_ecma_transforms_testing/src/lib.rs b/crates/swc_ecma_transforms_testing/src/lib.rs index 7d7f5bf9ae21..4f4a5ce5cfa1 100644 --- a/crates/swc_ecma_transforms_testing/src/lib.rs +++ b/crates/swc_ecma_transforms_testing/src/lib.rs @@ -129,7 +129,7 @@ impl Tester<'_> { { let fm = self .cm - .new_source_file(FileName::Real(file_name.into()).into(), src.into()); + .new_source_file(FileName::Real(file_name.into()).into(), src.to_string()); let mut p = Parser::new(syntax, StringInput::from(&*fm), Some(&self.comments)); let res = op(&mut p).map_err(|e| e.into_diagnostic(self.handler).emit()); diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 0563b41f7b4b..5fc74c9ee8d8 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -16,6 +16,7 @@ bench = false concurrent = ["swc_common/concurrent"] [dependencies] +bytes-str = { workspace = true } once_cell = { workspace = true } rustc-hash = { workspace = true } ryu-js = { workspace = true } diff --git a/crates/swc_ecma_transforms_typescript/benches/compat.rs b/crates/swc_ecma_transforms_typescript/benches/compat.rs index aa296d72fabb..576aebc402a0 100644 --- a/crates/swc_ecma_transforms_typescript/benches/compat.rs +++ b/crates/swc_ecma_transforms_typescript/benches/compat.rs @@ -9,7 +9,7 @@ use swc_ecma_visit::{fold_pass, Fold}; static SOURCE: &str = include_str!("assets/AjaxObservable.ts"); fn module(cm: Lrc) -> Program { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let lexer = Lexer::new( Syntax::Typescript(Default::default()), Default::default(), diff --git a/crates/swc_ecma_transforms_typescript/src/config.rs b/crates/swc_ecma_transforms_typescript/src/config.rs index 6eee8d077047..956d2e28a340 100644 --- a/crates/swc_ecma_transforms_typescript/src/config.rs +++ b/crates/swc_ecma_transforms_typescript/src/config.rs @@ -1,5 +1,5 @@ +use bytes_str::BytesStr; use serde::{Deserialize, Serialize}; -use swc_common::sync::Lrc; #[derive(Debug, Default, Serialize, Deserialize, Clone, Copy)] #[serde(rename_all = "camelCase")] @@ -40,11 +40,11 @@ pub struct Config { pub struct TsxConfig { /// Note: this pass handle jsx directives in comments #[serde(default)] - pub pragma: Option>, + pub pragma: Option, /// Note: this pass handle jsx directives in comments #[serde(default)] - pub pragma_frag: Option>, + pub pragma_frag: Option, } #[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/swc_ecma_transforms_typescript/src/typescript.rs b/crates/swc_ecma_transforms_typescript/src/typescript.rs index cb25df02bb4c..4fd5d8d1a3f5 100644 --- a/crates/swc_ecma_transforms_typescript/src/typescript.rs +++ b/crates/swc_ecma_transforms_typescript/src/typescript.rs @@ -9,19 +9,9 @@ use swc_ecma_visit::{visit_mut_pass, VisitMut, VisitMutWith}; pub use crate::config::*; use crate::{strip_import_export::StripImportExport, strip_type::StripType, transform::transform}; -#[cfg(feature = "concurrent")] -macro_rules! static_str { - ($s:expr) => {{ - static VAL: once_cell::sync::Lazy> = - once_cell::sync::Lazy::new(|| Lrc::new($s.into())); - VAL.clone() - }}; -} - -#[cfg(not(feature = "concurrent"))] macro_rules! static_str { ($s:expr) => { - Lrc::new($s.into()) + $s.into() }; } diff --git a/crates/swc_error_reporters/examples/swc_try.rs b/crates/swc_error_reporters/examples/swc_try.rs index 4d3a89d6866d..dba3601c5aaf 100644 --- a/crates/swc_error_reporters/examples/swc_try.rs +++ b/crates/swc_error_reporters/examples/swc_try.rs @@ -22,11 +22,11 @@ fn main() { let fm1 = cm.new_source_file( Lrc::new(FileName::Custom("foo.js".into())), - "13579\n12345\n13579".into(), + "13579\n12345\n13579", ); let fm2 = cm.new_source_file( Lrc::new(FileName::Custom("bar.js".into())), - "02468\n12345\n02468".into(), + "02468\n12345\n02468", ); // This is a simple example. diff --git a/crates/swc_error_reporters/tests/fixture.rs b/crates/swc_error_reporters/tests/fixture.rs index 2e69deabf3c2..c6961d377a8a 100644 --- a/crates/swc_error_reporters/tests/fixture.rs +++ b/crates/swc_error_reporters/tests/fixture.rs @@ -35,7 +35,7 @@ fn span(start: usize, end: usize) -> Span { #[test] fn test_1() { output("1.ans", |cm, h| { - let _fm = cm.new_source_file(FileName::Anon.into(), "123456789".into()); + let _fm = cm.new_source_file(FileName::Anon.into(), "123456789"); h.struct_span_err(span(1, 3), "test") .span_label(span(1, 4), "label") @@ -46,7 +46,7 @@ fn test_1() { #[test] fn test_2() { output("2.ans", |cm, h| { - let _fm = cm.new_source_file(FileName::Anon.into(), "123456789".into()); + let _fm = cm.new_source_file(FileName::Anon.into(), "123456789"); let mut d = h.struct_span_err(span(1, 3), "test"); @@ -65,7 +65,7 @@ fn test_2() { #[test] fn test_long_text_wrap() { output("long_text_wrap.ans", |cm, h| { - let _fm = cm.new_source_file(FileName::Anon.into(), "123456789".into()); + let _fm = cm.new_source_file(FileName::Anon.into(), "123456789"); let mut d = h.struct_span_err(span(1, 3), r##"You are attempting to export "metadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://nextjs.org/docs/app/api-reference/directives/use-client"##); diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 6716bf402115..70244f6ba0be 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -12,11 +12,12 @@ version = "19.0.0" [dependencies] anyhow = { workspace = true } +bytes-str = { workspace = true } serde = { workspace = true, features = ["derive"] } wasm-bindgen = { workspace = true, optional = true } -swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } +swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_common = { version = "11.1.3", path = "../swc_common", features = [ "sourcemap", ] } diff --git a/crates/swc_fast_ts_strip/src/lib.rs b/crates/swc_fast_ts_strip/src/lib.rs index 0a8a45229527..27f46119a1df 100644 --- a/crates/swc_fast_ts_strip/src/lib.rs +++ b/crates/swc_fast_ts_strip/src/lib.rs @@ -1,6 +1,7 @@ use std::{cell::RefCell, fmt::Display, rc::Rc}; use anyhow::Context; +use bytes_str::BytesStr; use serde::{Deserialize, Serialize}; use swc_common::{ comments::SingleThreadedComments, @@ -519,7 +520,7 @@ impl Visit for ErrorOnTsModule<'_> { } struct TsStrip { - src: Lrc, + src: BytesStr, /// Replaced with whitespace replacements: Vec<(BytePos, BytePos)>, @@ -531,7 +532,7 @@ struct TsStrip { } impl TsStrip { - fn new(src: Lrc, tokens: std::vec::Vec) -> Self { + fn new(src: BytesStr, tokens: std::vec::Vec) -> Self { TsStrip { src, replacements: Default::default(), diff --git a/crates/swc_html_minifier/benches/full.rs b/crates/swc_html_minifier/benches/full.rs index 4b9d306d1e6d..d725e2e66eb3 100644 --- a/crates/swc_html_minifier/benches/full.rs +++ b/crates/swc_html_minifier/benches/full.rs @@ -74,7 +74,7 @@ criterion_main!(files_document, files_document_fragment); fn run_document(src: &str) { testing::run_test2(false, |cm, handler| { HANDLER.set(&handler, || { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let mut errors = Vec::new(); let mut document: Document = @@ -111,7 +111,7 @@ fn run_document(src: &str) { fn run_document_fragment(src: &str) { testing::run_test2(false, |cm, handler| { HANDLER.set(&handler, || { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src.to_string()); let mut errors = Vec::new(); let context_element_namespace = Namespace::HTML; diff --git a/crates/swc_html_parser/benches/compare.rs b/crates/swc_html_parser/benches/compare.rs index 77b83a210b3b..63051201ffb0 100644 --- a/crates/swc_html_parser/benches/compare.rs +++ b/crates/swc_html_parser/benches/compare.rs @@ -13,7 +13,7 @@ where F: FnMut(Document) -> Document, { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let lexer = Lexer::new(StringInput::from(&*fm)); let mut parser = Parser::new(lexer, Default::default()); @@ -35,7 +35,7 @@ where F: FnMut(DocumentFragment) -> DocumentFragment, { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), SOURCE.into()); + let fm = cm.new_source_file(FileName::Anon.into(), SOURCE); let lexer = Lexer::new(StringInput::from(&*fm)); let mut parser = Parser::new(lexer, Default::default()); diff --git a/crates/swc_html_parser/benches/lexer.rs b/crates/swc_html_parser/benches/lexer.rs index 6704d2526d7e..66f9a9bc1ec1 100644 --- a/crates/swc_html_parser/benches/lexer.rs +++ b/crates/swc_html_parser/benches/lexer.rs @@ -6,7 +6,7 @@ use swc_html_parser::lexer::Lexer; fn bench_document(b: &mut Bencher, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let lexer = Lexer::new(StringInput::from(&*fm)); diff --git a/crates/swc_html_parser/benches/parser.rs b/crates/swc_html_parser/benches/parser.rs index 5dcc28c4ad28..3e8e48638e94 100644 --- a/crates/swc_html_parser/benches/parser.rs +++ b/crates/swc_html_parser/benches/parser.rs @@ -7,7 +7,7 @@ use swc_html_parser::{lexer::Lexer, parser::Parser}; fn bench_document(b: &mut Bencher, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let _ = black_box({ @@ -24,7 +24,7 @@ fn bench_document(b: &mut Bencher, src: &'static str) { fn bench_document_fragment(b: &mut Bencher, src: &'static str) { let _ = ::testing::run_test(false, |cm, _| { - let fm = cm.new_source_file(FileName::Anon.into(), src.into()); + let fm = cm.new_source_file(FileName::Anon.into(), src); b.iter(|| { let _ = black_box({ diff --git a/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock index 488a0e342530..36ccae83d3d2 100644 --- a/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ansi_term" @@ -40,9 +40,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -68,17 +74,18 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "simd-abstraction", + "outref", + "vsimd", ] [[package]] @@ -90,9 +97,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -117,18 +124,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] [[package]] name = "bytecheck" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -138,9 +145,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", @@ -149,24 +156,35 @@ dependencies = [ [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +dependencies = [ + "bytes", + "rkyv", + "serde", +] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -179,10 +197,24 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.12", ] [[package]] @@ -196,9 +228,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.37" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -224,9 +256,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -243,9 +275,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -253,9 +285,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -267,9 +299,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -278,9 +310,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debugid" @@ -358,31 +390,31 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -424,11 +456,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" @@ -442,9 +486,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -454,9 +498,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -466,33 +510,34 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.3.1" +version = "1.0.0" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -501,31 +546,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -533,67 +558,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -613,9 +625,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -629,12 +641,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.4", ] [[package]] @@ -651,9 +663,19 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "lazy_static" @@ -663,27 +685,27 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -691,9 +713,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -712,23 +734,22 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -737,18 +758,18 @@ dependencies = [ [[package]] name = "munge" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +checksum = "9e22e7961c873e8b305b176d2a4e1d41ce7ba31bc1c52d2a107a89568ec74c55" dependencies = [ "munge_macro", ] [[package]] name = "munge_macro" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b" dependencies = [ "proc-macro2", "quote", @@ -802,9 +823,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -812,15 +833,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "outref" -version = "0.1.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "overload" @@ -830,15 +851,34 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" + +[[package]] +name = "par-core" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" +dependencies = [ + "once_cell", +] + +[[package]] +name = "par-iter" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" +dependencies = [ + "either", + "par-core", +] [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -846,9 +886,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -865,9 +905,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -875,9 +915,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -885,9 +925,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -898,18 +938,27 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "pretty_assertions" @@ -923,18 +972,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -961,13 +1010,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -1000,9 +1055,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags", ] @@ -1015,7 +1070,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1030,9 +1085,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1068,13 +1123,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395027076c569819ea6035ee62e664f5e03d74e281744f55261dd1afd939212b" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ "bytecheck", "bytes", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "indexmap", "munge", "ptr_meta", @@ -1087,66 +1142,51 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustix" -version = "0.38.40" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" +checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" [[package]] name = "scoped-tls" @@ -1162,42 +1202,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1206,9 +1231,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1218,9 +1243,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -1242,15 +1267,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "simd-abstraction" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -1263,11 +1279,17 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smartstring" @@ -1280,25 +1302,18 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "sourcemap" -version = "9.0.1" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86721155737d89818020dc35713595c6e7b21016073c101e6590c47ca58c2d16" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash 1.1.0", - "rustc_version", + "rustc-hash", "serde", "serde_json", "unicode-id-start", @@ -1313,15 +1328,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1348,37 +1363,38 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc_allocator" -version = "3.0.1" +version = "4.0.0" dependencies = [ "allocator-api2", "bumpalo", "hashbrown 0.14.5", "ptr_meta", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "swc_atoms" -version = "4.0.0" +version = "5.0.0" dependencies = [ "bytecheck", "hstr", "once_cell", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", ] [[package]] name = "swc_common" -version = "7.0.0" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck", + "bytes-str", "cfg-if", "either", "from_variant", @@ -1388,9 +1404,9 @@ dependencies = [ "parking_lot", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", - "siphasher", + "siphasher 0.3.11", "sourcemap", "swc_allocator", "swc_atoms", @@ -1398,13 +1414,13 @@ dependencies = [ "swc_visit", "termcolor", "tracing", - "unicode-width", + "unicode-width 0.1.14", "url", ] [[package]] name = "swc_core" -version = "14.1.0" +version = "26.4.5" dependencies = [ "once_cell", "swc_allocator", @@ -1423,7 +1439,7 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "7.0.0" +version = "11.0.0" dependencies = [ "bytecheck", "is-macro", @@ -1436,7 +1452,7 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "7.0.0" +version = "11.0.0" dependencies = [ "serde", "swc_atoms", @@ -1447,12 +1463,14 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "7.0.0" +version = "11.0.0" dependencies = [ "bitflags", "is-macro", "num-bigint", + "once_cell", "phf", + "rustc-hash", "scoped-tls", "string_enum", "swc_atoms", @@ -1463,7 +1481,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "7.0.0" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -1471,7 +1489,8 @@ dependencies = [ "num-bigint", "once_cell", "regex", - "rustc-hash 2.1.1", + "rustc-hash", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -1484,7 +1503,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "1.0.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -1492,16 +1511,41 @@ dependencies = [ "syn", ] +[[package]] +name = "swc_ecma_lexer" +version = "14.0.5" +dependencies = [ + "arrayvec", + "bitflags", + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "rustc-hash", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + [[package]] name = "swc_ecma_parser" -version = "9.0.0" +version = "14.0.2" dependencies = [ + "arrayvec", + "bitflags", "either", "new_debug_unreachable", "num-bigint", "num-traits", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "smartstring", @@ -1509,13 +1553,14 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_lexer", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "anyhow", "hex", @@ -1526,14 +1571,15 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "10.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags", "indexmap", "once_cell", + "par-core", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "swc_atoms", @@ -1542,13 +1588,12 @@ dependencies = [ "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", - "swc_parallel", "tracing", ] [[package]] name = "swc_ecma_transforms_testing" -version = "10.0.0" +version = "18.0.0" dependencies = [ "ansi_term", "anyhow", @@ -1573,25 +1618,26 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "10.0.0" +version = "15.0.2" dependencies = [ "indexmap", "num_cpus", "once_cell", - "rustc-hash 2.1.1", + "par-core", + "par-iter", + "rustc-hash", "ryu-js", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_visit", - "swc_parallel", "tracing", "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "7.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -1613,12 +1659,15 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "8.0.0" +version = "13.0.0" dependencies = [ "anyhow", "miette", "once_cell", "parking_lot", + "serde", + "serde_derive", + "serde_json", "swc_common", ] @@ -1639,13 +1688,6 @@ dependencies = [ "swc_core", ] -[[package]] -name = "swc_parallel" -version = "1.2.0" -dependencies = [ - "once_cell", -] - [[package]] name = "swc_plugin" version = "1.0.0" @@ -1655,7 +1697,7 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "1.0.0" +version = "1.1.0" dependencies = [ "proc-macro2", "quote", @@ -1664,13 +1706,13 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "7.0.0" +version = "11.0.0" dependencies = [ "better_scoped_tls", "bytecheck", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "swc_common", "swc_ecma_ast", "swc_trace_macro", @@ -1679,7 +1721,7 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "2.0.0" +version = "2.0.1" dependencies = [ "proc-macro2", "quote", @@ -1696,9 +1738,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -1707,9 +1749,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1724,15 +1766,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1746,15 +1788,15 @@ dependencies = [ [[package]] name = "testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "serde_json", "swc_common", @@ -1780,13 +1822,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ - "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -1795,7 +1836,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1809,6 +1859,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -1821,9 +1882,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1831,9 +1892,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1846,9 +1907,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1857,9 +1918,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -1868,9 +1929,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1889,9 +1950,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1923,9 +1984,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-id" @@ -1941,9 +2002,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -1957,6 +2018,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "url" version = "2.5.4" @@ -1968,12 +2035,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -1982,24 +2043,28 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.11.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vergen" -version = "9.0.1" +version = "9.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" +checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" dependencies = [ "anyhow", - "cargo_metadata", + "cargo_metadata 0.19.2", "derive_builder", "regex", "rustversion", @@ -2008,9 +2073,9 @@ dependencies = [ [[package]] name = "vergen-lib" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" dependencies = [ "anyhow", "derive_builder", @@ -2023,6 +2088,79 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2045,7 +2183,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2054,15 +2192,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2137,16 +2266,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -2165,9 +2297,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -2177,9 +2309,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -2189,18 +2321,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -2209,18 +2341,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -2228,11 +2360,22 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -2241,9 +2384,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/swc_plugin_runner/tests/css_rkyv.rs b/crates/swc_plugin_runner/tests/css_rkyv.rs index d12c21adbdee..0bb689f1a2f5 100644 --- a/crates/swc_plugin_runner/tests/css_rkyv.rs +++ b/crates/swc_plugin_runner/tests/css_rkyv.rs @@ -132,7 +132,7 @@ fn invoke(input: PathBuf) { // Run multiple plugins. testing::run_test(false, |cm, _handler| { - let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)".into()); + let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)"); let parsed: Stylesheet = swc_css_parser::parse_file(&fm, None, Default::default(), &mut Vec::new()).unwrap(); diff --git a/crates/swc_plugin_runner/tests/ecma_integration.rs b/crates/swc_plugin_runner/tests/ecma_integration.rs index 511e1f581721..402415659184 100644 --- a/crates/swc_plugin_runner/tests/ecma_integration.rs +++ b/crates/swc_plugin_runner/tests/ecma_integration.rs @@ -108,7 +108,7 @@ fn internal() { testing::run_test(false, |cm, _handler| { eprint!("First run start"); - let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)".into()); + let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)"); let program = parse_file_as_program( &fm, @@ -181,7 +181,7 @@ fn internal() { // run single plugin with handler testing::run_test2(false, |cm, handler| { eprintln!("Second run start"); - let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)".into()); + let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)"); let program = parse_file_as_program( &fm, diff --git a/crates/swc_plugin_runner/tests/ecma_rkyv.rs b/crates/swc_plugin_runner/tests/ecma_rkyv.rs index 54271cced8de..f51444910639 100644 --- a/crates/swc_plugin_runner/tests/ecma_rkyv.rs +++ b/crates/swc_plugin_runner/tests/ecma_rkyv.rs @@ -80,7 +80,7 @@ fn internal(input: PathBuf) { // run single plugin tokio::runtime::Runtime::new().unwrap().block_on(async { testing::run_test(false, |cm, _handler| { - let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)".into()); + let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)"); let parsed = parse_file_as_program( &fm, @@ -141,7 +141,7 @@ fn internal(input: PathBuf) { // Run multiple plugins. testing::run_test(false, |cm, _handler| { - let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)".into()); + let fm = cm.new_source_file(FileName::Anon.into(), "console.log(foo)"); let parsed = parse_file_as_program( &fm, diff --git a/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock index 08f806568f60..5c8ffc548cf6 100644 --- a/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ansi_term" @@ -40,9 +40,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -68,17 +74,18 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "simd-abstraction", + "outref", + "vsimd", ] [[package]] @@ -90,9 +97,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -117,18 +124,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] [[package]] name = "bytecheck" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -138,9 +145,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", @@ -149,24 +156,35 @@ dependencies = [ [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +dependencies = [ + "bytes", + "rkyv", + "serde", +] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -179,10 +197,24 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -196,9 +228,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.37" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -224,9 +256,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -243,9 +275,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -253,9 +285,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -267,9 +299,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -278,9 +310,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debugid" @@ -358,31 +390,31 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -424,11 +456,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" @@ -442,9 +486,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -454,9 +498,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -466,33 +510,34 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.3.1" +version = "1.0.0" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -501,31 +546,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -533,67 +558,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -613,9 +625,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -629,12 +641,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.4", ] [[package]] @@ -651,9 +663,19 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "lazy_static" @@ -663,27 +685,27 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -691,9 +713,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -712,23 +734,22 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -737,18 +758,18 @@ dependencies = [ [[package]] name = "munge" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +checksum = "9e22e7961c873e8b305b176d2a4e1d41ce7ba31bc1c52d2a107a89568ec74c55" dependencies = [ "munge_macro", ] [[package]] name = "munge_macro" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b" dependencies = [ "proc-macro2", "quote", @@ -802,9 +823,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -812,15 +833,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "outref" -version = "0.1.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "overload" @@ -830,15 +851,34 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" + +[[package]] +name = "par-core" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" +dependencies = [ + "once_cell", +] + +[[package]] +name = "par-iter" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" +dependencies = [ + "either", + "par-core", +] [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -846,9 +886,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -865,9 +905,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -875,9 +915,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -885,9 +925,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -898,18 +938,27 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "pretty_assertions" @@ -923,18 +972,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -961,13 +1010,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -1000,9 +1055,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags", ] @@ -1015,7 +1070,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1030,9 +1085,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1068,13 +1123,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395027076c569819ea6035ee62e664f5e03d74e281744f55261dd1afd939212b" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ "bytecheck", "bytes", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "indexmap", "munge", "ptr_meta", @@ -1087,66 +1142,51 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustix" -version = "0.38.40" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" +checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" [[package]] name = "scoped-tls" @@ -1162,42 +1202,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1206,9 +1231,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1218,9 +1243,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -1242,15 +1267,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "simd-abstraction" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -1263,11 +1279,17 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smartstring" @@ -1280,25 +1302,18 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "sourcemap" -version = "9.0.1" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86721155737d89818020dc35713595c6e7b21016073c101e6590c47ca58c2d16" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash 1.1.0", - "rustc_version", + "rustc-hash", "serde", "serde_json", "unicode-id-start", @@ -1313,15 +1328,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1348,37 +1363,38 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc_allocator" -version = "3.0.1" +version = "4.0.0" dependencies = [ "allocator-api2", "bumpalo", "hashbrown 0.14.5", "ptr_meta", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "swc_atoms" -version = "4.0.0" +version = "5.0.0" dependencies = [ "bytecheck", "hstr", "once_cell", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", ] [[package]] name = "swc_common" -version = "7.0.0" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck", + "bytes-str", "cfg-if", "either", "from_variant", @@ -1388,9 +1404,9 @@ dependencies = [ "parking_lot", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", - "siphasher", + "siphasher 0.3.11", "sourcemap", "swc_allocator", "swc_atoms", @@ -1398,13 +1414,13 @@ dependencies = [ "swc_visit", "termcolor", "tracing", - "unicode-width", + "unicode-width 0.1.14", "url", ] [[package]] name = "swc_core" -version = "14.1.0" +version = "26.4.5" dependencies = [ "once_cell", "swc_allocator", @@ -1418,20 +1434,23 @@ dependencies = [ "swc_plugin", "swc_plugin_macro", "swc_plugin_proxy", + "swc_transform_common", "vergen", ] [[package]] name = "swc_ecma_ast" -version = "7.0.0" +version = "11.0.0" dependencies = [ "bitflags", "bytecheck", "is-macro", "num-bigint", + "once_cell", "phf", "rancor", "rkyv", + "rustc-hash", "scoped-tls", "string_enum", "swc_atoms", @@ -1442,7 +1461,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "7.0.0" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -1450,7 +1469,8 @@ dependencies = [ "num-bigint", "once_cell", "regex", - "rustc-hash 2.1.1", + "rustc-hash", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -1463,7 +1483,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "1.0.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -1471,16 +1491,41 @@ dependencies = [ "syn", ] +[[package]] +name = "swc_ecma_lexer" +version = "14.0.5" +dependencies = [ + "arrayvec", + "bitflags", + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "rustc-hash", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + [[package]] name = "swc_ecma_parser" -version = "9.0.0" +version = "14.0.2" dependencies = [ + "arrayvec", + "bitflags", "either", "new_debug_unreachable", "num-bigint", "num-traits", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "smartstring", @@ -1488,18 +1533,19 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_lexer", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_quote_macros" -version = "9.0.0" +version = "14.0.0" dependencies = [ "anyhow", "proc-macro2", "quote", - "rustc-hash 2.1.1", + "rustc-hash", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -1510,7 +1556,7 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "anyhow", "hex", @@ -1521,14 +1567,15 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "10.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags", "indexmap", "once_cell", + "par-core", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "swc_atoms", @@ -1537,13 +1584,12 @@ dependencies = [ "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", - "swc_parallel", "tracing", ] [[package]] name = "swc_ecma_transforms_testing" -version = "10.0.0" +version = "18.0.0" dependencies = [ "ansi_term", "anyhow", @@ -1568,25 +1614,26 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "10.0.0" +version = "15.0.2" dependencies = [ "indexmap", "num_cpus", "once_cell", - "rustc-hash 2.1.1", + "par-core", + "par-iter", + "rustc-hash", "ryu-js", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_visit", - "swc_parallel", "tracing", "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "7.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -1608,12 +1655,15 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "8.0.0" +version = "13.0.0" dependencies = [ "anyhow", "miette", "once_cell", "parking_lot", + "serde", + "serde_derive", + "serde_json", "swc_common", ] @@ -1634,13 +1684,6 @@ dependencies = [ "syn", ] -[[package]] -name = "swc_parallel" -version = "1.2.0" -dependencies = [ - "once_cell", -] - [[package]] name = "swc_plugin" version = "1.0.0" @@ -1650,7 +1693,7 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "1.0.0" +version = "1.1.0" dependencies = [ "proc-macro2", "quote", @@ -1659,13 +1702,13 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "7.0.0" +version = "11.0.0" dependencies = [ "better_scoped_tls", "bytecheck", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "swc_common", "swc_ecma_ast", "swc_trace_macro", @@ -1674,13 +1717,25 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "2.0.0" +version = "2.0.1" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "swc_transform_common" +version = "5.0.0" +dependencies = [ + "better_scoped_tls", + "once_cell", + "rustc-hash", + "serde", + "serde_json", + "swc_common", +] + [[package]] name = "swc_visit" version = "2.0.0" @@ -1691,9 +1746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -1702,9 +1757,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1719,15 +1774,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1741,15 +1796,15 @@ dependencies = [ [[package]] name = "testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "serde_json", "swc_common", @@ -1775,13 +1830,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ - "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -1790,7 +1844,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1804,6 +1867,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -1816,9 +1890,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1826,9 +1900,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1841,9 +1915,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1852,9 +1926,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -1863,9 +1937,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1884,9 +1958,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1918,9 +1992,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-id" @@ -1936,9 +2010,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -1952,6 +2026,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "url" version = "2.5.4" @@ -1963,12 +2043,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -1977,24 +2051,28 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.11.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vergen" -version = "9.0.1" +version = "9.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" +checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" dependencies = [ "anyhow", - "cargo_metadata", + "cargo_metadata 0.19.2", "derive_builder", "regex", "rustversion", @@ -2003,9 +2081,9 @@ dependencies = [ [[package]] name = "vergen-lib" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" dependencies = [ "anyhow", "derive_builder", @@ -2018,6 +2096,79 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2040,7 +2191,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2049,15 +2200,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2132,16 +2274,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -2160,9 +2305,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -2172,9 +2317,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -2184,18 +2329,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -2204,18 +2349,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -2223,11 +2368,22 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -2236,9 +2392,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock index 15789405625f..4f94cc89f33d 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ansi_term" @@ -40,9 +40,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -74,11 +80,12 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "simd-abstraction", + "outref", + "vsimd", ] [[package]] @@ -90,9 +97,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -117,18 +124,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] [[package]] name = "bytecheck" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -138,9 +145,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", @@ -149,24 +156,35 @@ dependencies = [ [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +dependencies = [ + "bytes", + "rkyv", + "serde", +] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -179,10 +197,24 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.12", ] [[package]] @@ -196,9 +228,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.37" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -224,9 +256,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -243,9 +275,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -253,9 +285,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -267,9 +299,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -278,9 +310,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debugid" @@ -358,31 +390,31 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -424,11 +456,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" @@ -442,9 +486,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -454,9 +498,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -472,27 +516,28 @@ dependencies = [ "new_debug_unreachable", "once_cell", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -501,31 +546,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -533,67 +558,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -613,9 +625,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -629,12 +641,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.4", ] [[package]] @@ -651,9 +663,19 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "lazy_static" @@ -663,27 +685,27 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -691,9 +713,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -712,23 +734,22 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -737,18 +758,18 @@ dependencies = [ [[package]] name = "munge" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +checksum = "9e22e7961c873e8b305b176d2a4e1d41ce7ba31bc1c52d2a107a89568ec74c55" dependencies = [ "munge_macro", ] [[package]] name = "munge_macro" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b" dependencies = [ "proc-macro2", "quote", @@ -802,9 +823,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -812,15 +833,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "outref" -version = "0.1.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "overload" @@ -830,15 +851,15 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" [[package]] name = "par-core" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b506ab63a8bd3cd38858c7bfc2d078a189dc3210c7f8c9be1bbaf50c082a0ae" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" dependencies = [ "once_cell", ] @@ -855,9 +876,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -865,9 +886,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -884,9 +905,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -894,9 +915,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -904,9 +925,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -917,18 +938,27 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "pretty_assertions" @@ -942,18 +972,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -980,13 +1010,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -1019,9 +1055,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags", ] @@ -1034,7 +1070,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1049,9 +1085,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1087,13 +1123,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395027076c569819ea6035ee62e664f5e03d74e281744f55261dd1afd939212b" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ "bytecheck", "bytes", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "indexmap", "munge", "ptr_meta", @@ -1106,66 +1142,51 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustix" -version = "0.38.40" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" +checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" [[package]] name = "scoped-tls" @@ -1181,42 +1202,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1225,9 +1231,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1237,9 +1243,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -1261,15 +1267,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "simd-abstraction" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -1282,11 +1279,17 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smartstring" @@ -1299,25 +1302,18 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "sourcemap" -version = "9.0.1" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86721155737d89818020dc35713595c6e7b21016073c101e6590c47ca58c2d16" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash 1.1.0", - "rustc_version", + "rustc-hash", "serde", "serde_json", "unicode-id-start", @@ -1332,15 +1328,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1373,7 +1369,7 @@ dependencies = [ "bumpalo", "hashbrown 0.14.5", "ptr_meta", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] @@ -1386,18 +1382,19 @@ dependencies = [ "once_cell", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", ] [[package]] name = "swc_common" -version = "8.0.1" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck", + "bytes-str", "cfg-if", "either", "from_variant", @@ -1407,9 +1404,9 @@ dependencies = [ "parking_lot", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", - "siphasher", + "siphasher 0.3.11", "sourcemap", "swc_allocator", "swc_atoms", @@ -1417,13 +1414,13 @@ dependencies = [ "swc_visit", "termcolor", "tracing", - "unicode-width", + "unicode-width 0.1.14", "url", ] [[package]] name = "swc_core" -version = "17.0.0" +version = "26.4.5" dependencies = [ "once_cell", "swc_allocator", @@ -1443,15 +1440,17 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "8.1.0" +version = "11.0.0" dependencies = [ "bitflags", "bytecheck", "is-macro", "num-bigint", + "once_cell", "phf", "rancor", "rkyv", + "rustc-hash", "scoped-tls", "string_enum", "swc_atoms", @@ -1462,7 +1461,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "8.0.2" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -1470,7 +1469,8 @@ dependencies = [ "num-bigint", "once_cell", "regex", - "rustc-hash 2.1.1", + "rustc-hash", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -1483,7 +1483,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "1.0.1" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -1491,16 +1491,41 @@ dependencies = [ "syn", ] +[[package]] +name = "swc_ecma_lexer" +version = "14.0.5" +dependencies = [ + "arrayvec", + "bitflags", + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "rustc-hash", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + [[package]] name = "swc_ecma_parser" -version = "11.0.0" +version = "14.0.2" dependencies = [ + "arrayvec", + "bitflags", "either", "new_debug_unreachable", "num-bigint", "num-traits", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "smartstring", @@ -1508,18 +1533,19 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_lexer", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_quote_macros" -version = "11.0.0" +version = "14.0.0" dependencies = [ "anyhow", "proc-macro2", "quote", - "rustc-hash 2.1.1", + "rustc-hash", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -1530,7 +1556,7 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "8.0.0" +version = "12.0.0" dependencies = [ "anyhow", "hex", @@ -1541,7 +1567,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "12.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags", @@ -1549,7 +1575,7 @@ dependencies = [ "once_cell", "par-core", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "swc_atoms", @@ -1563,7 +1589,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "12.0.0" +version = "18.0.0" dependencies = [ "ansi_term", "anyhow", @@ -1588,14 +1614,14 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "12.0.0" +version = "15.0.2" dependencies = [ "indexmap", "num_cpus", "once_cell", "par-core", "par-iter", - "rustc-hash 2.1.1", + "rustc-hash", "ryu-js", "swc_atoms", "swc_common", @@ -1607,7 +1633,7 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "8.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -1629,7 +1655,7 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "9.1.1" +version = "13.0.0" dependencies = [ "anyhow", "miette", @@ -1668,7 +1694,7 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "1.0.0" +version = "1.1.0" dependencies = [ "proc-macro2", "quote", @@ -1677,13 +1703,13 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "8.0.0" +version = "11.0.0" dependencies = [ "better_scoped_tls", "bytecheck", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "swc_common", "swc_ecma_ast", "swc_trace_macro", @@ -1692,7 +1718,7 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "2.0.0" +version = "2.0.1" dependencies = [ "proc-macro2", "quote", @@ -1701,11 +1727,11 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "1.0.1" +version = "5.0.0" dependencies = [ "better_scoped_tls", "once_cell", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "serde_json", "swc_common", @@ -1721,9 +1747,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -1732,9 +1758,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1749,15 +1775,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1771,15 +1797,15 @@ dependencies = [ [[package]] name = "testing" -version = "8.0.0" +version = "12.0.0" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "serde_json", "swc_common", @@ -1805,13 +1831,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ - "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -1820,7 +1845,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1834,6 +1868,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -1846,9 +1891,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1856,9 +1901,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1871,9 +1916,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1882,9 +1927,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -1893,9 +1938,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1914,9 +1959,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1948,9 +1993,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-id" @@ -1966,9 +2011,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -1982,6 +2027,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "url" version = "2.5.4" @@ -1993,12 +2044,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -2007,24 +2052,28 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.11.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vergen" -version = "9.0.1" +version = "9.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" +checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" dependencies = [ "anyhow", - "cargo_metadata", + "cargo_metadata 0.19.2", "derive_builder", "regex", "rustversion", @@ -2033,9 +2082,9 @@ dependencies = [ [[package]] name = "vergen-lib" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" dependencies = [ "anyhow", "derive_builder", @@ -2048,6 +2097,79 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2070,7 +2192,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2079,15 +2201,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2162,16 +2275,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -2190,9 +2306,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -2202,9 +2318,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -2214,18 +2330,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -2234,18 +2350,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -2253,11 +2369,22 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -2266,9 +2393,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock index 0402df803ff9..87799fbeded0 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ansi_term" @@ -40,9 +40,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -68,17 +74,18 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "simd-abstraction", + "outref", + "vsimd", ] [[package]] @@ -90,9 +97,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -117,18 +124,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] [[package]] name = "bytecheck" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -138,9 +145,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", @@ -149,24 +156,35 @@ dependencies = [ [[package]] name = "bytes" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytes-str" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +dependencies = [ + "bytes", + "rkyv", + "serde", +] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -179,10 +197,24 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -196,9 +228,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.37" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -224,9 +256,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -243,9 +275,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -253,9 +285,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -267,9 +299,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -278,9 +310,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "debugid" @@ -358,31 +390,31 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" @@ -424,11 +456,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" @@ -442,9 +486,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -454,9 +498,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -466,33 +510,34 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.3.1" +version = "1.0.0" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -501,31 +546,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -533,67 +558,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -613,9 +625,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -629,12 +641,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.4", ] [[package]] @@ -651,9 +663,19 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] name = "lazy_static" @@ -663,27 +685,27 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -691,9 +713,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -712,23 +734,22 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -737,18 +758,18 @@ dependencies = [ [[package]] name = "munge" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +checksum = "9e22e7961c873e8b305b176d2a4e1d41ce7ba31bc1c52d2a107a89568ec74c55" dependencies = [ "munge_macro", ] [[package]] name = "munge_macro" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b" dependencies = [ "proc-macro2", "quote", @@ -802,9 +823,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ "hermit-abi", "libc", @@ -812,15 +833,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "outref" -version = "0.1.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "overload" @@ -830,15 +851,34 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" + +[[package]] +name = "par-core" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "757892557993c69e82f9de0f9051e87144278aa342f03bf53617bbf044554484" +dependencies = [ + "once_cell", +] + +[[package]] +name = "par-iter" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5b20f31e9ba82bfcbbb54a67aa40be6cebec9f668ba5753be138f9523c531a" +dependencies = [ + "either", + "par-core", +] [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -846,9 +886,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -865,9 +905,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -875,9 +915,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -885,9 +925,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -898,18 +938,27 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "pretty_assertions" @@ -923,18 +972,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -961,13 +1010,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -1000,9 +1055,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags", ] @@ -1015,7 +1070,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1030,9 +1085,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1068,13 +1123,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395027076c569819ea6035ee62e664f5e03d74e281744f55261dd1afd939212b" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ "bytecheck", "bytes", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "indexmap", "munge", "ptr_meta", @@ -1087,66 +1142,51 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustix" -version = "0.38.40" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" +checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" [[package]] name = "scoped-tls" @@ -1162,42 +1202,27 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1206,9 +1231,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1218,9 +1243,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -1242,15 +1267,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "simd-abstraction" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -1263,11 +1279,17 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smartstring" @@ -1280,25 +1302,18 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "sourcemap" -version = "9.0.1" +version = "9.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86721155737d89818020dc35713595c6e7b21016073c101e6590c47ca58c2d16" +checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash 1.1.0", - "rustc_version", + "rustc-hash", "serde", "serde_json", "unicode-id-start", @@ -1313,15 +1328,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1348,37 +1363,38 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc_allocator" -version = "3.0.1" +version = "4.0.0" dependencies = [ "allocator-api2", "bumpalo", "hashbrown 0.14.5", "ptr_meta", - "rustc-hash 2.1.1", + "rustc-hash", "triomphe", ] [[package]] name = "swc_atoms" -version = "4.0.0" +version = "5.0.0" dependencies = [ "bytecheck", "hstr", "once_cell", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", ] [[package]] name = "swc_common" -version = "7.0.0" +version = "11.1.3" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck", + "bytes-str", "cfg-if", "either", "from_variant", @@ -1388,9 +1404,9 @@ dependencies = [ "parking_lot", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "serde", - "siphasher", + "siphasher 0.3.11", "sourcemap", "swc_allocator", "swc_atoms", @@ -1398,13 +1414,13 @@ dependencies = [ "swc_visit", "termcolor", "tracing", - "unicode-width", + "unicode-width 0.1.14", "url", ] [[package]] name = "swc_core" -version = "14.1.0" +version = "26.4.5" dependencies = [ "once_cell", "swc_allocator", @@ -1417,20 +1433,23 @@ dependencies = [ "swc_plugin", "swc_plugin_macro", "swc_plugin_proxy", + "swc_transform_common", "vergen", ] [[package]] name = "swc_ecma_ast" -version = "7.0.0" +version = "11.0.0" dependencies = [ "bitflags", "bytecheck", "is-macro", "num-bigint", + "once_cell", "phf", "rancor", "rkyv", + "rustc-hash", "scoped-tls", "string_enum", "swc_atoms", @@ -1441,7 +1460,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "7.0.0" +version = "13.2.0" dependencies = [ "ascii", "compact_str", @@ -1449,7 +1468,8 @@ dependencies = [ "num-bigint", "once_cell", "regex", - "rustc-hash 2.1.1", + "rustc-hash", + "ryu-js", "serde", "sourcemap", "swc_allocator", @@ -1462,7 +1482,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "1.0.0" +version = "2.0.0" dependencies = [ "proc-macro2", "quote", @@ -1470,16 +1490,41 @@ dependencies = [ "syn", ] +[[package]] +name = "swc_ecma_lexer" +version = "14.0.5" +dependencies = [ + "arrayvec", + "bitflags", + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "rustc-hash", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + [[package]] name = "swc_ecma_parser" -version = "9.0.0" +version = "14.0.2" dependencies = [ + "arrayvec", + "bitflags", "either", "new_debug_unreachable", "num-bigint", "num-traits", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "smartstring", @@ -1487,13 +1532,14 @@ dependencies = [ "swc_atoms", "swc_common", "swc_ecma_ast", + "swc_ecma_lexer", "tracing", "typed-arena", ] [[package]] name = "swc_ecma_testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "anyhow", "hex", @@ -1504,14 +1550,15 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "10.0.0" +version = "15.1.1" dependencies = [ "better_scoped_tls", "bitflags", "indexmap", "once_cell", + "par-core", "phf", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "smallvec", "swc_atoms", @@ -1520,13 +1567,12 @@ dependencies = [ "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", - "swc_parallel", "tracing", ] [[package]] name = "swc_ecma_transforms_testing" -version = "10.0.0" +version = "18.0.0" dependencies = [ "ansi_term", "anyhow", @@ -1551,25 +1597,26 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "10.0.0" +version = "15.0.2" dependencies = [ "indexmap", "num_cpus", "once_cell", - "rustc-hash 2.1.1", + "par-core", + "par-iter", + "rustc-hash", "ryu-js", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_visit", - "swc_parallel", "tracing", "unicode-id", ] [[package]] name = "swc_ecma_visit" -version = "7.0.0" +version = "11.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -1591,12 +1638,15 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "8.0.0" +version = "13.0.0" dependencies = [ "anyhow", "miette", "once_cell", "parking_lot", + "serde", + "serde_derive", + "serde_json", "swc_common", ] @@ -1617,13 +1667,6 @@ dependencies = [ "swc_core", ] -[[package]] -name = "swc_parallel" -version = "1.2.0" -dependencies = [ - "once_cell", -] - [[package]] name = "swc_plugin" version = "1.0.0" @@ -1633,7 +1676,7 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "1.0.0" +version = "1.1.0" dependencies = [ "proc-macro2", "quote", @@ -1642,13 +1685,13 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "7.0.0" +version = "11.0.0" dependencies = [ "better_scoped_tls", "bytecheck", "rancor", "rkyv", - "rustc-hash 2.1.1", + "rustc-hash", "swc_common", "swc_ecma_ast", "swc_trace_macro", @@ -1657,13 +1700,25 @@ dependencies = [ [[package]] name = "swc_trace_macro" -version = "2.0.0" +version = "2.0.1" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "swc_transform_common" +version = "5.0.0" +dependencies = [ + "better_scoped_tls", + "once_cell", + "rustc-hash", + "serde", + "serde_json", + "swc_common", +] + [[package]] name = "swc_visit" version = "2.0.0" @@ -1674,9 +1729,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -1685,9 +1740,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1702,15 +1757,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1724,15 +1779,15 @@ dependencies = [ [[package]] name = "testing" -version = "7.0.0" +version = "12.0.0" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.18.1", "difference", "once_cell", "pretty_assertions", "regex", - "rustc-hash 2.1.1", + "rustc-hash", "serde", "serde_json", "swc_common", @@ -1758,13 +1813,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ - "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -1773,7 +1827,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1787,6 +1850,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -1799,9 +1873,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1809,9 +1883,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1824,9 +1898,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1835,9 +1909,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -1846,9 +1920,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1867,9 +1941,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1901,9 +1975,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-id" @@ -1919,9 +1993,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -1935,6 +2009,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "url" version = "2.5.4" @@ -1946,12 +2026,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -1960,24 +2034,28 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.11.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vergen" -version = "9.0.1" +version = "9.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" +checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" dependencies = [ "anyhow", - "cargo_metadata", + "cargo_metadata 0.19.2", "derive_builder", "regex", "rustversion", @@ -1986,9 +2064,9 @@ dependencies = [ [[package]] name = "vergen-lib" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" dependencies = [ "anyhow", "derive_builder", @@ -2001,6 +2079,79 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2023,7 +2174,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2032,15 +2183,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2115,16 +2257,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -2143,9 +2288,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -2155,9 +2300,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -2167,18 +2312,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -2187,18 +2332,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -2206,11 +2351,22 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -2219,9 +2375,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", From de667bbc485efae5dcb2ba0bd0c29b90e66605d2 Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Mon, 9 Jun 2025 15:20:37 -0700 Subject: [PATCH 075/209] chore(plugin/runner): Update `virtual-fs` to dedupe dependencies (#10594) **Description:** This deduplicates some wasmer dependencies. This uses 0.600.0 instead of 0.600.1 because of a version range issue in `url` https://github.com/wasmerio/wasmer/issues/5597 (which would be a breaking change to support). --- .changeset/soft-dolphins-divide.md | 6 ++ Cargo.lock | 135 +++-------------------------- Cargo.toml | 2 +- 3 files changed, 18 insertions(+), 125 deletions(-) create mode 100644 .changeset/soft-dolphins-divide.md diff --git a/.changeset/soft-dolphins-divide.md b/.changeset/soft-dolphins-divide.md new file mode 100644 index 000000000000..7992f064d0f1 --- /dev/null +++ b/.changeset/soft-dolphins-divide.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_plugin_runner: patch +--- + +chore: Update `virtual-fs` to dedupe dependencies diff --git a/Cargo.lock b/Cargo.lock index 8d85586ce7f2..dc825ee65379 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1260,17 +1260,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -2377,7 +2366,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -6521,7 +6509,7 @@ dependencies = [ "tokio", "tracing", "vergen", - "virtual-fs 0.19.0", + "virtual-fs", "wasmer", "wasmer-cache", "wasmer-compiler-cranelift", @@ -7422,31 +7410,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtual-fs" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d2456ec960b74e5b0423159c70dd9796da1445de462013fe03eefd2545b631" -dependencies = [ - "async-trait", - "bytes", - "dashmap 6.1.0", - "derivative", - "dunce", - "futures", - "getrandom 0.2.15", - "indexmap 1.9.3", - "lazy_static", - "pin-project-lite", - "replace_with", - "shared-buffer", - "slab", - "thiserror 1.0.69", - "tokio", - "tracing", - "wasmer-package 0.2.0", -] - [[package]] name = "virtual-fs" version = "0.600.0" @@ -7472,8 +7435,8 @@ dependencies = [ "thiserror 1.0.69", "tokio", "tracing", - "wasmer-package 0.600.0", - "webc 9.0.0", + "wasmer-package", + "webc", ] [[package]] @@ -7833,28 +7796,6 @@ dependencies = [ "wasmer-types", ] -[[package]] -name = "wasmer-config" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d97272c1042e20957be5f7e4a42f28ae5367c32a79ae953339335a55512e3" -dependencies = [ - "anyhow", - "bytesize", - "ciborium", - "derive_builder 0.12.0", - "hex", - "indexmap 2.7.1", - "schemars", - "semver", - "serde", - "serde_json", - "serde_yml", - "thiserror 1.0.69", - "toml", - "url", -] - [[package]] name = "wasmer-config" version = "0.600.0" @@ -7911,39 +7852,13 @@ dependencies = [ "shared-buffer", "thiserror 1.0.69", "tracing", - "virtual-fs 0.600.0", + "virtual-fs", "virtual-net", "wasmer", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-wasix-types", ] -[[package]] -name = "wasmer-package" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98d05a5cd47f324ed784481d79351e12a02ad3289148dfa72432aa5d394634b8" -dependencies = [ - "anyhow", - "bytes", - "cfg-if", - "ciborium", - "flate2", - "insta", - "semver", - "serde", - "serde_json", - "sha2", - "shared-buffer", - "tar", - "tempfile", - "thiserror 1.0.69", - "toml", - "url", - "wasmer-config 0.10.0", - "webc 7.0.0-rc.2", -] - [[package]] name = "wasmer-package" version = "0.600.0" @@ -7967,9 +7882,9 @@ dependencies = [ "thiserror 1.0.69", "toml", "url", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-types", - "webc 9.0.0", + "webc", ] [[package]] @@ -8074,20 +7989,20 @@ dependencies = [ "tracing", "url", "urlencoding", - "virtual-fs 0.600.0", + "virtual-fs", "virtual-mio", "virtual-net", "waker-fn", "wasm-bindgen", "wasm-bindgen-futures", "wasmer", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-journal", - "wasmer-package 0.600.0", + "wasmer-package", "wasmer-types", "wasmer-wasix-types", "web-sys", - "webc 9.0.0", + "webc", "weezl", "windows-sys 0.59.0", "xxhash-rust", @@ -8168,34 +8083,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webc" -version = "7.0.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6893cbe58d5b97a0daa2dd77055d621db1c8b94fe0f2bbd719c8de747226ea6" -dependencies = [ - "anyhow", - "base64 0.22.1", - "bytes", - "cfg-if", - "ciborium", - "document-features", - "ignore", - "indexmap 1.9.3", - "leb128", - "lexical-sort", - "libc", - "once_cell", - "path-clean 1.0.1", - "rand 0.8.5", - "serde", - "serde_json", - "sha2", - "shared-buffer", - "thiserror 1.0.69", - "url", -] - [[package]] name = "webc" version = "9.0.0" diff --git a/Cargo.toml b/Cargo.toml index f37c504ae031..4e36b9311562 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,7 +128,7 @@ resolver = "2" unicode-width = "0.1.4" url = "2.5.4" vergen = { version = "9.0.0", default-features = false } - virtual-fs = { version = "0.19.0", default-features = false } + virtual-fs = { version = "0.600.0", default-features = false } walkdir = "2.4.0" wasm-bindgen = "0.2.91" wasm-bindgen-futures = "0.4.41" From 8a9f609061e65977b97baca95dce147fa19e92fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 10 Jun 2025 08:44:00 -0700 Subject: [PATCH 076/209] refactor(swc_common): Use `swc_sourcemap` instead (#10593) **Description:** `swc_sourcemap` uses `ByteStr` for source contents, which is identical to `swc_common`. So we can avoid reallocating source code strings. **Related issue:** - https://github.com/swc-project/swc-sourcemap/pull/1 - https://github.com/swc-project/plugins/pull/468 --- Cargo.lock | 59 +++--- Cargo.toml | 4 +- bindings/Cargo.toml | 2 +- bindings/binding_minifier_node/Cargo.toml | 2 +- .../binding_react_compiler_node/Cargo.toml | 2 +- crates/swc/Cargo.toml | 40 ++-- crates/swc/src/lib.rs | 4 +- crates/swc/tests/source_map.rs | 16 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 3 +- crates/swc_common/src/source_map.rs | 22 +- crates/swc_compiler_base/Cargo.toml | 3 +- crates/swc_compiler_base/src/lib.rs | 7 +- crates/swc_config/Cargo.toml | 25 +-- crates/swc_config/src/source_map.rs | 13 +- .../tests/fixture/stub_napi/Cargo.lock | 195 +++++++++--------- .../tests/fixture/stub_wasm/Cargo.lock | 53 ++--- crates/swc_ecma_codegen/Cargo.toml | 22 +- crates/swc_ecma_codegen/tests/sourcemap.rs | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 18 +- crates/swc_ecma_transforms_testing/src/lib.rs | 2 +- .../css-plugins/swc_noop_plugin/Cargo.lock | 61 +++--- .../tests/fixture/issue_6404/Cargo.lock | 61 +++--- .../fixture/swc_internal_plugin/Cargo.lock | 61 +++--- .../tests/fixture/swc_noop_plugin/Cargo.lock | 61 +++--- 26 files changed, 382 insertions(+), 360 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc825ee65379..9d1a89e612b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -498,9 +498,9 @@ dependencies = [ [[package]] name = "bytes-str" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +checksum = "c02af038c863b51d496dd4a2eabdf781f8f7ab68025e13b984b7f2c525560454" dependencies = [ "bytes", "rkyv", @@ -4616,24 +4616,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sourcemap" -version = "9.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd430118acc9fdd838557649b9b43fd0a78e3834d84a283b466f8e84720d6101" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "spin" version = "0.9.8" @@ -4760,7 +4742,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_atoms", "swc_common", "swc_compiler_base", @@ -4785,6 +4766,7 @@ dependencies = [ "swc_node_comments", "swc_plugin_proxy", "swc_plugin_runner", + "swc_sourcemap", "swc_timer", "swc_transform_common", "swc_typescript", @@ -4900,8 +4882,8 @@ dependencies = [ "relative-path", "serde", "serde_json", - "sourcemap", "swc_core", + "swc_sourcemap", "tracing", "tracing-chrome", "tracing-futures", @@ -4936,10 +4918,10 @@ dependencies = [ "serde_json", "shrink-to-fit", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "termcolor", "tracing", @@ -4953,6 +4935,7 @@ version = "22.0.1" dependencies = [ "anyhow", "base64 0.22.1", + "bytes-str", "napi", "napi-derive", "once_cell", @@ -4960,7 +4943,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", @@ -4970,6 +4952,7 @@ dependencies = [ "swc_ecma_minifier", "swc_ecma_parser", "swc_ecma_visit", + "swc_sourcemap", "swc_timer", ] @@ -4978,6 +4961,7 @@ name = "swc_config" version = "3.0.0" dependencies = [ "anyhow", + "bytes-str", "dashmap 5.5.3", "globset", "indexmap 2.7.1", @@ -4987,8 +4971,8 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_config_macro", + "swc_sourcemap", ] [[package]] @@ -5294,7 +5278,6 @@ dependencies = [ "ryu-js", "serde", "serde_json", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", @@ -5303,6 +5286,7 @@ dependencies = [ "swc_ecma_parser", "swc_ecma_testing", "swc_malloc", + "swc_sourcemap", "testing", "tracing", ] @@ -5815,7 +5799,6 @@ version = "19.0.0" dependencies = [ "par-core", "pretty_assertions", - "sourcemap", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -5831,6 +5814,7 @@ dependencies = [ "swc_ecma_transforms_typescript", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -6054,7 +6038,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "sourcemap", "swc_allocator", "swc_common", "swc_ecma_ast", @@ -6064,6 +6047,7 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -6520,6 +6504,25 @@ dependencies = [ name = "swc_plugin_testing" version = "0.24.1" +[[package]] +name = "swc_sourcemap" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8d25be7830fcf30414c080697f5db03cbe7467cd4908a9a77958ebc8dbbafe" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_timer" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 4e36b9311562..5e982bd1038a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ resolver = "2" bitflags = "2.5.0" browserslist-rs = "0.18.1" bumpalo = "3.16.0" - bytes-str = "0.2.3" + bytes-str = "0.2.5" cargo_metadata = "0.18.1" cfg-if = "1.0.0" changesets = "0.2.2" @@ -108,9 +108,9 @@ resolver = "2" smallvec = "1.8.0" smartstring = "1.0.1" smol_str = "0.2.0" - sourcemap = "9.2.0" st-map = "0.2.0" string_cache = "0.8.7" + swc_sourcemap = "9.3.0" syn = "2" tempfile = "3.6.0" termcolor = "1.0" diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 0dd1aad8d55c..b2db0be37cbc 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -35,7 +35,6 @@ resolver = "2" serde = "1" serde-wasm-bindgen = "0.6.5" serde_json = "1.0.120" - sourcemap = "8.0.1" swc_atoms = "5.0.0" swc_cli_impl = "26.0.0" swc_common = "11.1.3" @@ -54,6 +53,7 @@ resolver = "2" swc_html_minifier = "20.0.0" swc_malloc = "1.2.3" swc_nodejs_common = "1.0.0" + swc_sourcemap = "9.3.0" tracing = "0.1.40" tracing-chrome = "0.7.2" tracing-futures = "0.2.5" diff --git a/bindings/binding_minifier_node/Cargo.toml b/bindings/binding_minifier_node/Cargo.toml index 627af13ff36c..5dcc70c3fa86 100644 --- a/bindings/binding_minifier_node/Cargo.toml +++ b/bindings/binding_minifier_node/Cargo.toml @@ -25,7 +25,7 @@ path-clean = { workspace = true } rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["unbounded_depth"] } -sourcemap = { workspace = true } +swc_sourcemap = { workspace = true } tracing = { workspace = true, features = ["release_max_level_info"] } tracing-chrome = { workspace = true } tracing-futures = { workspace = true } diff --git a/bindings/binding_react_compiler_node/Cargo.toml b/bindings/binding_react_compiler_node/Cargo.toml index 6099cc04335b..26248721cfd1 100644 --- a/bindings/binding_react_compiler_node/Cargo.toml +++ b/bindings/binding_react_compiler_node/Cargo.toml @@ -25,7 +25,7 @@ path-clean = { workspace = true } rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["unbounded_depth"] } -sourcemap = { workspace = true } +swc_sourcemap = { workspace = true } tracing = { workspace = true, features = ["release_max_level_info"] } tracing-chrome = { workspace = true } tracing-futures = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index ad2b3262b31d..3057e9754aed 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -51,26 +51,26 @@ plugin_transform_host_native = [ manual-tokio-runtime = [] [dependencies] -anyhow = { workspace = true } -base64 = { workspace = true } -bytes-str = { workspace = true } -dashmap = { workspace = true } -either = { workspace = true } -indexmap = { workspace = true, features = ["serde"] } -jsonc-parser = { workspace = true, features = ["serde"] } -lru = { workspace = true } -once_cell = { workspace = true } -par-core = { workspace = true } -par-iter = { workspace = true } -parking_lot = { workspace = true } -pathdiff = { workspace = true } -regex = { workspace = true } -rustc-hash = { workspace = true } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -sourcemap = { workspace = true } -tracing = { workspace = true } -url = { workspace = true } +anyhow = { workspace = true } +base64 = { workspace = true } +bytes-str = { workspace = true } +dashmap = { workspace = true } +either = { workspace = true } +indexmap = { workspace = true, features = ["serde"] } +jsonc-parser = { workspace = true, features = ["serde"] } +lru = { workspace = true } +once_cell = { workspace = true } +par-core = { workspace = true } +par-iter = { workspace = true } +parking_lot = { workspace = true } +pathdiff = { workspace = true } +regex = { workspace = true } +rustc-hash = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +swc_sourcemap = { workspace = true } +tracing = { workspace = true } +url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } diff --git a/crates/swc/src/lib.rs b/crates/swc/src/lib.rs index b048f8629999..e50e4a74a8a7 100644 --- a/crates/swc/src/lib.rs +++ b/crates/swc/src/lib.rs @@ -129,7 +129,6 @@ use common::{ use jsonc_parser::{parse_to_serde_value, ParseOptions}; use once_cell::sync::Lazy; use serde_json::error::Category; -pub use sourcemap; use swc_common::{ comments::Comments, errors::Handler, sync::Lrc, FileName, Mark, SourceFile, SourceMap, Spanned, GLOBALS, @@ -154,6 +153,7 @@ use swc_ecma_transforms_base::fixer::paren_remover; use swc_ecma_visit::{FoldWith, VisitMutWith, VisitWith}; pub use swc_error_reporters::handler::{try_with_handler, HandlerOpts}; pub use swc_node_comments::SwcComments; +pub use swc_sourcemap as sourcemap; use swc_timer::timer; use swc_transform_common::output::experimental_emit; use swc_typescript::fast_dts::FastDts; @@ -412,7 +412,7 @@ impl Compiler { } else { // Load source map passed by user Ok(Some( - sourcemap::SourceMap::from_slice(s.as_bytes()).context( + swc_sourcemap::SourceMap::from_slice(s.as_bytes()).context( "failed to read input source map from user-provided sourcemap", )?, )) diff --git a/crates/swc/tests/source_map.rs b/crates/swc/tests/source_map.rs index 9ec4c99a8897..a779c06cbf97 100644 --- a/crates/swc/tests/source_map.rs +++ b/crates/swc/tests/source_map.rs @@ -151,7 +151,8 @@ fn validate_map(map_file: PathBuf) { if content.is_empty() { return; } - sourcemap::SourceMap::from_slice(content.as_bytes()).expect("failed to deserialize sourcemap"); + swc_sourcemap::SourceMap::from_slice(content.as_bytes()) + .expect("failed to deserialize sourcemap"); } #[cfg(not(target_os = "windows"))] @@ -321,9 +322,10 @@ fn issue_4112() { }, ) .expect("failed to process js file"); - let source_count = sourcemap::SourceMap::from_slice(output2.map.unwrap().as_bytes()) - .expect("failed to deserialize sourcemap") - .get_source_count(); + let source_count = + swc_sourcemap::SourceMap::from_slice(output2.map.unwrap().as_bytes()) + .expect("failed to deserialize sourcemap") + .get_source_count(); if source_count == 1 { return Ok(()); } @@ -368,7 +370,7 @@ fn should_work_with_emit_source_map_columns() { let map = result.map.unwrap(); // lookup createElement(...) function call - let source_map = sourcemap::SourceMap::from_slice(map.as_bytes()) + let source_map = swc_sourcemap::SourceMap::from_slice(map.as_bytes()) .expect("failed to deserialize sourcemap"); let token = source_map .lookup_token(1, 14) @@ -420,7 +422,7 @@ fn should_work_with_emit_source_map_columns() { Ok(result) => { assert!(result.map.is_some()); let map = result.map.unwrap(); - let source_map = sourcemap::SourceMap::from_slice(map.as_bytes()) + let source_map = swc_sourcemap::SourceMap::from_slice(map.as_bytes()) .expect("failed to deserialize sourcemap"); let token = source_map .lookup_token(1, 14) @@ -507,7 +509,7 @@ export const fixupRiskConfigData = (data: any): types.RiskConfigType => { assert!(result.map.is_some()); let map = result.map.unwrap(); - let source_map = sourcemap::SourceMap::from_slice(map.as_bytes()) + let source_map = swc_sourcemap::SourceMap::from_slice(map.as_bytes()) .expect("failed to deserialize sourcemap"); // "export" diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 749a36db3055..cc5db65e4680 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -33,7 +33,7 @@ rayon = { workspace = true } relative-path = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["unbounded_depth"] } -sourcemap = { workspace = true } +swc_sourcemap = { workspace = true } tracing = { workspace = true } tracing-chrome = { workspace = true } tracing-futures = { workspace = true } diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 5909e5bd8a8c..57121c15681a 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -26,6 +26,7 @@ diagnostic-serde = [] plugin-base = ["__plugin", "rkyv-impl", "diagnostic-serde"] plugin-mode = ["__plugin_mode", "plugin-base"] plugin-rt = ["__plugin_rt", "plugin-base"] +sourcemap = ["dep:swc_sourcemap"] plugin_transform_schema_v1 = [] plugin_transform_schema_vtest = [] @@ -62,7 +63,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } shrink-to-fit = { workspace = true, optional = true } siphasher = { workspace = true } -sourcemap = { workspace = true, optional = true } +swc_sourcemap = { workspace = true, optional = true } termcolor = { workspace = true, optional = true } tracing = { workspace = true } unicode-width = { workspace = true } diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 8955eb1f0443..1e82cd7e450f 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -31,7 +31,7 @@ use bytes_str::BytesStr; use once_cell::sync::Lazy; use rustc_hash::FxHashMap; #[cfg(feature = "sourcemap")] -use sourcemap::SourceMapBuilder; +use swc_sourcemap::SourceMapBuilder; use tracing::debug; pub use crate::syntax_pos::*; @@ -1180,9 +1180,9 @@ impl SourceMap { pub fn build_source_map( &self, mappings: &[(BytePos, LineCol)], - orig: Option, + orig: Option, config: impl SourceMapGenConfig, - ) -> sourcemap::SourceMap { + ) -> swc_sourcemap::SourceMap { build_source_map(self, mappings, orig, &config) } } @@ -1281,9 +1281,9 @@ impl Files for SourceMap { pub fn build_source_map( files: &impl Files, mappings: &[(BytePos, LineCol)], - orig: Option, + orig: Option, config: &impl SourceMapGenConfig, -) -> sourcemap::SourceMap { +) -> swc_sourcemap::SourceMap { let mut builder = SourceMapBuilder::new(None); let mut src_id = 0u32; @@ -1326,7 +1326,7 @@ pub fn build_source_map( if config.skip(&f.name) { continue; } - src_id = builder.add_source(&config.file_name_to_source(&f.name)); + src_id = builder.add_source(config.file_name_to_source(&f.name).into()); // orig.adjust_mappings below will throw this out if orig is Some if orig.is_none() && config.ignore_list(&f.name) { builder.add_to_ignore_list(src_id); @@ -1336,7 +1336,7 @@ pub fn build_source_map( let inline_sources_content = orig.is_none() && config.inline_sources_content(&f.name); if inline_sources_content { - builder.set_source_contents(src_id, Some(&f.src)); + builder.set_source_contents(src_id, Some(f.src.clone())); } ch_state = ByteToCharPosState::default(); @@ -1386,8 +1386,12 @@ pub fn build_source_map( let name = None; let name_idx = if orig.is_none() { - name.or_else(|| config.name_for_bytepos(pos)) - .map(|name| builder.add_name(name)) + name.or_else(|| config.name_for_bytepos(pos)).map(|name| { + builder.add_name(unsafe { + // Safety: name is `&str`, which is valid UTF-8 + BytesStr::from_utf8_slice_unchecked(name.as_bytes()) + }) + }) } else { // orig.adjust_mappings below will throw this out None diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index cf42716d2122..2ab24a53e1ac 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -15,13 +15,14 @@ node = ["napi", "napi-derive"] [dependencies] anyhow = { workspace = true } base64 = { workspace = true } +bytes-str = { workspace = true } once_cell = { workspace = true } pathdiff = { workspace = true } rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } -sourcemap = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } +swc_sourcemap = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "11.1.3", path = "../swc_common", features = [ diff --git a/crates/swc_compiler_base/src/lib.rs b/crates/swc_compiler_base/src/lib.rs index 665664b63ff2..5aef0250d54b 100644 --- a/crates/swc_compiler_base/src/lib.rs +++ b/crates/swc_compiler_base/src/lib.rs @@ -5,6 +5,7 @@ use std::{ use anyhow::{Context, Error}; use base64::prelude::{Engine, BASE64_STANDARD}; +use bytes_str::BytesStr; use once_cell::sync::Lazy; use rustc_hash::FxHashMap; #[allow(unused)] @@ -112,7 +113,7 @@ pub struct PrintArgs<'a> { pub inline_sources_content: bool, pub source_map: SourceMapsConfig, pub source_map_names: &'a FxHashMap, - pub orig: Option, + pub orig: Option, pub comments: Option<&'a dyn Comments>, pub emit_source_map_columns: bool, pub preamble: &'a str, @@ -243,8 +244,8 @@ where }; if let Some(map) = &mut map { - if source_root.is_some() { - map.set_source_root(source_root) + if let Some(source_root) = source_root { + map.set_source_root(Some(BytesStr::from_str_slice(source_root))) } } diff --git a/crates/swc_config/Cargo.toml b/crates/swc_config/Cargo.toml index 9f5ebe8276a9..b14d7407744d 100644 --- a/crates/swc_config/Cargo.toml +++ b/crates/swc_config/Cargo.toml @@ -19,20 +19,21 @@ file_pattern = ["glob", "regex"] glob = ["dep:globset", "dep:dashmap", "dep:rustc-hash", "dep:once_cell"] regex = ["dep:regex", "dep:dashmap", "dep:rustc-hash", "dep:once_cell"] regex_js = ["dep:regress"] -sourcemap = ["dep:sourcemap"] +sourcemap = ["dep:swc_sourcemap"] [dependencies] -anyhow = { workspace = true } -dashmap = { workspace = true, optional = true } -globset = { workspace = true, optional = true } -indexmap = { workspace = true } -once_cell = { workspace = true, optional = true } -regex = { workspace = true, optional = true } -regress = { workspace = true, optional = true } -rustc-hash = { workspace = true, optional = true } -serde = { workspace = true, features = ["derive", "rc"] } -serde_json = { workspace = true } -sourcemap = { workspace = true, optional = true } +anyhow = { workspace = true } +bytes-str = { workspace = true, features = ["serde"] } +dashmap = { workspace = true, optional = true } +globset = { workspace = true, optional = true } +indexmap = { workspace = true } +once_cell = { workspace = true, optional = true } +regex = { workspace = true, optional = true } +regress = { workspace = true, optional = true } +rustc-hash = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive", "rc"] } +serde_json = { workspace = true } +swc_sourcemap = { workspace = true, optional = true } swc_config_macro = { version = "1.0.0", path = "../swc_config_macro" } diff --git a/crates/swc_config/src/source_map.rs b/crates/swc_config/src/source_map.rs index 85de6215294d..b1e0e7d5ef73 100644 --- a/crates/swc_config/src/source_map.rs +++ b/crates/swc_config/src/source_map.rs @@ -1,8 +1,7 @@ -use std::sync::Arc; - use anyhow::{bail, Context, Result}; +use bytes_str::BytesStr; use serde::{Deserialize, Serialize}; -use sourcemap::{vlq::parse_vlq_segment, RawToken, SourceMap}; +use swc_sourcemap::{vlq::parse_vlq_segment, RawToken, SourceMap}; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -11,19 +10,19 @@ pub enum SourceMapContent { #[serde(rename_all = "camelCase")] Parsed { #[serde(default)] - sources: Vec>, + sources: Vec, #[serde(default)] - names: Vec>, + names: Vec, #[serde(default)] mappings: String, #[serde(default)] range_mappings: String, #[serde(default)] - file: Option>, + file: Option, #[serde(default)] source_root: Option, #[serde(default)] - sources_content: Option>>>, + sources_content: Option>>, }, } diff --git a/crates/swc_core/tests/fixture/stub_napi/Cargo.lock b/crates/swc_core/tests/fixture/stub_napi/Cargo.lock index 5a0c2991c5a0..a634f71783b7 100644 --- a/crates/swc_core/tests/fixture/stub_napi/Cargo.lock +++ b/crates/swc_core/tests/fixture/stub_napi/Cargo.lock @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" @@ -114,7 +114,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -125,7 +125,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -145,7 +145,7 @@ checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -218,7 +218,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -345,7 +345,7 @@ checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -365,9 +365,9 @@ dependencies = [ [[package]] name = "bytes-str" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "rkyv", @@ -444,9 +444,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -788,7 +788,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -836,7 +836,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -858,7 +858,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -963,7 +963,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -983,7 +983,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -994,7 +994,7 @@ checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1014,7 +1014,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", "unicode-xid", ] @@ -1036,7 +1036,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1110,7 +1110,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1217,7 +1217,7 @@ version = "2.0.0" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1288,7 +1288,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1340,7 +1340,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -1756,7 +1756,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -1883,7 +1883,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2174,7 +2174,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2200,9 +2200,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] @@ -2215,7 +2215,7 @@ checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] @@ -2242,7 +2242,7 @@ checksum = "734799cf91479720b2f970c61a22850940dd91e27d4f02b1c6fc792778df2459" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2277,7 +2277,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2292,7 +2292,7 @@ dependencies = [ "quote", "regex", "semver", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2493,7 +2493,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2655,7 +2655,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2684,7 +2684,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2743,7 +2743,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" dependencies = [ "proc-macro2", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2775,7 +2775,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -2833,7 +2833,7 @@ checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3216,14 +3216,14 @@ checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -3401,7 +3401,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3482,7 +3482,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3493,7 +3493,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3677,24 +3677,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "spin" version = "0.9.8" @@ -3741,7 +3723,7 @@ checksum = "710e9696ef338691287aeb937ee6ffe60022f579d3c8d2fd9d58973a9a10a466" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3757,7 +3739,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -3822,7 +3804,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_atoms", "swc_common", "swc_compiler_base", @@ -3845,6 +3826,7 @@ dependencies = [ "swc_node_comments", "swc_plugin_proxy", "swc_plugin_runner", + "swc_sourcemap", "swc_timer", "swc_transform_common", "swc_typescript", @@ -3930,10 +3912,10 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "tracing", "unicode-width 0.1.14", @@ -3946,6 +3928,7 @@ version = "22.0.1" dependencies = [ "anyhow", "base64", + "bytes-str", "napi", "napi-derive", "once_cell", @@ -3953,7 +3936,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", @@ -3963,6 +3945,7 @@ dependencies = [ "swc_ecma_minifier", "swc_ecma_parser", "swc_ecma_visit", + "swc_sourcemap", "swc_timer", ] @@ -3971,6 +3954,7 @@ name = "swc_config" version = "3.0.0" dependencies = [ "anyhow", + "bytes-str", "dashmap 5.5.3", "globset", "indexmap 2.9.0", @@ -3980,8 +3964,8 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap", "swc_config_macro", + "swc_sourcemap", ] [[package]] @@ -3991,7 +3975,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4049,12 +4033,12 @@ dependencies = [ "rustc-hash 2.1.1", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -4065,7 +4049,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4497,7 +4481,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4667,7 +4651,7 @@ version = "1.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4701,7 +4685,7 @@ version = "1.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4803,6 +4787,25 @@ dependencies = [ "wasmer-wasix", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_timer" version = "1.0.0" @@ -4816,7 +4819,7 @@ version = "2.0.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4867,9 +4870,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" dependencies = [ "proc-macro2", "quote", @@ -4893,7 +4896,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4958,7 +4961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -4987,7 +4990,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -4998,7 +5001,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -5114,7 +5117,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -5292,7 +5295,7 @@ checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -5446,9 +5449,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unicode-xid" @@ -5761,9 +5764,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -5796,7 +5799,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", "wasm-bindgen-shared", ] @@ -5831,7 +5834,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6274,7 +6277,7 @@ dependencies = [ "bumpalo", "leb128fmt", "memchr", - "unicode-width 0.2.0", + "unicode-width 0.2.1", "wasm-encoder", ] @@ -6439,7 +6442,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -6450,7 +6453,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -6773,7 +6776,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", "synstructure", ] @@ -6794,7 +6797,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] [[package]] @@ -6814,7 +6817,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", "synstructure", ] @@ -6843,5 +6846,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.102", ] diff --git a/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock b/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock index 36f5b4e3f215..ba405d0d22d5 100644 --- a/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock +++ b/crates/swc_core/tests/fixture/stub_wasm/Cargo.lock @@ -218,9 +218,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-str" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c361579d538821f45a32d54aa7e980c27b10f8649ee4e812fb0e6200eb869c" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "serde", @@ -1404,24 +1404,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "sourcemap" -version = "9.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd430118acc9fdd838557649b9b43fd0a78e3834d84a283b466f8e84720d6101" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "st-map" version = "0.2.4" @@ -1518,7 +1500,6 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "sourcemap", "swc_atoms", "swc_common", "swc_compiler_base", @@ -1539,6 +1520,7 @@ dependencies = [ "swc_ecma_visit", "swc_error_reporters", "swc_node_comments", + "swc_sourcemap", "swc_timer", "swc_transform_common", "swc_typescript", @@ -1587,10 +1569,10 @@ dependencies = [ "rustc-hash", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "tracing", "unicode-width 0.1.14", @@ -1603,12 +1585,12 @@ version = "22.0.1" dependencies = [ "anyhow", "base64", + "bytes-str", "once_cell", "pathdiff", "rustc-hash", "serde", "serde_json", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", @@ -1618,6 +1600,7 @@ dependencies = [ "swc_ecma_minifier", "swc_ecma_parser", "swc_ecma_visit", + "swc_sourcemap", "swc_timer", ] @@ -1626,6 +1609,7 @@ name = "swc_config" version = "3.0.0" dependencies = [ "anyhow", + "bytes-str", "dashmap", "globset", "indexmap", @@ -1635,8 +1619,8 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "sourcemap", "swc_config_macro", + "swc_sourcemap", ] [[package]] @@ -1697,12 +1681,12 @@ dependencies = [ "rustc-hash", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -2346,6 +2330,25 @@ dependencies = [ "swc_common", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_timer" version = "1.0.0" diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 611c934a3900..5125dc568498 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -17,17 +17,17 @@ serde-impl = ["swc_ecma_ast/serde"] bench = false [dependencies] -ascii = { workspace = true } -compact_str = { workspace = true } -memchr = { workspace = true } -num-bigint = { workspace = true, features = ["serde"] } -once_cell = { workspace = true } -regex = { workspace = true } -rustc-hash = { workspace = true } -ryu-js = { workspace = true } -serde = { workspace = true } -sourcemap = { workspace = true } -tracing = { workspace = true } +ascii = { workspace = true } +compact_str = { workspace = true } +memchr = { workspace = true } +num-bigint = { workspace = true, features = ["serde"] } +once_cell = { workspace = true } +regex = { workspace = true } +rustc-hash = { workspace = true } +ryu-js = { workspace = true } +serde = { workspace = true } +swc_sourcemap = { workspace = true } +tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false, features = [ "hashbrown", diff --git a/crates/swc_ecma_codegen/tests/sourcemap.rs b/crates/swc_ecma_codegen/tests/sourcemap.rs index 4b256ebaddf3..ae756c65229c 100644 --- a/crates/swc_ecma_codegen/tests/sourcemap.rs +++ b/crates/swc_ecma_codegen/tests/sourcemap.rs @@ -2,13 +2,13 @@ use std::{fs::read_to_string, path::PathBuf}; use base64::prelude::{Engine, BASE64_STANDARD}; use rustc_hash::FxBuildHasher; -use sourcemap::SourceMap; use swc_allocator::api::global::HashSet; use swc_common::{comments::SingleThreadedComments, source_map::SourceMapGenConfig}; use swc_ecma_ast::EsVersion; use swc_ecma_codegen::{text_writer::WriteJs, Emitter}; use swc_ecma_parser::{lexer::Lexer, Parser, Syntax}; use swc_ecma_testing::{exec_node_js, JsExecOptions}; +use swc_sourcemap::SourceMap; static IGNORED_PASS_TESTS: &[&str] = &[ // Temporally ignored diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 7f4b1ecb1108..0a42f8274198 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -52,7 +52,7 @@ swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_vis [dev-dependencies] par-core = { workspace = true, features = ["chili"] } pretty_assertions = { workspace = true } -sourcemap = { workspace = true } +swc_sourcemap = { workspace = true } tempfile = { workspace = true } swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 5b4931d3a3ad..8588532e7f9f 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -12,15 +12,15 @@ version = "18.0.0" bench = false [dependencies] -ansi_term = { workspace = true } -anyhow = { workspace = true } -base64 = { workspace = true } -hex = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -sha2 = { workspace = true } -sourcemap = { workspace = true } -tempfile = { workspace = true } +ansi_term = { workspace = true } +anyhow = { workspace = true } +base64 = { workspace = true } +hex = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +sha2 = { workspace = true } +swc_sourcemap = { workspace = true } +tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_common = { version = "11.1.3", path = "../swc_common", features = [ diff --git a/crates/swc_ecma_transforms_testing/src/lib.rs b/crates/swc_ecma_transforms_testing/src/lib.rs index 4f4a5ce5cfa1..407bac688e1f 100644 --- a/crates/swc_ecma_transforms_testing/src/lib.rs +++ b/crates/swc_ecma_transforms_testing/src/lib.rs @@ -1007,7 +1007,7 @@ fn test_fixture_inner<'a>( } /// Creates a url for https://evanw.github.io/source-map-visualization/ -fn visualizer_url(code: &str, map: &sourcemap::SourceMap) -> String { +fn visualizer_url(code: &str, map: &swc_sourcemap::SourceMap) -> String { let map = { let mut buf = Vec::new(); map.to_writer(&mut buf).unwrap(); diff --git a/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock index 36ccae83d3d2..b87b91b369b2 100644 --- a/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/css-plugins/swc_noop_plugin/Cargo.lock @@ -162,9 +162,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-str" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "rkyv", @@ -237,9 +237,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "compact_str" @@ -1302,24 +1302,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1407,10 +1389,10 @@ dependencies = [ "rustc-hash", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "termcolor", "tracing", @@ -1492,12 +1474,12 @@ dependencies = [ "rustc-hash", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -1602,7 +1584,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "sourcemap", "swc_allocator", "swc_common", "swc_ecma_ast", @@ -1612,6 +1593,7 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -1719,6 +1701,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_trace_macro" version = "2.0.1" @@ -1738,9 +1739,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" dependencies = [ "proc-macro2", "quote", @@ -1827,7 +1828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -2020,9 +2021,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "url" diff --git a/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock index 5c8ffc548cf6..586bbfd4f29c 100644 --- a/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/issue_6404/Cargo.lock @@ -162,9 +162,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-str" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "rkyv", @@ -237,9 +237,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "compact_str" @@ -1302,24 +1302,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1407,10 +1389,10 @@ dependencies = [ "rustc-hash", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "termcolor", "tracing", @@ -1472,12 +1454,12 @@ dependencies = [ "rustc-hash", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -1598,7 +1580,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "sourcemap", "swc_allocator", "swc_common", "swc_ecma_ast", @@ -1608,6 +1589,7 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -1715,6 +1697,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_trace_macro" version = "2.0.1" @@ -1746,9 +1747,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" dependencies = [ "proc-macro2", "quote", @@ -1835,7 +1836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -2028,9 +2029,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "url" diff --git a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock index 4f94cc89f33d..92fc53605e56 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.lock @@ -162,9 +162,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-str" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "rkyv", @@ -237,9 +237,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "compact_str" @@ -1302,24 +1302,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1407,10 +1389,10 @@ dependencies = [ "rustc-hash", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "termcolor", "tracing", @@ -1472,12 +1454,12 @@ dependencies = [ "rustc-hash", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -1598,7 +1580,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "sourcemap", "swc_allocator", "swc_common", "swc_ecma_ast", @@ -1608,6 +1589,7 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -1716,6 +1698,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_trace_macro" version = "2.0.1" @@ -1747,9 +1748,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" dependencies = [ "proc-macro2", "quote", @@ -1836,7 +1837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -2029,9 +2030,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "url" diff --git a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock index 87799fbeded0..118c57e690cd 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock +++ b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.lock @@ -162,9 +162,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-str" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d88f0bfe9e7ccec43a0d2aa5bc1d932cc1ddb004601f31b859da7dc71ecc0" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" dependencies = [ "bytes", "rkyv", @@ -237,9 +237,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "compact_str" @@ -1302,24 +1302,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "sourcemap" -version = "9.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22afbcb92ce02d23815b9795523c005cb9d3c214f8b7a66318541c240ea7935" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1407,10 +1389,10 @@ dependencies = [ "rustc-hash", "serde", "siphasher 0.3.11", - "sourcemap", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "termcolor", "tracing", @@ -1471,12 +1453,12 @@ dependencies = [ "rustc-hash", "ryu-js", "serde", - "sourcemap", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -1581,7 +1563,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "sourcemap", "swc_allocator", "swc_common", "swc_ecma_ast", @@ -1591,6 +1572,7 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_sourcemap", "tempfile", "testing", ] @@ -1698,6 +1680,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_trace_macro" version = "2.0.1" @@ -1729,9 +1730,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "f6397daf94fa90f058bd0fd88429dd9e5738999cca8d701813c80723add80462" dependencies = [ "proc-macro2", "quote", @@ -1818,7 +1819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] @@ -2011,9 +2012,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "url" From c96fa238168ce6418781b6c6c14aea7de832d67c Mon Sep 17 00:00:00 2001 From: bohan Date: Tue, 10 Jun 2025 23:57:38 +0800 Subject: [PATCH 077/209] refactor(es/parser): Remove `cur!(false)` macro (#10583) --- .../swc_ecma_lexer/src/common/parser/expr.rs | 16 +++++++-------- .../swc_ecma_lexer/src/common/parser/ident.rs | 2 +- .../swc_ecma_lexer/src/common/parser/jsx.rs | 4 ++-- .../src/common/parser/macros.rs | 17 ++-------------- .../swc_ecma_lexer/src/common/parser/mod.rs | 15 +++++++++++--- .../src/common/parser/module_item.rs | 9 +++++---- .../swc_ecma_lexer/src/common/parser/stmt.rs | 11 ++++++---- .../src/common/parser/typescript.rs | 20 ++++++++++--------- 8 files changed, 48 insertions(+), 46 deletions(-) diff --git a/crates/swc_ecma_lexer/src/common/parser/expr.rs b/crates/swc_ecma_lexer/src/common/parser/expr.rs index d61d6885e23f..df1e53d95949 100644 --- a/crates/swc_ecma_lexer/src/common/parser/expr.rs +++ b/crates/swc_ecma_lexer/src/common/parser/expr.rs @@ -567,7 +567,7 @@ fn parse_subscript<'a, P: Parser<'a>>( no_computed_member: bool, ) -> PResult<(Box, bool)> { trace_cur!(p, parse_subscript); - let _ = cur!(p, false); + p.input_mut().cur(); if p.input().syntax().typescript() { if !p.input_mut().had_line_break_before_cur() && p.input_mut().is(&P::Token::BANG) { @@ -1312,7 +1312,7 @@ fn parse_bin_op_recursively_inner<'a, P: Parser<'a>>( let expr = left; let node = if peek!(p).is_some_and(|cur| cur.is_const()) { p.bump(); // as - let _ = cur!(p, false); + p.input_mut().cur(); p.bump(); // const TsConstAssertion { span: p.span(start), @@ -1352,9 +1352,9 @@ fn parse_bin_op_recursively_inner<'a, P: Parser<'a>>( let ctx = p.ctx(); // Return left on eof - let word = match cur!(p, false) { - Ok(cur) => cur, - Err(..) => return Ok((left, None)), + let word = match p.input_mut().cur() { + Some(cur) => cur, + None => return Ok((left, None)), }; let op = if word.is_in() && ctx.contains(Context::IncludeInExpr) { op!("in") @@ -1742,7 +1742,7 @@ pub fn parse_lhs_expr<'a, P: Parser<'a>>(p: &mut P) -> PResult> { expect!(p, &P::Token::LPAREN); } debug_assert!( - !cur!(p, false).is_ok_and(|cur| cur.is_lparen()), + !p.input_mut().cur().is_some_and(|cur| cur.is_lparen()), "parse_new_expr() should eat paren if it exists" ); return Ok(NewExpr { type_args, ..ne }.into()); @@ -1857,7 +1857,7 @@ fn parse_args_or_pats_inner<'a, P: Parser<'a>>( } else { let mut expr = parse_bin_expr(p)?; - if cur!(p, false).is_ok_and(|t| t.is_assign_op()) { + if p.input_mut().cur().is_some_and(|t| t.is_assign_op()) { expr = finish_assignment_expr(p, start, expr)? } @@ -1876,7 +1876,7 @@ fn parse_args_or_pats_inner<'a, P: Parser<'a>>( peek.is_comma() || peek.is_equal() || peek.is_rparen() || peek.is_colon() }) { p.assert_and_bump(&P::Token::QUESTION)?; - let _ = cur!(p, false); + p.input_mut().cur(); if arg.spread.is_some() { p.emit_err(p.input().prev_span(), SyntaxError::TS1047); } diff --git a/crates/swc_ecma_lexer/src/common/parser/ident.rs b/crates/swc_ecma_lexer/src/common/parser/ident.rs index 6a1c5ca8f233..142cb10b8c30 100644 --- a/crates/swc_ecma_lexer/src/common/parser/ident.rs +++ b/crates/swc_ecma_lexer/src/common/parser/ident.rs @@ -11,7 +11,7 @@ use crate::{ // https://tc39.es/ecma262/#prod-ModuleExportName pub fn parse_module_export_name<'a, P: Parser<'a>>(p: &mut P) -> PResult { - let Ok(cur) = cur!(p, false) else { + let Some(cur) = p.input_mut().cur() else { unexpected!(p, "identifier or string"); }; let module_export_name = if cur.is_str() { diff --git a/crates/swc_ecma_lexer/src/common/parser/jsx.rs b/crates/swc_ecma_lexer/src/common/parser/jsx.rs index 6c51fbe5f0ae..24a61125bbf4 100644 --- a/crates/swc_ecma_lexer/src/common/parser/jsx.rs +++ b/crates/swc_ecma_lexer/src/common/parser/jsx.rs @@ -131,7 +131,7 @@ fn parse_jsx_empty_expr<'a>(p: &mut impl Parser<'a>) -> JSXEmptyExpr { pub fn parse_jsx_text<'a>(p: &mut impl Parser<'a>) -> JSXText { debug_assert!(p.input().syntax().jsx()); - debug_assert!(cur!(p, false).is_ok_and(|t| t.is_jsx_text())); + debug_assert!(p.input_mut().cur().is_some_and(|t| t.is_jsx_text())); let token = p.bump(); let span = p.input().prev_span(); let (value, raw) = token.take_jsx_text(p.input_mut()); @@ -245,7 +245,7 @@ fn parse_jsx_opening_element_at<'a, P: Parser<'a>>( pub fn parse_jsx_attrs<'a, P: Parser<'a>>(p: &mut P) -> PResult> { let mut attrs = Vec::with_capacity(8); - while cur!(p, false).is_ok() { + while p.input_mut().cur().is_some() { trace_cur!(p, parse_jsx_opening__attrs_loop); if p.input_mut() diff --git a/crates/swc_ecma_lexer/src/common/parser/macros.rs b/crates/swc_ecma_lexer/src/common/parser/macros.rs index 83f641d3ed89..f9740a9f9360 100644 --- a/crates/swc_ecma_lexer/src/common/parser/macros.rs +++ b/crates/swc_ecma_lexer/src/common/parser/macros.rs @@ -1,18 +1,5 @@ /// cur!($parser, required:bool) macro_rules! cur { - ($p:expr, false) => {{ - match $p.input_mut().cur() { - Some(c) => Ok(c), - None => { - let pos = $p.input().end_pos(); - let last = Span::new(pos, pos); - Err(crate::error::Error::new( - last, - crate::error::SyntaxError::Eof, - )) - } - } - }}; ($p:expr, true) => {{ match $p.input_mut().cur() { Some(c) => { @@ -90,7 +77,7 @@ macro_rules! peek { $p.input().knows_cur(), "parser should not call peek() without knowing current token. Current token is {:?}", - cur!($p, false), + $p.input_mut().cur(), ); $p.input_mut().peek() }}; @@ -121,7 +108,7 @@ macro_rules! debug_tracing { /// Returns true on eof. macro_rules! eof { ($p:expr) => { - cur!($p, false).is_err() + $p.input_mut().cur().is_none() }; } diff --git a/crates/swc_ecma_lexer/src/common/parser/mod.rs b/crates/swc_ecma_lexer/src/common/parser/mod.rs index b822846d3461..66e099f341f2 100644 --- a/crates/swc_ecma_lexer/src/common/parser/mod.rs +++ b/crates/swc_ecma_lexer/src/common/parser/mod.rs @@ -207,7 +207,7 @@ pub trait Parser<'a>: Sized + Clone { fn eat_general_semi(&mut self) -> bool { if cfg!(feature = "debug") { - tracing::trace!("eat(';'): cur={:?}", cur!(self, false)); + tracing::trace!("eat(';'): cur={:?}", self.input_mut().cur()); } let Some(cur) = self.input_mut().cur() else { return true; @@ -472,11 +472,20 @@ pub trait Parser<'a>: Sized + Clone { } pub fn parse_shebang<'a>(p: &mut impl Parser<'a>) -> PResult> { - let cur = cur!(p, false); - Ok(if cur.is_ok_and(|t| t.is_shebang()) { + Ok(if p.input_mut().cur().is_some_and(|t| t.is_shebang()) { let t = p.bump(); Some(t.take_shebang(p.input_mut())) } else { None }) } + +pub fn eof_error<'a, P: Parser<'a>>(p: &mut P) -> crate::error::Error { + debug_assert!( + p.input_mut().cur().is_none(), + "Parser should not call throw_eof_error() without knowing current token" + ); + let pos = p.input().end_pos(); + let last = Span::new(pos, pos); + crate::error::Error::new(last, crate::error::SyntaxError::Eof) +} diff --git a/crates/swc_ecma_lexer/src/common/parser/module_item.rs b/crates/swc_ecma_lexer/src/common/parser/module_item.rs index 2e68342d92d5..6673840e25d5 100644 --- a/crates/swc_ecma_lexer/src/common/parser/module_item.rs +++ b/crates/swc_ecma_lexer/src/common/parser/module_item.rs @@ -70,7 +70,7 @@ fn parse_from_clause_and_semi<'a, P: Parser<'a>>( } else { unexpected!(p, "a string literal") }; - let _ = cur!(p, false); + p.input_mut().cur(); let with = if p.input().syntax().import_attributes() && !p.input_mut().had_line_break_before_cur() && (p.input_mut().eat(&P::Token::ASSERT) || p.input_mut().eat(&P::Token::WITH)) @@ -758,9 +758,10 @@ fn parse_import<'a, P: Parser<'a>>(p: &mut P) -> PResult { expect!(p, &P::Token::IMPORT); // Handle import 'mod.js' - if cur!(p, false).is_ok_and(|cur| cur.is_str()) { + if p.input_mut().cur().is_some_and(|cur| cur.is_str()) { let src = Box::new(parse_str_lit(p)); - let _ = cur!(p, false); + debug_assert!(p.input_mut().get_cur().is_none()); + p.input_mut().cur(); let with = if p.input().syntax().import_attributes() && !p.input_mut().had_line_break_before_cur() && (p.input_mut().eat(&P::Token::ASSERT) || p.input_mut().eat(&P::Token::WITH)) @@ -886,7 +887,7 @@ fn parse_import<'a, P: Parser<'a>>(p: &mut P) -> PResult { } }; - let _ = cur!(p, false); + p.input_mut().cur(); let with = if p.input().syntax().import_attributes() && !p.input_mut().had_line_break_before_cur() && (p.input_mut().eat(&P::Token::ASSERT) || p.input_mut().eat(&P::Token::WITH)) diff --git a/crates/swc_ecma_lexer/src/common/parser/stmt.rs b/crates/swc_ecma_lexer/src/common/parser/stmt.rs index cacaf59a7e69..9e76b4b9dc13 100644 --- a/crates/swc_ecma_lexer/src/common/parser/stmt.rs +++ b/crates/swc_ecma_lexer/src/common/parser/stmt.rs @@ -19,6 +19,7 @@ use crate::{ lexer::token::TokenFactory, parser::{ class_and_fn::{parse_async_fn_decl, parse_class_decl, parse_decorators}, + eof_error, expr::{parse_await_expr, parse_bin_op_recursively, parse_for_head_prefix}, ident::{parse_binding_ident, parse_label_ident}, pat::reparse_expr_as_pat, @@ -323,7 +324,7 @@ pub fn parse_using_decl<'a, P: Parser<'a>>( // reader = init() // is two statements - let _ = cur!(p, false); + p.input_mut().cur(); if p.input_mut().has_linebreak_between_cur_and_peeked() { return Ok(None); } @@ -1331,7 +1332,10 @@ fn parse_stmt_internal<'a, P: Parser<'a>>( } .into()) } else { - if cur!(p, false)?.is_bin_op() { + let Some(cur) = p.input_mut().cur() else { + return Err(eof_error(p)); + }; + if cur.is_bin_op() { p.emit_err(p.input().cur_span(), SyntaxError::TS1005); let expr = parse_bin_op_recursively(p, expr, 0)?; return Ok(ExprStmt { @@ -1376,8 +1380,7 @@ pub(super) fn parse_block_body<'a, P: Parser<'a>, Type: IsDirective + From ); false } else { - let c = cur!(p, false).ok(); - c != end + p.input_mut().cur() != end } } { let stmt = parse_stmt_like(p, true, &handle_import_export)?; diff --git a/crates/swc_ecma_lexer/src/common/parser/typescript.rs b/crates/swc_ecma_lexer/src/common/parser/typescript.rs index c589f26a2706..487b4bb844fe 100644 --- a/crates/swc_ecma_lexer/src/common/parser/typescript.rs +++ b/crates/swc_ecma_lexer/src/common/parser/typescript.rs @@ -7,6 +7,7 @@ use swc_ecma_ast::*; use super::{ class_and_fn::{parse_class_decl, parse_fn_block_or_expr_body, parse_fn_decl}, + eof_error, expr::{is_start_of_left_hand_side_expr, parse_new_expr}, ident::parse_maybe_private_name, is_simple_param_list::IsSimpleParameterList, @@ -129,8 +130,7 @@ where if kind == ParsingContext::EnumMembers { let expect = P::Token::COMMA; - let cur = cur!(p, false); - let cur = match cur.ok() { + let cur = match p.input_mut().cur() { Some(tok) => tok.clone().to_string(p.input()), None => "EOF".to_string(), }; @@ -324,7 +324,9 @@ where pub fn eat_any_ts_modifier<'a>(p: &mut impl Parser<'a>) -> PResult { if p.syntax().typescript() && { - let cur = cur!(p, false)?; + let Some(cur) = p.input_mut().cur() else { + return Err(eof_error(p)); + }; cur.is_public() || cur.is_protected() || cur.is_private() || cur.is_readonly() } && peek!(p).is_some_and(|t| t.is_word() || t.is_lbrace() || t.is_lbracket()) @@ -612,7 +614,7 @@ fn expect_then_parse_ts_type<'a, P: Parser<'a>>( p.in_type().parse_with(|p| { if !p.input_mut().eat(token) { - let got = format!("{:?}", cur!(p, false).ok()); + let got = format!("{:?}", p.input_mut().cur()); syntax_error!( p, p.input().cur_span(), @@ -784,7 +786,7 @@ pub fn parse_ts_type_or_type_predicate_ann<'a, P: Parser<'a>>( p.in_type().parse_with(|p| { let return_token_start = p.input_mut().cur_pos(); if !p.input_mut().eat(return_token) { - let cur = format!("{:?}", cur!(p, false).ok()); + let cur = format!("{:?}", p.input_mut().cur()); let span = p.input_mut().cur_span(); syntax_error!( p, @@ -806,7 +808,9 @@ pub fn parse_ts_type_or_type_predicate_ann<'a, P: Parser<'a>>( }; if has_type_pred_asserts { p.assert_and_bump(&P::Token::ASSERTS)?; - cur!(p, false)?; + if p.input_mut().cur().is_none() { + return Err(eof_error(p)); + } } let has_type_pred_is = p.is_ident_ref() @@ -893,7 +897,7 @@ pub(super) fn try_parse_ts_type_args<'a, P: Parser<'a>>( }) { Ok(None) } else if p.input_mut().had_line_break_before_cur() - || cur!(p, false).is_ok_and(|t| t.is_bin_op()) + || p.input_mut().cur().is_some_and(|t| t.is_bin_op()) || !is_start_of_expr(p) { Ok(Some(type_args)) @@ -2211,8 +2215,6 @@ fn parse_ts_import_type<'a, P: Parser<'a>>(p: &mut P) -> PResult { expect!(p, &P::Token::LPAREN); - let _ = cur!(p, false); - let cur = cur!(p, true); let arg = if cur.is_str() { parse_str_lit(p) From 759de2e463864d331e5528bbe60b400efb3b1f84 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Tue, 10 Jun 2025 23:59:53 +0800 Subject: [PATCH 078/209] feat(es/module): Add support for `import.meta.main` in AMD and CJS (#10596) **Related issue:** - https://github.com/nodejs/node/pull/57804 --- crates/swc_ecma_transforms_module/src/amd.rs | 9 +++++++++ crates/swc_ecma_transforms_module/src/common_js.rs | 14 ++++++++++++++ .../tests/fixture/common/import-meta/input.js | 7 ++++++- .../tests/fixture/common/import-meta/output.amd.js | 7 ++++++- .../tests/fixture/common/import-meta/output.cjs | 7 ++++++- .../tests/fixture/common/import-meta/output.umd.js | 7 ++++++- 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/crates/swc_ecma_transforms_module/src/amd.rs b/crates/swc_ecma_transforms_module/src/amd.rs index ef46ac787472..2ed8056ec5fd 100644 --- a/crates/swc_ecma_transforms_module/src/amd.rs +++ b/crates/swc_ecma_transforms_module/src/amd.rs @@ -352,6 +352,15 @@ where *n = n.take().as_call(n.span(), vec![quote_str!(".").as_arg()]); } + "main" => { + *n = BinExpr { + span: *span, + left: self.module().make_member(quote_ident!("id")).into(), + op: op!("=="), + right: quote_str!("main").into(), + } + .into(); + } _ => {} } } diff --git a/crates/swc_ecma_transforms_module/src/common_js.rs b/crates/swc_ecma_transforms_module/src/common_js.rs index 10088f6367fa..85c8219f36c4 100644 --- a/crates/swc_ecma_transforms_module/src/common_js.rs +++ b/crates/swc_ecma_transforms_module/src/common_js.rs @@ -254,6 +254,20 @@ impl VisitMut for Cjs { ) .into(); } + "main" => { + let ctxt = SyntaxContext::empty().apply_mark(self.unresolved_mark); + let require = quote_ident!(ctxt, "require"); + let require_main = require.make_member(quote_ident!("main")); + let module = quote_ident!(ctxt, "module"); + + *n = BinExpr { + span: *span, + op: op!("=="), + left: require_main.into(), + right: module.into(), + } + .into(); + } _ => {} } } diff --git a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/input.js b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/input.js index 37918ae2d6d0..47d1e7497e95 100644 --- a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/input.js +++ b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/input.js @@ -2,5 +2,10 @@ const react = import.meta.resolve("react"); const url = import.meta.url; const filename = import.meta.filename; const dirname = import.meta.dirname; +const main = import.meta.main; -console.log(react, url, filename, dirname); +console.log(react); +console.log(url); +console.log(filename); +console.log(dirname); +console.log(main); diff --git a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.amd.js b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.amd.js index 98b908eea83c..58be26aba291 100644 --- a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.amd.js +++ b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.amd.js @@ -7,5 +7,10 @@ define([ const url = new URL(module.uri, document.baseURI).href; const filename = module.uri.split("/").pop(); const dirname = require.toUrl("."); - console.log(react, url, filename, dirname); + const main = module.id == "main"; + console.log(react); + console.log(url); + console.log(filename); + console.log(dirname); + console.log(main); }); diff --git a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.cjs b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.cjs index 0b6e8acbf12f..e30832aaef1f 100644 --- a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.cjs +++ b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.cjs @@ -3,4 +3,9 @@ const react = require.resolve("react"); const url = require("url").pathToFileURL(__filename).toString(); const filename = __filename; const dirname = __dirname; -console.log(react, url, filename, dirname); +const main = require.main == module; +console.log(react); +console.log(url); +console.log(filename); +console.log(dirname); +console.log(main); diff --git a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.umd.js b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.umd.js index 3a3ae8b275e1..96e6fb463fd9 100644 --- a/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.umd.js +++ b/crates/swc_ecma_transforms_module/tests/fixture/common/import-meta/output.umd.js @@ -8,5 +8,10 @@ const url = import.meta.url; const filename = import.meta.filename; const dirname = import.meta.dirname; - console.log(react, url, filename, dirname); + const main = import.meta.main; + console.log(react); + console.log(url); + console.log(filename); + console.log(dirname); + console.log(main); }); From 6e368593807a3cc46c6d46bdf238b15e9a33d81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 10 Jun 2025 09:32:00 -0700 Subject: [PATCH 079/209] chore: Publish crates with `swc_core` `v27.0.0` --- .changeset/itchy-tables-hide.md | 6 - .changeset/sixty-pans-help.md | 6 - .changeset/smart-wombats-share.md | 6 - .changeset/soft-dolphins-divide.md | 6 - .changeset/tiny-melons-carry.md | 6 - .changeset/warm-ghosts-try.md | 5 - .changeset/weak-shirts-count.md | 6 - .changeset/wet-clouds-develop.md | 5 - CHANGELOG-CORE.md | 84 +++++++-- CHANGELOG.md | 92 +++++++--- Cargo.lock | 170 +++++++++--------- crates/binding_macros/Cargo.toml | 12 +- crates/dbg-swc/Cargo.toml | 18 +- crates/jsdoc/Cargo.toml | 10 +- crates/swc/Cargo.toml | 54 +++--- crates/swc_bundler/Cargo.toml | 34 ++-- crates/swc_cli_impl/Cargo.toml | 4 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 14 +- crates/swc_core/Cargo.toml | 82 ++++----- crates/swc_css/Cargo.toml | 20 +-- crates/swc_css_ast/Cargo.toml | 4 +- crates/swc_css_codegen/Cargo.toml | 16 +- crates/swc_css_compat/Cargo.toml | 16 +- crates/swc_css_lints/Cargo.toml | 12 +- crates/swc_css_minifier/Cargo.toml | 16 +- crates/swc_css_modules/Cargo.toml | 16 +- crates/swc_css_parser/Cargo.toml | 12 +- crates/swc_css_prefixer/Cargo.toml | 16 +- crates/swc_css_utils/Cargo.toml | 8 +- crates/swc_css_visit/Cargo.toml | 6 +- crates/swc_ecma_ast/Cargo.toml | 4 +- crates/swc_ecma_codegen/Cargo.toml | 14 +- crates/swc_ecma_compat_bugfixes/Cargo.toml | 18 +- crates/swc_ecma_compat_common/Cargo.toml | 10 +- crates/swc_ecma_compat_es2015/Cargo.toml | 20 +-- crates/swc_ecma_compat_es2016/Cargo.toml | 16 +- crates/swc_ecma_compat_es2017/Cargo.toml | 16 +- crates/swc_ecma_compat_es2018/Cargo.toml | 18 +- crates/swc_ecma_compat_es2019/Cargo.toml | 16 +- crates/swc_ecma_compat_es2020/Cargo.toml | 18 +- crates/swc_ecma_compat_es2021/Cargo.toml | 12 +- crates/swc_ecma_compat_es2022/Cargo.toml | 16 +- crates/swc_ecma_compat_es3/Cargo.toml | 16 +- crates/swc_ecma_ext_transforms/Cargo.toml | 10 +- crates/swc_ecma_lexer/Cargo.toml | 14 +- crates/swc_ecma_lints/Cargo.toml | 20 +-- crates/swc_ecma_loader/Cargo.toml | 4 +- crates/swc_ecma_minifier/Cargo.toml | 24 +-- crates/swc_ecma_parser/Cargo.toml | 16 +- crates/swc_ecma_preset_env/Cargo.toml | 18 +- crates/swc_ecma_quote/Cargo.toml | 10 +- crates/swc_ecma_quote_macros/Cargo.toml | 8 +- crates/swc_ecma_react_compiler/Cargo.toml | 12 +- crates/swc_ecma_regexp/Cargo.toml | 10 +- crates/swc_ecma_regexp_ast/Cargo.toml | 4 +- crates/swc_ecma_regexp_visit/Cargo.toml | 8 +- crates/swc_ecma_testing/Cargo.toml | 4 +- crates/swc_ecma_transforms/Cargo.toml | 32 ++-- crates/swc_ecma_transforms_base/Cargo.toml | 16 +- crates/swc_ecma_transforms_classes/Cargo.toml | 12 +- crates/swc_ecma_transforms_compat/Cargo.toml | 42 ++--- crates/swc_ecma_transforms_module/Cargo.toml | 26 +-- .../Cargo.toml | 28 +-- .../swc_ecma_transforms_proposal/Cargo.toml | 26 +-- crates/swc_ecma_transforms_react/Cargo.toml | 22 +-- crates/swc_ecma_transforms_testing/Cargo.toml | 20 +-- .../swc_ecma_transforms_typescript/Cargo.toml | 26 +-- crates/swc_ecma_usage_analyzer/Cargo.toml | 10 +- crates/swc_ecma_utils/Cargo.toml | 12 +- crates/swc_ecma_visit/Cargo.toml | 6 +- crates/swc_ecmascript/Cargo.toml | 20 +-- crates/swc_error_reporters/Cargo.toml | 4 +- crates/swc_estree_ast/Cargo.toml | 4 +- crates/swc_estree_compat/Cargo.toml | 26 +-- crates/swc_fast_ts_strip/Cargo.toml | 18 +- crates/swc_graph_analyzer/Cargo.toml | 6 +- crates/swc_html/Cargo.toml | 12 +- crates/swc_html_ast/Cargo.toml | 4 +- crates/swc_html_codegen/Cargo.toml | 16 +- crates/swc_html_minifier/Cargo.toml | 36 ++-- crates/swc_html_parser/Cargo.toml | 14 +- crates/swc_html_utils/Cargo.toml | 4 +- crates/swc_html_visit/Cargo.toml | 6 +- crates/swc_node_bundler/Cargo.toml | 24 +-- crates/swc_node_comments/Cargo.toml | 4 +- crates/swc_plugin_proxy/Cargo.toml | 6 +- crates/swc_plugin_runner/Cargo.toml | 26 +-- crates/swc_timer/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 4 +- crates/swc_typescript/Cargo.toml | 18 +- crates/swc_xml/Cargo.toml | 10 +- crates/swc_xml_ast/Cargo.toml | 4 +- crates/swc_xml_codegen/Cargo.toml | 14 +- crates/swc_xml_parser/Cargo.toml | 12 +- crates/swc_xml_visit/Cargo.toml | 6 +- crates/testing/Cargo.toml | 6 +- 97 files changed, 878 insertions(+), 826 deletions(-) delete mode 100644 .changeset/itchy-tables-hide.md delete mode 100644 .changeset/sixty-pans-help.md delete mode 100644 .changeset/smart-wombats-share.md delete mode 100644 .changeset/soft-dolphins-divide.md delete mode 100644 .changeset/tiny-melons-carry.md delete mode 100644 .changeset/warm-ghosts-try.md delete mode 100644 .changeset/weak-shirts-count.md delete mode 100644 .changeset/wet-clouds-develop.md diff --git a/.changeset/itchy-tables-hide.md b/.changeset/itchy-tables-hide.md deleted file mode 100644 index 60bb13bdd5bd..000000000000 --- a/.changeset/itchy-tables-hide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc: major -swc_ecma_transforms_typescript: patch ---- - -fix(es/typescript): Pass `native_class_properties` diff --git a/.changeset/sixty-pans-help.md b/.changeset/sixty-pans-help.md deleted file mode 100644 index ca59346b7625..000000000000 --- a/.changeset/sixty-pans-help.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_codegen: patch -swc_core: patch ---- - -Don't call `cmt.get_leading` for dummy span diff --git a/.changeset/smart-wombats-share.md b/.changeset/smart-wombats-share.md deleted file mode 100644 index 8e76d76ff54b..000000000000 --- a/.changeset/smart-wombats-share.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_ecma_transforms_typescript: patch ---- - -fix(es/typescript): Handle `export declare var` in namespace diff --git a/.changeset/soft-dolphins-divide.md b/.changeset/soft-dolphins-divide.md deleted file mode 100644 index 7992f064d0f1..000000000000 --- a/.changeset/soft-dolphins-divide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_plugin_runner: patch ---- - -chore: Update `virtual-fs` to dedupe dependencies diff --git a/.changeset/tiny-melons-carry.md b/.changeset/tiny-melons-carry.md deleted file mode 100644 index cabd3bfd48d3..000000000000 --- a/.changeset/tiny-melons-carry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_ecma_lexer: patch -swc_core: patch ---- - -fix(es/parser): disallow spread operator in JSX attribute values diff --git a/.changeset/warm-ghosts-try.md b/.changeset/warm-ghosts-try.md deleted file mode 100644 index 21c5e59a83bf..000000000000 --- a/.changeset/warm-ghosts-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -swc_common: major ---- - -refactor(swc_common): Use `BytesStr` instead of `Lrc` diff --git a/.changeset/weak-shirts-count.md b/.changeset/weak-shirts-count.md deleted file mode 100644 index 08f0f4d4e794..000000000000 --- a/.changeset/weak-shirts-count.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_core: patch -swc_typescript: patch ---- - -fix(isolated_declarations): add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports diff --git a/.changeset/wet-clouds-develop.md b/.changeset/wet-clouds-develop.md deleted file mode 100644 index 64efb5a72a64..000000000000 --- a/.changeset/wet-clouds-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -swc_common: major ---- - -refactor(common): rm Input/find diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index ed95a09b2fe4..8007c5c27ac4 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,12 +1,78 @@ # Changelog ## [unreleased] +### Bug Fixes + + + +- **(@swc/types)** Add `jsc.output.charset` ([#10567](https://github.com/swc-project/swc/issues/10567)) ([26b41e8](https://github.com/swc-project/swc/commit/26b41e86cb103fd6e9b76dcc9ed6625ef73ef9d0)) + + +- **(es/codegen)** Don't call `cmt.get_leading` for dummy span ([#10568](https://github.com/swc-project/swc/issues/10568)) ([16e204d](https://github.com/swc-project/swc/commit/16e204d3fa44acfea087e2e8929b7989894cf7bc)) + + +- **(es/parser)** Disallow spread operator(`...`) in JSX attribute values ([#10587](https://github.com/swc-project/swc/issues/10587)) ([8deba78](https://github.com/swc-project/swc/commit/8deba787bb7a210826be09ce065a7a40eef0d508)) + + +- **(es/typescript)** Pass `native_class_properties` ([#10561](https://github.com/swc-project/swc/issues/10561)) ([7e4cd9a](https://github.com/swc-project/swc/commit/7e4cd9ad4fcd28bc179c75020acb9a596d405efb)) + + +- **(es/typescript)** Handle `export declare var` in namespace ([#10579](https://github.com/swc-project/swc/issues/10579)) ([2daa17f](https://github.com/swc-project/swc/commit/2daa17f110910eae14412bbb29e8fdcf61265d13)) + + +- **(ts/isolated-dts)** Add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports ([#10577](https://github.com/swc-project/swc/issues/10577)) ([e6d4da2](https://github.com/swc-project/swc/commit/e6d4da219530744171ba46bfa44a06076080e7c2)) + +### Documentation + + + +- **(contributing)** Add a script to patch local projects ([#10565](https://github.com/swc-project/swc/issues/10565)) ([3ac0a21](https://github.com/swc-project/swc/commit/3ac0a21288c780ef1267cfeba2662bc6a825b508)) + +### Features + + + +- **(es/minifier)** Regex support for `format.comments` ([#10571](https://github.com/swc-project/swc/issues/10571)) ([e441df5](https://github.com/swc-project/swc/commit/e441df50105a99c4725277278059e9b6100a95d0)) + + +- **(es/module)** Add support for `import.meta.main` in AMD and CJS ([#10596](https://github.com/swc-project/swc/issues/10596)) ([759de2e](https://github.com/swc-project/swc/commit/759de2e463864d331e5528bbe60b400efb3b1f84)) + ### Miscellaneous Tasks - **(ecosystem-ci)** Exclude `ts-node` ([2b284e1](https://github.com/swc-project/swc/commit/2b284e1930bd9aab88d74bef0f7453bf23e2ddfe)) + +- **(plugin/runner)** Update `virtual-fs` to dedupe dependencies ([#10594](https://github.com/swc-project/swc/issues/10594)) ([de667bb](https://github.com/swc-project/swc/commit/de667bbc485efae5dcb2ba0bd0c29b90e66605d2)) + +### Refactor + + + +- **(es/lexer)** Remove unnecessary result wrap ([#10578](https://github.com/swc-project/swc/issues/10578)) ([49d15df](https://github.com/swc-project/swc/commit/49d15df1b4d2f5e07d10e10c75dcbeb637b2528d)) + + +- **(es/parser)** Extract `parse_jsx_attrs` ([#10569](https://github.com/swc-project/swc/issues/10569)) ([6492786](https://github.com/swc-project/swc/commit/649278679eab86e6cf167c170ecb49987559e26c)) + + +- **(es/parser)** Remove `cur!(false)` macro ([#10583](https://github.com/swc-project/swc/issues/10583)) ([c96fa23](https://github.com/swc-project/swc/commit/c96fa238168ce6418781b6c6c14aea7de832d67c)) + + +- **(swc_common)** Remove `Input::find` ([#10542](https://github.com/swc-project/swc/issues/10542)) ([494cef9](https://github.com/swc-project/swc/commit/494cef9982b7b9f93601ed8c0f49978a7d260259)) + + +- **(swc_common)** Use `BytesStr` instead of `Lrc` ([#10580](https://github.com/swc-project/swc/issues/10580)) ([6f00973](https://github.com/swc-project/swc/commit/6f00973ba08b19f09adb1bc9b9dd9558be27247a)) + + +- **(swc_common)** Use `swc_sourcemap` instead ([#10593](https://github.com/swc-project/swc/issues/10593)) ([8a9f609](https://github.com/swc-project/swc/commit/8a9f609061e65977b97baca95dce147fa19e92fd)) + +### Testing + + + +- **(es/parser)** Enable jsx test ([#10566](https://github.com/swc-project/swc/issues/10566)) ([72b1efe](https://github.com/swc-project/swc/commit/72b1efeaec0931b17c9a7b0acd52be8de77d07dc)) + ## [swc_core@v26.4.5] - 2025-06-05 ### Bug Fixes @@ -2490,9 +2556,6 @@ - **(ast)** Add `archive(check_bytes)` to all relevant AST types ([#9574](https://github.com/swc-project/swc/issues/9574)) ([185d6f5](https://github.com/swc-project/swc/commit/185d6f55b35f4f8323035c1199cddb9dd547f254)) -- **(cli)** Exclude non-files from get_files_list ([#9560](https://github.com/swc-project/swc/issues/9560)) ([85cc2bd](https://github.com/swc-project/swc/commit/85cc2bd79c3193cb0a8b54e4fce0efc1aa15b271)) - - - **(es/codegen)** Fix wrong sourcemap when there are new lines in tpl ([#9578](https://github.com/swc-project/swc/issues/9578)) ([cf74382](https://github.com/swc-project/swc/commit/cf74382ba0429c0d4f04428889cf53a5231fad7f)) @@ -2505,9 +2568,6 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Avoid decl name when mangle with eval ([#9546](https://github.com/swc-project/swc/issues/9546)) ([e2242c4](https://github.com/swc-project/swc/commit/e2242c41c4d648a32119eb8141dd9990b2c8c468)) - - - **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) @@ -2519,22 +2579,10 @@ - **(es/parser)** Fix failure of TS instantiation followed by satisfies ([#9583](https://github.com/swc-project/swc/issues/9583)) ([77900d8](https://github.com/swc-project/swc/commit/77900d808e2a3be2e62b74022c88a81b26a73f86)) - -- **(plugin)** Don't panic when ast byte not match ([#9562](https://github.com/swc-project/swc/issues/9562)) ([c36871a](https://github.com/swc-project/swc/commit/c36871a84826cc125c3c10a78ee2d7a435373154)) - ### Miscellaneous Tasks -- **(es)** Update `wasmer` to `v4.3.7` ([#9557](https://github.com/swc-project/swc/issues/9557)) ([190d6f0](https://github.com/swc-project/swc/commit/190d6f06d9545e4206bdb53c0f1ba2d443a5a7ab)) - - - **(es)** Add helpers ([#9586](https://github.com/swc-project/swc/issues/9586)) ([b94a0e1](https://github.com/swc-project/swc/commit/b94a0e1fd2b900b05c5f18d3d993a74ff9cc6e7d)) -### Testing - - - -- **(es)** Add tests for arm64 windows ([#9547](https://github.com/swc-project/swc/issues/9547)) ([9dd8f6f](https://github.com/swc-project/swc/commit/9dd8f6facf29817902ddf55ec0388061585cbf7d)) - diff --git a/CHANGELOG.md b/CHANGELOG.md index fec49a9af1c8..6aaf8338e966 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,75 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(@swc/types)** Add `jsc.output.charset` ([#10567](https://github.com/swc-project/swc/issues/10567)) ([26b41e8](https://github.com/swc-project/swc/commit/26b41e86cb103fd6e9b76dcc9ed6625ef73ef9d0)) + + +- **(es/codegen)** Don't call `cmt.get_leading` for dummy span ([#10568](https://github.com/swc-project/swc/issues/10568)) ([16e204d](https://github.com/swc-project/swc/commit/16e204d3fa44acfea087e2e8929b7989894cf7bc)) + + +- **(es/parser)** Disallow spread operator(`...`) in JSX attribute values ([#10587](https://github.com/swc-project/swc/issues/10587)) ([8deba78](https://github.com/swc-project/swc/commit/8deba787bb7a210826be09ce065a7a40eef0d508)) + + +- **(es/typescript)** Pass `native_class_properties` ([#10561](https://github.com/swc-project/swc/issues/10561)) ([7e4cd9a](https://github.com/swc-project/swc/commit/7e4cd9ad4fcd28bc179c75020acb9a596d405efb)) + + +- **(es/typescript)** Handle `export declare var` in namespace ([#10579](https://github.com/swc-project/swc/issues/10579)) ([2daa17f](https://github.com/swc-project/swc/commit/2daa17f110910eae14412bbb29e8fdcf61265d13)) + + +- **(ts/isolated-dts)** Add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports ([#10577](https://github.com/swc-project/swc/issues/10577)) ([e6d4da2](https://github.com/swc-project/swc/commit/e6d4da219530744171ba46bfa44a06076080e7c2)) + +### Documentation + + + +- **(contributing)** Add a script to patch local projects ([#10565](https://github.com/swc-project/swc/issues/10565)) ([3ac0a21](https://github.com/swc-project/swc/commit/3ac0a21288c780ef1267cfeba2662bc6a825b508)) + +### Features + + + +- **(es/minifier)** Regex support for `format.comments` ([#10571](https://github.com/swc-project/swc/issues/10571)) ([e441df5](https://github.com/swc-project/swc/commit/e441df50105a99c4725277278059e9b6100a95d0)) + + +- **(es/module)** Add support for `import.meta.main` in AMD and CJS ([#10596](https://github.com/swc-project/swc/issues/10596)) ([759de2e](https://github.com/swc-project/swc/commit/759de2e463864d331e5528bbe60b400efb3b1f84)) + +### Miscellaneous Tasks + + + +- **(plugin/runner)** Update `virtual-fs` to dedupe dependencies ([#10594](https://github.com/swc-project/swc/issues/10594)) ([de667bb](https://github.com/swc-project/swc/commit/de667bbc485efae5dcb2ba0bd0c29b90e66605d2)) + +### Refactor + + + +- **(es/lexer)** Remove unnecessary result wrap ([#10578](https://github.com/swc-project/swc/issues/10578)) ([49d15df](https://github.com/swc-project/swc/commit/49d15df1b4d2f5e07d10e10c75dcbeb637b2528d)) + + +- **(es/parser)** Extract `parse_jsx_attrs` ([#10569](https://github.com/swc-project/swc/issues/10569)) ([6492786](https://github.com/swc-project/swc/commit/649278679eab86e6cf167c170ecb49987559e26c)) + + +- **(es/parser)** Remove `cur!(false)` macro ([#10583](https://github.com/swc-project/swc/issues/10583)) ([c96fa23](https://github.com/swc-project/swc/commit/c96fa238168ce6418781b6c6c14aea7de832d67c)) + + +- **(swc_common)** Remove `Input::find` ([#10542](https://github.com/swc-project/swc/issues/10542)) ([494cef9](https://github.com/swc-project/swc/commit/494cef9982b7b9f93601ed8c0f49978a7d260259)) + + +- **(swc_common)** Use `BytesStr` instead of `Lrc` ([#10580](https://github.com/swc-project/swc/issues/10580)) ([6f00973](https://github.com/swc-project/swc/commit/6f00973ba08b19f09adb1bc9b9dd9558be27247a)) + + +- **(swc_common)** Use `swc_sourcemap` instead ([#10593](https://github.com/swc-project/swc/issues/10593)) ([8a9f609](https://github.com/swc-project/swc/commit/8a9f609061e65977b97baca95dce147fa19e92fd)) + +### Testing + + + +- **(es/parser)** Enable jsx test ([#10566](https://github.com/swc-project/swc/issues/10566)) ([72b1efe](https://github.com/swc-project/swc/commit/72b1efeaec0931b17c9a7b0acd52be8de77d07dc)) + ## [1.11.31] - 2025-06-05 ### Bug Fixes @@ -2041,9 +2112,6 @@ - **(ast)** Add `archive(check_bytes)` to all relevant AST types ([#9574](https://github.com/swc-project/swc/issues/9574)) ([185d6f5](https://github.com/swc-project/swc/commit/185d6f55b35f4f8323035c1199cddb9dd547f254)) -- **(cli)** Exclude non-files from get_files_list ([#9560](https://github.com/swc-project/swc/issues/9560)) ([85cc2bd](https://github.com/swc-project/swc/commit/85cc2bd79c3193cb0a8b54e4fce0efc1aa15b271)) - - - **(es/codegen)** Fix wrong sourcemap when there are new lines in tpl ([#9578](https://github.com/swc-project/swc/issues/9578)) ([cf74382](https://github.com/swc-project/swc/commit/cf74382ba0429c0d4f04428889cf53a5231fad7f)) @@ -2053,27 +2121,9 @@ - **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) -- **(es/minifier)** Avoid decl name when mangle with eval ([#9546](https://github.com/swc-project/swc/issues/9546)) ([e2242c4](https://github.com/swc-project/swc/commit/e2242c41c4d648a32119eb8141dd9990b2c8c468)) - - - **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) - **(es/module)** Rewrite import specifier in type declaration ([#9577](https://github.com/swc-project/swc/issues/9577)) ([fc0ba2a](https://github.com/swc-project/swc/commit/fc0ba2a08408b90f7d799cd5707dfa6827334085)) - -- **(plugin)** Don't panic when ast byte not match ([#9562](https://github.com/swc-project/swc/issues/9562)) ([c36871a](https://github.com/swc-project/swc/commit/c36871a84826cc125c3c10a78ee2d7a435373154)) - -### Miscellaneous Tasks - - - -- **(es)** Update `wasmer` to `v4.3.7` ([#9557](https://github.com/swc-project/swc/issues/9557)) ([190d6f0](https://github.com/swc-project/swc/commit/190d6f06d9545e4206bdb53c0f1ba2d443a5a7ab)) - -### Testing - - - -- **(es)** Add tests for arm64 windows ([#9547](https://github.com/swc-project/swc/issues/9547)) ([9dd8f6f](https://github.com/swc-project/swc/commit/9dd8f6facf29817902ddf55ec0388061585cbf7d)) - diff --git a/Cargo.lock b/Cargo.lock index 9d1a89e612b6..72065ab1d6fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "binding_macros" -version = "25.0.0" +version = "26.0.0" dependencies = [ "anyhow", "console_error_panic_hook", @@ -1214,7 +1214,7 @@ checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "dbg-swc" -version = "21.0.0" +version = "22.0.0" dependencies = [ "anyhow", "clap 3.2.25", @@ -2488,7 +2488,7 @@ dependencies = [ [[package]] name = "jsdoc" -version = "11.0.0" +version = "12.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -4716,7 +4716,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swc" -version = "25.0.0" +version = "26.0.0" dependencies = [ "ansi_term", "anyhow", @@ -4825,7 +4825,7 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "19.0.0" +version = "20.0.0" dependencies = [ "anyhow", "crc", @@ -4869,7 +4869,7 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "26.0.0" +version = "27.0.0" dependencies = [ "anyhow", "assert_cmd", @@ -4893,7 +4893,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.1.3" +version = "12.0.0" dependencies = [ "anyhow", "arbitrary", @@ -4931,7 +4931,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "22.0.1" +version = "23.0.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -4987,7 +4987,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.5" +version = "27.0.0" dependencies = [ "anyhow", "binding_macros", @@ -5044,7 +5044,7 @@ dependencies = [ [[package]] name = "swc_css" -version = "13.0.0" +version = "14.0.0" dependencies = [ "swc_css_ast", "swc_css_codegen", @@ -5059,7 +5059,7 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "11.0.0" +version = "12.0.0" dependencies = [ "bytecheck 0.8.1", "is-macro", @@ -5073,7 +5073,7 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "11.0.0" +version = "12.0.0" dependencies = [ "auto_impl", "bitflags 2.6.0", @@ -5101,7 +5101,7 @@ dependencies = [ [[package]] name = "swc_css_compat" -version = "11.0.0" +version = "12.0.0" dependencies = [ "bitflags 2.6.0", "once_cell", @@ -5119,7 +5119,7 @@ dependencies = [ [[package]] name = "swc_css_lints" -version = "12.0.0" +version = "13.0.0" dependencies = [ "anyhow", "auto_impl", @@ -5140,7 +5140,7 @@ dependencies = [ [[package]] name = "swc_css_minifier" -version = "11.0.0" +version = "12.0.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -5159,7 +5159,7 @@ dependencies = [ [[package]] name = "swc_css_modules" -version = "11.0.0" +version = "12.0.0" dependencies = [ "indexmap 2.7.1", "rustc-hash 2.1.1", @@ -5177,7 +5177,7 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "11.0.0" +version = "12.0.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -5194,7 +5194,7 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "13.0.0" +version = "14.0.0" dependencies = [ "once_cell", "preset_env_base", @@ -5213,7 +5213,7 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "11.0.0" +version = "12.0.0" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5227,7 +5227,7 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "11.0.0" +version = "12.0.0" dependencies = [ "serde", "swc_atoms", @@ -5238,7 +5238,7 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "11.0.0" +version = "12.0.0" dependencies = [ "arbitrary", "bitflags 2.6.0", @@ -5263,7 +5263,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.2.0" +version = "14.0.0" dependencies = [ "ascii", "base64 0.22.1", @@ -5303,7 +5303,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "16.0.0" +version = "17.0.0" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -5321,7 +5321,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5332,7 +5332,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "16.0.0" +version = "17.0.0" dependencies = [ "arrayvec", "indexmap 2.7.1", @@ -5359,7 +5359,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5376,7 +5376,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "15.0.0" +version = "16.0.0" dependencies = [ "serde", "swc_atoms", @@ -5394,7 +5394,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "15.0.0" +version = "16.0.0" dependencies = [ "serde", "swc_atoms", @@ -5413,7 +5413,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5429,7 +5429,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "16.0.0" +version = "17.0.0" dependencies = [ "serde", "swc_atoms", @@ -5447,7 +5447,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5461,7 +5461,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "16.0.0" +version = "17.0.0" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -5479,7 +5479,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5494,7 +5494,7 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "15.0.0" +version = "16.0.0" dependencies = [ "phf", "swc_atoms", @@ -5506,7 +5506,7 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.5" +version = "15.0.0" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -5537,7 +5537,7 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "16.0.0" +version = "17.0.0" dependencies = [ "anyhow", "auto_impl", @@ -5567,7 +5567,7 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "11.0.0" +version = "12.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5588,7 +5588,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.5" +version = "21.0.0" dependencies = [ "ansi_term", "anyhow", @@ -5636,7 +5636,7 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "14.0.2" +version = "15.0.0" dependencies = [ "arrayvec", "bitflags 2.6.0", @@ -5668,7 +5668,7 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "20.0.0" +version = "21.0.0" dependencies = [ "anyhow", "codspeed-criterion-compat", @@ -5697,7 +5697,7 @@ dependencies = [ [[package]] name = "swc_ecma_quote" -version = "14.0.0" +version = "15.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5708,7 +5708,7 @@ dependencies = [ [[package]] name = "swc_ecma_quote_macros" -version = "14.0.0" +version = "15.0.0" dependencies = [ "anyhow", "proc-macro2", @@ -5724,7 +5724,7 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.2" +version = "5.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5736,7 +5736,7 @@ dependencies = [ [[package]] name = "swc_ecma_regexp" -version = "0.0.0" +version = "0.1.0" dependencies = [ "phf", "rustc-hash 2.1.1", @@ -5754,7 +5754,7 @@ dependencies = [ [[package]] name = "swc_ecma_regexp_ast" -version = "0.0.0" +version = "0.1.0" dependencies = [ "bitflags 2.6.0", "bytecheck 0.8.1", @@ -5772,7 +5772,7 @@ version = "0.0.0" [[package]] name = "swc_ecma_regexp_visit" -version = "0.0.0" +version = "0.1.0" dependencies = [ "serde", "swc_atoms", @@ -5784,7 +5784,7 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "12.0.0" +version = "13.0.0" dependencies = [ "anyhow", "hex", @@ -5795,7 +5795,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "19.0.0" +version = "20.0.0" dependencies = [ "par-core", "pretty_assertions", @@ -5821,7 +5821,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.1.1" +version = "16.0.0" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", @@ -5850,7 +5850,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "15.0.0" +version = "16.0.0" dependencies = [ "swc_atoms", "swc_common", @@ -5862,7 +5862,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "17.0.0" +version = "18.0.0" dependencies = [ "arrayvec", "indexmap 2.7.1", @@ -5912,7 +5912,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "17.0.0" +version = "18.0.0" dependencies = [ "Inflector", "anyhow", @@ -5943,7 +5943,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "16.0.0" +version = "17.0.0" dependencies = [ "bytes-str", "dashmap 5.5.3", @@ -5974,7 +5974,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "15.0.0" +version = "16.0.0" dependencies = [ "either", "rustc-hash 2.1.1", @@ -5999,7 +5999,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "17.0.0" +version = "18.0.0" dependencies = [ "base64 0.22.1", "bytes-str", @@ -6029,7 +6029,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "18.0.0" +version = "19.0.0" dependencies = [ "ansi_term", "anyhow", @@ -6054,7 +6054,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "17.0.0" +version = "18.0.0" dependencies = [ "bytes-str", "codspeed-criterion-compat", @@ -6080,7 +6080,7 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "16.0.1" +version = "17.0.0" dependencies = [ "bitflags 2.6.0", "indexmap 2.7.1", @@ -6096,7 +6096,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.2" +version = "16.0.0" dependencies = [ "indexmap 2.7.1", "num_cpus", @@ -6119,7 +6119,7 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "11.0.0" +version = "12.0.0" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -6133,7 +6133,7 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "24.0.0" +version = "25.0.0" dependencies = [ "par-core", "swc_ecma_ast", @@ -6158,7 +6158,7 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "13.0.0" +version = "14.0.0" dependencies = [ "anyhow", "miette", @@ -6172,7 +6172,7 @@ dependencies = [ [[package]] name = "swc_estree_ast" -version = "11.0.0" +version = "12.0.0" dependencies = [ "better_scoped_tls", "serde", @@ -6183,7 +6183,7 @@ dependencies = [ [[package]] name = "swc_estree_compat" -version = "15.0.0" +version = "16.0.0" dependencies = [ "anyhow", "codspeed-criterion-compat", @@ -6209,7 +6209,7 @@ dependencies = [ [[package]] name = "swc_fast_ts_strip" -version = "19.0.0" +version = "20.0.0" dependencies = [ "anyhow", "bytes-str", @@ -6230,7 +6230,7 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" -version = "12.0.0" +version = "13.0.0" dependencies = [ "auto_impl", "petgraph 0.7.1", @@ -6242,7 +6242,7 @@ dependencies = [ [[package]] name = "swc_html" -version = "20.0.0" +version = "21.0.0" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -6253,7 +6253,7 @@ dependencies = [ [[package]] name = "swc_html_ast" -version = "11.0.0" +version = "12.0.0" dependencies = [ "bytecheck 0.8.1", "is-macro", @@ -6266,7 +6266,7 @@ dependencies = [ [[package]] name = "swc_html_codegen" -version = "11.0.0" +version = "12.0.0" dependencies = [ "auto_impl", "bitflags 2.6.0", @@ -6293,7 +6293,7 @@ dependencies = [ [[package]] name = "swc_html_minifier" -version = "20.0.0" +version = "21.0.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -6325,7 +6325,7 @@ dependencies = [ [[package]] name = "swc_html_parser" -version = "11.0.0" +version = "12.0.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -6343,7 +6343,7 @@ dependencies = [ [[package]] name = "swc_html_utils" -version = "11.0.0" +version = "12.0.0" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -6355,7 +6355,7 @@ dependencies = [ [[package]] name = "swc_html_visit" -version = "11.0.0" +version = "12.0.0" dependencies = [ "serde", "swc_atoms", @@ -6383,7 +6383,7 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "26.0.0" +version = "27.0.0" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -6413,7 +6413,7 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "11.0.0" +version = "12.0.0" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", @@ -6451,7 +6451,7 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "11.0.0" +version = "12.0.0" dependencies = [ "better_scoped_tls", "bytecheck 0.8.1", @@ -6466,7 +6466,7 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "13.0.0" +version = "14.0.0" dependencies = [ "anyhow", "codspeed-criterion-compat", @@ -6542,7 +6542,7 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "5.0.0" +version = "6.0.0" dependencies = [ "better_scoped_tls", "once_cell", @@ -6554,7 +6554,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.3" +version = "15.0.0" dependencies = [ "bitflags 2.6.0", "petgraph 0.7.1", @@ -6581,7 +6581,7 @@ dependencies = [ [[package]] name = "swc_xml" -version = "11.0.0" +version = "12.0.0" dependencies = [ "swc_xml_ast", "swc_xml_codegen", @@ -6591,7 +6591,7 @@ dependencies = [ [[package]] name = "swc_xml_ast" -version = "11.0.0" +version = "12.0.0" dependencies = [ "is-macro", "serde", @@ -6602,7 +6602,7 @@ dependencies = [ [[package]] name = "swc_xml_codegen" -version = "11.0.0" +version = "12.0.0" dependencies = [ "auto_impl", "bitflags 2.6.0", @@ -6628,7 +6628,7 @@ dependencies = [ [[package]] name = "swc_xml_parser" -version = "11.0.0" +version = "12.0.0" dependencies = [ "rustc-hash 2.1.1", "serde", @@ -6642,7 +6642,7 @@ dependencies = [ [[package]] name = "swc_xml_visit" -version = "11.0.0" +version = "12.0.0" dependencies = [ "serde", "swc_atoms", @@ -6802,7 +6802,7 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "testing" -version = "12.0.0" +version = "13.0.0" dependencies = [ "ansi_term", "cargo_metadata", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 763cdcdbe032..7eea1b97973c 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "binding_macros" repository = { workspace = true } -version = "25.0.0" +version = "26.0.0" [lib] bench = false @@ -33,11 +33,11 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports -swc = { optional = true, version = "25.0.0", path = "../swc" } -swc_common = { optional = true, version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms" } -swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } +swc = { optional = true, version = "26.0.0", path = "../swc" } +swc_common = { optional = true, version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { optional = true, version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms = { optional = true, version = "20.0.0", path = "../swc_ecma_transforms" } +swc_ecma_visit = { optional = true, version = "12.0.0", path = "../swc_ecma_visit" } # Optional deps for the wasm binding macro anyhow = { workspace = true, optional = true } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index fa06c08f1476..6a449c38ba3a 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "dbg-swc" repository = { workspace = true } -version = "21.0.0" +version = "22.0.0" [[bin]] bench = false @@ -27,17 +27,17 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", features = [ +swc_common = { version = "12.0.0", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ "concurrent", ] } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +swc_error_reporters = { version = "14.0.0", path = "../swc_error_reporters" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 40847b2a38ea..e5311ad555eb 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "jsdoc" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -20,12 +20,12 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } dashmap = { workspace = true } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 3057e9754aed..f2f316bc528a 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc" repository = { workspace = true } -version = "25.0.0" +version = "26.0.0" [lib] bench = false @@ -74,25 +74,25 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } -swc_compiler_base = { version = "22.0.1", path = "../swc_compiler_base" } +swc_compiler_base = { version = "23.0.0", path = "../swc_compiler_base" } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_ext_transforms = { version = "15.0.0", path = "../swc_ecma_ext_transforms" } -swc_ecma_lints = { version = "16.0.0", path = "../swc_ecma_lints" } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_ext_transforms = { version = "16.0.0", path = "../swc_ecma_ext_transforms" } +swc_ecma_lints = { version = "17.0.0", path = "../swc_ecma_lints" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = [ "cache", "node", "tsc", ] } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env" } -swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_preset_env = { version = "21.0.0", path = "../swc_ecma_preset_env" } +swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms", features = [ "compat", "module", "optimization", @@ -100,18 +100,18 @@ swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", fea "react", "typescript", ] } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } -swc_node_comments = { version = "11.0.0", path = "../swc_node_comments" } -swc_plugin_proxy = { version = "11.0.0", path = "../swc_plugin_proxy", optional = true } -swc_plugin_runner = { version = "13.0.0", path = "../swc_plugin_runner", optional = true, default-features = false } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_optimization = { version = "17.0.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +swc_error_reporters = { version = "14.0.0", path = "../swc_error_reporters" } +swc_node_comments = { version = "12.0.0", path = "../swc_node_comments" } +swc_plugin_proxy = { version = "12.0.0", path = "../swc_plugin_proxy", optional = true } +swc_plugin_runner = { version = "14.0.0", path = "../swc_plugin_runner", optional = true, default-features = false } swc_timer = { version = "1.0.0", path = "../swc_timer" } -swc_transform_common = { version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { version = "14.0.3", path = "../swc_typescript" } +swc_transform_common = { version = "6.0.0", path = "../swc_transform_common" } +swc_typescript = { version = "15.0.0", path = "../swc_typescript" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dependencies.tokio] @@ -141,15 +141,15 @@ walkdir = { workspace = true } codspeed-criterion-compat = { workspace = true } par-core = { workspace = true, features = ["chili"] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde-impl", ] } -swc_ecma_lints = { version = "16.0.0", path = "../swc_ecma_lints", features = [ +swc_ecma_lints = { version = "17.0.0", path = "../swc_ecma_lints", features = [ "non_critical_lints", ] } -swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } +swc_ecma_testing = { version = "13.0.0", path = "../swc_ecma_testing" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[example]] name = "transform" diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 43c9e2f12230..289197c9aa25 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"] license = { workspace = true } name = "swc_bundler" repository = { workspace = true } -version = "19.0.0" +version = "20.0.0" [package.metadata.docs.rs] all-features = true @@ -39,16 +39,16 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -swc_graph_analyzer = { version = "12.0.0", path = "../swc_graph_analyzer/" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_optimization = { version = "17.0.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +swc_graph_analyzer = { version = "13.0.0", path = "../swc_graph_analyzer/" } [dev-dependencies] hex = { workspace = true } @@ -60,15 +60,15 @@ sha1 = { workspace = true } tempfile = { workspace = true } url = { workspace = true } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = [ "node", "cache", ] } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ "concurrent", ] } -swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_proposal = { version = "16.0.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { version = "18.0.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_typescript = { version = "18.0.0", path = "../swc_ecma_transforms_typescript" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index cc5db65e4680..60b2ac2be22d 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli_impl" repository = { workspace = true } -version = "26.0.0" +version = "27.0.0" [[bin]] name = "swc" @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "26.4.5", features = [ +swc_core = { version = "27.0.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 57121c15681a..5e9d7a186c59 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "11.1.3" +version = "12.0.0" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 2ab24a53e1ac..9079c1279813 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_compiler_base" repository = { workspace = true } -version = "22.0.1" +version = "23.0.0" [features] node = ["napi", "napi-derive"] @@ -25,15 +25,15 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features swc_sourcemap = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } [dependencies.napi-derive] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 69c8f5f5cca6..375fef5e8b63 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "26.4.5" +version = "27.0.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -348,57 +348,57 @@ once_cell = { workspace = true, optional = true } par-core = { workspace = true, optional = true } # swc_* dependencies -binding_macros = { optional = true, version = "25.0.0", path = "../binding_macros" } -swc = { optional = true, version = "25.0.0", path = "../swc" } +binding_macros = { optional = true, version = "26.0.0", path = "../binding_macros" } +swc = { optional = true, version = "26.0.0", path = "../swc" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } -swc_bundler = { optional = true, version = "19.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "11.1.3", path = "../swc_common" } +swc_bundler = { optional = true, version = "20.0.0", path = "../swc_bundler" } +swc_common = { optional = true, version = "12.0.0", path = "../swc_common" } swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } -swc_css_ast = { optional = true, version = "11.0.0", path = "../swc_css_ast" } -swc_css_codegen = { optional = true, version = "11.0.0", path = "../swc_css_codegen" } -swc_css_compat = { optional = true, version = "11.0.0", path = "../swc_css_compat" } -swc_css_minifier = { optional = true, version = "11.0.0", path = "../swc_css_minifier" } -swc_css_modules = { optional = true, version = "11.0.0", path = "../swc_css_modules" } -swc_css_parser = { optional = true, version = "11.0.0", path = "../swc_css_parser" } -swc_css_prefixer = { optional = true, version = "13.0.0", path = "../swc_css_prefixer" } -swc_css_utils = { optional = true, version = "11.0.0", path = "../swc_css_utils/" } -swc_css_visit = { optional = true, version = "11.0.0", path = "../swc_css_visit" } -swc_ecma_ast = { optional = true, version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { optional = true, version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_lints = { optional = true, version = "16.0.0", path = "../swc_ecma_lints" } -swc_ecma_loader = { optional = true, version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "20.0.5", path = "../swc_ecma_minifier" } -swc_ecma_parser = { optional = true, version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_preset_env = { optional = true, version = "20.0.0", path = "../swc_ecma_preset_env" } -swc_ecma_quote_macros = { optional = true, version = "14.0.0", path = "../swc_ecma_quote_macros" } -swc_ecma_react_compiler = { optional = true, version = "4.0.2", path = "../swc_ecma_react_compiler" } -swc_ecma_transforms_base = { optional = true, version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_module = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_module" } -swc_ecma_transforms_optimization = { optional = true, version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_transforms_proposal = { optional = true, version = "15.0.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_testing = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_typescript" } -swc_ecma_usage_analyzer = { optional = true, version = "16.0.1", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { optional = true, version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { optional = true, version = "11.0.0", path = "../swc_ecma_visit" } +swc_css_ast = { optional = true, version = "12.0.0", path = "../swc_css_ast" } +swc_css_codegen = { optional = true, version = "12.0.0", path = "../swc_css_codegen" } +swc_css_compat = { optional = true, version = "12.0.0", path = "../swc_css_compat" } +swc_css_minifier = { optional = true, version = "12.0.0", path = "../swc_css_minifier" } +swc_css_modules = { optional = true, version = "12.0.0", path = "../swc_css_modules" } +swc_css_parser = { optional = true, version = "12.0.0", path = "../swc_css_parser" } +swc_css_prefixer = { optional = true, version = "14.0.0", path = "../swc_css_prefixer" } +swc_css_utils = { optional = true, version = "12.0.0", path = "../swc_css_utils/" } +swc_css_visit = { optional = true, version = "12.0.0", path = "../swc_css_visit" } +swc_ecma_ast = { optional = true, version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { optional = true, version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_lints = { optional = true, version = "17.0.0", path = "../swc_ecma_lints" } +swc_ecma_loader = { optional = true, version = "12.0.0", path = "../swc_ecma_loader" } +swc_ecma_minifier = { optional = true, version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_parser = { optional = true, version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_preset_env = { optional = true, version = "21.0.0", path = "../swc_ecma_preset_env" } +swc_ecma_quote_macros = { optional = true, version = "15.0.0", path = "../swc_ecma_quote_macros" } +swc_ecma_react_compiler = { optional = true, version = "5.0.0", path = "../swc_ecma_react_compiler" } +swc_ecma_transforms_base = { optional = true, version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_module = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_module" } +swc_ecma_transforms_optimization = { optional = true, version = "17.0.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_transforms_proposal = { optional = true, version = "16.0.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_testing = { optional = true, version = "19.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { optional = true, version = "18.0.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_usage_analyzer = { optional = true, version = "17.0.0", path = "../swc_ecma_usage_analyzer" } +swc_ecma_utils = { optional = true, version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { optional = true, version = "12.0.0", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "1.2.3", path = "../swc_malloc" } -swc_node_bundler = { optional = true, version = "26.0.0", path = "../swc_node_bundler" } +swc_node_bundler = { optional = true, version = "27.0.0", path = "../swc_node_bundler" } swc_nodejs_common = { optional = true, version = "1.0.0", path = "../swc_nodejs_common" } swc_plugin = { optional = true, version = "1.0.0", path = "../swc_plugin" } swc_plugin_macro = { optional = true, version = "1.1.0", path = "../swc_plugin_macro" } -swc_plugin_proxy = { optional = true, version = "11.0.0", path = "../swc_plugin_proxy" } -swc_plugin_runner = { optional = true, version = "13.0.0", path = "../swc_plugin_runner", default-features = false } +swc_plugin_proxy = { optional = true, version = "12.0.0", path = "../swc_plugin_proxy" } +swc_plugin_runner = { optional = true, version = "14.0.0", path = "../swc_plugin_runner", default-features = false } swc_trace_macro = { optional = true, version = "2.0.1", path = "../swc_trace_macro" } -swc_transform_common = { optional = true, version = "5.0.0", path = "../swc_transform_common" } -swc_typescript = { optional = true, version = "14.0.3", path = "../swc_typescript" } -testing = { optional = true, version = "12.0.0", path = "../testing" } +swc_transform_common = { optional = true, version = "6.0.0", path = "../swc_transform_common" } +swc_typescript = { optional = true, version = "15.0.0", path = "../swc_typescript" } +testing = { optional = true, version = "13.0.0", path = "../testing" } [build-dependencies] vergen = { workspace = true, features = ["cargo"] } [dev-dependencies] anyhow = { workspace = true } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css/Cargo.toml b/crates/swc_css/Cargo.toml index 687a6ae19be9..a3930810b08c 100644 --- a/crates/swc_css/Cargo.toml +++ b/crates/swc_css/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_css" repository = { workspace = true } -version = "13.0.0" +version = "14.0.0" [package.metadata.docs.rs] all-features = true @@ -22,12 +22,12 @@ modules = ["swc_css_modules"] prefixer = ["swc_css_prefixer"] [dependencies] -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } -swc_css_compat = { version = "11.0.0", path = "../swc_css_compat", optional = true } -swc_css_minifier = { version = "11.0.0", path = "../swc_css_minifier", optional = true } -swc_css_modules = { version = "11.0.0", path = "../swc_css_modules", optional = true } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -swc_css_prefixer = { version = "13.0.0", path = "../swc_css_prefixer", optional = true } -swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } +swc_css_compat = { version = "12.0.0", path = "../swc_css_compat", optional = true } +swc_css_minifier = { version = "12.0.0", path = "../swc_css_minifier", optional = true } +swc_css_modules = { version = "12.0.0", path = "../swc_css_modules", optional = true } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +swc_css_prefixer = { version = "14.0.0", path = "../swc_css_prefixer", optional = true } +swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 829c3d0b5cc9..83eca40f16f8 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_css_ast" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index b4c6e4a1d01c..591fa3f32d0c 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_css_codegen" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -19,15 +19,15 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } -swc_css_utils = { version = "11.0.0", path = "../swc_css_utils" } +swc_css_utils = { version = "12.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } -testing = { version = "12.0.0", path = "../testing" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index ef6186f3f734..c8786bd6e546 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json", "data/**/*.json"] license = { workspace = true } name = "swc_css_compat" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -19,12 +19,12 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } [dev-dependencies] -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index be35c7d1932c..49368a389ac7 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_css_lints" repository = { workspace = true } -version = "12.0.0" +version = "13.0.0" [lib] bench = false @@ -22,13 +22,13 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } [dev-dependencies] serde_json = { workspace = true } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index ea883da4538d..027613cf97fe 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_css_minifier" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -17,16 +17,16 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index a29eed0964e8..67a240762619 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_css_modules" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -19,15 +19,15 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } [dev-dependencies] indexmap = { workspace = true, features = ["serde"] } serde_json = { workspace = true } -swc_css_compat = { version = "11.0.0", path = "../swc_css_compat" } -testing = { version = "12.0.0", path = "../testing" } +swc_css_compat = { version = "12.0.0", path = "../swc_css_compat" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 66808bc5208c..994c4191e183 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_css_parser" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -20,20 +20,20 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } serde_json = { workspace = true } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", features = [ +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", features = [ "serde-impl", ] } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index fda5f05c5e12..43bcc2e9e110 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json", "data/**/*.json"] license = { workspace = true } name = "swc_css_prefixer" repository = { workspace = true } -version = "13.0.0" +version = "14.0.0" [lib] bench = false @@ -20,12 +20,12 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_utils = { version = "11.0.0", path = "../swc_css_utils/" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } [dev-dependencies] -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen" } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index f09057756790..ef9002ce44f3 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] license = { workspace = true } name = "swc_css_utils" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } -swc_css_visit = { version = "11.0.0", path = "../swc_css_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } +swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index e869d3f90b7a..9c303fe260f9 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_css_visit" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index fc8e701587c4..34d99dc38abc 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_ast" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 5125dc568498..6d3a793235ef 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_codegen" repository = { workspace = true } -version = "13.2.0" +version = "14.0.0" [features] # This does not enable serde for ast nodes. @@ -33,8 +33,8 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } [dev-dependencies] @@ -44,13 +44,13 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_testing = { version = "13.0.0", path = "../swc_ecma_testing" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index ce1d0f72ac95..6b37ed62e5e4 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_bugfixes" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -15,14 +15,14 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_es2015 = { version = "17.0.0", path = "../swc_ecma_compat_es2015" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 4071202c5d77..6b12e1c59b89 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -7,13 +7,13 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_common" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index a226700841e9..2646a3f2f147 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2015" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -23,18 +23,18 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "16.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index a987c15a6338..00b2d1c07fa8 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -7,22 +7,22 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2016" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index c92031728c20..6b878ed0bbb9 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2017" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,14 +17,14 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 2eadd8cf9fbd..2c745a63a8d4 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2018" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,15 +17,15 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 400b6fc732a8..033927cd430d 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2019" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,13 +17,13 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 6c56c3fddb09..c1d3895e34a6 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2020" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,15 +15,15 @@ version = "16.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_es2022 = { version = "17.0.0", path = "../swc_ecma_compat_es2022" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } tracing = { workspace = true } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index c134d15e1323..8d010079fde4 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2021" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,9 +16,9 @@ version = "15.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index 52d02d20ada5..b95c2eb3781c 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es2022" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,12 +18,12 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "16.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 7d090669e007..0d9b2f740d6b 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_compat_es3" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,13 +15,13 @@ version = "15.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index b1780cedf5f7..ee8ec89f1340 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_ext_transforms" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" [lib] bench = false @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 11ee169c2a9d..3a53d869ea55 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_lexer" repository = { workspace = true } -version = "14.0.5" +version = "15.0.0" [package.metadata.docs.rs] all-features = true @@ -40,9 +40,9 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] stacker = { version = "0.1.15", optional = true } @@ -54,12 +54,12 @@ serde_json = { workspace = true } walkdir = { workspace = true } codspeed-criterion-compat = { workspace = true } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde-impl", ] } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[example]] name = "lexer" diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 3a3e5e0efb16..705a17ada00a 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_lints" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -22,27 +22,27 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] anyhow = { workspace = true } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_testing = { version = "13.0.0", path = "../swc_ecma_testing" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } walkdir = { workspace = true } [features] diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index daf4ebe88ba8..0a5d251db53f 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_loader" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 26d07141f198..eb0554ffa1b4 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "20.0.5" +version = "21.0.0" [package.metadata.docs.rs] all-features = true @@ -54,22 +54,22 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", "regex_js", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_usage_analyzer = { version = "16.0.1", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_optimization = { version = "17.0.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_usage_analyzer = { version = "17.0.0", path = "../swc_ecma_usage_analyzer" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } [dev-dependencies] @@ -84,9 +84,9 @@ pretty_assertions = { workspace = true } walkdir = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } +swc_ecma_testing = { version = "13.0.0", path = "../swc_ecma_testing" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index b70981aa790f..e0878a37ddc6 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = { workspace = true } name = "swc_ecma_parser" repository = { workspace = true } -version = "14.0.2" +version = "15.0.0" [package.metadata.docs.rs] all-features = true @@ -40,10 +40,10 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_lexer = { version = "15.0.0", path = "../swc_ecma_lexer" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit", optional = true } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] stacker = { version = "0.1.15", optional = true } @@ -55,12 +55,12 @@ serde_json = { workspace = true } walkdir = { workspace = true } codspeed-criterion-compat = { workspace = true } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde-impl", ] } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[example]] name = "typescript" diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 6528ca620d8c..0d3ed4ae5021 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json", "data/**/*.json"] license = { workspace = true } name = "swc_ecma_preset_env" repository = { workspace = true } -version = "20.0.0" +version = "21.0.0" [lib] bench = false @@ -30,23 +30,23 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", features = [ +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms", features = [ "compat", "proposal", ] } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index a8e41d6432d6..7a8c89199e55 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -6,16 +6,16 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_quote" repository = { workspace = true } -version = "14.0.0" +version = "15.0.0" [lib] bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_quote_macros = { version = "14.0.0", path = "../swc_ecma_quote_macros" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_quote_macros = { version = "15.0.0", path = "../swc_ecma_quote_macros" } [dev-dependencies] -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index ceca0e740393..052f43196e6b 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_quote_macros" repository = { workspace = true } -version = "14.0.0" +version = "15.0.0" [lib] bench = false @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 511792dc6558..4b1e68aadf45 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_react_compiler" repository = { workspace = true } -version = "4.0.2" +version = "5.0.0" [package.metadata.docs.rs] @@ -14,10 +14,10 @@ version = "4.0.2" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index 198b2d601386..5f1577d78370 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] license = { workspace = true } name = "swc_ecma_regexp" repository = "https://github.com/swc-project/swc.git" -version = "0.0.0" +version = "0.1.0" [lib] bench = false @@ -21,10 +21,10 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_regexp_ast = { version = "0.1.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } -swc_ecma_regexp_visit = { version = "0.0.0", path = "../swc_ecma_regexp_visit" } +swc_ecma_regexp_visit = { version = "0.1.0", path = "../swc_ecma_regexp_visit" } swc_visit = { version = "2.0.0", path = "../swc_visit" } @@ -32,4 +32,4 @@ swc_visit = { version = "2.0.0", path = "../swc_visit" } serde = { workspace = true } serde_json = { workspace = true } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 7d69c04a1c57..02e366423881 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_regexp_ast" repository = { workspace = true } -version = "0.0.0" +version = "0.1.0" [lib] bench = false @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index dcc8f3e0b2e1..64bc051e619b 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_regexp_visit" repository = { workspace = true } -version = "0.0.0" +version = "0.1.0" [lib] bench = false @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_regexp_ast = { version = "0.0.0", path = "../swc_ecma_regexp_ast" } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_regexp_ast = { version = "0.1.0", path = "../swc_ecma_regexp_ast" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_testing/Cargo.toml b/crates/swc_ecma_testing/Cargo.toml index 1929ff02b875..d0aaed1cab15 100644 --- a/crates/swc_ecma_testing/Cargo.toml +++ b/crates/swc_ecma_testing/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_testing" repository = { workspace = true } -version = "12.0.0" +version = "13.0.0" [lib] bench = false @@ -17,4 +17,4 @@ hex = { workspace = true } sha2 = { workspace = true } tracing = { workspace = true } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 0a42f8274198..247632a4621e 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms" repository = { workspace = true } -version = "19.0.0" +version = "20.0.0" [package.metadata.docs.rs] all-features = true @@ -36,17 +36,17 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat", optional = true } -swc_ecma_transforms_module = { version = "17.0.0", path = "../swc_ecma_transforms_module", optional = true } -swc_ecma_transforms_optimization = { version = "16.0.0", path = "../swc_ecma_transforms_optimization", optional = true } -swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal", optional = true } -swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react", optional = true } -swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript", optional = true } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat", optional = true } +swc_ecma_transforms_module = { version = "18.0.0", path = "../swc_ecma_transforms_module", optional = true } +swc_ecma_transforms_optimization = { version = "17.0.0", path = "../swc_ecma_transforms_optimization", optional = true } +swc_ecma_transforms_proposal = { version = "16.0.0", path = "../swc_ecma_transforms_proposal", optional = true } +swc_ecma_transforms_react = { version = "18.0.0", path = "../swc_ecma_transforms_react", optional = true } +swc_ecma_transforms_typescript = { version = "18.0.0", path = "../swc_ecma_transforms_typescript", optional = true } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] @@ -55,7 +55,7 @@ pretty_assertions = { workspace = true } swc_sourcemap = { workspace = true } tempfile = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index b27c1c1dc021..1abaf2f24715 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.js"] license = { workspace = true } name = "swc_ecma_transforms_base" repository = { workspace = true } -version = "15.1.1" +version = "16.0.0" [lib] bench = false @@ -30,11 +30,11 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } @@ -42,10 +42,10 @@ criterion = { workspace = true } par-core = { workspace = true, features = ["chili"] } rayon = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index fd7c15e7a8a3..ae3038e6791a 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -6,15 +6,15 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_transforms_classes" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" [lib] bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 09b751daab95..a7326b37c03f 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_compat" repository = { workspace = true } -version = "17.0.0" +version = "18.0.0" [lib] bench = false @@ -31,31 +31,31 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_compat_bugfixes = { version = "16.0.0", path = "../swc_ecma_compat_bugfixes" } -swc_ecma_compat_common = { version = "15.0.0", path = "../swc_ecma_compat_common" } -swc_ecma_compat_es2015 = { version = "16.0.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_compat_es2016 = { version = "15.0.0", path = "../swc_ecma_compat_es2016" } -swc_ecma_compat_es2017 = { version = "15.0.0", path = "../swc_ecma_compat_es2017" } -swc_ecma_compat_es2018 = { version = "15.0.0", path = "../swc_ecma_compat_es2018" } -swc_ecma_compat_es2019 = { version = "15.0.0", path = "../swc_ecma_compat_es2019" } -swc_ecma_compat_es2020 = { version = "16.0.0", path = "../swc_ecma_compat_es2020" } -swc_ecma_compat_es2021 = { version = "15.0.0", path = "../swc_ecma_compat_es2021" } -swc_ecma_compat_es2022 = { version = "16.0.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_compat_es3 = { version = "15.0.0", path = "../swc_ecma_compat_es3" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_compat_bugfixes = { version = "17.0.0", path = "../swc_ecma_compat_bugfixes" } +swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } +swc_ecma_compat_es2015 = { version = "17.0.0", path = "../swc_ecma_compat_es2015" } +swc_ecma_compat_es2016 = { version = "16.0.0", path = "../swc_ecma_compat_es2016" } +swc_ecma_compat_es2017 = { version = "16.0.0", path = "../swc_ecma_compat_es2017" } +swc_ecma_compat_es2018 = { version = "16.0.0", path = "../swc_ecma_compat_es2018" } +swc_ecma_compat_es2019 = { version = "16.0.0", path = "../swc_ecma_compat_es2019" } +swc_ecma_compat_es2020 = { version = "17.0.0", path = "../swc_ecma_compat_es2020" } +swc_ecma_compat_es2021 = { version = "16.0.0", path = "../swc_ecma_compat_es2021" } +swc_ecma_compat_es2022 = { version = "17.0.0", path = "../swc_ecma_compat_es2022" } +swc_ecma_compat_es3 = { version = "16.0.0", path = "../swc_ecma_compat_es3" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "16.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } serde_json = { workspace = true } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 8827bb537d93..e3a236793630 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_module" repository = { workspace = true } -version = "17.0.0" +version = "18.0.0" [lib] bench = false @@ -26,28 +26,28 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = [ "file_pattern", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = [ "node", ] } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] indexmap = { workspace = true, features = ["serde"] } serde_json = { workspace = true } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", features = [ +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = [ "node", "tsc", ] } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } -testing = { version = "12.0.0", path = "../testing/" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { version = "18.0.0", path = "../swc_ecma_transforms_typescript" } +testing = { version = "13.0.0", path = "../testing/" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 88186ce91a2a..46c898942b84 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_optimization" repository = { workspace = true } -version = "16.0.0" +version = "17.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -34,23 +34,23 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_module = { version = "17.0.0", path = "../swc_ecma_transforms_module" } -swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_module = { version = "18.0.0", path = "../swc_ecma_transforms_module" } +swc_ecma_transforms_proposal = { version = "16.0.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { version = "18.0.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { version = "18.0.0", path = "../swc_ecma_transforms_typescript" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index b9bba8bbb168..743527b7bcd3 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_proposal" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" [lib] bench = false @@ -23,20 +23,20 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader", optional = true } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "15.0.0", path = "../swc_ecma_transforms_classes" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", optional = true } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "16.0.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] serde_json = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 3df89dd23afc..a88f7188ca92 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_react" repository = { workspace = true } -version = "17.0.0" +version = "18.0.0" [lib] bench = false @@ -31,17 +31,17 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen/" } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat/" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen/" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat/" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 8588532e7f9f..2c94a73ae7f0 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_transforms_testing" repository = { workspace = true } -version = "18.0.0" +version = "19.0.0" [lib] bench = false @@ -23,14 +23,14 @@ swc_sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_testing = { version = "12.0.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_testing = { version = "13.0.0", path = "../swc_ecma_testing" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 5fc74c9ee8d8..bba76225baa1 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_transforms_typescript" repository = { workspace = true } -version = "17.0.0" +version = "18.0.0" [lib] bench = false @@ -23,23 +23,23 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_react = { version = "17.0.0", path = "../swc_ecma_transforms_react" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_react = { version = "18.0.0", path = "../swc_ecma_transforms_react" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_compat = { version = "17.0.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_proposal = { version = "15.0.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_testing = { version = "18.0.0", path = "../swc_ecma_transforms_testing" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_proposal = { version = "16.0.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_testing = { version = "19.0.0", path = "../swc_ecma_transforms_testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 15cc86c5cc6b..f1ef9316275f 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_ecma_usage_analyzer" repository = { workspace = true } -version = "16.0.1" +version = "17.0.0" [package.metadata.docs.rs] all-features = true @@ -29,8 +29,8 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 1ded05dc77b3..5f0bcd482eeb 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_utils" repository = { workspace = true } -version = "15.0.2" +version = "16.0.0" [package.metadata.docs.rs] all-features = true @@ -32,14 +32,14 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [target.'cfg(not(any(target_arch = "wasm32", target_arch = "arm")))'.dependencies] stacker = { version = "0.1.15", optional = true } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 0eff0621b66a..82516a21f7c6 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecma_visit" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index c04c410b064f..9fcaba71d1a3 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_ecmascript" repository = { workspace = true } -version = "24.0.0" +version = "25.0.0" [package.metadata.docs.rs] all-features = true @@ -38,15 +38,15 @@ react = ["swc_ecma_transforms/react"] typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", optional = true } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser", optional = true, default-features = false } -swc_ecma_preset_env = { version = "20.0.0", path = "../swc_ecma_preset_env", optional = true } -swc_ecma_quote = { version = "14.0.0", path = "../swc_ecma_quote", optional = true } -swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms", optional = true } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils", optional = true } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit", optional = true } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen", optional = true } +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", optional = true } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } +swc_ecma_preset_env = { version = "21.0.0", path = "../swc_ecma_preset_env", optional = true } +swc_ecma_quote = { version = "15.0.0", path = "../swc_ecma_quote", optional = true } +swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms", optional = true } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils", optional = true } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit", optional = true } [dev-dependencies] par-core = { workspace = true, features = ["chili"] } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 8be9fea3cde4..022ab729637d 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_error_reporters" repository = { workspace = true } -version = "13.0.0" +version = "14.0.0" [lib] bench = false @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 85511ad1b3dd..39e61797dac5 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_estree_ast" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index bfe91100f4a0..d209bd58e124 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_estree_compat" repository = { workspace = true } -version = "15.0.0" +version = "16.0.0" [package.metadata.docs.rs] all-features = true @@ -25,27 +25,27 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -swc_estree_ast = { version = "11.0.0", path = "../swc_estree_ast" } -swc_node_comments = { version = "11.0.0", path = "../swc_node_comments/" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +swc_estree_ast = { version = "12.0.0", path = "../swc_estree_ast" } +swc_node_comments = { version = "12.0.0", path = "../swc_node_comments/" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc = { version = "25.0.0", path = "../swc" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms/" } -testing = { version = "12.0.0", path = "../testing" } +swc = { version = "26.0.0", path = "../swc" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms/" } +testing = { version = "13.0.0", path = "../testing" } walkdir = { workspace = true } [[bench]] diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 70244f6ba0be..d770ed48ad4c 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_fast_ts_strip" repository = { workspace = true } -version = "19.0.0" +version = "20.0.0" [dependencies] @@ -18,20 +18,20 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_lexer = { version = "14.0.5", path = "../swc_ecma_lexer" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_typescript = { version = "17.0.0", path = "../swc_ecma_transforms_typescript" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_lexer = { version = "15.0.0", path = "../swc_ecma_lexer" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_typescript = { version = "18.0.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 7218a81ae640..18bde7b95560 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_graph_analyzer" repository = { workspace = true } -version = "12.0.0" +version = "13.0.0" [lib] bench = false @@ -15,8 +15,8 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "11.1.3", path = "../swc_common/" } +swc_common = { version = "12.0.0", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_html/Cargo.toml b/crates/swc_html/Cargo.toml index 5e32ea0e9d78..ad4a2a975b4b 100644 --- a/crates/swc_html/Cargo.toml +++ b/crates/swc_html/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_html" repository = "https://github.com/swc-project/swc.git" -version = "20.0.0" +version = "21.0.0" [package.metadata.docs.rs] all-features = true @@ -22,8 +22,8 @@ bench = false minifier = ["swc_html_minifier"] [dependencies] -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } -swc_html_codegen = { version = "11.0.0", path = "../swc_html_codegen" } -swc_html_minifier = { version = "20.0.0", path = "../swc_html_minifier", optional = true, default-features = false } -swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } -swc_html_visit = { version = "11.0.0", path = "../swc_html_visit" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } +swc_html_codegen = { version = "12.0.0", path = "../swc_html_codegen" } +swc_html_minifier = { version = "21.0.0", path = "../swc_html_minifier", optional = true, default-features = false } +swc_html_parser = { version = "12.0.0", path = "../swc_html_parser" } +swc_html_visit = { version = "12.0.0", path = "../swc_html_visit" } diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 677fc1ba918c..34a6622dbf08 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_html_ast" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index c8937de844c1..e844783191a8 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_html_codegen" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -21,15 +21,15 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } -swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } +swc_html_utils = { version = "12.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } -swc_html_visit = { version = "11.0.0", path = "../swc_html_visit" } -testing = { version = "12.0.0", path = "../testing" } +swc_html_parser = { version = "12.0.0", path = "../swc_html_parser" } +swc_html_visit = { version = "12.0.0", path = "../swc_html_visit" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 07214b7942cb..6727cb0ef848 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs", "data/**/*.json"] license = { workspace = true } name = "swc_html_minifier" repository = "https://github.com/swc-project/swc.git" -version = "20.0.0" +version = "21.0.0" [lib] bench = false @@ -32,34 +32,34 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } -swc_css_codegen = { version = "11.0.0", path = "../swc_css_codegen", optional = true } -swc_css_minifier = { version = "11.0.0", path = "../swc_css_minifier", optional = true } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser", optional = true } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen", features = [ +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", optional = true } +swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen", optional = true } +swc_css_minifier = { version = "12.0.0", path = "../swc_css_minifier", optional = true } +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser", optional = true } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "20.0.5", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } -swc_html_codegen = { version = "11.0.0", path = "../swc_html_codegen" } -swc_html_parser = { version = "11.0.0", path = "../swc_html_parser" } -swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } -swc_html_visit = { version = "11.0.0", path = "../swc_html_visit" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } +swc_html_codegen = { version = "12.0.0", path = "../swc_html_codegen" } +swc_html_parser = { version = "12.0.0", path = "../swc_html_parser" } +swc_html_utils = { version = "12.0.0", path = "../swc_html_utils" } +swc_html_visit = { version = "12.0.0", path = "../swc_html_visit" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index 46414024886e..206a0e0bdc2e 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] license = { workspace = true } name = "swc_html_parser" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -22,9 +22,9 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } -swc_html_utils = { version = "11.0.0", path = "../swc_html_utils" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } +swc_html_utils = { version = "12.0.0", path = "../swc_html_utils" } [dev-dependencies] codspeed-criterion-compat = { workspace = true } @@ -32,12 +32,12 @@ criterion = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast", features = [ +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast", features = [ "serde-impl", ] } -swc_html_visit = { version = "11.0.0", path = "../swc_html_visit" } +swc_html_visit = { version = "12.0.0", path = "../swc_html_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } [[bench]] harness = false diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index bb6f647b5998..87ebe98e055a 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs", "data/**/*.json"] license = { workspace = true } name = "swc_html_utils" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 6b915a36b125..9878f600ee09 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_html_visit" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_html_ast = { version = "11.0.0", path = "../swc_html_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index e89148400d44..b0bf692b177d 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -7,7 +7,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_node_bundler" repository = { workspace = true } -version = "26.0.0" +version = "27.0.0" [lib] bench = false @@ -30,24 +30,24 @@ serde_json = { workspace = true } tracing = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } -swc = { version = "25.0.0", path = "../swc" } +swc = { version = "26.0.0", path = "../swc" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_bundler = { version = "19.0.0", path = "../swc_bundler", features = [ +swc_bundler = { version = "20.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "concurrent", ] } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms = { version = "19.0.0", path = "../swc_ecma_transforms" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } [dev-dependencies] pretty_assertions = { workspace = true } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 47f7090ab09e..2b1a5c095b6e 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_node_comments" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index f749b7db5f73..813324342f22 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -5,7 +5,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_plugin_proxy" repository = { workspace = true } -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 6bb4ec1a7c3a..73faca658615 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_plugin_runner" repository = { workspace = true } -version = "13.0.0" +version = "14.0.0" [lib] bench = false @@ -65,13 +65,13 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "concurrent", ] } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", optional = true } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", optional = true } -swc_plugin_proxy = { version = "11.0.0", path = "../swc_plugin_proxy" } -swc_transform_common = { version = "5.0.0", path = "../swc_transform_common" } +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", optional = true } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", optional = true } +swc_plugin_proxy = { version = "12.0.0", path = "../swc_plugin_proxy" } +swc_transform_common = { version = "6.0.0", path = "../swc_transform_common" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] wasmer-cache = { version = "6.0.0", optional = true } @@ -81,18 +81,18 @@ wasmer-compiler-cranelift = { version = "6.0.0", default-features = false } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_css_ast = { version = "11.0.0", path = "../swc_css_ast", features = [ +swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", features = [ "rkyv-impl", ] } -swc_css_parser = { version = "11.0.0", path = "../swc_css_parser" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast", features = [ +swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "rkyv-impl", ] } -swc_ecma_loader = { version = "11.0.0", path = "../swc_ecma_loader" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_malloc = { version = "1.2.3", path = "../swc_malloc" } -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } tokio = { workspace = true, features = ["rt"] } [[bench]] diff --git a/crates/swc_timer/Cargo.toml b/crates/swc_timer/Cargo.toml index daaaf25ed108..e8fe0fb83157 100644 --- a/crates/swc_timer/Cargo.toml +++ b/crates/swc_timer/Cargo.toml @@ -15,4 +15,4 @@ bench = false tracing = { workspace = true } [dev-dependencies] -testing = { version = "12.0.0", path = "../testing" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index 2dd8a48ce4dd..aac5811165fe 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_transform_common" repository = { workspace = true } -version = "5.0.0" +version = "6.0.0" [package.metadata.docs.rs] all-features = true @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 4858cbaf1a00..439c625a07ea 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_typescript" repository = { workspace = true } -version = "14.0.3" +version = "15.0.0" [dependencies] bitflags = {workspace = true } @@ -15,14 +15,14 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_ecma_ast = { version = "11.0.0", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "15.0.2", path = "../swc_ecma_utils" } -swc_ecma_visit = { version = "11.0.0", path = "../swc_ecma_visit" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } +swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } +swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "13.2.0", path = "../swc_ecma_codegen" } -swc_ecma_parser = { version = "14.0.2", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "15.1.1", path = "../swc_ecma_transforms_base" } -testing = { version = "12.0.0", path = "../testing" } +swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } +swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } +swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_xml/Cargo.toml b/crates/swc_xml/Cargo.toml index 75c65c5a1264..617863094c9d 100644 --- a/crates/swc_xml/Cargo.toml +++ b/crates/swc_xml/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_xml" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -19,7 +19,7 @@ version = "11.0.0" bench = false [dependencies] -swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } -swc_xml_codegen = { version = "11.0.0", path = "../swc_xml_codegen" } -swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } -swc_xml_visit = { version = "11.0.0", path = "../swc_xml_visit" } +swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } +swc_xml_codegen = { version = "12.0.0", path = "../swc_xml_codegen" } +swc_xml_parser = { version = "12.0.0", path = "../swc_xml_parser" } +swc_xml_visit = { version = "12.0.0", path = "../swc_xml_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index 9fc6df11ebd5..db3bf21a5e98 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_xml_ast" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index b3768d957179..87bb82f0b71b 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_xml_codegen" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -21,14 +21,14 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_xml_parser = { version = "11.0.0", path = "../swc_xml_parser" } -swc_xml_visit = { version = "11.0.0", path = "../swc_xml_visit" } -testing = { version = "12.0.0", path = "../testing" } +swc_xml_parser = { version = "12.0.0", path = "../swc_xml_parser" } +swc_xml_visit = { version = "12.0.0", path = "../swc_xml_visit" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index 960a2d329342..b25374a31239 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json"] license = { workspace = true } name = "swc_xml_parser" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [lib] bench = false @@ -22,15 +22,15 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } -swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } +swc_common = { version = "12.0.0", path = "../swc_common" } +swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } [dev-dependencies] serde = { workspace = true } serde_json = { workspace = true } -swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast", features = [ +swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast", features = [ "serde-impl", ] } -swc_xml_visit = { version = "11.0.0", path = "../swc_xml_visit" } -testing = { version = "12.0.0", path = "../testing" } +swc_xml_visit = { version = "12.0.0", path = "../swc_xml_visit" } +testing = { version = "13.0.0", path = "../testing" } diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index c0e20e638e4f..34bb5f94af3e 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = { workspace = true } name = "swc_xml_visit" repository = "https://github.com/swc-project/swc.git" -version = "11.0.0" +version = "12.0.0" [package.metadata.docs.rs] all-features = true @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "11.1.3", path = "../swc_common" } +swc_common = { version = "12.0.0", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } -swc_xml_ast = { version = "11.0.0", path = "../swc_xml_ast" } +swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index c589530d42b7..bcb871a4e0dc 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "testing" repository = { workspace = true } -version = "12.0.0" +version = "13.0.0" [lib] bench = false @@ -24,8 +24,8 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "11.1.3", path = "../swc_common", features = [ +swc_common = { version = "12.0.0", path = "../swc_common", features = [ "tty-emitter", ] } -swc_error_reporters = { version = "13.0.0", path = "../swc_error_reporters" } +swc_error_reporters = { version = "14.0.0", path = "../swc_error_reporters" } testing_macros = { version = "1.0.0", path = "../testing_macros" } From 70cbaee16facb4e2af948c2f9b9e84f8edaee1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 10 Jun 2025 09:46:40 -0700 Subject: [PATCH 080/209] chore: Publish crates with `swc_core` `v27.0.1` --- CHANGELOG-CORE.md | 2 +- Cargo.lock | 6 +++--- crates/dbg-swc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 4 ++-- crates/swc_config/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 6 +++--- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 4 ++-- tools/generate-code/Cargo.toml | 2 +- 19 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 8007c5c27ac4..e831902b96b3 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [swc_core@v27.0.0] - 2025-06-10 ### Bug Fixes diff --git a/Cargo.lock b/Cargo.lock index 72065ab1d6fb..ac1ae64d43a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4958,7 +4958,7 @@ dependencies = [ [[package]] name = "swc_config" -version = "3.0.0" +version = "3.1.0" dependencies = [ "anyhow", "bytes-str", @@ -4987,7 +4987,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "27.0.0" +version = "27.0.1" dependencies = [ "anyhow", "binding_macros", @@ -5588,7 +5588,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "21.0.0" +version = "21.0.1" dependencies = [ "ansi_term", "anyhow", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 6a449c38ba3a..19e66a07584c 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -33,7 +33,7 @@ swc_common = { version = "12.0.0", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index f2f316bc528a..55f227a1a454 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -79,7 +79,7 @@ swc_common = { version = "12.0.0", path = "../swc_common", features = [ "parking_lot", ] } swc_compiler_base = { version = "23.0.0", path = "../swc_compiler_base" } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } swc_ecma_ext_transforms = { version = "16.0.0", path = "../swc_ecma_ext_transforms" } @@ -89,7 +89,7 @@ swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "21.0.0", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms", features = [ diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 289197c9aa25..3c4bfcf30093 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -64,7 +64,7 @@ swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "16.0.0", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 60b2ac2be22d..45556684a4e1 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "27.0.0", features = [ +swc_core = { version = "27.0.1", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 9079c1279813..0306394ed555 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -28,10 +28,10 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common", features = [ "sourcemap", ] } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } swc_timer = { version = "1.0.0", path = "../swc_timer" } diff --git a/crates/swc_config/Cargo.toml b/crates/swc_config/Cargo.toml index b14d7407744d..70edbb7e4349 100644 --- a/crates/swc_config/Cargo.toml +++ b/crates/swc_config/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_config" repository = { workspace = true } -version = "3.0.0" +version = "3.1.0" [package.metadata.docs.rs] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 375fef5e8b63..ce233c12cc39 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "27.0.0" +version = "27.0.1" [package.metadata.docs.rs] features = [ "allocator_node", @@ -354,7 +354,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "20.0.0", path = "../swc_bundler" } swc_common = { optional = true, version = "12.0.0", path = "../swc_common" } -swc_config = { optional = true, version = "3.0.0", path = "../swc_config" } +swc_config = { optional = true, version = "3.1.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "12.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "12.0.0", path = "../swc_css_codegen" } swc_css_compat = { optional = true, version = "12.0.0", path = "../swc_css_compat" } @@ -368,7 +368,7 @@ swc_ecma_ast = { optional = true, version = "12.0.0", path = swc_ecma_codegen = { optional = true, version = "14.0.0", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "17.0.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "12.0.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "21.0.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "21.0.1", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "21.0.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "15.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 49368a389ac7..fb93ce7f449f 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -23,7 +23,7 @@ thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } +swc_config = { version = "3.1.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 2646a3f2f147..e1298c69aeca 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -24,7 +24,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 705a17ada00a..660c48e1dbf3 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -25,7 +25,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common", features = [ "concurrent", ] } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast", features = [ "serde", ] } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index eb0554ffa1b4..1468b6d3c885 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = { workspace = true } name = "swc_ecma_minifier" repository = { workspace = true } -version = "21.0.0" +version = "21.0.1" [package.metadata.docs.rs] all-features = true @@ -55,7 +55,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config", features = [ +swc_config = { version = "3.1.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", "regex_js", diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index a7326b37c03f..3c512be115a8 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "17.0.0", path = "../swc_ecma_compat_bugfixes" } swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index e3a236793630..481b7b31bc78 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -27,7 +27,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config", features = [ +swc_config = { version = "3.1.0", path = "../swc_config", features = [ "file_pattern", ] } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index a88f7188ca92..5e73485e116f 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -32,7 +32,7 @@ string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config" } +swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 9fcaba71d1a3..9e491ef64bd8 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -40,7 +40,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "21.0.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "15.0.0", path = "../swc_ecma_quote", optional = true } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 6727cb0ef848..719ba39fd3ec 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_common = { version = "12.0.0", path = "../swc_common" } -swc_config = { version = "3.0.0", path = "../swc_config", features = ["regex"] } +swc_config = { version = "3.1.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen", optional = true } swc_css_minifier = { version = "12.0.0", path = "../swc_css_minifier", optional = true } @@ -42,7 +42,7 @@ swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "21.0.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "21.0.1", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } diff --git a/tools/generate-code/Cargo.toml b/tools/generate-code/Cargo.toml index 22131de52f84..6d57a71ef3e4 100644 --- a/tools/generate-code/Cargo.toml +++ b/tools/generate-code/Cargo.toml @@ -15,6 +15,6 @@ quote = { workspace = true } syn = { workspace = true, features = ["full", "visit-mut", "extra-traits"] } walkdir = { workspace = true } -swc_config = { version = "3.0.0", path = "../../crates/swc_config", features = [ +swc_config = { version = "3.1.0", path = "../../crates/swc_config", features = [ "regex", ] } From 8b02840156376c390567eca51295952e86d748b2 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 17:09:57 +0000 Subject: [PATCH 081/209] chore: Publish `1.12.0-nightly-20250610.1` with `swc_core` `v27.0.1` --- bindings/Cargo.lock | 551 +++++++----------- bindings/Cargo.toml | 30 +- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../core/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../html/scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../scripts/npm/darwin-arm64/package.json | 2 +- .../scripts/npm/darwin-x64/package.json | 2 +- .../npm/linux-arm-gnueabihf/package.json | 2 +- .../scripts/npm/linux-arm64-gnu/package.json | 2 +- .../scripts/npm/linux-arm64-musl/package.json | 2 +- .../scripts/npm/linux-x64-gnu/package.json | 2 +- .../scripts/npm/linux-x64-musl/package.json | 2 +- .../scripts/npm/win32-arm64-msvc/package.json | 2 +- .../scripts/npm/win32-ia32-msvc/package.json | 2 +- .../scripts/npm/win32-x64-msvc/package.json | 2 +- 39 files changed, 271 insertions(+), 384 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 11ff99e568d5..5026d72030ae 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -321,9 +321,9 @@ dependencies = [ [[package]] name = "binding_macros" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c23c0cf9351aa158baee33c9dea1870a0f21393375cf00b2a6170ad7f477aa1b" +checksum = "428642de120b71cd9c9d0668e81791d4c8b646b28ce9e093cb8ba42d868aa2ef" dependencies = [ "anyhow", "console_error_panic_hook", @@ -354,13 +354,13 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap 8.0.1", "swc_compiler_base", "swc_config", "swc_core", "swc_error_reporters", "swc_malloc", "swc_nodejs_common", + "swc_sourcemap", "tracing", "tracing-chrome 0.7.2", "tracing-futures", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -394,13 +394,13 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap 8.0.1", "swc_compiler_base", "swc_config", "swc_core", "swc_ecma_react_compiler", "swc_malloc", "swc_nodejs_common", + "swc_sourcemap", "tracing", "tracing-chrome 0.7.2", "tracing-futures", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -570,6 +570,17 @@ dependencies = [ "serde", ] +[[package]] +name = "bytes-str" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ea3da8de225a11bcd5cee66b00eddcc7fd03e55bbe839fa4735d3281afb758" +dependencies = [ + "bytes", + "rkyv 0.8.10", + "serde", +] + [[package]] name = "bytesize" version = "1.3.2" @@ -605,7 +616,7 @@ checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", - "semver 1.0.26", + "semver", "serde", "serde_json", "thiserror 2.0.12", @@ -1220,17 +1231,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_builder" version = "0.12.0" @@ -1503,6 +1503,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1764,6 +1770,11 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "heapless" @@ -1773,7 +1784,7 @@ checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", "hash32", - "rustc_version 0.4.1", + "rustc_version", "spin", "stable_deref_trait", ] @@ -2756,7 +2767,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "semver 1.0.26", + "semver", "syn 2.0.100", ] @@ -3280,7 +3291,7 @@ dependencies = [ "from_variant", "once_cell", "rustc-hash 2.1.1", - "semver 1.0.26", + "semver", "serde", "st-map", "tracing", @@ -3669,6 +3680,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "regress" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ef7fa9ed0256d64a688a3747d0fef7a88851c18a5e1d57f115f38ec2e09366" +dependencies = [ + "hashbrown 0.15.2", + "memchr", +] + [[package]] name = "relative-path" version = "1.9.3" @@ -3840,22 +3861,13 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.26", + "semver", ] [[package]] @@ -4085,15 +4097,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.26" @@ -4103,12 +4106,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.219" @@ -4352,43 +4349,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sourcemap" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" -dependencies = [ - "base64-simd 0.7.0", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash 1.1.0", - "rustc_version 0.2.3", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - -[[package]] -name = "sourcemap" -version = "9.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd430118acc9fdd838557649b9b43fd0a78e3834d84a283b466f8e84720d6101" -dependencies = [ - "base64-simd 0.8.0", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "spin" version = "0.9.8" @@ -4476,12 +4436,13 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swc" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707e7a089761c5f4661765cc38b689d795d67bb0810782cdece3997cd03a6e94" +checksum = "4c8c9c0708a941ebe3aa08a2070510cbf557ae2358776ae1daa9431c8ddc49e7" dependencies = [ "anyhow", "base64", + "bytes-str", "dashmap 5.5.3", "either", "indexmap 2.8.0", @@ -4498,7 +4459,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap 9.2.0", "swc_atoms", "swc_common", "swc_compiler_base", @@ -4521,6 +4481,7 @@ dependencies = [ "swc_node_comments", "swc_plugin_proxy", "swc_plugin_runner", + "swc_sourcemap", "swc_timer", "swc_transform_common", "swc_typescript", @@ -4561,9 +4522,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f1e45e5e60780d93df3a91942e95998745d330dff2550071fcc19e87cdc173" +checksum = "7d42ad120e2ac77e72e574064791accf26f513044ce30887ef578b519edf334d" dependencies = [ "anyhow", "crc", @@ -4593,7 +4554,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.553" +version = "0.91.554" dependencies = [ "anyhow", "par-core", @@ -4602,9 +4563,9 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662c31306f388f8662a0d524a4f6c2fb32946240f06f04e1f0b3af5b4cb021ce" +checksum = "b852d55f1ff4343aa59e618e5bb0198f30e41f4ae3c32414fd887b29db94680e" dependencies = [ "anyhow", "clap", @@ -4615,8 +4576,8 @@ dependencies = [ "relative-path", "serde", "serde_json", - "sourcemap 9.2.0", "swc_core", + "swc_sourcemap", "tracing", "tracing-chrome 0.5.0", "tracing-futures", @@ -4626,14 +4587,15 @@ dependencies = [ [[package]] name = "swc_common" -version = "11.1.3" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c332906667b0fa98622f19a19e43afa5aa63b652813f80645dd0f33eca1fbb" +checksum = "84c376d04a9e50083b31962550590199c78a1c0f6b88e48ea9f46c95623074dc" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", "bytecheck 0.8.1", + "bytes-str", "cfg-if", "either", "from_variant", @@ -4646,10 +4608,10 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "siphasher 0.3.11", - "sourcemap 9.2.0", "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", + "swc_sourcemap", "swc_visit", "tracing", "unicode-width 0.1.14", @@ -4658,12 +4620,13 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "22.0.1" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993329d52eab041a7123fc25c76a54ead1488cb24114b5c7b56f0d1f9d2a210" +checksum = "e894a7fc45d1a34a8634e9a7e1a28d349e1f2525dec6ae7014835b279ddfb458" dependencies = [ "anyhow", "base64", + "bytes-str", "napi", "napi-derive", "once_cell", @@ -4671,7 +4634,6 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap 9.2.0", "swc_allocator", "swc_atoms", "swc_common", @@ -4681,26 +4643,29 @@ dependencies = [ "swc_ecma_minifier", "swc_ecma_parser", "swc_ecma_visit", + "swc_sourcemap", "swc_timer", ] [[package]] name = "swc_config" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01bfcbbdea182bdda93713aeecd997749ae324686bf7944f54d128e56be4ea9" +checksum = "03d5e0421bd73cbf44f676a461fca3d6aae167e934e36d4671e41e1548e7482d" dependencies = [ "anyhow", + "bytes-str", "dashmap 5.5.3", "globset", "indexmap 2.8.0", "once_cell", "regex", + "regress", "rustc-hash 2.1.1", "serde", "serde_json", - "sourcemap 9.2.0", "swc_config_macro", + "swc_sourcemap", ] [[package]] @@ -4717,9 +4682,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "26.4.5" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083af217e9715a7c1b020f7c9e71e4961285adb0333ee3f0e5e92962a0494a11" +checksum = "44216725e29a980e3081bb4afea465f486121af281114f6218d448aba9fc81f3" dependencies = [ "binding_macros", "swc", @@ -4745,9 +4710,9 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a434516e60c9ceebcd288c5b22f6d6d4051403e11691a97a2c6729b74d8a9aba" +checksum = "fc33cccf3606257d7335c5c52ad23abf925ab9838c01223af633a880343d0475" dependencies = [ "is-macro", "string_enum", @@ -4757,9 +4722,9 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "838abcc39836584f28b413370575636286ea36cbaa00b748f787a3a68868e0c8" +checksum = "bbe1c5d929928ae9c6a877097d48b93edd96482ce35a9b0b3c32f90742e35d38" dependencies = [ "auto_impl", "bitflags 2.9.0", @@ -4786,9 +4751,9 @@ dependencies = [ [[package]] name = "swc_css_minifier" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f809a4dff6a164664ff1553ec7ef891a69241c26a9ec788f0e59053542c9fc" +checksum = "17aa01534ea1bcbf978861c2fb9a3c48a67a7c83cf5806cace3ebc104b895ac8" dependencies = [ "rustc-hash 2.1.1", "serde", @@ -4801,9 +4766,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c5f791bcaedb06018e1f6a5c6f8a45e03149be6cc72f291dae8782d90a3654" +checksum = "4a2424ac3ab0672426f77dec5ff28d261085ee107383fd4ee2b15382ec9035b9" dependencies = [ "lexical", "serde", @@ -4814,9 +4779,9 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62b1d0dc15f9f09405f90f76cfb89900a5eaeb53486e91cdad1e8df25a1ee3d" +checksum = "f8d9b54060c4732665f352d8b1d12bf2109e32c8032a8775113c0b0762282617" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -4830,9 +4795,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf01ce7c4f3d05f82ee58692daaa0df8bee5c8115842df36780bc3ce74faa41" +checksum = "22b4a22843a1625c65e6d56fd5ba70bea30b1045eb66b5fe0faddbf76b2ad8e1" dependencies = [ "serde", "swc_atoms", @@ -4843,9 +4808,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2313360a518a37c4b9ee50030d189222927a3af902903cc70c50f6929e402dc" +checksum = "82007a7a4fb30198baf82f79244aca929d9845e16fcf897179773e4ebfed20f5" dependencies = [ "bitflags 2.9.0", "bytecheck 0.8.1", @@ -4867,9 +4832,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "13.2.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005b9e6e4cdd15c4c437d6662e4fc6dc93f60bd1c5159a1afcf6cd9eea6fb24f" +checksum = "af054998dc8a578e8232b94ef046fe06f470b6d8f7f3cbe5c37e7f71dd0e48db" dependencies = [ "ascii", "compact_str", @@ -4880,12 +4845,12 @@ dependencies = [ "rustc-hash 2.1.1", "ryu-js", "serde", - "sourcemap 9.2.0", "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_codegen_macros", + "swc_sourcemap", "tracing", ] @@ -4903,9 +4868,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842e35f35bb7732f35b885c906e93183817d76e167234ab45948bf7cfc856804" +checksum = "37da3383099064199bb6709c55dea03ac588a664e499cb21d946fdcd5f6b7f1b" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -4921,9 +4886,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5d027ec8260c28031723a13d30f12793f0f1cdb1f64133c4da32891e5058e8" +checksum = "b81039144af2228328d4a7ce4b172ae50c87eb05bd0a65d844d58d48c396bac9" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4934,9 +4899,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "073fd6f4f2fe6e5929056fab53d1ce188818b81b7008904bc7f932efa3348717" +checksum = "164dc5c628d19234ffdb5c34ec59662003c6ada0a2f3c34b1b0e878b39e0f6ca" dependencies = [ "arrayvec", "indexmap 2.8.0", @@ -4961,9 +4926,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f53fcada063eba1c278e829a8b9ec024408c5bad526171b0cb96c77bf9c533b" +checksum = "0d40a75e491688dc3037475189603fd65eca68f956f3435e0e0b50c97f172464" dependencies = [ "swc_atoms", "swc_common", @@ -4978,9 +4943,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d9a8e0589b8933b4e2de95a787b33e6ef91371c5a85f9d73c5870ac546fc6b7" +checksum = "d1e9f0b36adf031db2e07dd40f1b94a5d54697c93cdaa60668ce4ef118ce24a0" dependencies = [ "serde", "swc_atoms", @@ -4996,9 +4961,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb69df2828e6d00ca815d66fd1e609e64683abf705dcc46b195fbc7353cabe89" +checksum = "d30812107d9cd982e83522823bd2dc0cb87fca07f7d8aed26ecfbcf145dffeae" dependencies = [ "serde", "swc_atoms", @@ -5015,9 +4980,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a71abfad6a3a6093098f46e68e026d132ca15906fed912b0912f561a1cbd67f5" +checksum = "97404a23c1a6157f5770b8f33a06d776cd83265bd45c3278e0e3d8b43fd332ff" dependencies = [ "swc_atoms", "swc_common", @@ -5031,9 +4996,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b226871c16b8f4e3914c1dff2e8c93626fbc6a6bfeb3fb598f941d04890e20" +checksum = "9256d30f822964b8169f0e58546bf906dbe6140fde3caa326fa84cfec6659fb0" dependencies = [ "serde", "swc_atoms", @@ -5049,9 +5014,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f79df9e55b7c3fd29e4116fc6ef1e0155c86fe64fa6a91d357469501d574ef2" +checksum = "a7ec5141e881b26bebbd195d34b625db449686f2f7cf7e6a736bad1769381400" dependencies = [ "swc_atoms", "swc_common", @@ -5065,9 +5030,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7749e111ac8251708d6067dc20d0a9399dd7d8e3cd75a18d309830575064d1" +checksum = "03aa525d5d4722c192f5342dec43c2dce5a4e637c0d5cffbd2b33596a7865f94" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -5085,9 +5050,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb2f4d16cd2459bdae7a12a0c3258bb53d63d97c0bbff50dade9c3f324c634" +checksum = "01d2190dd56a39e728382af9e3ce4c0e60820efeadef2e8d9f42ec1add4a2149" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5100,9 +5065,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db3a2e81be5e12bf58f53a9217791e695bb79e43e6e9e0b63be602c048f0451" +checksum = "eb2f24d080ca4d51b723ffb591c8277ae9078ac3562b0f73f8ab11eea50a999a" dependencies = [ "phf", "swc_atoms", @@ -5114,9 +5079,9 @@ dependencies = [ [[package]] name = "swc_ecma_lexer" -version = "14.0.5" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb339d30ba6ee93da5d5638982faaa79586cd429fe331648abf42afa0eb0a7b5" +checksum = "52114e9b522b43636f0034f1f6e63460777bde4c3a77c830c9b5724c2afcc4fc" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5139,9 +5104,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf720184ed1f84a61a34df1c9d73be0931a8184a7ed6af67ad8f5f1bbec3881" +checksum = "c0e4b66b379dc57b4c706176e89f399aded91a984dd92f358f488d457047358a" dependencies = [ "auto_impl", "dashmap 5.5.3", @@ -5160,9 +5125,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c6a8a5ca19c9b24daf598debb4f2fa57bf21a3bd76046d9791b7f2a0b0c93" +checksum = "1c97b4a6f7b88d1d62d7021f8adec2c49c0b31b5091463d6cb7f7e4829eb5588" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5182,9 +5147,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "20.0.5" +version = "21.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf26b860e6a0e23807c70b03175d0e09082cfe256130c4759fdf9372020d3a3f" +checksum = "ce347368c82be500ee926b3eba18064f74769a277d3146a441c97f9a76a31e1c" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5220,9 +5185,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "14.0.2" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e07e6ecd47f748988902976d09c4022b1147772f88ad8a95852a20722ac7dc" +checksum = "27e4002a6385182fa389f10832e3d3aa1a7cd6d865e9492fb8d4b5c399bbdb6b" dependencies = [ "arrayvec", "bitflags 2.9.0", @@ -5246,9 +5211,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f94ea6dfa4daf55a08e210cbc213b5758b6bc92a929a3af75f478c8b0253cf" +checksum = "76d2118d089d339631ea9e74f4b9f88cc680616e816f25a547491a1716540b23" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5256,7 +5221,7 @@ dependencies = [ "once_cell", "preset_env_base", "rustc-hash 2.1.1", - "semver 1.0.26", + "semver", "serde", "serde_json", "st-map", @@ -5271,9 +5236,9 @@ dependencies = [ [[package]] name = "swc_ecma_react_compiler" -version = "4.0.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28ce240709428417c997bbaf0db62fd297f634d7225fd3e74afa89e62ba461a9" +checksum = "fc6fde528a5d75818185ea0634e538b8e23124caab606e04d87a3424f5dd8ed7" dependencies = [ "swc_atoms", "swc_common", @@ -5283,9 +5248,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f91c0e075315f1e745f65888e135ff05e3d16b6c6393c70dc9fb2c944b40fe" +checksum = "73c066ef35c6d5f4f7629f9cfc9b2ac6680ed78c8fc6955722a64e1f5340beac" dependencies = [ "par-core", "swc_atoms", @@ -5304,9 +5269,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "15.1.1" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c0a76bff24b9fa13d5451e7a664d18158849c45434d863e0553e29fb31170b" +checksum = "47c511aff4fabb634c1799a6d6fa2a5057a4f0f482e097e31aeb43939b0ad601" dependencies = [ "better_scoped_tls", "bitflags 2.9.0", @@ -5329,9 +5294,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c30a47eb83be77705a16103918db015a409a45e158a490697d8419a6f92151a" +checksum = "479b773f8a6c3d21224e3e28eadcc7f021f7d0a521f5b8730a936d74e36f2c86" dependencies = [ "swc_atoms", "swc_common", @@ -5343,9 +5308,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab71af00c78903335fc2ac0ad4308e6729b6be60e47393a36357fb20ffbb612" +checksum = "450b7c2646111adbd8d65220df230325c40ba8551e974ee8d5a7d0c17feba19d" dependencies = [ "arrayvec", "indexmap 2.8.0", @@ -5393,9 +5358,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc169d2f3e52ab9619aff70b97b6f9db7b96feec8112454df3dd7d134f34078a" +checksum = "d7ca0784c98ec4f5dfd73da4619f3afda483f5146de04f589c5f97c4c2e1450b" dependencies = [ "Inflector", "anyhow", @@ -5421,10 +5386,11 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e184bf675c5c9111e1b155e49fc267bc2971b732ac22d80887cc46973a782b7" +checksum = "3487748f5df174d85d5456b500c1185dc4e1857dd344e3d0190412148dfae44f" dependencies = [ + "bytes-str", "dashmap 5.5.3", "indexmap 2.8.0", "once_cell", @@ -5446,9 +5412,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21a20e2231143fe4aacecf2f1957c80bca8096ebe52f27e6e5624a49a2a385d" +checksum = "926eb7fb2b45f13e0313a0a48e54c1f3a7b650769f1c7e4420e25822cd65afa8" dependencies = [ "either", "rustc-hash 2.1.1", @@ -5466,11 +5432,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f141582d19aa9679ecfc811bc72cb8ef24290bc1e53ba208445ff5d5745f2b" +checksum = "827698a1088586bc6d67e1a239b3dca02ec4183fec1fc3bd1e0dc1f4b29c2151" dependencies = [ "base64", + "bytes-str", "dashmap 5.5.3", "indexmap 2.8.0", "once_cell", @@ -5493,10 +5460,11 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af18b9b3f38cf775b9dcf46f0fdbde542d6559e5759799263ef0f76563fcd9b" +checksum = "0eb967a6b448b2874dccd9290cccb948dff5ce82f3144cb8b6886a431e67b54d" dependencies = [ + "bytes-str", "once_cell", "rustc-hash 2.1.1", "ryu-js", @@ -5512,9 +5480,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "16.0.1" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4061a34574b9431c94c21519948ad4421d7b28479a1a78bb94b878c67d9fac9" +checksum = "bee2056c43b70955843e8f029c94037f0d509e9019e08cb6609f08ffa66b3a9c" dependencies = [ "bitflags 2.9.0", "indexmap 2.8.0", @@ -5530,9 +5498,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "15.0.2" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d2c29dbfc54e02c14975aff9d2c75ae6fff0808d860d9971a493d37870e282f" +checksum = "5a8afc858d9cd7aa2b480d55174ff9c7ee02de003ac5f9e140398206af566b0f" dependencies = [ "indexmap 2.8.0", "num_cpus", @@ -5552,9 +5520,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8227d1d2d76a9ccfd190ec06bb4a4720bf3edb9f954c69816b2bca5f5aa43887" +checksum = "0698960f28169c5eaa01127273aca31999bbbb6b1d3f2576ee5400daaa295d0a" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -5578,9 +5546,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572075b92eef780f9a13b99abcb4fbf8e6272abeed27b361632b5e3a2e8de70d" +checksum = "863dea960d5c8646125462d5b283b03a8b709879729c6713c14e413b0c7a3f8f" dependencies = [ "anyhow", "miette", @@ -5594,11 +5562,12 @@ dependencies = [ [[package]] name = "swc_fast_ts_strip" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f7061f0bfa9f1a60c3bbc2c72af7441f0dde77925284822e2a71e6dc2746a5" +checksum = "1ee25b37793d35c5988a1348c2791ba55d76235f05b2127479a7770a0c6b8261" dependencies = [ "anyhow", + "bytes-str", "serde", "swc_allocator", "swc_common", @@ -5613,9 +5582,9 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852cac708da0cd6705f4b840b2da08061d061efced10c55f41a93ae7711736a1" +checksum = "0f4ba49e7307404aec69a81efe29ad489e63d941a73d579520ecf38c16b53464" dependencies = [ "auto_impl", "petgraph 0.7.1", @@ -5626,9 +5595,9 @@ dependencies = [ [[package]] name = "swc_html" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7246397da37cfe250a88e6dc03bca27bac52388c1943844a3fbfcb7deba506ce" +checksum = "cdd67679d49d0b878371a625dd1c1d207bc002d65f9008dd69c79e170c125313" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -5638,9 +5607,9 @@ dependencies = [ [[package]] name = "swc_html_ast" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf011d422c327fe895a11748459c6b7f87a1fe2be3b8ddf88ff1b8a387bcfa0" +checksum = "fe54efa419f33bf81bd7f1601b9283ce1a27044ba16ca36944b0833a5ee1f8e4" dependencies = [ "is-macro", "serde", @@ -5651,9 +5620,9 @@ dependencies = [ [[package]] name = "swc_html_codegen" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb539cb7801958fa9830e191ea287c44763fb28f2ffd1c03f680682dbfca005" +checksum = "67e744d9214e8db01a217919e2adad0103e7318a7d09d7bd95b82e90925682b4" dependencies = [ "auto_impl", "bitflags 2.9.0", @@ -5679,9 +5648,9 @@ dependencies = [ [[package]] name = "swc_html_minifier" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09e7b1f35254c3d9fb0dc4ff10a8e5078f8d49c52be41724f144fb5a2189e1c" +checksum = "ad38d48248d1da7ad1135b835f5305196a45323df63e82459da2db2979778c18" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5709,9 +5678,9 @@ dependencies = [ [[package]] name = "swc_html_parser" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d61db194416b3bb8c3b6d83594a7879744c3c0e39cfea4857a9828ad928733a" +checksum = "6521f684a0f732587a6aa0a9f8889017174d6106fca153193d64948a77c3a705" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -5722,9 +5691,9 @@ dependencies = [ [[package]] name = "swc_html_utils" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e20f7a34bd591c5ccd3dadc03fd604de4d553375c54b5bd1908561e6d7306f" +checksum = "fcf4508a58ceda45394523b52d333880abbd67c2465b3eb4fa1724a3bff78374" dependencies = [ "once_cell", "rustc-hash 2.1.1", @@ -5736,9 +5705,9 @@ dependencies = [ [[package]] name = "swc_html_visit" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69629a92e1f71bf078506e1cc2298678d69bdc6e89e582fbaf8139d7be65310" +checksum = "13cd9510c5691def4afd04a62391c0942225fef662d7635d8182256888b83936" dependencies = [ "serde", "swc_atoms", @@ -5770,9 +5739,9 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed98d6e103babf8ace118c0dcac6b9526ccfe2c1fb3f54c7f4ea554f9b0fe53f" +checksum = "57b13c664bccef8fa0d2b3d3fb48e46f16ba7fa230cde5364c8359ade7031d1b" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5800,9 +5769,9 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75011be56778fa9d67fce20853b9a00f46484bfaef230e8098c08ad9caf8dc7" +checksum = "f210c157f234d00c17611071ac46d3789f2038342400a9f1b2676e9330984390" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", @@ -5826,9 +5795,9 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab1281343dca1fe02aa027e2dfdf77067e62506e77b651e3e9c1a4e3fa8bccf6" +checksum = "e55c2e46b9cc32e206a6f041621468717bbc5748d3321f2e99648340843d16ce" dependencies = [ "better_scoped_tls", "bytecheck 0.8.1", @@ -5843,9 +5812,9 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4802311e7168c171b047c28335603e8969e62ba4d75c0c607b53e77fbcb1a9aa" +checksum = "fc5321d6729321f0bf313339be866bcfc66ca9360ddbad32fcf2d6a278746bd3" dependencies = [ "anyhow", "enumset", @@ -5862,13 +5831,32 @@ dependencies = [ "swc_transform_common", "tracing", "vergen", - "virtual-fs 0.19.0", + "virtual-fs", "wasmer", "wasmer-cache", "wasmer-compiler-cranelift", "wasmer-wasix", ] +[[package]] +name = "swc_sourcemap" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604e837ad12213d381dea886a184e06b4e09fd502e5d1a4db9d4b7341eb85105" +dependencies = [ + "base64-simd 0.8.0", + "bitvec", + "bytes-str", + "data-encoding", + "debugid", + "if_chain", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "swc_timer" version = "1.0.0" @@ -5891,9 +5879,9 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be97f7341c59045d8ecbd5579acad8063e545d10304db086846b9dcf985c56e" +checksum = "51d2564e80c5c664914f327640288f5637b0f0acf6a340b92e0082655e558f51" dependencies = [ "better_scoped_tls", "once_cell", @@ -5905,9 +5893,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "14.0.3" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520693e220391e003179bed5d1c8e183e7673fb67a446eac8ad650493c279619" +checksum = "2715faf3905cba3600b600b49e1c2a194c110cc331255f8bacb6a7fd81fb7787" dependencies = [ "bitflags 2.9.0", "petgraph 0.7.1", @@ -6650,31 +6638,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtual-fs" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d2456ec960b74e5b0423159c70dd9796da1445de462013fe03eefd2545b631" -dependencies = [ - "async-trait", - "bytes", - "dashmap 6.1.0", - "derivative", - "dunce", - "futures", - "getrandom 0.2.15", - "indexmap 1.9.3", - "lazy_static", - "pin-project-lite", - "replace_with", - "shared-buffer", - "slab", - "thiserror 1.0.69", - "tokio", - "tracing", - "wasmer-package 0.2.0", -] - [[package]] name = "virtual-fs" version = "0.600.0" @@ -6700,8 +6663,8 @@ dependencies = [ "thiserror 1.0.69", "tokio", "tracing", - "wasmer-package 0.600.0", - "webc 9.0.0", + "wasmer-package", + "webc", ] [[package]] @@ -7060,28 +7023,6 @@ dependencies = [ "wasmer-types", ] -[[package]] -name = "wasmer-config" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d97272c1042e20957be5f7e4a42f28ae5367c32a79ae953339335a55512e3" -dependencies = [ - "anyhow", - "bytesize", - "ciborium", - "derive_builder 0.12.0", - "hex", - "indexmap 2.8.0", - "schemars", - "semver 1.0.26", - "serde", - "serde_json", - "serde_yml", - "thiserror 1.0.69", - "toml", - "url", -] - [[package]] name = "wasmer-config" version = "0.600.0" @@ -7096,7 +7037,7 @@ dependencies = [ "indexmap 2.8.0", "saffron", "schemars", - "semver 1.0.26", + "semver", "serde", "serde_json", "serde_yml", @@ -7138,39 +7079,13 @@ dependencies = [ "shared-buffer", "thiserror 1.0.69", "tracing", - "virtual-fs 0.600.0", + "virtual-fs", "virtual-net", "wasmer", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-wasix-types", ] -[[package]] -name = "wasmer-package" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98d05a5cd47f324ed784481d79351e12a02ad3289148dfa72432aa5d394634b8" -dependencies = [ - "anyhow", - "bytes", - "cfg-if", - "ciborium", - "flate2", - "insta", - "semver 1.0.26", - "serde", - "serde_json", - "sha2", - "shared-buffer", - "tar", - "tempfile", - "thiserror 1.0.69", - "toml", - "url", - "wasmer-config 0.10.0", - "webc 7.1.0", -] - [[package]] name = "wasmer-package" version = "0.600.0" @@ -7184,7 +7099,7 @@ dependencies = [ "flate2", "ignore", "insta", - "semver 1.0.26", + "semver", "serde", "serde_json", "sha2", @@ -7194,9 +7109,9 @@ dependencies = [ "thiserror 1.0.69", "toml", "url", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-types", - "webc 9.0.0", + "webc", ] [[package]] @@ -7282,7 +7197,7 @@ dependencies = [ "reqwest", "rkyv 0.8.10", "rusty_pool", - "semver 1.0.26", + "semver", "serde", "serde_derive", "serde_json", @@ -7299,17 +7214,17 @@ dependencies = [ "tracing", "url", "urlencoding", - "virtual-fs 0.600.0", + "virtual-fs", "virtual-mio", "virtual-net", "waker-fn", "wasmer", - "wasmer-config 0.600.0", + "wasmer-config", "wasmer-journal", - "wasmer-package 0.600.0", + "wasmer-package", "wasmer-types", "wasmer-wasix-types", - "webc 9.0.0", + "webc", "weezl", "windows-sys 0.59.0", "xxhash-rust", @@ -7356,7 +7271,7 @@ checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2" dependencies = [ "bitflags 2.9.0", "indexmap 2.8.0", - "semver 1.0.26", + "semver", ] [[package]] @@ -7401,34 +7316,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webc" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870aa1d988842465951a64aedb4196e71b83dedff1c4f624a8bee59ac3d85be6" -dependencies = [ - "anyhow", - "base64", - "bytes", - "cfg-if", - "ciborium", - "document-features", - "ignore", - "indexmap 2.8.0", - "leb128", - "lexical-sort", - "libc", - "once_cell", - "path-clean 1.0.1", - "rand 0.8.5", - "serde", - "serde_json", - "sha2", - "shared-buffer", - "thiserror 1.0.69", - "url", -] - [[package]] name = "webc" version = "9.0.0" diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index b2db0be37cbc..d830b74af0ce 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -36,21 +36,21 @@ resolver = "2" serde-wasm-bindgen = "0.6.5" serde_json = "1.0.120" swc_atoms = "5.0.0" - swc_cli_impl = "26.0.0" - swc_common = "11.1.3" - swc_compiler_base = "22.0.1" - swc_config = "3.0.0" - swc_core = "26.4.5" - swc_css_ast = "11.0.0" - swc_css_codegen = "11.0.0" - swc_css_minifier = "11.0.0" - swc_css_parser = "11.0.0" - swc_ecma_react_compiler = "4.0.2" - swc_error_reporters = "13.0.0" - swc_fast_ts_strip = "19.0.0" - swc_html = "20.0.0" - swc_html_ast = "11.0.0" - swc_html_minifier = "20.0.0" + swc_cli_impl = "27.0.0" + swc_common = "12.0.0" + swc_compiler_base = "23.0.0" + swc_config = "3.1.0" + swc_core = "27.0.1" + swc_css_ast = "12.0.0" + swc_css_codegen = "12.0.0" + swc_css_minifier = "12.0.0" + swc_css_parser = "12.0.0" + swc_ecma_react_compiler = "5.0.0" + swc_error_reporters = "14.0.0" + swc_fast_ts_strip = "20.0.0" + swc_html = "21.0.0" + swc_html_ast = "12.0.0" + swc_html_minifier = "21.0.0" swc_malloc = "1.2.3" swc_nodejs_common = "1.0.0" swc_sourcemap = "9.3.0" diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index e619d91d2ae9..3191203e2f37 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 66b2afd7dbd7..3635561f9e71 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 3c555a3f9de6..65a7301859ee 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.11.31" +version = "1.12.0-nightly-20250610.1" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 8f8f250aa6e4..978b45726660 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.553" +version = "0.91.554" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index 329fd9705308..1eb0bb7ddd4c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index 0680341d3882..65737392508a 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 143221eefac7..9033247ea81c 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index edfa5564c061..b822307ec5b3 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index 0c8d8247b2d3..5963e9bd6f41 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 295f2b44d593..873d7062ace7 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 39db4e0ae3d3..203d5a17d1ed 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index 895a67d36113..a827e0757afe 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index 03019b5fc647..3433198764bf 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 9f9038707ce5..9c1e347630d3 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index fecbc3d9da0a..83244dda7c08 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index 13f3ebcc3091..5d94dd21ec9d 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index 3eeb3170ebc1..cbbae588b8cb 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index 802242f669ce..b2db7cbadfa7 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index cc23c37c6880..cd3ab234648b 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 1ce5d70437ba..4d00f2c8daf7 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index ceabe4f725e3..9ccf168369bd 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index ceec27a69cf3..21aa5c8c8219 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index 41a3d61d5fc1..f57bb13d306c 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index bdd7db0e1b5f..99ee31933528 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index be89b2eb7d04..824297e8a755 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index 996c914e38c8..056b63584b75 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 51da3f524852..2dc9e440e039 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index 3e58c22de815..002eda3af3e0 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index 1364cb9071ab..ded569a38cee 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index 038825181b30..928e77ee502d 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index efa61eedef20..aebcf64d6ee9 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index c2cc9a86801e..58bd0bfa5beb 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index b40fecdeca3a..b8dfab91cfd0 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index fc0152802a91..0a40ccc59035 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index 2d49c7643814..52ed2454a7db 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index 460bcc1afcc6..25aa8d89b61e 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index a6efb8a7cd9d..51b74bf89a0d 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.11.31", + "version": "1.12.0-nightly-20250610.1", "os": [ "win32" ], From b9a9856c4f9fdbcc3c479a4676de828f1b5569bd Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 17:09:59 +0000 Subject: [PATCH 082/209] chore: Update changelog --- CHANGELOG-CORE.md | 3 --- CHANGELOG.md | 3 --- 2 files changed, 6 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index e831902b96b3..1149ba0a90e6 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -2565,9 +2565,6 @@ - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) -- **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) - - - **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aaf8338e966..e71637525310 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2118,9 +2118,6 @@ - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) -- **(es/isolated-dts)** Preserve comments ([#9572](https://github.com/swc-project/swc/issues/9572)) ([6d15d9c](https://github.com/swc-project/swc/commit/6d15d9c2eb4397b15908cda38f2e44e02d81ebc1)) - - - **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) From 0f858fd3470c5c104ab9b6ca900ea97be37c615f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 10 Jun 2025 10:17:23 -0700 Subject: [PATCH 083/209] fix: Fix bindings --- bindings/binding_html_node/src/lib.rs | 2 +- bindings/binding_minifier_node/src/minify.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/binding_html_node/src/lib.rs b/bindings/binding_html_node/src/lib.rs index c6d010072fff..8222c8bca81a 100644 --- a/bindings/binding_html_node/src/lib.rs +++ b/bindings/binding_html_node/src/lib.rs @@ -508,7 +508,7 @@ fn minify_inner( None => FileName::Anon, }; - let fm = cm.new_source_file(filename.into(), code.into()); + let fm = cm.new_source_file(filename.into(), code.to_string()); let scripting_enabled = opts.scripting_enabled; let mut errors = vec![]; diff --git a/bindings/binding_minifier_node/src/minify.rs b/bindings/binding_minifier_node/src/minify.rs index 9e7bbcde5283..f7997e86d600 100644 --- a/bindings/binding_minifier_node/src/minify.rs +++ b/bindings/binding_minifier_node/src/minify.rs @@ -227,7 +227,7 @@ fn do_work( inline_sources_content: options.inline_sources_content, source_map, source_map_names: &source_map_names, - orig: orig.as_ref(), + orig, comments: Some(&comments), emit_source_map_columns: options.emit_source_map_columns, preamble: &options.format.preamble, From 194f6ec030a528a90eaadce888f5c12527c9c5e0 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 17:24:30 +0000 Subject: [PATCH 084/209] chore: Publish `1.12.0-nightly-20250610.2` with `swc_core` `v27.0.1` --- bindings/Cargo.lock | 10 +++++----- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- packages/core/scripts/npm/darwin-arm64/package.json | 2 +- packages/core/scripts/npm/darwin-x64/package.json | 2 +- .../core/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/core/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../core/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/core/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/core/scripts/npm/linux-x64-musl/package.json | 2 +- .../core/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/core/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/core/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- packages/html/scripts/npm/darwin-arm64/package.json | 2 +- packages/html/scripts/npm/darwin-x64/package.json | 2 +- .../html/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/html/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../html/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/html/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/html/scripts/npm/linux-x64-musl/package.json | 2 +- .../html/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/html/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/html/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../minifier/scripts/npm/darwin-arm64/package.json | 2 +- packages/minifier/scripts/npm/darwin-x64/package.json | 2 +- .../scripts/npm/linux-arm-gnueabihf/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-musl/package.json | 2 +- .../minifier/scripts/npm/linux-x64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-x64-musl/package.json | 2 +- .../minifier/scripts/npm/win32-arm64-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-ia32-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-x64-msvc/package.json | 2 +- 38 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 5026d72030ae..6fbaa12424f2 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.10.5", "log", "prettyplease", "proc-macro2", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -4554,7 +4554,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.554" +version = "0.91.555" dependencies = [ "anyhow", "par-core", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 3191203e2f37..24f63e3f6363 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 3635561f9e71..cec6f1eb49dc 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 65a7301859ee..631541fae7a4 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.1" +version = "1.12.0-nightly-20250610.2" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 978b45726660..41ead344311e 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.554" +version = "0.91.555" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index 1eb0bb7ddd4c..c03b206065a8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index 65737392508a..e92b91e9f2e5 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 9033247ea81c..4ac7edfc7dd8 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index b822307ec5b3..53865653f9c4 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index 5963e9bd6f41..e651937a3c0a 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 873d7062ace7..0aff580c1d20 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 203d5a17d1ed..028241fd523d 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index a827e0757afe..87d5db5b38da 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index 3433198764bf..3b76e49fc6b8 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index 9c1e347630d3..e1cf5e30ddcc 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index 83244dda7c08..771256b32526 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index 5d94dd21ec9d..b836048507bc 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index cbbae588b8cb..c93d9fde1af1 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index b2db7cbadfa7..cc306848848b 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index cd3ab234648b..e405f489027a 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 4d00f2c8daf7..7b584b890ee0 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index 9ccf168369bd..621fa3aaaf53 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index 21aa5c8c8219..76151e1c1e43 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index f57bb13d306c..cac55c6861cd 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index 99ee31933528..067d5dbc9abb 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index 824297e8a755..cbdc191ce3da 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index 056b63584b75..cce27a181ad8 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 2dc9e440e039..947512292bd4 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index 002eda3af3e0..8491f746cf31 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index ded569a38cee..9da910f53d1a 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index 928e77ee502d..ad8bf9a4e262 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index aebcf64d6ee9..ed4e19bbdd6f 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 58bd0bfa5beb..8f2d7bcb8984 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index b8dfab91cfd0..51a04bec4ee5 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index 0a40ccc59035..8af47eb53f22 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index 52ed2454a7db..ece9dcf51244 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index 25aa8d89b61e..8298365960ba 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index 51b74bf89a0d..a302dbc22a61 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.1", + "version": "1.12.0-nightly-20250610.2", "os": [ "win32" ], From 80fb4bc1d02add2ea92a2ce6cfea24cca836a42b Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 17:24:32 +0000 Subject: [PATCH 085/209] chore: Update changelog --- CHANGELOG-CORE.md | 17 ++++++++--------- CHANGELOG.md | 12 +++--------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 1149ba0a90e6..4294a3757921 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -1,4 +1,12 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- Fix bindings ([0f858fd](https://github.com/swc-project/swc/commit/0f858fd3470c5c104ab9b6ca900ea97be37c615f)) + ## [swc_core@v27.0.0] - 2025-06-10 ### Bug Fixes @@ -2553,21 +2561,12 @@ -- **(ast)** Add `archive(check_bytes)` to all relevant AST types ([#9574](https://github.com/swc-project/swc/issues/9574)) ([185d6f5](https://github.com/swc-project/swc/commit/185d6f55b35f4f8323035c1199cddb9dd547f254)) - - -- **(es/codegen)** Fix wrong sourcemap when there are new lines in tpl ([#9578](https://github.com/swc-project/swc/issues/9578)) ([cf74382](https://github.com/swc-project/swc/commit/cf74382ba0429c0d4f04428889cf53a5231fad7f)) - - - **(es/codegen)** Emit .d.ts when using --out-file ([#9582](https://github.com/swc-project/swc/issues/9582)) ([3d9d641](https://github.com/swc-project/swc/commit/3d9d641f8b49725014e7d7a72a6f0a5dfe01f42c)) - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) -- **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) - - - **(es/module)** Rewrite import specifier in type declaration ([#9577](https://github.com/swc-project/swc/issues/9577)) ([fc0ba2a](https://github.com/swc-project/swc/commit/fc0ba2a08408b90f7d799cd5707dfa6827334085)) diff --git a/CHANGELOG.md b/CHANGELOG.md index e71637525310..708c57ca148d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ - **(ts/isolated-dts)** Add edges `SymbolFlags::Value` and `SymbolFlags::Type` in exports ([#10577](https://github.com/swc-project/swc/issues/10577)) ([e6d4da2](https://github.com/swc-project/swc/commit/e6d4da219530744171ba46bfa44a06076080e7c2)) + +- Fix bindings ([0f858fd](https://github.com/swc-project/swc/commit/0f858fd3470c5c104ab9b6ca900ea97be37c615f)) + ### Documentation @@ -2109,18 +2112,9 @@ -- **(ast)** Add `archive(check_bytes)` to all relevant AST types ([#9574](https://github.com/swc-project/swc/issues/9574)) ([185d6f5](https://github.com/swc-project/swc/commit/185d6f55b35f4f8323035c1199cddb9dd547f254)) - - -- **(es/codegen)** Fix wrong sourcemap when there are new lines in tpl ([#9578](https://github.com/swc-project/swc/issues/9578)) ([cf74382](https://github.com/swc-project/swc/commit/cf74382ba0429c0d4f04428889cf53a5231fad7f)) - - - **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) -- **(es/minifier)** Check variable type while optimizing `+=` ([#9575](https://github.com/swc-project/swc/issues/9575)) ([04016e9](https://github.com/swc-project/swc/commit/04016e9687c5f02e764ffc9d7be2432d16da5dc0)) - - - **(es/module)** Rewrite import specifier in type declaration ([#9577](https://github.com/swc-project/swc/issues/9577)) ([fc0ba2a](https://github.com/swc-project/swc/commit/fc0ba2a08408b90f7d799cd5707dfa6827334085)) From f9c04db3f4c3e10f07428bca5e9f789e955ee3e7 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 18:33:44 +0000 Subject: [PATCH 086/209] chore: Publish `1.12.0` with `swc_core` `v27.0.1` --- bindings/Cargo.lock | 10 +++++----- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/binding_minifier_wasm/Cargo.toml | 2 +- bindings/binding_typescript_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 2 +- packages/core/package.json | 2 +- packages/core/scripts/npm/darwin-arm64/package.json | 2 +- packages/core/scripts/npm/darwin-x64/package.json | 2 +- .../core/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/core/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../core/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/core/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/core/scripts/npm/linux-x64-musl/package.json | 2 +- .../core/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/core/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/core/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/html/package.json | 2 +- packages/html/scripts/npm/darwin-arm64/package.json | 2 +- packages/html/scripts/npm/darwin-x64/package.json | 2 +- .../html/scripts/npm/linux-arm-gnueabihf/package.json | 2 +- packages/html/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../html/scripts/npm/linux-arm64-musl/package.json | 2 +- packages/html/scripts/npm/linux-x64-gnu/package.json | 2 +- packages/html/scripts/npm/linux-x64-musl/package.json | 2 +- .../html/scripts/npm/win32-arm64-msvc/package.json | 2 +- packages/html/scripts/npm/win32-ia32-msvc/package.json | 2 +- packages/html/scripts/npm/win32-x64-msvc/package.json | 2 +- packages/minifier/package.json | 2 +- .../minifier/scripts/npm/darwin-arm64/package.json | 2 +- packages/minifier/scripts/npm/darwin-x64/package.json | 2 +- .../scripts/npm/linux-arm-gnueabihf/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-arm64-musl/package.json | 2 +- .../minifier/scripts/npm/linux-x64-gnu/package.json | 2 +- .../minifier/scripts/npm/linux-x64-musl/package.json | 2 +- .../minifier/scripts/npm/win32-arm64-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-ia32-msvc/package.json | 2 +- .../minifier/scripts/npm/win32-x64-msvc/package.json | 2 +- 38 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 6fbaa12424f2..0d27aaa8a661 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "binding_typescript_wasm" -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -4554,7 +4554,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.555" +version = "0.91.556" dependencies = [ "anyhow", "par-core", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 24f63e3f6363..93b59632caf5 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_core_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" [lib] bench = false diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index cec6f1eb49dc..61c4f3d34565 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_minifier_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" [lib] bench = false diff --git a/bindings/binding_typescript_wasm/Cargo.toml b/bindings/binding_typescript_wasm/Cargo.toml index 631541fae7a4..54b20dc6a205 100644 --- a/bindings/binding_typescript_wasm/Cargo.toml +++ b/bindings/binding_typescript_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = { workspace = true } name = "binding_typescript_wasm" publish = false repository = { workspace = true } -version = "1.12.0-nightly-20250610.2" +version = "1.12.0" [lib] bench = false diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 41ead344311e..37e0b4a1debc 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = { workspace = true } name = "swc_cli" repository = { workspace = true } -version = "0.91.555" +version = "0.91.556" [[bin]] bench = false diff --git a/packages/core/package.json b/packages/core/package.json index c03b206065a8..fd8a27b909e8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json index e92b91e9f2e5..dc2094d02dfb 100644 --- a/packages/core/scripts/npm/darwin-arm64/package.json +++ b/packages/core/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-arm64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json index 4ac7edfc7dd8..0316237db025 100644 --- a/packages/core/scripts/npm/darwin-x64/package.json +++ b/packages/core/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-darwin-x64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json index 53865653f9c4..fe20d606b721 100644 --- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json index e651937a3c0a..44b15e9e6da9 100644 --- a/packages/core/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json index 0aff580c1d20..80855266e810 100644 --- a/packages/core/scripts/npm/linux-arm64-musl/package.json +++ b/packages/core/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json index 028241fd523d..13cd0d56ae73 100644 --- a/packages/core/scripts/npm/linux-x64-gnu/package.json +++ b/packages/core/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json index 87d5db5b38da..3a581b575a57 100644 --- a/packages/core/scripts/npm/linux-x64-musl/package.json +++ b/packages/core/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-linux-x64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json index 3b76e49fc6b8..8b2498fee266 100644 --- a/packages/core/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json index e1cf5e30ddcc..c1bb36cf113b 100644 --- a/packages/core/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json index 771256b32526..0ba26eb8bcd9 100644 --- a/packages/core/scripts/npm/win32-x64-msvc/package.json +++ b/packages/core/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/html/package.json b/packages/html/package.json index b836048507bc..3e7ae3e89675 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "description": "Super-fast HTML minifier", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/html/scripts/npm/darwin-arm64/package.json b/packages/html/scripts/npm/darwin-arm64/package.json index c93d9fde1af1..352b619f1bac 100644 --- a/packages/html/scripts/npm/darwin-arm64/package.json +++ b/packages/html/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-arm64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/darwin-x64/package.json b/packages/html/scripts/npm/darwin-x64/package.json index cc306848848b..9ba6be5afb47 100644 --- a/packages/html/scripts/npm/darwin-x64/package.json +++ b/packages/html/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-darwin-x64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json index e405f489027a..82d34497196f 100644 --- a/packages/html/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/html/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-gnu/package.json b/packages/html/scripts/npm/linux-arm64-gnu/package.json index 7b584b890ee0..d76356aa57b5 100644 --- a/packages/html/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/html/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-arm64-musl/package.json b/packages/html/scripts/npm/linux-arm64-musl/package.json index 621fa3aaaf53..3f67259ad1b5 100644 --- a/packages/html/scripts/npm/linux-arm64-musl/package.json +++ b/packages/html/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-gnu/package.json b/packages/html/scripts/npm/linux-x64-gnu/package.json index 76151e1c1e43..6af42845f794 100644 --- a/packages/html/scripts/npm/linux-x64-gnu/package.json +++ b/packages/html/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/linux-x64-musl/package.json b/packages/html/scripts/npm/linux-x64-musl/package.json index cac55c6861cd..329b84d85693 100644 --- a/packages/html/scripts/npm/linux-x64-musl/package.json +++ b/packages/html/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-linux-x64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/html/scripts/npm/win32-arm64-msvc/package.json b/packages/html/scripts/npm/win32-arm64-msvc/package.json index 067d5dbc9abb..63a9d96b0dde 100644 --- a/packages/html/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/html/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-ia32-msvc/package.json b/packages/html/scripts/npm/win32-ia32-msvc/package.json index cbdc191ce3da..8340ac943d86 100644 --- a/packages/html/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/html/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/html/scripts/npm/win32-x64-msvc/package.json b/packages/html/scripts/npm/win32-x64-msvc/package.json index cce27a181ad8..9626d20ffc88 100644 --- a/packages/html/scripts/npm/win32-x64-msvc/package.json +++ b/packages/html/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/html-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/minifier/package.json b/packages/minifier/package.json index 947512292bd4..4ed46be22a9b 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json index 8491f746cf31..0d7c28680285 100644 --- a/packages/minifier/scripts/npm/darwin-arm64/package.json +++ b/packages/minifier/scripts/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-arm64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json index 9da910f53d1a..a9b7b9c85998 100644 --- a/packages/minifier/scripts/npm/darwin-x64/package.json +++ b/packages/minifier/scripts/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-darwin-x64", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "darwin" ], diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json index ad8bf9a4e262..a5aaa1a38bd5 100644 --- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json +++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm-gnueabihf", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json index ed4e19bbdd6f..64962db76ed1 100644 --- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json index 8f2d7bcb8984..16bc3c1dba77 100644 --- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-arm64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json index 51a04bec4ee5..55fb57f8729e 100644 --- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json +++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-gnu", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json index 8af47eb53f22..d49495b8d29c 100644 --- a/packages/minifier/scripts/npm/linux-x64-musl/package.json +++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-linux-x64-musl", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "linux" ], diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json index ece9dcf51244..ab5115b8f9e3 100644 --- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-arm64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json index 8298365960ba..c35356e96e41 100644 --- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-ia32-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json index a302dbc22a61..b3e6d339829c 100644 --- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json +++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier-win32-x64-msvc", - "version": "1.12.0-nightly-20250610.2", + "version": "1.12.0", "os": [ "win32" ], From 3b0386785df98a086e0102cda96ed346298a4bef Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 10 Jun 2025 18:33:45 +0000 Subject: [PATCH 087/209] chore: Update changelog --- CHANGELOG-CORE.md | 6 ------ CHANGELOG.md | 13 +------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 4294a3757921..1a3a5206c083 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -2564,12 +2564,6 @@ - **(es/codegen)** Emit .d.ts when using --out-file ([#9582](https://github.com/swc-project/swc/issues/9582)) ([3d9d641](https://github.com/swc-project/swc/commit/3d9d641f8b49725014e7d7a72a6f0a5dfe01f42c)) -- **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) - - -- **(es/module)** Rewrite import specifier in type declaration ([#9577](https://github.com/swc-project/swc/issues/9577)) ([fc0ba2a](https://github.com/swc-project/swc/commit/fc0ba2a08408b90f7d799cd5707dfa6827334085)) - - - **(es/module)** Fix `jsc.paths` using absolute paths with dots in a filename for an alias ([#9595](https://github.com/swc-project/swc/issues/9595)) ([74e3d04](https://github.com/swc-project/swc/commit/74e3d0466abcd7422620623d8adcceac04ce26c9)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 708c57ca148d..52f9c7ccac62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -## [unreleased] +## [1.12.0] - 2025-06-10 ### Bug Fixes @@ -2106,15 +2106,4 @@ - **(es)** Add helpers ([#9586](https://github.com/swc-project/swc/issues/9586)) ([b94a0e1](https://github.com/swc-project/swc/commit/b94a0e1fd2b900b05c5f18d3d993a74ff9cc6e7d)) -## [1.7.28] - 2024-09-24 - -### Bug Fixes - - - -- **(es/compat)** Skip `getter` and `setter` as FlowHelper `function` do ([#9580](https://github.com/swc-project/swc/issues/9580)) ([14cfd70](https://github.com/swc-project/swc/commit/14cfd70ee00938497ce6b59f68332f9daa17378b)) - - -- **(es/module)** Rewrite import specifier in type declaration ([#9577](https://github.com/swc-project/swc/issues/9577)) ([fc0ba2a](https://github.com/swc-project/swc/commit/fc0ba2a08408b90f7d799cd5707dfa6827334085)) - From 39032dcd96bc618fcddf55d0824836c56f766eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=B9=E0=A4=BF=E0=A4=AE=E0=A4=BE=E0=A4=82=E0=A4=B6?= =?UTF-8?q?=E0=A5=81?= Date: Wed, 11 Jun 2025 09:16:36 +0530 Subject: [PATCH 088/209] fix(@swc/types): Remove `nativeClassProperties` (#10592) --- packages/types/index.ts | 52 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/packages/types/index.ts b/packages/types/index.ts index 7a4cdf63f969..bba893cbda68 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -352,7 +352,7 @@ export interface TerserMangleOptions { reserved?: string[]; } -export interface TerserManglePropertiesOptions {} +export interface TerserManglePropertiesOptions { } /** * Programmatic options. @@ -879,10 +879,6 @@ export interface TransformConfig { */ verbatimModuleSyntax?: boolean; - /** - * Native class properties support - */ - nativeClassProperties?: boolean; } export interface ReactConfig { @@ -925,27 +921,27 @@ export interface ReactConfig { * Enable fast refresh feature for React app */ refresh?: - | boolean - | { - /** - * Identifier for the `react-refresh` register function. - * - * Defaults to `$RefreshReg$` - */ - refreshReg?: string; - /** - * Identifier for the `react-refresh` signature function. - * - * Defaults to `$RefreshSig$` - */ - refreshSig?: string; - /** - * Flag to emit full signatures. - * - * Defaults to `false` - */ - emitFullSignatures?: boolean; - }; + | boolean + | { + /** + * Identifier for the `react-refresh` register function. + * + * Defaults to `$RefreshReg$` + */ + refreshReg?: string; + /** + * Identifier for the `react-refresh` signature function. + * + * Defaults to `$RefreshSig$` + */ + refreshSig?: string; + /** + * Flag to emit full signatures. + * + * Defaults to `false` + */ + emitFullSignatures?: boolean; + }; /** * jsx runtime @@ -1232,7 +1228,7 @@ export interface Output { map?: string; } -export interface MatchPattern {} +export interface MatchPattern { } // ------------------------------- // ---------- Ast nodes ---------- @@ -1464,7 +1460,7 @@ export type Expression = | OptionalChainingExpression | Invalid; -interface ExpressionBase extends Node, HasSpan {} +interface ExpressionBase extends Node, HasSpan { } export interface Identifier extends ExpressionBase { type: "Identifier"; From c6a0565172514f8e62039852e48da79fbf9689ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 11 Jun 2025 07:08:34 -0700 Subject: [PATCH 089/209] chore: Publish `@swc/types@v0.1.23` --- packages/types/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/package.json b/packages/types/package.json index 2aef023a4421..ffe808cdcacb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,7 +1,7 @@ { "name": "@swc/types", "packageManager": "yarn@4.0.2", - "version": "0.1.22", + "version": "0.1.23", "description": "Typings for the swc project.", "types": "./index.d.ts", "sideEffects": false, From e6b61ebfde2b0680c3e4144e6725803b2d9d7fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 11 Jun 2025 07:24:00 -0700 Subject: [PATCH 090/209] fix(swc_common): Add `Files#is_in_file` (#10599) --- .changeset/dull-needles-behave.md | 6 ++++++ crates/swc_common/src/source_map.rs | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/dull-needles-behave.md diff --git a/.changeset/dull-needles-behave.md b/.changeset/dull-needles-behave.md new file mode 100644 index 000000000000..b4953f3e5148 --- /dev/null +++ b/.changeset/dull-needles-behave.md @@ -0,0 +1,6 @@ +--- +swc_common: patch +swc_core: patch +--- + +fix(swc_common): Add `Files#is_in_file` diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 1e82cd7e450f..9feec5f552a3 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1258,6 +1258,14 @@ pub trait Files { raw_pos } + /// Check if the given byte position is within the given file. This has a + /// good default implementation that will work for most cases. + /// + /// The passed `raw_pos` is the value passed to [Files::map_raw_pos]. + fn is_in_file(&self, f: &Lrc, raw_pos: BytePos) -> bool { + f.start_pos <= raw_pos && raw_pos < f.end_pos + } + /// `raw_pos` is the [BytePos] in the AST. It's the raw value passed to /// the source map generator. fn try_lookup_source_file( @@ -1320,7 +1328,7 @@ pub fn build_source_map( let f; let f = match cur_file { - Some(ref f) if f.start_pos <= pos && pos < f.end_pos => f, + Some(ref f) if files.is_in_file(f, *raw_pos) => f, _ => { f = files.try_lookup_source_file(*raw_pos).unwrap(); if config.skip(&f.name) { From 26eceed2c8b7420e132f25ab2e6ac09993a64b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 11 Jun 2025 07:24:13 -0700 Subject: [PATCH 091/209] chore: Publish crates with `swc_core` `v27.0.2` --- .changeset/dull-needles-behave.md | 6 ------ CHANGELOG-CORE.md | 6 ++++++ CHANGELOG.md | 11 +++++++++++ Cargo.lock | 4 ++-- crates/binding_macros/Cargo.toml | 2 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_cli_impl/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_compiler_base/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 4 ++-- crates/swc_css_compat/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_modules/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 2 +- crates/swc_ecma_compat_es2015/Cargo.toml | 2 +- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 2 +- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 2 +- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 2 +- crates/swc_ecma_lexer/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_quote/Cargo.toml | 2 +- crates/swc_ecma_quote_macros/Cargo.toml | 2 +- crates/swc_ecma_react_compiler/Cargo.toml | 2 +- crates/swc_ecma_regexp/Cargo.toml | 2 +- crates/swc_ecma_regexp_ast/Cargo.toml | 2 +- crates/swc_ecma_regexp_visit/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 2 +- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_error_reporters/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_fast_ts_strip/Cargo.toml | 2 +- crates/swc_graph_analyzer/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_codegen/Cargo.toml | 4 ++-- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_node_comments/Cargo.toml | 2 +- crates/swc_plugin_proxy/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- crates/swc_transform_common/Cargo.toml | 2 +- crates/swc_typescript/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_codegen/Cargo.toml | 4 ++-- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- crates/testing/Cargo.toml | 2 +- 84 files changed, 104 insertions(+), 93 deletions(-) delete mode 100644 .changeset/dull-needles-behave.md diff --git a/.changeset/dull-needles-behave.md b/.changeset/dull-needles-behave.md deleted file mode 100644 index b4953f3e5148..000000000000 --- a/.changeset/dull-needles-behave.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -swc_common: patch -swc_core: patch ---- - -fix(swc_common): Add `Files#is_in_file` diff --git a/CHANGELOG-CORE.md b/CHANGELOG-CORE.md index 1a3a5206c083..8c0dd022c5e5 100644 --- a/CHANGELOG-CORE.md +++ b/CHANGELOG-CORE.md @@ -5,6 +5,12 @@ +- **(@swc/types)** Remove `nativeClassProperties` ([#10592](https://github.com/swc-project/swc/issues/10592)) ([39032dc](https://github.com/swc-project/swc/commit/39032dcd96bc618fcddf55d0824836c56f766eab)) + + +- **(swc_common)** Add `Files#is_in_file` ([#10599](https://github.com/swc-project/swc/issues/10599)) ([e6b61eb](https://github.com/swc-project/swc/commit/e6b61ebfde2b0680c3e4144e6725803b2d9d7fc8)) + + - Fix bindings ([0f858fd](https://github.com/swc-project/swc/commit/0f858fd3470c5c104ab9b6ca900ea97be37c615f)) ## [swc_core@v27.0.0] - 2025-06-10 diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f9c7ccac62..16571cc6e7fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ # Changelog +## [unreleased] + +### Bug Fixes + + + +- **(@swc/types)** Remove `nativeClassProperties` ([#10592](https://github.com/swc-project/swc/issues/10592)) ([39032dc](https://github.com/swc-project/swc/commit/39032dcd96bc618fcddf55d0824836c56f766eab)) + + +- **(swc_common)** Add `Files#is_in_file` ([#10599](https://github.com/swc-project/swc/issues/10599)) ([e6b61eb](https://github.com/swc-project/swc/commit/e6b61ebfde2b0680c3e4144e6725803b2d9d7fc8)) + ## [1.12.0] - 2025-06-10 ### Bug Fixes diff --git a/Cargo.lock b/Cargo.lock index ac1ae64d43a7..a40db94d27ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4893,7 +4893,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "12.0.0" +version = "12.0.1" dependencies = [ "anyhow", "arbitrary", @@ -4987,7 +4987,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "27.0.1" +version = "27.0.2" dependencies = [ "anyhow", "binding_macros", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index 7eea1b97973c..0469d56a097c 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -34,7 +34,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports swc = { optional = true, version = "26.0.0", path = "../swc" } -swc_common = { optional = true, version = "12.0.0", path = "../swc_common" } +swc_common = { optional = true, version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "20.0.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 19e66a07584c..11f173d66323 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -27,7 +27,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-filter"] } url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", features = [ +swc_common = { version = "12.0.1", features = [ "concurrent", "tty-emitter", ], path = "../swc_common" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index e5311ad555eb..1c63f70c7771 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -20,7 +20,7 @@ nom = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } [dev-dependencies] anyhow = { workspace = true } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 55f227a1a454..9d363a32b59f 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -74,7 +74,7 @@ url = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 3c4bfcf30093..e7c82542865f 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -39,7 +39,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "14.0.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 45556684a4e1..3ae9162c7cd2 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "27.0.1", features = [ +swc_core = { version = "27.0.2", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 5e9d7a186c59..7d1b6c95ed9e 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_common" repository = { workspace = true } -version = "12.0.0" +version = "12.0.1" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 0306394ed555..56dcf1beb3bf 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -25,7 +25,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features swc_sourcemap = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_config = { version = "3.1.0", path = "../swc_config" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index ce233c12cc39..17468080bf79 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } name = "swc_core" repository = { workspace = true } -version = "27.0.1" +version = "27.0.2" [package.metadata.docs.rs] features = [ "allocator_node", @@ -353,7 +353,7 @@ swc = { optional = true, version = "26.0.0", path = swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { optional = true, version = "5.0.0", path = "../swc_atoms" } swc_bundler = { optional = true, version = "20.0.0", path = "../swc_bundler" } -swc_common = { optional = true, version = "12.0.0", path = "../swc_common" } +swc_common = { optional = true, version = "12.0.1", path = "../swc_common" } swc_config = { optional = true, version = "3.1.0", path = "../swc_config" } swc_css_ast = { optional = true, version = "12.0.0", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "12.0.0", path = "../swc_css_codegen" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index 83eca40f16f8..681181194057 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -32,6 +32,6 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } rkyv = { workspace = true, optional = true } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index 591fa3f32d0c..0b78f10a0918 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -19,13 +19,13 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_codegen_macros = { version = "1.0.0", path = "../swc_css_codegen_macros" } swc_css_utils = { version = "12.0.0", path = "../swc_css_utils" } [dev-dependencies] -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_compat/Cargo.toml b/crates/swc_css_compat/Cargo.toml index c8786bd6e546..bb34e34fdf52 100644 --- a/crates/swc_css_compat/Cargo.toml +++ b/crates/swc_css_compat/Cargo.toml @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index fb93ce7f449f..a00c7f227299 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -22,7 +22,7 @@ serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index 027613cf97fe..9cb0d27aaafc 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -17,7 +17,7 @@ rustc-hash = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_modules/Cargo.toml b/crates/swc_css_modules/Cargo.toml index 67a240762619..136e2ad1b164 100644 --- a/crates/swc_css_modules/Cargo.toml +++ b/crates/swc_css_modules/Cargo.toml @@ -19,7 +19,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen" } swc_css_parser = { version = "12.0.0", path = "../swc_css_parser" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index 994c4191e183..bbb3ad4d88b7 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -20,7 +20,7 @@ lexical = { workspace = true } serde = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } [dev-dependencies] diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 43bcc2e9e110..1c897403d8fd 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -20,7 +20,7 @@ serde_json = { workspace = true } preset_env_base = { version = "3.0.1", path = "../preset_env_base" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_utils = { version = "12.0.0", path = "../swc_css_utils/" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index ef9002ce44f3..f76b6fba07ed 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -19,6 +19,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_css_visit = { version = "12.0.0", path = "../swc_css_visit" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 9c303fe260f9..a429f9aec8b2 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -24,6 +24,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index 34d99dc38abc..428e272b7d78 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -53,7 +53,7 @@ unicode-id-start = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 6d3a793235ef..7e7fec1bad7b 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -33,7 +33,7 @@ swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features "hashbrown", ] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_codegen_macros = { version = "2.0.0", path = "../swc_ecma_codegen_macros" } @@ -44,7 +44,7 @@ criterion = { workspace = true } serde_json = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator" } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index 6b37ed62e5e4..d5eb4b348b2b 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "17.0.0", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 6b12e1c59b89..bc36fe92c3a0 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -12,7 +12,7 @@ version = "16.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index e1298c69aeca..272bc7468177 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -23,7 +23,7 @@ smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 00b2d1c07fa8..d8ed1a62e7ed 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -14,7 +14,7 @@ version = "16.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 6b878ed0bbb9..edcbf0ea569f 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "1.0.0", path = "../swc_ecma_transforms_macros" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 2c745a63a8d4..423065329a80 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -17,7 +17,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 033927cd430d..9239569cb04d 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -17,7 +17,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index c1d3895e34a6..be53a032ae9e 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -15,7 +15,7 @@ version = "17.0.0" [dependencies] serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "17.0.0", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 8d010079fde4..16e4ffcf1542 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -16,7 +16,7 @@ version = "16.0.0" tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index b95c2eb3781c..65963d304b13 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "16.0.0", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 0d9b2f740d6b..cafc7043b53f 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -15,7 +15,7 @@ version = "16.0.0" [dependencies] tracing = { workspace = true } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index ee8ec89f1340..da8ccc943f69 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -15,7 +15,7 @@ bench = false phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lexer/Cargo.toml b/crates/swc_ecma_lexer/Cargo.toml index 3a53d869ea55..dd89c716d7c3 100644 --- a/crates/swc_ecma_lexer/Cargo.toml +++ b/crates/swc_ecma_lexer/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 660c48e1dbf3..05cc346a5b2e 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_config = { version = "3.1.0", path = "../swc_config" } diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index 0a5d251db53f..7774748ddd70 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } [dev-dependencies] lazy_static = { workspace = true } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 1468b6d3c885..779423927751 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -54,7 +54,7 @@ tracing = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config", features = [ "sourcemap", "file_pattern", diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index e0878a37ddc6..6462d4a8445a 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -40,7 +40,7 @@ typed-arena = { workspace = true } new_debug_unreachable = { workspace = true } phf = { workspace = true, features = ["macros"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_lexer = { version = "15.0.0", path = "../swc_ecma_lexer" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 0d3ed4ae5021..a148ce7f549d 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -30,7 +30,7 @@ preset_env_base = { version = "3.0.1", path = "../preset_env_base" } rustc-hash = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms = { version = "20.0.0", path = "../swc_ecma_transforms", features = [ "compat", diff --git a/crates/swc_ecma_quote/Cargo.toml b/crates/swc_ecma_quote/Cargo.toml index 7a8c89199e55..ea8359b12ac2 100644 --- a/crates/swc_ecma_quote/Cargo.toml +++ b/crates/swc_ecma_quote/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_quote_macros = { version = "15.0.0", path = "../swc_ecma_quote_macros" } diff --git a/crates/swc_ecma_quote_macros/Cargo.toml b/crates/swc_ecma_quote_macros/Cargo.toml index 052f43196e6b..b1b0fde22bcc 100644 --- a/crates/swc_ecma_quote_macros/Cargo.toml +++ b/crates/swc_ecma_quote_macros/Cargo.toml @@ -20,7 +20,7 @@ rustc-hash = { workspace = true } syn = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_macros_common = { version = "1.0.0", path = "../swc_macros_common" } diff --git a/crates/swc_ecma_react_compiler/Cargo.toml b/crates/swc_ecma_react_compiler/Cargo.toml index 4b1e68aadf45..0a7149f9a605 100644 --- a/crates/swc_ecma_react_compiler/Cargo.toml +++ b/crates/swc_ecma_react_compiler/Cargo.toml @@ -14,7 +14,7 @@ version = "5.0.0" [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_regexp/Cargo.toml b/crates/swc_ecma_regexp/Cargo.toml index 5f1577d78370..f39af4cdb4b9 100644 --- a/crates/swc_ecma_regexp/Cargo.toml +++ b/crates/swc_ecma_regexp/Cargo.toml @@ -21,7 +21,7 @@ rustc-hash = { workspace = true } unicode-id-start = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.1.0", path = "../swc_ecma_regexp_ast" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } swc_ecma_regexp_visit = { version = "0.1.0", path = "../swc_ecma_regexp_visit" } diff --git a/crates/swc_ecma_regexp_ast/Cargo.toml b/crates/swc_ecma_regexp_ast/Cargo.toml index 02e366423881..6cbbec524bee 100644 --- a/crates/swc_ecma_regexp_ast/Cargo.toml +++ b/crates/swc_ecma_regexp_ast/Cargo.toml @@ -25,5 +25,5 @@ rancor = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"], optional = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_regexp_common = { version = "0.0.0", path = "../swc_ecma_regexp_common" } diff --git a/crates/swc_ecma_regexp_visit/Cargo.toml b/crates/swc_ecma_regexp_visit/Cargo.toml index 64bc051e619b..80e7b47fbbea 100644 --- a/crates/swc_ecma_regexp_visit/Cargo.toml +++ b/crates/swc_ecma_regexp_visit/Cargo.toml @@ -20,7 +20,7 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_regexp_ast = { version = "0.1.0", path = "../swc_ecma_regexp_ast" } swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 247632a4621e..e397898248a1 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -36,7 +36,7 @@ typescript = ["swc_ecma_transforms_typescript"] par-core = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "18.0.0", path = "../swc_ecma_transforms_compat", optional = true } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 1abaf2f24715..07d97f2631c6 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -30,7 +30,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index ae3038e6791a..7d2325de6b87 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 3c512be115a8..0d040c8ef566 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -31,7 +31,7 @@ smallvec = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "17.0.0", path = "../swc_ecma_compat_bugfixes" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 481b7b31bc78..a459d6cd68c1 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -26,7 +26,7 @@ serde = { workspace = true, features = ["derive"] } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config", features = [ "file_pattern", ] } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 46c898942b84..af293e540ee9 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -34,7 +34,7 @@ serde_json = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 743527b7bcd3..c1cf4ea7c5c9 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -23,7 +23,7 @@ serde = { workspace = true, features = ["derive"] } smallvec = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "12.0.0", path = "../swc_ecma_loader", optional = true } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 5e73485e116f..59c20efad88f 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -31,7 +31,7 @@ sha1 = { workspace = true } string_enum = { version = "1.0.0", path = "../string_enum" } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "15.0.0", path = "../swc_ecma_parser" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 2c94a73ae7f0..24ac4db5e8de 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -23,7 +23,7 @@ swc_sourcemap = { workspace = true } tempfile = { workspace = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index bba76225baa1..71c01a0185dc 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -23,7 +23,7 @@ ryu-js = { workspace = true } serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "16.0.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "18.0.0", path = "../swc_ecma_transforms_react" } diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index f1ef9316275f..7ec351921f68 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -29,7 +29,7 @@ rustc-hash = { workspace = true } tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 5f0bcd482eeb..109da9092418 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -32,7 +32,7 @@ tracing = { workspace = true } unicode-id = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 82516a21f7c6..aeb7313f7a47 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -28,6 +28,6 @@ serde = { workspace = true, optional = true, features = ["derive tracing = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_error_reporters/Cargo.toml b/crates/swc_error_reporters/Cargo.toml index 022ab729637d..541230873885 100644 --- a/crates/swc_error_reporters/Cargo.toml +++ b/crates/swc_error_reporters/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "concurrent", ] } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index 39e61797dac5..fa29349ea7c7 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -27,4 +27,4 @@ serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index d209bd58e124..f94e62b7c0af 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -25,7 +25,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", "tty-emitter", ] } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index d770ed48ad4c..9641ad7bc651 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -18,7 +18,7 @@ wasm-bindgen = { workspace = true, optional = true } swc_allocator = { version = "4.0.0", path = "../swc_allocator", default-features = false } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_graph_analyzer/Cargo.toml b/crates/swc_graph_analyzer/Cargo.toml index 18bde7b95560..c91ba57edcad 100644 --- a/crates/swc_graph_analyzer/Cargo.toml +++ b/crates/swc_graph_analyzer/Cargo.toml @@ -15,7 +15,7 @@ bench = false auto_impl = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -swc_common = { version = "12.0.0", path = "../swc_common/" } +swc_common = { version = "12.0.1", path = "../swc_common/" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 34a6622dbf08..88a54292931f 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -33,4 +33,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_html_codegen/Cargo.toml b/crates/swc_html_codegen/Cargo.toml index e844783191a8..625b3986ca98 100644 --- a/crates/swc_html_codegen/Cargo.toml +++ b/crates/swc_html_codegen/Cargo.toml @@ -21,13 +21,13 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_html_codegen_macros = { version = "1.0.0", path = "../swc_html_codegen_macros" } swc_html_utils = { version = "12.0.0", path = "../swc_html_utils" } [dev-dependencies] -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_html_parser = { version = "12.0.0", path = "../swc_html_parser" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 719ba39fd3ec..450dc3f97f7a 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -32,7 +32,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_config = { version = "3.1.0", path = "../swc_config", features = ["regex"] } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", optional = true } swc_css_codegen = { version = "12.0.0", path = "../swc_css_codegen", optional = true } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index 206a0e0bdc2e..8b3b40991dd5 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_html_utils = { version = "12.0.0", path = "../swc_html_utils" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index 87ebe98e055a..6826371473e0 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 9878f600ee09..9aeb5d0e2853 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_html_ast = { version = "12.0.0", path = "../swc_html_ast" } swc_visit = { version = "2.0.0", path = "../swc_visit" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index b0bf692b177d..30109875bd42 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -35,7 +35,7 @@ swc_atoms = { version = "5.0.0", path = "../swc_atoms" } swc_bundler = { version = "20.0.0", path = "../swc_bundler", features = [ "concurrent", ] } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_node_comments/Cargo.toml b/crates/swc_node_comments/Cargo.toml index 2b1a5c095b6e..90306f01a77e 100644 --- a/crates/swc_node_comments/Cargo.toml +++ b/crates/swc_node_comments/Cargo.toml @@ -19,4 +19,4 @@ dashmap = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_plugin_proxy/Cargo.toml b/crates/swc_plugin_proxy/Cargo.toml index 813324342f22..43ec4dd49f29 100644 --- a/crates/swc_plugin_proxy/Cargo.toml +++ b/crates/swc_plugin_proxy/Cargo.toml @@ -28,6 +28,6 @@ rustc-hash = { workspace = true } tracing = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_trace_macro = { version = "2.0.1", path = "../swc_trace_macro" } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 73faca658615..a86fffe0209e 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -65,7 +65,7 @@ wasmer = { workspace = true } wasmer-wasix = { workspace = true } swc_atoms = { version = "5.0.0", path = '../swc_atoms' } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "concurrent", ] } swc_css_ast = { version = "12.0.0", path = "../swc_css_ast", optional = true } diff --git a/crates/swc_transform_common/Cargo.toml b/crates/swc_transform_common/Cargo.toml index aac5811165fe..f910807be94b 100644 --- a/crates/swc_transform_common/Cargo.toml +++ b/crates/swc_transform_common/Cargo.toml @@ -22,4 +22,4 @@ serde = { workspace = true } serde_json = { workspace = true } better_scoped_tls = { version = "1.0.0", path = "../better_scoped_tls" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index 439c625a07ea..e21fba794b93 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -15,7 +15,7 @@ rustc-hash = { workspace = true } thiserror = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_ecma_ast = { version = "12.0.0", path = "../swc_ecma_ast" } swc_ecma_utils = { version = "16.0.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "12.0.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index db3bf21a5e98..e817188c0946 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -23,4 +23,4 @@ serde = { workspace = true, features = ["derive"], optional = true } string_enum = { version = "1.0.0", path = "../string_enum/" } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } diff --git a/crates/swc_xml_codegen/Cargo.toml b/crates/swc_xml_codegen/Cargo.toml index 87bb82f0b71b..1e5ffc4e19d2 100644 --- a/crates/swc_xml_codegen/Cargo.toml +++ b/crates/swc_xml_codegen/Cargo.toml @@ -21,12 +21,12 @@ bitflags = { workspace = true } rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } swc_xml_codegen_macros = { version = "1.0.0", path = "../swc_xml_codegen_macros" } [dev-dependencies] -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "sourcemap", ] } swc_xml_parser = { version = "12.0.0", path = "../swc_xml_parser" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index b25374a31239..8b88ad00ead1 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -22,7 +22,7 @@ debug = [] rustc-hash = { workspace = true } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } [dev-dependencies] diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index 34bb5f94af3e..d15abf92f697 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -27,6 +27,6 @@ serde-impl = ["serde"] serde = { workspace = true, optional = true, features = ["derive"] } swc_atoms = { version = "5.0.0", path = "../swc_atoms" } -swc_common = { version = "12.0.0", path = "../swc_common" } +swc_common = { version = "12.0.1", path = "../swc_common" } swc_visit = { version = "2.0.0", path = "../swc_visit" } swc_xml_ast = { version = "12.0.0", path = "../swc_xml_ast" } diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index bcb871a4e0dc..166e4ab20971 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -24,7 +24,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } -swc_common = { version = "12.0.0", path = "../swc_common", features = [ +swc_common = { version = "12.0.1", path = "../swc_common", features = [ "tty-emitter", ] } swc_error_reporters = { version = "14.0.0", path = "../swc_error_reporters" } From 70bda6a199bec4b0f8fddb20040a382c44a78354 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 13 Jun 2025 00:19:33 +0800 Subject: [PATCH 092/209] feat(es/parser): Support parsing CommonJS (#10600) **Related issue:** - Closes https://github.com/swc-project/swc/issues/10597 --- .changeset/gentle-mangos-perform.md | 9 ++ bindings/binding_core_wasm/src/lib.rs | 4 +- bindings/binding_core_wasm/src/types.rs | 2 +- crates/swc_compiler_base/src/lib.rs | 9 +- crates/swc_config/src/is_module.rs | 3 + crates/swc_ecma_lexer/src/parser/mod.rs | 19 ++++ crates/swc_ecma_parser/examples/parse.rs | 93 +++++++++++++++++++ crates/swc_ecma_parser/src/lib.rs | 1 + crates/swc_ecma_parser/src/parser/mod.rs | 19 ++++ crates/swc_ecma_parser/tests/js.rs | 11 ++- .../tests/js/issue-10597/config.json | 4 + .../tests/js/issue-10597/new_target.cjs | 1 + .../tests/js/issue-10597/new_target.cjs.json | 25 +++++ .../tests/js/issue-10597/return.cjs | 1 + .../tests/js/issue-10597/return.cjs.json | 26 ++++++ .../tests/js/issue-10597/using.cjs | 1 + .../tests/js/issue-10597/using.cjs.json | 46 +++++++++ packages/types/index.ts | 2 +- 18 files changed, 270 insertions(+), 6 deletions(-) create mode 100644 .changeset/gentle-mangos-perform.md create mode 100644 crates/swc_ecma_parser/examples/parse.rs create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/config.json create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/new_target.cjs create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/new_target.cjs.json create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/return.cjs create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/return.cjs.json create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/using.cjs create mode 100644 crates/swc_ecma_parser/tests/js/issue-10597/using.cjs.json diff --git a/.changeset/gentle-mangos-perform.md b/.changeset/gentle-mangos-perform.md new file mode 100644 index 000000000000..0fc2f6a9e3b2 --- /dev/null +++ b/.changeset/gentle-mangos-perform.md @@ -0,0 +1,9 @@ +--- +swc_compiler_base: patch +swc_config: patch +swc_ecma_lexer: patch +swc_ecma_parser: patch +swc_core: patch +--- + +feat(es/parser): Support parsing CommonJS diff --git a/bindings/binding_core_wasm/src/lib.rs b/bindings/binding_core_wasm/src/lib.rs index f83e498c0c76..a59e4cc85db7 100644 --- a/bindings/binding_core_wasm/src/lib.rs +++ b/bindings/binding_core_wasm/src/lib.rs @@ -13,11 +13,11 @@ export function minify(src: string, opts?: JsMinifyOptions): Promise; export function minifySync(code: string, opts?: JsMinifyOptions): Output; export function parse(src: string, options: ParseOptions & { - isModule: false; + isModule: false | "commonjs"; }): Promise