Skip to content

Commit 0f29770

Browse files
committed
Lifecycle adjustments (#939)
- Remove monaco-editor-wrapper. Create EditorApp in client - Move languageclient management from wrapper to client - move all tests from wrapper to client - client: proper separation of sub-exports, rename tools to common - monaco-vscode-api independent config and init - clean up and restructure src and test - Update vitest and other dependencies - Update examples - Unify json, eclipse.jdt and groovy example - react component: fix re-render and global init - expand react tests - LanguageClient handling with react component - Updated versions to next.1 and updated dependencies. Removed references to monaco-editor-wrapper where applicable - Updated test timeout and vite optimizeDeps - Implemented review comments - GHA: Properly dispose editor app in tests (saves lots of memory in Playwright/Chromium)
1 parent 5962c5f commit 0f29770

File tree

129 files changed

+3885
-4322
lines changed

Some content is hidden

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

129 files changed

+3885
-4322
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424

2525
- name: Volta
2626
uses: volta-cli/action@v4
27-
with:
28-
node-version: 20
2927

3028
- name: Use pnpm
3129
uses: pnpm/action-setup@v3
@@ -55,5 +53,4 @@ jobs:
5553
- name: Test
5654
shell: bash
5755
run: |
58-
npm run test:install
59-
npm run test:run
56+
npm run test

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ All notable changes for `vscode-ws-jsonrpc` are found here:
88

99
[vscode-ws-jsonrpc CHANGELOG](./packages/vscode-ws-jsonrpc/CHANGELOG.md)
1010

11-
All notable changes for `monaco-editor-wrapper` are found here:
12-
13-
[monaco-editor-wrapper CHANGELOG](./packages/wrapper/CHANGELOG.md)
14-
1511
All notable changes for `@typefox/monaco-editor-react` are found here:
1612

1713
[@typefox/monaco-editor-react CHANGELOG](./packages/wrapper-react/CHANGELOG.md)

README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Monaco Language Client, VSCode WebSocket Json RPC, Monaco-Editor-Wrapper, Monaco-Editor-React and examples
1+
# Monaco Language Client, VSCode WebSocket Json RPC, Monaco Editor React and examples
22

33
[![Github Pages](https://img.shields.io/badge/GitHub-Pages-blue?logo=github)](https://typefox.github.io/monaco-languageclient)
44
[![monaco-languageclient](https://github.com/TypeFox/monaco-languageclient/actions/workflows/actions.yml/badge.svg)](https://github.com/TypeFox/monaco-languageclient/actions/workflows/actions.yml)
@@ -9,22 +9,19 @@
99
[![monaco-languageclient Downloads](https://img.shields.io/npm/dt/monaco-languageclient)](https://www.npmjs.com/package/monaco-languageclient)
1010
[![vscode-ws-jsonrpc Version](https://img.shields.io/npm/v/vscode-ws-jsonrpc?logo=npm&label=vscode-ws-jsonrpc)](https://www.npmjs.com/package/vscode-ws-jsonrpc)
1111
[![vscode-ws-jsonrpc Downloads](https://img.shields.io/npm/dt/vscode-ws-jsonrpc)](https://www.npmjs.com/package/vscode-ws-jsonrpc)
12-
[![monaco-editor-wrapper Version](https://img.shields.io/npm/v/monaco-editor-wrapper?logo=npm&label=monaco-editor-wrapper)](https://www.npmjs.com/package/monaco-editor-wrapper)
13-
[![monaco-editor-wrapper Downloads](https://img.shields.io/npm/dt/monaco-editor-wrapper)](https://www.npmjs.com/package/monaco-editor-wrapper)
1412
[![monaco-editor-react Version](https://img.shields.io/npm/v/@typefox/monaco-editor-react?logo=npm&label=@typefox/monaco-editor-react)](https://www.npmjs.com/package/@typefox/monaco-editor-react)
1513
[![monaco-editor-react Downloads](https://img.shields.io/npm/dt/@typefox/monaco-editor-react)](https://www.npmjs.com/package/@typefox/monaco-editor-react)
1614

1715
This repository now host multiple npm packages under one roof:
1816

1917
- [monaco-languageclient](https://www.npmjs.com/package/monaco-languageclient) to connect [Monaco editor](https://microsoft.github.io/monaco-editor/) with [language servers](https://microsoft.github.io/language-server-protocol/).
2018
- [vscode-ws-jsonrpc](https://www.npmjs.com/package/vscode-ws-jsonrpc) which implements communication between a jsonrpc client and server over WebSocket.
21-
- [monaco-editor-wrapper](https://www.npmjs.com/package/monaco-editor-wrapper) for building monaco editor application driven by configuration
22-
- [monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) puts a react cloack over `monaco-editor-wrapper`
19+
- [monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) makes editor and languageclient available within a react component.
2320
- [monaco-languageclient-examples](https://www.npmjs.com/package/monaco-languageclient-examples) provides the examples which allows to use them externally.
2421

2522
The examples not requiring a backend are now available [via GitHub Pages](https://typefox.github.io/monaco-languageclient).<br>
2623

27-
- [Monaco Language Client, VSCode WebSocket Json RPC, Monaco-Editor-Wrapper, Monaco-Editor-React and examples](#monaco-language-client-vscode-websocket-json-rpc-monaco-editor-wrapper-monaco-editor-react-and-examples)
24+
- [Monaco Language Client, VSCode WebSocket Json RPC, Monaco Editor React and examples](#monaco-language-client-vscode-websocket-json-rpc-monaco-editor-react-and-examples)
2825
- [Changelogs, project history and compatibility](#changelogs-project-history-and-compatibility)
2926
- [Getting started](#getting-started)
3027
- [Vite dev server](#vite-dev-server)
@@ -71,7 +68,6 @@ CHANGELOGs for each project are available from the linked location:
7168

7269
- CHANGELOG for `monaco-languageclient` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/client/CHANGELOG.md)
7370
- CHANGELOG for `vscode-ws-jsonrpc` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/vscode-ws-jsonrpc/CHANGELOG.md)
74-
- CHANGELOG for `monaco-editor-wrapper` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper/CHANGELOG.md)
7571
- CHANGELOG for `@typefox/monaco-editor-react` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper-react/CHANGELOG.md)
7672
- CHANGELOG for `monaco-languageclient-examples` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/examples/CHANGELOG.md)
7773

@@ -80,7 +76,6 @@ Important Project changes and notes about the project's history are found [here]
8076
These are the current versions of packages from this repository and their alignment with **@codingame/monaco-vscode-api** **monaco-editor** and **vscode**:
8177

8278
- **monaco-languageclient**: `10.0.0` (release date: unreleased)
83-
- **monaco-editor-wrapper**: `7.0.0` (release date: unreleased)
8479
- **@typefox/monaco-editor-react**: `7.0.0` (release date: unreleased)
8580
- Aligned with:
8681
- **@codingame/monaco-vscode-[editor]-api**: `20.2.1`
@@ -129,7 +124,6 @@ Please look at the respective section in the packages:
129124

130125
- Usage for `monaco-languageclient` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/client/README.md#usage)
131126
- Usage for `vscode-ws-jsonrpc` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/vscode-ws-jsonrpc/README.md#usage)
132-
- Usage for `monaco-editor-wrapper` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper/README.md#usage)
133127
- Usage for `@typefox/monaco-editor-react` is found [here](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper-react/README.md#usage)
134128

135129
## Examples Overview
@@ -144,23 +138,23 @@ The examples demonstrate mutliple things:
144138
#### JSON Language client and language server example ([Location](./packages/examples/src/json))
145139

146140
The **json-server** runs an external Node.js [Express app](./packages/examples/src/json/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application (see [JSON Language Server](#json-language-server)).
147-
The **json-client** contains the [monaco-editor-wrapper app](./packages/examples/src/json/client/wrapperWs.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
141+
The **json-client** contains the [editor app](./packages/examples/src/json/client/wrapperWs.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
148142

149143
#### Python Language client and pyright language server example ([Location](./packages/examples/src/python))
150144

151145
The **python-server** runs an external Node.js [Express app](./packages/examples/src/python/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application (see [Pyright Language Server](#pyright-language-server)).
152-
The **python-client** contains the [monaco-editor-wrapper app](./packages/examples/src/python/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
146+
The **python-client** contains the [editor app](./packages/examples/src/python/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
153147
It is also possible to use a [@typefox/monaco-editor-react app](./packages/examples/src/python/client/reactPython.tsx) to connect to the server. Both versions now feature a debugger, see [here](#graalpy-debugger).
154148

155149
#### Groovy Language client and language server example ([Location](./packages/examples/src/groovy))
156150

157151
The **groovy-server** runs an external [Java app](./packages/examples/src/groovy/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application ([Groovy Language Server](#groovy-language-server)).
158-
The **groovy-client** contains the [monaco-editor-wrapper app](./packages/examples/src/groovy/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
152+
The **groovy-client** contains the [editor app](./packages/examples/src/groovy/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
159153

160154
#### Java Language client and language server example ([Location](./packages/examples/src/eclipse.jdt.ls))
161155

162156
The **java-server** runs an external [Java app](./packages/examples/src/eclipse.jdt.ls/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application ([Java Language Server](#java-language-server)).
163-
The **java-client** contains the [monaco-editor-wrapper app](./packages/examples/src/eclipse.jdt.ls/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
157+
The **java-client** contains the [editor app](./packages/examples/src/eclipse.jdt.ls/client/main.ts) which connects to the language server and therefore requires the node server app to be run in parallel.
164158

165159
Langium examples (here client and server communicate via `vscode-languageserver-protocol/browser` instead of a web socket used in the three examples above
166160

@@ -183,11 +177,11 @@ It is also possible to use a [@typefox/monaco-editor-react app](./packages/examp
183177

184178
#### bare monaco-languageclient ([Location](./packages/examples/src/bare))
185179

186-
It demostrate how the `JSON Language client and language server example` can be realised without `monaco-editor-wrapper`. You find the implementation [here](./packages/examples/src/bare/client.ts).
180+
This demonstrates how the `JSON Language client and language server example` can be realized with just the pure monaco api and no abstraction via the `editor app`. You find the implementation [here](./packages/examples/src/bare/client.ts).
187181

188182
#### Browser example ([Location](./packages/examples/src/browser))
189183

190-
It demonstrates how a [monaco-editor-wrapper can be combined with a language service written in JavaScript](./packages/examples/src/browser/main.ts). This example can now be considered legacy as the web worker option eases client side language server implementation and separation, but it still shows a valid way to achieve the desired outcome.
184+
This demonstrates how an [editor app can be combined with a language service written in JavaScript](./packages/examples/src/browser/main.ts). This example can now be considered legacy as the web worker option eases client side language server implementation and separation, but it still shows a valid way to achieve the desired outcome.
191185

192186
#### Purely monaco-editor related examples
193187

@@ -251,7 +245,7 @@ You can as well run [vscode tasks](./.vscode/launch.json) to start and debug the
251245

252246
### General
253247

254-
Whenever you used `monaco-editor`/`@codingame/monaco-vscode-editor-api` `vscode`/`@codingame/monaco-vscode-extension-api`, `monaco-languageclient`, `monaco-editor-wrapper` or `@typefox/monaco-editor-react` ensure they are imported before you do any `monaco-editor` or `vscode` api related intialization work or start using it.
248+
Whenever you used `monaco-editor`/`@codingame/monaco-vscode-editor-api` `vscode`/`@codingame/monaco-vscode-extension-api`, `monaco-languageclient` or `@typefox/monaco-editor-react` ensure they are imported before you do any `monaco-editor` or `vscode` api related intialization work or start using it.
255249

256250
If you use pnpm or yarn, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency, otherwise the installation will fail:
257251

@@ -390,6 +384,5 @@ When webpack is used as bundler there are issues with utilizing the undbundled w
390384

391385
- monaco-languageclient: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/client/LICENSE)
392386
- vscode-ws-jsonrpc: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/vscode-ws-jsonrpc/LICENSE)
393-
- monaco-editor-wrapper: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper/LICENSE)
394387
- @typefox/monaco-editor-react: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/wrapper-react/LICENSE)
395388
- monaco-languageclient-examples: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/examples/LICENSE)

docs/versions-and-history.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The following table describes which version of **monaco-languageclient** and **@
66

77
| monaco-languageclient | vscode-ws-jsonrpc | monaco-editor-wrapper | monaco-editor-react | monaco-vscode-api / editor-api | vscode | monaco-editor | release date | comment |
88
| :---- | :---- | :---- | :--- | :--- | :--- | :--- | :--- | :--- |
9-
| 10.0.0 | 3.5.0 | 7.0.0 | 7.0.0 | 20.1.1 | 1.103.1 | 0.52.2 | unreleased | |
9+
| 10.0.0 | 3.5.0 | 7.0.0 | 7.0.0 | 20.2.1 | 1.103.1 | 0.52.2 | unreleased | |
1010
| 9.11.0 | 3.5.0 | 6.12.0 | 6.12.0 | 20.2.1 | 1.103.1 | 0.52.2 | 2025-08-21 | |
1111
| 9.10.0 | 3.5.0 | 6.11.0 | 6.11.0 | 20.1.1 | 1.103.1 | 0.52.2 | 2025-08-14 | |
1212
| 9.9.0 | 3.5.0 | 6.10.0 | 6.10.0 | 19.1.4 | 1.102.3 | 0.52.2 | 2025-08-11 | |
@@ -82,6 +82,11 @@ The following table describes which version of **monaco-languageclient** and **@
8282

8383
## Important Project Changes
8484

85+
### July 2025 (v10.0.0)
86+
87+
- Dropped `monaco-editor-wrapper`. All required funcitonality was moved back to `monaco-languageclient` and made available as sub exports.
88+
- `@typefox/monaco-editor-react` lifecycle and robustness improvements.
89+
8590
### March 2024 (v8.0.0)
8691

8792
`@codingame/monaco-editor-treemended` is replaced by self-standing `@codingame/monaco-vscode-editor-api`. `monaco-editor-wrapper` and `@typefox/monaco-editor-react` have been moved into this repository.

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export default [{
105105
'@typescript-eslint/no-empty-object-type': 'error',
106106
'@typescript-eslint/no-unsafe-function-type': 'error',
107107
'@typescript-eslint/no-wrapper-object-types': 'error',
108-
// temporarily disabled due to "Maximum call stack size exceeded" error
109108
'@stylistic/indent': 'error',
110109
'@typescript-eslint/no-explicit-any': 'error',
111110
'@typescript-eslint/no-misused-new': 'error',

index.html

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h3>Langium</h3>
3636

3737
Langium Grammar DSL: <a href="./packages/examples/langium_extended.html">Extended Mode</a> - <a href="./packages/examples/langium_classic.html">Classic Mode</a>
3838
<br>
39-
<a href="./packages/examples/statemachine.html">Langium Statemachine Client & Language Server (Worker)</a>
39+
<a href="./packages/examples/statemachine.html">Langium Statemachine Client & Language Server (Worker)</a> (<a href="./packages/examples/react_statemachine.html">React Version</a>)<br>
4040
<br>
4141
Localizations:
4242
<a href="./packages/examples/statemachine.html?locale=cs">cs</a> -
@@ -58,7 +58,7 @@ <h3>Langium</h3>
5858
<h3>Python</h3>
5959
Please execute <b><code>npm run start:example:server:python</code></b> beforehand.<br>
6060
Debugger requires docker. Please execute <b><code>docker compose -f ./packages/examples/resources/debugger/docker-compose.yml up -d</code></b> beforehand.<br>
61-
<a href="./packages/examples/python.html">Python Language Client & Pyright Language Server (Web Socket)</a><br>
61+
<a href="./packages/examples/python.html">Python Language Client & Pyright Language Server (Web Socket)</a> (<a href="./packages/examples/react_python.html">React Version</a>)<br>
6262

6363
<h3>Java / Eclipse JDS LS</h3>
6464
Requires docker. Please execute <b><code>docker compose -f ./packages/examples/resources/eclipse.jdt.ls/docker-compose.yml up -d</code></b> beforehand:<br>
@@ -80,23 +80,12 @@ <h3>Multiple Languageclients</h3>
8080
<br>
8181

8282
<h3>Application Playground</h3>
83-
<a href="./packages/examples/appPlayground.html">Application Playground</a>
83+
<a href="./packages/examples/appPlayground.html">Application Playground</a> (<a href="./packages/examples/react_appPlayground.html">React Version</a>)
8484

8585
<h3>TypeScript</h3>
8686
<a href="./packages/examples/tsExtHost.html">TypeScript Extension Host Worker</a>
8787
<br>
8888

89-
<h2>Monaco Editor React</h2>
90-
Please execute <b><code>npm run start:example:server:python</code></b> beforehand.<br>
91-
Debugger requires docker. Please execute <b><code>docker compose -f ./packages/examples/resources/debugger/docker-compose.yml up -d</code></b> beforehand.<br>
92-
<a href="./packages/examples/react_appPlayground.html">React: Application Playground</a>
93-
<br>
94-
<a href="./packages/examples/react_statemachine.html">React: Langium Statemachine Language Client & Language Server (Worker)</a>
95-
<br><br>
96-
Please execute <b><code>npm run start:example:server:python</code></b> beforehand:<br>
97-
<a href="./packages/examples/react_python.html">React: Python Language Client & Language Server (Web Socket)</a>
98-
<br>
99-
10089
<h2>Verification</h2>
10190
<h3>Angular</h2>
10291
Please start <b><code>cd verify/angular && npm run verify</code></b> beforehand:<br>

0 commit comments

Comments
 (0)