Skip to content

Comments

refactor!: expose \0rolldown/runtime in transform hook#8068

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-27-feat_expose_0rolldown_runtime_in_transform_hook
Jan 27, 2026
Merged

refactor!: expose \0rolldown/runtime in transform hook#8068
graphite-app[bot] merged 1 commit intomainfrom
01-27-feat_expose_0rolldown_runtime_in_transform_hook

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Jan 26, 2026

No description provided.

@hyf0 hyf0 changed the title feat!: expose \0rolldown/runtime in transform hook refactor!: expose \0rolldown/runtime in transform hook Jan 26, 2026
Copy link
Member Author

hyf0 commented Jan 26, 2026


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.

@hyf0 hyf0 marked this pull request as ready for review January 26, 2026 17:35
Copilot AI review requested due to automatic review settings January 26, 2026 17:35
@hyf0 hyf0 force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from a94ca38 to c4ba6c7 Compare January 26, 2026 17:36
@hyf0 hyf0 force-pushed the 01-27-refactor_rename_rolldown_runtime_to_0rolldown_runtime.js_ branch from 058014f to 26002fb Compare January 26, 2026 17:36
@hyf0 hyf0 requested review from sapphi-red and removed request for Copilot January 26, 2026 17:37
@hyf0 hyf0 force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from c4ba6c7 to ebfd6c2 Compare January 26, 2026 17:40
Copilot AI review requested due to automatic review settings January 26, 2026 17:40
Copy link
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 pull request enables the \0rolldown/runtime.js module to be processed by transform hooks, and exposes its identifier constant to TypeScript users.

Changes:

  • Exports ROLLDOWN_RUNTIME_ID constant from the rolldown package for programmatic use
  • Modifies transform hook filtering to only skip rolldown: prefixed modules, allowing \0rolldown/ modules to be transformed

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/rolldown/src/index.ts Adds export for the ROLLDOWN_RUNTIME_ID constant
packages/rolldown/src/constants/index.ts Defines the ROLLDOWN_RUNTIME_ID constant with value '\0rolldown/runtime.js'
crates/rolldown/src/module_loader/module_task.rs Removes \0rolldown/ prefix check from transform hook skip condition, now only rolldown: prefix is skipped

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hyf0 hyf0 force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from ebfd6c2 to b1f66b1 Compare January 26, 2026 17:46
@hyf0 hyf0 force-pushed the 01-27-refactor_rename_rolldown_runtime_to_0rolldown_runtime.js_ branch from 26002fb to 5666aa7 Compare January 26, 2026 17:46
@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

Benchmarks Rust

  • target: main(f3f0778)
  • pr: 01-27-feat_expose_0rolldown_runtime_in_transform_hook(3435a8f)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     67.5±1.57ms        ? ?/sec    1.00     67.7±1.62ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     73.9±1.90ms        ? ?/sec    1.00     73.6±1.49ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00     98.8±2.82ms        ? ?/sec    1.01     99.6±2.88ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    110.0±2.21ms        ? ?/sec    1.01    111.4±1.97ms        ? ?/sec
bundle/bundle@threejs                                        1.00     34.7±0.66ms        ? ?/sec    1.00     34.8±0.67ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     39.8±1.26ms        ? ?/sec    1.00     39.8±0.77ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    358.7±3.01ms        ? ?/sec    1.01    361.5±5.89ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    416.8±4.27ms        ? ?/sec    1.00    415.7±4.28ms        ? ?/sec
scan/scan@rome_ts                                            1.02     80.8±1.61ms        ? ?/sec    1.00     79.2±1.52ms        ? ?/sec
scan/scan@threejs                                            1.01     28.0±1.80ms        ? ?/sec    1.00     27.8±1.81ms        ? ?/sec
scan/scan@threejs10x                                         1.02    285.9±4.34ms        ? ?/sec    1.00    281.5±4.57ms        ? ?/sec

@hyf0 hyf0 force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from b1f66b1 to 5044767 Compare January 27, 2026 04:31
@hyf0 hyf0 force-pushed the 01-27-refactor_rename_rolldown_runtime_to_0rolldown_runtime.js_ branch from 5666aa7 to 1555d2b Compare January 27, 2026 04:31
@graphite-app graphite-app bot changed the base branch from 01-27-refactor_rename_rolldown_runtime_to_0rolldown_runtime.js_ to graphite-base/8068 January 27, 2026 04:46
@graphite-app graphite-app bot force-pushed the graphite-base/8068 branch from 1555d2b to f3a03ed Compare January 27, 2026 05:00
@graphite-app graphite-app bot force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from 5044767 to e610433 Compare January 27, 2026 05:00
@graphite-app graphite-app bot changed the base branch from graphite-base/8068 to main January 27, 2026 05:00
@graphite-app graphite-app bot force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from e610433 to 85e2b31 Compare January 27, 2026 05:00
@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 3435a8f
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69788de4fa0b8100085061e6
😎 Deploy Preview https://deploy-preview-8068--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hyf0 hyf0 force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from 85e2b31 to 6e5b7bb Compare January 27, 2026 05:43
Copilot AI review requested due to automatic review settings January 27, 2026 05:43
Copy link
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member Author

hyf0 commented Jan 27, 2026

Merge activity

  • Jan 27, 7:19 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.
  • Jan 27, 7:20 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.
  • Jan 27, 10:04 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.
  • Jan 27, 10:04 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Jan 27, 10:16 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch from 6e5b7bb to 3435a8f Compare January 27, 2026 10:05
@graphite-app graphite-app bot merged commit 3435a8f into main Jan 27, 2026
35 checks passed
@graphite-app graphite-app bot deleted the 01-27-feat_expose_0rolldown_runtime_in_transform_hook branch January 27, 2026 10:16
This was referenced Jan 28, 2026
shulaoda added a commit that referenced this pull request Jan 28, 2026
## [1.0.0-rc.2] - 2026-01-28

⚡ Lazy Barrel Optimization

- Skips compilation of unused re-export modules in side-effect-free barrel modules
- Particularly beneficial for projects importing from large component libraries

For large component libraries like Ant Design, when you import just one component:

```js
import { Button } from 'antd';
Button;
```

| Metric                    | Without lazy barrel | With lazy barrel |
| -------------------- | --------------------- | ---------------- |
| Modules compiled | 2986                       | 250              |
| Build time               | ~210ms                  | ~50ms            |

By enabling lazy barrel, Rolldown reduces the number of compiled modules by 90% and speeds up the build by 2-4x. 

Enable it in your config:

```js
export default {
  experimental: {
    lazyBarrel: true,
  },
};
```

For more details, see the https://rolldown.rs/in-depth/lazy-barrel-optimization

### 💥 BREAKING CHANGES

- expose `\0rolldown/runtime` in transform hook (#8068) by @hyf0
- rename `rolldown:runtime` to `\0rolldown/runtime.js` (#8067) by @hyf0

### 🚀 Features

- remove inlined constants in smart mode (#8085) by @sapphi-red
- allow more options for `this.emitFile` with `type: 'prebuilt-chunk'` (#8062) by @sapphi-red
- warn when both code and postBanner contain shebang (#8039) by @Copilot

### 🐛 Bug Fixes

- update the links to Rolldown docs in the error messages (#8103) by @sapphi-red
- handle tsconfig.json load errors (#8105) by @sapphi-red
- include inlined constants in namespace object (#8099) by @sapphi-red
- vite test ci (#8084) by @IWANABETHATGUY
- renamer: nested binding shadowing external module namespace in UMD/IIFE formats (#8083) by @Dunqing
- deduplicate ESM chunk imports by canonical symbol (#8059) by @IWANABETHATGUY
- refine side-effect detection for BigInt and RegExp (#8060) by @IWANABETHATGUY
- rust: use string literal span for `new URL` error diagnostic (#8043) by @valadaptive
- rust: use ModuleType::Asset for `new URL` imports (#8035) by @valadaptive
- CJS-ESM interop - property assignment on CJS module exports (#8006) by @IWANABETHATGUY
- eliminate the facade chunk if the dynamic entry module has been merged into common chunk (#8046) by @IWANABETHATGUY
- Inlining dynamic imports broken with multiple entry points (#8037) by @IWANABETHATGUY
- devtools: revert `Chunk#id` to `Chunk#chunk_id` (#8040) by @hyf0
- invert `__exportAll` parameter logic to reduce default output size (#8036) by @Copilot
- `</script` tag search should be case insensitive (#8033) by @IWANABETHATGUY
- use directory name as-is for the variable name even if the name contained `.` (#8029) by @Copilot
- dev/lazy: remove unnecessary rewrite from top level `this` to `undefined` (#8020) by @hyf0
- dev/lazy: should keep lazy entries imports for patch file (#8019) by @hyf0
- `output.generatedCode.preset: 'es2015'` was not set by default (#8026) by @sapphi-red
- node: align option validator to types (#8023) by @sapphi-red
- node: allow `output.strictExecutionOrder` by the option validator (#8022) by @sapphi-red
- types: return `this` from on / off methods of `RolldownWatcher` (#8015) by @sapphi-red

### 🚜 Refactor

- rolldown_plugin_vite_dynamic_import_vars: remove v1 implementation (#8096) by @shulaoda
- rolldown_plugin_vite_import_glob: remove v1 implementation (#8095) by @shulaoda
- lazy-barrel: restructure lazy barrel implementation (#8070) by @shulaoda
- remove `use_built_ins` and `use_spread` from internal JSX options (#8079) by @sapphi-red
- remove `experimental.transformHiresSourcemap` (#8055) by @Copilot
- rust: use `is_data_url` more consistently (#8042) by @valadaptive
- use `FxIndexMap` to store EntryPoint (#8032) by @IWANABETHATGUY
- node: add type checks that ensures validator schema is up to date with types (#8024) by @sapphi-red

### 📚 Documentation

- link to vite plugin registry (#8086) by @sapphi-red
- lazy-barrel: improve documentation and enable in sidebar (#8072) by @shulaoda
- add more examples and details (#8054) by @sapphi-red
- in-depth: add dead code elimination page (#8007) by @sapphi-red
- update status from beta to release candidate (#8012) by @shulaoda

### ⚡ Performance

- run inline-const pass for modules that are affected by inlining (#8064) by @sapphi-red

### 🧪 Testing

- lazy-barrel: use package.json sideEffects instead of plugin hook (#8077) by @shulaoda
- lazy-barrel: enable tests and add treeshake-behavior cases (#8071) by @shulaoda

### ⚙️ Miscellaneous Tasks

- deps: update crate-ci/typos action to v1.42.3 (#8087) by @renovate[bot]
- deps: update rollup submodule for tests to v4.56.0 (#8073) by @sapphi-red
- deps: update oxc to v0.111.0 (#8063) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.6 (#8076) by @renovate[bot]
- deps: update test262 submodule for tests (#8074) by @sapphi-red
- deps: update crate-ci/typos action to v1.42.2 (#8069) by @renovate[bot]
- deps: update oxc apps (#8066) by @renovate[bot]
- remove `{@include ./foo.md}` from d.ts files (#8056) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.11.2 (#8057) by @renovate[bot]
- deps: update github-actions (#8050) by @renovate[bot]
- deps: update npm packages (#8051) by @renovate[bot]
- deps: update rust crates (#8049) by @renovate[bot]
- debug: add IdxExt debug trait for human-readable index debugging (#8045) by @IWANABETHATGUY
- deps: update dependency rolldown-plugin-dts to v0.21.5 (#8034) by @renovate[bot]
- deps: update oxc resolver to v11.16.4 (#8031) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.4 (#8030) by @renovate[bot]
- deps: update dependency rust to v1.93.0 (#8018) by @renovate[bot]
- archive 2025 beta changelog (#8014) by @shulaoda
- update release workflow version pattern from beta to rc (#8013) by @shulaoda

### ❤️ New Contributors

* @valadaptive made their first contribution in [#8043](#8043)

Co-authored-by: shulaoda <[email protected]>
graphite-app bot pushed a commit that referenced this pull request Jan 31, 2026
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.

2 participants