Skip to content

Comments

feat(rolldown_plugin_vite_reporter): truncate long importer lists in ineffective dynamic import warnings#7528

Merged
sapphi-red merged 4 commits intomainfrom
copilot/improve-vector-display
Dec 16, 2025
Merged

feat(rolldown_plugin_vite_reporter): truncate long importer lists in ineffective dynamic import warnings#7528
sapphi-red merged 4 commits intomainfrom
copilot/improve-vector-display

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

  • Add helper function to format vectors with ellipsis if more than 5 entries
  • Update dynamic_importers formatting to use the helper
  • Update importers formatting to use the helper
  • Test the changes with Rust tests
  • Address code review feedback
  • Add debug assert to ensure limit is not 0
  • Add test case for empty vector
Original prompt

Improve this part to use ... if there's more than 5 entries in the vector.

module
.dynamic_importers
.iter()
.map(std::convert::AsRef::as_ref)
.collect::<Vec<_>>()
.join(", "),
module
.importers
.iter()
.map(std::convert::AsRef::as_ref)
.collect::<Vec<_>>()
.join(", "),


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@netlify
Copy link

netlify bot commented Dec 16, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 96007d4
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/694132fc50b57c000823bee0

Copilot AI changed the title [WIP] Improve vector representation for more than five entries Truncate long importer lists in vite_reporter warnings with ellipsis Dec 16, 2025
Copilot AI requested a review from sapphi-red December 16, 2025 09:21
@sapphi-red sapphi-red changed the title Truncate long importer lists in vite_reporter warnings with ellipsis feat(rolldown_plugin_vite_reporter): truncate long importer lists in warnings with ellipsis Dec 16, 2025
@sapphi-red sapphi-red changed the title feat(rolldown_plugin_vite_reporter): truncate long importer lists in warnings with ellipsis feat(rolldown_plugin_vite_reporter): truncate long importer lists in ineffective dynamic import warnings with ellipsis Dec 16, 2025
@sapphi-red sapphi-red changed the title feat(rolldown_plugin_vite_reporter): truncate long importer lists in ineffective dynamic import warnings with ellipsis feat(rolldown_plugin_vite_reporter): truncate long importer lists in ineffective dynamic import warnings Dec 16, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

Benchmarks Rust

group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     68.0±1.95ms        ? ?/sec    1.12     76.0±2.79ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     76.1±2.79ms        ? ?/sec    1.10     83.9±3.20ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    115.3±2.90ms        ? ?/sec    1.00    115.5±3.53ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    124.7±2.05ms        ? ?/sec    1.05    131.1±3.97ms        ? ?/sec
bundle/bundle@threejs                                        1.00     40.4±1.78ms        ? ?/sec    1.04     42.2±1.41ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     44.5±1.17ms        ? ?/sec    1.07     47.6±1.65ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    407.2±6.00ms        ? ?/sec    1.03   420.1±10.57ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    470.4±6.84ms        ? ?/sec    1.02    481.0±6.42ms        ? ?/sec
scan/scan@rome_ts                                            1.00     89.2±4.36ms        ? ?/sec    1.00     89.5±2.97ms        ? ?/sec
scan/scan@threejs                                            1.00     30.1±1.91ms        ? ?/sec    1.00     30.0±0.50ms        ? ?/sec
scan/scan@threejs10x                                         1.02    316.8±6.33ms        ? ?/sec    1.00    309.1±4.32ms        ? ?/sec

@sapphi-red sapphi-red removed their request for review December 16, 2025 10:14
@sapphi-red sapphi-red marked this pull request as ready for review December 16, 2025 10:14
Copilot AI review requested due to automatic review settings December 16, 2025 10:14
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

This PR adds truncation functionality to the Vite reporter plugin to prevent excessively long warning messages when modules have many importers. The implementation adds a reusable join_with_limit() utility function that limits lists to 5 entries, appending "..." when truncated.

Key Changes:

  • Adds join_with_limit() utility function with comprehensive test coverage
  • Applies truncation to dynamic_importers and importers lists in ineffective dynamic import warnings
  • Improves readability of warning messages by limiting each list to 5 entries

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/rolldown_plugin_vite_reporter/src/utils.rs Adds the join_with_limit() utility function with 4 unit tests covering various scenarios
crates/rolldown_plugin_vite_reporter/src/lib.rs Refactors warning message formatting to use join_with_limit() for both dynamic_importers and importers lists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI requested a review from sapphi-red December 16, 2025 10:28
@sapphi-red sapphi-red requested review from shulaoda and removed request for sapphi-red December 16, 2025 10:42
@sapphi-red sapphi-red merged commit fb703eb into main Dec 16, 2025
36 of 45 checks passed
@sapphi-red sapphi-red deleted the copilot/improve-vector-display branch December 16, 2025 10:47
This was referenced Dec 17, 2025
shulaoda added a commit that referenced this pull request Dec 17, 2025
## [1.0.0-beta.55] - 2025-12-17

### 🚀 Features

- add validation errors for incompatible `inlineDynamicImports` options (#7539) by @Copilot
- rolldown_plugin_vite_reporter: truncate long importer lists in ineffective dynamic import warnings (#7528) by @Copilot
- export `memfs` from `rolldown/experimental` for browser builds (#7490) by @Copilot
- implement `postBanner` and `postFooter` (#7487) by @sevenc-nanashi
- port getLogFilter helper from Rollup for advanced log filtering (#6890) by @taearls
- dev: initialize `rolldown_plugin_lazy_compilation` (#7488) by @hyf0
- enable `experimental.transform_hires_sourcemap: 'boundary'` by default (#7478) by @sapphi-red
- apply merge CJS namespace optimizations more generally (#7475) by @sapphi-red

### 🐛 Bug Fixes

- avoid panic on invalid values for `output.exports`, `output.format`, `output.hash_characters` (#7542) by @sapphi-red
- handle `__proto__` export for module namespace correctly (#7534) by @sapphi-red
- handle `__proto__` export correctly (#7533) by @sapphi-red
- rolldown_plugin_vite_resolve: acquire resolver lock before package json resolution (#7524) by @sapphi-red
- disable syntax transform optimization for `minify: 'dce-only'` (#7520) by @sapphi-red
- arrow function expression keep names (#7519) by @IWANABETHATGUY
- skip symbols that are imported from other module when deconflicting module symbols (#7510) by @IWANABETHATGUY
- preserve class names in assignment expressions with keepNames option (#7491) by @IWANABETHATGUY
- accessor with decorators should be kept (#7499) by @Copilot
- rolldown_plugin_vite_reporter: support `Infinity` for chunk_limit (#7497) by @shulaoda
- change filename template validation errors from UNHANDLEABLE_ERROR to INVALID_OPTION (#7472) by @Copilot
- `no entry found for key` error when merging CJS namespace exports (#7474) by @sapphi-red
- generate output with syntax error when wrapped esm module using tla syntax (#7468) by @IWANABETHATGUY

### 🚜 Refactor

- dev: rename `experimental.hmr` to `experimental.devMode` (#7527) by @hyf0
- pass addon option to rust as it is (#7526) by @hyf0
- remove unused stmtinfo meta flag (#7518) by @IWANABETHATGUY

### 📚 Documentation

- clarify `closeBundle` behavior (#7525) by @sapphi-red

### 🧪 Testing

- add tests for static string postBanner and postFooter (#7516) by @Copilot
- disable pluginTimings in Rust integration tests to avoid snapshot noise (#7485) by @shulaoda
- port Rollup JSX tests to `crates/rolldown/tests/rollup` (#7480) by @sapphi-red
- re-triage some esbuild JSX preserve tests (#7479) by @sapphi-red
- disable pluginTimings by default to avoid snapshot noise (#7471) by @shulaoda

### ⚙️ Miscellaneous Tasks

- mark feature that will not be supported as ignored in rollup test status (#7535) by @sapphi-red
- support `banner`/`footer`/`intro`/`outro` for config variants (#7532) by @sapphi-red
- `dce/dce_of_decorators` esbuild test is now passing (#7531) by @sapphi-red
- deps: update github-actions (major) (#7495) by @renovate[bot]
- deps: update npm packages (#7493) by @renovate[bot]
- add a check to verify failedReasons are updated (#7521) by @sapphi-red
- deps: update test262 submodule for tests (#7523) by @sapphi-red
- deps: update taiki-e/install-action action to v2.63.2 (#7496) by @renovate[bot]
- deps: update oxc apps (#7511) by @renovate[bot]
- deps: update oxc to v0.103.0 (#7513) by @camc314
- fix format in `.github/instructions/bug-investigation.instructions.md` (#7506) by @sapphi-red
- add instructions for REPL decoding (#7502) by @sapphi-red
- deps: update github-actions (#7492) by @renovate[bot]
- deps: cargo-shear v1.9.0 (#7483) by @Boshen
- deps: update dependency oxlint-tsgolint to v0.9.0 (#7484) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.8.6 (#7470) by @renovate[bot]
- add syntax validation for test output chunks that are not executed (#7466) by @IWANABETHATGUY
- deps: update dependency rust to v1.92.0 (#7467) by @renovate[bot]
- deps: update test262 submodule for tests (#7457) by @sapphi-red

### ❤️ New Contributors

* @sevenc-nanashi made their first contribution in [#7487](#7487)
* @taearls made their first contribution in [#6890](#6890)

Co-authored-by: shulaoda <[email protected]>
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