/glsp

Graphical language server platform for building web-based diagram editors

Eclipse Public License 2.0EPL-2.0

Eclipse GLSP build-status-server build-status-client build-status-theia build-status-examples

The Graphical Language Server Platform provides extensible components for the development of diagram editors including edit functionality in (distributed) web-applications via a client-server protocol.

It follows the architectural pattern of the Language Server Protocol, but applies it to graphical modeling and diagram editors for browser/cloud-based deployments. Parts of the protocol and the web-based client implementation is based on Sprotty but extends it with editing functionality and GLSP-specific communication with the server.

For more information, please visit the Eclipse GLSP Website. If you have questions, contact us on our spectrum chat and have a look at our communication and support options.

alt

Repositories

The GLSP source code consists of the following repositories:

Build artifacts

The client packages are available via npmjs, such as the glsp-client and the theia integration. The examples are available on npmjs too.

The server packages are available as maven as well as p2 dependency from the following maven repository or p2 update site.

Maven Repositories

P2 Update Sites

All changes on the master branch are deployed automatically to the corresponding snapshot repositories.

Prerequisites for building

Client packages

You’ll need node in version 12:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
nvm install 12

and Yarn

npm install -g yarn

and Lerna

npm install -g lerna

Server packages

You'll need Java 11 and maven.

Building

To build the client packages, just invoke yarn in glsp-client, glsp-theia-integration. If you want to build the example too, run yarn in glsp-examples/client.

The server components are built with mvn clean install in glsp-server. If you want to build the example server, run mvn clean install in glsp-examples/server.

Building and starting the workflow example

Clone glsp-examples, if you haven't already and switch to the cloned repository.

git clone git@github.com:eclipse-glsp/glsp-examples.git
cd glsp-examples

Building and running the GLSP backend

cd server
mvn clean install -Pfatjar

In the folder server/org.eclipse.glsp.example.workflow/target, you should have a jar file org.eclipse.glsp.example.workflow-X.X.X-SNAPSHOT-glsp.jar whereas X.X.X is the current version. You can now start the server by executing the following commands:

cd org.eclipse.glsp.example.workflow/target
java -jar org.eclipse.glsp.example.workflow-X.X.X-SNAPSHOT-glsp.jar org.eclipse.glsp.example.workflow.ExampleServerLauncher

To start the example server from within your IDE, run the main method of the class ExampleServerLauncher.java in the module server/org.eclipse.glsp.example.workflow.

Building and running the Workflow Theia application

Note that it is not necessary to build the other components of GLSP just for running the workflow example, as the workflow example build will pull all dependencies (including those from GLSP) from npmjs and sonar.

Switch to the folder client in your clone of the glsp-examples repository and build.

cd client
yarn

This will not only build the GLSP workflow example modules, but also its Theia integration and a Theia application. Once the build is finished, you can start the Theia application:

cd workflow/browser-app
yarn start

Now open a browser and point it to http://localhost:3000. If you open this the first time and you don't have selected a workspace yet, point it to glsp-examples/client/workflow/workspace of your repository clone. This will already include an up to date workflow file example1.wf that you can open by double-clicking it in the navigator.

Setting up your development environment

We recommend cloning the repositories mentioned above alongside this repository, so that you have the following folder layout:

For the client-side code (Typescript), we recommend using VSCode. Therefore, this repository provides a VSCode workspace file, which you can open in VSCode and it will import all client-side folders for you -- given that you kept the repository structure specified above.

The GLSP workspace file provides build & watch tasks, so that you can build all packages with the task Build all or start watching all client packages with Watch all.

For the server components, you can use any IDE you like. We recommend an IDE that supports maven, though, to import the maven modules from the glsp-server and optionally also those from the glsp-examples.

Linking and watching

When you are planning to change more than one client package at a time, or if you want to test your changes with the workflow example, we recommend to yarn link your local sources. Therefore, we provide the yarn-link script that automatically links all the relevant packages. Currently, this script is only available for Linux and Mac (shell script). The GLSP VSCode workspace also includes a dedicated VSCode task called Yarn link all packages and Yarn unlink all packages.