Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gatsby): upgrade @pmmmwh/react-refresh-webpack-plugin #36360

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@babel/cli": "^7.15.4",
"@babel/core": "^7.15.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"babel-preset-gatsby-package": "^2.22.0-next.0",
"cross-env": "^7.0.3",
"preact": "^10.6.4"
Expand Down Expand Up @@ -46,4 +46,4 @@
"engines": {
"node": ">=14.15.0"
}
}
}
3 changes: 3 additions & 0 deletions packages/gatsby/cache-dir/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// needed for fast refresh
import "@gatsbyjs/webpack-hot-middleware/client"
Comment on lines +1 to +2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously refresh plugin would automatically fallback to importing client and using it. After https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/337/files#diff-5425e895a25e9446e7307d31bc2cf26e1a77778571d76656d3b10876e9e48871 hot middleware client needs to be initialized elsewhere in the app and react-refresh will hook up to it (if available)

We can do it here as first import, or follow example and have it in our webpack entry ( https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/5b0ef9b2ee2fb2f4323df3ec628c26b9c72bf0c7/examples/webpack-hot-middleware/webpack.config.js#L10-L12 )


/* global HAS_REACT_18 */
import React from "react"
import ReactDOM from "react-dom"
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@jridgewell/trace-mapping": "^0.3.13",
"@nodelib/fs.walk": "^1.2.8",
"@parcel/core": "2.6.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@types/http-proxy": "^1.17.7",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
Expand Down Expand Up @@ -272,4 +272,4 @@
"yargs": {
"boolean-negation": false
}
}
}
47 changes: 24 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4187,16 +4187,19 @@
chrome-trace-event "^1.0.2"
nullthrows "^1.1.1"

"@pmmmwh/react-refresh-webpack-plugin@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.3.tgz#1eec460596d200c0236bf195b078a5d1df89b766"
integrity sha512-br5Qwvh8D2OQqSXpd1g/xqXKnK0r+Jz6qVKBbWmpUcrbGOxUrf39V5oZ1876084CGn18uMdR5uvPqBv9UqtBjQ==
"@pmmmwh/react-refresh-webpack-plugin@^0.5.7":
version "0.5.7"
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz#58f8217ba70069cc6a73f5d7e05e85b458c150e2"
integrity sha512-bcKCAzF0DV2IIROp9ZHkRJa6O4jy7NlnHdWL3GmcUxYWNjLXkK5kfELELwEfSP5hXPfVL/qOGMAROuMQb9GG8Q==
dependencies:
ansi-html "^0.0.7"
ansi-html-community "^0.0.8"
common-path-prefix "^3.0.0"
core-js-pure "^3.8.1"
error-stack-parser "^2.0.6"
html-entities "^1.2.1"
native-url "^0.2.6"
schema-utils "^2.6.5"
find-up "^5.0.0"
html-entities "^2.1.0"
loader-utils "^2.0.0"
schema-utils "^3.0.0"
source-map "^0.7.3"

"@prefresh/babel-plugin@^0.4.3":
Expand Down Expand Up @@ -5904,7 +5907,7 @@ ansi-escapes@^4.2.1, ansi-escapes@^4.3.0:
dependencies:
type-fest "^0.11.0"

ansi-html-community@0.0.8:
ansi-html-community@0.0.8, ansi-html-community@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41"
integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==
Expand Down Expand Up @@ -8056,6 +8059,11 @@ common-path-prefix@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-1.0.0.tgz#cd52f6f0712e0baab97d6f9732874f22f47752c0"

common-path-prefix@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0"
integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==

common-tags@1.8.2, common-tags@^1.8.0, common-tags@^1.8.2:
version "1.8.2"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6"
Expand Down Expand Up @@ -8573,6 +8581,11 @@ core-js-pure@^3.0.0:
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.4.tgz#4bf1ba866e25814f149d4e9aaa08c36173506e3a"
integrity sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==

core-js-pure@^3.8.1:
version "3.24.1"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.24.1.tgz#8839dde5da545521bf282feb7dc6d0b425f39fd3"
integrity sha512-r1nJk41QLLPyozHUUPmILCEMtMw24NG4oWK6RbsDdjzQgg9ZvrUsPBj1MnG0wXXp1DCDU6j+wUvEmBSrtRbLXg==

core-js@3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.9.0.tgz#790b1bb11553a2272b36e2625c7179db345492f8"
Expand Down Expand Up @@ -13087,12 +13100,7 @@ html-encoding-sniffer@^2.0.1:
dependencies:
whatwg-encoding "^1.0.5"

html-entities@^1.2.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.3.1.tgz#fb9a1a4b5b14c5daba82d3e34c6ae4fe701a0e44"
integrity sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA==

html-entities@^2.3.3:
html-entities@^2.1.0, html-entities@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46"
integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==
Expand Down Expand Up @@ -17866,13 +17874,6 @@ napi-macros@~2.0.0:
resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b"
integrity sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==

native-url@^0.2.6:
version "0.2.6"
resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.2.6.tgz#ca1258f5ace169c716ff44eccbddb674e10399ae"
integrity sha512-k4bDC87WtgrdD362gZz6zoiXQrl40kYlBmpfmSjwRO1VU0V5ccwJTlxuE72F6m3V0vc1xOf6n3UCP9QyerRqmA==
dependencies:
querystring "^0.2.0"

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down Expand Up @@ -20618,7 +20619,7 @@ query-string@^6.14.1, query-string@^6.8.2:
split-on-first "^1.0.0"
strict-uri-encode "^2.0.0"

querystring@0.2.0, querystring@^0.2.0:
querystring@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"

Expand Down