What Changed
Oxc's April 16 release β crates v0.126.0 β is a relatively quiet one in terms of user-facing features but ships meaningful tooling improvements and one unavoidable breaking change.
Turbopack Magic Comments in the Parser
The headline feature is parser support for Turbopack magic comments. These are special comments like /* webpackChunkName */, /* webpackPreload */, and /* resource */ that bundlers use to communicate metadata about dynamic imports and code splitting. Until now, the Oxc parser treated them as plain comments. With this change, they're recognized and preserved semantically, which means tools built on Oxc β including Rolldown, the Rust-based successor to Rollup β can process webpack-annotated code more accurately.
If you're using Rolldown or any toolchain that wraps Oxc's parser, this should reduce spurious warnings and improve tree-shaking decisions when working with code originally written for webpack.
Allocator Breaking Changes
The more disruptive change is a rename of Box and Vec methods in the allocator crate. This is a breaking change targeting projects that directly depend on Oxc's internal allocator API β most users of Oxc through Rolldown or oxlint won't be affected.
The rename aligns the allocator's method naming with updated Rust idioms and removes some historical inconsistencies that accumulated as the crate evolved. If you're maintaining a fork or a deep integration with Oxc internals, budget time to update your method calls after upgrading.
NAPI Transform: Enum Optimization Controls
The NAPI transform β used by the Node.js binding for oxc_transform β now exposes optimizeConstEnums and optimizeEnums as configurable options. These flags control whether the transformer should inline enum values at compile time, reducing runtime enum lookup overhead. The addition is straightforward but useful for performance-sensitive TypeScript projects that use enums heavily.
Performance: Arena and Lexer
Two commits targeted steady-state performance improvements:
- The allocator's Arena chunk allocation was simplified, reducing overhead when creating new memory chunks during large file processing.
- The lexer refactored out
LexerContext, a structural cleanup that reduces branching during tokenization.
Neither of these are user-visible behavior changes, but they contribute to Oxc's continuing lead in JavaScript parsing and transformation benchmarks.
Bug Fixes
A handful of fixes landed in this release:
- The transformer now preserves correct execution order for class field accessors when
useDefineForClassFields: falseβ a niche but important edge case for projects with non-standard class field semantics. - The minifier fixed a bug producing illegal
var;when folding unused argument copies β a code generation bug that could produce invalid JavaScript output. - Update expressions are now treated as unconditionally side-effectful, fixing a minification correctness issue where the minifier could incorrectly remove expressions.
FAQ
Does this affect oxlint users?
No. oxlint is built on Oxc's linting infrastructure, not the allocator or parser changes in this release. You should be able to update without any config changes.
What about Rolldown users?
Rolldown benefits from the Turbopack magic comment support and any parser correctness fixes. The allocator breaking change is internal and should not affect Rolldown's public API.
How do I update?
cargo update -p oxc_allocator
And rebuild. If you have a direct dependency on the allocator crate's Box or Vec methods, check the CHANGELOG for the full list of renamed methods.
Is there an oxlint release tied to this?
Yes β oxlint v1.60.0 was released on April 13 alongside this cycle's work, bringing oxlint's lint rule coverage up to date with the latest parser changes.