Lightweight alternatives to Electron

December 01, 2019

The paradox of Electron is the bundling of a full Chromium instance while all users already have a browser installed locally.

The problem comes when users run several Electron apps at once, and each comes with its own overhead (i.e. the runtime memory consumption of the browser-runtime as a whole, independent of how many render contexts are open.).

This is quite inefficient but sadly there are no true cross-platform webview standard as of today that Electron could use.

So what are some alternatives to be considered?

The alternatives we’ll have a look at are:

  • Allow to use HTML/CSS/JS to build desktop apps
  • Cross-platform
  • Don’t package a full browser when shipping your app

webview

Webview is a tiny cross-platform webview library with bindings for C/C++/C#/Golang/Python. It uses WebKit (Gtk on Linux / Cocoa on MacOS) or Edge (on Windows).

It supports two-way JavaScript bindings (to call JavaScript from native code and to call native code from JavaScript) so that you can build apps that have access to the os.

As opposed to Electron, you have to deal with cross-browser web compatibility issues between WebKit and Edge, but this is something you can handle.

There are bindings for Node.js (although not very popular) and the repo gives good examples as to how to use the project:

const { WebView } = require('../')
const express = require('express')

const app = express()
app.use(express.static(__dirname))
app.listen(3000)

const view = WebView({
	title: 'Home',
	url: `http://localhost:3000/index.html`,
	height: 600,
	width: 800,
})

view.show()

Neutralino

Neutralino is a somewhat new project which aims to be as easy as Electron but using the already installed browsers.

That means smaller packages (< 10mb) and smaller RAM footprint (<10mb) for your users.

Check out this benchmark comparison if you’re interested.

Proton Native

If you have experience with React Native, Proton Native will be very familiar to you.

It uses the same components as React Native, it makes it easy to build real native apps from Javascript.

Great if your UI needs aren’t too complex.

Carlo

Carlo was another alternative by the Google Chrome team. Same as Neutralino, you get full access to Node and the user system.

It works as long as the user has Google Chrome installed.

However it’s not maintained anymore and has a lot of bugs open that have gone long without being fixed.

We can only hope a community fork will continue the work.


I don’t think these projects are ready to be used over Electron for most apps yet. Electron’s force is also the huge community, the tutorials, articles and years of bug fixing that makes the development experience really smooth.

That being said, definitely keep them in mind if your next app doesn’t need all the native APIs that Electron provides.

Do you have a minute?

Nucleus provides analytics for your desktop apps so you can follow and understand your users.

Discover →