Commit Graph

59 Commits

Author SHA1 Message Date
camc314 46d237c9a7 chore(codegen,parser,tasks): pin benchmark fixtures by sha (#25557)
Pin the Codegen benchmark fixture to an immutable `benchmark-files` commit. This makes benchmark inputs reproducible and prevents `main` updates from silently changing results.
2026-08-12 15:56:52 +00:00
camc314 51cc574bba fix(tasks): use native TLS only on macOS (#24182)
## Summary

- use the native TLS backend on macOS so HTTPS requests work with Warp and custom roots from `SSL_CERT_FILE`
- use Rustls on other targets so Linux cross-builds do not pull in `openssl-sys`
- keep the existing proxy detection and custom certificate bundle handling

## Root cause

#24178 enabled `ureq/native-tls` for all targets. On macOS this is needed for Warp because Rustls/webpki rejects part of the intercepted certificate chain with `UnsupportedSignatureAlgorithmForPublicKeyContext`.

Enabling native TLS globally also adds `native-tls -> openssl-sys` to the 32-bit and big-endian Linux dependency graphs. Those cross images do not provide target OpenSSL development files, so the builds fail before tests run.

The TLS provider and feature are now selected by target: macOS uses the platform verifier through native TLS, while all other targets continue to use Rustls.
2026-07-05 17:38:25 +00:00
camc314 24c19a8216 fix(tasks): honor SSL_CERT_FILE for HTTPS requests (#24178)
## Summary

- load PEM root certificates from `SSL_CERT_FILE` for shared task HTTP requests
- use the native TLS verifier for custom bundles, supporting interception CAs such as Cloudflare WARP
- retain the existing Rustls/WebPKI defaults when `SSL_CERT_FILE` is unset

## Testing

- `cargo fmt --all -- --check`
- `cargo clippy -p oxc_tasks_common --all-targets -- -D warnings`
- `cargo minsize --compress-only ssl-cert-file` (downloaded all fixtures through WARP)
- `just minsize`
- `just ready` (format/check passed; workspace tests stopped on three unrelated oxlint stylish-output ANSI snapshot mismatches)

## AI disclosure

This change was developed with OpenAI Codex assistance and has been manually exercised against the reported Cloudflare WARP certificate setup.
2026-07-05 14:24:54 +00:00
Dunqing 53f0b2ee3e fix(coverage): use ephemeral ports for runtime servers (#24053)
## Summary

Self-review follow-up to #24034 (stacked on #24052), hardening the runtime suite's server transport:

- **Ephemeral ports + stdout handshake**: the fixed 32055..N port range let an orphaned server from a killed run pass the readiness probe (silently testing against a stale binary) and made two concurrent runs in different worktrees cross-talk — one run's shutdown DELETE kills the other's servers. `runtime.js` now listens on an OS-assigned ephemeral port and reports it as the first stdout line, which the runner reads as both the port and the readiness signal (the polling loop and port math are gone); remaining server stdout is drained by a background thread so `DEBUG=1` output can't deadlock a full pipe.
- **Transport retry**: monitor-oxc's first live Test262 run flipped 13 for-of cases to `timeout: global` — ureq's 10s client timeout tripping under CI load while requests queued, not a semantic change. A localhost-specific agent (no proxy, one-minute timeout) plus a single retry fixes it; the server responds even for failing tests, so a transport `Err` never carries a verdict.

Result-neutral: 17279/18277, `runtime.snap` byte-identical across repeated runs.
2026-07-02 09:19:22 +00:00
Dunqing 188b9e6b43 chore(bench): swap cal.com.tsx for excalidraw App.tsx everywhere (#22895)
## Summary

Follow-up to #22590. That PR replaced the synthetic `cal.com.tsx` fixture — a concatenation of Next.js pages that declares top-level names 70–113× and emits thousands of redeclaration diagnostics, inflating semantic `sys_allocs` — with excalidraw's real, single-file `App.tsx`. But it only touched `TestFiles::complicated()` (used by `track_memory_allocations`).

This applies the same swap to every remaining benchmark that still used `cal.com.tsx`, and unifies **all** excalidraw `App.tsx` references on one pin (`f6d85bc8`):

| File | Change |
| --- | --- |
| `tasks/common/src/test_file.rs` | `minimal()` (feeds every `tasks/benchmark` criterion bench): `cal.com.tsx` → `App.tsx@f6d85bc8`. `formatter()` re-pinned `@v0.18.0` → `@f6d85bc8` |
| `napi/parser/bench.bench.js` | parser benchmark fixture → `App.tsx@f6d85bc8` |
| `napi/parser/test/parse-raw.test.ts` | bench-fixture list + size comment → `App.tsx@f6d85bc8` |
| `tasks/benchmark/benches/semantic.rs` | rewrote the now-false "`cal.com.tsx` has many errors" comment |
| `crates/oxc_ast/src/serialize/mod.rs` | removed the stale `cal.com.tsx` row from the capacity-ratio doc table |

## Why a single pin

`get_source_text` caches downloads by the last URL segment only (`App.tsx`). With two different pins live, a single `cargo bench` run would download both into the same `target/App.tsx` and silently bench whichever landed first. Re-pinning `formatter()` to `f6d85bc8` removes that collision — and the pre-existing latent one between `cargo bench` (`@v0.18.0`) and `cargo allocs` (`@f6d85bc8`).

## Notes

No committed snapshots change: these fixtures feed only timing benches and a `programRaw.toEqual(programStandard)` self-consistency test; the snapshotted `complicated()` / `minifier()` sets are untouched.

---

This PR was prepared with AI assistance; I reviewed, tested, and verified the changes.
2026-06-01 16:21:32 +00:00
Dunqing a15be790bf feat(bench): add kitchen-sink.tsx to TestFiles (#22609)
## Summary

Adds `kitchen-sink.tsx` — a comprehensive synthetic TypeScript+JSX fixture maintained at [oxc-project/benchmark-files](https://github.com/oxc-project/benchmark-files) — to both `TestFiles::minimal()` (bench input set) and `TestFiles::complicated()` (alloc-tracking input set). The existing files in each set are untouched; this is a strict append.

## Why

The existing bench input set didn't reliably surface general-purpose perf wins above the ~1-2% measurement noise floor:
- #22580 (semantic pre-reserve) — visible because `binder.ts` exercises it
- #22594 (formatter buffer) — visible
- #22596 (minifier `try_fold_concat`) — **not visible** on the old set
- #22599 (semantic resolve-refs no-temp-Vec) — **not visible**
- #22603 (semantic var-hoist SmallVec) — **not visible**

The kitchen-sink fixes that by exercising every AST node, every transformer plugin, every minifier optimization opportunity, and every semantic step in one large file. Verified by re-benching #22596 against this fixture: **minifier mean −1.5%, min −3.7%** — above noise, signal confirmed.

## Fixture stats (cross-checked locally)

| Metric | Value |
|---|---|
| Source size | 21,117 lines / 732.90 kB |
| AST nodes | ~133,000 |
| Scopes | ~4,750 |
| Symbols | ~7,000 |
| Resolved references | ~16,000 |
| Semantic diagnostics | 0 errors / 0 warnings |

## Snap baselines

`tasks/track_memory_allocations/allocs_*.snap` updated with the kitchen-sink row across all 5 pipelines (parser / semantic / transformer / minifier / formatter). Future PRs that change allocation behavior on this fixture will produce a snap diff in CI.

## Bench-cleaner fix

`tasks/benchmark/benches/lexer.rs`'s `SourceCleaner` was missing `visit_ts_template_literal_type` — TypeScript type-level template literals (e.g. `` `${T}-${U}` `` in conditional / mapped types) are syntactically identical to value-level template literals, so the bench-mode lexer (without parser context) cannot distinguish them. Without the cleaner converting them to plain strings, kitchen-sink's type-level templates caused the lexer bench to swallow ~1 KB spans as a single `TemplateHead` and produce spurious "Unterminated string" / "Invalid Unicode escape" errors. One-line fix to mirror the existing `visit_template_literal` handling.

AI disclosure: drafted with Claude Code, reviewed manually.
2026-05-20 15:56:52 +00:00
Dunqing c7dfa6e9c4 chore(track-memory-allocations): swap cal.com.tsx for excalidraw App.tsx (#22590)
## Summary

`cal.com.tsx` (1.0MB) is a concatenation of many Next.js page files. Top-level names like `getServerSideProps`, `useLocale`, `PageWrapper`, `Page`, and `getLayout` are declared 70–113 times each, so semantic emits 2,914 redeclaration `OxcDiagnostic`s. Each diagnostic allocates ~4 strings/Vecs on the system heap, accounting for the bulk of the file's 12,064 reported semantic `sys_allocs` — an artifact of the fixture rather than typical real-world TSX semantic cost.

Replace it with excalidraw [`App.tsx`](https://github.com/excalidraw/excalidraw/blob/f6d85bc80fe328e8f472636eb0d541f7bb891aa0/packages/excalidraw/components/App.tsx), pinned to master @ `f6d85bc8` (415KB, 13k lines, single source file). Semantic `sys_allocs` drops from 12,064 → 174, in line with the other fixtures.
2026-05-19 14:59:15 +00:00
renovate 74d8dc6082 chore(deps): update rust crates (major) (#21070)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [similar](https://redirect.github.com/mitsuhiko/similar) | workspace.dependencies | major | `2.7.0` → `3.0.0` |
| [similar-asserts](https://redirect.github.com/mitsuhiko/similar-asserts) | workspace.dependencies | major | `1.7.0` → `2.0.0` |

---

### Release Notes

<details>
<summary>mitsuhiko/similar (similar)</summary>

### [`v3.0.0`](https://redirect.github.com/mitsuhiko/similar/blob/HEAD/CHANGELOG.md#300)

[Compare Source](https://redirect.github.com/mitsuhiko/similar/compare/2.7.0...3.0.0)

- Added a Git-style Histogram diff implementation exposed as
  `Algorithm::Histogram`, including deadline-aware Myers fallback and
  comprehensive regression/behavior tests.
- Raised MSRV to Rust 1.85 and moved the crate to Rust 2024 edition.
- Added a Hunt-style diff implementation exposed as `Algorithm::Hunt`.
- Added configurable inline refinement via `InlineChangeOptions` and
  `InlineChangeMode`, including semantic cleanup and new
  `TextDiff::iter_inline_changes_with_options*` methods.  [#&#8203;92](https://redirect.github.com/mitsuhiko/similar/issues/92)
- Added a global disjoint-input fast path in `algorithms::diff_deadline`
  to avoid pathological runtimes on large, fully distinct inputs.
- Improved `Algorithm::Myers` performance on heavily unbalanced diffs to
  avoid pathological slowdowns.
- Added `diff_deadline_raw` entrypoints in the algorithm modules to bypass
  shared heuristics and keep minimal intrinsic trait bounds where needed.
- Added test files in `examples/diffs` that can be used with the some of the
  examples as input pairs.
- Added `CachedLookup`, a helper for adapting virtual or computed sequences by
  materializing items on first access and then serving borrowed values through
  normal indexing.  The `owned-lookup` example demonstrates this approach for
  issue [#&#8203;33](https://redirect.github.com/mitsuhiko/similar/issues/33).
- Fixed ranged indexing in the classic LCS table algorithm.
- Improved diff compaction to merge adjacent delete hunks across equal runs.
- Excluded development scripts from published crate contents.  [#&#8203;87](https://redirect.github.com/mitsuhiko/similar/issues/87)
- `TextDiff::from_*` and `TextDiffConfig::diff_*` now accept owned inputs
  (`String`, `Vec<u8>`, `Cow`) in addition to borrowed inputs.  This allows
  returning text diffs from functions without external owner lifetimes.  [#&#8203;65](https://redirect.github.com/mitsuhiko/similar/issues/65)
- `TextDiff` no longer exposes `old_slices` / `new_slices`.  Use
  `old_len`, `new_len`, `old_slice`, `new_slice`, `iter_old_slices`,
  `iter_new_slices`, `old_lookup`, and `new_lookup` instead.
- `TextDiff::iter_changes` now panics on invalid out-of-bounds `DiffOp`
  ranges instead of silently truncating iteration.
- `utils::diff_lines_inline` now takes `&TextDiff` and options rather than
  `(Algorithm, old, new, options)`.
- `utils::diff_lines` now avoids a second line-tokenization pass.
- Renamed `get_diff_ratio` to `diff_ratio`.
- Added first-class `no_std + alloc` support with an explicit default `std`
  feature.
- Added optional `hashbrown` backend for `no_std` map storage
  (`default-features = false, features = ["hashbrown"]`), while the default
  `no_std` backend uses `alloc::collections::BTreeMap`.
- Made core constructors const-ready (`Capture::new`, `Replace::new`,
  `NoFinishHook::new`, `InlineChangeOptions::new`, `TextDiff::configure`).

</details>

<details>
<summary>mitsuhiko/similar-asserts (similar-asserts)</summary>

### [`v2.0.0`](https://redirect.github.com/mitsuhiko/similar-asserts/blob/HEAD/CHANGELOG.md#200)

[Compare Source](https://redirect.github.com/mitsuhiko/similar-asserts/compare/1.7.0...2.0.0)

- Raised the crate edition to Rust 2024 and updated the MSRV to Rust 1.85.
- Upgraded the `similar` dependency to `3.0.0`.
- Modernized CI workflows to current GitHub Actions and added PR runs.
- Replaced atomic env-var caching with `OnceLock`.
- Minor documentation and wording fixes.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 10am on monday" in timezone Asia/Shanghai, 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:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDIuMTEiLCJ1cGRhdGVkSW5WZXIiOiI0My4xMDIuMTEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
2026-04-05 17:14:10 +00:00
Dunqing e9dd5f9099 chore(tasks): use cargo insta's diff printing implementation (#18691)
The previous implementation is easily confusing, as the old line index and the new line index are in the same column.

The new implementation is based on [Cargo insta diff printing](https://github.com/mitsuhiko/insta/blob/8a5b77531f89bc78d00cab17f2ac8b2c69ceadab/insta/src/output.rs#L238-L296).

### Example

```shell
❯ cargo run -p oxc_prettier_conformance   -- --filter "typescript/union/comments/18106.ts"
Failed ❌
   26    26 │   | [string, ExpressionNode, ExpressionNode]
   27    27 │   | [string, ExpressionNode, ExpressionNode, ObjectExpression] = 1;
   28    28 │
   29       │-type A2 =
   30       │-  /* block comment */
         29 │+type A2 = /* block comment */
   31    30 │   | [string]
   32    31 │   | [string, ExpressionNode]
   33    32 │   | [string, ExpressionNode, ExpressionNode]
   34    33 │   | [string, ExpressionNode, ExpressionNode, ObjectExpression];
   35    34 │
   36       │-type A3 =
   37       │-  /* block comment
         35 │+type A3 = /* block comment
   38    36 │    */
   39    37 │   | [string]
   40    38 │   | [string, ExpressionNode]

```
2026-01-29 08:25:41 +00:00
Dunqing 4d97ba3952 chore(tasks): unify printing differences for mismatch code (#18441)
Instead of implementing printing diffs everywhere, use a unified method to make the code cleaner and maintain consistency.
2026-01-26 05:16:44 +00:00
Dunqing 7ba9fa19f8 refactor(tasks): improve terminal diff output with context lines (#18437)
## Summary

Improves the `print_diff_in_terminal` function with better readability and a simpler API:

**API Changes:**
- `print_diff_in_terminal(expected, result)` - Simple API that takes two strings
- `print_text_diff(diff)` - For when you already have a `TextDiff` (e.g., to use `diff.ratio()`)

**Features:**
- Show 3 lines of context above and below each change
- Add line numbers with gutter separator (`│`)
- Add blank line between adjacent hunks for visual separation
- Add `...` separator when lines are skipped between hunks
- Use single-pass streaming algorithm with small fixed-size buffer
- Colors: red (`-`) for deletions, green (`+`) for insertions, dim for context

**Formatter Example:**
- Added `--diff` flag to show diff between original and formatted code

Example output:
```
    1 │class A {
    2 │  #x;
    3 │}
-   4 │var _x = /* @__PURE__ */ new WeakMap();
-   5 │var _B_brand = /* @__PURE__ */ new WeakSet();
    4 │class B {

-   7 │  constructor() {
-   8 │    babelHelpers.classPrivateMethodInitSpec(this, _B_brand);
-   9 │    babelHelpers.classPrivateFieldInitSpec(this, _x, void 0);
+   5 │  #x;
+   6 │  #y() {
+   7 │    this.#x;
    8 │  }

-  11 │}
-  12 │function _y() {
-  13 │  babelHelpers.classPrivateFieldGet2(_x, this);
    9 │}
```

## Test plan

- [x] `cargo check -p oxc_tasks_common` passes
- [x] Clippy passes
- [x] Verified output with `just test-transform --filter "plugins-integration/class-features-node-12/input.js"`

🤖 Generated with [Claude Code](https://claude.ai/code)
2026-01-23 08:53:25 +00:00
leaysgur e61516258d ci(benchmarks): Update formatter fixtures (#15658)
Fixes #15628

- Remove unused `TestFiles::react()`
- Refactor private function to be inlined
- Add formatter fixtures
- Expand timeout 5 > 10s
2025-11-18 01:31:01 +00:00
overlookmotel 84972e4cd3 fix(tasks): use same version of antd.js for all tasks (#13465) 2025-08-31 19:18:19 +08:00
overlookmotel 7e974309dc docs(tasks): correct comment to match code (#12923)
Happened to come across this. The comment didn't match the code here.

I *assume* the code is right and the comment is outdated, so this PR
amends the comment. But I don't know what this code does, so maybe it's
the other way around and the code should be changed to match the
comment?
2025-08-09 11:24:54 +08:00
camc314 84794ebdbf refactor(all): enable collapsible_if lint (#12902) 2025-08-08 11:27:58 +00:00
Cameron 13f0658f88 fix(tasks): propagate io::copy errors during benchmark file download (#12813)
Codspeed left this comment on my PR.

The perf increase is obviously wrong, the only way i could see this
happening is if it failed to copy. this PR updates it to propogate the
error so that we know when something fails, rather than having codspeed
log incorrect perf differences

![Screenshot 2025-08-04 at
20.03.10.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/8ASanJZ3iQ7b9iVhlds7/ff7af92c-a344-477b-862c-06b1ebebef4a.png)
2025-08-05 14:28:55 +08:00
Boshen f1c221f68d ci(benchmark): tweak benchmark files (#11120)
antd is too big, use cal.com.tsx instead.
2025-05-18 23:58:46 +08:00
Boshen 0a66cb0599 refactor(benchmark): change benchmark files to a minimal set (#11110)
The benchmark jobs take too long to run, change them to a minimal set.

This set of files are smaller but should provide basic coverage to real
world examples.
2025-05-18 15:16:23 +08:00
Boshen 3795eb6d98 fix(ci): use jsdelivr for all benchmark files (#11108)
https://github.blog/changelog/2025-05-08-updated-rate-limits-for-unauthenticated-requests/
2025-05-18 04:33:35 +00:00
renovate[bot] f524552e06 chore(deps): update dependency rust to v1.87.0 (#11063) 2025-05-16 12:16:07 +08:00
Boshen 0f429b7842 feat(formatter): fill in implementations (#10513) 2025-04-29 16:10:22 +00:00
Boshen d2b8a73c00 feat(formatter): fill in implementations (#10397)
js compatibility: 61/645 (9.46%) -> 157/699 (22.46%)
ts compatibility: 20/573 (3.49%) -> 91/573 (15.88%)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-04-19 23:10:19 +08:00
renovate a788a64649 chore(deps): update dependency rust to v1.86.0 (#10196)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust) | minor | `1.85.1` -> `1.86.0` |

---

### Release Notes

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

### [`v1.86.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1860-2025-04-03)

[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.85.1...1.86.0)

\==========================

<a id="1.86.0-Language"></a>

## Language

-   [Stabilize upcasting trait objects to supertraits.](https://redirect.github.com/rust-lang/rust/pull/134367)
-   [Allow safe functions to be marked with the `#[target_feature]` attribute.](https://redirect.github.com/rust-lang/rust/pull/134090)
-   [The `missing_abi` lint now warns-by-default.](https://redirect.github.com/rust-lang/rust/pull/132397)
-   Rust now lints about double negations, to catch cases that might have intended to be a prefix decrement operator (`--x`) as written in other languages. This was previously a clippy lint, `clippy::double_neg`, and is [now available directly in Rust as `double_negations`.](https://redirect.github.com/rust-lang/rust/pull/126604)
-   [More pointers are now detected as definitely not-null based on their alignment in const eval.](https://redirect.github.com/rust-lang/rust/pull/133700)
-   [Empty `repr()` attribute applied to invalid items are now correctly rejected.](https://redirect.github.com/rust-lang/rust/pull/133925)
-   [Inner attributes `#![test]` and `#![rustfmt::skip]` are no longer accepted in more places than intended.](https://redirect.github.com/rust-lang/rust/pull/134276)

<a id="1.86.0-Compiler"></a>

## Compiler

-   [Debug-assert that raw pointers are non-null on access.](https://redirect.github.com/rust-lang/rust/pull/134424)
-   [Change `-O` to mean `-C opt-level=3` instead of `-C opt-level=2` to match Cargo's defaults.](https://redirect.github.com/rust-lang/rust/pull/135439)
-   [Fix emission of `overflowing_literals` under certain macro environments.](https://redirect.github.com/rust-lang/rust/pull/136393)

<a id="1.86.0-Platform-Support"></a>

## Platform Support

-   [Replace `i686-unknown-redox` target with `i586-unknown-redox`.](https://redirect.github.com/rust-lang/rust/pull/136698)
-   [Increase baseline CPU of `i686-unknown-hurd-gnu` to Pentium 4.](https://redirect.github.com/rust-lang/rust/pull/136700)
-   New tier 3 targets:
    -   [`{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock`](https://redirect.github.com/rust-lang/rust/pull/133631).
        For supporting Neutrino QNX 7.1 with `io-socket` network stack.
    -   [`{aarch64-unknown,x86_64-pc}-nto-qnx800`](https://redirect.github.com/rust-lang/rust/pull/133631).
        For supporting Neutrino QNX 8.0 (`no_std`-only).
    -   [`{x86_64,i686}-win7-windows-gnu`](https://redirect.github.com/rust-lang/rust/pull/134609).
        Intended for backwards compatibility with Windows 7. `{x86_64,i686}-win7-windows-msvc` are the Windows MSVC counterparts that already exist as Tier 3 targets.
    -   [`amdgcn-amd-amdhsa`](https://redirect.github.com/rust-lang/rust/pull/134740).
    -   [`x86_64-pc-cygwin`](https://redirect.github.com/rust-lang/rust/pull/134999).
    -   [`{mips,mipsel}-mti-none-elf`](https://redirect.github.com/rust-lang/rust/pull/135074).
        Initial bare-metal support.
    -   [`m68k-unknown-none-elf`](https://redirect.github.com/rust-lang/rust/pull/135085).
    -   [`armv7a-nuttx-{eabi,eabihf}`, `aarch64-unknown-nuttx`, and `thumbv7a-nuttx-{eabi,eabihf}`](https://redirect.github.com/rust-lang/rust/pull/135757).

Refer to Rust's \[platform support page]\[platform-support-doc]
for more information on Rust's tiered platform support.

<a id="1.86.0-Libraries"></a>

## Libraries

-   The type of `FromBytesWithNulError` in `CStr::from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>` was [changed from an opaque struct to an enum](https://redirect.github.com/rust-lang/rust/pull/134143), allowing users to examine why the conversion failed.
-   [Remove `RustcDecodable` and `RustcEncodable`.](https://redirect.github.com/rust-lang/rust/pull/134272)
-   [Deprecate libtest's `--logfile` option.](https://redirect.github.com/rust-lang/rust/pull/134283)
-   [On recent versions of Windows, `std::fs::remove_file` will now remove read-only files.](https://redirect.github.com/rust-lang/rust/pull/134679)

<a id="1.86.0-Stabilized-APIs"></a>

## Stabilized APIs

-   [`{float}::next_down`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_down)
-   [`{float}::next_up`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_up)
-   [`<[_]>::get_disjoint_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_mut)
-   [`<[_]>::get_disjoint_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_unchecked_mut)
-   [`slice::GetDisjointMutError`](https://doc.rust-lang.org/stable/std/slice/enum.GetDisjointMutError.html)
-   [`HashMap::get_disjoint_mut`](https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_mut)
-   [`HashMap::get_disjoint_unchecked_mut`](https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_unchecked_mut)
-   [`NonZero::count_ones`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.count_ones)
-   [`Vec::pop_if`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pop_if)
-   [`sync::Once::wait`](https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait)
-   [`sync::Once::wait_force`](https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait_force)
-   [`sync::OnceLock::wait`](https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html#method.wait)

These APIs are now stable in const contexts:

-   [`hint::black_box`](https://doc.rust-lang.org/stable/std/hint/fn.black_box.html)
-   [`io::Cursor::get_mut`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_mut)
-   [`io::Cursor::set_position`](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.set_position)
-   [`str::is_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.is_char_boundary)
-   [`str::split_at`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at)
-   [`str::split_at_checked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_checked)
-   [`str::split_at_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut)
-   [`str::split_at_mut_checked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut_checked)

<a id="1.86.0-Cargo"></a>

## Cargo

-   [When merging, replace rather than combine configuration keys that refer to a program path and its arguments.](https://redirect.github.com/rust-lang/cargo/pull/15066/)
-   [Error if both `--package` and `--workspace` are passed but the requested package is missing.](https://redirect.github.com/rust-lang/cargo/pull/15071/) This was previously silently ignored, which was considered a bug since missing packages should be reported.
-   [Deprecate the token argument in `cargo login` to avoid shell history leaks.](https://redirect.github.com/rust-lang/cargo/pull/15057/)
-   [Simplify the implementation of `SourceID` comparisons.](https://redirect.github.com/rust-lang/cargo/pull/14980/) This may potentially change behavior if the canonicalized URL compares differently in alternative registries.

<a id="1.86.0-Rustdoc"></a>

## Rustdoc

-   [Add a sans-serif font setting.](https://redirect.github.com/rust-lang/rust/pull/133636)

<a id="1.86.0-Compatibility-Notes"></a>

## Compatibility Notes

-   [The `wasm_c_abi` future compatibility warning is now a hard error.](https://redirect.github.com/rust-lang/rust/pull/133951)
    Users of `wasm-bindgen` should upgrade to at least version 0.2.89, otherwise compilation will fail.
-   [Remove long-deprecated no-op attributes `#![no_start]` and `#![crate_id]`.](https://redirect.github.com/rust-lang/rust/pull/134300)
-   [The future incompatibility lint `cenum_impl_drop_cast` has been made into a hard error.](https://redirect.github.com/rust-lang/rust/pull/135964) This means it is now an error to cast a field-less enum to an integer if the enum implements `Drop`.
-   [SSE2 is now required for "i686" 32-bit x86 hard-float targets; disabling it causes a warning that will become a hard error eventually.](https://redirect.github.com/rust-lang/rust/pull/137037)
    To compile for pre-SSE2 32-bit x86, use a "i586" target instead.

<a id="1.86.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

-   [Build the rustc on AArch64 Linux with ThinLTO + PGO.](https://redirect.github.com/rust-lang/rust/pull/133807)
    The ARM 64-bit compiler (AArch64) on Linux is now optimized with ThinLTO and PGO, similar to the optimizations we have already performed for the x86-64 compiler on Linux. This should make it up to 30% faster.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjcuMyIsInVwZGF0ZWRJblZlciI6IjM5LjIyNy4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2025-04-04 07:43:00 +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
camchenry bb9d76352f refactor(linter): remove usage of url crate (#8833)
In the linter, this was only used for getting a query parameter value out of a URL. These lint rules already check that the URL value is a known-good URL so we don't need to validate and parse it. I've replaced these usages with a simple helper function to get the value from the query string.

There was also a usage in the tasks directory for getting test files and I've also skipped validating here since it's not strictly necessary as we control all inputs.
2025-02-02 01:16:03 +00:00
Yuji Sugiura b3a57696a1 feat(tasks/prettier): Show total match ratio with updating snapshot format (#8788)
Previously, #8634 visualized each spec result, but this was not enough.

If the implementation has been updated but the spec still fails, there
is no way to know if there is an improvement or not.

This time, finally, all progress is visualized! 🤩 


![image](https://github.com/user-attachments/assets/df5b4658-450a-4b0c-8348-ffc9b977c50c)

e.g. here `arrow_function_expression` is mostly passing, except for
comment handling.
2025-01-30 22:27:34 +08:00
renovate[bot] e00e3abd84 chore(deps): update rust crates (major) (#8739)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [oxc_resolver](https://redirect.github.com/oxc-project/oxc-resolver) |
workspace.dependencies | major | `3` -> `4` |
| [ureq](https://redirect.github.com/algesten/ureq) |
workspace.dependencies | major | `2.12.1` -> `3.0.0` |

---

### Release Notes

<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>

###
[`v4.0.0`](https://redirect.github.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#400---2025-01-20)

[Compare
Source](https://redirect.github.com/oxc-project/oxc-resolver/compare/oxc_resolver-v3.0.3...oxc_resolver-v4.0.0)

##### <!-- 0 -->Features

- \[**breaking**] generic fs cache `type Resolver =
ResolverGeneric<FsCache<FileSystemOs>>`
([#&#8203;358](https://redirect.github.com/oxc-project/oxc-resolver/issues/358))
- \[**breaking**] `PackageJson` and `TsConfig` traits
([#&#8203;360](https://redirect.github.com/oxc-project/oxc-resolver/issues/360))

##### <!-- 2 -->Performance

- use papaya instead of dashmap
([#&#8203;356](https://redirect.github.com/oxc-project/oxc-resolver/issues/356))

</details>

<details>
<summary>algesten/ureq (ureq)</summary>

###
[`v3.0.0`](https://redirect.github.com/algesten/ureq/blob/HEAD/CHANGELOG.md#300)

[Compare
Source](https://redirect.github.com/algesten/ureq/compare/2.12.1...3.0.0)

- Replace RequestBuilder Deref with explicit wrappers
([#&#8203;944](https://redirect.github.com/algesten/ureq/issues/944))
- Remove dependency on `url` crate
([#&#8203;943](https://redirect.github.com/algesten/ureq/issues/943))
- Feature `Config::save_redirect_history`
([#&#8203;939](https://redirect.github.com/algesten/ureq/issues/939))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on monday" in timezone Asia/Shanghai,
Automerge - "on monday" in timezone Asia/Shanghai.

🚦 **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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-27 12:56:52 +08: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
dalaoshu d18c896a2c perf(rust): use cow_utils instead (#5664)
Related to #5586 and #5662

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-09-11 18:39:30 +08:00
Boshen c220730779 feat(coverage): check symbols and scopes after transformation (#4917)
closes https://github.com/oxc-project/oxc/issues/4790

@overlookmotel enjoy ... take a look at the snapshots and probably nothing else.

The snapshots are minimal right now, but it's already showing symbols from import specifiers are not being removed. We can iterate on the snapshot representation to aid debugging later.

I'll extend this to `transformer_conformance` and `oxc-monitor` in an up coming PR.
2024-08-16 07:05:11 +00:00
Boshen ca0b4fa08a refactor(tasks): clean up test files and remove libs.txt (#4172) 2024-07-10 17:38:06 +00:00
Boshen 051ceb6539 chore: improve some format by running cargo +nightly fmt 2024-06-19 00:48:30 +08:00
Boshen 982e6f08df chore: make println and eprintln opt-in (#3712)
I noticed accidental `println` can be merged, which isn't really nice.
2024-06-17 10:40:34 +00:00
Dunqing 9ee962add8 feat(transformer): support from_babel_options in TransformOptions (#3301)
Move `BabelOptions` to Transformer. The `output.json` is a standard babel configuration. We can reuse BabelOptions to read [babel.config.json](https://babeljs.io/docs/configuration#babelconfigjson) or our configuration(maybe oxc.config.json)

The current `from_babel_options` implementation is copied from the `transform_options` in `test_case.rs`, which I'll completely reimplement next
2024-05-16 10:10:39 +00:00
Boshen 530455849b chore(tasks): add commit sha to snapshots to make sure submodules are not outdated (#3267)
If submodules are outdated, it'll panic with the following message

```
Repository is outdated, please run `just submodules` to update it.
```

For us maintainers, we'll need the env `UPDATE_SNAPSHOT` to force an update.
2024-05-14 10:18:00 +00:00
overlookmotel f0cbbbe28c ci: build each benchmark only with deps it needs (#3221)
This PR builds on #3201 to further speed up the benchmarks and reduce CI
time.

* Build and run each benchmark as separate job (like before).
* But now each bench is only built with the dependencies it needs.
* For linter benchmarks, build benchmark in 1 job (like #3201 does).
* Run each linter fixture in a separate job as they're slow.

This reduces total time to complete benchmarks from between 6m-7m to
~4m40s.

All the individual jobs complete in under 1m30s, except for building
linter benchmark which takes 2m30s. So there won't be the problem of
blocking the CI queue that there was before.

NB: I did try this before, and didn't see a benefit. But I realized
today what I was doing wrong - it only works once the caches are
populated by a previous run on main branch.

So the CI times in this PR won't look good, but once it's merged to
main, it will take effect. Here it is running on main branch of my fork:

https://github.com/overlookmotel/oxc/actions/runs/9030511348

I also added a step to delete the temp artefacts which aren't needed
once the run has completed.
2024-05-10 22:01:24 +08:00
Boshen 5683aceae9 ci: improve benchmark build time by only building once (#3201)
relates #3200
2024-05-08 14:54:10 +08:00
Boshen ae9d681b4d feat(transform_conformance): skip windows tests (#3003) 2024-04-16 17:50:43 +08:00
Boshen 85a3653994 feat(transformer): add "_jsxFileName" variable in jsx source plugin (#3000) 2024-04-16 17:40:24 +08:00
Boshen bd9fc6d169 feat(transformer): react jsx transform (#2961) 2024-04-14 10:50:17 +08:00
Boshen 7710d8caf1 feat(transformer): add compiler assumptions (#2872)
closes #2869
2024-03-31 02:04:21 +00:00
overlookmotel 68f304faa3 feat(tasks): shard linter benchmarks in CI (#2752)
Follow-on from #2751. Further shards linter benchmarks so each fixture runs in its own job.

This reduces total time to run benchmarks by another ~75 secs. So approx 2.5 mins shaved off in total.
2024-03-18 10:50:44 +08:00
overlookmotel 73ec4df61c chore(benchmark): add radix-ui.jsx as a real world jsx example (#2304)
Following #2297, this adds another benchmark.

This one is from radix-ui website. I've chosen this particular file
because it differs from the other benchmark sources in 3 ways:

1. JSX not TSX (despite the file extension).
2. Contains no logic, only JSX component hierarchy, and content text.
3. Very small (60 LOC).

The last is particularly important, I think. Often developers will be
working on small files (single component per file convention). And some
possible directions for the parser (SIMD etc) involve optimizing chewing
through chunks of text, with a de-opt at the end to process the final
batch of bytes. If that imposes a penalty on short files, this benchmark
will surface it.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-02-05 13:42:45 +08:00
Boshen 018674c56c chore(benchmark): add cal.com.tsx as a realword tsx example (#2297)
closes #1884
2024-02-04 22:40:55 +08:00
IWANABETHATGUY 4bbc977971 chore: upgrade rustc toolchain to stable 1.75.0 (#1853)
ref: 
https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html
2023-12-29 12:20:51 +08:00
Boshen 601153fe8f refactor(benchmark): use more complicated files (#1811)
closes #1806

---------

Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-12-25 17:27:02 +08:00
Boshen c61a6c6694 chore(benchmark): remove vue from test benchmark because it is flaky 2023-12-19 19:05:42 +08:00
IWANABETHATGUY 4fb4a85ab1 chore(transformer): 🤖 add diff section when conformance failed in filter mode (#1488) 2023-11-21 21:47:58 +08:00
Dunqing 472707c04e feat(task/transformer-conformance): skip babel 8 unsupported test cases (#1258)
Prior to babel8, object merging would use `babelHelper.extend`, which
caused most tests to fail
2023-11-13 11:05:36 +08:00
Dunqing ae71b36f9b fix(tasks): avoid overriding existing babel options (#1193) 2023-11-08 17:04:59 +08:00