Skip to content

Commit

Permalink
v1.0.0-theia1.34.0
Browse files Browse the repository at this point in the history
- Update Theia dependencies to 1.34.0
- Adapt code base to API breaks of 1.34.0
- Declare Node 14 as minimum required version
- Update readmes

Fixes eclipse-glsp/glsp#901
  • Loading branch information
tortmayr committed Feb 6, 2023
1 parent 256b594 commit 3f8a176
Show file tree
Hide file tree
Showing 9 changed files with 609 additions and 926 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Eclipse GLSP - Theia Integration for GLSP Clients [![build-status](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fglsp%2Fjob%2Feclipse-glsp%2Fjob%2Fglsp-theia-integration%2Fjob%2Fmaster%2F)](https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp-theia-integration/) [![build-status-server](https://img.shields.io/jenkins/build?jobUrl=https://ci.eclipse.org/glsp/job/deploy-npm-glsp-theia-integration/&label=publish)](https://ci.eclipse.org/glsp/job/deploy-npm-glsp-theia-integration/)
# Eclipse GLSP - Theia Integration for GLSP Clients [![Build Status](https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp-theia-integration/job/master/badge/icon)](https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp-theia-integration/job/master/)

This project contains the glue code necessary to integrate diagram editors built with the [graphical language server platform](https://github.com/eclipse-glsp/glsp) with [Eclipse Theia](https://github.com/theia-ide/theia) as well as an example Theia application for testing purposes.

Expand All @@ -10,26 +10,28 @@ For details on building the project, please see the [README file of the theia-in

The `@eclipse-glsp/theia-integration` package in version `1.0.0` is currently compatible with Theia `>=1.25.0`.
Theia releases currently have no stable public API so new Theia versions might introduce API breaks.
If that is the case, a new compatible 1.0.0 version prefixed with the supported minimal Theia version will be released (e.g. `1.0.0-theia1.27.0` for Theia >= 1.27.0).
If that is the case, a new compatible 1.0.0 version prefixed with the supported minimal Theia version will be released (e.g. `1.0.0-theia1.34.0` for Theia >= 1.34.0).

| @eclipse-glsp/theia-integration | Theia |
| ------------------------------- | ------------------ |
| 0.8.0 | <=1.4.0 |
| 0.9.0 | >=1.20.0 <= 1.25.0 |
| 0.9.0 | >=1.20.0 <= 1.24.0 |
| 1.0.0 | >=1.25.0 <= 1.26.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 |
| next | >=1.27.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 <= 1.33.0 |
| 1.0.0-theia1.34.0 | >=1.34.0 |
| next | >=1.34.0 |

> Note: Due to a transitive dependency to `sprotty-theia` it's currently not possible to safely restrict the maximum version of Theia packages. If you encounter build errors related to multiple resolved Theia versions please add a resolutions block to the `package.json` of your project e.g. for `1.0.0-theia1.27.0`:
> Note: Due to a transitive dependency to `sprotty-theia` it's currently not possible to safely restrict the maximum version of Theia packages. If you encounter build errors related to multiple resolved Theia versions please add a resolutions block to the `package.json` of your project e.g. for `1.0.0-theia1.34.0`:
```json
...
"resolutions": {
"**/@theia/core": "1.27.0",
"**/@theia/editor": "1.27.0",
"**/@theia/filesystem": "1.27.0",
"**/@theia/messages": "1.27.0",
"**/@theia/monaco": "1.27.0"
"**/@theia/cli":"1.0.0-theia1.34.0",
"**/@theia/core": "1.0.0-theia1.34.0",
"**/@theia/editor": "1.0.0-theia1.34.0",
"**/@theia/filesystem": "1.0.0-theia1.34.0",
"**/@theia/messages": "1.0.0-theia1.34.0",
"**/@theia/monaco": "1.0.0-theia1.34.0"
},
...
```
Expand Down
40 changes: 20 additions & 20 deletions examples/browser-app/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"private": true,
"name": "browser-app",
"version": "1.0.0-theia1.27.0",
"dependencies": {
"@eclipse-glsp-examples/workflow-theia": "^1.0.0-theia1.27.0",
"@theia/core": "1.27.0",
"@theia/editor": "1.27.0",
"@theia/filesystem": "1.27.0",
"@theia/markers": "1.27.0",
"@theia/messages": "1.27.0",
"@theia/monaco": "1.27.0",
"@theia/navigator": "1.27.0",
"@theia/preferences": "1.27.0",
"@theia/process": "1.27.0",
"@theia/terminal": "1.27.0",
"@theia/workspace": "1.27.0"
},
"devDependencies": {
"@theia/cli": "1.27.0"
},
"version": "1.0.0-theia1.34.0",
"private": true,
"scripts": {
"prepare": "yarn build",
"build": "theia build --mode development",
"prepare": "yarn build",
"start": "theia start --WF_GLSP=5007 --root-dir=../workspace",
"start:debug": "theia start --WF_GLSP=5007 --root-dir=../workspace --loglevel=debug --debug",
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-theia": "^1.0.0-theia1.34.0",
"@theia/core": "1.34.0",
"@theia/editor": "1.34.0",
"@theia/filesystem": "1.34.0",
"@theia/markers": "1.34.0",
"@theia/messages": "1.34.0",
"@theia/monaco": "1.34.0",
"@theia/navigator": "1.34.0",
"@theia/preferences": "1.34.0",
"@theia/process": "1.34.0",
"@theia/terminal": "1.34.0",
"@theia/workspace": "1.34.0"
},
"devDependencies": {
"@theia/cli": "1.34.0"
},
"theia": {
"target": "browser"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/workflow-theia/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-glsp-examples/workflow-theia",
"version": "1.0.0-theia1.27.0",
"version": "1.0.0-theia1.34.0",
"description": "Theia extension for the workflow GLSP example",
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,7 @@
],
"dependencies": {
"@eclipse-glsp-examples/workflow-glsp": "1.0.0",
"@eclipse-glsp/theia-integration": "^1.0.0-theia1.27.0"
"@eclipse-glsp/theia-integration": "^1.0.0-theia1.34.0"
},
"devDependencies": {
"mvn-artifact-download": "5.1.0"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.0-theia1.27.0",
"version": "1.0.0-theia1.34.0",
"useWorkspaces": true,
"npmClient": "yarn",
"command": {
Expand Down
40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
{
"private": true,
"name": "parent",
"version": "1.0.0",
"engines": {
"yarn": ">=1.7.0 <2",
"node": ">=12.14.1"
},
"version": "1.0.0-theia1.34.0",
"private": true,
"workspaces": [
"packages/theia-integration",
"examples/*"
],
"scripts": {
"prepare": "lerna run prepare",
"watch": "lerna run --parallel watch",
"build": "lerna run build",
"download:exampleServer": "ts-node examples/workflow-theia/server/download.ts",
"lint": "lerna run lint --",
"publish:prepare": "lerna version --ignore-scripts --yes --no-push",
"prepare": "lerna run prepare",
"publish:latest": "lerna publish from-git --no-git-reset --no-git-tag-version --no-verify-access --no-push",
"publish:next": "SHA=$(git rev-parse --short HEAD) && lerna publish preminor --exact --canary --preid next.${SHA} --dist-tag next --no-git-reset --no-git-tag-version --no-push --ignore-scripts --yes --no-verify-access",
"publish:prepare": "lerna version --ignore-scripts --yes --no-push",
"upgrade:next": "yarn upgrade -p \"sprotty-theia|@eclipse-glsp.*\" --next ",
"download:exampleServer": "ts-node examples/workflow-theia/server/download.ts"
"watch": "lerna run --parallel watch",
"start":"yarn --cwd examples/browser-app start",
"start:debug":"yarn --cwd examples/browser-app start:debug"
},
"resolutions": {
"**/@theia/cli": "1.34.0",
"**/@theia/core": "1.34.0",
"**/@theia/editor": "1.34.0",
"**/@theia/filesystem": "1.34.0",
"**/@theia/messages": "1.34.0",
"**/@theia/monaco": "1.34.0"
},
"devDependencies": {
"@eclipse-glsp/config": "1.0.0",
"@types/node": "12.x",
"@types/node": "14.x",
"lerna": "^4.0.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
},
"workspaces": [
"packages/theia-integration",
"examples/*"
]
"engines": {
"node": ">=14.18.0",
"yarn": ">=1.7.0 <2"
}
}
22 changes: 12 additions & 10 deletions packages/theia-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ This project is built with `yarn` and is available from npm via [@eclipse-glsp/t

The `@eclipse-glsp/theia-integration` package in version `1.0.0` is currently compatible with Theia `>=1.25.0`.
Theia releases currently have no stable public API so new Theia versions might introduce API breaks.
If that is the case, a new compatible 1.0.0 version prefixed with the supported minimal Theia version will be released (e.g. `1.0.0-theia1.27.0` for Theia >= 1.27.0).
If that is the case, a new compatible 1.0.0 version prefixed with the supported minimal Theia version will be released (e.g. `1.0.0-theia1.34.0` for Theia >= 1.34.0).

| @eclipse-glsp/theia-integration | Theia |
| ------------------------------- | ------------------ |
| 0.8.0 | <=1.4.0 |
| 0.9.0 | >=1.20.0 <= 1.25.0 |
| 0.9.0 | >=1.20.0 <= 1.24.0 |
| 1.0.0 | >=1.25.0 <= 1.26.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 |
| next | >=1.27.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 <= 1.33.0 |
| 1.0.0-theia1.34.0 | >=1.34.0 |
| next | >=1.34.0 |

> Note: Due to a transitive dependency to `sprotty-theia` it's currently not possible to safely restrict the maximum version of Theia packages. If you encounter build errors related to multiple resolved Theia versions please add a resolutions block to the `package.json` of your project e.g. for `1.0.0-theia1.27.0`:
> Note: Due to a transitive dependency to `sprotty-theia` it's currently not possible to safely restrict the maximum version of Theia packages. If you encounter build errors related to multiple resolved Theia versions please add a resolutions block to the `package.json` of your project e.g. for `1.0.0-theia1.34.0`:
```json
...
"resolutions": {
"**/@theia/core": "1.27.0",
"**/@theia/editor": "1.27.0",
"**/@theia/filesystem": "1.27.0",
"**/@theia/messages": "1.27.0",
"**/@theia/monaco": "1.27.0"
"**/@theia/cli":"1.0.0-theia1.34.0",
"**/@theia/core": "1.0.0-theia1.34.0",
"**/@theia/editor": "1.0.0-theia1.34.0",
"**/@theia/filesystem": "1.0.0-theia1.34.0",
"**/@theia/messages": "1.0.0-theia1.34.0",
"**/@theia/monaco": "1.0.0-theia1.34.0"
},
...
```
Expand Down
8 changes: 4 additions & 4 deletions packages/theia-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@eclipse-glsp/theia-integration",
"version": "1.0.0-theia1.27.0",
"version": "1.0.0-theia1.34.0",
"description": "Glue code to integrate GLSP clients into Eclipse Theia",
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
"engines": {
"yarn": ">=1.7.0 <2.x.x",
"node": ">=12.14.1"
"node": ">=14.18.0"
},
"keywords": [
"theia-extension",
Expand Down Expand Up @@ -40,8 +40,8 @@
],
"dependencies": {
"@eclipse-glsp/client": "1.0.0",
"@theia/core": "^1.27.0",
"@theia/messages": "^1.27.0",
"@theia/core": "^1.34.0",
"@theia/messages": "^1.34.0",
"sprotty-theia": "0.12.0"
},
"scripts": {
Expand Down
17 changes: 10 additions & 7 deletions packages/theia-integration/src/browser/channel-connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022 STMicroelectronics and others.
* Copyright (c) 2022-2023 STMicroelectronics and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -14,10 +14,9 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Channel, Disposable, DisposableCollection, Emitter, MessageProvider } from '@theia/core';
import { createMessageConnection, Logger, Message, MessageConnection } from 'vscode-jsonrpc';
import { AbstractMessageReader, DataCallback, MessageReader } from 'vscode-jsonrpc/lib/messageReader';
import { AbstractMessageReader, createMessageConnection, DataCallback, Logger, Message, MessageConnection, MessageReader } from 'vscode-jsonrpc';

import { AbstractMessageWriter, MessageWriter } from 'vscode-jsonrpc/lib/messageWriter';
import { AbstractMessageWriter, MessageWriter } from 'vscode-jsonrpc';

// Temporary fix/workaround to enable comparability with Theia >=1.27 until https://github.com/eclipse-theia/theia/issues/11405 is resolved

Expand Down Expand Up @@ -46,8 +45,8 @@ export class ChannelMessageReader extends AbstractMessageReader implements Messa
this.toDispose.dispose();
}

listen(callback: DataCallback): void {
this.onMessageEmitter.event(callback);
listen(callback: DataCallback): Disposable {
return this.onMessageEmitter.event(callback);
}
}

Expand All @@ -62,7 +61,11 @@ export class ChannelMessageWriter extends AbstractMessageWriter implements Messa
this.toDispose = channel.onClose(() => this.fireClose());
}

write(msg: Message): void {
end(): void {
this.dispose();
}

async write(msg: Message): Promise<void> {
const writeBuffer = this.channel.getWriteBuffer();
writeBuffer.writeBytes(Buffer.from(JSON.stringify(msg, undefined, 0)));
writeBuffer.commit();
Expand Down
Loading

0 comments on commit 3f8a176

Please sign in to comment.