Skip to content

Commit 39c4987

Browse files
chore(deps): update [dev] minor and patch dependencies for gatsby-graphiql-explorer (#38279)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: LekoArts <[email protected]>
1 parent 1ebae56 commit 39c4987

File tree

5 files changed

+589
-279
lines changed

5 files changed

+589
-279
lines changed

packages/gatsby-graphiql-explorer/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@
3838
"@babel/plugin-transform-runtime": "^7.19.6",
3939
"@babel/preset-env": "^7.20.2",
4040
"@babel/preset-react": "^7.18.6",
41-
"@graphiql/plugin-code-exporter": "^0.1.2",
42-
"@graphiql/plugin-explorer": "^0.1.20",
43-
"@graphiql/react": "^0.17.6",
41+
"@graphiql/plugin-code-exporter": "^0.2.0",
42+
"@graphiql/plugin-explorer": "^0.2.0",
43+
"@graphiql/react": "^0.18.0",
4444
"@graphiql/toolkit": "^0.8.4",
45-
"babel-loader": "^8.3.0",
45+
"babel-loader": "^9.1.2",
4646
"babel-preset-gatsby-package": "^3.12.0-next.0",
4747
"core-js": "^3.30.2",
4848
"cross-env": "^7.0.3",
4949
"css-loader": "^6.8.1",
5050
"del-cli": "^5.0.0",
51-
"graphiql": "^2.4.7",
52-
"html-webpack-plugin": "^5.5.1",
51+
"graphiql": "^3.0.0",
52+
"html-webpack-plugin": "^5.5.3",
5353
"npm-run-all": "4.1.5",
5454
"react": "^18.2.0",
5555
"react-dom": "^18.2.0",
5656
"regenerator-runtime": "^0.13.11",
5757
"style-loader": "^3.3.3",
58-
"webpack": "^5.85.0",
59-
"webpack-cli": "^4.10.0"
58+
"webpack": "^5.88.1",
59+
"webpack-cli": "^5.1.4"
6060
},
6161
"engines": {
6262
"node": ">=18.0.0"

packages/gatsby-graphiql-explorer/src/app.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import regeneratorRuntime from "regenerator-runtime"
33

44
import * as React from "react"
5-
import ReactDOM from "react-dom"
5+
import { createRoot } from "react-dom/client"
66
import { GraphiQL } from "graphiql"
77
import { getIntrospectionQuery } from "graphql"
88
import { useExplorerPlugin } from "@graphiql/plugin-explorer"
@@ -179,12 +179,12 @@ const App = ({ initialExternalFragments }) => {
179179
)
180180
}
181181

182+
const container = document.getElementById(`root`)
183+
const root = createRoot(container)
184+
182185
// crude way to fetch fragments on boot time
183186
// it won't hot reload fragments (refresh required)
184187
// but good enough for initial integration
185188
fetchFragments().then(initialExternalFragments => {
186-
ReactDOM.render(
187-
<App initialExternalFragments={initialExternalFragments} />,
188-
document.getElementById(`root`)
189-
)
189+
root.render(<App initialExternalFragments={initialExternalFragments} />)
190190
})

packages/gatsby-graphiql-explorer/src/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const webpack = require(`webpack`)
44

55
const mode = `production`
66

7+
/** @type { import('webpack').Configuration } */
78
module.exports = {
89
entry: path.join(__dirname, `app.jsx`),
910
mode,

packages/gatsby/src/utils/webpack/plugins/partial-hydration.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,16 @@ export class PartialHydrationPlugin {
449449
}
450450
}
451451

452-
for (const cssModule of modulesToInsertIntoApp.sort(
453-
(a, b) =>
454-
compilation.moduleGraph.getPostOrderIndex(a) -
455-
compilation.moduleGraph.getPostOrderIndex(b)
456-
)) {
452+
for (const cssModule of modulesToInsertIntoApp.sort((a, b) => {
453+
const _a = compilation.moduleGraph.getPostOrderIndex(a)
454+
const _b = compilation.moduleGraph.getPostOrderIndex(b)
455+
456+
if (!_a || !_b) {
457+
return 0
458+
} else {
459+
return _a - _b
460+
}
461+
})) {
457462
compilation.chunkGraph.connectChunkAndModule(appChunk, cssModule)
458463

459464
for (const group of appChunk.groupsIterable) {

0 commit comments

Comments
 (0)