Skip to content

Commit

Permalink
Setup react fast refresh config & remove react-hot-loader (#9509)
Browse files Browse the repository at this point in the history
Setup react fast refresh config & remove react-hot-loader
  • Loading branch information
charrondev committed Nov 2, 2019
2 parents 5a76ebb + 1b1f249 commit 4d5d3b7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 38 deletions.
2 changes: 1 addition & 1 deletion build/scripts/Builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ${chalk.yellowBright("$Configuration['HotReload']['Enabled'] = true;")}`);
const devServerOptions: DevServerConfiguration = {
host: this.options.devIp,
port: 3030,
hot: true,
hotOnly: true,
open: false,
https: false,
disableHostCheck: true,
Expand Down
4 changes: 1 addition & 3 deletions build/scripts/configs/makeBaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ ${chalk.green(aliases)}`;
const hotLoaders: any[] = [];
const hotAliases: any = {};
if (options.mode === BuildMode.DEVELOPMENT) {
babelPlugins.push(require.resolve("react-hot-loader/babel"));
hotLoaders.push(require.resolve("react-hot-loader/webpack"));
hotAliases["react-dom"] = require.resolve("@hot-loader/react-dom");
babelPlugins.push(require.resolve("react-refresh/babel"));
}

// Leaving this out until we get the docs actually generating. Huge slowdown.
Expand Down
2 changes: 2 additions & 0 deletions build/scripts/configs/makeDevConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @license GPL-2.0-only
*/

const ReactRefreshPlugin = require("react-refresh-webpack-plugin");
import webpack, { Configuration } from "webpack";
import { makeBaseConfig } from "./makeBaseConfig";
import EntryModel from "../utility/EntryModel";
Expand Down Expand Up @@ -33,6 +34,7 @@ export async function makeDevConfig(entryModel: EntryModel, section: string) {
splitChunks: false,
};
baseConfig.plugins!.push(new webpack.HotModuleReplacementPlugin());
baseConfig.plugins!.push(new ReactRefreshPlugin());

return baseConfig;
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"p-debounce": "1.0.0",
"path-to-regexp": "3.0.0",
"qs": "6.7.0",
"react": "16.8.6",
"react": "^16.9.0",
"react-aria-live": "2.0.4",
"react-autosize-textarea": "^7.0.0",
"react-day-picker": "7.2.4",
"react-dom": "16.8.6",
"react-dom": "^16.9.0",
"react-loadable": "5.5.0",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
Expand All @@ -64,7 +64,7 @@
"devDependencies": {
"@babel/core": "^7.6.2",
"@emotion/core": "^10.0.7",
"@hot-loader/react-dom": "^16.8.6",
"@hot-loader/react-dom": "^16.9.0",
"@storybook/addon-a11y": "^5.2.1",
"@storybook/addon-actions": "^5.2.1",
"@storybook/addon-knobs": "^5.2.1",
Expand Down Expand Up @@ -141,6 +141,8 @@
"react-docgen-typescript-loader": "^3.1.0",
"react-docgen-typescript-webpack-plugin": "^1.1.0",
"react-hot-loader": "^4.8.4",
"react-refresh": "^0.6.0",
"react-refresh-webpack-plugin": "https://github.com/vanilla/react-refresh-webpack-plugin#6b483ff",
"sass": "^1.20.1",
"sass-loader": "^7.1.0",
"sinon": "^7.3.2",
Expand Down
75 changes: 44 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@
unique-filename "^1.1.1"
which "^1.3.1"

"@hot-loader/react-dom@^16.8.6":
"@hot-loader/react-dom@^16.9.0":
version "16.10.2"
resolved "https://registry.yarnpkg.com/@hot-loader/react-dom/-/react-dom-16.10.2.tgz#91920442252acac6f343eef5df41aca333f7dcea"
integrity sha512-vbrSDuZMoE1TXiDNAVCSAcIS6UX55Fa9KF0MD0wQgOaOIPZs/C6CtEDUcnNFEwTQ5ciIULcp+96lQlSuANNagA==
Expand Down Expand Up @@ -15332,7 +15332,7 @@ react-day-picker@7.2.4:
dependencies:
prop-types "^15.6.2"

react-dev-utils@^9.0.0:
react-dev-utils@^9.0.0, react-dev-utils@^9.0.3:
version "9.1.0"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.1.0.tgz#3ad2bb8848a32319d760d0a84c56c14bdaae5e81"
integrity sha512-X2KYF/lIGyGwP/F/oXgGDF24nxDA2KC4b7AFto+eqzc/t838gpSGiaU8trTqHXOohuLxxc5qi1eDzsl9ucPDpg==
Expand Down Expand Up @@ -15398,16 +15398,6 @@ react-docgen@^4.1.0:
node-dir "^0.1.10"
recast "^0.17.3"

react-dom@16.8.6:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.6"

react-dom@^16.8.3:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.2.tgz#4840bce5409176bc3a1f2bd8cb10b92db452fda6"
Expand All @@ -15418,6 +15408,16 @@ react-dom@^16.8.3:
prop-types "^15.6.2"
scheduler "^0.16.2"

react-dom@^16.9.0:
version "16.11.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5"
integrity sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.17.0"

react-draggable@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.0.3.tgz#6b9f76f66431c47b9070e9b805bbc520df8ca481"
Expand All @@ -15426,7 +15426,7 @@ react-draggable@^4.0.3:
classnames "^2.2.5"
prop-types "^15.6.0"

react-error-overlay@^6.0.3:
react-error-overlay@^6.0.1, react-error-overlay@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.3.tgz#c378c4b0a21e88b2e159a3e62b2f531fd63bf60d"
integrity sha512-bOUvMWFQVk5oz8Ded9Xb7WVdEi3QGLC8tH7HmYP0Fdp4Bn3qw0tRFmr5TW6mvahzvmrK4a6bqWGfCevBflP+Xw==
Expand Down Expand Up @@ -15561,6 +15561,20 @@ react-redux@^7.0.2, react-redux@^7.1.0:
prop-types "^15.7.2"
react-is "^16.9.0"

"react-refresh-webpack-plugin@https://github.com/vanilla/react-refresh-webpack-plugin#6b483ff":
version "0.1.0"
resolved "https://github.com/vanilla/react-refresh-webpack-plugin#6b483ff24526a63e6a6fe3cadffe6e2e74ac21d9"
dependencies:
react-dev-utils "^9.0.3"
react-error-overlay "^6.0.1"
sockjs-client "^1.4.0"
strip-ansi "^5.2.0"

react-refresh@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.6.0.tgz#81971b8f3c8c05aaa6ce87491ae41b396133f896"
integrity sha512-Wv48N+GFt6Azvtl/LMvzNW9hvEyJdRQ48oVKIBAN7hjtvXXfxfVJXbPl/11SM1C/NIquIFXzzWCo6ZNH0I8I4g==

react-router-dom@^5.1.0:
version "5.1.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.1.2.tgz#06701b834352f44d37fbb6311f870f84c76b9c18"
Expand Down Expand Up @@ -15693,20 +15707,19 @@ react-virtualized@9.21.0:
prop-types "^15.6.0"
react-lifecycles-compat "^3.0.4"

react@16.8.6:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
react@^16.8.3:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.10.2.tgz#a5ede5cdd5c536f745173c8da47bda64797a4cf0"
integrity sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.6"

react@^16.8.3:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.10.2.tgz#a5ede5cdd5c536f745173c8da47bda64797a4cf0"
integrity sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==
react@^16.9.0:
version "16.11.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb"
integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
Expand Down Expand Up @@ -16442,14 +16455,6 @@ sax@^1.2.4, sax@~1.2.1, sax@~1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

scheduler@^0.13.6:
version "0.13.6"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

scheduler@^0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.2.tgz#f74cd9d33eff6fc554edfb79864868e4819132c1"
Expand All @@ -16458,6 +16463,14 @@ scheduler@^0.16.2:
loose-envify "^1.1.0"
object-assign "^4.1.1"

scheduler@^0.17.0:
version "0.17.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe"
integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
Expand Down Expand Up @@ -16865,7 +16878,7 @@ socket.io@2.1.1:
socket.io-client "2.1.1"
socket.io-parser "~3.2.0"

sockjs-client@1.4.0:
sockjs-client@1.4.0, sockjs-client@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.4.0.tgz#c9f2568e19c8fd8173b4997ea3420e0bb306c7d5"
integrity sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==
Expand Down

0 comments on commit 4d5d3b7

Please sign in to comment.