-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
monaco-editor/monaco-graphql x GraphiQL #3234
Open
dimaMachina
wants to merge
5
commits into
main
Choose a base branch
from
monaco4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9931c9a
commit @graphiql/react
dimaMachina 7869934
cleanup after rebase
acao dd8b9a1
get partially working with netlify/webpack consuming module build
acao ca776ed
use normal monaco-editor imports in graphiql react
acao f02956a
add changeset - now all merges/commits to monaco4 will release a grap…
acao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
last 2 versions | ||
Firefox ESR | ||
not dead | ||
not IE 11 | ||
not ios 10 | ||
defaults and supports es6-module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "monaco", | ||
"initialVersions": { | ||
"example-graphiql-webpack": "1.1.1-alpha.8", | ||
"example-monaco-graphql-nextjs": "0.0.0", | ||
"example-monaco-graphql-react-vite": "0.0.0", | ||
"example-monaco-graphql-webpack": "1.1.1", | ||
"cm6-graphql": "0.0.9", | ||
"codemirror-graphql": "2.0.9", | ||
"graphiql": "3.0.5", | ||
"@graphiql/plugin-code-exporter": "0.3.4", | ||
"@graphiql/plugin-explorer": "0.3.4", | ||
"@graphiql/react": "0.19.3", | ||
"@graphiql/toolkit": "0.9.1", | ||
"graphql-language-service": "5.1.7", | ||
"graphql-language-service-cli": "3.3.25", | ||
"graphql-language-service-server": "2.11.3", | ||
"monaco-graphql": "1.3.0", | ||
"vscode-graphql": "0.8.17", | ||
"vscode-graphql-execution": "0.2.4", | ||
"vscode-graphql-syntax": "1.2.2" | ||
}, | ||
"changesets": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'graphiql': major | ||
'@graphiql/react': major | ||
'monaco-graphql': major | ||
--- | ||
|
||
release `graphiql` with `monaco-editor` support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!doctype html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no" | ||
/> | ||
<title>GraphiQL Webpack Example!</title> | ||
</head> | ||
|
||
<body> | ||
<style> | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
min-height: 100vh; | ||
} | ||
#root { | ||
height: 100vh; | ||
} | ||
</style> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1 +1,83 @@ | ||||||||||||||
module.exports = require('../../resources/webpack.config'); | ||||||||||||||
const path = require('node:path'); | ||||||||||||||
const webpack = require('webpack'); | ||||||||||||||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||||||||||||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); | ||||||||||||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); | ||||||||||||||
|
||||||||||||||
const relPath = (...args) => path.resolve(__dirname, ...args); | ||||||||||||||
const rootPath = (...args) => relPath(...args); | ||||||||||||||
|
||||||||||||||
const resultConfig = { | ||||||||||||||
mode: process.env.NODE_ENV, | ||||||||||||||
entry: './index.jsx', | ||||||||||||||
context: rootPath('src'), | ||||||||||||||
output: { | ||||||||||||||
path: rootPath('dist'), | ||||||||||||||
filename: '[name].js', | ||||||||||||||
}, | ||||||||||||||
module: { | ||||||||||||||
rules: [ | ||||||||||||||
// you can also use ts-loader of course | ||||||||||||||
// i prefer to use babel-loader & @babel/plugin-typescript | ||||||||||||||
// so we can experiment with how changing browserslistrc targets impacts | ||||||||||||||
// monaco-graphql bundling | ||||||||||||||
{ | ||||||||||||||
test: /\.(js|jsx|ts|tsx)$/, | ||||||||||||||
use: [{ loader: 'babel-loader' }], | ||||||||||||||
}, | ||||||||||||||
{ | ||||||||||||||
test: /\.css$/, | ||||||||||||||
use: ['style-loader', 'css-loader'], | ||||||||||||||
}, | ||||||||||||||
{ | ||||||||||||||
test: /\.svg$/, | ||||||||||||||
use: [{ loader: 'svg-inline-loader' }], | ||||||||||||||
}, | ||||||||||||||
{ | ||||||||||||||
test: /\.(woff|woff2|eot|ttf|otf)$/, | ||||||||||||||
type: 'asset/resource', | ||||||||||||||
}, | ||||||||||||||
], | ||||||||||||||
}, | ||||||||||||||
resolve: { | ||||||||||||||
extensions: ['.mjs', '.js', '.json', '.jsx', '.css', '.ts', '.tsx'], | ||||||||||||||
}, | ||||||||||||||
plugins: [ | ||||||||||||||
new webpack.optimize.LimitChunkCountPlugin({ | ||||||||||||||
maxChunks: 1, | ||||||||||||||
}), | ||||||||||||||
// in order to prevent async modules for CDN builds | ||||||||||||||
// until we can guarantee it will work with the CDN properly | ||||||||||||||
// and so that graphiql.min.js can retain parity | ||||||||||||||
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
new HtmlWebpackPlugin({ | ||||||||||||||
template: relPath('src/index.html.ejs'), | ||||||||||||||
filename: 'index.html', | ||||||||||||||
}), | ||||||||||||||
|
||||||||||||||
new MonacoWebpackPlugin({ | ||||||||||||||
languages: ['json', 'graphql'], | ||||||||||||||
publicPath: '/', | ||||||||||||||
customLanguages: [ | ||||||||||||||
{ | ||||||||||||||
label: 'graphql', | ||||||||||||||
worker: { | ||||||||||||||
id: 'graphql', | ||||||||||||||
entry: 'monaco-graphql/esm/graphql.worker.js', | ||||||||||||||
}, | ||||||||||||||
}, | ||||||||||||||
], | ||||||||||||||
}), | ||||||||||||||
], | ||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
if (process.env.ANALYZE) { | ||||||||||||||
resultConfig.plugins.push( | ||||||||||||||
new BundleAnalyzerPlugin({ | ||||||||||||||
analyzerMode: 'static', | ||||||||||||||
openAnalyzer: false, | ||||||||||||||
reportFilename: rootPath('build/analyzer.html'), | ||||||||||||||
}), | ||||||||||||||
); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
module.exports = resultConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.