Skip to content

Commit b131947

Browse files
authored
chore(package): upgrade to react-hot-loader 4 (Semantic-Org#2783)
1 parent ed935f8 commit b131947

File tree

4 files changed

+34
-54
lines changed

4 files changed

+34
-54
lines changed

docs/app/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
3+
import { AppContainer } from 'react-hot-loader'
34

45
import Router from './routes'
56

@@ -10,7 +11,13 @@ import Router from './routes'
1011
const mountNode = document.createElement('div')
1112
document.body.appendChild(mountNode)
1213

13-
const render = NewApp => ReactDOM.render(<NewApp />, mountNode)
14+
const render = NewApp =>
15+
ReactDOM.render(
16+
<AppContainer>
17+
<NewApp />
18+
</AppContainer>,
19+
mountNode,
20+
)
1421

1522
// ----------------------------------------
1623
// HMR

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"react-docgen": "^2.17.0",
146146
"react-document-title": "^2.0.3",
147147
"react-dom": "^16.0.0",
148-
"react-hot-loader": "^3.0.0-beta.7",
148+
"react-hot-loader": "^4.1.3",
149149
"react-router": "^4.1.2",
150150
"react-router-dom": "^4.1.2",
151151
"react-test-renderer": "^16.0.0",

webpack.config.babel.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const APP_ENTRY = paths.docsSrc('index.js')
4646

4747
webpackConfig.entry = __DEV__
4848
? {
49-
app: ['react-hot-loader/patch', webpackHotMiddlewareEntry, APP_ENTRY],
49+
app: [webpackHotMiddlewareEntry, APP_ENTRY],
5050
vendor: [webpackHotMiddlewareEntry, ...config.compiler_vendor],
5151
}
5252
: {
@@ -108,7 +108,10 @@ if (!__TEST__) {
108108
}
109109

110110
if (__DEV__) {
111-
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin())
111+
webpackConfig.plugins.push(
112+
new webpack.HotModuleReplacementPlugin(),
113+
new webpack.NoEmitOnErrorsPlugin(),
114+
)
112115
}
113116

114117
if (__PROD__) {
@@ -170,10 +173,10 @@ const jsLoaders = [
170173
loader: 'babel-loader',
171174
options: {
172175
cacheDirectory: true,
176+
plugins: __DEV__ ? ['react-hot-loader/babel'] : [],
173177
},
174178
},
175179
]
176-
if (__DEV__) jsLoaders.unshift('react-hot-loader/webpack')
177180

178181
webpackConfig.module.rules = [
179182
...webpackConfig.module.rules,

yarn.lock

+19-49
Original file line numberDiff line numberDiff line change
@@ -3059,12 +3059,6 @@ error-ex@^1.2.0, error-ex@^1.3.1:
30593059
dependencies:
30603060
is-arrayish "^0.2.1"
30613061

3062-
error-stack-parser@^1.3.6:
3063-
version "1.3.6"
3064-
resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-1.3.6.tgz#e0e73b93e417138d1cd7c0b746b1a4a14854c292"
3065-
dependencies:
3066-
stackframe "^0.3.1"
3067-
30683062
es-abstract@^1.6.1, es-abstract@^1.7.0:
30693063
version "1.10.0"
30703064
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
@@ -3606,7 +3600,7 @@ fast-json-stable-stringify@^2.0.0:
36063600
version "2.0.0"
36073601
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
36083602

3609-
fast-levenshtein@~2.0.4:
3603+
fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.4:
36103604
version "2.0.6"
36113605
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
36123606

@@ -4490,6 +4484,10 @@ hoist-non-react-statics@^2.3.0:
44904484
version "2.3.1"
44914485
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"
44924486

4487+
hoist-non-react-statics@^2.5.0:
4488+
version "2.5.0"
4489+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
4490+
44934491
home-or-tmp@^3.0.0:
44944492
version "3.0.0"
44954493
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb"
@@ -5918,7 +5916,7 @@ lodash@^3.8.0:
59185916
version "3.10.1"
59195917
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
59205918

5921-
lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.6.1, lodash@~4.17.4:
5919+
lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.4:
59225920
version "4.17.4"
59235921
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
59245922

@@ -7342,10 +7340,6 @@ react-ace@^5.1.2:
73427340
lodash.isequal "^4.1.1"
73437341
prop-types "^15.5.8"
73447342

7345-
react-deep-force-update@^2.1.1:
7346-
version "2.1.1"
7347-
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.1.1.tgz#8ea4263cd6455a050b37445b3f08fd839d86e909"
7348-
73497343
react-docgen@^2.17.0:
73507344
version "2.20.0"
73517345
resolved "https://registry.yarnpkg.com/react-docgen/-/react-docgen-2.20.0.tgz#41a6da483a34a4aaed041a9909f5e61864d681cb"
@@ -7374,21 +7368,20 @@ react-dom@^16.0.0:
73747368
object-assign "^4.1.1"
73757369
prop-types "^15.6.0"
73767370

7377-
react-hot-loader@^3.0.0-beta.7:
7378-
version "3.1.3"
7379-
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-3.1.3.tgz#6f92877326958c7cb0134b512474517869126082"
7371+
react-hot-loader@^4.1.3:
7372+
version "4.1.3"
7373+
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.1.3.tgz#b4ceca7961cc08451f8199a24a5753a749edd9ce"
73807374
dependencies:
7375+
fast-levenshtein "^2.0.6"
73817376
global "^4.3.0"
7382-
react-deep-force-update "^2.1.1"
7383-
react-proxy "^3.0.0-alpha.0"
7384-
redbox-react "^1.3.6"
7385-
source-map "^0.6.1"
7377+
hoist-non-react-statics "^2.5.0"
7378+
prop-types "^15.6.1"
7379+
react-lifecycles-compat "^3.0.2"
7380+
shallowequal "^1.0.2"
73867381

7387-
react-proxy@^3.0.0-alpha.0:
7388-
version "3.0.0-alpha.1"
7389-
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-3.0.0-alpha.1.tgz#4400426bcfa80caa6724c7755695315209fa4b07"
7390-
dependencies:
7391-
lodash "^4.6.1"
7382+
react-lifecycles-compat@^3.0.2:
7383+
version "3.0.4"
7384+
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
73927385

73937386
react-router-dom@^4.1.2:
73947387
version "4.2.2"
@@ -7534,15 +7527,6 @@ rechoir@^0.6.2:
75347527
dependencies:
75357528
resolve "^1.1.6"
75367529

7537-
redbox-react@^1.3.6:
7538-
version "1.5.0"
7539-
resolved "https://registry.yarnpkg.com/redbox-react/-/redbox-react-1.5.0.tgz#04dab11557d26651bf3562a67c22ace56c5d3967"
7540-
dependencies:
7541-
error-stack-parser "^1.3.6"
7542-
object-assign "^4.0.1"
7543-
prop-types "^15.5.4"
7544-
sourcemapped-stacktrace "^1.1.6"
7545-
75467530
redent@^1.0.0:
75477531
version "1.0.0"
75487532
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
@@ -8147,7 +8131,7 @@ sha.js@^2.4.0, sha.js@^2.4.8:
81478131
inherits "^2.0.1"
81488132
safe-buffer "^5.0.1"
81498133

8150-
shallowequal@^1.0.1:
8134+
shallowequal@^1.0.1, shallowequal@^1.0.2:
81518135
version "1.0.2"
81528136
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.0.2.tgz#1561dbdefb8c01408100319085764da3fcf83f8f"
81538137

@@ -8328,10 +8312,6 @@ source-map-url@^0.4.0:
83288312
version "0.4.0"
83298313
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
83308314

8331-
8332-
version "0.5.6"
8333-
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
8334-
83358315
[email protected], source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1:
83368316
version "0.5.7"
83378317
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
@@ -8348,7 +8328,7 @@ source-map@^0.4.2, source-map@^0.4.4:
83488328
dependencies:
83498329
amdefine ">=0.0.4"
83508330

8351-
source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
8331+
source-map@^0.6.0, source-map@~0.6.1:
83528332
version "0.6.1"
83538333
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
83548334

@@ -8358,12 +8338,6 @@ source-map@~0.2.0:
83588338
dependencies:
83598339
amdefine ">=0.0.4"
83608340

8361-
sourcemapped-stacktrace@^1.1.6:
8362-
version "1.1.7"
8363-
resolved "https://registry.yarnpkg.com/sourcemapped-stacktrace/-/sourcemapped-stacktrace-1.1.7.tgz#17e05374ff78b71a9d89ad3975a49f22725ba935"
8364-
dependencies:
8365-
source-map "0.5.6"
8366-
83678341
sparkles@^1.0.0:
83688342
version "1.0.0"
83698343
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3"
@@ -8414,10 +8388,6 @@ stack-utils@^1.0.1:
84148388
version "1.0.1"
84158389
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620"
84168390

8417-
stackframe@^0.3.1:
8418-
version "0.3.1"
8419-
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4"
8420-
84218391
84228392
version "1.1.1"
84238393
resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b"

0 commit comments

Comments
 (0)