Electron

Desktop TIBET

wins

  • Build cross-platform desktop and web applications with a single library.
  • Leverage a large-scale library built to run offline but fully HTTP-capable.
  • Use interactive development tools for faster desktop app development.

concepts

One of the long-standing problems in the IT industry is developing cross-platform applications that run on Windows, Macs, and Linux/Unix platforms.

While we'd be the first to agree that web technologies were not initially designed as an application platform, porting apps from historical platforms such as PowerBuilder, Delphi, Visual Basic, etc. to the web is a direct response to the cross-platform problem.

Electron, a pairing of Node.js with the Chrome browser, is a powerful solution that makes building cross-platform desktop applications possible using web technology, one leveraged by popular desktop apps like the extremely popular Slack product.

Electron applications run on Windows®, Mac OS®, and Linux® making them a powerful option for building cross-platform desktop applications. TIBET gives you a library uniquely qualified to take maximum advantage of the Electron platform.

TIBET applications run out of the box with Electron, in fact TIBET ships with Electron 'dna' for the tibet clone command letting you create a new TIBET+Electron project in seconds.

$ tibet clone --dna electron HelloElectron
$ cd HelloElectron
$ tibet init
$ tibet start  # or tibet electron

TIBET+Electron
TIBET+Electron

cookbook

Getting Started

Creating A TIBET+Electron Project

TIBET+Electron projects are built using TIBET's standard tibet clone/tibet init approach. Simply add --dna electron to get an Electron project:

$ tibet clone  --dna electron
$ cd 
$ tibet init

Development

Running Your Electron App

You can use tibet start or tibet electron to start your Electron project.

The tibet electron command is your best choice:

$ cd 
$ tibet electron

…or…

$ cd 
$ tibet start
No server.js found...
Found electron.js...
Running 'tibet electron'...

Note that when you use tibet start it will be looking for a server.js file and then delegate over to tibet electron if the project contains an electron.js file.

Developing For The main Process

Describing how to build additional functionality in the 'main process' (aka the "server") is best left to the Electron Documentation. TIBET+Electron projects use an electron.js file which loads your TIBET application just with any other TIBET project.

Developing For The renderer Process

Developing for the renderer process is identical to developing for Chrome. All of TIBET's functionality is available to you, including all of TIBET's interactive development tools, the TIBET command line, etc. See the documentation for those components for details.

Testing Your Electron App

Like any TIBET project, your TIBET+Electron project is testable right out of the box using the tibet test command:

$ tibet test
# Loading TIBET platform at 2019-08-02T01:53:29.910Z
# TIBET reflection suite loaded and active in 6469ms
# TIBET starting test run
# 2 suite(s) found.
1..3
#
# tibet test APP --suite='APP'
ok - Has a namespace.
ok - Has an application type.
# pass: 2 total, 2 pass, 0 fail, 0 error, 0 skip, 0 todo, 0 only.
#
# tibet test APP.HelloElectron.app.Type --suite='APP.HelloElectron:app'
ok - Is a templated tag.
# pass: 1 total, 1 pass, 0 fail, 0 error, 0 skip, 0 todo, 0 only.
#
# PASS: 3 total, 3 pass, 0 fail, 0 error, 0 skip, 0 todo, 0 only.

code

At the present time there's no Electron-specific code in the TIBET client. In some sense that's a testament to both the Electron platform and TIBET's offline-first design.

That said, we do have plans for tighter integration with Electron's Node.js foundation so you have TIBET-supported APIs for interacting with the file system and with other services.

The TIBET Sherpa will eventually be fully-supported on Electron as well.