Skip to content

feat: expose oxcRuntimePlugin#8654

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-12-feat_expose_oxcruntimeplugin_
Mar 13, 2026
Merged

feat: expose oxcRuntimePlugin#8654
graphite-app[bot] merged 1 commit intomainfrom
03-12-feat_expose_oxcruntimeplugin_

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

@sapphi-red sapphi-red commented Mar 12, 2026

Expose oxcRuntimePlugin as a callable plugin from rolldown/experimental to use it in Vite unbundled dev.

The aim is to reduce the inconsistency between dev and build as Rolldown resolves @oxc-project/runtime in a special way. The inconsistency caused a bug. See vitejs/vite#21822 for more details.

Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit ed98a89
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69b3d9237572030008012f51

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 12, 2026

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@8654

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@8654

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@8654

rolldown

npm i https://pkg.pr.new/rolldown@8654

@rolldown/binding-android-arm64

npm i https://pkg.pr.new/@rolldown/binding-android-arm64@8654

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@8654

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@8654

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@8654

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@8654

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@8654

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@8654

@rolldown/binding-linux-ppc64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-ppc64-gnu@8654

@rolldown/binding-linux-s390x-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-s390x-gnu@8654

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@8654

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@8654

@rolldown/binding-openharmony-arm64

npm i https://pkg.pr.new/@rolldown/binding-openharmony-arm64@8654

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@8654

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@8654

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@8654

commit: a9922f4

@sapphi-red sapphi-red marked this pull request as ready for review March 13, 2026 07:03
Copilot AI review requested due to automatic review settings March 13, 2026 07:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes Rolldown’s internal OXC runtime handling as an explicit builtin plugin factory (oxcRuntimePlugin) from rolldown/experimental, enabling Vite unbundled dev to reuse Rolldown’s special @oxc-project/runtime resolution behavior and reduce dev/build inconsistencies.

Changes:

  • Export oxcRuntimePlugin from the experimental entrypoint.
  • Add a JS-side builtin plugin constructor for builtin:oxc-runtime.
  • Wire the new builtin plugin name through the NAPI binding enum/mapping and Rust binding dependencies.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/rolldown/src/experimental-index.ts Re-exports oxcRuntimePlugin from the experimental entrypoint.
packages/rolldown/src/builtin-plugin/constructors.ts Adds oxcRuntimePlugin() constructor using makeBuiltinPluginCallable.
packages/rolldown/src/binding.d.cts Extends BindingBuiltinPluginName union with builtin:oxc-runtime.
crates/rolldown_binding/src/options/plugin/types/binding_builtin_plugin_name.rs Adds OxcRuntime variant for NAPI string enum.
crates/rolldown_binding/src/options/plugin/binding_builtin_plugin.rs Maps OxcRuntime to OxcRuntimePlugin implementation.
crates/rolldown_binding/Cargo.toml Adds rolldown_plugin_oxc_runtime dependency.
Cargo.lock Records the new Rust dependency in the lockfile.

You can also share your feedback on Copilot code review. Take the survey.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 13, 2026

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing 03-12-feat_expose_oxcruntimeplugin_ (92388c2) with main (7b8c6ee)

Open in CodSpeed

@github-actions
Copy link
Copy Markdown
Contributor

Benchmarks Rust

  • target: main(16de9b5)
  • pr: 03-12-feat_expose_oxcruntimeplugin_(92388c2)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.01     69.3±1.66ms        ? ?/sec    1.00     68.7±1.83ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.05     78.3±1.40ms        ? ?/sec    1.00     74.8±1.55ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    158.1±5.83ms        ? ?/sec    1.03    162.1±2.74ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.01    175.6±3.98ms        ? ?/sec    1.00    174.5±4.82ms        ? ?/sec
bundle/bundle@threejs                                        1.00     60.9±2.37ms        ? ?/sec    1.06     64.5±2.14ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     73.9±3.97ms        ? ?/sec    1.10     80.9±1.53ms        ? ?/sec
bundle/bundle@threejs10x                                     1.02    726.7±9.29ms        ? ?/sec    1.00    711.2±7.92ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.02    828.4±6.76ms        ? ?/sec    1.00    812.5±8.90ms        ? ?/sec
scan/scan@rome_ts                                            1.03     70.0±1.39ms        ? ?/sec    1.00     68.2±1.47ms        ? ?/sec
scan/scan@threejs                                            1.04     25.2±1.44ms        ? ?/sec    1.00     24.3±0.43ms        ? ?/sec
scan/scan@threejs10x                                         1.03    249.5±4.44ms        ? ?/sec    1.00    243.1±4.65ms        ? ?/sec

@sapphi-red sapphi-red marked this pull request as draft March 13, 2026 07:20
@sapphi-red sapphi-red force-pushed the 03-12-feat_expose_oxcruntimeplugin_ branch 2 times, most recently from b020379 to e371361 Compare March 13, 2026 08:59
@sapphi-red sapphi-red marked this pull request as ready for review March 13, 2026 09:24
@sapphi-red sapphi-red requested review from Copilot, hyf0 and shulaoda March 13, 2026 09:24
Copy link
Copy Markdown
Member Author

sapphi-red commented Mar 13, 2026

Merge activity

  • Mar 13, 9:29 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 13, 9:29 AM UTC: sapphi-red added this pull request to the Graphite merge queue.
  • Mar 13, 9:35 AM UTC: Merged by the Graphite merge queue.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes Rolldown’s internal OxcRuntimePlugin as a callable builtin plugin (oxcRuntimePlugin) via rolldown/experimental, primarily to make Vite unbundled dev resolve @oxc-project/runtime helpers the same way Rolldown does.

Changes:

  • Added a new builtin plugin constructor oxcRuntimePlugin() and exported it from rolldown/experimental.
  • Extended the NAPI binding builtin-plugin name set to include builtin:oxc-runtime and wired it to rolldown_plugin_oxc_runtime::OxcRuntimePlugin.
  • Added a Vitest test validating resolveId/load behavior for the exposed plugin.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/rolldown/tests/builtin-plugin/oxc-runtime.test.ts Adds coverage for oxcRuntimePlugin resolve/load behavior.
packages/rolldown/src/experimental-index.ts Re-exports oxcRuntimePlugin from rolldown/experimental.
packages/rolldown/src/builtin-plugin/constructors.ts Introduces the oxcRuntimePlugin() builtin plugin constructor.
packages/rolldown/src/binding.d.cts Updates BindingBuiltinPluginName union to include builtin:oxc-runtime.
crates/rolldown_binding/src/options/plugin/types/binding_builtin_plugin_name.rs Adds OxcRuntime to the NAPI string enum.
crates/rolldown_binding/src/options/plugin/binding_builtin_plugin.rs Maps the new enum variant to OxcRuntimePlugin.
crates/rolldown_binding/Cargo.toml Adds rolldown_plugin_oxc_runtime dependency.
Cargo.lock Locks the new dependency.

You can also share your feedback on Copilot code review. Take the survey.

Expose `oxcRuntimePlugin` as a callable plugin from `rolldown/experimental` to use it in Vite unbundled dev.

The aim is to reduce the inconsistency between dev and build as Rolldown resolves `@oxc-project/runtime` in a special way. The inconsistency caused a bug. See vitejs/vite#21822 for more details.
@graphite-app graphite-app bot force-pushed the 03-12-feat_expose_oxcruntimeplugin_ branch from e371361 to ed98a89 Compare March 13, 2026 09:30
@graphite-app graphite-app bot merged commit ed98a89 into main Mar 13, 2026
33 checks passed
@graphite-app graphite-app bot deleted the 03-12-feat_expose_oxcruntimeplugin_ branch March 13, 2026 09:35
This was referenced Mar 18, 2026
shulaoda added a commit that referenced this pull request Mar 18, 2026
## [1.0.0-rc.10] - 2026-03-18

### 🚀 Features

- add indentExclusionRanges property to MagicString (#8746) by @IWANABETHATGUY
- expose `oxcRuntimePlugin` (#8654) by @sapphi-red
- rust: make bundler generic over FileSystem for in-memory benchmarks (#8652) by @Boshen

### 🐛 Bug Fixes

- rolldown_plugin_vite_dynamic_import_vars: align dynamic import fast check with Vite (#8760) by @shulaoda
- renamer: handle existing bindings in nested scopes when finding unique names (#8741) by @drewolson
- pass `yarn_pnp` option where needed (#8736) by @sapphi-red
- preserve optional chaining in namespace member expr rewrite (#8712) by @Copilot
- correct UTF-16 index handling in native MagicString (#8693) by @IWANABETHATGUY
- mark failing doctests as ignore (#8700) by @Boshen
- prevent may_partial_namespace from leaking through include_module (#8682) by @IWANABETHATGUY
- ci: bump native-build cache key to invalidate stale napi-rs artifacts (#8678) by @Boshen
- `comments.annotation: false` breaking tree-shaking (#8657) by @IWANABETHATGUY
- validate filenames for NUL bytes from chunkFileNames/entryFileNames (#8644) by @IWANABETHATGUY
- dce-only minify should not set NODE_ENV to production (#8651) by @IWANABETHATGUY

### 🚜 Refactor

- rust: remove dead `CrossModuleOptimizationConfig::side_effects_free_function_optimization` (#8673) by @Dunqing
- rust: simplify `cross_module_optimization` by removing redundant scope tracking (#8672) by @Dunqing
- simplify string repeat in guess_indentor (#8753) by @IWANABETHATGUY
- consolidate custom magic-string tests into one file (#8696) by @IWANABETHATGUY
- extract CJS bailout checks from include_symbol (#8683) by @IWANABETHATGUY
- rust: remove `BindingIdentifierExt` to use `BindingIdentifier::symbol_id()` instead (#8667) by @Dunqing
- bench: add bench_preset helper and inline presets (#8658) by @Boshen
- rust: filter external modules from entries instead of mapping bit positions (#8637) by @Dunqing

### 📚 Documentation

- clarify watch mode behavior and its limitations (#8751) by @sapphi-red
- add external link icon to GitHub button in Hero section (#8731) by @thisisnkc
- guide: clarify that `inject` option is only conceptually similar to esbuild's one (#8743) by @sapphi-red
- meta/design: add `devtools.md` (#8663) by @hyf0
- add viteplus alpha announcement banner (#8668) by @shulaoda

### ⚡ Performance

- rolldown: some minor perf optimization found by autoresearch (#8730) by @Brooooooklyn
- replace Vec allocation with lazy iterator in find_hash_placeholders (#8703) by @Boshen
- replace TypedDashMap with TypedMap in CustomField (#8708) by @Boshen
- bench: remove scan benchmark binary to halve LTO link time (#8694) by @Boshen

### 🧪 Testing

- watch: increase timeout for error output (#8766) by @sapphi-red
- vite-tests: remove JS plugin tests (#8767) by @sapphi-red
- watch: add CLI exit code test (#8752) by @sapphi-red
- normalize paths on Windows even if `resolve.symlinks` is false (#8483) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- correct comment in bundle-analyzer-plugin.ts (#8770) by @origami-z
- upgrade oxc to 0.120.0 (#8764) by @Boshen
- enable all test for `reset` category in MagicString.test.ts (#8749) by @IWANABETHATGUY
- deps: update test262 submodule for tests (#8742) by @sapphi-red
- deps: update oxc apps (#8734) by @renovate[bot]
- deps: update softprops/action-gh-release action to v2.6.1 (#8724) by @renovate[bot]
- deps: update npm packages (major) (#8722) by @renovate[bot]
- deps: update github-actions (major) (#8721) by @renovate[bot]
- deps: update softprops/action-gh-release action to v2.6.0 (#8720) by @renovate[bot]
- deps: update npm packages (#8718) by @renovate[bot]
- deps: update rust crates (#8717) by @renovate[bot]
- deps: update github-actions (#8716) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.17.0 (#8713) by @renovate[bot]
- deps: bump cargo-shear to v1.11.2 (#8711) by @Boshen
- use org level `CODE_OF_CONDUCT.md` (#8706) by @sapphi-red
- fix cache key mismatch and remove redundant cache saves (#8695) by @Boshen
- deps: update oxc apps (#8692) by @renovate[bot]
- deps: update oxc apps (#8649) by @renovate[bot]
- should do matrix out side of reusable workflows 2 (#8691) by @hyf0
- should do matrix out side of reusable workflows (#8690) by @hyf0
- deps: update dependency rolldown-plugin-dts to v0.22.5 (#8689) by @renovate[bot]
- upgrade oxc to 0.119.0 and oxc_resolver to 11.19.1 (#8686) by @Boshen
- correct if condition of `type-check` job (#8677) by @hyf0
- Gate CI type-check job on node changes (#8669) by @Copilot
- benchmark: improve codspeed build (#8665) by @Boshen
- deps: update oxc to v0.118.0 (#8650) by @renovate[bot]
- deps: update crate-ci/typos action to v1.44.0 (#8647) by @renovate[bot]
- deps: update oxc resolver to v11.19.1 (#8646) by @renovate[bot]
- deps: update dependency rust to v1.94.0 (#8648) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.22.4 (#8645) by @renovate[bot]

### ◀️ Revert

- Revert "ci: Gate CI type-check job on node changes" (#8674) by @hyf0
- "chore(deps): update dependency rust to v1.94.0 (#8648)" (#8660) by @shulaoda

### ❤️ New Contributors

* @origami-z made their first contribution in [#8770](#8770)
* @drewolson made their first contribution in [#8741](#8741)
* @thisisnkc made their first contribution in [#8731](#8731)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants