TypeFox / monaco-languageclient

Repo hosts npm packages for monaco-languageclient, vscode-ws-jsonrpc, monaco-editor-wrapper, @typefox/monaco-editor-react and monaco-languageclient-examples
https://www.npmjs.com/package/monaco-languageclient
MIT License
992 stars 171 forks source link

@typefox/monaco-editor-react works in strict mode #634

Closed kaisalmen closed 2 months ago

kaisalmen commented 2 months ago

Re-Initialization was not properly safe-guarded. This update ensure this is the case. Re-init check functionality was mostly moved to the wrapper as it is unrelated to react, but to user and editor configuration. A simple unit test is introduced as well. The logger from the wrapper is exposed, so it can be used by the react-component.

updateLayout was removed by intention as you can just use the wrapper via getEditorWrapper or onLoad.

This fixes #631 and #621

kaisalmen commented 2 months ago

In addition to @zzullick in #631 @cdietrich brought this also up a while ago (see #621). I discussed this internally with @sailingKieler and I realized what the root cause is. Good thing is (FMPOV) that the react layer is now even thinner around monaco-editor-wrapper.

kaisalmen commented 2 months ago

One kind request: could you make @typefox/monaco-editor-react re-export the definitions of UserConfig, WrapperConfig, LanguageClientConfig, etc. ?

I am no fan of re-exports, because it basically hides where things come from. It should just be the exception and not the rule. People should be very much aware they use "things" from the wrapper as this react component should just be the most thinnest layer possible around monaco-editor-wrapper . Is there a better reason than just the need do use another import and package definition? 🙂

Btw, the peerDependencies defined should prevent a wrong combination of underlying packages.

kaisalmen commented 2 months ago

@zzullick @cdietrich and @sailingKieler next releases are available for testing: https://www.npmjs.com/package/monaco-editor-wrapper/v/4.2.0-next.0 https://www.npmjs.com/package/@typefox/monaco-editor-react/v/3.2.0-next.0

Final release will come when latest changes in the underlying stack will be available.