An alternative to Electron

DeskGap wants to be your go-to framework for building cross-platform desktop apps with web technologies

Eirini-Eleni Papadopoulou
© Shutterstock / Andrey Suslov  

Enabling native capabilities while keeping the size in check, DeskGap is a framework you may want to have a look at! Did I mention it is designed as an alternative to Electron? Let’s take a closer look.

If you are looking for a new framework to help you build cross-platform apps with web technologies like JavaScript, HTML, and CSS, then DeskGap is the tool you are looking for.

Designed to be a more lightweight alternative to Electron, DeskGap bundles a Node.js runtime and leaves the HTML rendering to the operating system‘s webview. This way, the framework enables native capabilities while keeping the in check.

Sounds interesting? Let’s have a closer look.

The features

Multi-threading architecture – DeskGap starts Node.js in a new thread to keep Node.js from blocking the UI. The node thread runs the entry script and has access to all the Node.js API, but there is no DOM access. JavaScript scripts executed inside the browser window can directly access DOM and manipulate the UI – they are running in a UI thread. Scripts in UI thread have no direct access to Node.js or any native resources just like normal browsers, but unlike browsers, a global object window.deskgap is available to UI scripts.

Communication between threads – UI threads communicate with the node thread in two ways:

  • messageUI and messageNode (analogous to Electron’s ipcRenderer and ipcMain) for sending messages.
  • asyncNode (to be documented; analogous to Electron’s remote but in an asynchronous style) for requiring CommonJS modules, invoking methods and accessing properties.

Synchronous and asynchronous dispatching – Most UI-related APIs in the node thread dispatches an action synchronously to the UI thread. Due to the lack of related functionalities provided by the system’s webview, UI threads do not have any API that synchronously dispatches actions to the node thread.

Have a look at the official documentation to find out more info on DeskGap’s functions. Keep in mind, however, that DeskGap is still a work in progress so you may find some parts of the documentation still missing.

SEE ALSO: Electron Fiddle: A playful Electron laboratory

Getting started

If you are interested in giving DeskGap a try, there are several prerequisites you should keep in mind. You can find the build instructions here.

Eirini-Eleni Papadopoulou
Eirini-Eleni Papadopoulou was the editor for Coming from an academic background in East Asian Studies, she decided that it was time to go back to her high-school hobby that was computer science and she dived into the development world. Other hobbies include esports and League of Legends, although she never managed to escape elo hell (yet), and she is a guest writer/analyst for competitive LoL at TGH.

Inline Feedbacks
View all comments