feat: merge same ImportNamespaceSpecifier for external module#4373
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
b121b2e to
1cba71a
Compare
1cba71a to
339cf6d
Compare
339cf6d to
83c426b
Compare
Benchmarks Rust |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce logic to deduplicate namespace imports for external modules during the ECMAScript module formatting and import/export binding stages. A new set is used to track which external modules have already had a namespace import rendered, ensuring only one such import per module appears in the output. Additionally, the import/export binding context is updated to separately manage and link namespace imports for external modules. New test files and configuration are added to verify the deduplication behavior for specific external modules. Changes
Sequence Diagram(s)sequenceDiagram
participant File1 as file.js
participant File2 as file2.js
participant Main as main.js
participant Formatter as ESM Formatter
participant Binder as Import/Export Binder
File1->>Binder: Import * as what from "node:http"
File2->>Binder: Import * as hello from "node:http"
Binder->>Binder: Track namespace imports per module
Binder->>Formatter: Provide deduplicated import info
Formatter->>Formatter: Render only one namespace import per external module
Formatter-->>Main: Output merged import statements
Assessment against linked issues
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
83c426b to
cb46411
Compare
4853b6a to
5dbbc61
Compare
127c45e to
a6b2879
Compare
a6b2879 to
97feeb6
Compare
ImportNamespaceSpecifier for external module
## [1.0.0-beta.13] - 2025-06-07 ### 🚀 Features - feat: merge same `ImportNamespaceSpecifier` for external module by @IWANABETHATGUY in [#4373](#4373) ### 🐛 Bug Fixes - ci: disable `generate_release_notes` by @Boshen ### 📚 Documentation - docs: add MAINTENANCE.md; remove rolldown.rs/contrib-guide/release by @Boshen in [#4854](#4854) ### ⚙️ Miscellaneous Tasks - add input description to prepare-release.yml by @Boshen - fix prepare-release.yml by @Boshen - CHANGELOG.md: ci(CHANGELOG.md): use git-cliff to generate changelogs by @Boshen in [#4858](#4858)

Description
Summary by CodeRabbit
Bug Fixes
Tests
Chores