react-hot-loader
Advanced tools
Comparing version 4.7.1 to 4.7.2
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="4.7.2"></a> | ||
## [4.7.2](https://github.com/gaearon/react-hot-loader/compare/v4.7.1...v4.7.2) (2019-03-04) | ||
### Bug Fixes | ||
* safer reads from context consumer ([7942d26](https://github.com/gaearon/react-hot-loader/commit/7942d26)) | ||
* suppress error message on a server side, fixes [#1188](https://github.com/gaearon/react-hot-loader/issues/1188) ([b12b430](https://github.com/gaearon/react-hot-loader/commit/b12b430)) | ||
<a name="4.7.1"></a> | ||
@@ -7,0 +18,0 @@ ## [4.7.1](https://github.com/gaearon/react-hot-loader/compare/v4.7.0...v4.7.1) (2019-02-20) |
'use strict' | ||
if (!module.hot || process.env.NODE_ENV === 'production') { | ||
var hasWindow = typeof window !== 'undefined'; | ||
if (!module.hot || process.env.NODE_ENV === 'production' || !hasWindow) { | ||
module.exports = require('./dist/react-hot-loader.production.min.js'); | ||
@@ -14,3 +16,3 @@ } else { | ||
// RHL needs setPrototypeOf to operate Component inheritance, and eval to patch methods | ||
var jsFeaturesPresent = typeof window !== 'undefined' && !!Object.setPrototypeOf; | ||
var jsFeaturesPresent = !!Object.setPrototypeOf; | ||
@@ -17,0 +19,0 @@ if (!jsFeaturesPresent || !evalAllowed) { |
{ | ||
"name": "react-hot-loader", | ||
"version": "4.7.1", | ||
"version": "4.7.2", | ||
"description": "Tweak React components in real time.", | ||
@@ -104,5 +104,5 @@ "main": "index.js", | ||
"global": "^4.3.0", | ||
"hoist-non-react-statics": "^2.5.0", | ||
"hoist-non-react-statics": "^3.3.0", | ||
"loader-utils": "^1.1.0", | ||
"lodash.merge": "^4.6.1", | ||
"lodash": "^4.17.11", | ||
"prop-types": "^15.6.1", | ||
@@ -109,0 +109,0 @@ "react-lifecycles-compat": "^3.0.4", |
@@ -69,5 +69,13 @@ # React Hot Loader | ||
There is also old version of `hot`, used prior version 4.5.4. **Please use a new one**, | ||
as it is much more resilient to js errors you may make during development. | ||
3. [Run webpack with Hot Module Replacement](https://webpack.js.org/guides/hot-module-replacement/#enabling-hmr): | ||
```sh | ||
webpack-dev-server --hot | ||
``` | ||
### Old API | ||
**Note:** There is also an old version of `hot`, used prior to version 4.5.4. **Please use the new one**, | ||
as it is much more resilient to js errors that you may make during development. | ||
```js | ||
@@ -79,8 +87,2 @@ import { hot } from 'react-hot-loader' | ||
3. [Run webpack with Hot Module Replacement](https://webpack.js.org/guides/hot-module-replacement/#enabling-hmr): | ||
```sh | ||
webpack-dev-server --hot | ||
``` | ||
## Limitations | ||
@@ -242,8 +244,7 @@ | ||
We recommend to use `babel` plugin, but there are situations when you are unable to use it, then - try webpack loader (as seen in v3) | ||
to have at least _something_. | ||
Remember - it is **not compatible** with class-based components - as long as babel plugin | ||
would inject a special methods to the every class, to make `class members`(like onClick) hot-updatable, | ||
while webpack-plugin would leave classes as is, without any _instrumentation_. | ||
We recommend using the `babel` plugin, but there are some situations where you are unable to. If so, try the `webpack` plugin / `webpack-loader` (as seen in v3). | ||
Remember - the `webpack` plugin is **not compatible** with class-based components. The `babel` plugin | ||
will inject special methods to every class, to make `class members` (like onClick) hot-updatable, while the `webpack` plugin would leave classes as is, without any _instrumentation_. | ||
```js | ||
@@ -257,3 +258,3 @@ class MyComponent extends React.Component { | ||
But webpack-loader could help with TypeScript or _spreading_ "cold API" [to all node_modules](https://github.com/gaearon/react-hot-loader#disabling-a-type-change-for-all-node_modules). | ||
But `webpack-loader` could help with TypeScript or _spreading_ "cold API" [to all node_modules](https://github.com/gaearon/react-hot-loader#disabling-a-type-change-for-all-node_modules). | ||
@@ -530,3 +531,3 @@ > It is safe to enable this loader for all the files. But place it after babel-loader, if babel-loader is present. | ||
Mark application as hot reloadable. (**Prefer** using `hot` helper) | ||
Mark application as hot reloadable. (**Prefer** using `hot` helper, see below for migration details). | ||
@@ -533,0 +534,0 @@ This low-level approach lets you make **hot **imports\_\_, not exports. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
182352
2782
812
+ Addedlodash@^4.17.11
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedlodash@4.17.21(transitive)
- Removedlodash.merge@^4.6.1
- Removedhoist-non-react-statics@2.5.5(transitive)
- Removedlodash.merge@4.6.2(transitive)