mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #11425 from meteor/react-fast-refresh-ie-fix
Fix react-fast-refresh for IE11
This commit is contained in:
18
packages/react-fast-refresh/client-runtime.js
vendored
18
packages/react-fast-refresh/client-runtime.js
vendored
@@ -6,7 +6,7 @@ if (enabled && process.env.NODE_ENV !== 'production' && module.hot) {
|
||||
let timeout = null;
|
||||
function scheduleRefresh() {
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(() => {
|
||||
timeout = setTimeout(function() {
|
||||
timeout = null;
|
||||
runtime.performReactRefresh();
|
||||
}, 0);
|
||||
@@ -69,11 +69,13 @@ if (enabled && process.env.NODE_ENV !== 'production' && module.hot) {
|
||||
|
||||
runtime.injectIntoGlobalHook(window);
|
||||
|
||||
window.$RefreshReg$ = () => { };
|
||||
window.$RefreshSig$ = () => type => type;
|
||||
window.$RefreshReg$ = function() { };
|
||||
window.$RefreshSig$ = function() {
|
||||
return function(type) { return type; };
|
||||
};
|
||||
|
||||
module.hot.onRequire({
|
||||
before(module) {
|
||||
before: function(module) {
|
||||
if (module.loaded) {
|
||||
// The module was already executed
|
||||
return;
|
||||
@@ -83,18 +85,18 @@ if (enabled && process.env.NODE_ENV !== 'production' && module.hot) {
|
||||
var prevRefreshSig = window.$RefreshSig$;
|
||||
|
||||
window.RefreshRuntime = runtime;
|
||||
window.$RefreshReg$ = (type, _id) => {
|
||||
window.$RefreshReg$ = function(type, _id) {
|
||||
const fullId = module.id + ' ' + _id;
|
||||
RefreshRuntime.register(type, fullId);
|
||||
}
|
||||
window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
|
||||
|
||||
return {
|
||||
prevRefreshReg,
|
||||
prevRefreshSig
|
||||
prevRefreshReg: prevRefreshReg,
|
||||
prevRefreshSig: prevRefreshSig
|
||||
};
|
||||
},
|
||||
after(module, beforeData) {
|
||||
after: function(module, beforeData) {
|
||||
// TODO: handle modules with errors
|
||||
if (!beforeData) {
|
||||
return;
|
||||
|
||||
2
packages/react-fast-refresh/package.js
vendored
2
packages/react-fast-refresh/package.js
vendored
@@ -1,6 +1,6 @@
|
||||
Package.describe({
|
||||
name: 'react-fast-refresh',
|
||||
version: '0.1.0',
|
||||
version: '0.1.1',
|
||||
summary: 'Automatically update React components with HMR',
|
||||
documentation: 'README.md',
|
||||
devOnly: true
|
||||
|
||||
Reference in New Issue
Block a user