Skip to content

Commit 9eb0115

Browse files
authored
Merge pull request #21 from pauleramirez/final-build
remove codemirror graphql dependencies
2 parents 0932dac + ef563ba commit 9eb0115

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

src/client/components/composer/NewRequest/GraphQLBodyEntryForm.jsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import "codemirror/theme/twilight.css";
66
import "codemirror/lib/codemirror.css";
77
import "codemirror/addon/hint/show-hint";
88
import "codemirror/addon/hint/show-hint.css";
9-
import "codemirror-graphql/hint";
10-
import "codemirror-graphql/lint";
11-
import "codemirror-graphql/mode";
9+
// import "codemirror-graphql/hint";
10+
// import "codemirror-graphql/lint";
11+
// import "codemirror-graphql/mode";
1212
import "codemirror/addon/lint/lint.css";
1313

1414
const GraphQLBodyEntryForm = (props) => {
@@ -25,19 +25,14 @@ const GraphQLBodyEntryForm = (props) => {
2525

2626
// set a new value for codemirror only if loading from history or changing query type
2727
useEffect(() => {
28-
if (!bodyIsNew) setValue(bodyContent)
29-
}, [bodyContent])
30-
31-
28+
if (!bodyIsNew) setValue(bodyContent);
29+
}, [bodyContent]);
3230

3331
return (
3432
<div className="mt-3">
35-
{ // conditionally render warning message
36-
warningMessage ?
37-
<div >
38-
{warningMessage.body}
39-
</div>
40-
: null
33+
{
34+
// conditionally render warning message
35+
warningMessage ? <div>{warningMessage.body}</div> : null
4136
}
4237
<div className="composer-section-title">Body</div>
4338
<div id="gql-body-entry" className="is-neutral-200-box p-3">
@@ -55,12 +50,14 @@ const GraphQLBodyEntryForm = (props) => {
5550
indentUnit: 2,
5651
tabSize: 2,
5752
}}
58-
editorDidMount={editor => { editor.setSize('100%', 150) }}
53+
editorDidMount={(editor) => {
54+
editor.setSize("100%", 150);
55+
}}
5956
onBeforeChange={(editor, data, value) => {
6057
const optionObj = {
6158
schema: introspectionData.clientSchema,
6259
completeSingle: false,
63-
}
60+
};
6461
setValue(value);
6562
editor.setOption("lint", optionObj);
6663
editor.setOption("hintOptions", optionObj);

webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const CspHtmlWebpackPlugin = require("csp-html-webpack-plugin");
44
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
55
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
66
.BundleAnalyzerPlugin;
7-
const webpack = require("webpack");
87

98
module.exports = {
109
target: "web",
@@ -90,9 +89,5 @@ module.exports = {
9089
openAnalyzer: false,
9190
analyzerMode: "static",
9291
}),
93-
new webpack.ContextReplacementPlugin(
94-
/graphql-language-service-interface[\/\\]dist/,
95-
/\.js$/
96-
),
9792
],
9893
};

0 commit comments

Comments
 (0)