-
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-graphql] Cannot use the monaco-editor-webpack features toggle #3383
Comments
The workaround is to play with overrides, which works but is not ideal new NormalModuleReplacementPlugin(
/^\.\/monaco-editor$/,
'monaco-editor/esm/vs/editor/editor.api',
), |
@bboure i think this workaround may also break json completion for variables, and a few other imports from |
I saw that issue and I was going to mention it too. It's the same root issue. The workaround seems to work was long as the json worker is loaded with the WebPack plugin |
And reverting the PR will not solve my issue since the full In my project I had to change all imports to There could be an escape hatch for custom cases like mine. |
we originally imported from |
This looks good and it makes sense I think. Users using this plugin will probably want these features anyway. But I'm wondering if it's necessary. Most users will probably already import It would be great if monaco-graphql only imported what it needs. For what I can see and unless I missed something, in this case it's With that said, changing it now might be a breaking change to anyone not importing Maybe in the next version bump, we can change it? Note it still does not fix #3381 which is also a breaking change. But at this point there is no easy fix to everything I think |
if we only import |
perhaps we could have a |
👍 opt-out with |
Is there an existing issue for this?
Current Behavior
I'm trying to use the monaco-editor-webpack-plugin in combination with
monaco-graphql
and I am trying to disable some features using the newfeatures
flag.However, the disabling of the flag does not work.
Here is my webpack config
I traced the issue and it turns out that
monaco-graphql
importsedcore.main
here which in turns imports all the features by default througheditor.all.js
Expected Behavior
the features flag should be respected.
I think the solution is to only import from
monaco-editor/esm/vs/editor/editor.api
anywhere inmonaco-graphql
.Especially in
initializeMode.ts
. It should be possible since the only thing we need islanguage
Edit: importing from
monaco-editor/esm/vs/editor/editor.api
is actually what the doc recommends/requires when using the webpack plugin.Anything else (features, language workers, etc) should be imported/initialized by the developer in their own project through import 'monaco-editor`.
Steps To Reproduce
No response
Environment
react
Version:graphql
Version:Anything else?
No response
The text was updated successfully, but these errors were encountered: