mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge branch 'hot-module-reload' into release-2.0
# Conflicts: # packages/modules-runtime-hot/package.js # packages/react-fast-refresh/README.md
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Package.describe({
|
||||
name: "modules-runtime-hot",
|
||||
version: "0.13.0-rc200.1",
|
||||
summary: "Patches modules-runtime to support Hot Module Reload",
|
||||
summary: "Patches modules-runtime to support Hot Module Replacement",
|
||||
git: "https://github.com/benjamn/install",
|
||||
documentation: "README.md"
|
||||
});
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
# react-fast-refresh
|
||||
[Source code of released version](https://github.com/meteor/meteor/tree/master/packages/react-fast-refresh) | [Source code of development version](https://github.com/meteor/meteor/tree/devel/packages/react-fast-refresh)
|
||||
***
|
||||
|
||||
Automatically update React components with HMR
|
||||
This package updates modified React components in the running app for faster
|
||||
feedback after changing a file. To be enabled, your app must:
|
||||
|
||||
- Use the `hot-module-replacement` package
|
||||
- Use React 16.9.0 or newer
|
||||
|
||||
This package is disabled in production. It currently only supports the modern web client.
|
||||
|
||||
Learn more in the [React Fast Refresh docs](https://reactnative.dev/docs/fast-refresh)
|
||||
|
||||
React Fast Refresh can be disabled by setting the `DISABLE_REACT_FAST_REFRESH` environment variable before starting Meteor.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
if (process.env.NODE_ENV !== 'production' && module.hot) {
|
||||
const enabled = __meteor_runtime_config__.reactFastRefreshEnabled;
|
||||
|
||||
if (enabled && process.env.NODE_ENV !== 'production' && module.hot) {
|
||||
const runtime = require('react-refresh/runtime');
|
||||
|
||||
let timeout = null;
|
||||
|
||||
2
packages/react-fast-refresh/package.js
vendored
2
packages/react-fast-refresh/package.js
vendored
@@ -7,7 +7,7 @@ Package.describe({
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
'react-refresh': '0.8.3',
|
||||
'react-refresh': '0.9.0',
|
||||
semver: '7.3.4'
|
||||
});
|
||||
|
||||
|
||||
4
packages/react-fast-refresh/server.js
vendored
4
packages/react-fast-refresh/server.js
vendored
@@ -15,6 +15,10 @@ if (enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof __meteor_runtime_config__ === 'object') {
|
||||
__meteor_runtime_config__.reactFastRefreshEnabled = enabled;
|
||||
}
|
||||
|
||||
const babelPlugin = enabled ?
|
||||
require('react-refresh/babel') :
|
||||
null;
|
||||
|
||||
@@ -226,7 +226,9 @@ _.extend(AppProcess.prototype, {
|
||||
|
||||
env.METEOR_PRINT_ON_LISTEN = 'true';
|
||||
|
||||
env.METEOR_HMR_SECRET = self.hmrSecret;
|
||||
if (self.hmrSecret) {
|
||||
env.METEOR_HMR_SECRET = self.hmrSecret;
|
||||
}
|
||||
|
||||
return env;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user