Commit 15fef8e
refactor: prevent reinitializing
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 `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: #1510
Test Plan: n/a
Reviewed By: huntie
Differential Revision: D75678288
Pulled By: robhogan
fbshipit-source-id: 2f7eb8ac3b298494b260276b1ab74e35230e3743global.$RefreshReg$ (#1510)1 parent 0686024 commit 15fef8e
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
0 commit comments