Skip to content

fix: use modern syntax for reexport runtime#12268

Merged
chenjiahan merged 1 commit intomainfrom
reexport_syntax_1123
Nov 24, 2025
Merged

fix: use modern syntax for reexport runtime#12268
chenjiahan merged 1 commit intomainfrom
reexport_syntax_1123

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Nov 23, 2025

Summary

Check environment support for const and arrow functions to generate appropriate syntax for Rspack's reexport runtime.

Align with webpack: https://github.com/webpack/webpack/blob/main/lib/dependencies/HarmonyExportImportedSpecifierDependency.js#L1237-L1256

Checklist

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

Copilot AI review requested due to automatic review settings November 23, 2025 05:41
@netlify
Copy link

netlify bot commented Nov 23, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 7b9634f
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69229e7da966cc00083aa63b

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Nov 23, 2025
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 modernizes the syntax for Rspack reexport bindings by checking environment support for const and arrow functions, aligning with webpack's implementation. The changes ensure that generated code is compatible with the target environment by using modern syntax (const, arrow functions) when supported, and falling back to legacy syntax (var, regular functions) otherwise.

  • Adds environment support checks for const and arrow functions
  • Conditionally generates modern or legacy syntax for dynamic reexports
  • Aligns implementation with webpack's approach

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

@chenjiahan chenjiahan changed the title fix: use modern syntax for reexport bindings fix: use modern syntax for reexport runtime Nov 23, 2025
@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 7b9634f to feat: support SRI with experiments.css and CssExtractRspackPlugin (#12239) by harpsealjs

❌ Size increased by 4.38KB from 47.63MB to 47.63MB (⬆️0.01%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 23, 2025

CodSpeed Performance Report

Merging #12268 will not alter performance

Comparing reexport_syntax_1123 (7b9634f) with main (ca1a20f)

Summary

✅ 17 untouched

@chenjiahan chenjiahan requested a review from JSerFeng November 24, 2025 03:41
@chenjiahan chenjiahan enabled auto-merge (squash) November 24, 2025 03:42
@chenjiahan chenjiahan disabled auto-merge November 24, 2025 03:50
@chenjiahan chenjiahan merged commit a4e964a into main Nov 24, 2025
182 of 192 checks passed
@chenjiahan chenjiahan deleted the reexport_syntax_1123 branch November 24, 2025 03:50
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