Skip to content

Comments

feat: add builtin plugin for visualizing chunk graph#8162

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-28-feat_chunk_visualization_plugin
Feb 9, 2026
Merged

feat: add builtin plugin for visualizing chunk graph#8162
graphite-app[bot] merged 1 commit intomainfrom
01-28-feat_chunk_visualization_plugin

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Feb 2, 2026

No description provided.

Copy link
Member Author

IWANABETHATGUY commented Feb 2, 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.

@netlify
Copy link

netlify bot commented Feb 2, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 1251959
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6989a07719319600086d5588

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 2, 2026

Open in StackBlitz

@rolldown/browser

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

@rolldown/debug

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

@rolldown/pluginutils

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

rolldown

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

@rolldown/binding-android-arm64

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

@rolldown/binding-darwin-arm64

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

@rolldown/binding-darwin-x64

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

@rolldown/binding-freebsd-x64

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

@rolldown/binding-linux-arm-gnueabihf

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

@rolldown/binding-linux-arm64-gnu

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

@rolldown/binding-linux-arm64-musl

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

@rolldown/binding-linux-x64-gnu

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

@rolldown/binding-linux-x64-musl

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

@rolldown/binding-openharmony-arm64

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

@rolldown/binding-wasm32-wasi

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

@rolldown/binding-win32-arm64-msvc

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

@rolldown/binding-win32-x64-msvc

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

commit: f2bf28a

@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch 9 times, most recently from 16eced4 to d4dd4de Compare February 8, 2026 07:31
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review February 8, 2026 13:36
@IWANABETHATGUY IWANABETHATGUY requested review from Copilot, hyf0 and shulaoda and removed request for Copilot February 8, 2026 13:36
@IWANABETHATGUY IWANABETHATGUY changed the title feat: chunk visualization plugin feat: chunk metadata plugin Feb 8, 2026
@IWANABETHATGUY IWANABETHATGUY changed the title feat: chunk metadata plugin feat: add builtin plugin for visualizing chunk graph Feb 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Benchmarks Rust

  • target: main(37107bf)
  • pr: 01-28-feat_chunk_visualization_plugin(f2bf28a)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     66.8±1.15ms        ? ?/sec    1.13     75.5±2.17ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     74.9±2.77ms        ? ?/sec    1.06     79.6±3.42ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    100.4±3.03ms        ? ?/sec    1.01    101.6±1.75ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    110.8±2.32ms        ? ?/sec    1.03    113.8±2.40ms        ? ?/sec
bundle/bundle@threejs                                        1.00     34.7±2.03ms        ? ?/sec    1.00     34.7±0.68ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     39.9±0.46ms        ? ?/sec    1.01     40.4±0.70ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    359.2±3.20ms        ? ?/sec    1.05    378.1±4.86ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    414.3±2.52ms        ? ?/sec    1.05    433.3±6.32ms        ? ?/sec
scan/scan@rome_ts                                            1.00     78.7±1.60ms        ? ?/sec    1.01     79.7±1.60ms        ? ?/sec
scan/scan@threejs                                            1.00     27.4±1.61ms        ? ?/sec    1.01     27.6±0.65ms        ? ?/sec
scan/scan@threejs10x                                         1.00    282.2±4.97ms        ? ?/sec    1.00    282.6±4.33ms        ? ?/sec

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

Adds a new built-in plugin that emits JSON describing the produced chunk graph (chunks, modules, and relationships) to support bundle analysis, along with a demo example and the necessary Rust↔TS binding wiring.

Changes:

  • Introduce rolldown_plugin_chunk_visualize (Rust) and a JS factory chunkVisualizePlugin() to enable emitting analyze-data.json.
  • Wire the plugin through the binding layer (enum name, config object, TS typings) and export it from rolldown/experimental and rolldown/plugins.
  • Add an examples/chunk-visualize-demo project demonstrating code-splitting and plugin usage.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds the new example as a workspace importer dependency on rolldown.
packages/rolldown/src/plugins-index.ts Exports chunkVisualizePlugin from the stable rolldown/plugins entrypoint.
packages/rolldown/src/options/input-options.ts Formatting-only change (blank line).
packages/rolldown/src/experimental-index.ts Re-exports chunkVisualizePlugin from rolldown/experimental.
packages/rolldown/src/builtin-plugin/chunk-visualize-plugin.ts New JS builtin-plugin factory and JSDoc examples for chunkVisualizePlugin().
packages/rolldown/src/binding.d.cts Updates generated TS types: builtin plugin name union + plugin config interface.
examples/chunk-visualize-demo/src/worker.js Demo entry showcasing dynamic import and various module relationships.
examples/chunk-visualize-demo/src/utils/logger.js Demo logger stub used by the example modules.
examples/chunk-visualize-demo/src/utils/helpers.js Demo helper functions to create additional module edges.
examples/chunk-visualize-demo/src/styles.css Minimal CSS asset for the demo build.
examples/chunk-visualize-demo/src/router.js Demo class module for chunk graph variety.
examples/chunk-visualize-demo/src/main.js Demo main entry with dynamic imports and exports.
examples/chunk-visualize-demo/src/features/dashboard.js Demo feature module imported dynamically.
examples/chunk-visualize-demo/src/features/admin.js Demo feature module imported dynamically.
examples/chunk-visualize-demo/src/components/header.js Demo component module.
examples/chunk-visualize-demo/src/components/footer.js Demo component module.
examples/chunk-visualize-demo/src/app.js Demo app wiring that references multiple modules.
examples/chunk-visualize-demo/rolldown.config.js Demo config enabling the chunk visualization plugin.
examples/chunk-visualize-demo/package.json Declares the new example package and build script.
examples/chunk-visualize-demo/README.md Explains plugin usage, output, and how to analyze the JSON.
crates/rolldown_plugin_chunk_visualize/src/lib.rs New Rust plugin implementation: builds chunk/module graph and emits JSON asset.
crates/rolldown_plugin_chunk_visualize/Cargo.toml New crate manifest for the plugin.
crates/rolldown_binding/src/options/plugin/types/binding_builtin_plugin_name.rs Adds builtin:chunk-visualize to the binding builtin plugin enum.
crates/rolldown_binding/src/options/plugin/config/mod.rs Registers and re-exports the new binding config type.
crates/rolldown_binding/src/options/plugin/config/binding_chunk_visualize_plugin_config.rs New NAPI object config and conversion into ChunkVisualizePlugin.
crates/rolldown_binding/src/options/plugin/binding_builtin_plugin.rs Instantiates the new plugin from binding options.
crates/rolldown_binding/Cargo.toml Adds dependency on rolldown_plugin_chunk_visualize.
Cargo.toml Adds rolldown_plugin_chunk_visualize to workspace dependencies.
Cargo.lock Records the new crate and dependency edges.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from a37bde0 to 9691365 Compare February 9, 2026 02:41
Copilot AI review requested due to automatic review settings February 9, 2026 03:58
@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from 9691365 to f9d3997 Compare February 9, 2026 03:58
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 29 out of 31 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from f9d3997 to 0812a20 Compare February 9, 2026 04:10
Copilot AI review requested due to automatic review settings February 9, 2026 08:40
@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from f04fcaa to f2bf28a Compare February 9, 2026 08: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

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

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 9, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 01-28-feat_chunk_visualization_plugin branch from f2bf28a to 1251959 Compare February 9, 2026 08:53
@graphite-app graphite-app bot merged commit 1251959 into main Feb 9, 2026
35 checks passed
@graphite-app graphite-app bot deleted the 01-28-feat_chunk_visualization_plugin branch February 9, 2026 09:02
This was referenced Feb 11, 2026
shulaoda added a commit that referenced this pull request Feb 11, 2026
## [1.0.0-rc.4] - 2026-02-11

💡 Granular `comments` Option
- New `output.comments` option provides fine-grained control over comment preservation
- The `output.legalComments` option is now deprecated and use `comments.legal` instead

### 🚀 Features

- rename error name to `RolldownError` from `RollupError` (#8262) by @sapphi-red
- add hidden `resolve_tsconfig` function for Vite (#8257) by @sapphi-red
- rust: introduce `rolldown_watcher` (#8161) by @hyf0
- unify `comments` and `legalComments` into a single granular `comments` option (#8229) by @IWANABETHATGUY
- add builtin plugin for visualizing chunk graph (#8162) by @IWANABETHATGUY
- show import declaration location in AssignToImport errors (#8222) by @Copilot
- show import declaration span in CannotCallNamespace error (#8223) by @Copilot
- emit error when plugin accidentally removes runtime module symbols (#8203) by @IWANABETHATGUY
- support tsconfig loading & inputMap for `transform` (#8180) by @sapphi-red
- rolldown_plugin_vite_reporter: update warning message to link to Rolldown docs (#8205) by @sapphi-red

### 🐛 Bug Fixes

- avoid panic on untranspiled JSX syntax by reporting a diagnostic error (#8226) by @IWANABETHATGUY
- rolldown_plugin_vite_import_glob: relax absolute path check and improve invalid glob warning (#8219) by @shulaoda
- merge chunks after detect circular reference (#8154) by @IWANABETHATGUY
- rust: detect runtime module side effects based on its content (#8209) by @hyf0

### 🚜 Refactor

- rename `other` to `jsdoc` in comments options (#8256) by @IWANABETHATGUY
- rename chunk-visualize plugin with bundle-analyzer plugin (#8255) by @IWANABETHATGUY
- remove EXPORT_UNDEFINED_VARIABLE error (#8228) by @Copilot
- consolidate missing runtime symbol errors into a single diagnostic (#8220) by @IWANABETHATGUY
- stabilize `parse` and `parseSync` (#8215) by @sapphi-red
- return errors instead of panicking on builtin plugin conversion failure (#8217) by @shulaoda
- expose `parse` / `minify` / `transform` from `rolldown/utils` (#8214) by @sapphi-red
- prepare defer chunk merging (#8153) by @IWANABETHATGUY

### 📚 Documentation

- remove `<script>` escape behavior difference note from `platform` option (#8253) by @sapphi-red
- TypeScript & JSX support by plugins (#8183) by @sapphi-red

### 🧪 Testing

- ensure runtime module is preserved even if it's not used but has side effects (#8213) by @hyf0

### ⚙️ Miscellaneous Tasks

- deps: update oxc to v0.113.0 (#8267) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.12.0 (#8272) by @renovate[bot]
- deps: update oxc apps (#8269) by @renovate[bot]
- deps: update test262 submodule for tests (#8261) by @sapphi-red
- deps: update crate-ci/typos action to v1.43.4 (#8260) by @renovate[bot]
- deps: update dependency esbuild to v0.27.3 (#8250) by @renovate[bot]
- deps: update rust crates (#8244) by @renovate[bot]
- deps: update dependency semver to v7.7.4 (#8247) by @renovate[bot]
- deps: update github-actions (#8243) by @renovate[bot]
- deps: update npm packages (#8245) by @renovate[bot]
- deps: update oxc resolver to v11.17.1 (#8240) by @renovate[bot]
- deps: update rust crate oxc_sourcemap to v6.0.2 (#8241) by @renovate[bot]
- rust: handle ignored `RUSTSEC-2025-0141` cargo check error (#8235) by @hyf0
- deps: update dependency oxlint-tsgolint to v0.11.5 (#8233) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.22.0 (#8232) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.3 (#8225) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.9 (#8224) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.2 (#8212) by @renovate[bot]
- remove rolldown_plugin_vite_wasm_helper (#8207) by @shulaoda
- build docs for production (#8206) by @sapphi-red

Co-authored-by: shulaoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants