Skip to content

Conversation

@JSerFeng
Copy link
Contributor

@JSerFeng JSerFeng commented Nov 5, 2025

Summary

Special handle for re-export from external module. Should render re-exports for all ExportMode

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 5, 2025 03:45
@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 Nov 5, 2025
@netlify
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 32ac475
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/690afde296697c00085c31ef
😎 Deploy Preview https://deploy-preview-12089--rspack.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.

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 enhances support for re-exporting from external modules in ESM library output by introducing more granular handling of different export patterns. Previously, only export * from external modules was optimized; now the plugin handles all re-export forms including named exports, default exports, and namespace exports from external modules.

Key Changes

  • Modified the re-export data structure to support both chunk-based and request-based (external module) re-exports
  • Added comprehensive handling for all ExportMode variants when re-exporting from external modules
  • Enhanced the rendering logic to distinguish between chunk re-exports and external module re-exports

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rspack_plugin_esm_library/src/chunk_link.rs Introduced ReExportFrom enum to differentiate chunk vs. request-based re-exports; changed raw_star_exports from set to map to track export names
crates/rspack_plugin_esm_library/src/link.rs Added re_export_from_external_module function to handle all external module re-export modes; added logic to skip external re-exports when collecting exports
crates/rspack_plugin_esm_library/src/render.rs Updated rendering logic to handle both star exports with names and re-exports from external modules vs. chunks
tests/rspack-test/esmOutputCases/re-exports/*/*.snap.txt Updated test snapshots to reflect new external module re-export output format
tests/rspack-test/esmOutputCases/re-exports/re-export-namespaced-external/*.js Added new test case for external module re-exports with various export patterns

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

📦 Binary Size-limit

Comparing 32ac475 to chore(deps): update patch npm dependencies (#12084) by renovate[bot]

❌ Size increased by 11.13KB from 47.85MB to 47.86MB (⬆️0.02%)

@JSerFeng JSerFeng force-pushed the fix/reexport-external branch 3 times, most recently from 179cd7f to 08ea7b8 Compare November 5, 2025 06:43
@JSerFeng JSerFeng marked this pull request as draft November 5, 2025 07:02
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 5, 2025

CodSpeed Performance Report

Merging #12089 will not alter performance

Comparing fix/reexport-external (32ac475) with main (498466d)

Summary

✅ 17 untouched

@JSerFeng JSerFeng force-pushed the fix/reexport-external branch from a7ca36e to 32ac475 Compare November 5, 2025 07:33
@JSerFeng JSerFeng marked this pull request as ready for review November 5, 2025 07:57
@JSerFeng JSerFeng merged commit 61cb132 into main Nov 5, 2025
44 checks passed
@JSerFeng JSerFeng deleted the fix/reexport-external branch November 5, 2025 08:31
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.

3 participants