Skip to content

Comments

test: handle re-exports of external modules in CJS format#7641

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-24-test_7634
Dec 24, 2025
Merged

test: handle re-exports of external modules in CJS format#7641
graphite-app[bot] merged 1 commit intomainfrom
12-24-test_7634

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Dec 24, 2025

Related to #7634. Separated the test to make it easier to review (too many snapshots were updated in the previous PR).

Copy link
Member Author

IWANABETHATGUY commented Dec 24, 2025


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.

@IWANABETHATGUY IWANABETHATGUY changed the title test: 7634 fix: handle re-exports of external modules in CJS format Dec 24, 2025
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review December 24, 2025 05:59
@IWANABETHATGUY IWANABETHATGUY changed the title fix: handle re-exports of external modules in CJS format test: handle re-exports of external modules in CJS format Dec 24, 2025
Base automatically changed from 12-24-fix_module-lexer to main December 24, 2025 06:03
Copilot AI review requested due to automatic review settings December 24, 2025 06:10
@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 7c1c6ac
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/694b8c081311c00008aa60a6

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 a test case for handling re-exports of external modules in CJS format, related to issue #7634. The test verifies that when an ESM module re-exports an external CommonJS module using export * from "bar", the bundler correctly generates CJS output that re-exports all properties from the external module.

Key changes:

  • New test case issue_7634 demonstrating CJS re-export handling
  • Test includes both local module bundling (baz.js) and external module re-exporting (bar)
  • Snapshot verification of generated CJS output with proper re-export code

Reviewed changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap Added hash entry for the new test case
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/node_modules/bar/package.json Package metadata for mock "bar" external module
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/node_modules/bar/index.js Entry point that re-exports from dist/bar.js
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/node_modules/bar/dist/bar.js Implementation file for external "bar" module (currently empty - needs implementation)
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/node_modules/.gitignore Ensures dist/ directory is not ignored by git
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/main.js Test entry point that imports baz and re-exports bar
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/baz.js Local module providing baz export
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/artifacts.snap Expected output snapshot showing CJS re-export pattern
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/_test.mjs Runtime test verifying that bar is exported as a function
crates/rolldown/tests/rolldown/cjs_compat/issue_7634/_config.json Test configuration marking "bar" as external

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

Related to #7634. Separated the test to make it easier to review (too many snapshots were updated in the previous PR).
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 24, 2025

Merge activity

@graphite-app graphite-app bot merged commit 7c1c6ac into main Dec 24, 2025
31 checks passed
@graphite-app graphite-app bot deleted the 12-24-test_7634 branch December 24, 2025 06:56
shulaoda added a commit that referenced this pull request Dec 24, 2025
## [1.0.0-beta.57] - 2025-12-24

✨ TypeScript Project References Support
- Rolldown now supports TypeScript project references when manually specifying a `tsconfig`
- See more details: https://rolldown.rs/options/tsconfig

💥 Rename `__export` to `__exportAll`
- Update `rolldown-plugin-dts` to the latest version for compatibility

### 💥 BREAKING CHANGES

- tsconfig: enable project references support in manual mode (#7545) by @shulaoda

### 🚀 Features

- add `CANNOT_CALL_NAMESPACE` warning (#7636) by @sapphi-red
- add import path for unresolved import diagnostics (#7625) by @sapphi-red
- optimize dynamic entry facade chunks by merging with common chunks when they are captured by common chunks (#7486) by @IWANABETHATGUY

### 🐛 Bug Fixes

- rename `__export` to `__exportAll` to be compatible with `cjs-module-lexer` (#7640) by @IWANABETHATGUY
- strip UTF-8 BOM when using text loader (#7635) by @sapphi-red
- rolldown_plugin_replace: avoid crashing with invalid delimiters (#7621) by @sapphi-red

### 🚜 Refactor

- export all filter functions (#7622) by @sxzz
- allow multiple help messages in diagnostics (#7624) by @sapphi-red

### 📚 Documentation

- add README.md to packages/rolldown (#7556) by @Copilot

### ⚡ Performance

- use fsevents on macOS for file watching (#7596) by @sapphi-red

### 🧪 Testing

- handle re-exports of external modules in CJS format (#7641) by @IWANABETHATGUY
- update integration to use vite's rolldown-canary branch (#7633) by @shulaoda

### ⚙️ Miscellaneous Tasks

- docs: fix Netlify ignore condition to detect docs changes across all PR commits (#7637) by @Copilot
- deps: update rollup submodule for tests to v4.54.0 (#7630) by @sapphi-red
- skip benchmarks for PRs with 'graphite: merge-when-ready' label (#7631) by @Boshen
- deps: update esbuild for tests to 0.27.2 (#7629) by @sapphi-red
- fix "update-test-dependencies" workflow (#7628) by @sapphi-red
- deps: update test262 submodule for tests (#7626) by @sapphi-red
- deps: update dependency oxlint to v1.35.0 (#7623) 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.

2 participants