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

Share
  • February 17, 2019

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.

The post DeskGap wants to be your go-to framework for building cross-platform desktop apps with web technologies appeared first on JAXenter.

Source : JAXenter