Although there hasn’t yet been a big official announcement (except Svens blog last week), one of the most interesting Eclipse project proposals in recent years was approved a couple of weeks ago. So what is this all about? In a nutshell, it is a new platform to build modern IDEs and tools based on web technologies. It was open source and available before it even became an Eclipse project. However, the move to the Eclipse ecosystem is a good opportunity to have a closer look at this very promising project.
According to the hypothesis, “Theia” collided with earth 4.5 billion years ago
What is Theia?
Theia is a platform based on modern web technologies (TypeScript, HTML and CSS) to build IDEs and tools. Those tools can run as desktop applications or in the browser. Besides that, the scope is pretty much like the classic Eclipse Platform and the Eclipse Tools platform. Such a tool platform aims at two generic goals:
The first goal is to provide common features, which can be reused to implement a custom tool as efficiently as possible. Some good examples for this feature are support for Git or a source code editor with syntax highlighting. These reusable features significantly lower the required effort for the implementation of a custom tool or IDE.
The second goal is providing mechanisms to integrate existing and new modules to a custom product, e.g. “an IDE for TypeScript developers”. This integration must be supported on both a technical level as well as from a UI perspective. This allows you to create a custom product by combining existing modules with custom extensions.
Theia in particular adds a third goal, which could be called the “unique selling point”: A platform for building tools as desktop-apps and web-apps at the same time sharing the same code.
To achieve the first two goals, Theia provides three main features:
- A basic workbench frame including menus, a status bar, a view concept, part layouting, a workspace abstraction, etc.. This basic workbench can be extended with custom UI extensions, such as menu items, custom views, and custom editors.
- A modular extension mechanism, allowing you to implement features in a modular, reusable and combinable way. Those extension can target the frontend, the backend, or both. This extension mechanism also allows the user to install new features.
- Common tool features to be reused, e.g. an integrated source code editor supporting LSP, support for the most important Git features, a terminal and many more
To target the third goal – the ability to run a tool on the desktop and as a web application –
Theia consists of two parts, a client (the UI) and a server. In a local, desktop scenario, the server part is deployed locally. Theia is implemented in Typescript, CSS, and HTML. When running a Theia-based tool on the desktop, Electron is used as a local replacement for the Browser.
The same tool based on Theia, running as a desktop application and in the browser.
Yet another Web IDE?
There are several similar approaches out there already, some commercial and some open source. So why is there yet another Web IDE? The combination of several interesting features make Theia unique in the market. To pick the most relevant ones from our point of view:
- Web AND desktop-based: Theia as a platform supports the use case to run tools in the cloud (access via a browser), but also, at the same time, on the desktop (via Electron). This is a very unique and interesting feature, as it provides a lot of flexibility when it comes to use cases for tools created based on Theia.
- Do not reinvent the wheel: Theia reuses other frameworks, standards and technologies wherever it makes sense to do so. Otherwise, the project would not have evolved so quickly. As an example, Theia reuses the Monaco code editor of VS Code and makes strong use of the language server protocol (LSP).
- For IDEs (not only code editors): Theia does not aim at being a simple code editor, but rather being a platform to create comprehensive tool-suites and integrated development environments (IDEs)
- Extension first: Theia is meant as a platform, not as a tool itself. This leads to a consistent “extension first” approach, which basically means: Everything is an extension, even the core features, which are provided by the project itself. As a result, you can customize almost everything within Theia and even replace core features, if you like. This is an important “lesson learned” from the Eclipse rich-client platform.
- Promising community: The project has currently a lot of traction and many of the key players in the Eclipse ecosystem have started to adopt, contribute, or evaluate Theia (see the next section). Eclipse itself could never have been as successful as it is without its excellent ecosystem. Therefore, building a strong ecosystem around a technology such as Theia is the key to success.
Where does it come from?
One very interesting aspect about Theia is that from the beginning it has not been a single-vendor driven project. The initial idea and scope has been discussed with member companies such as Ericsson, Codenvy, Intel, Obeo, RedHat, and Eclipse. If you look at the list of interested parties in the project proposal and the list of 40 contributors, you will immediately see, that Theia is not a one-man show. In any case, credits go to TypeFox and Ericsson for getting the ball rolling on this endeavour one year ago. The broad variety of interested parties also differentiates Theia from other approaches mentioned in the section before.
What is the current state?
Theia is far from being as feature-rich as the Eclipse desktop ecosystem. This is kind of obvious, as the project was only incepted a year ago. However, Theia reuses existing components wherever this makes sense, rather than reinventing them from scratch. A good example of this is seen in the Monaco Code editor, which has its origin in VS Code and is also embedded into Theia. Another example is the focus on LSP, which allows you to reuse existing language servers. Therefore, Theia is already quite powerful for its age as a platform.
Although Theia is currently in the “early adopter” stage, which often means that something is not ready to be used, Theia has already been successfully used as a basis for products such as Yangster and we have already successfully adopted Theia for a couple of customer projects. It has been open source and available before even becoming an Eclipse project. Whatever is currently in Theia works pretty well in our experience. However, not “everything” is available from desktop Eclipse.
How is it different from classic Eclipse?
The most obvious difference is the technology stack. While Eclipse is implemented based on Java, SWT and uses OSGi as a module system, Theia is implemented in TypeScript uses HTML and CSS for the UI and provides its own extension mechanism based on npm. Therefore, if your UI is implemented in SWT, you cannot simply migrate it to Theia. However, there are several strategies to reuse existing tool components in Theia. One example is to embed existing components, e.g. a compiler into the server part of Theia and embed their results into the UI. The most prominent example is using a Language Server (LSP), which operates exactly like this. Another technique is to avoid manually written SWT code and use declarative approaches such as EMF Forms and JSON Forms.
However, the more interesting question is whether you would like to migrate to Theia. First of all, you should evaluate, whether you would benefit from a web-based solution, see here for more details. Second, there is no rush if you have an existing tool. If you look at how long tools took to migrate to Eclipse 4, it is clear, that not everything is re-implemented over night. This is especially true for tools that typically have a long life cycle. Many projects could benefit from a more modern UI stack, but not enough to justify the efforts of an intermediate migration.
However, it makes sense to develop a strategy for the future, as pointed out here.
Which platform to use for new projects also depends on the use case you would like to implement. Although we like Theia a lot, it does not yet have a successful 17 year track record like desktop Eclipse does and obviously, Eclipse has had quite a head start in terms of supported features.
So, Theia is not the next version of Eclipse and not a replacement, but hopefully it can be as successful. It fills an important gap in the Eclipse ecosystem, which previously lacked a platform to build web-based tools, which still run on the desktop. After several suggestions, e.g. “Eclipse Two” by Dough Schaefer, such a platform has now become a realty and it is moving forward very quickly. The broad set of interested parties looks very promising to create a powerful piece of technology.
Therefore, we are contributing to Theia as well as using it in projects. Two particular features we are working on is enhancing the support for graphical editors and support for creating form-based data-centric editors in Theia.
If you are interested in using Eclipse Theia to create your own tool or to migrate an existing tool to the cloud, have a look at our service offering for support around Eclipse Theia, web-based tools or tools in general and please get in contact with us!
In any case, Theia is a very interesting and promising project. The next months and years will be important to show whether Theia can become as successful as Eclipse has been (and still is), as a technology, a community, and an ecosystem. Welcome to Eclipse, Theia!