Skip to content

refactor: return errors instead of panicking on builtin plugin conversion failure#8217

Merged
graphite-app[bot] merged 1 commit into
mainfrom
02-06-refactor_return_errors_instead_of_panicking_on_builtin_plugin_conversion_failure
Feb 6, 2026
Merged

refactor: return errors instead of panicking on builtin plugin conversion failure#8217
graphite-app[bot] merged 1 commit into
mainfrom
02-06-refactor_return_errors_instead_of_panicking_on_builtin_plugin_conversion_failure

Conversation

@shulaoda

@shulaoda shulaoda commented Feb 6, 2026

Copy link
Copy Markdown
Member

Related to #8143

shulaoda commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

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.

@shulaoda shulaoda marked this pull request as ready for review February 6, 2026 08:18
Copilot AI review requested due to automatic review settings February 6, 2026 08:18
@netlify

netlify Bot commented Feb 6, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit f6d9f14
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6985a5df9d04520008a1cfc0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors error handling in the builtin plugin conversion process to return proper errors instead of panicking when conversion fails. This addresses issue #8143 where users encountered cryptic panic messages when providing invalid plugin configurations.

Changes:

  • Replaced unwrap_or_else(|err| panic!(...)) with map_err(|err| napi::Error::new(...)) for builtin plugin conversion
  • Updated both non-WASM and WASM code paths consistently
  • Changed collection from Vec<_> to Result<Vec<_>, _> with ? propagation

@graphite-app

graphite-app Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Merge activity

@graphite-app graphite-app Bot force-pushed the 02-06-refactor_return_errors_instead_of_panicking_on_builtin_plugin_conversion_failure branch from bd13e21 to f6d9f14 Compare February 6, 2026 08:27
@graphite-app graphite-app Bot merged commit f6d9f14 into main Feb 6, 2026
35 checks passed
@graphite-app graphite-app Bot deleted the 02-06-refactor_return_errors_instead_of_panicking_on_builtin_plugin_conversion_failure branch February 6, 2026 08:39
@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Benchmarks Rust

  • target: main(80b184f)
  • pr: 02-06-refactor_return_errors_instead_of_panicking_on_builtin_plugin_conversion_failure(f6d9f14)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     69.2±2.17ms        ? ?/sec    1.03     71.4±2.29ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     75.8±2.97ms        ? ?/sec    1.02     77.4±2.45ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00     99.9±1.90ms        ? ?/sec    1.01    100.7±1.95ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    110.7±2.51ms        ? ?/sec    1.01    112.2±2.16ms        ? ?/sec
bundle/bundle@threejs                                        1.00     35.6±1.67ms        ? ?/sec    1.00     35.5±0.71ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     40.1±0.82ms        ? ?/sec    1.01     40.5±0.76ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    359.8±4.76ms        ? ?/sec    1.03    370.4±7.70ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    417.8±5.69ms        ? ?/sec    1.02    426.2±9.56ms        ? ?/sec
scan/scan@rome_ts                                            1.00     80.1±1.78ms        ? ?/sec    1.00     79.9±1.67ms        ? ?/sec
scan/scan@threejs                                            1.01     28.1±1.71ms        ? ?/sec    1.00     27.8±0.91ms        ? ?/sec
scan/scan@threejs10x                                         1.00    282.7±4.78ms        ? ?/sec    1.01    285.6±4.48ms        ? ?/sec

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 <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.

3 participants