refactor: prevent reinitializing global.$RefreshReg$#1510
Closed
jbroma wants to merge 1 commit intofacebook:mainfrom
Closed
refactor: prevent reinitializing global.$RefreshReg$#1510jbroma wants to merge 1 commit intofacebook:mainfrom
global.$RefreshReg$#1510jbroma wants to merge 1 commit intofacebook:mainfrom
Conversation
Contributor
|
@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
jbroma
added a commit
to callstack/metro
that referenced
this pull request
Jul 1, 2025
Summary: Part of facebook#1480 This PR adds a check for global.$RefreshReg$ to prevent reinitialising it in case there are multiple module systems present in runtime (like it does in the implementation of module-federation in Metro). For context: for the HMR in MF we're reusing the global instance of `ReactRefresh` <!-- Changelog entries should be prefixed with one of the following scopes: [Breaking, Feature, Fix, Performance, Deprecated, Experimental, Internal] Examples: Changelog: [Fix] Respond with HTTP 404 when a bundle entry point cannot be resolved Changelog: [Internal] --> Changelog: [Internal] Prevent reinitialising global.$RefreshReg$ in require.js polyfill Pull Request resolved: facebook#1510 Test Plan: n/a Reviewed By: huntie Differential Revision: D75678288 Pulled By: robhogan fbshipit-source-id: 2f7eb8ac3b298494b260276b1ab74e35230e3743
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #1480
This PR adds a check for global.$RefreshReg$ to prevent reinitialising it in case there are multiple module systems present in runtime (like it does in the implementation of module-federation in Metro).
For context: for the HMR in MF we're reusing the global instance of
ReactRefreshChangelog: [Internal] Prevent reinitialising global.$RefreshReg$ in require.js polyfill
Test plan
n/a