-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Does it make sense to switch to monaco-editor instead of monaco-editor-core #337
Comments
I agree! Btw, since we only import it for types, It won't change anything to the generated code, will it? We can switch on monaco-editor for the example tho, we'll at least have the syntax highlighting. |
It should be the same, but I would first compare what results both import/dependency combinations provide (hope this makes sense 🙂) An application (or in the example) can then selectively import what is needed from the possible things/features:
|
The javascript won't change, but the types will changes indeed. I don't see a single reason why someone would use monaco-editor-core instead of monaco-editor Btw importing What is a little weird however is that monaco-editor or monaco-editor-core is not in the dependencies of monaco-languageclient (not event in peer dependencies) |
This sounds fishy. So, this only works because the example imports |
Otherwise, the TypeScript compile step must go 💥 because the import does not exist!? Ok, I will address this in #331 as well. |
It only works because at the only place we need to have access to the monaco namespace are when we install the services, and we expect to developer to provide the monaco namespace as parameter, so they can import it any way they want, it can be either monaco-editor or monaco-editor-core. The only issue with it is that we reference monaco-editor-core in the d.ts files and it's probably not installed so typescript infer it's
I needed to enable |
💡
Ok, also good to know. |
Resolved with #340 |
I was wondering if we should switch to the dependency of
monaco-editor-core
tomonaco-editor
.Why? Because you cannot import both
monaco-editor
andmonaco-editor-core
in the same project/app. This blocks using features available from the main editor (like js support) and adding a new language + LS connection via this project, because both define the same things in global space.As far as I understand it you can just important the "core" feature of
monaco-editor
like this:and then you achieve the same as now, but you don't block the combined usage outlined above. Is this reasoning correct? WDYT? Does this have any bad implications I am overlooking?
The text was updated successfully, but these errors were encountered: