Skip to content

Commit b61fc7f

Browse files
authored
feat: add support for npm 7 and Node 16, migrate to graphiql (#1807)
1 parent d9960de commit b61fc7f

File tree

8 files changed

+6674
-6229
lines changed

8 files changed

+6674
-6229
lines changed

.github/workflows/ci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- '**'
99
env:
10-
NODE_VERSION: 16.9.0
10+
NODE_VERSION: 16.10.0
1111
jobs:
1212
check-ci:
1313
name: CI Self-Check
@@ -123,9 +123,8 @@ jobs:
123123
NODE_VERSION: 12.22.6
124124
- name: Node 14
125125
NODE_VERSION: 14.17.6
126-
# Enable the following lines when Parse Dashboard reached Node 16 compatibility
127-
# - name: Node 16
128-
# NODE_VERSION: 16.9.0
126+
- name: Node 16
127+
NODE_VERSION: 16.10.0
129128
fail-fast: false
130129
name: ${{ matrix.name }}
131130
timeout-minutes: 15

package-lock.json

+6,639-6,194
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@
3838
"@babel/runtime": "7.15.4",
3939
"bcryptjs": "2.3.0",
4040
"body-parser": "1.19.0",
41-
"codemirror-graphql": "github:timsuchanek/codemirror-graphql#details-fix",
4241
"commander": "6.2.1",
4342
"connect-flash": "0.1.1",
4443
"cookie-session": "2.0.0-beta.3",
4544
"copy-to-clipboard": "3.2.0",
4645
"create-react-class": "15.7.0",
4746
"csurf": "1.11.0",
4847
"express": "4.17.1",
49-
"graphql": "14.6.0",
50-
"graphql-playground-react": "1.7.20",
48+
"graphiql": "1.4.2",
49+
"graphql": "15.4.0",
5150
"history": "4.10.1",
5251
"immutable": "4.0.0-rc.9",
5352
"immutable-devtools": "0.1.5",
@@ -56,7 +55,7 @@
5655
"json-file-plus": "3.2.0",
5756
"otpauth": "7.0.5",
5857
"package-json": "6.5.0",
59-
"parse": "3.3.0",
58+
"parse": "3.3.1",
6059
"passport": "0.4.1",
6160
"passport-local": "1.0.0",
6261
"prismjs": "1.25.0",
@@ -75,7 +74,8 @@
7574
"react-router": "5.2.1",
7675
"react-router-dom": "5.2.1",
7776
"regenerator-runtime": "0.13.8",
78-
"semver": "7.3.4"
77+
"semver": "7.3.4",
78+
"typescript": "4.4.3"
7979
},
8080
"devDependencies": {
8181
"@actions/core": "1.2.6",
@@ -106,19 +106,19 @@
106106
"jest": "24.8.0",
107107
"madge": "5.0.1",
108108
"marked": "0.8.2",
109-
"node-sass": "5.0.0",
110-
"null-loader": "3.0.0",
109+
"node-sass": "6.0.0",
110+
"null-loader": "4.0.1",
111111
"path-to-regexp": "3.2.0",
112112
"puppeteer": "3.0.0",
113113
"react-test-renderer": "16.13.1",
114114
"request": "2.88.2",
115115
"request-promise": "4.2.5",
116-
"sass-loader": "10.1.1",
116+
"sass-loader": "11.1.1",
117117
"semantic-release": "17.4.6",
118118
"style-loader": "1.1.2",
119119
"svg-prep": "1.0.4",
120-
"webpack": "4.42.1",
121-
"webpack-cli": "3.3.10",
120+
"webpack": "5.53.0",
121+
"webpack-cli": "4.0.0",
122122
"yaml": "1.10.0"
123123
},
124124
"scripts": {
@@ -141,7 +141,7 @@
141141
"parse-dashboard": "./bin/parse-dashboard"
142142
},
143143
"engines": {
144-
"node": ">=12.0.0 <16.0.0"
144+
"node": ">=12.0.0"
145145
},
146146
"main": "Parse-Dashboard/app.js",
147147
"jest": {

src/dashboard/Data/ApiConsole/ApiConsole.scss

-12
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@
2626
height: calc(100vh - 96px);
2727
margin-top: 96px;
2828
overflow: hidden;
29-
30-
// Workaround to override graphql-playground-react
31-
// animations and query editor height
32-
& > div:not(.empty) > div {
33-
opacity: 1;
34-
transform: unset;
35-
animation: unset;
36-
37-
& > div > :nth-child(2){
38-
height: calc(100vh - 153px);
39-
}
40-
}
4129
}
4230

4331
.empty {

src/dashboard/Data/ApiConsole/GraphQLConsole.react.js

+18-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import ParseApp from 'lib/ParseApp';
99
import PropTypes from 'lib/PropTypes';
1010
import React, { Component } from 'react';
11-
import { Provider } from 'react-redux'
12-
import { Playground, store } from 'graphql-playground-react';
11+
import GraphiQL from 'graphiql';
1312
import EmptyState from 'components/EmptyState/EmptyState.react';
1413
import Toolbar from 'components/Toolbar/Toolbar.react';
1514
import styles from 'dashboard/Data/ApiConsole/ApiConsole.scss';
@@ -38,9 +37,23 @@ export default class GraphQLConsole extends Component {
3837
headers['X-Parse-Client-Key'] = clientKey
3938
}
4039
content = (
41-
<Provider store={store}>
42-
<Playground endpoint={graphQLServerURL} headers={headers} />
43-
</Provider>
40+
<GraphiQL
41+
fetcher={async graphQLParams => {
42+
const data = await fetch(
43+
graphQLServerURL,
44+
{
45+
method: 'POST',
46+
headers: {
47+
Accept: 'application/json',
48+
'Content-Type': 'application/json',
49+
...headers
50+
},
51+
body: JSON.stringify(graphQLParams),
52+
},
53+
);
54+
return data.json().catch(() => data.text());
55+
}}
56+
/>
4457
);
4558
}
4659

src/dashboard/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'core-js/stable';
1414
import 'regenerator-runtime/runtime';
1515

1616
require('stylesheets/fonts.scss');
17-
require('graphql-playground-react/build/static/css/index.css')
17+
require('graphiql/graphiql.min.css')
1818
installDevTools(Immutable);
1919

2020
var path = window.PARSE_DASHBOARD_PATH || '/';

webpack/base.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
exclude: /node_modules/,
3636
use: {
3737
loader: 'babel-loader',
38-
query: {
38+
options: {
3939
plugins: [['@babel/plugin-proposal-decorators', { 'legacy': true }], '@babel/transform-regenerator', '@babel/transform-runtime'],
4040
presets: ['@babel/preset-react', '@babel/preset-env']
4141
},

webpack/plugins/svg-prep.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function SvgPrepPlugin(options) {
2323
}
2424

2525
SvgPrepPlugin.prototype.apply = function(compiler) {
26-
compiler.plugin('emit', (compilation, callback) => {
26+
compiler.hooks.emit.tapAsync('SvgPrepPlugin', (compilation, callback) => {
2727
if (!this.options.source) {
2828
return callback();
2929
}

0 commit comments

Comments
 (0)