Skip to content

Commit

Permalink
GLSP-1240: Ensure compatibility with >= Theia 1.45 (#196)
Browse files Browse the repository at this point in the history
 GLSP-1240: Ensure compatibility with >= Theia 1.45
  • Loading branch information
tortmayr authored Feb 9, 2024
1 parent 060a407 commit c8cd5cd
Show file tree
Hide file tree
Showing 12 changed files with 353 additions and 397 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.eslint": true
"source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "typescript"],
"search.exclude": {
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eclipse GLSP Theia Integration Changelog

## 2.1.0 - active
## [2.1.0- 24/01/2024](https://github.com/eclipse-glsp/glsp-theia-integration/releases/tag/v2.1.0)

### Changes

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ For details on building the project, please see the [README file of the theia-in

## Theia Version Compatibility

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).

| @eclipse-glsp/theia-integration | Theia |
| ------------------------------- | ------------------ |
| 0.8.0 | <=1.4.0 |
| 0.9.0 | >=1.20.0 <= 1.25.0 |
| 1.0.0 | >=1.25.0 <= 1.26.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 < 1.34.0 |
| 1.0.0-theia1.34.0 | >=1.34.0 < 1.39.0 |
| 2.0.0 | >=1.39.0 |
| next | >=1.39.0 |
| 2.0.0 | >=1.39.0 < 1.45.0 |
| 2.1.0 | >=1.39.0 < 1.45.0 |
| 2.1.0-theia1.45.0 | >=1.45.0 |
| next | >=1.45.0 |

> Note: For versions <=1.0.0 it is 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: For versions =1.0.0 it is 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`:
```json
...
Expand Down
28 changes: 14 additions & 14 deletions examples/browser-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browser-app",
"version": "2.1.0",
"version": "2.2.0-next",
"private": true,
"scripts": {
"build": "theia build --mode development",
Expand All @@ -13,21 +13,21 @@
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-theia": "2.1.0",
"@theia/core": "1.39.0",
"@theia/editor": "1.39.0",
"@theia/filesystem": "1.39.0",
"@theia/markers": "1.39.0",
"@theia/messages": "1.39.0",
"@theia/monaco": "1.39.0",
"@theia/navigator": "1.39.0",
"@theia/preferences": "1.39.0",
"@theia/process": "1.39.0",
"@theia/terminal": "1.39.0",
"@theia/workspace": "1.39.0"
"@eclipse-glsp-examples/workflow-theia": "2.2.0-next",
"@theia/core": "1.45.1",
"@theia/editor": "1.45.1",
"@theia/filesystem": "1.45.1",
"@theia/markers": "1.45.1",
"@theia/messages": "1.45.1",
"@theia/monaco": "1.45.1",
"@theia/navigator": "1.45.1",
"@theia/preferences": "1.45.1",
"@theia/process": "1.45.1",
"@theia/terminal": "1.45.1",
"@theia/workspace": "1.45.1"
},
"devDependencies": {
"@theia/cli": "1.39.0"
"@theia/cli": "1.45.1"
},
"theia": {
"target": "browser"
Expand Down
18 changes: 9 additions & 9 deletions examples/workflow-theia/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# workflow-theia

This package contains the glue code to integrate the [GLSP Workflow example language](https://www.npmjs.com/package/@eclipse-glsp-examples/workflow-glsp) into a Theia applicatiopn.
This package contains the glue code to integrate the [GLSP Workflow example language](https://www.npmjs.com/package/@eclipse-glsp-examples/workflow-glsp) into a Theia application.

This project is built with `yarn` and is available from npm via [@eclipse-glsp-examples/workflow-theia](https://www.npmjs.com/package/@eclipse-glsp-examples/workflow-theia).

## Theia Version Compatibility

The `@eclipse-glsp/workflow-theia` 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).

| @eclipse-glsp/theia-integration | Theia |
| ------------------------------- | ------------------ |
| 0.8.0 | <=1.4.0 |
| 0.9.0 | >=1.20.0 <= 1.25.0 |
| 1.0.0 | >=1.25.0 <= 1.26.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 |
| next | >=1.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.27.0`:
| 1.0.0-theia1.27.0 | >=1.27.0 < 1.34.0 |
| 1.0.0-theia1.34.0 | >=1.34.0 < 1.39.0 |
| 2.0.0 | >=1.39.0 < 1.45.0 |
| 2.1.0 | >=1.39.0 < 1.45.0 |
| 2.1.0-theia1.45.0 | >=1.45.0 |
| next | >=1.45.0 |

> Note: For versions =1.0.0 it is 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`:
```json
...
Expand Down
8 changes: 4 additions & 4 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": "2.1.0",
"version": "2.2.0-next",
"private": "true",
"description": "Theia extension for the workflow GLSP example",
"keywords": [
Expand Down Expand Up @@ -36,10 +36,10 @@
"watch": "tsc -w"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-glsp": "2.1.0",
"@eclipse-glsp-examples/workflow-server": "2.1.0",
"@eclipse-glsp-examples/workflow-glsp": "next",
"@eclipse-glsp-examples/workflow-server": "next",
"@eclipse-glsp-examples/workflow-server-bundled": "next",
"@eclipse-glsp/theia-integration": "2.1.0"
"@eclipse-glsp/theia-integration": "2.2.0-next"
},
"devDependencies": {
"mvn-artifact-download": "5.1.0"
Expand Down
14 changes: 6 additions & 8 deletions packages/theia-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ This project is built with `yarn` and is available from npm via [@eclipse-glsp/t

## Theia Version Compatibility

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).

| @eclipse-glsp/theia-integration | Theia |
| ------------------------------- | ------------------ |
| 0.8.0 | <=1.4.0 |
| 0.9.0 | >=1.20.0 <= 1.25.0 |
| 1.0.0 | >=1.25.0 <= 1.26.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 |
| 1.0.0-theia1.27.0 | >=1.27.0 < 1.34.0 |
| 1.0.0-theia1.34.0 | >=1.34.0 < 1.39.0 |
| 2.0.0 | >=1.39.0 |
| next | >=1.39.0 |
| 2.0.0 | >=1.39.0 < 1.45.0 |
| 2.1.0 | >=1.39.0 < 1.45.0 |
| 2.1.0-theia1.44.0 | >=1.45.0 |
| next | >=1.45.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: For versions =1.0.0 it is 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`:
```json
...
Expand Down
12 changes: 6 additions & 6 deletions packages/theia-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-glsp/theia-integration",
"version": "2.1.0",
"version": "2.2.0-next",
"description": "Glue code to integrate GLSP clients into Eclipse Theia",
"keywords": [
"theia-extension",
Expand Down Expand Up @@ -44,17 +44,17 @@
"watch": "tsc -w"
},
"dependencies": {
"@eclipse-glsp/client": "2.1.0",
"@eclipse-glsp/client": "next",
"ws": "~8.11.0"
},
"devDependencies": {
"@types/ws": "^8.5.4"
},
"peerDependencies": {
"@theia/core": "^1.39.0",
"@theia/filesystem": "^1.39.0",
"@theia/messages": "^1.39.0",
"@theia/monaco": "^1.39.0"
"@theia/core": "^1.45.1",
"@theia/filesystem": "^1.45.1",
"@theia/messages": "^1.45.1",
"@theia/monaco": "^1.45.1"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
listen
} from '@eclipse-glsp/client';
import { Disposable, DisposableCollection, MessageService } from '@theia/core';
import { FrontendApplication, WebSocketConnectionProvider } from '@theia/core/lib/browser';
import { FrontendApplication } from '@theia/core/lib/browser';
import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
import { Deferred } from '@theia/core/lib/common/promise-util';
import { inject, injectable } from '@theia/core/shared/inversify';
import { MessageConnection } from 'vscode-jsonrpc';
Expand Down Expand Up @@ -110,7 +111,8 @@ export abstract class BaseGLSPClientContribution implements GLSPClientContributi
}

@inject(MessageService) protected readonly messageService: MessageService;
@inject(WebSocketConnectionProvider) protected readonly connectionProvider: WebSocketConnectionProvider;
@inject(ServiceConnectionProvider)
protected readonly connectionProvider: ServiceConnectionProvider;

get glspClient(): Promise<GLSPClient> {
return this.glspClientDeferred.promise;
Expand Down Expand Up @@ -178,9 +180,9 @@ export abstract class BaseGLSPClientContribution implements GLSPClientContributi
protected createChannelConnection(): Promise<MessageConnection> {
return new Promise((resolve, reject) => {
this.connectionProvider.listen(
{
path: GLSPContribution.getPath(this),
onConnection: channel => {
GLSPContribution.getPath(this),
(path, channel) => {
if (path === GLSPContribution.getPath(this)) {
if (this.toDispose.disposed) {
channel.close();
reject(new Error('GLSPClientContribution is already disposed'));
Expand All @@ -193,7 +195,7 @@ export abstract class BaseGLSPClientContribution implements GLSPClientContributi
resolve(connection);
}
},
{ reconnecting: false }
false
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
********************************************************************************/
import { bindAsService } from '@eclipse-glsp/client';
import { CommandContribution, MenuContribution, bindContributionProvider } from '@theia/core';
import {
FrontendApplicationContribution,
KeybindingContext,
KeybindingContribution,
WebSocketConnectionProvider
} from '@theia/core/lib/browser';
import { FrontendApplicationContribution, KeybindingContext, KeybindingContribution } from '@theia/core/lib/browser';
import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
import { ContainerModule } from '@theia/core/shared/inversify';
import { GLSPContribution } from '../common';
import { DiagramServiceProvider } from './diagram-service-provider';
Expand All @@ -43,7 +39,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bindAsService(context, FrontendApplicationContribution, GLSPFrontendContribution);
bind(DiagramServiceProvider).toSelf().inSingletonScope();
bind(GLSPContribution.Service)
.toDynamicValue(({ container }) => WebSocketConnectionProvider.createProxy(container, GLSPContribution.servicePath))
.toDynamicValue(({ container }) => ServiceConnectionProvider.createProxy(container, GLSPContribution.servicePath))
.inSingletonScope();

// Diagram Command API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class GLSPBackendContribution implements MessagingService.Contribution {
}

protected forward(service: MessagingService, path: string, contribution: GLSPServerContribution): void {
service.wsChannel(path, async (_params, clientChannel) => {
service.registerChannelHandler(path, async (_params, clientChannel) => {
try {
const toDispose = await contribution.connect(clientChannel);
clientChannel.onClose(() => toDispose.dispose());
Expand Down
Loading

0 comments on commit c8cd5cd

Please sign in to comment.