From 795af8092c9381e4b122e0388fb3da8d6763a6c4 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 9 Aug 2020 09:46:22 -0400 Subject: [PATCH] chore(*): upgrade react-hot-loader (#580) --- package.json | 2 +- .../examples/todomvc/containers/Root.dev.js | 3 +- .../examples/todomvc/containers/Root.prod.js | 3 +- .../examples/todomvc/package.json | 3 +- .../examples/todomvc/webpack.config.js | 1 - .../package.json | 1 - .../examples/counter/package.json | 6 +- .../redux-devtools/examples/counter/server.js | 19 ------ .../counter/src/containers/Root.dev.js | 5 +- .../counter/src/containers/Root.prod.js | 5 +- .../examples/counter/webpack.config.js | 6 +- .../examples/todomvc/containers/Root.dev.js | 5 +- .../examples/todomvc/containers/Root.prod.js | 5 +- .../examples/todomvc/package.json | 6 +- .../redux-devtools/examples/todomvc/server.js | 19 ------ .../examples/todomvc/webpack.config.js | 6 +- yarn.lock | 67 ++++--------------- 17 files changed, 51 insertions(+), 111 deletions(-) delete mode 100644 packages/redux-devtools/examples/counter/server.js delete mode 100644 packages/redux-devtools/examples/todomvc/server.js diff --git a/package.json b/package.json index f927d1f4..122b5ad5 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "packages/react-json-tree/examples", "packages/redux-devtools/examples/counter", "packages/redux-devtools/examples/todomvc", - "packages/redux-slider-monitor/examples/todomvc" + "packages/redux-devtools-slider-monitor/examples/todomvc" ], "engines": { "node": ">=10.13.0" diff --git a/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.dev.js b/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.dev.js index c9e7dec8..48c6641f 100644 --- a/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.dev.js +++ b/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.dev.js @@ -1,3 +1,4 @@ +import { hot } from 'react-hot-loader/root'; import React from 'react'; import PropTypes from 'prop-types'; import { Provider } from 'react-redux'; @@ -17,4 +18,4 @@ Root.propTypes = { store: PropTypes.object.isRequired, }; -export default Root; +export default hot(Root); diff --git a/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.prod.js b/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.prod.js index 1e05ee94..b9a63c53 100644 --- a/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.prod.js +++ b/packages/redux-devtools-slider-monitor/examples/todomvc/containers/Root.prod.js @@ -1,3 +1,4 @@ +import { hot } from 'react-hot-loader/root'; import React from 'react'; import PropTypes from 'prop-types'; import { Provider } from 'react-redux'; @@ -15,4 +16,4 @@ Root.propTypes = { store: PropTypes.object.isRequired, }; -export default Root; +export default hot(Root); diff --git a/packages/redux-devtools-slider-monitor/examples/todomvc/package.json b/packages/redux-devtools-slider-monitor/examples/todomvc/package.json index d861f75d..928dc2ac 100644 --- a/packages/redux-devtools-slider-monitor/examples/todomvc/package.json +++ b/packages/redux-devtools-slider-monitor/examples/todomvc/package.json @@ -2,7 +2,7 @@ "name": "slider-todomvc", "version": "0.0.0", "description": "TodoMVC example for redux", - "main": "server.js", + "main": "index.js", "scripts": { "start": "webpack-dev-server", "build": "webpack --config webpack.config.prod.js" @@ -23,6 +23,7 @@ "webpack-dev-server": "^3.11.0" }, "dependencies": { + "react-hot-loader": "^4.12.21", "react-redux": "^7.2.1", "redux-devtools-slider-monitor": "^2.0.0-3" } diff --git a/packages/redux-devtools-slider-monitor/examples/todomvc/webpack.config.js b/packages/redux-devtools-slider-monitor/examples/todomvc/webpack.config.js index 07af0d74..f8585aaa 100644 --- a/packages/redux-devtools-slider-monitor/examples/todomvc/webpack.config.js +++ b/packages/redux-devtools-slider-monitor/examples/todomvc/webpack.config.js @@ -11,7 +11,6 @@ module.exports = { hot: true, }, entry: [ - 'react-hot-loader/patch', 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './index', diff --git a/packages/redux-devtools-slider-monitor/package.json b/packages/redux-devtools-slider-monitor/package.json index 0a556943..29237dae 100644 --- a/packages/redux-devtools-slider-monitor/package.json +++ b/packages/redux-devtools-slider-monitor/package.json @@ -27,7 +27,6 @@ "classnames": "^2.2.6", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-hot-loader": "^3.1.3", "redux": "^4.0.5", "redux-devtools": "^3.6.0", "redux-devtools-dock-monitor": "^1.1.3", diff --git a/packages/redux-devtools/examples/counter/package.json b/packages/redux-devtools/examples/counter/package.json index 81210138..83cb5f4f 100644 --- a/packages/redux-devtools/examples/counter/package.json +++ b/packages/redux-devtools/examples/counter/package.json @@ -2,9 +2,9 @@ "name": "counter-redux", "version": "0.0.0", "description": "Counter example for redux", - "main": "server.js", + "main": "src/index.js", "scripts": { - "start": "node server.js" + "start": "webpack-dev-server --open" }, "repository": { "type": "git", @@ -19,7 +19,7 @@ "prop-types": "^15.7.2", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-hot-loader": "^3.1.3", + "react-hot-loader": "^4.12.21", "react-redux": "^7.2.1", "redux": "^4.0.5", "redux-thunk": "^2.3.0" diff --git a/packages/redux-devtools/examples/counter/server.js b/packages/redux-devtools/examples/counter/server.js deleted file mode 100644 index 85ce31e6..00000000 --- a/packages/redux-devtools/examples/counter/server.js +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable no-console */ -var webpack = require('webpack'); -var WebpackDevServer = require('webpack-dev-server'); -var config = require('./webpack.config'); - -new WebpackDevServer(webpack(config), { - publicPath: config.output.publicPath, - hot: true, - historyApiFallback: true, - stats: { - colors: true, - }, -}).listen(3000, 'localhost', function (err) { - if (err) { - console.log(err); - } - - console.log('Listening at localhost:3000'); -}); diff --git a/packages/redux-devtools/examples/counter/src/containers/Root.dev.js b/packages/redux-devtools/examples/counter/src/containers/Root.dev.js index e32eb240..7ffcee70 100644 --- a/packages/redux-devtools/examples/counter/src/containers/Root.dev.js +++ b/packages/redux-devtools/examples/counter/src/containers/Root.dev.js @@ -1,9 +1,10 @@ +import { hot } from 'react-hot-loader/root'; import React, { Component } from 'react'; import { Provider } from 'react-redux'; import CounterApp from './CounterApp'; import DevTools from './DevTools'; -export default class Root extends Component { +class Root extends Component { render() { const { store } = this.props; return ( @@ -16,3 +17,5 @@ export default class Root extends Component { ); } } + +export default hot(Root); diff --git a/packages/redux-devtools/examples/counter/src/containers/Root.prod.js b/packages/redux-devtools/examples/counter/src/containers/Root.prod.js index da9e91d2..e190b4ed 100644 --- a/packages/redux-devtools/examples/counter/src/containers/Root.prod.js +++ b/packages/redux-devtools/examples/counter/src/containers/Root.prod.js @@ -1,8 +1,9 @@ +import { hot } from 'react-hot-loader/root'; import React, { Component } from 'react'; import { Provider } from 'react-redux'; import CounterApp from './CounterApp'; -export default class Root extends Component { +class Root extends Component { render() { const { store } = this.props; return ( @@ -12,3 +13,5 @@ export default class Root extends Component { ); } } + +export default hot(Root); diff --git a/packages/redux-devtools/examples/counter/webpack.config.js b/packages/redux-devtools/examples/counter/webpack.config.js index 40528dc9..41a69de6 100644 --- a/packages/redux-devtools/examples/counter/webpack.config.js +++ b/packages/redux-devtools/examples/counter/webpack.config.js @@ -7,7 +7,6 @@ module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', - 'react-hot-loader/patch', './src/index', ], output: { @@ -26,4 +25,9 @@ module.exports = { }, ], }, + devServer: { + historyApiFallback: true, + hot: true, + port: 3000, + }, }; diff --git a/packages/redux-devtools/examples/todomvc/containers/Root.dev.js b/packages/redux-devtools/examples/todomvc/containers/Root.dev.js index 43f6626e..f2a3db3d 100644 --- a/packages/redux-devtools/examples/todomvc/containers/Root.dev.js +++ b/packages/redux-devtools/examples/todomvc/containers/Root.dev.js @@ -1,9 +1,10 @@ +import { hot } from 'react-hot-loader/root'; import React, { Component } from 'react'; import { Provider } from 'react-redux'; import TodoApp from './TodoApp'; import DevTools from './DevTools'; -export default class Root extends Component { +class Root extends Component { render() { const { store } = this.props; return ( @@ -16,3 +17,5 @@ export default class Root extends Component { ); } } + +export default hot(Root); diff --git a/packages/redux-devtools/examples/todomvc/containers/Root.prod.js b/packages/redux-devtools/examples/todomvc/containers/Root.prod.js index 7a29a4fe..f89e612d 100644 --- a/packages/redux-devtools/examples/todomvc/containers/Root.prod.js +++ b/packages/redux-devtools/examples/todomvc/containers/Root.prod.js @@ -1,8 +1,9 @@ +import { hot } from 'react-hot-loader/root'; import React, { Component } from 'react'; import { Provider } from 'react-redux'; import TodoApp from './TodoApp'; -export default class Root extends Component { +class Root extends Component { render() { const { store } = this.props; return ( @@ -12,3 +13,5 @@ export default class Root extends Component { ); } } + +export default hot(Root); diff --git a/packages/redux-devtools/examples/todomvc/package.json b/packages/redux-devtools/examples/todomvc/package.json index e051fb64..50e9614c 100644 --- a/packages/redux-devtools/examples/todomvc/package.json +++ b/packages/redux-devtools/examples/todomvc/package.json @@ -2,9 +2,9 @@ "name": "todomvc", "version": "0.0.0", "description": "TodoMVC example for redux", - "main": "server.js", + "main": "index.js", "scripts": { - "start": "node server.js" + "start": "webpack-dev-server --open" }, "repository": { "type": "git", @@ -32,7 +32,7 @@ "prop-types": "^15.7.2", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-hot-loader": "^3.1.3", + "react-hot-loader": "^4.12.21", "react-redux": "^7.2.1", "redux": "^4.0.5", "todomvc-app-css": "^2.3.0" diff --git a/packages/redux-devtools/examples/todomvc/server.js b/packages/redux-devtools/examples/todomvc/server.js deleted file mode 100644 index 85ce31e6..00000000 --- a/packages/redux-devtools/examples/todomvc/server.js +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable no-console */ -var webpack = require('webpack'); -var WebpackDevServer = require('webpack-dev-server'); -var config = require('./webpack.config'); - -new WebpackDevServer(webpack(config), { - publicPath: config.output.publicPath, - hot: true, - historyApiFallback: true, - stats: { - colors: true, - }, -}).listen(3000, 'localhost', function (err) { - if (err) { - console.log(err); - } - - console.log('Listening at localhost:3000'); -}); diff --git a/packages/redux-devtools/examples/todomvc/webpack.config.js b/packages/redux-devtools/examples/todomvc/webpack.config.js index 138d1d86..402c5ac1 100644 --- a/packages/redux-devtools/examples/todomvc/webpack.config.js +++ b/packages/redux-devtools/examples/todomvc/webpack.config.js @@ -7,7 +7,6 @@ module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', - 'react-hot-loader/patch', './index', ], output: { @@ -38,4 +37,9 @@ module.exports = { }, ], }, + devServer: { + historyApiFallback: true, + hot: true, + port: 3000, + }, }; diff --git a/yarn.lock b/yarn.lock index 192902aa..5f38892c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,7 +61,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.11.1", "@babel/core@^7.4.5", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.11.0", "@babel/core@^7.11.1", "@babel/core@^7.4.5", "@babel/core@^7.7.5": version "7.11.1" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.1.tgz#2c55b604e73a40dc21b0e52650b11c65cf276643" integrity sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ== @@ -6745,13 +6745,6 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -error-stack-parser@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-1.3.6.tgz#e0e73b93e417138d1cd7c0b746b1a4a14854c292" - integrity sha1-4Oc7k+QXE40c18C3RrGkoUhUwpI= - dependencies: - stackframe "^0.3.1" - es-abstract@^1.17.0, es-abstract@^1.17.0-next.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.4, es-abstract@^1.17.5: version "1.17.6" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" @@ -13013,11 +13006,6 @@ react-deep-force-update@^1.0.0: resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.2.tgz#3d2ae45c2c9040cbb1772be52f8ea1ade6ca2ee1" integrity sha512-WUSQJ4P/wWcusaH+zZmbECOk7H5N2pOIl0vzheeornkIMhu+qrNdGFm0bDZLCb0hSF0jf/kH1SgkNGfBdTc4wA== -react-deep-force-update@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.1.3.tgz#740612322e617bcced38f61794a4af75dc3d98e7" - integrity sha512-lqD4eHKVuB65RyO/hGbEST53E2/GPbcIPcFYyeW/p4vNngtH4G7jnKGlU6u1OqrFo0uNfIvwuBOg98IbLHlNEA== - react-dev-utils@^6.1.0: version "6.1.1" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-6.1.1.tgz#a07e3e8923c4609d9f27e5af5207e3ca20724895" @@ -13102,16 +13090,19 @@ react-fuzzy@^0.5.2: fuse.js "^3.0.1" prop-types "^15.5.9" -react-hot-loader@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-3.1.3.tgz#6f92877326958c7cb0134b512474517869126082" - integrity sha512-d7nZf78irxoGN5PY4zd6CSgZiroOhvIWzRast3qwTn4sSnBwlt08kV8WMQ9mitmxEdlCTwZt+5ClrRSjxWguMQ== +react-hot-loader@^4.12.21: + version "4.12.21" + resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.21.tgz#332e830801fb33024b5a147d6b13417f491eb975" + integrity sha512-Ynxa6ROfWUeKWsTHxsrL2KMzujxJVPjs385lmB2t5cHUxdoRPGind9F00tOkdc1l5WBleOF4XEAMILY1KPIIDA== dependencies: + fast-levenshtein "^2.0.6" global "^4.3.0" - react-deep-force-update "^2.1.1" - react-proxy "^3.0.0-alpha.0" - redbox-react "^1.3.6" - source-map "^0.6.1" + hoist-non-react-statics "^3.3.0" + loader-utils "^1.1.0" + prop-types "^15.6.1" + react-lifecycles-compat "^3.0.4" + shallowequal "^1.1.0" + source-map "^0.7.3" react-icons@^3.10.0: version "3.10.0" @@ -13195,13 +13186,6 @@ react-proxy@^1.1.7: lodash "^4.6.1" react-deep-force-update "^1.0.0" -react-proxy@^3.0.0-alpha.0: - version "3.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-3.0.0-alpha.1.tgz#4400426bcfa80caa6724c7755695315209fa4b07" - integrity sha1-RABCa8+oDKpnJMd1VpUxUgn6Swc= - dependencies: - lodash "^4.6.1" - react-pure-render@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/react-pure-render/-/react-pure-render-1.0.2.tgz#9d8a928c7f2c37513c2d064e57b3e3c356e9fabb" @@ -13524,16 +13508,6 @@ recursive-readdir@2.2.2: dependencies: minimatch "3.0.4" -redbox-react@^1.3.6: - version "1.6.0" - resolved "https://registry.yarnpkg.com/redbox-react/-/redbox-react-1.6.0.tgz#e753ac02595bc1bf695b3935889a4f5b1b5a21a1" - integrity sha512-mLjM5eYR41yOp5YKHpd3syFeGq6B4Wj5vZr64nbLvTZW5ZLff4LYk7VE4ITpVxkZpCY6OZuqh0HiP3A3uEaCpg== - dependencies: - error-stack-parser "^1.3.6" - object-assign "^4.0.1" - prop-types "^15.5.4" - sourcemapped-stacktrace "^1.1.6" - redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -14600,11 +14574,6 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= - source-map@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" @@ -14627,13 +14596,6 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -sourcemapped-stacktrace@^1.1.6: - version "1.1.11" - resolved "https://registry.yarnpkg.com/sourcemapped-stacktrace/-/sourcemapped-stacktrace-1.1.11.tgz#e2dede7fc148599c52a4f883276e527f8452657d" - integrity sha512-O0pcWjJqzQFVsisPlPXuNawJHHg9N9UgpJ/aDmvi9+vnS3x1C0NhwkVFzzZ1VN0Xo+bekyweoqYvBw5ZBKiNnQ== - dependencies: - source-map "0.5.6" - spawn-promise@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/spawn-promise/-/spawn-promise-0.1.8.tgz#a5bea98814c48f52cbe02720e7fe2d6fc3b5119a" @@ -14775,11 +14737,6 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" -stackframe@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4" - integrity sha1-M6qE8Rd6VUjIk1Uzy/6zQgl19aQ= - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"