Skip to content

fix: expose plugins on NormalizedInputOptions for buildStart hook#8521

Merged
shulaoda merged 6 commits intomainfrom
copilot/fix-exposed-plugin-list-access
Mar 4, 2026
Merged

fix: expose plugins on NormalizedInputOptions for buildStart hook#8521
shulaoda merged 6 commits intomainfrom
copilot/fix-exposed-plugin-list-access

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

  • Add plugins field to NormalizedInputOptions interface and NormalizedInputOptionsImpl
  • Update PluginContextData to store and pass input plugins to NormalizedInputOptionsImpl
  • Update bindingify-input-options.ts to pass rawPlugins to PluginContextData
  • Add test for accessing plugins in buildStart
  • Remove unnecessary @lazyProp decorator from plugins getter (no Rust data pull)
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Unable to access the exposed plugin list in buildStart</issue_title>
<issue_description>### Reproduction link or steps

Image Unable to access the exposed plugin list in **buildStart**

What is expected?

Image Access plugin API as shown in the document

What is actually happening?

Accessing plugins as undefined in buildStart

Image

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz        
    Memory: 15.85 GB / 31.83 GB
  Binaries:
    Node: 22.21.1 - D:\nvm4w\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Users\ZPC21-163\AppData\Local\pnpm\yarn.CMD
    npm: 10.9.4 - D:\nvm4w\nodejs\npm.CMD
    pnpm: 9.1.2 - C:\Users\ZPC21-163\AppData\Local\pnpm\pnpm.CMD  
  Browsers:
    Chrome: 144.0.7559.133
    Edge: Chromium (140.0.3485.54)
    Internet Explorer: 11.0.19041.5794
  npmPackages:
    rolldown: ^1.0.0-rc.5 => 1.0.0-rc.5

Any additional comments?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for rolldown-rs canceled.

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

Copilot AI changed the title [WIP] Fix issue accessing exposed plugin list in buildStart fix: expose plugins on NormalizedInputOptions for buildStart hook Mar 2, 2026
Copilot AI and others added 3 commits March 4, 2026 17:29
Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
@shulaoda shulaoda force-pushed the copilot/fix-exposed-plugin-list-access branch from d37e9f9 to 7905b84 Compare March 4, 2026 09:29
@shulaoda shulaoda requested review from IWANABETHATGUY and hyf0 March 4, 2026 09:42
@shulaoda shulaoda marked this pull request as ready for review March 4, 2026 09:42
Copilot AI review requested due to automatic review settings March 4, 2026 09:42
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

Fixes a mismatch between documented and actual buildStart hook behavior by exposing the input plugin list (plugins) on NormalizedInputOptions, enabling plugin-to-plugin communication during build start.

Changes:

  • Expose plugins: RolldownPlugin[] on NormalizedInputOptions and implement it via a lazy getter.
  • Thread normalized input plugins through bundler option creation into PluginContextData so buildStart receives them.
  • Add a regression test ensuring buildStart sees input plugins (and not output plugins).

Reviewed changes

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

Show a summary per file
File Description
packages/rolldown/src/options/normalized-input-options.ts Adds plugins to normalized input options and implements it on NormalizedInputOptionsImpl.
packages/rolldown/src/plugin/plugin-context-data.ts Stores normalized input plugins and passes them into NormalizedInputOptionsImpl for hook option objects.
packages/rolldown/src/utils/create-bundler-option.ts Computes normalizedInputPlugins and threads them into bindingifyInputOptions.
packages/rolldown/src/utils/bindingify-input-options.ts Extends PluginContextData construction to include normalized input plugins.
packages/rolldown/src/parallel-plugin-worker.ts Updates PluginContextData instantiation to match the new constructor signature.
packages/rolldown/tests/build-api/build-api.test.ts Adds coverage verifying buildStart({ plugins }) returns the input plugin list only.

@hyf0 hyf0 requested a review from sapphi-red March 4, 2026 12:07
…putOptionsImpl

Co-authored-by: hyf0 <49502170+hyf0@users.noreply.github.com>
Copy link
Member

hyf0 commented Mar 4, 2026

Merge activity

  • Mar 4, 12:35 PM 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 4, 12:49 PM 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 4, 12:50 PM 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 4, 12:51 PM 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.

@shulaoda shulaoda merged commit 3a64ec4 into main Mar 4, 2026
52 of 54 checks passed
@shulaoda shulaoda deleted the copilot/fix-exposed-plugin-list-access branch March 4, 2026 13:23
@github-actions github-actions bot mentioned this pull request Mar 5, 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.

[Bug]: Unable to access the exposed plugin list in buildStart

5 participants