Skip to content

Commit ea161ce

Browse files
authored
feat(gatsby-graphiql-explorer): upgrade to webpack 5 (#30642)
1 parent 944e381 commit ea161ce

File tree

6 files changed

+353
-994
lines changed

6 files changed

+353
-994
lines changed

e2e-tests/development-runtime/cypress/integration/functionality/graphql-endpoint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe(`The GraphQL endpoint`, () => {
1313
it(`Should appear on ${endpoint}`, () => {
1414
cy.visit(endpoint)
1515
cy.get(`.graphiql-container`).should(`be.visible`)
16-
cy.title().should(`eq`, `GraphiQL`)
16+
cy.title().should(`eq`, `Gatsby - GraphiQL`)
1717
})
1818

1919
it(`Should execute queries from query string on ${endpoint}`, () => {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/*.js
22
/*.html
33
yarn.lock
4+
app.js.LICENSE.txt

packages/gatsby-graphiql-explorer/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"license": "MIT",
3030
"dependencies": {
31-
"@babel/runtime": "^7.14.8"
31+
"@babel/runtime": "^7.15.3"
3232
},
3333
"devDependencies": {
3434
"@babel/cli": "^7.14.8",
@@ -41,19 +41,19 @@
4141
"babel-preset-gatsby-package": "^1.13.0-next.0",
4242
"core-js": "^3.8.1",
4343
"cross-env": "^7.0.3",
44-
"css-loader": "^1.0.1",
45-
"graphiql": "^1.3.2",
44+
"css-loader": "^5.2.0",
45+
"graphiql": "^1.4.0",
4646
"graphiql-code-exporter": "^3.0.3",
47-
"graphiql-explorer": "^0.6.2",
48-
"html-webpack-plugin": "^3.2.0",
47+
"graphiql-explorer": "^0.6.3",
48+
"html-webpack-plugin": "^5.3.2",
4949
"npm-run-all": "4.1.5",
5050
"react": "^16.12.0",
5151
"react-dom": "^16.12.0",
5252
"regenerator-runtime": "^0.13.7",
53-
"style-loader": "^0.23.1",
54-
"webpack": "^4.44.2",
55-
"webpack-cli": "^3.3.12",
56-
"whatwg-fetch": "^3.5.0"
53+
"style-loader": "^3.2.1",
54+
"webpack": "^5.51.1",
55+
"webpack-cli": "^4.8.0",
56+
"whatwg-fetch": "^3.6.2"
5757
},
5858
"engines": {
5959
"node": ">=12.13.0"

packages/gatsby-graphiql-explorer/src/app/index.ejs

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
<html>
33
<head>
44
<meta charset="UTF-8" />
5-
<title>GraphiQL</title>
5+
<title>Gatsby - GraphiQL</title>
66
<meta name="robots" content="noindex" />
77
<meta name="referrer" content="origin" />
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<%= htmlWebpackPlugin.tags.headTags %>
910
</head>
1011
<body>
1112
<div id="root" class="graphiql-container">Loading...</div>
12-
<script
13-
type="text/javascript"
14-
src="/___graphql/<%= htmlWebpackPlugin.files.chunks.main.entry %>?<%= htmlWebpackPlugin.files.chunks.main.hash %>"
15-
></script>
13+
<%= htmlWebpackPlugin.tags.bodyTags %>
1614
</body>
1715
</html>

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
output: {
1010
path: path.join(__dirname, `..`, `..`),
1111
filename: `./app.js`,
12+
publicPath: `/___graphql`,
1213
},
1314
devtool: false,
1415
module: {
@@ -25,8 +26,9 @@ module.exports = {
2526
{
2627
corejs: 3,
2728
loose: true,
29+
bugfixes: true,
2830
modules: `commonjs`,
29-
useBuiltIns: `usage`,
31+
useBuiltIns: `entry`,
3032
targets: [`>0.25%`, `not dead`],
3133
},
3234
],

0 commit comments

Comments
 (0)