Skip to content

fix: preserve direct exports bindings - #15003

Merged
LingyuCoder merged 1 commit into
mainfrom
seal/fix-rspack-exports-binding
Jul 31, 2026
Merged

LingyuCoder merged 1 commit into
mainfrom
seal/fix-rspack-exports-binding

Conversation

@LingyuCoder

@LingyuCoder LingyuCoder commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix a name collision when application code exports a top-level binding named __webpack_exports__ with output.module: true and library.type: "modern-module"
  • allow the conflicting local binding to be renamed while preserving __webpack_exports__ as the public ESM export name
  • keep nested bindings on the existing compatibility path and add regression coverage for both __webpack_exports__ and exports bindings across runtime render modes

Reproduction

Stack

Testing

  • cargo fmt --all --check
  • cargo check -p rspack_plugin_javascript --lib --locked
  • cargo clippy -p rspack_plugin_javascript --lib --locked -- -D warnings
  • corepack pnpm@11.8.0 --filter @rspack/binding run build:dev
  • corepack pnpm@11.8.0 --dir tests/rspack-test exec rs test EsmOutput.test.js RuntimeModeEsmOutput.test.js --testNamePattern 'deconflict/(exports-binding|webpack-exports-binding)'
  • full EsmOutput.test.js and RuntimeModeEsmOutput.test.js suites on fix: preserve runtime-free ESM binding names #15004 (506 tests)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 523819a06e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/parser_plugin/compatibility_plugin.rs Outdated
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 45cf213 to fix: avoid runtime scope conflicts in module factories (#15002) by harpsealjs

🙈 Size remains the same at 66.77MB

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 552.1 KB 0 0
react-1k 823.1 KB 217.0 KB 0 0
react-10k 5.6 MB 1.3 MB 0 0
react-5k 2.7 MB 663.8 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@codspeed

codspeed Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 3.11%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
✅ 43 untouched benchmarks
⏩ 47 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@persistent_cache_restore_after_single_file_change@basic-react-development 4.8 ms 4.7 ms +3.23%
Simulation rust@persistent_cache_restore@basic-react-development 4.5 ms 4.3 ms +3.14%
Simulation rust@create_chunk_assets 1.5 ms 1.4 ms +2.96%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing seal/fix-rspack-exports-binding (45cf213) with main (c05244a)2

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (727ca03) during the generation of this report, so c05244a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LingyuCoder
LingyuCoder force-pushed the seal/fix-rspack-exports-binding branch from 523819a to f215056 Compare July 30, 2026 16:39
@LingyuCoder
LingyuCoder changed the base branch from main to seal/fix-cjs-rspack-require-conflict July 30, 2026 16:39
@LingyuCoder
LingyuCoder force-pushed the seal/fix-rspack-exports-binding branch 2 times, most recently from 33d05e0 to eb81ae3 Compare July 31, 2026 06:52
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 45cf213
Status: ✅  Deploy successful!
Preview URL: https://f802f07a.rspack-v2.pages.dev
Branch Preview URL: https://seal-fix-rspack-exports-bind.rspack-v2.pages.dev

View logs

@LingyuCoder
LingyuCoder force-pushed the seal/fix-rspack-exports-binding branch from eb81ae3 to 2c6a4fc Compare July 31, 2026 06:56
@LingyuCoder
LingyuCoder requested a review from JSerFeng July 31, 2026 07:04
JSerFeng
JSerFeng previously approved these changes Jul 31, 2026
stack merge was automatically disabled July 31, 2026 08:41

Pull Request is not mergeable

stack merge was automatically disabled July 31, 2026 08:42

Pull Request is not mergeable

stack merge was automatically disabled July 31, 2026 08:43

Pull Request is not mergeable

stack merge was automatically disabled July 31, 2026 08:45

Pull Request is not mergeable

@LingyuCoder
LingyuCoder force-pushed the seal/fix-rspack-exports-binding branch from 2c6a4fc to 46c6731 Compare July 31, 2026 08:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46c673186f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

stack merge was automatically disabled July 31, 2026 09:17

Pull Request is not mergeable

Base automatically changed from seal/fix-cjs-rspack-require-conflict to main July 31, 2026 09:18
@LingyuCoder
LingyuCoder force-pushed the seal/fix-rspack-exports-binding branch from 46c6731 to 45cf213 Compare July 31, 2026 09:18
@LingyuCoder
LingyuCoder merged commit ade7e9e into main Jul 31, 2026
39 checks passed
@LingyuCoder
LingyuCoder deleted the seal/fix-rspack-exports-binding branch July 31, 2026 09:34
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