Skip to content

feat: add LLM-friendly markdown output format to bundle analyzer plugin#8242

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-07-feat_markdown_format_chunk_meta
Mar 1, 2026
Merged

feat: add LLM-friendly markdown output format to bundle analyzer plugin#8242
graphite-app[bot] merged 1 commit intomainfrom
02-07-feat_markdown_format_chunk_meta

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Feb 8, 2026

Summary

Adds an LLM-friendly markdown output format for the chunk visualization plugin, and an optimization suggestions section that analyzes bundle composition.

Markdown Format (format: 'md')

When format: 'md' is set, the plugin emits a structured markdown report instead of JSON. The report is designed to be consumed by LLMs and contains:

Section Description
Quick Summary Total output size, module count, entry points, code-split chunks
Largest Modules by Output Contribution All modules sorted by size with percentage of total
Entry Point Analysis Each entry's output file, bundle size, loaded chunks, and bundled modules
Dependency Chains Modules imported by multiple files — helps understand why a module is included
Optimization Suggestions Actionable suggestions with severity levels (see below)
Full Module Graph Complete per-module dependency info (imports, imported-by, size)
Raw Data for Searching Grep-friendly [MODULE:], [IMPORT:], [IMPORTED_BY:], [ENTRY:], [CHUNK:] patterns

Optimization Suggestions

The new suggestions section identifies modules in shared common chunks that are only reachable from a single static entry. These modules are unnecessarily shared and could be moved closer to their entry point via code splitting configuration.

Each suggestion includes a severity level based on the proportion of single-entry-reachable module size:

  • [HIGH] — > 50%
  • [MEDIUM] — 30%–50%
  • [LOW] — < 30%

Other Changes

  • format field type narrowed from string to 'json' | 'md' via #[napi(ts_type)]
  • Updated chunk-visualize-demo example with a proper multi-entry dependency graph that demonstrates the optimization suggestions

Copy link
Member Author

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

@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch 8 times, most recently from 3f071b6 to 3d3f4cd Compare February 8, 2026 16:52
@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from d4dd4de to a37bde0 Compare February 8, 2026 17:09
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from 11ac591 to edbbfbd Compare February 8, 2026 17:09
@IWANABETHATGUY IWANABETHATGUY changed the title feat: chunk visualization plugin feat: markdown format & optimization suggestions for chunk visualize plugin Feb 8, 2026
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from edbbfbd to 9fe108c Compare February 9, 2026 02:41
@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch 2 times, most recently from 9691365 to f9d3997 Compare February 9, 2026 03:58
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from 9fe108c to 3d1e6a6 Compare February 9, 2026 03:58
@IWANABETHATGUY IWANABETHATGUY force-pushed the 01-28-feat_chunk_visualization_plugin branch from f9d3997 to 0812a20 Compare February 9, 2026 04:10
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch 2 times, most recently from 195e4f8 to bf26cb2 Compare 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
@graphite-app graphite-app bot changed the base branch from 01-28-feat_chunk_visualization_plugin to graphite-base/8242 February 9, 2026 08:53
@graphite-app graphite-app bot force-pushed the graphite-base/8242 branch from f2bf28a to 1251959 Compare February 9, 2026 09:03
@graphite-app graphite-app bot force-pushed the 02-07-feat_markdown_format_chunk_meta branch from bf26cb2 to e7fedd8 Compare February 9, 2026 09:03
@graphite-app graphite-app bot changed the base branch from graphite-base/8242 to main February 9, 2026 09:04
@graphite-app graphite-app bot force-pushed the 02-07-feat_markdown_format_chunk_meta branch from e7fedd8 to bdbd4a1 Compare February 9, 2026 09:04
@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for rolldown-rs canceled.

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

@IWANABETHATGUY IWANABETHATGUY changed the base branch from main to graphite-base/8242 February 9, 2026 09:34
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from bdbd4a1 to b671a7f Compare February 9, 2026 09:34
@IWANABETHATGUY IWANABETHATGUY changed the base branch from graphite-base/8242 to 02-09-refactor_give_a_proper_crate_name_for_bundle_analyze_plugin February 9, 2026 09:34
@graphite-app graphite-app bot changed the base branch from 02-09-refactor_give_a_proper_crate_name_for_bundle_analyze_plugin to graphite-base/8242 February 9, 2026 09:44
@graphite-app graphite-app bot force-pushed the graphite-base/8242 branch from 6eed944 to 325c779 Compare February 9, 2026 09:59
@graphite-app graphite-app bot force-pushed the 02-07-feat_markdown_format_chunk_meta branch from b671a7f to 1f9f0be Compare February 9, 2026 09:59
@graphite-app graphite-app bot changed the base branch from graphite-base/8242 to main February 9, 2026 10:00
@graphite-app graphite-app bot force-pushed the 02-07-feat_markdown_format_chunk_meta branch from 1f9f0be to 29c2594 Compare February 9, 2026 10:00
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from 29c2594 to b0be86e Compare March 1, 2026 07:01
@IWANABETHATGUY IWANABETHATGUY changed the title feat: markdown format & optimization suggestions for chunk visualize plugin feat: add LLM-friendly markdown output format to bundle analyzer plugin Mar 1, 2026
@IWANABETHATGUY IWANABETHATGUY force-pushed the 02-07-feat_markdown_format_chunk_meta branch from b0be86e to c26b8a4 Compare March 1, 2026 07:21
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review March 1, 2026 07:59
@IWANABETHATGUY IWANABETHATGUY requested review from Copilot, hyf0 and shulaoda and removed request for Copilot March 1, 2026 07:59
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 1, 2026

Merge activity

…in (#8242)

## Summary

Adds an LLM-friendly markdown output format for the chunk visualization plugin, and an optimization suggestions section that analyzes bundle composition.

### Markdown Format (`format: 'md'`)

When `format: 'md'` is set, the plugin emits a structured markdown report instead of JSON. The report is designed to be consumed by LLMs and contains:

| Section | Description |
| --- | --- |
| **Quick Summary** | Total output size, module count, entry points, code-split chunks |
| **Largest Modules by Output Contribution** | All modules sorted by size with percentage of total |
| **Entry Point Analysis** | Each entry's output file, bundle size, loaded chunks, and bundled modules |
| **Dependency Chains** | Modules imported by multiple files — helps understand why a module is included |
| **Optimization Suggestions** | Actionable suggestions with severity levels (see below) |
| **Full Module Graph** | Complete per-module dependency info (imports, imported-by, size) |
| **Raw Data for Searching** | Grep-friendly `[MODULE:]`, `[IMPORT:]`, `[IMPORTED_BY:]`, `[ENTRY:]`, `[CHUNK:]` patterns |

### Optimization Suggestions

The new suggestions section identifies modules in **shared common chunks** that are only reachable from a **single static entry**. These modules are unnecessarily shared and could be moved closer to their entry point via code splitting configuration.

Each suggestion includes a severity level based on the proportion of single-entry-reachable module size:

- **`[HIGH]`** — > 50%
- **`[MEDIUM]`** — 30%–50%
- **`[LOW]`** — < 30%

### Other Changes

- `format` field type narrowed from `string` to `'json' | 'md'` via `#[napi(ts_type)]`
- Updated `chunk-visualize-demo` example with a proper multi-entry dependency graph that demonstrates the optimization suggestions
@graphite-app graphite-app bot force-pushed the 02-07-feat_markdown_format_chunk_meta branch from c26b8a4 to 7c89e51 Compare March 1, 2026 08:01
@graphite-app graphite-app bot merged commit 7c89e51 into main Mar 1, 2026
34 of 35 checks passed
@graphite-app graphite-app bot deleted the 02-07-feat_markdown_format_chunk_meta branch March 1, 2026 08:13
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Benchmarks Rust

  • target: main(20bce39)
  • pr: 02-07-feat_markdown_format_chunk_meta(7c89e51)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     77.2±1.35ms        ? ?/sec    1.01     77.7±1.40ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     85.3±1.42ms        ? ?/sec    1.01     86.2±1.39ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    157.6±3.07ms        ? ?/sec    1.00    157.8±2.77ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    174.4±2.95ms        ? ?/sec    1.01    176.1±3.02ms        ? ?/sec
bundle/bundle@threejs                                        1.01     71.6±2.28ms        ? ?/sec    1.00     71.1±1.32ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.02     79.3±0.81ms        ? ?/sec    1.00     77.6±0.74ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    758.6±5.66ms        ? ?/sec    1.00    761.6±6.53ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    869.5±5.65ms        ? ?/sec    1.01    878.1±7.30ms        ? ?/sec
scan/scan@rome_ts                                            1.00     76.8±1.95ms        ? ?/sec    1.01     77.8±1.62ms        ? ?/sec
scan/scan@threejs                                            1.00     27.2±0.38ms        ? ?/sec    1.02     27.7±0.45ms        ? ?/sec
scan/scan@threejs10x                                         1.00    266.2±2.69ms        ? ?/sec    1.02    271.1±3.38ms        ? ?/sec

IWANABETHATGUY added a commit that referenced this pull request Mar 1, 2026
…in (#8242)

Adds an LLM-friendly markdown output format for the chunk visualization plugin, and an optimization suggestions section that analyzes bundle composition.

When `format: 'md'` is set, the plugin emits a structured markdown report instead of JSON. The report is designed to be consumed by LLMs and contains:

| Section | Description |
| --- | --- |
| **Quick Summary** | Total output size, module count, entry points, code-split chunks |
| **Largest Modules by Output Contribution** | All modules sorted by size with percentage of total |
| **Entry Point Analysis** | Each entry's output file, bundle size, loaded chunks, and bundled modules |
| **Dependency Chains** | Modules imported by multiple files — helps understand why a module is included |
| **Optimization Suggestions** | Actionable suggestions with severity levels (see below) |
| **Full Module Graph** | Complete per-module dependency info (imports, imported-by, size) |
| **Raw Data for Searching** | Grep-friendly `[MODULE:]`, `[IMPORT:]`, `[IMPORTED_BY:]`, `[ENTRY:]`, `[CHUNK:]` patterns |

The new suggestions section identifies modules in **shared common chunks** that are only reachable from a **single static entry**. These modules are unnecessarily shared and could be moved closer to their entry point via code splitting configuration.

Each suggestion includes a severity level based on the proportion of single-entry-reachable module size:

- **`[HIGH]`** — > 50%
- **`[MEDIUM]`** — 30%–50%
- **`[LOW]`** — < 30%

- `format` field type narrowed from `string` to `'json' | 'md'` via `#[napi(ts_type)]`
- Updated `chunk-visualize-demo` example with a proper multi-entry dependency graph that demonstrates the optimization suggestions
This was referenced Mar 4, 2026
shulaoda added a commit that referenced this pull request Mar 5, 2026
## [1.0.0-rc.7] - 2026-03-05

⚡ Smarter Code Generation Defaults
- DCE-only minification and smart constant inlining are now enabled by default
- Produces cleaner, smaller output bundles without requiring explicit configuration

💡 LLM-Friendly Bundle Analyzer Reports
- New markdown output format for the bundle analyzer plugin with bundle summaries, module graphs, dependency chains, and optimization suggestions
- Optimization suggestions now also recommend using the entriesAware option when common chunks contain modules only reachable from specific entries


### 💥 BREAKING CHANGES

- enable minify: 'dce-only' by default (#8465) by @IWANABETHATGUY
- settings `inlineConst: { mode: 'smart', pass: 1}`  by default (#8444) by @IWANABETHATGUY

### 🚀 Features

- binding: add original getter to BindingMagicString (#8533) by @IWANABETHATGUY
- native-magic-string: add `offset` property support (#8531) by @IWANABETHATGUY
- add `output.strict` option to control `"use strict"` directive emission (#8489) by @Copilot
- watch: expose `watcher.compareContentsForPolling` (#8526) by @hyf0
- watch: use new watcher to support watch mode (#8475) by @hyf0
- rust/watch: handle bulk-change (#8466) by @hyf0
- add LLM-friendly markdown output format to bundle analyzer plugin (#8242) by @IWANABETHATGUY

### 🐛 Bug Fixes

- expose `plugins` on `NormalizedInputOptions` for `buildStart` hook (#8521) by @Copilot
- only uppercase facade symbols in JSX preserve mode (#8519) by @IWANABETHATGUY
- binding: export BindingResult in generated dts header (#8537) by @minsoo-web
- pre-resolve paths option to avoid `invoke_sync` deadlock (#8518) by @IWANABETHATGUY
- remove debug-only jsx_preset and UntranspiledSyntaxError (#8511) by @IWANABETHATGUY
- apply `topLevelVar` to exported `const`/`let` declarations (#8507) by @IWANABETHATGUY
- rolldown_plugin_vite_web_worker_post: avoid replacing `new.target` (#8488) by @sapphi-red
- update copyright year to 2026 (#8486) by @maciekzygmunt

### 🚜 Refactor

- rust: use Oxc's SymbolFlags::ConstVariable instead of custom IsConst flag (#8543) by @Dunqing
- rust: remove FacadeScoping, use Scoping::create_symbol for facade symbols (#8540) by @Dunqing
- rust/watch: remove hacky `reset_closed_for_watch_mode` (#8530) by @hyf0
- binding: return &str instead of String in filename() getter (#8534) by @IWANABETHATGUY
- rust: remove old watch mode implementation (#8525) by @hyf0
- rust/watch: simply watch logic in the binding layer (#8516) by @hyf0
- rust/watch: tweak struct/function names (#8464) by @hyf0

### 📚 Documentation

- explain how external modules work in rolldown (#8457) by @sapphi-red
- add some diagrams using graphviz (#8499) by @sapphi-red
- use `vitepress-plugin-graphviz` (#8498) by @sapphi-red
- list s390x/ppc64le prebuilt binaries (#8495) by @crusty-voidzero
- fix error type for `RolldownBuild.generate` and others (#8490) by @sapphi-red

### ⚡ Performance

- string_wizard: reduce allocations and add ASCII fast paths (#8541) by @IWANABETHATGUY
- use IndexBitSet to replace IndexVec<XXXIdx, bool> for module/stmt inclusion tracking (#8503) by @IWANABETHATGUY
- plugin: use IndexBitSet to optimize skipped plugins checking (#8497) by @ShroXd
- rust/tla: skip compute_tla if there is no module use TLA (#8487) by @ShroXd

### 🧪 Testing

- node/watch: make watch tests run in concurrent and retry-able (#8512) by @hyf0
- add test case for static flag tree-shaking (#8476) by @IWANABETHATGUY
- migrate post-banner sourcemap-with-shebang to Rust (#8477) by @Copilot

### ⚙️ Miscellaneous Tasks

- vscode: `formatOnSave` for markdown files using oxc formatter (#8536) by @minsoo-web
- deps: update test262 submodule for tests (#8528) by @sapphi-red
- remove `retry` workaround from output paths test fixtures (#8520) by @Copilot
- docs: add Shuyuan Wang (h-a-n-a) and remove from acknowledgements (#8509) by @Copilot
- consolidate top_level_var test cases using configVariants (#8508) by @IWANABETHATGUY
- add s390x and ppc64le linux gnu targets (#8493) by @Brooooooklyn

### ◀️ Revert

- fix(rolldown): increase tokio blocking threads size for watch mode (#8517) by @hyf0

### ❤️ New Contributors

* @minsoo-web made their first contribution in [#8536](#8536)
* @crusty-voidzero made their first contribution in [#8495](#8495)
* @maciekzygmunt made their first contribution in [#8486](#8486)

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.

2 participants