Latest Results
fix(es/estree)!: fix AST roundtrip bugs and implement missing conversions
**Description:**
Fix several AST conversion bugs and panics across `swc_estree_ast` and `swc_estree_compat` (`babelify` and `swcify`) to improve ESTree/Babel round-trip fidelity:
- **`swc_estree_ast`:**
- Add `#[serde(default)] pub computed: bool` to `ClassPrivateProperty`.
- Add `#[serde(default, rename = "await")] pub is_await: bool` to `ForOfStatement` and wire it through `babelify` and `swcify`.
- Add `LiteralExtra<T>` (`pub extra: Option<...>` with `#[serde(default, skip_serializing_if = "Option::is_none")]`) to `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` to preserve raw literal representations across `babelify` and `swcify`.
- Add `#[serde(default)]` to `StringLiteral::raw` and `ExportSpecifier::export_kind` (deriving `Default` on `ExportKind` with `#[default] Value`).
- **`swc_estree_compat::babelify`:**
- Filter out `ClassMember::Empty` in `Class::babelify` instead of panicking, migrating any attached leading/trailing comments into `ClassBody.base.inner_comments`.
- Populate `computed` flags from `self.key.is_computed()` on `ObjectMethod`, `KeyValueProp`, `KeyValuePatProp`, `ClassMethod`, and `Constructor` (along with `is_static`/`generator`/`is_async` defaults on `Constructor` and `computed: false` on `PrivateMethod`/`PrivateProp`).
- Fix `AssignPatProp::babelify` when a default value is present (`{ x = 1 }`) to emit `ObjectPropVal::Pattern(PatternLike::AssignmentPat(...))` with `shorthand: true` instead of `ObjectPropVal::Expr`, without duplicating comments on the cloned identifier.
- Implement `Babelify` for `OptChainExpr` (`OptionalMemberExpression` and `OptionalCallExpression`), `PropName::BigInt`, and `ModuleExportName::Str`.
- **`swc_estree_compat::swcify`:**
- Implement `Swcify` for `File` and `Program` in `swcify/program.rs`.
- Fix `ClassMethodKind::Method` mapping in `ClassMethod` and `ClassPrivateMethod` (previously mapped to `MethodKind::Getter` instead of `MethodKind::Method`) and read `is_static` from `static_any` on `ClassPrivateProperty`.
- Preserve `computed` property keys via `swcify_object_key` across `ObjectMethod`, `ObjectProperty`, `ClassMethod`, `Constructor`, `ClassProperty`, and `ObjectPatternProp`, while unwrapping non-computed `BigIntLiteral` keys into `PropName::BigInt`.
- Handle computed `MemberExpression` (`arr[i]`, `super[i]`) and `OptionalMemberExpression` (`arr?.[i]`) when `property` deserializes as `Id(Identifier)` instead of panicking on `unreachable!()`.
- Preserve `ObjectMethodKind::Get`/`Set` (`Prop::Getter`/`Prop::Setter`) and shorthand `ObjectProperty` (`Prop::Shorthand`) in `ObjectExprProp::swcify`.
- Fix `ObjectPatternProp::swcify` to preserve default values on shorthand `AssignmentPattern` properties (`{ x = 1 }`) and computed destructuring keys.
**BREAKING CHANGE:**
`swc_estree_ast` structs `ClassPrivateProperty`, `ForOfStatement`, `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` have new public fields (`computed`, `is_await`, and `extra`). All new fields use `#[serde(default)]` so existing JSON inputs continue to deserialize without change, but Rust callers constructing these struct literals directly must initialize the new fields.
**Related issue (if exists):**
N/Agmcsorley-work:estree-upstream-fixes perf(node): Optimize macOS native addon first load (#12436)
**Description:**
The first macOS load currently recompresses the decoded native addon
with `ditto` for APFS self-replacement, then decodes another image for
the current process. Use the existing verified cache directly on macOS
to remove that synchronous work.
This retains compressed downloads, full-byte integrity verification,
locking, atomic publication, and corruption recovery. The installed
carrier and uncompressed cache coexist. Linux/Windows loading policy,
public APIs, environment variables, payload format, cache keys, and the
directly tested APFS helpers stay unchanged.
Extend the native fixture to cover persistent and temporary caches,
custom-cache fallback, corruption repair, hardlinked/read-only
installations, and eight concurrent first loads. Measure macOS cold
samples with ordinary single-link carriers while preserving warm-cache
measurements. Add a reproducible before/after comparison and
[measurement details](docs/native-addon-macos-startup.md).
**Performance:**
Using the same release core addon on an Apple M5 Max/APFS, with three
rounds of 15 fresh-process samples for each of Node 20 and 22:
- First `require()` medians improve by **9.8–18.6%**, exceeding the 5%
criterion in every round.
- The second installed execution falls from **253–270 ms to 17–19 ms**;
warm-cache performance is preserved.
- Allocated binary storage increases from **11.03 MiB to 31.32–32.00
MiB** for this core artifact.
Copies occur outside the timer. These are installation-first-load
measurements; the OS page cache was not cleared.
**Validation:**
- `cargo fmt --all` and `cargo clippy --all --all-targets -- -D
warnings`.
- All three native Rust crate suites, including Rust 1.73 verification;
explicit APFS replacement test.
- Native JavaScript tests and core `pnpm build:dev && pnpm test`.
- [Verification-only release
workflow](https://github.com/swc-project/swc/actions/runs/36549130544):
all 48 builds, 69 runtime jobs, four native lifecycle jobs, and the
final gate passed, including all 16 macOS ARM64/Rosetta and Node 20/22
combinations. Publishing and tag creation were disabled.
The initial Windows x64 core/Node 20 job exceeded its existing cold
budget (571.99 ms versus 500 ms), with functional tests passing. One
diagnostic rerun using identical artifacts and unchanged budgets passed
at 374.45 ms. Both observations are recorded in the measurement
document.
**Related issue (if exists):**
None. fix(es/estree)!: fix AST roundtrip bugs and implement missing conversions
**Description:**
Fix several AST conversion bugs and panics across `swc_estree_ast` and `swc_estree_compat` (`babelify` and `swcify`) to improve ESTree/Babel round-trip fidelity:
- **`swc_estree_ast`:**
- Add `#[serde(default)] pub computed: bool` to `ClassPrivateProperty`.
- Add `#[serde(default, rename = "await")] pub is_await: bool` to `ForOfStatement` and wire it through `babelify` and `swcify`.
- Add `LiteralExtra<T>` (`pub extra: Option<...>` with `#[serde(default, skip_serializing_if = "Option::is_none")]`) to `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` to preserve raw literal representations across `babelify` and `swcify`.
- Add `#[serde(default)]` to `StringLiteral::raw` and `ExportSpecifier::export_kind` (deriving `Default` on `ExportKind` with `#[default] Value`).
- **`swc_estree_compat::babelify`:**
- Filter out `ClassMember::Empty` in `Class::babelify` instead of panicking, migrating any attached leading/trailing comments into `ClassBody.base.inner_comments`.
- Populate `computed` flags from `self.key.is_computed()` on `ObjectMethod`, `KeyValueProp`, `KeyValuePatProp`, `ClassMethod`, and `Constructor` (along with `is_static`/`generator`/`is_async` defaults on `Constructor` and `computed: false` on `PrivateMethod`/`PrivateProp`).
- Fix `AssignPatProp::babelify` when a default value is present (`{ x = 1 }`) to emit `ObjectPropVal::Pattern(PatternLike::AssignmentPat(...))` with `shorthand: true` instead of `ObjectPropVal::Expr`, without duplicating comments on the cloned identifier.
- Implement `Babelify` for `OptChainExpr` (`OptionalMemberExpression` and `OptionalCallExpression`), `PropName::BigInt`, and `ModuleExportName::Str`.
- **`swc_estree_compat::swcify`:**
- Implement `Swcify` for `File` and `Program` in `swcify/program.rs`.
- Fix `ClassMethodKind::Method` mapping in `ClassMethod` and `ClassPrivateMethod` (previously mapped to `MethodKind::Getter` instead of `MethodKind::Method`) and read `is_static` from `static_any` on `ClassPrivateProperty`.
- Preserve `computed` property keys via `swcify_object_key` across `ObjectMethod`, `ObjectProperty`, `ClassMethod`, `Constructor`, `ClassProperty`, and `ObjectPatternProp`, while unwrapping non-computed `BigIntLiteral` keys into `PropName::BigInt`.
- Handle computed `MemberExpression` (`arr[i]`, `super[i]`) and `OptionalMemberExpression` (`arr?.[i]`) when `property` deserializes as `Id(Identifier)` instead of panicking on `unreachable!()`.
- Preserve `ObjectMethodKind::Get`/`Set` (`Prop::Getter`/`Prop::Setter`) and shorthand `ObjectProperty` (`Prop::Shorthand`) in `ObjectExprProp::swcify`.
- Fix `ObjectPatternProp::swcify` to preserve default values on shorthand `AssignmentPattern` properties (`{ x = 1 }`) and computed destructuring keys.
**BREAKING CHANGE:**
`swc_estree_ast` structs `ClassPrivateProperty`, `ForOfStatement`, `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` have new public fields (`computed`, `is_await`, and `extra`). All new fields use `#[serde(default)]` so existing JSON inputs continue to deserialize without change, but Rust callers constructing these struct literals directly must initialize the new fields.
**Related issue (if exists):**
N/Agmcsorley-work:estree-upstream-fixes fix(es/estree)!: fix AST roundtrip bugs and implement missing conversions
**Description:**
Fix several AST conversion bugs and panics across `swc_estree_ast` and `swc_estree_compat` (`babelify` and `swcify`) to improve ESTree/Babel round-trip fidelity:
- **`swc_estree_ast`:**
- Add `#[serde(default)] pub computed: bool` to `ClassPrivateProperty`.
- Add `#[serde(default, rename = "await")] pub is_await: bool` to `ForOfStatement` and wire it through `babelify` and `swcify`.
- Add `LiteralExtra<T>` (`pub extra: Option<...>` with `#[serde(default, skip_serializing_if = "Option::is_none")]`) to `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` to preserve raw literal representations across `babelify` and `swcify`.
- Add `#[serde(default)]` to `StringLiteral::raw` and `ExportSpecifier::export_kind` (deriving `Default` on `ExportKind` with `#[default] Value`).
- **`swc_estree_compat::babelify`:**
- Filter out `ClassMember::Empty` in `Class::babelify` instead of panicking, migrating any attached leading/trailing comments into `ClassBody.base.inner_comments`.
- Populate `computed` flags from `self.key.is_computed()` on `ObjectMethod`, `KeyValueProp`, `KeyValuePatProp`, `ClassMethod`, and `Constructor` (along with `is_static`/`generator`/`is_async` defaults on `Constructor` and `computed: false` on `PrivateMethod`/`PrivateProp`).
- Fix `AssignPatProp::babelify` when a default value is present (`{ x = 1 }`) to emit `ObjectPropVal::Pattern(PatternLike::AssignmentPat(...))` with `shorthand: true` instead of `ObjectPropVal::Expr`, without duplicating comments on the cloned identifier.
- Implement `Babelify` for `OptChainExpr` (`OptionalMemberExpression` and `OptionalCallExpression`), `PropName::BigInt`, and `ModuleExportName::Str`.
- **`swc_estree_compat::swcify`:**
- Implement `Swcify` for `File` and `Program` in `swcify/program.rs`.
- Fix `ClassMethodKind::Method` mapping in `ClassMethod` and `ClassPrivateMethod` (previously mapped to `MethodKind::Getter` instead of `MethodKind::Method`) and read `is_static` from `static_any` on `ClassPrivateProperty`.
- Preserve `computed` property keys via `swcify_object_key` across `ObjectMethod`, `ObjectProperty`, `ClassMethod`, `Constructor`, `ClassProperty`, and `ObjectPatternProp`, while unwrapping non-computed `BigIntLiteral` keys into `PropName::BigInt`.
- Handle computed `MemberExpression` (`arr[i]`, `super[i]`) and `OptionalMemberExpression` (`arr?.[i]`) when `property` deserializes as `Id(Identifier)` instead of panicking on `unreachable!()`.
- Preserve `ObjectMethodKind::Get`/`Set` (`Prop::Getter`/`Prop::Setter`) and shorthand `ObjectProperty` (`Prop::Shorthand`) in `ObjectExprProp::swcify`.
- Fix `ObjectPatternProp::swcify` to preserve default values on shorthand `AssignmentPattern` properties (`{ x = 1 }`) and computed destructuring keys.
**BREAKING CHANGE:**
`swc_estree_ast` structs `ClassPrivateProperty`, `ForOfStatement`, `StringLiteral`, `NumericLiteral`, and `BigIntLiteral` have new public fields (`computed`, `is_await`, and `extra`). All new fields use `#[serde(default)]` so existing JSON inputs continue to deserialize without change, but Rust callers constructing these struct literals directly must initialize the new fields.
**Related issue (if exists):**
N/Agmcsorley-work:estree-upstream-fixes Latest Branches
0%
gmcsorley-work:fix-jsx-element-test 0%
gmcsorley-work:estree-upstream-fixes 0%
Cayan:keep-bool-or-data-deserialize-error © 2026 CodSpeed Technology