Skip to content

feat(react-refresh-loader): generate more compact runtime code#12160

Merged
chenjiahan merged 1 commit intomainfrom
react_refresh_compat_1112
Nov 12, 2025
Merged

feat(react-refresh-loader): generate more compact runtime code#12160
chenjiahan merged 1 commit intomainfrom
react_refresh_compat_1112

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Nov 12, 2025

Summary

The React Refresh runtime helpers are inserted into every React component, and keeping it compact helps keep the output code clear.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 12, 2025 03:45
@chenjiahan chenjiahan requested a review from ahabhgk as a code owner November 12, 2025 03:46
@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 12, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 12, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 94b6412
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691402fa18eed90008a1dd9f

Copy link
Copy Markdown
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 optimizes the React Refresh loader by generating more compact runtime code. The runtime helpers are now emitted on single lines instead of multiple lines, reducing the overall output size. The code conditionally uses arrow functions when the environment supports them.

  • Compacted the React Refresh runtime helper functions from multi-line to single-line format
  • Added environment-aware code generation that uses arrow functions when supported
  • Maintained backward compatibility for environments that don't support arrow functions

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

@chenjiahan chenjiahan enabled auto-merge (squash) November 12, 2025 03:57
@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 94b6412 to chore(deps): update patch npm dependencies (#12153) by renovate[bot]

❌ Size increased by 384bytes from 48.09MB to 48.09MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 12, 2025

CodSpeed Performance Report

Merging #12160 will not alter performance

Comparing react_refresh_compat_1112 (94b6412) with main (1f2a3a3)

Summary

✅ 17 untouched

@chenjiahan chenjiahan merged commit 49f97a7 into main Nov 12, 2025
55 checks passed
@chenjiahan chenjiahan deleted the react_refresh_compat_1112 branch November 12, 2025 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature 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