Skip to content

Conversation

@chenjiahan
Copy link
Member

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 const is also supported. Otherwise, it falls back to a function-based getter that safely captures the key per iteration.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 17, 2025 03:58
@netlify
Copy link

netlify bot commented Dec 17, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 6483619
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69422a57c289da000825b6cf

@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 Dec 17, 2025
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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 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_function AND supports_const
  • Added explanatory comments about why both checks are necessary

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

@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📊 Quick Summary (Click to expand)
Project Total Size Change
react-10k 5.7 MB ➡️ 0 B (0.0%)
react-1k 823.4 KB ➡️ 0 B (0.0%)
react-5k 2.7 MB ➡️ 0 B (0.0%)
rome 984.3 KB ➡️ 0 B (0.0%)
ui-components 2.1 MB ➡️ 0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: ec646ebb83 | PR: #12469

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB 0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: ec646ebb83 | PR: #12469

Metric Current Baseline Change
📊 Total Size 823.4 KB 823.4 KB 0 B (0.0%)
📄 JavaScript 823.4 KB 823.4 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: ec646ebb83 | PR: #12469

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: ec646ebb83 | PR: #12469

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: ec646ebb83 | PR: #12469

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 6483619 to perf(rstest): minor performance optimization (#12469) by Max

❌ Size increased by 128bytes from 48.29MB to 48.29MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 17, 2025

CodSpeed Performance Report

Merging #12484 will not alter performance

Comparing fix_reexports_runtime_1217 (6483619) with main (ec646eb)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) December 17, 2025 05:48
@chenjiahan chenjiahan merged commit aef8598 into main Dec 17, 2025
61 checks passed
@chenjiahan chenjiahan deleted the fix_reexports_runtime_1217 branch December 17, 2025 06:16
@CPunisher CPunisher mentioned this pull request Dec 17, 2025
2 tasks
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