Skip to content

Commit 1d2fb5c

Browse files
committed
Update README, especially Troubleshooting and examples.
- Update dates in CHANGELOGs
1 parent a8234c4 commit 1d2fb5c

File tree

16 files changed

+68
-65
lines changed

16 files changed

+68
-65
lines changed

README.md

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ The examples not requiring a backend are now available [via GitHub Pages](https:
4545
- [Server processes](#server-processes)
4646
- [JSON Language Server](#json-language-server)
4747
- [Pyright Language Server](#pyright-language-server)
48+
- [Graalpy Debugger](#graalpy-debugger)
4849
- [Groovy Language Server](#groovy-language-server)
4950
- [Java Language Server](#java-language-server)
5051
- [Verification Examples \& Usage](#verification-examples--usage)
5152
- [VSCode integration](#vscode-integration)
5253
- [Featured projects](#featured-projects)
5354
- [Troubleshooting](#troubleshooting)
5455
- [General](#general)
56+
- [@codingame/monaco-vscode-editor-api / monaco-editor usage](#codingamemonaco-vscode-editor-api--monaco-editor-usage)
5557
- [Dependency issues: monaco-editor / @codingame/monaco-vscode-api / @codingame/monaco-vscode-editor-api](#dependency-issues-monaco-editor--codingamemonaco-vscode-api--codingamemonaco-vscode-editor-api)
5658
- [Volta](#volta)
5759
- [Vite dev server troubleshooting](#vite-dev-server-troubleshooting)
@@ -60,7 +62,6 @@ The examples not requiring a backend are now available [via GitHub Pages](https:
6062
- [Bad Polyfills](#bad-polyfills)
6163
- [buffer](#buffer)
6264
- [monaco-editor and react](#monaco-editor-and-react)
63-
- [pnpm](#pnpm)
6465
- [Licenses](#licenses)
6566

6667
## Changelogs, project history and compatibility
@@ -137,7 +138,7 @@ The **json-client** contains the [monaco-editor-wrapper app](./packages/examples
137138

138139
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)).
139140
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.
140-
It is also possible to use a [@typefox/monaco-editor-react app](./packages/examples/src/python/client/reactPython.tsx) to connect to the server.
141+
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).
141142

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

@@ -200,6 +201,10 @@ For the **python-client** example you need to ensure the **python-server** examp
200201
npm run start:example:server:python
201202
```
202203

204+
##### Graalpy Debugger
205+
206+
If you want to use the debugger in the **python-client** example you need to the debugger is running. You require **docker-compose** to run it. From the project root run `docker-compose -f ./packages/examples/resources/debugger/docker-compose.yml up -d`. First start up will take longer as the container is downloaded from GitHub's container registry. Use `docker-compose -f ./packages/examples/resources/debugger/docker-compose.yml down` to stop it.
207+
203208
##### Groovy Language Server
204209

205210
For the **groovy-client** example you need to ensure the **groovy-server** example is running. You require **docker-compose** which does not require any manual setup (OpenJDK / Gradle). From the project root run `docker-compose -f ./packages/examples/resources/groovy/docker-compose.yml up -d`. First start up will take longer as the container is downloaded from GitHub's container registry. Use `docker-compose -f ./packages/examples/resources/groovy/docker-compose.yml down` to stop it.
@@ -214,15 +219,11 @@ None of the verification examples is part of the npm workspace. Some bring subst
214219

215220
- [Angular verification example](./verify/angular): Before March 2024 this was located in [a separate repository](https://github.com/TypeFox/monaco-languageclient-ng-example). If you want to test it, Please do: `cd verify/angular && npm run verify`. It serves the client here: <http://localhost:4200>.
216221

217-
- [webpack verification example](./verify/webpack) demonstrates how bundling can be achieved with webpack. You find the configuration here: [webpack.config.js](./verify/webpack/webpack.config.js). Please do: `cd verify/webpack && npm run verify`. It serves the client here: <http://localhost:8081>.
218-
219-
- [vite verification example](./verify/vite) demonstrates how bundling can be achieved with vite. There is no configuration required Please do: `cd verify/vite && npm run verify`. It serves the client here: <http://localhost:8082>.
222+
- [Next.js verification example](./verify/next): demonstrates how to use `@typefox/monaco-editor-react` with Next.js, Please do: `cd verify/next && npm run verify`. It serves the client here: <http://localhost:8081>.
220223

221-
- [pnpm verification example](./verify/pnpm) demonstrates that the project can be build with vite, but pnpm is used instead of npm. Please do: `cd verify/pnpm && pnpm run verify`. It serves the client here: <http://localhost:8083>.
224+
- [webpack verification example](./verify/webpack) demonstrates how bundling can be achieved with webpack. You find the configuration here: [webpack.config.js](./verify/webpack/webpack.config.js). Please do: `cd verify/webpack && npm run verify`. It serves the client here: <http://localhost:8082>.
222225

223-
- [yarn verification example](./verify/yarn) demonstrates that the project can be build with vite, but yarn is used instead of npm. Please do: `cd verify/yarn && yarn run verify`. It serves the client here: <http://localhost:8083>.
224-
225-
- [Next.js verification example](./verify/next): demonstrates how to use `@typefox/monaco-editor-react` with Next.js, Please do: `cd verify/next && npm run verify`. It serves the client here: <http://localhost:8084>.
226+
- [vite verification example](./verify/vite) demonstrates how bundling can be achieved with vite. There is no configuration required Please do: `cd verify/vite && npm run verify`. It serves the client here: <http://localhost:8083>.
226227

227228
### VSCode integration
228229

@@ -238,11 +239,38 @@ You can as well run [vscode tasks](./.vscode/launch.json) to start and debug the
238239

239240
### General
240241

241-
Whenever you used `monaco-editor`, `vscode`, `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. Please check the [our python language client example](./packages/examples/src/python/client/main.ts) to see how it should be done.
242+
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.
243+
244+
If you use pnpm or yarn, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency, otherwise the installation will fail:
245+
246+
```json
247+
"vscode": "npm:@codingame/monaco-vscode-extension-api@~14.0.4"
248+
```
249+
250+
### @codingame/monaco-vscode-editor-api / monaco-editor usage
251+
252+
When you use the libraries from this project you are no longer are required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~14.0.4"` in you `package.json`. You can directly use it like this:
253+
254+
```js
255+
import * as monaco from '@codingame/monaco-vscode-editor-api';
256+
```
257+
258+
If your dependency stack already contains a reference `monaco-editor` you must enforce the correct reference to `@codingame/monaco-vscode-editor-api` or you will have problems with mismatching code. Use`overrides` (npm/pnpm) or `resolutions` (yarn) to do so:
259+
260+
```json
261+
"overrides": {
262+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~14.0.4"
263+
}
264+
```
242265

243266
### Dependency issues: monaco-editor / @codingame/monaco-vscode-api / @codingame/monaco-vscode-editor-api
244267

245-
If you have mutiple, possibly hundreds of compile errors resulting from missing functions deep in `monaco-editor` or `vscode` then it is very likely your `package-lock.json` or `node_modules` are dirty. Remove both and do a fresh `npm install`. Always `npm list monaco-editor` is very useful. If you see different or errornous versions, then this is an indicator something is wrong.
268+
If you have mutiple, possibly hundreds of compile errors resulting from missing functions deep in `monaco-editor` or `vscode` then it is very likely you have a mismatching dependency definition somewhere in your dependency definitions:
269+
270+
1. Use `npm list @codingame/monaco-vscode-api` to see if there are two different versions are listed in the dependency tree.
271+
2. If you see a message in the browser console starting with `Another version of monaco-vscode-api has already been loaded. Trying to load` then definetly a version mismatch was detected by `@codingame/monaco-vscode-api`. This error is reported since v14.
272+
273+
If one of the two is true, fix you dependencies, remove `package-lock.json` and `node_modules` and perform a fresh `npm install`.
246274

247275
### Volta
248276

@@ -252,7 +280,7 @@ There are [Volta](https://volta.sh/) instructions in the `package.json` files. W
252280

253281
When you are using the vite dev server there are some issues with imports, please [read this recommendation](https://github.com/CodinGame/monaco-vscode-api/wiki/Troubleshooting#if-you-use-vite).
254282

255-
If you see the problem *Assertion failed (There is already an extension with this id)* you likely have mismatching dependencies defined for `vscode` / `@codingame/monaco-vscode-api`. You should fix this or add the following entry to your vite config:
283+
If you see the problem *Assertion failed (There is already an extension with this id)* you likely have mismatching dependencies defined for `vscode` / `@codingame/monaco-vscode-extension-api`. You should fix this or add the following entry to your vite config:
256284

257285
```javascript
258286
resolve: {
@@ -262,7 +290,7 @@ resolve: {
262290

263291
### SSR frameworks
264292

265-
**Important:** Due to its reliance on `monaco-editor` and `@codingame/monaco-vscode-api` this stack will very likely not work with Server-Side Rendering (SSR) frameworks. They client code has to be run in a browser environment.
293+
**Important:** Due to its reliance on `@codingame/monaco-vscode-api` this stack will not directly work with Server-Side Rendering (SSR) frameworks like Next.js. They client code has to be run in a browser environment. Take a look at the [Next.js verification example](./verify/next) to see how to dynamically load the code.
266294

267295
### Serve all files required
268296

@@ -302,22 +330,6 @@ import { loader } from "@monaco-editor/react";
302330
loader.config({ monaco });
303331
```
304332

305-
Because `@codingame/monaco-vscode-api` relies on it own build of `monaco-editor` it may be required to enforce the `monaco-editor` version via `overrides` (npm/pnpm) or `resolutions` (yarn):
306-
307-
```json
308-
"overrides": {
309-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~14.0.4"
310-
}
311-
```
312-
313-
### pnpm
314-
315-
If you use pnpm, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency (you find the [compatibility table here](https://github.com/TypeFox/monaco-languageclient/blob/main/docs/versions-and-history.md#monaco-editor--codingamemonaco-vscode-api-compatibility-table), otherwise the installation will fail.
316-
317-
```json
318-
"vscode": "npm:@codingame/monaco-vscode-extension-api@~14.0.4"
319-
```
320-
321333
## Licenses
322334

323335
- monaco-languageclient: [MIT](https://github.com/TypeFox/monaco-languageclient/blob/main/packages/client/LICENSE)

docs/versions-and-history.md

Lines changed: 1 addition & 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 | monaco-editor-wrapper | monaco-editor-react | monaco-vscode-api / editor-api | vscode | monaco-editor | release date | comment |
88
| :---- | :---- | :--- | :--- | :--- | :--- | :--- | :--- |
9-
| 9.4.0 | 6.4.0 | 6.4.0 | 14.0.4 | 1.97.2 | 0.52.2 | 2025-02-1x | |
9+
| 9.4.0 | 6.4.0 | 6.4.0 | 14.0.4 | 1.97.2 | 0.52.2 | 2025-02-17 | |
1010
| 9.3.0 | 6.3.0 | 6.3.0 | 14.0.2 | 1.97.0 | 0.52.2 | 2025-02-12 | |
1111
| 9.2.5 | 6.2.5 | 6.2.5 | 13.1.6 | 1.96.4 | 0.52.2 | 2025-02-08 | |
1212
| 9.2.4 | 6.2.4 | 6.2.4 | 13.1.4 | 1.96.4 | 0.52.2 | 2025-02-06 | |

index.html

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,15 @@ <h3>Angular</h2>
102102
Please start <b><code>cd verify/angular && npm run verify</code></b> beforehand:<br>
103103
<a href="http://localhost:4200">JSON Language Client & Language Server (Web Socket) (Angular Dev Server)</a>
104104
<h3>Next.js</h3>
105-
Please start <b><code>cd verify/next && npm run verify</code></b> beforehand:<br>
106-
<a href="http://localhost:8084">JSON Language Client & Language Server (Web Socket) (Next.js Dev Server)</a>
105+
Please start <b><code>cd verify/next && npm run verify</code></b> beforehand:<br>
106+
<a href="http://localhost:8081">JSON Language Client & Language Server (Web Socket) (Next.js Dev Server)</a>
107107
<h3>Webpack</h3>
108-
Please start <b><code>cd verify/webpack && npm run verify</code></b> beforehand:<br>
109-
<a href="http://localhost:8081">JSON Language Client & Language Server (Web Socket) (webpack build)</a>
108+
Please start <b><code>cd verify/webpack && npm run verify</code></b> beforehand:<br>
109+
<a href="http://localhost:8082">JSON Language Client & Language Server (Web Socket) (webpack build)</a>
110110
<h3>Vite</h3>
111-
Please start <b><code>cd verify/vite && npm run verify</code></b> beforehand:<br>
112-
<a href="http://localhost:8082">JSON Language Client & Language Server (Web Socket) (vite build)</a>
113-
<h3>Pnpm/vite</h3>
114-
Please start <b><code>cd verify/pnpm && pnpm run verify</code></b> beforehand:<br>
115-
<a href="http://localhost:8083">JSON Language Client & Language Server (Web Socket) (pnpm/vite build)</a>
116-
<h3>Yarn/vite</h3>
117-
Please start <b><code>cd verify/yarn && yarn run verify</code></b> beforehand:<br>
118-
<a href="http://localhost:8083">JSON Language Client & Language Server (Web Socket) (yarn/vite build)</a>
119-
</div>
111+
Please start <b><code>cd verify/vite && npm run verify</code></b> beforehand:<br>
112+
<a href="http://localhost:8083">JSON Language Client & Language Server (Web Socket) (vite build)</a>
113+
</div>
120114
</body>
121115

122116
</html>

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"@stylistic/eslint-plugin": "~3.1.0",
2020
"@testing-library/react": "~16.2.0",
2121
"@types/node": "~22.13.4",
22-
"@types/react": "~19.0.8",
23-
"@types/react-dom": "~19.0.3",
22+
"@types/react": "~19.0.10",
23+
"@types/react-dom": "~19.0.4",
2424
"@typescript-eslint/eslint-plugin": "~8.24.0",
2525
"@typescript-eslint/parser": "~8.24.0",
2626
"@vitejs/plugin-react": "~4.3.4",

packages/client/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this npm module are documented in this file.
44

5-
## [9.4.0] - 2025-02-1x
5+
## [9.4.0] - 2025-02-17
66

77
- Handle languageclient errors cases more robustly [#859](https://github.com/TypeFox/monaco-languageclient/pull/859)
88
- Updated all `@codingame/monaco-vscode` packages to `14.0.4`.

packages/examples/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this npm module are documented in this file.
44

5-
## [2025.2.6] - 2025-02-1x
5+
## [2025.2.6] - 2025-02-17
66

77
- Handle languageclient errors cases more robustly [#859](https://github.com/TypeFox/monaco-languageclient/pull/859)
88
- Updated all `@codingame/monaco-vscode` packages to `14.0.4`.

packages/wrapper-react/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to npm module [@typefox/monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) are documented in this file.
44

5-
## [6.4.0] - 2025-02-1x
5+
## [6.4.0] - 2025-02-17
66

77
- refactor: replace all useEffect and useCallback with one useEffect [#862](https://github.com/TypeFox/monaco-languageclient/pull/862)
88
- Handle languageclient errors cases more robustly [#859](https://github.com/TypeFox/monaco-languageclient/pull/859)

packages/wrapper-react/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { WrapperConfig } from 'monaco-editor-wrapper';
2424
import { MonacoEditorReactComp } from '@typefox/monaco-editor-react';
2525

2626
const wrapperConfig: WrapperConfig = {
27-
$type: 'extendend',
27+
$type: 'extended',
2828
htmlContainer: document.getElementById('monaco-editor-root')!,
2929
editorAppConfig: {
3030
codeResources: {

packages/wrapper/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to npm module [monaco-editor-wrapper](https://www.npmjs.com/package/monaco-editor-wrapper) are documented in this file.
44

5-
## [6.4.0] - 2025-02-1x
5+
## [6.4.0] - 2025-02-17
66

77
- Handle languageclient errors cases more robustly [#859](https://github.com/TypeFox/monaco-languageclient/pull/859)
88
- Updated all `@codingame/monaco-vscode` packages to `14.0.4`.

verify/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"scripts": {
44
"verify": "npm install && npm run dev",
55
"verify:ci": "npm install && npm run build -d",
6-
"dev": "next dev -p 8084",
7-
"dev:turbo": "next dev --turbopack -p 8084",
6+
"dev": "next dev -p 8081",
7+
"dev:turbo": "next dev --turbopack -p 8081",
88
"build": "next build",
99
"start": "next start",
1010
"clean": "shx rm -fr dist .next *.tsbuildinfo"

verify/peerNpm/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"scripts": {
2222
"build": "tsc --build tsconfig.json",
23-
"showconfig": "tsc --showconfig",
2423
"verify:ci": "npm install && npm run build"
2524
}
2625
}

verify/peerPnpm/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"scripts": {
2222
"build": "tsc --build tsconfig.json",
23-
"showconfig": "tsc --showconfig",
2423
"verify:ci": "pnpm install && pnpm run build"
2524
}
2625
}

verify/peerYarn/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
},
3333
"scripts": {
3434
"build": "tsc --build tsconfig.json",
35-
"showconfig": "tsc --showconfig",
3635
"verify:ci": "yarn install && yarn run build"
3736
}
3837
}

verify/vite/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { defineConfig } from 'vite';
77

88
export default defineConfig({
99
preview: {
10-
port: 8082
10+
port: 8083
1111
},
1212
worker: {
1313
format: 'es'

verify/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
"clean": "shx rm -fr dist *.tsbuildinfo",
3030
"build:msg": "echo Building client-webpack example:",
3131
"build": "npm run build:msg && npm run clean && webpack",
32-
"start": "http-server ./ --port 8081"
32+
"start": "http-server ./ --port 8082"
3333
}
3434
}

0 commit comments

Comments
 (0)