Commit Graph

30 Commits

Author SHA1 Message Date
Boshen baf022d74d refactor(ast)!: remove old AstBuilder methods (#24563)
Closes the migration tracked in #23043.

The new builder API (methods on the AST types themselves) has been in place for a while, all Oxc crates are migrated, and every crate which uses `AstBuilder` already enables `disable_old_builder` in its tests. The module docs said "after a few weeks, we will remove `AstBuilder`'s own methods entirely" — this does that.

## What's removed

- `crates/oxc_ast/src/generated/ast_builder.rs` and `builder/methods.rs` — `AstBuilder`'s own node and primitive constructors.
- `AstBuilderGenerator`, which produced the former.
- The `disable_old_builder` Cargo feature, plus the dev-dependency hacks it required across 33 manifests. Eight crates depended on `oxc_ast` *purely* to turn the feature on; those deps and their `cargo-shear` ignore entries are gone too.

## One thing worth reviewing

`AstBuilderGenerator` owned the `#[builder(default)]` / `#[builder(skip)]` attr registration that `BuilderMethodsGenerator` only *reads* — its doc comment said as much. Deleting it naively would have silently dropped `skip`/`default` handling for the 12 AST types using those attrs, so `attrs()` and `parse_attr()` move to `BuilderMethodsGenerator`.

The evidence this was faithful: after regenerating, `builder_methods.rs` and every other generated file are **byte-identical**. The only generated change in the diff is the deletion.

## Breaking changes

- `AstBuilder`'s own methods are gone. Use the AST type methods: `Statement::new_expression_statement(span, expr, &builder)` instead of `builder.statement_expression(span, expr)`.
- `AstBuilder` is no longer `Copy`/`Clone`, and its `allocator` field is private — use the `allocator` method from `GetAllocator`.
- `AstBuilder` and `NONE` are no longer re-exported from the crate root; import them from `oxc_ast::builder`. (The `disable_old_builder` feature already gated these off, so nothing in-tree used the root path.)
- The `disable_old_builder` feature no longer exists — remove it from any manifest that sets it.

A migration note covering all of the above is in `crates/oxc_ast/src/builder/mod.rs`.

---

Implemented with AI assistance (Claude Code); design, review, and verification driven by the author per the repo AI-usage policy.
2026-07-21 15:22:46 +00:00
Dunqing 79e6d775fb fix(minifier): preserve RegExp feature detection (#24712)
> **PR stack (3 of 3)**
> 1. #24739
> 2. #24742
> 3. **#24712 (this PR)**
>
> Review #24739 and #24742 first. This PR is based on #24742, so GitHub shows only the RegExp behavior change.

Stacked on #24742, which exposes strict engine-target capabilities to side-effect analysis.

RegExp constructor calls used for engine feature detection were removed by DCE when their pattern was valid according to the current Oxc RegExp parser. A pattern can be valid at build time but still throw a `SyntaxError` on the configured runtime, so removing the call changes the result of surrounding `try`/`catch` checks.

RegExp purity now requires both syntactic validity and support from every configured target. Consumers without concrete targets remain conservative, while an explicit target allows the minifier to remove constructors known to be safe for those engines.

Target-independent flag validation and pattern compatibility checks now live in `oxc_regular_expression`; side-effect analysis only maps target support to unsupported flags and patterns. String patterns, modern flags, named groups, property escapes, lookbehind, modifiers, invalid flags, and lone-surrogate strings are covered. A RegExp literal with replacement flags is removable only when the target supports both those flags and the dedicated `ES2015RegExpConstructorCanAlterFlags` compatibility feature. Explicitly targeting `esnext` opts into current features.

## Example

Input:

```js
export function supportsUnicodeRegExp() {
  try {
    new RegExp("\\p{Ll}", "u");
    return true;
  } catch {
    return false;
  }
}
```

Before:

```js
export function supportsUnicodeRegExp() {
  try {
    return true;
  } catch {
    return false;
  }
}
```

After:

```js
export function supportsUnicodeRegExp() {
  try {
    new RegExp("\\p{Ll}", "u");
    return true;
  } catch {
    return false;
  }
}
```

Verified with all `oxc_regular_expression`, `oxc_compat`, `oxc_ecmascript`, and `oxc_minifier` tests; the no-feature/`side_effects`/`constant_evaluation` `oxc_ecmascript` matrix; affected-crate clippy; formatting; and diff checks.

Fixes rolldown/rolldown#10279.

Implemented with AI assistance (OpenAI Codex and Claude). The contributor remains responsible for reviewing, understanding, and submitting these changes under the repository AI usage policy.
2026-07-21 14:15:24 +00:00
renovate[bot] 75ce81de95 chore(deps): update rust crate syn to v3 (#24684)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | major | `2` → `3` |

---

### Release Notes

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v3.0.0`](https://redirect.github.com/dtolnay/syn/releases/tag/3.0.0)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.119...3.0.0)

This release contains adjustments to the syntax tree to account for
ongoing Rust language development from the 3 years since syn 2.0.0 and
to anticipate some in-flight Rust language RFCs.

These include: default values in fields, pinned type sugar, raw
lifetimes, generator blocks and functions, unnamed enum variants,
attributes in tuple types and tuple patterns, named arguments in
parenthesized generic argument lists, lightweight clones, const traits,
const function pointers, mutability restricted fields, supertrait auto
implementation, final associated functions, trait implementability
restrictions, const blocks in path arguments, item-level const blocks,
return type notation, never patterns, function delegation, mutable
by-reference bindings, in-place initialization, field projections,
explicitly dyn-compatible traits, view types, file-level frontmatter,
generic const arguments, guard patterns, lazy type aliases, explicitly
safe foreign items, super let, unsafe fields, pattern types,
heterogeneous try-blocks, function contracts, async function trait
bounds, static closure coroutine syntax, unsafe binder types, move
expressions, for-await loops, and postfix keywords.

<br>

<p align="center"><a href="https://docs.rs/syn/3/syn">[API documentation
for 3.0]</a></p>

### Breaking changes
#### Modifiers

To reserve more room for language evolution, there are 10 new
non-exhaustive structs in the syntax tree having the following
commonality:

- Name ending in `Modifiers`. {`BlockModifiers`, `ClosureModifiers`,
`ConstModifiers`, `FieldModifiers`, `FnModifiers`, `ImplModifiers`,
`LocalModifiers`, `TraitBoundModifiers`, `TraitModifiers`,
`TypeModifiers`}

- Each implements `Default`. The default value is guaranteed to comprise
no tokens.

- Non-exhaustive. Can only be instantiated by Syn's parser or by
creating and then mutating `▁▁Modifiers::default()`.

- Does not implement `Parse`. When parsing, they are parsed by the
enclosing syntax tree node.

- Does not implement `ToTokens`. In some cases the syntax that these
nodes might hold in the future is not necessarily contiguous tokens.

- Provides `.require_empty() -> Result<()>` which returns a meaningfully
spanned error if the modifiers are different from the empty default.
This enables a caller to reject syntax it does not recognize without
knowing what that syntax may be.

#### Types

- `Type::BareFn` has been renamed to `Type::FnPtr` to mirror the
compiler's terminology. Together with this, `BareVariadic` is renamed to
`FnPtrVariadic`.

- The mutually exclusive `const_token` and `mutability` fields of
`Type::Ptr` have been unified into an enum of type `PointerMutability`,
which was already previously used by `Expr::RawAddr`.

- Every `Type` variant now holds attributes, which can represent the
attributes of element types inside a tuple type, or attributes for a
function return type.

- `BareFnArg` is renamed to `NamedArg` and is used in
`ParenthesizedGenericArguments`, in addition to the existing use in
`Type::FnPtr`.

#### Expressions

- In `Expr::Closure`, the fields `or1_token` and `or2_token` have been
renamed to `inputs_begin` and `inputs_end` to indicate the beginning and
ending `|` token of the closure inputs.

#### Statements

- Attributes are now preserved on all expression kinds in statement
position. Previously, parsing would silently lose attributes on some
expression statements without a dedicated Expr variant, such as
tail-call expressions.

#### Patterns

- The `guard` field of `Arm` is replaced by a new `Pat::Guard` variant
held in the arm's `pat`.

#### Items

- The `unsafety` field of `Signature`, which represented the presence or
absence of `unsafe`, is replaced by a 3-way `Safety` enum which may be
safe, unsafe, or default. `ForeignItem::Static` also gets a `Safety`.

- Some of the fields of `Receiver` have been split to a non-exhaustive
`ReceiverKind` enum to create room for proposed new kinds of method
receivers, such as pinned.

- Type aliases now hold a `WhereClausePlacement` to distinguish between
early placement (which is the default for item-level type aliases and is
*deprecated* in associated type aliases) and late placement (which is
the default for associated type aliases and is *unstable* in item-level
type aliases). Parsing and printing a syntax tree will now preserve the
where-clause placement rather than rewriting it to the default placement
for the item kind.

#### Generics

- `WherePredicate::Lifetime` and `WherePredicate::Type` have a new field
holding the attributes on the where-predicates.

- `GenericParam::Type` and `GenericParam::Const` now match the rest of
the syntax tree in holding their optional default using a single Option
of tuple, rather than a pair of Option.

#### Literals

- The `Parse` implementation of `Lifetime` no longer permits keyword
lifetimes, matching a change in Rust 1.81 to deny such lifetimes
pre-expansion. `Lifetime::parse_any` may be used to parse lifetimes
permissive of keywords.

- `LitInt` and `LitFloat` no longer implement
`From<proc_macro2::Literal>`. Use `Lit::new(literal)` and then match
`Lit::Int` or `Lit::Float`.

- The `StrStyle` enum was unused and has been deleted.

#### More

- `File` contains a new `Option<Frontmatter>`, but does not yet parse
frontmatter in `syn::parse_file` until that language feature progresses
closer to stabilization.

- Some enums no longer provide `From` impls. Construct the variant by
name instead, such as `Expr::Array(e)` in place of `e.into()`.

- The `pop` method of `Punctuated<T, P>` now returns `Option<T>`
discarding the trailing punctuation if any, rather than `Option<Pair<T,
P>>`. A new method `pop_pair` provides the old behavior.

- Syntax tree traversal (`visit`, `visit_mut`, `fold`) no longer
provides a method for processing `Span`. This was already incompletely
supported and never walked most of the spans in a syntax tree.

- The `Speculative` and `AnyDelimiter` traits have been sealed and
cannot be implemented for types outside of Syn's `ParseStream`.

</details>

---

### Configuration

📅 **Schedule**: (in timezone Asia/Shanghai)

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2026-07-19 20:57:12 +01:00
renovate[bot] da927afaa5 chore(deps): update rust crates (#24681)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anyhow](https://redirect.github.com/dtolnay/anyhow) |
workspace.dependencies | patch | `1.0.103` → `1.0.104` |
| [bitflags](https://redirect.github.com/bitflags/bitflags) |
workspace.dependencies | patch | `2.13.0` → `2.13.1` |
| [compact_str](https://redirect.github.com/ParkMyCar/compact_str) |
workspace.dependencies | minor | `0.9.1` → `0.10.0` |
| [futures](https://rust-lang.github.io/futures-rs)
([source](https://redirect.github.com/rust-lang/futures-rs)) |
workspace.dependencies | patch | `0.3.32` → `0.3.33` |
|
[ignore](https://redirect.github.com/BurntSushi/ripgrep/tree/master/crates/ignore)
([source](https://redirect.github.com/BurntSushi/ripgrep/tree/HEAD/crates/ignore))
| workspace.dependencies | patch | `0.4.28` → `0.4.30` |
| [prettyplease](https://redirect.github.com/dtolnay/prettyplease) |
workspace.dependencies | minor | `0.2.37` → `0.3.0` |
| [proc-macro2](https://redirect.github.com/dtolnay/proc-macro2) |
workspace.dependencies | patch | `1.0.106` → `1.0.107` |
| [quote](https://redirect.github.com/dtolnay/quote) |
workspace.dependencies | patch | `1.0.46` → `1.0.47` |
| [self_cell](https://redirect.github.com/Voultapher/self_cell) |
workspace.dependencies | minor | `1.2.2` → `1.3.0` |
| [serde](https://serde.rs)
([source](https://redirect.github.com/serde-rs/serde)) |
workspace.dependencies | patch | `1.0.228` → `1.0.229` |
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | patch | `2.0.118` → `2.0.119` |
| [tokio](https://tokio.rs)
([source](https://redirect.github.com/tokio-rs/tokio)) |
workspace.dependencies | minor | `1.52.3` → `1.53.0` |
| [toml](https://redirect.github.com/toml-rs/toml) |
workspace.dependencies | patch | `1.1.2+spec-1.1.0` → `1.1.3` |

---

### Release Notes

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

###
[`v1.0.104`](https://redirect.github.com/dtolnay/anyhow/releases/tag/1.0.104)

[Compare
Source](https://redirect.github.com/dtolnay/anyhow/compare/1.0.103...1.0.104)

- Update `syn` dev-dependency to version 3

</details>

<details>
<summary>bitflags/bitflags (bitflags)</summary>

###
[`v2.13.1`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2131)

[Compare
Source](https://redirect.github.com/bitflags/bitflags/compare/2.13.0...2.13.1)

#### What's Changed

- Lower the LLVM IR output of the generated output by
[@&#8203;bolshoytoster](https://redirect.github.com/bolshoytoster) in
[#&#8203;492](https://redirect.github.com/bitflags/bitflags/pull/492)

#### New Contributors

- [@&#8203;bolshoytoster](https://redirect.github.com/bolshoytoster)
made their first contribution in
[#&#8203;492](https://redirect.github.com/bitflags/bitflags/pull/492)

**Full Changelog**:
<https://github.com/bitflags/bitflags/compare/2.13.0...2.13.1>

</details>

<details>
<summary>ParkMyCar/compact_str (compact_str)</summary>

###
[`v0.10.0`](https://redirect.github.com/ParkMyCar/compact_str/blob/HEAD/CHANGELOG.md#0100)

[Compare
Source](https://redirect.github.com/ParkMyCar/compact_str/compare/v0.9.1...v0.10.0)

##### July 12, 2026

#### Changes

- Minimum supported Rust version (MSRV) was bumped to `v1.71`.
- The `Error` trait impls once again require the `std` feature. This
reverts the (unreleased)
no-std `core::error::Error` support from
[#&#8203;443](https://redirect.github.com/ParkMyCar/compact_str/pull/443),
which required Rust `v1.81`, it can return once the MSRV reaches
`v1.81`.
- Added support for the [`garde`](https://crates.io/crates/garde)
validation crate under an
optional feature, implementing its string rule traits for
`CompactString`.
- Implemented in [`feat: add garde validation
support`](https://redirect.github.com/ParkMyCar/compact_str/pull/471).
- Added support for the [`schemars`](https://crates.io/crates/schemars)
crate under an optional
feature, implementing `JsonSchema` for `CompactString`. Every method
delegates to `String`'s
  impl, so the generated schema is identical to a `String`'s.
- Implemented in [`feat: support
schemars`](https://redirect.github.com/ParkMyCar/compact_str/pull/454).
- Added support for the [`valuable`](https://crates.io/crates/valuable)
crate under an optional
feature, implementing the `Valuable` trait for `CompactString` so it
presents as a `Value::String`.
- Implemented in [`Add impl
Valuable`](https://redirect.github.com/ParkMyCar/compact_str/pull/451).
- Added a `pyo3` feature which implements
[`FromPyObject`](https://docs.rs/pyo3/0.29/pyo3/conversion/trait.FromPyObject.html)
and
[`IntoPyObject`](https://docs.rs/pyo3/0.29/pyo3/conversion/trait.IntoPyObject.html)
for `CompactString`, so it can
  be used seamlessly with [`pyo3`](https://crates.io/crates/pyo3) v0.29.
- Implemented in [`feat: add pyo3
feature`](https://redirect.github.com/ParkMyCar/compact_str/pull/446).
- Added support for the [`defmt`](https://crates.io/crates/defmt) crate
under an optional feature,
  implementing `defmt::Format` for `CompactString`.
- Implemented in [`feat: Add support for
defmt`](https://redirect.github.com/ParkMyCar/compact_str/pull/438).
- Added a `bevy-reflect` feature which implements
[`bevy_reflect`](https://crates.io/crates/bevy_reflect)'s
  reflection traits for `CompactString` (as an opaque type).
- Implemented in [`feat: Add bevy-reflect
feature`](https://redirect.github.com/ParkMyCar/compact_str/pull/439).
- Added a `utoipa` feature which implements
[`utoipa`](https://crates.io/crates/utoipa)'s
  `PartialSchema` and `ToSchema` traits for `CompactString`.
- Implemented in [`fix sqlx type impl, add utoipa
feature`](https://redirect.github.com/ParkMyCar/compact_str/pull/442)
and [`feat: fixup the utoipa
feature`](https://redirect.github.com/ParkMyCar/compact_str/pull/445).
- Removed `#[must_use]` from the `Drain` iterator.
- Implemented in [`fix: remove #[must_use] from
Drain`](https://redirect.github.com/ParkMyCar/compact_str/pull/486).
- Added [Kani](https://redirect.github.com/model-checking/kani) proof
harnesses to formally verify the crate's
  unsafe code.
- Implemented in [`feat: add kani proof harnesses to verify unsafe
code`](https://redirect.github.com/ParkMyCar/compact_str/pull/480).
- Bump the [`sqlx`](https://crates.io/crates/sqlx) dependency to `v0.9`.
Enabling the `sqlx`
  feature now requires Rust `v1.94`.
- Implemented in [`deps: bump sqlx to
0.9`](https://redirect.github.com/ParkMyCar/compact_str/pull/474).
- Bump the [`bevy_reflect`](https://crates.io/crates/bevy_reflect)
dependency to `v0.19`.
- Implemented in [`deps: update optional deps to
latest`](https://redirect.github.com/ParkMyCar/compact_str/pull/490).
- Bump the [`markup`](https://crates.io/crates/markup) dependency to
`v0.16`.
- Implemented in [`deps: update optional deps to
latest`](https://redirect.github.com/ParkMyCar/compact_str/pull/490).

#### Bug Fixes

- Fixed possible undefined behavior when reallocating a heap-allocated
`CompactString`.
- Implemented in [`fix: possible undefined behavior with realloc in a
HeapString`](https://redirect.github.com/ParkMyCar/compact_str/pull/459).
- Fixed `CompactString::retain` to avoid briefly creating references to
invalid UTF-8.
- Implemented in [`Avoid invalid UTF-8 references in
retain`](https://redirect.github.com/ParkMyCar/compact_str/pull/469).
- Fixed `CompactString::as_mut_bytes` exposing uninitialized spare
capacity through a `&mut [u8]`;
  heap spare capacity is now zero-initialized before it's returned.
- Implemented in [`fix: avoid exposing uninitialized spare
capacity`](https://redirect.github.com/ParkMyCar/compact_str/pull/468).

#### Performance

- Reuse an owned `String`'s existing allocation in `CompactString::new`.
- Implemented in [`perf: reuse owned String in
CompactString::new`](https://redirect.github.com/ParkMyCar/compact_str/pull/460).
- Specialize `ToCompactString` for `str`.
- Implemented in [`perf: specialize ToCompactString for
str`](https://redirect.github.com/ParkMyCar/compact_str/pull/461).
- Pass heap fields by value when dropping a `CompactString` instead of
`&mut Repr`.
- Implemented in [`perf: Drop passes heap fields by-value instead of
&mut Repr`](https://redirect.github.com/ParkMyCar/compact_str/pull/462).
- Skip the `Result` on the hot inline construction path with
`Repr::new_panic`.
- Implemented in [`perf: add Repr::new_panic to skip Result on the hot
inline
path`](https://redirect.github.com/ParkMyCar/compact_str/pull/463).
- Assert internal `Repr` invariants so the compiler can fold dead
error-handling branches on construction.
- Implemented in [`perf: assert Repr invariants to fold dead Err arms on
construction`](https://redirect.github.com/ParkMyCar/compact_str/pull/467).
- Speed up append, integer formatting, and inline creation.
- Implemented in [`perf: speed up append, integer formatting, and inline
creation`](https://redirect.github.com/ParkMyCar/compact_str/pull/479).
- Bulk-copy valid runs in `from_utf8_lossy` instead of copying
byte-by-byte.
- Implemented in [`perf: bulk-copy valid runs in
from_utf8_lossy`](https://redirect.github.com/ParkMyCar/compact_str/pull/484).
- Specialize memory copies for small/medium strings to avoid calling
`memcpy`. Keep heap construction out-of-line,
and move the OOM panic off the hot construction path to keep generated
assembly lean.
- Implemented in [`perf: several small
improvements`](https://redirect.github.com/ParkMyCar/compact_str/pull/488).
- Replaced the `ryu` dependency with
[`zmij`](https://crates.io/crates/zmij) for float formatting.
- Implemented in [`deps: replace ryu with zmij for float
formatting`](https://redirect.github.com/ParkMyCar/compact_str/pull/485).

</details>

<details>
<summary>rust-lang/futures-rs (futures)</summary>

###
[`v0.3.33`](https://redirect.github.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#0333---2026-07-18)

[Compare
Source](https://redirect.github.com/rust-lang/futures-rs/compare/0.3.32...0.3.33)

- Fix `ReadLine`'s soundness issue regarding to exception safety.
([#&#8203;3020](https://redirect.github.com/rust-lang/futures-rs/issues/3020))
- Fix unsound `Send` impl for `IterPinRef` and `Iter`.
([#&#8203;3003](https://redirect.github.com/rust-lang/futures-rs/issues/3003))
- Fix stacked borrows violation in `compat01as03` implementation.
([#&#8203;3012](https://redirect.github.com/rust-lang/futures-rs/issues/3012))
- Fix memory leak in `FuturesUnordered::IntoIter`.
([#&#8203;3005](https://redirect.github.com/rust-lang/futures-rs/issues/3005))
- Add `portable-atomic-alloc` feature and use it in `FuturesUnordered`.
([#&#8203;3007](https://redirect.github.com/rust-lang/futures-rs/issues/3007))
- Re-export `alloc::task::Wake`.
([#&#8203;3010](https://redirect.github.com/rust-lang/futures-rs/issues/3010))
- Update `spin` to 0.12.
([#&#8203;3014](https://redirect.github.com/rust-lang/futures-rs/issues/3014))

</details>

<details>
<summary>BurntSushi/ripgrep (ignore)</summary>

###
[`v0.4.30`](https://redirect.github.com/BurntSushi/ripgrep/compare/ignore-0.4.29...ignore-0.4.30)

[Compare
Source](https://redirect.github.com/BurntSushi/ripgrep/compare/ignore-0.4.29...ignore-0.4.30)

###
[`v0.4.29`](https://redirect.github.com/BurntSushi/ripgrep/compare/ignore-0.4.28...ignore-0.4.29)

[Compare
Source](https://redirect.github.com/BurntSushi/ripgrep/compare/ignore-0.4.28...ignore-0.4.29)

</details>

<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>

###
[`v0.3.0`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.3.0)

[Compare
Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.37...0.3.0)

- Update to syn 3 (release notes:
<https://github.com/dtolnay/syn/releases/tag/3.0.0>)

</details>

<details>
<summary>dtolnay/proc-macro2 (proc-macro2)</summary>

###
[`v1.0.107`](https://redirect.github.com/dtolnay/proc-macro2/releases/tag/1.0.107)

[Compare
Source](https://redirect.github.com/dtolnay/proc-macro2/compare/1.0.106...1.0.107)

- Documentation improvements

</details>

<details>
<summary>dtolnay/quote (quote)</summary>

###
[`v1.0.47`](https://redirect.github.com/dtolnay/quote/releases/tag/1.0.47)

[Compare
Source](https://redirect.github.com/dtolnay/quote/compare/1.0.46...1.0.47)

- Documentation improvements

</details>

<details>
<summary>Voultapher/self_cell (self_cell)</summary>

###
[`v1.3.0`](https://redirect.github.com/Voultapher/self_cell/releases/tag/v1.3.0):
Version 1.3.0

[Compare
Source](https://redirect.github.com/Voultapher/self_cell/compare/v1.2.2...v1.3.0)

- Async `self_cell` construction is now `Send`, this makes using it with
tokio easier. This comes at no additional performance cost. See
[#&#8203;74](https://redirect.github.com/Voultapher/self_cell/issues/74)
for more details.
- Fixed some typos in the docs.

</details>

<details>
<summary>serde-rs/serde (serde)</summary>

###
[`v1.0.229`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.229)

[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

- Update to syn 3

</details>

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v2.0.119`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.119)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.118...2.0.119)

- Preserve attributes on tail-call expressions in statement position
([#&#8203;1994](https://redirect.github.com/dtolnay/syn/issues/1994))
- Parse field-representing types builtin in type position
([#&#8203;1996](https://redirect.github.com/dtolnay/syn/issues/1996))

</details>

<details>
<summary>tokio-rs/tokio (tokio)</summary>

###
[`v1.53.0`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.53.0):
Tokio v1.53.0

[Compare
Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.4...tokio-1.53.0)

### 1.53.0 (July 17th, 2026)

##### Added

- fs: implement `From<OwnedFd>` and `From<OwnedHandle>` for `File`
([#&#8203;8266])
- metrics: add task schedule latency metric ([#&#8203;7986])
- net: add `SocketAddr` methods to Unix sockets ([#&#8203;8144])

##### Changed

- io: add `#[inline]` to IO trait impls for in-memory types
([#&#8203;8242])
- net: implement UCred::pid on FreeBSD ([#&#8203;8086])
- net: support Nuttx target os ([#&#8203;8259])
- signal: refactor global variables on Windows ([#&#8203;8231])
- sync: `mpsc::{Receiver,UnboundedReceiver}` now drops waker on drop,
even if there are still senders ([#&#8203;8095])
- taskdump: support taskdumps on s390x ([#&#8203;8192])
- time: add `#[track_caller]` to `timeout_at()` ([#&#8203;8077])
- time: consolidate mutex locks on spurious poll ([#&#8203;8124])
- time: defer waker clone on spurious poll ([#&#8203;8107])
- time: move lazy-registration state into `Sleep` ([#&#8203;8132])
- tracing: remove unnecessary span clone ([#&#8203;8126])

##### Fixed

- io: do not treat zero-length reads as EOF in `Chain` ([#&#8203;8251])
- net: use getpeereid for QNX peer credentials ([#&#8203;8270])
- runtime: avoid illegal state in `FastRand` ([#&#8203;8078])
- sync: wake mpsc receiver when a queued `reserve[_many]` returns
permits ([#&#8203;8260])
- taskdump: skip double wake on `Trace::capture`/`Trace::trace_with`
([#&#8203;8043])
- time: avoid stack overflow in runtime constructor ([#&#8203;8093])
- time (alt timer): ensure timers stay in the same runtime after
`.reset()` ([#&#8203;8169])

##### IO uring (unstable)

- fs: use io-uring for `fs::try_exists` ([#&#8203;8080])
- fs: use io-uring for renaming files ([#&#8203;7800])
- rt: flush io-uring CQE in case of CQE overflow ([#&#8203;8277])

##### Documented

- docs: clarify cancel safety wording ([#&#8203;8181])
- fs: clarify `create_dir_all` succeeds if path exists ([#&#8203;8149])
- io: add warning about stdout reordering with multiple handles
([#&#8203;8276])
- net: document pipe `try_read*`/`try_write*` readiness behavior
([#&#8203;8032])
- runtime: document interaction with fork() ([#&#8203;8202])
- sync: clarify broadcast lagging semantics ([#&#8203;8239])
- sync: document memory ordering guarantees for Semaphore
([#&#8203;8119])
- task: explain why `yield_now` defers its waker ([#&#8203;8254])
- time: add panic docs to `timeout_at()` ([#&#8203;8077])
- time: fix reversed poll order in timeout doc ([#&#8203;8214])

[#&#8203;7800]: https://redirect.github.com/tokio-rs/tokio/pull/7800

[#&#8203;7986]: https://redirect.github.com/tokio-rs/tokio/pull/7986

[#&#8203;8032]: https://redirect.github.com/tokio-rs/tokio/pull/8032

[#&#8203;8043]: https://redirect.github.com/tokio-rs/tokio/pull/8043

[#&#8203;8077]: https://redirect.github.com/tokio-rs/tokio/pull/8077

[#&#8203;8078]: https://redirect.github.com/tokio-rs/tokio/pull/8078

[#&#8203;8080]: https://redirect.github.com/tokio-rs/tokio/pull/8080

[#&#8203;8086]: https://redirect.github.com/tokio-rs/tokio/pull/8086

[#&#8203;8093]: https://redirect.github.com/tokio-rs/tokio/pull/8093

[#&#8203;8095]: https://redirect.github.com/tokio-rs/tokio/pull/8095

[#&#8203;8107]: https://redirect.github.com/tokio-rs/tokio/pull/8107

[#&#8203;8119]: https://redirect.github.com/tokio-rs/tokio/pull/8119

[#&#8203;8124]: https://redirect.github.com/tokio-rs/tokio/pull/8124

[#&#8203;8126]: https://redirect.github.com/tokio-rs/tokio/pull/8126

[#&#8203;8132]: https://redirect.github.com/tokio-rs/tokio/pull/8132

[#&#8203;8144]: https://redirect.github.com/tokio-rs/tokio/pull/8144

[#&#8203;8149]: https://redirect.github.com/tokio-rs/tokio/pull/8149

[#&#8203;8169]: https://redirect.github.com/tokio-rs/tokio/pull/8169

[#&#8203;8181]: https://redirect.github.com/tokio-rs/tokio/pull/8181

[#&#8203;8192]: https://redirect.github.com/tokio-rs/tokio/pull/8192

[#&#8203;8193]: https://redirect.github.com/tokio-rs/tokio/pull/8193

[#&#8203;8202]: https://redirect.github.com/tokio-rs/tokio/pull/8202

[#&#8203;8214]: https://redirect.github.com/tokio-rs/tokio/pull/8214

[#&#8203;8231]: https://redirect.github.com/tokio-rs/tokio/pull/8231

[#&#8203;8239]: https://redirect.github.com/tokio-rs/tokio/pull/8239

[#&#8203;8242]: https://redirect.github.com/tokio-rs/tokio/pull/8242

[#&#8203;8251]: https://redirect.github.com/tokio-rs/tokio/pull/8251

[#&#8203;8254]: https://redirect.github.com/tokio-rs/tokio/pull/8254

[#&#8203;8259]: https://redirect.github.com/tokio-rs/tokio/pull/8259

[#&#8203;8260]: https://redirect.github.com/tokio-rs/tokio/pull/8260

[#&#8203;8266]: https://redirect.github.com/tokio-rs/tokio/pull/8266

[#&#8203;8270]: https://redirect.github.com/tokio-rs/tokio/pull/8270

[#&#8203;8276]: https://redirect.github.com/tokio-rs/tokio/pull/8276

[#&#8203;8277]: https://redirect.github.com/tokio-rs/tokio/pull/8277

###
[`v1.52.4`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.52.4):
Tokio v1.52.4

[Compare
Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.3...tokio-1.52.4)

### 1.52.4 (July 16th, 2026)

##### Fixed

- runtime: don't skip the driver when `before_park` schedules work
([#&#8203;8222])

##### Fixed (unstable)

- taskdump: remove crate disambiguators from output ([#&#8203;8264])

[#&#8203;8264]: https://redirect.github.com/tokio-rs/tokio/pull/8264

[#&#8203;8222]: https://redirect.github.com/tokio-rs/tokio/pull/8222

</details>

<details>
<summary>toml-rs/toml (toml)</summary>

###
[`v1.1.3`](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.2...toml-v1.1.3)

[Compare
Source](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.2...toml-v1.1.3)

</details>

---

### Configuration

📅 **Schedule**: (in timezone Asia/Shanghai)

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2026-07-19 18:22:30 +01:00
overlookmotel 85a6853e0b fix(tasks): enable disable_old_builder Cargo feature for oxc_ast crate for all tasks (#23885)
Part of #23043.

We don't enable `oxc_ast`'s `disable_old_builder` Cargo feature in any of our published crates, or crates that are depended on by published crates.

Tasks are private to the repo, so enable this feature on them, to ensure no usage of legacy `AstBuilder` methods sneak in during the transition period before we delete these methods.
2026-06-28 12:13:17 +00:00
leaysgur b3185b96ab chore(deps): Bump degit and use from catalog (#22707) 2026-05-25 05:34:28 +00:00
Boshen 8f98fa0d4e test(rust): disable empty test and doctest targets (#17409)
## Summary

- Disable `test = false` and `doctest = false` for crates that have no tests
- Reduces CI noise from "0 passed; 0 failed" output
- Saves compilation time for empty test targets

**Affected crates:**
- `oxc_ast_macros` - lib test
- `oxc_language_server` - bin test, lib doctest
- `oxc_napi` - lib test
- `oxc_syntax` - lib doctest
- `oxc_compat_data` - bin test
- `oxc_coverage` - lib test
- `oxc_linter_codegen` - bin test
- `oxc_prettier_conformance` - lib test
- `oxc_transform_conformance` - lib test
- `vscode_docs` - bin test
- `website_common` - lib test, lib doctest

## Test plan

- [x] `cargo test` passes with no empty test suites

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-12-28 11:44:19 +00:00
Boshen c16082c448 feat(tasks/compat_data): integrate node-compat-table (#16831)
Node version changes:

* TemplateLiterals: 8.10 -> 10.0
* Classes: 5.0 -> 6.0
* ObjectSuper: 5.0 -> 6.0
* Spread: 5.0 -> 6.0
* TypeofSymbol: 0.12 -> 4.0
* OptionalChaining: 16.9 -> 16.1
* PrivatePropertyInObject: 16.9 -> 16.4

fixes #11941
fixes https://github.com/rolldown/rolldown/issues/7293
2025-12-18 10:21:48 +00:00
Boshen 6fca2f7f60 chore(infra): use oxfmt for all files, remove dprint (#16599)
Toml formatting is missing but there's only a few toml files, can wait
for oxfmt plugins.

- [x] Something is slow, can't figure out why, need #16607
2025-12-15 12:06:24 +00:00
Boshen 523a30a016 style(all): apply oxfmt default options (#16091)
Embrace the defaults!

---------

Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
2025-11-25 15:56:24 +09:00
Copilot 2c15353822 feat(transformer): warn top level await usage if not supported (#14276)
## Implementation Complete: Add warning for top-level await usage

Successfully implemented warning for top-level await usage when the
target doesn't support it, following the same pattern as the existing
BigInt warning.

✅ **Successfully merged main branch and resolved all conflicts**

All changes have been merged with the latest main and all tests pass.
Ready for review and merge.

## Summary

- [x] Add `ES2022TopLevelAwait` feature to `oxc_compat` crate  
- [x] Add `top_level_await` option to `ES2022Options`
- [x] Update `EnvOptions` to include `top_level_await` feature detection
- [x] Implement `enter_await_expression` handler in `ES2022` to emit
warning for top-level await
- [x] Add test cases to verify the warning is emitted correctly
- [x] Run tests to ensure everything works
- [x] Address review feedback: use `ctx.scoping().root_scope_id()` to
check for top-level
- [x] Add feature to `es-features.js` for proper tracking  
- [x] Add test case for nested block with await (confirms current
implementation is correct)
- [x] **Merge main branch and resolve all conflicts** ✨

## Test Results
All tests pass successfully:
- ✅ oxc_transformer: 30 unit tests + 3 integration tests (es_target)
- ✅ oxc_compat: 3 tests
- ✅ No clippy warnings
- ✅ Successfully merged with latest main

## Resolved Conflicts
Merged with main and resolved conflicts in:
- `crates/oxc_compat/src/es_features.rs` - kept both
ES2020ArbitraryModuleNamespaceNames and ES2022TopLevelAwait features
- `crates/oxc_transformer/src/lib.rs` - kept both import/export
specifier methods and await expression method
- `crates/oxc_transformer/tests/integrations/es_target.rs` - kept both
test cases
- `crates/oxc_transformer/tests/integrations/snapshots/es_target.snap` -
updated test numbering to include both features
- `tasks/compat_data/data.json` - kept both
ArbitraryModuleNamespaceNames and TopLevelAwait entries

Fixes oxc-project/oxc#14258

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>transformer: warn top level await usage if not
supported</issue_title>
> <issue_description>A warning is emitted when BigInt is used and the
target does not support it
([playground](https://playground.oxc.rs/#eNptUj1vGzEM/SuGZg9Np9ZFp6YGAvQjyJCd0fEuSnTkgeQ5Dg7+76Euljwkk6RHkXzvkUuIYRcik9qmZ9783FzRj7ANHHZLkJnKkRNZ2PWQFbehZxnBDOUjcnPBTIC0BMLOZHYgKWcw7K4xZhCw5B3b75fHZKgTRGzQCDTkyzPyOAnqJUUjTx5+L66v4wPn+or9cP522oYJRAvXJeDRkNT7ul7To2uEnPnlDm0W+j+bpg73M8VCrZYqPVEOeAviuRVd8+6/3ZBJ8oqxBRSdtqX4W4TljDqH4t/Kwe/NmHdSBjKgmxtQv365+u6kZsVr7BPhnuVXBtV9wty1FnicUNKIZJDdS3YrWyuPjska+hcNOjBoPD6fwRLUdUyuBoXAXazWRe5wwHUDqIy4GfykHfvWnM0gYltrVSTjUP+uVerkivw6VlfO0x88YCv6jDj9gxHriNdUd5jz3t0uGQeUB9a6E0UPPWF085bL7eRwt9pX4HY7FbzYXDWd3gBEIxCc)).
Similar to that, it would be helpful if a warning is emitted for
top-level await as well.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>
Fixes oxc-project/oxc#14258

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2025-11-03 10:03:13 +08:00
Copilot aee631081b feat(transformer): add warning for arbitrary module namespace identifier names (#15035)
feat(transformer): add warning for arbitrary module namespace identifier
names

Implements warnings for the ES2020 "Arbitrary module namespace
identifier names" feature (TC39 proposal #2154), which allows string
literals as import/export specifiers. Similar to #14276.

### Changes

- **Compatibility data**: Added `ArbitraryModuleNamespaceNames` to
`tasks/compat_data/custom-compat-data.js` with browser support (Chrome
88+, Edge 88+, Opera 74+, Firefox 87+, Safari 14.1+, Node 16.0+, Deno
1.6+)
- **Transformer**: Added warning logic in `ES2020` for string literals
in `ImportSpecifier`, `ExportSpecifier`, and `ExportAllDeclaration`
nodes
- **Configuration**: Added `arbitrary_module_namespace_names` option and
environment target mapping

### Example

```javascript
// Triggers warning when targeting ES2019 or Chrome 87
export { foo as "kebab-case-name" };
import { "string-name" as bar } from "./module";
export * as "namespace" from "./module";
```

Warning message:
```
⚠ Arbitrary module namespace identifier names are not available in the configured target environment.
```

### Testing

Added integration tests covering supported/unsupported targets, multiple
literals, and normal identifiers.

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> Similar to https://github.com/oxc-project/oxc/pull/14276, add a
warning for "Arbitrary module namespace identifier names" feature
(https://github.com/tc39/ecma262/pull/2154). Add the compat data to
`tasks/compat_data/custom-compat-data.js` as the data is not included in
the compat table.


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Signed-off-by: 翠 <green@sapphi.red>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Co-authored-by: 翠 <green@sapphi.red>
2025-10-31 14:17:51 +08:00
leaysgur a8e5181ab7 chore(infra): dogfooding oxfmt (#14979)
Fixes #14803

- Added `oxfmt` and `oxfmtrc.jsonc`
- Remove `dprint` plugin and useless ignore paths
- Apply `dprint` again
- Apply `oxfmt`
2025-10-28 01:16:46 +00:00
sapphi-red d1ff7188d7 feat(tasks/compat_data): add custom compat data for export namespace from (#14317)
Added a way to add custom compat data that doesn't exist in compat table. Also added the data for "export namespace from".
2025-10-07 07:46:02 +00:00
Boshen 588acd55b4 feat(transformer): add ES2026 target for explicit resource management (#14330)
## Summary

fixes #12796

* Added target `ES2026`
* Moves the explicit resource management feature from proposals to ES2026, as it is now a finalized ECMAScript 2026 feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-05 07:12:53 +00:00
sapphi-red d1a0d04f0e feat(compat): extract compatibility data to oxc_compat crate (#13932)
Extracted compatibility data to a new `oxc_compat` crate so that we can use this information from the minifier as well.
2025-09-20 14:41:56 +00:00
Boshen b07cf3026b chore(compat_data): update compat-table to latest commit (#13761)
Updates compat-table dependency to the latest commit.

- Previous SHA: `047878d9b67327ebd642ea855649e029fe066a50`
- New SHA: `a970fc00cc33b58d0b84d4b290ea46a185c8fcf1`
2025-09-15 02:33:23 +00:00
oxc-bot 26746341ab chore(compat_data): update compat-table to latest commit (#13224)
Updates compat-table dependency to the latest commit.

- Previous SHA: `b3427ba3a2d6fd2dc427c3dfcf191832f634eb06`
- New SHA: `047878d9b67327ebd642ea855649e029fe066a50`

---------

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-20 10:27:23 +08:00
Boshen 83ac93cf8f chore(deps): bump oxc-browserslist (#12826) 2025-08-05 06:54:26 +00:00
Boshen ccd4d2e234 chore(compat_data): update (#9786) 2025-03-14 15:10:03 +00:00
overlookmotel a4a8e7deda style(all): replace #[allow] with #[expect] (#8930)
Replace `#[allow]` with `#[expect]` through the whole codebase.

This also surfaced many places where the `#[allow]` attributes were outdated/pointless and could be removed entirely.

Only places `#[allow]` remains are:

1. In generated code and macros, where lint errors may or may not be triggered depending on the generated code.
2. A few places where clippy malfunctions. These use e.g. `#[allow(unused, clippy::allow_attributes)]`.
2025-02-07 14:50:02 +00:00
overlookmotel 3858221f45 refactor(global): sort imports (#7883)
Pure refactor. Re-order imports for clarity:

1. `std`
2. External crates
3. `oxc_*` crates
4. Current crate `use crate::...`
5. Super `use super::...`
6. Local modules

This order is from "furthest away" to "closest". This makes it clearer to see what is coming from where.

`cargo +nightly fmt` (#7877) did a lot of the work, but unfortunately `rustfmt` does not have an option to (a) put workspace crates in a separate block from external crates and (b) move `mod` statements to after `use` statements.
2024-12-14 15:07:21 +00:00
Boshen 7fb9d47460 style(rust): cargo +nightly fmt (#7877) 2024-12-14 06:03:31 +00:00
Song Gao cf3415b0e4 chore(doc): replace main/master to tag/commit to make the url always accessible (#7298) 2024-11-16 21:00:30 +08:00
Boshen b57d00d6fb fix(tasks/compat_data): fix misplaced features (#7284)
closes #7279
2024-11-14 16:36:16 +00:00
Boshen 3a20b906f4 feat(transformer): add es target to engineTargets (#7193) 2024-11-08 03:25:21 +00:00
Boshen 22898c855a feat(transformer): warn BigInt when targeting < ES2020 (#7184)
closes #5822
2024-11-07 08:29:03 +00:00
Boshen a579011e37 feat(transformer): add features ES2018NamedCapturingGroupsRegex and ES2018LookbehindRegex (#7182) 2024-11-07 07:39:33 +00:00
Boshen ad3a2f518e feat(tasks/compat_data): generate our own compat table (#7176) 2024-11-07 07:39:33 +00:00
Boshen 14ce0eef44 feat(tasks/compat_data): init compat data task (#7156) 2024-11-07 07:39:32 +00:00