Skip to content

Conversation

JSerFeng
Copy link
Contributor

Summary

when module does reexport, there are 2 exportInfo.

when A re-export foo from B, A has exportInfo foo, and B also has exportInfo foo, should render based on exportInfo from B not A

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Copilot Copilot AI review requested due to automatic review settings September 28, 2025 09:08
Copy link

netlify bot commented Sep 28, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 34839eb
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68dfb540e3e747000808fb5e

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Sep 28, 2025
Copy link
Contributor

@Copilot 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 an issue with re-exports in dynamic JavaScript modules where the wrong exportInfo was being used for rendering. When module A re-exports from module B, the system should use the exportInfo from module B (the source) rather than from module A (the re-exporter).

Key changes:

  • Added a new default_exported field to ExternalInterop to properly handle default export symbols
  • Updated the re-export logic to use the correct exportInfo from the source module rather than the re-exporting module
  • Modified the concate modules map parameter to be mutable to allow updating interop settings

Reviewed Changes

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

File Description
crates/rspack_plugin_esm_library/src/link.rs Core logic changes to fix re-export handling by using source module's exportInfo and adding default_exported support
crates/rspack_plugin_esm_library/src/chunk_link.rs Added default_exported field and method to ExternalInterop struct for proper symbol generation
tests/rspack-test/esmOutputCases/interop/type-module/* New test files to verify the re-export fix works correctly with ESM/CJS interop

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

github-actions bot commented Sep 28, 2025

📦 Binary Size-limit

Comparing 34839eb to chore(deps): update swc (#11747) by renovate[bot]

❌ Size increased by 4.13KB from 47.89MB to 47.89MB (⬆️0.01%)

Copy link

codspeed-hq bot commented Sep 28, 2025

CodSpeed Performance Report

Merging #11776 will not alter performance

Comparing esm-lib-plugin (34839eb) with main (4e1954d)

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched

@JSerFeng JSerFeng enabled auto-merge (squash) October 6, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant