Repository navigation
chore(deps): upgrade oxc to 0.155.0 - #11228
Merged
Merged
Conversation
…6242) Points every oxc crate at oxc main (d2bea210) through `[patch.crates-io]` to see how the JSStr breaking changes (oxc-project/oxc#26548, #26677, #27095) affect Rolldown. Not for merging: the npm packages stay at 0.154.0 because oxc main is unpublished. - Migrate `StringLiteral::value`, `TemplateElementValue::cooked`, and static member / property names to `JSStr` and `StaticPropertyName`. - Names, globs and paths that can be skipped safely (property names, CJS export names, `new URL`, `import.meta.glob` patterns) decline through `JSStr::as_str()`, as `oxc_str` documents. - Values Rolldown keeps outside the arena have no owned `JSStr` to go in: a static specifier with a lone surrogate reports `UNSUPPORTED_FEATURE`, `import()` / `require()` stay non-static, and import attribute entries are dropped. These are marked `TODO(oxc)`. - Snapshot: `(empty(), foo?.bar)()` now keeps `(0, foo?.bar)()` (oxc-project/oxc#27082), which matches esbuild. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
Moves the oxc patch from main (d2bea210) to the top of the open #26242 stack (850f799a): #26712, #26716, #26717, #27096, #27098, #26743, #27580. Only #27098 breaks Rolldown: oxc's `ConstantValue::String` now holds `JSStr<'a>`. Rolldown keeps constants across modules as `String`, so: - `ConstantValue::from_oxc` replaces the `From` impl and declines a string constant with a lone surrogate (it is not inlined across modules). - `as_oxc_value` lends the string to oxc without copying, and `to_oxc_value_in` copies it into the arena where the context outlives the constant map. `StmtEvalAnalyzer` now implements `GlobalContext<'a>` for its own lifetime so it can lend. No snapshot changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Moves the oxc patch to the rebased stack top (2a17adf1, on main@6fe4c1b9). #26716, #26717 and #27098 were rewritten (#26717 no longer adds `JSStr::to_string_lossy`); the APIs Rolldown uses are unchanged, so no source changes are needed and there are no snapshot changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
Addresses the oxc-side review of the JSStr migration. A value with a lone surrogate that Rolldown can't keep as UTF-8 is now an error wherever skipping it would change what is built: - module specifiers in `import()`, `require()`, `new URL()` and `import.meta.hot.accept()`, not only static imports. `hot.accept` with such a dep no longer turns the module self-accepting. - import attribute keys and values, which were dropped from the output. - `import.meta.glob` `base`, `import` and `query` options, which fell back to the defaults. - type-only imports in the isolated-declarations plugin, which were skipped. Also drops `StmtEvalAnalyzer`'s `get_constant_value_for_reference_id` override (oxc only reads it through `ConstantEvaluationCtx`), lends `ConstEvalCtx`'s constants to oxc instead of copying them into the arena, moves `add_import_record`'s doc comment back onto it, mirrors the `binding.d.cts` type change in `rolldown-binding.wasi.d.cts`, and adds fixtures and unit tests for these paths. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
Follow-up to the oxc-side review of 8b6455c. A `data:` URL is left untouched whatever it contains, so `new URL('data:…\uD800', import.meta.url)` no longer reports an error. Also adds the review's test cases: `require()` inside `try`/`catch`, a `data:` URL, the backtick form of `import.meta.hot.accept()`, `ns['\uD800']` for `ASSIGN_TO_IMPORT`, and a CJS fixture with lone-surrogate export names. The `ConstEvalCtx` comment now names the `AstBuilder` covariance it relies on. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
This was referenced Oct 19, 2026
graphite-app Bot
pushed a commit
to oxc-project/oxc
that referenced
this pull request
Oct 19, 2026
…y()` (#27950) `StaticPropertyName` implemented `Display`, so `.to_string()` turned a name into escaped text without saying so. That matters where the text is used as a key rather than shown. It now has a `display()` adapter like `JSStr`'s, so each caller says what it wants. Both `display()` docs now note that the output is not injective (`"\uD800"` and `"\\ud800"` print the same), so it must not be compared or used as a key. The 31 current callers keep their output: they format diagnostics or messages, and the few that key by the text get the same keys as before. **Breaking:** `StaticPropertyName` no longer implements `Display`. Use `name.display()`. Came up in the review of rolldown/rolldown#11228. Part of #26242. Implemented with AI assistance.
graphite-app Bot
pushed a commit
to oxc-project/oxc
that referenced
this pull request
Oct 19, 2026
…y()` (#27950) `StaticPropertyName` implemented `Display`, so `.to_string()` turned a name into escaped text without saying so. That matters where the text is used as a key rather than shown. It now has a `display()` adapter like `JSStr`'s, so each caller says what it wants. Both `display()` docs now note that the output is not injective (`"\uD800"` and `"\\ud800"` print the same), so it must not be compared or used as a key. The 31 current callers keep their output: they format diagnostics or messages, and the few that key by the text get the same keys as before. **Breaking:** `StaticPropertyName` no longer implements `Display`. Use `name.display()`. Came up in the review of rolldown/rolldown#11228. Part of #26242. Implemented with AI assistance.
Replaces the `[patch.crates-io]` git overrides with the released oxc 0.155.0 crates and npm packages. It contains the JSStr changes this branch was written for (#26548, #26677, #27095, #27579, #26712, #26716, #26717, #27096) but not oxc-project/oxc#27098, so `ConstantValue::String` is still `Cow<'a, str>`: - `rolldown_common::ConstantValue` goes back to main's `From` impls. oxc doesn't evaluate a literal with a lone surrogate, so the conversion can't fail. `From<&ConstantValue>` now lends the string (`Cow::Borrowed`) instead of cloning it, which `ConstEvalCtx` can do because it implements the oxc traits for the lifetime its constants live for. - The lone-surrogate unit test expects `'\uD800' + '\uDC00'` to stay unevaluated until #27098 is released. Also regenerates the embedded `@oxc-project/runtime` helper version. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Moves the constant-lending change out of the upgrade. `ConstEvalCtx`, `From<&ConstantValue>` and `StmtEvalAnalyzer` are back to main's code: 0.155.0 still uses `Cow<'a, str>` for string constants, so main's version compiles, and lending them is an unmeasured performance change for its own PR. Also corrects comments added for the upgrade: - the module-request and import-attribute docs say why such a value is reported, not what older code did, and name the bundled-import case; - JSON keys always come from `serde_json`, so the JSON-to-ESM path expects UTF-8 keys instead of describing a branch that can't run; - smaller wording fixes in `new_url.rs`, `expression_ext.rs`, the glob plugin and two fixtures. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
…_surrogate` From a second review of the upgrade: - `transform_ast` hooks run on a JSON module's AST after `serde_json` parses it, so a key with a lone surrogate is reachable. Skip it again (it stays on the default export) instead of expecting UTF-8 keys, and say why. - `text_before_lone_surrogate` takes the first valid UTF-8 chunk in one pass, instead of validating twice with an arm that could never run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
…sform peer From the oxc-side re-review of the upgrade: - `import.meta['ROLLDOWN_FILE_URL_\uD800']` was left untouched without a diagnostic. Reference ids are ASCII, so such a name matches no emitted file: it now reports FILE_NOT_FOUND like any unknown reference id. - `examples/isolated-decl` still resolved `unplugin-isolated-decl`'s `oxc-transform` peer to 0.154.0. `pnpm --filter isolated-decl update oxc-transform` aligns it to 0.155.0 and drops the old bindings, as the 0.153.0 and 0.154.0 upgrades did. - Comments: CommonJS exports can contain a lone surrogate, so the reason for treating such a name like a computed one is that Rolldown stores export names as UTF-8. The module-request doc covers absolute URLs and bare specifiers, and the constant-evaluation test names oxc-project/oxc#27098, which will change what it asserts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
main now marks module starts with `// <id>` comments instead of `#region` pairs (#11235). This PR's new `cjs_compat/lone_surrogate_export_name` snapshot predates that change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
Dunqing
force-pushed
the
claude/gifted-pascal-tl3lic
branch
from
October 20, 2026 07:16
38408b9 to
bb7ceb2
Compare
A module request, import attribute, `import.meta.glob` option or type-only import with a lone surrogate was reported as an error. Convert each lone surrogate to U+FFFD instead, as `URL` and Node's file system APIs do, so the request names the file the runtime would load. webpack and Bun resolve the same way. Property and export names with a lone surrogate are still skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
Dunqing
marked this pull request as ready for review
October 21, 2026 00:31
Dunqing
requested review from
IWANABETHATGUY,
hyfdev,
sapphi-red and
shulaoda
as code owners
October 21, 2026 00:31
Merging this PR will not alter performance
|
shulaoda
approved these changes
Oct 21, 2026
main now records entry modules in the HMR module graph (#11252), so the fixture added in this branch gains `entries: [3]`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
hyfdev
approved these changes
Oct 21, 2026
sapphi-red
approved these changes
Oct 21, 2026
Merged
shulaoda
added a commit
that referenced
this pull request
Oct 21, 2026
## [1.2.15] - 2026-10-21 ### 🚀 Features - rolldown_plugin_vite_resolve: add `isBundled` to pick the browser-external stub format (#11260) by @h-a-n-a - dev: mark entry modules in the HMR module graph (#11252) by @h-a-n-a - mark module starts with `// <id>` comments instead of `#region` pairs (#11235) by @IWANABETHATGUY ### 🐛 Bug Fixes - plugin: stop `this.resolve` recursion between plugins with `skipSelf: true` (#11181) by @anzal1 - rolldown_plugin_vite_resolve: handle external `require` for `ssr.target: 'webworker'` (#11205) by @sapphi-red - rolldown_plugin_vite_build_import_analysis: only wrap dynamic imports with static specifiers in __vitePreload (#10879) by @smeng9 - strict-execution-order: wrap eager modules that forward wrapped definers (#11186) by @hyfdev - chunk-import-map: keep common chunk keys unique when enabling inline common chunks (#11230) by @hyfdev - only register signal-exit handler when a trace subscriber is active (#11208) by @DaniilIsupov ### 🧪 Testing - fold hand-unrolled Rust test tables (#11212) by @Brooooooklyn ### ⚙️ Miscellaneous Tasks - deps: upgrade oxc to 0.155.0 (#11228) by @Dunqing - rollup-tests: retriage failed tests (#11251) by @sapphi-red - deps: update rollup submodule for tests to v4.64.12 (#11249) by @rolldown-guard[bot] - deps: update test262 submodule for tests (#11242) by @rolldown-guard[bot] ### ❤️ New Contributors * @anzal1 made their first contribution in [#11181](#11181) * @smeng9 made their first contribution in [#10879](#10879) * @DaniilIsupov made their first contribution in [#11208](#11208) Co-authored-by: shulaoda <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades oxc from 0.154.0 to 0.155.0.
The breaking change: AST strings are now
JSStrand can hold lone surrogates ('\uD800'). Rolldown handles them in two ways:import './a\uD800.js'resolvesa�.js. Before, Rolldown tried a mangleda�d800.js.An earlier revision reported an error instead, but no other bundler does.
It also brings oxc fixes for a few minifier bugs, such as wrong
thisin(0, foo?.bar)(), which changes one snapshot.Needs attention
rolldown-binding.wasi.d.ctswas edited by hand to matchbinding.d.cts, because the wasm target isn't installed locally. CI's WASI job passes.Tests
New fixtures load files with U+FFFD in their names, for every import form and for HMR. CI is green, including Windows.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E