Skip to content

Commit 5ee0325

Browse files
authored
Fixed re-rendering issues with React StrictMode (#986)
- StrictMode renders editor only once, fixed broken test, bring back enforced language client disposal - Renamed LanguageClientsManager to LanguageClientManager - Update dependencies - Fix lint issues - Fixed multiple editor rendering problems - Updated dependencies and changelogs - Fixed htmlContainter check was made too early - Fix re-mount errors and enforce htmlElement when ViewsService is ised (react or not) - Fix EditorService detection - Fix editorDipose triggered to often, fixed and extended react tests - Properly kick and stop queue - Fixed all tests and align strict and non-strict mode tests. text and options can be updated without restarting the editor - Added independent loggers for MonacoVscodeApiWrapper, EditorApp, LanguageClientWrapper and LanguageClientManager - Fix exceptions break queue, language client dispose is integrated in main config, only editorAppConfig drives text changes - Separate language client tests / move to own files - Implemented review comments. All paths use the central error handling and queue mechanism. Added external monaco-vscode-api init tests - Improve code and model update handling - Fix logging default and remove console.log
1 parent 8145a49 commit 5ee0325

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+6451
-4310
lines changed

docs/diagrams/mlc-details.drawio

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<mxCell id="k4CSAVVTnt-oedxpcEqQ-55" value="&lt;b&gt;&lt;font style=&quot;font-size: 34px;&quot;&gt;monaco-language&lt;span style=&quot;background-color: initial;&quot;&gt;client&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=top;fontSize=24;fillColor=#dae8fc;strokeColor=#6c8ebf;strokeWidth=3;arcSize=6;align=left;spacingLeft=16;" parent="1" vertex="1">
1111
<mxGeometry x="-1640" y="-880" width="1480" height="840" as="geometry" />
1212
</mxCell>
13-
<mxCell id="_uGb1KgNCc7sdFown7Vx-17" value="&lt;font style=&quot;font-size: 24px;&quot;&gt;LanguageClientsManager (optional)&lt;/font&gt;" style="rounded=1;html=1;fillColor=light-dark(#97D077,#80CC80);strokeColor=#005700;fontColor=#090909;verticalAlign=top;arcSize=10;whiteSpace=wrap;align=left;spacingLeft=10;opacity=30;" parent="1" vertex="1">
13+
<mxCell id="_uGb1KgNCc7sdFown7Vx-17" value="&lt;font style=&quot;font-size: 24px;&quot;&gt;LanguageClientManager (optional)&lt;/font&gt;" style="rounded=1;html=1;fillColor=light-dark(#97D077,#80CC80);strokeColor=#005700;fontColor=#090909;verticalAlign=top;arcSize=10;whiteSpace=wrap;align=left;spacingLeft=10;opacity=30;" parent="1" vertex="1">
1414
<mxGeometry x="-1550" y="-810" width="800" height="380.5" as="geometry" />
1515
</mxCell>
1616
<mxCell id="_uGb1KgNCc7sdFown7Vx-46" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;strokeWidth=4;dashed=1;dashPattern=1 2;endArrow=none;endFill=0;curved=0;" parent="1" source="_uGb1KgNCc7sdFown7Vx-14" target="k4CSAVVTnt-oedxpcEqQ-79" edge="1">

docs/guides/troubleshooting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Whenever you use `monaco-editor`/`@codingame/monaco-vscode-editor-api` `vscode`/
1111
If you use pnpm or yarn, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency, otherwise the installation will fail:
1212

1313
```json
14-
"vscode": "npm:@codingame/monaco-vscode-extension-api@^22.1.3"
14+
"vscode": "npm:@codingame/monaco-vscode-extension-api@^22.1.9"
1515
```
1616

1717
### Missing Overrides or Resolutions
@@ -23,7 +23,7 @@ To ensure all Monaco-related packages use a single, compatible version, you must
2323
```json
2424
{
2525
"overrides": {
26-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"
26+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"
2727
}
2828
}
2929
```
@@ -33,7 +33,7 @@ To ensure all Monaco-related packages use a single, compatible version, you must
3333
```json
3434
{
3535
"resolutions": {
36-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"
36+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"
3737
}
3838
}
3939
```
@@ -50,7 +50,7 @@ Additionally, if you see a message in the browser console starting with `Another
5050

5151
### @codingame/monaco-vscode-editor-api / monaco-editor usage
5252

53-
When you use the libraries from this project you are no longer required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"` in you `package.json`. You can directly use it like so:
53+
When you use the libraries from this project you are no longer required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"` in you `package.json`. You can directly use it like so:
5454

5555
```js
5656
import * as monaco from '@codingame/monaco-vscode-editor-api';
@@ -60,7 +60,7 @@ If your dependency stack already contains a reference `monaco-editor` you must e
6060

6161
```json
6262
"overrides": {
63-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"
63+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"
6464
}
6565
```
6666

docs/installation.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If using npm or pnpm, and your dependencies already contain a refernence to `mon
4545
```json
4646
{
4747
"overrides": {
48-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"
48+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"
4949
}
5050
}
5151
```
@@ -57,7 +57,7 @@ In yarn you have to specify `resolutions` instead of `overrides`:
5757
```json
5858
{
5959
"resolutions": {
60-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.3"
60+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^22.1.9"
6161
}
6262
}
6363
```
@@ -69,17 +69,17 @@ If using pnpm, you have to add more transitive dependencies that npm or yarn aut
6969
```json
7070
{
7171
"dependencies": {
72-
"@codingame/monaco-vscode-api": "^22.1.3",
73-
"@codingame/monaco-vscode-configuration-service-override": "^22.1.3",
74-
"@codingame/monaco-vscode-editor-api": "^22.1.3",
75-
"@codingame/monaco-vscode-editor-service-override": "^22.1.3",
76-
"@codingame/monaco-vscode-extension-api": "^22.1.3",
77-
"@codingame/monaco-vscode-extensions-service-override": "^22.1.3",
78-
"@codingame/monaco-vscode-languages-service-override": "^22.1.3",
79-
"@codingame/monaco-vscode-localization-service-override": "^22.1.3",
80-
"@codingame/monaco-vscode-log-service-override": "^22.1.3",
81-
"@codingame/monaco-vscode-model-service-override": "^22.1.3",
82-
"vscode": "npm:@codingame/monaco-vscode-extension-api@^22.1.3"
72+
"@codingame/monaco-vscode-api": "^22.1.9",
73+
"@codingame/monaco-vscode-configuration-service-override": "^22.1.9",
74+
"@codingame/monaco-vscode-editor-api": "^22.1.9",
75+
"@codingame/monaco-vscode-editor-service-override": "^22.1.9",
76+
"@codingame/monaco-vscode-extension-api": "^22.1.9",
77+
"@codingame/monaco-vscode-extensions-service-override": "^22.1.9",
78+
"@codingame/monaco-vscode-languages-service-override": "^22.1.9",
79+
"@codingame/monaco-vscode-localization-service-override": "^22.1.9",
80+
"@codingame/monaco-vscode-log-service-override": "^22.1.9",
81+
"@codingame/monaco-vscode-model-service-override": "^22.1.9",
82+
"vscode": "npm:@codingame/monaco-vscode-extension-api@^22.1.9"
8383
}
8484
}
8585
```

docs/migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const vscodeApiConfig: MonacoVscodeApiConfig = {
117117
118118
## LanguageClientConfig(s)
119119
120-
The previous `languageClientConfigs` can now be expressed as single `LanguageClientConfig` to be directly used with `LanguageClientWrapper` or multiple language client configurations can be expressed in the `LanguageClientConfigs` and used with `LanguageClientsManager`. Obey, that `languageId` is now a mandatory property in `LanguageClientConfig`.
120+
The previous `languageClientConfigs` can now be expressed as single `LanguageClientConfig` to be directly used with `LanguageClientWrapper` or multiple language client configurations can be expressed in the `LanguageClientConfigs` and used with `LanguageClientManager`. Obey, that `languageId` is now a mandatory property in `LanguageClientConfig`.
121121
122122
<table>
123123
<tr><th>v9/v6</th><th>v10</th></tr>
@@ -181,7 +181,7 @@ await lcWrapper.start();
181181
</td><td>
182182
183183
```ts
184-
const lcManager = new LanguageClientsManager();
184+
const lcManager = new LanguageClientManager();
185185
const languageClientConfigs: LanguageClientConfigs = {
186186
configs: {
187187
myLang1: {

0 commit comments

Comments
 (0)