-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: reexports in arrow-only environments without const #12484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack canceled.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this 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 a critical bug in the reexport code generation for environments that support arrow functions but not block-scoped bindings like const (e.g., iOS 10). The fix ensures arrow function getters in reexport loops are only generated when both supports_arrow_function and supports_const are true, preventing incorrect exports caused by variable capture issues.
Key Changes:
- Modified the condition for generating arrow function getters in dynamic reexports to check both
supports_arrow_functionANDsupports_const - Added explanatory comments about why both checks are necessary
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📊 Quick Summary (Click to expand)
📋 Detailed Reports (Click to expand)📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 128bytes from 48.29MB to 48.29MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12484 will not alter performanceComparing Summary
|
Summary
When generating re-exports runtime code, arrow function getters were previously emitted based on
supports_arrow_function.In environments that support arrow functions but not block-scoped bindings like
const(for example iOS 10), this causes all reexport getters to capture the same loop variable and produce incorrect exports.This change ensures arrow getters are only generated when
constis also supported. Otherwise, it falls back to a function-based getter that safely captures the key per iteration.Related links
Checklist