Skip to content

Commit

Permalink
v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tortmayr committed Dec 26, 2024
1 parent 1877812 commit 8ac9d6a
Show file tree
Hide file tree
Showing 10 changed files with 828 additions and 572 deletions.
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.3.0- 19/12/2024](https://github.com/eclipse-glsp/glsp-theia-integration/releases/tag/v2.3.0)
## [2.3.0- 23/12/2024](https://github.com/eclipse-glsp/glsp-theia-integration/releases/tag/v2.3.0)

### Changes

Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ For details on building the project, please see the [README file of the theia-in

### Potential Compatibility Issues

- When using Theia versions `<= 1.55.1` you might encounter runtime issues related to inversify.
- When using Theia versions `<= 1.55.1` you might encounter runtime issues related to inversify.
Due to a loose version restriction Theia might pull in an incompatible version.
To resolve this the inversify version need to be locked to `6.0.2`. (e.g. via [yarn resolutions](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/) or [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides))
- For `@eclipse-glsp/theia-integration` 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`:
- For `@eclipse-glsp/theia-integration` 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 Expand Up @@ -114,14 +114,14 @@ In the example the argument to be passed is `--WF_PATH=workflow`.

The example provides scripts and launch configs that pass this argument to test this connectivity option either in embedded or debug mode:

- Embedded: Start a Node GLSP server in WebSocket mode along with the backend:
- Embedded: Start a Node GLSP server in WebSocket mode along with the backend:

- VS Code Launch config: `Launch Workflow Browser Backend (WebSocket GLSP Server)`
- Script: `yarn browser start:ws` or `yarn electron start:ws`
- VS Code Launch config: `Launch Workflow Browser Backend (WebSocket GLSP Server)`
- Script: `yarn browser start:ws` or `yarn electron start:ws`

- Debug mode: Expects a running GLSP server (Java or Node) in WebSocket mode:
- VS Code Launch config: `Launch Workflow Browser Backend (External Websocket GLSP Server)`
- Script: `yarn browser start:ws:debug` or `yarn electron start:ws:debug`
- Debug mode: Expects a running GLSP server (Java or Node) in WebSocket mode:
- VS Code Launch config: `Launch Workflow Browser Backend (External Websocket GLSP Server)`
- Script: `yarn browser start:ws:debug` or `yarn electron start:ws:debug`

#### **2. Connect directly to GLSP server from frontend via WebSockets**

Expand All @@ -131,8 +131,8 @@ In this case, we do not have any GLSP backend contribution which means, the GLSP

The workflow example provides a launch config that passes the argument sets the environment variable:

- Debug mode: Expects a running GLSP server (Java or node.js) in WebSocket mode:
- VS Code Launch config: `Launch Theia Browser Backend (Direct WebSocket GLSP Server connection from frontend)`
- Debug mode: Expects a running GLSP server (Java or node.js) in WebSocket mode:
- VS Code Launch config: `Launch Theia Browser Backend (Direct WebSocket GLSP Server connection from frontend)`

### Start Workflow Diagram example without a dedicated server process

Expand All @@ -142,18 +142,18 @@ If this argument is passed, the node-based GLSP server will be integrated direct

The example provides scripts and launch configs that pass this argument to test this connectivity option:

- VS Code Launch config: `Launch Workflow Browser Backend (Integrated Node GLSP Server)`
- Script: `yarn browser start:integrated` or `yarn electron start:integrated`
- VS Code Launch config: `Launch Workflow Browser Backend (Integrated Node GLSP Server)`
- Script: `yarn browser start:integrated` or `yarn electron start:integrated`

> _**Remark:**_ In production, one would decide for one way of connectivity, and would not implement all the different options as we do in the workflow diagram example. This was setup to easily show and switch between the different possibilities.
### Where to find the sources?

In addition to this repository, the related source code can be found here:

- <https://github.com/eclipse-glsp/glsp-server>
- <https://github.com/eclipse-glsp/glsp-server-node>
- <https://github.com/eclipse-glsp/glsp-client>
- <https://github.com/eclipse-glsp/glsp-server>
- <https://github.com/eclipse-glsp/glsp-server-node>
- <https://github.com/eclipse-glsp/glsp-client>

## More information

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.3.0-next",
"version": "2.3.0",
"private": true,
"scripts": {
"build": "yarn rebuild && theia build --mode development",
Expand All @@ -14,21 +14,21 @@
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-theia": "2.3.0-next",
"@theia/core": "~1.52.0",
"@theia/editor": "~1.52.0",
"@theia/filesystem": "~1.52.0",
"@theia/markers": "~1.52.0",
"@theia/messages": "~1.52.0",
"@theia/monaco": "~1.52.0",
"@theia/navigator": "~1.52.0",
"@theia/preferences": "~1.52.0",
"@theia/process": "~1.52.0",
"@theia/terminal": "~1.52.0",
"@theia/workspace": "~1.52.0"
"@eclipse-glsp-examples/workflow-theia": "2.3.0",
"@theia/core": "~1.56.0",
"@theia/editor": "~1.56.0",
"@theia/filesystem": "~1.56.0",
"@theia/markers": "~1.56.0",
"@theia/messages": "~1.56.0",
"@theia/monaco": "~1.56.0",
"@theia/navigator": "~1.56.0",
"@theia/preferences": "~1.56.0",
"@theia/process": "~1.56.0",
"@theia/terminal": "~1.56.0",
"@theia/workspace": "~1.56.0"
},
"devDependencies": {
"@theia/cli": "~1.52.0"
"@theia/cli": "~1.56.0"
},
"theia": {
"target": "browser",
Expand Down
30 changes: 15 additions & 15 deletions examples/electron-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-app",
"version": "2.3.0-next",
"version": "2.3.0",
"private": true,
"main": "lib/backend/electron-main.js",
"scripts": {
Expand All @@ -15,22 +15,22 @@
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-theia": "2.3.0-next",
"@theia/core": "~1.52.0",
"@theia/editor": "~1.52.0",
"@theia/electron": "~1.52.0",
"@theia/filesystem": "~1.52.0",
"@theia/markers": "~1.52.0",
"@theia/messages": "~1.52.0",
"@theia/monaco": "~1.52.0",
"@theia/navigator": "~1.52.0",
"@theia/preferences": "~1.52.0",
"@theia/process": "~1.52.0",
"@theia/terminal": "~1.52.0",
"@theia/workspace": "~1.52.0"
"@eclipse-glsp-examples/workflow-theia": "2.3.0",
"@theia/core": "~1.56.0",
"@theia/editor": "~1.56.0",
"@theia/electron": "~1.56.0",
"@theia/filesystem": "~1.56.0",
"@theia/markers": "~1.56.0",
"@theia/messages": "~1.56.0",
"@theia/monaco": "~1.56.0",
"@theia/navigator": "~1.56.0",
"@theia/preferences": "~1.56.0",
"@theia/process": "~1.56.0",
"@theia/terminal": "~1.56.0",
"@theia/workspace": "~1.56.0"
},
"devDependencies": {
"@theia/cli": "~1.52.0",
"@theia/cli": "~1.56.0",
"electron": "^30.1.2"
},
"theia": {
Expand Down
10 changes: 5 additions & 5 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.3.0-next",
"version": "2.3.0",
"private": "true",
"description": "Theia extension for the workflow GLSP example",
"keywords": [
Expand Down Expand Up @@ -34,10 +34,10 @@
"watch": "tsc -w"
},
"dependencies": {
"@eclipse-glsp-examples/workflow-glsp": "next",
"@eclipse-glsp-examples/workflow-server": "next",
"@eclipse-glsp-examples/workflow-server-bundled": "next",
"@eclipse-glsp/theia-integration": "2.3.0-next"
"@eclipse-glsp-examples/workflow-glsp": "2.3.0",
"@eclipse-glsp-examples/workflow-server": "2.3.0",
"@eclipse-glsp-examples/workflow-server-bundled": "2.3.0",
"@eclipse-glsp/theia-integration": "2.3.0"
},
"publishConfig": {
"access": "public"
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": "2.2.1",
"version": "2.3.0",
"npmClient": "yarn",
"command": {
"run": {
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parent",
"version": "2.3.0-next",
"version": "2.3.0",
"private": true,
"workspaces": [
"packages/theia-integration",
Expand Down Expand Up @@ -29,11 +29,8 @@
"watch:browser": "concurrently --kill-others -n tsc,browser -c red,yellow \"tsc -b -w --preserveWatchOutput\" \"yarn -s browser watch\"",
"watch:electron": "concurrently --kill-others -n tsc,browser -c red,yellow \"tsc -b -w --preserveWatchOutput\" \"yarn -s electron watch\""
},
"resolutions": {
"**/inversify": "6.0.2"
},
"devDependencies": {
"@eclipse-glsp/dev": "next",
"@eclipse-glsp/dev": "2.3.0",
"@types/node": "18.x",
"concurrently": "^8.2.2",
"lerna": "^7.0.0",
Expand Down
4 changes: 2 additions & 2 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.3.0-next",
"version": "2.3.0",
"description": "Glue code to integrate GLSP clients into Eclipse Theia",
"keywords": [
"theia-extension",
Expand Down Expand Up @@ -43,7 +43,7 @@
"watch": "tsc -w"
},
"dependencies": {
"@eclipse-glsp/client": "next",
"@eclipse-glsp/client": "2.3.0",
"ws": "~8.11.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { codiconCSSString, lazyBind } from '@eclipse-glsp/client';
import { ContainerModule, injectable, interfaces } from '@theia/core/shared/inversify';
import { ContainerModule, inject, injectable, interfaces } from '@theia/core/shared/inversify';
import { GLSPDiagramWidget } from '.';
import { GLSPDiagramLanguage } from '../common/glsp-diagram-language';
import { registerCopyPasteContextMenu } from './copy-paste-context-menu-contribution';
Expand Down Expand Up @@ -78,10 +78,10 @@ export abstract class GLSPTheiaFrontendModule extends ContainerModule {
* @param context the container context
*/
bindGLSPClientContribution(context: ContainerContext): void {
context.bind(GLSPClientContribution).toDynamicValue(dynamicContext => {
const contribution = dynamicContext.container.resolve(ConfigurableGLSPClientContribution);
contribution.id = this.diagramLanguage.contributionId;
return contribution;
context.bind(GLSPClientContribution).toDynamicValue(ctx => {
const childContainer = ctx.container.createChild();
childContainer.bind(GLSPDiagramLanguage).toConstantValue(this.diagramLanguage);
return childContainer.resolve(ConfigurableGLSPClientContribution);
});
}

Expand Down Expand Up @@ -139,10 +139,10 @@ export abstract class GLSPTheiaFrontendModule extends ContainerModule {
const diagramManagerServiceId = Symbol(`DiagramManager_${this.diagramLanguage.diagramType}`);
context
.bind(diagramManagerServiceId)
.toDynamicValue(dynamicContext => {
const manager = dynamicContext.container.resolve(ConfigurableGLSPDiagramManager);
manager.doConfigure(this.diagramLanguage);
return manager;
.toDynamicValue(ctx => {
const childContainer = ctx.container.createChild();
childContainer.bind(GLSPDiagramLanguage).toConstantValue(this.diagramLanguage);
return childContainer.resolve(InternalGLSPDiagramManager);
})
.inSingletonScope();
registerDiagramManager(context.bind, diagramManagerServiceId, false);
Expand Down Expand Up @@ -201,21 +201,25 @@ export abstract class GLSPTheiaFrontendModule extends ContainerModule {
}
}

const GLSPDiagramLanguage = Symbol('GLSPDiagramLanguage');

/**
* Internal class that is used in {@link GLSPTheiaFrontendModule.configureDiagramManager} to
* bind a default implementation for `DiagramManager`. A custom `DiagramManager` should
* never extend this class. Use {@link GLSPDiagramManager} instead.
*/

@injectable()
class ConfigurableGLSPDiagramManager extends GLSPDiagramManager {
private _diagramType?: string;
class InternalGLSPDiagramManager extends GLSPDiagramManager {
private _diagramType: string;
private _label: string;
private _fileExtensions: string[] = [];
private _iconClass = codiconCSSString('type-hierarchy-sub');
private _contributionId: string;
private _providerName?: string;

public doConfigure(diagramLanguage: GLSPDiagramLanguage): void {
constructor(@inject(GLSPDiagramLanguage) diagramLanguage: GLSPDiagramLanguage) {
super();
this._fileExtensions = diagramLanguage.fileExtensions;
this._diagramType = diagramLanguage.diagramType;
this._label = diagramLanguage.label;
Expand All @@ -229,9 +233,6 @@ class ConfigurableGLSPDiagramManager extends GLSPDiagramManager {
}

get diagramType(): string {
if (!this._diagramType) {
throw new Error('No diagramType has been set for this ConfigurableGLSPDiagramManager');
}
return this._diagramType;
}

Expand Down Expand Up @@ -259,19 +260,10 @@ class ConfigurableGLSPDiagramManager extends GLSPDiagramManager {
*/
@injectable()
class ConfigurableGLSPClientContribution extends BaseGLSPClientContribution {
protected _id?: string;
readonly id: string;

get id(): string {
if (!this._id) {
throw new Error('No id has been set for this DefaultTheiaGLSPConnector');
}
return this._id;
}

set id(value: string) {
if (this._id) {
throw new Error(`A value for id has already been set. Cannot set new value'${value}'`);
}
this._id = value;
constructor(@inject(GLSPDiagramLanguage) diagramLanguage: GLSPDiagramLanguage) {
super();
this.id = diagramLanguage.contributionId;
}
}
Loading

0 comments on commit 8ac9d6a

Please sign in to comment.