Skip to content

Comments

fix: use output.name instead of chunk.name in mixed export warning#7788

Merged
sapphi-red merged 6 commits intomainfrom
copilot/fix-output-options-name
Jan 8, 2026
Merged

fix: use output.name instead of chunk.name in mixed export warning#7788
sapphi-red merged 6 commits intomainfrom
copilot/fix-output-options-name

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

The mixed export warning was using chunk.name instead of output.name for the module identifier in the warning message, diverging from Rollup's behavior.

Changes

  • determine_export_mode.rs:51: Changed from ctx.chunk.name to ctx.options.name
  • determine_export_mode.rs:54-56: Swapped module_name and entry_module parameters to correct mapping:
    • module_name → now uses output.name (for .default access pattern)
    • entry_module → now uses module.stable_id (for entry module identifier)

Effect

Before:

Warning: Entry module "main" is using named and default exports together. 
Consumers will have to use `main.js.default` to access the default export.

After:

Warning: Entry module "main.js" is using named and default exports together. 
Consumers will have to use `bundle.default` to access the default export.

Where "bundle" is the configured output.name value.

Reference: https://github.com/rollup/rollup/blob/299cc46f3059a72b1e37b80c688a6d88c6c5f3fd/src/utils/getExportMode.ts#L29

Original prompt

This should be output_options.name instead of chunk name

let name = ctx.chunk.name.as_ref().map(arcstr::ArcStr::to_string);

reference: https://github.com/rollup/rollup/blob/299cc46f3059a72b1e37b80c688a6d88c6c5f3fd/src/utils/getExportMode.ts#L29


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 0712dba
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/695f6160837e82000816fb25
😎 Deploy Preview https://deploy-preview-7788--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Fix output options name instead of chunk name fix: use output.name instead of chunk.name in mixed export warning Jan 7, 2026
Copilot AI requested a review from sapphi-red January 7, 2026 12:32
@sapphi-red sapphi-red marked this pull request as ready for review January 8, 2026 04:21
Copilot AI review requested due to automatic review settings January 8, 2026 04:21
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 fixes the mixed export warning message to align with Rollup's behavior by using output.name instead of chunk.name for the module identifier.

Key Changes:

  • Updated warning message construction to use ctx.options.name instead of ctx.chunk.name
  • Corrected parameter order in BuildDiagnostic::mixed_export() call to match intended semantics

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
crates/rolldown/src/utils/chunk/determine_export_mode.rs Updated warning logic to use output.name and fixed parameter mapping
crates/rolldown/tests/rolldown/warnings/mixed_export/artifacts.snap Updated test snapshot to reflect corrected warning output
crates/rolldown/tests/rolldown/issues/2859/2/artifacts.snap Updated test snapshot to reflect corrected warning output
crates/rolldown/tests/esbuild/loader/loader_json_no_bundle_iife/artifacts.snap Updated test snapshot to reflect corrected warning output
crates/rolldown/tests/esbuild/loader/loader_json_no_bundle_common_js/artifacts.snap Updated test snapshot to reflect corrected warning output
crates/rolldown/tests/esbuild/default/export_forms_iife/artifacts.snap Updated test snapshot to reflect corrected warning output

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Benchmarks Rust

group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.02     64.5±1.91ms        ? ?/sec    1.00     63.4±1.68ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     70.4±2.24ms        ? ?/sec    1.00     70.4±2.23ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    105.1±2.31ms        ? ?/sec    1.01    105.8±1.77ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    116.9±2.34ms        ? ?/sec    1.00    117.0±2.57ms        ? ?/sec
bundle/bundle@threejs                                        1.01     37.4±2.09ms        ? ?/sec    1.00     36.8±0.64ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     41.9±0.69ms        ? ?/sec    1.00     42.0±0.72ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    378.5±5.12ms        ? ?/sec    1.01    382.2±8.14ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    438.9±5.33ms        ? ?/sec    1.01    442.4±4.87ms        ? ?/sec
scan/scan@rome_ts                                            1.00     83.3±1.28ms        ? ?/sec    1.02     84.8±1.65ms        ? ?/sec
scan/scan@threejs                                            1.02     28.2±1.71ms        ? ?/sec    1.00     27.7±0.42ms        ? ?/sec
scan/scan@threejs10x                                         1.00    286.9±4.57ms        ? ?/sec    1.00    287.1±4.96ms        ? ?/sec

@sapphi-red sapphi-red requested review from hyf0 and shulaoda and removed request for sapphi-red January 8, 2026 05:32
@sapphi-red sapphi-red enabled auto-merge (squash) January 8, 2026 07:49
@sapphi-red sapphi-red merged commit ace0e25 into main Jan 8, 2026
34 checks passed
@sapphi-red sapphi-red deleted the copilot/fix-output-options-name branch January 8, 2026 08:00
This was referenced Jan 14, 2026
shulaoda added a commit that referenced this pull request Jan 14, 2026
## [1.0.0-beta.60] - 2026-01-14

### 💥 BREAKING CHANGES

- tsconfig: enable auto-discovery by default (#7817) by @shulaoda

### 🚀 Features

- distinguish transformer diagnostics from parse errors (#7872) by @shulaoda
- emit transformer warnings instead of ignoring them (#7850) by @shulaoda
- node: add `output.codeSplitting` option and deprecate `output.advancedChunks` (#7855) by @hyf0
- nativeMagicString reset (#7828) by @IWANABETHATGUY
- nativeMagicString lastChar (#7819) by @IWANABETHATGUY
- dev/lazy: inject lazy compilation runtime automatically (#7816) by @hyf0
- nativeMagicString snip (#7818) by @IWANABETHATGUY
- nativeMagicString construct with options (#7814) by @IWANABETHATGUY
- nativeMagicString clone (#7813) by @IWANABETHATGUY
- nativeMagicString `insert` (#7812) by @IWANABETHATGUY
- nativeMagicString `slice` (#7807) by @IWANABETHATGUY
- nativeMagicString trim methods (#7800) by @IWANABETHATGUY
- make closeBundle hook receive the last error (#7278) by @Copilot

### 🐛 Bug Fixes

- when package only contains export default, cjsDefault didn't resolve correctly (#7873) by @IWANABETHATGUY
- inline __name calls for default exports  (#7862) by @IWANABETHATGUY
- improve variable renaming to avoid unnecessary shadowing in nested scopes (#7859) by @IWANABETHATGUY
- use correct index when inserting keepNames statements during export default transformation (#7853) by @IWANABETHATGUY
- transform non-static dynamic imports when `dynamicImportInCjs` is `false` (#7823) by @shulaoda
- dev/lazy: should include imported and non-executed modules in the patch (#7815) by @hyf0
- set ExportsKind to Esm when json is none object literal  (#7808) by @IWANABETHATGUY
- nativeMagicString move api (#7796) by @IWANABETHATGUY
- remove unnecessary exports after merging into commong and user defined entry (#7789) by @IWANABETHATGUY
- use output.name instead of chunk.name in mixed export warning (#7788) by @Copilot

### 🚜 Refactor

- generalize ParseError to OxcError with dynamic EventKind (#7868) by @shulaoda
- rust: rename `advanced_chunks` to `manual_code_splitting` (#7856) by @hyf0
- string_wizard error hanlding (#7830) by @IWANABETHATGUY
- remove `experimental.disableLiveBindings` option (#7820) by @sapphi-red
- node/test: run fixture tests in concurrent (#7790) by @hyf0
- move ConfigExport and RolldownOptionsFunction types to define-config (#7799) by @shulaoda
- cli: validate config after resolving and improve error message (#7798) by @shulaoda

### 📚 Documentation

- rebrand (#7670) by @yyx990803
- fix incorrect default value for propertyReadSideEffects (#7847) by @Copilot
- remove options pages and redirect to reference pages (#7834) by @sapphi-red
- options: inline types to option property pages (#7831) by @sapphi-red
- options: port checks.pluginTimings content from options page to reference page (#7832) by @sapphi-red
- options: use `@linkcode` where possible (#7824) by @sapphi-red
- options: port content from options page to reference page (#7822) by @sapphi-red
- options: add descriptions for output options (#7821) by @sapphi-red
- options: add description for input options (#7802) by @sapphi-red
- options: add description for `checks.*` (#7801) by @sapphi-red
- apis: add hook graph (#7671) by @sapphi-red

### 🧪 Testing

- add all valid combination of chunk exports related test (#7851) by @IWANABETHATGUY
- enable MagicString test after api return type alignment (#7797) by @IWANABETHATGUY
- init magic-string test (#7794) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- vite-tests: configure git user for rebase operation (#7875) by @shulaoda
- rolldown_binding: remove v3 native plugins (#7837) by @shulaoda
- rolldown_binding: allow crate-type as lib (#7866) by @Brooooooklyn
- README.md: adjust position and size of rolldown logo (#7861) by @hyf0
- deps: update test262 submodule for tests (#7857) by @sapphi-red
- deps: update oxc to v0.108.0 (#7845) by @renovate[bot]
- deps: update dependency oxlint to v1.39.0 (#7849) by @renovate[bot]
- deps: update dependency oxfmt to ^0.24.0 (#7844) by @renovate[bot]
- deps: update npm packages (#7841) by @renovate[bot]
- deps: update rust crates (#7839) by @renovate[bot]
- deps: update github-actions (#7840) by @renovate[bot]
- use workspace edition for all crates (#7829) by @IWANABETHATGUY
- deps: update dependency oxlint-tsgolint to v0.11.0 (#7827) by @renovate[bot]
- deps: update napi to v3.8.2 (#7810) by @renovate[bot]
- remove outdated snapshot files (#7806) by @shulaoda
- deps: update crate-ci/typos action to v1.42.0 (#7792) by @renovate[bot]

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