refactor: consolidate missing runtime symbol errors into a single diagnostic#8220
Conversation
How to use the Graphite Merge QueueAdd 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. |
✅ Deploy Preview for rolldown-rs canceled.
|
ff78676 to
76e6b82
Compare
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the runtime module symbol validation to consolidate multiple error messages into a single diagnostic when runtime symbols are missing. Instead of emitting up to 19 separate errors (one per missing symbol), the code now groups all missing symbols into a single error message.
Changes:
- Modified
RuntimeModuleSymbolNotFoundstruct to accept multiple symbol names instead of a single symbol name - Refactored
validate_symbols()method to use a functional approach that collects all missing symbols and returns a single error - Updated test to verify multiple missing symbols are reported together in one error message
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rolldown_error/src/build_diagnostic/events/runtime_module_symbol_not_found.rs |
Changed struct field from singular symbol_name to plural symbol_names (Vec); updated error message formatting to list multiple symbols |
crates/rolldown_error/src/build_diagnostic/constructors.rs |
Updated constructor signature to accept Vec<String> for symbol names |
crates/rolldown_common/src/module_loader/runtime_module_brief.rs |
Refactored validation logic from loop-based to functional style that collects all missing symbols and returns 0 or 1 error |
crates/rolldown/tests/rolldown/topics/runtime/transform_symbol_removed/mod.rs |
Updated test plugin to remove two symbols instead of one to demonstrate consolidated error |
crates/rolldown/tests/rolldown/topics/runtime/transform_symbol_removed/artifacts.snap |
Updated snapshot showing both missing symbols in single error message |
crates/rolldown_error/src/build_diagnostic/events/runtime_module_symbol_not_found.rs
Show resolved
Hide resolved
crates/rolldown_error/src/build_diagnostic/events/runtime_module_symbol_not_found.rs
Show resolved
Hide resolved
## [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]>

Before If all symbols in runtime module are eliminated accidently, we will emit 19 errors, but now we only emit one error.