-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
monaco-graphql
exports, validate on load (#3384)
- validates both graphql and json variables on load - reduces bundle size further, allowing users to specify which features they want, instead of importing all of them - adds a typescript mode to the vite/next.js demos to ensure our implementation doesn't break `typescript` language mode & worker - fix variables json validation by pointing to a meta schema - add `exports` aliases that are backwards compatible, but allow `monaco-graphql/initializeMode` and `monaco-graphql/graphql.worker` to be imported directly - add a `monaco-graphql/lite` import for minimal features - import the json language mode only if variables json validation is used
- Loading branch information
Showing
21 changed files
with
254 additions
and
87 deletions.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'monaco-graphql': patch | ||
--- | ||
|
||
import only `editor.api` & basic features, add `monaco-graphql/lite` | ||
|
||
- switch from exporting `edcore.js` to `editor.api.js` as recommended, and minimal features to get the editor working | ||
- `edcore` imports `editor.all` which contains many monaco-editor features we don't use | ||
- dynamic import of `json` language mode only if the user supplies configuration for json validation | ||
- update monaco examples to show minimal `typescript` implementation alongside `graphql` | ||
- add new simplified `exports` with backwards compatibility: | ||
- `monaco-graphql/initializeMode` | ||
- `monaco-graphql/graphql.worker` | ||
- `monaco-graphql/monaco-editor` | ||
- introduce `monaco-graphql/lite` for users who want the most minimum version possible, and to only import the features they need |
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 |
---|---|---|
|
@@ -130,6 +130,7 @@ matchingbracket | |
middlewares | ||
modulemap | ||
newhope | ||
nextjs | ||
nocheck | ||
nocursor | ||
nonmatchingbracket | ||
|
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
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
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
Oops, something went wrong.