Electron (software framework)

Electron (formerly known as Atom Shell ) is a free and open-source software framework developed and maintained by OpenJS Foundation. The framework is designed to create desktop applications using web technologies (mainly HTML, CSS and JavaScript, although other technologies such as front-end frameworks and WebAssembly are possible) that are rendered using a version of the Chromium browser engine and a back end using the Node.js runtime environment. It also uses various APIs to enable functionality such as native integration with Node.js services and an inter-process communication module.

Electron was originally built for Atom and is the main GUI framework behind several other open-source projects including GitHub Desktop, Light Table, Visual Studio Code, WordPress Desktop and Eclipse Theia.

Architecture
Electron applications include a "main" process and several "renderer" processes. The main process runs the logic for the application (e. g. menus, shell commands, lifecycle events), and can then launch multiple renderer processes by instantiating an instance of the BrowserWindow class, which loads a window that appears on the screen by rendering HTML and CSS.

Both the main and renderer processes can run with Node.js integration if the nodeIntegration field in the main process is set to true.

Most of Electron's APIs are written in C++ or Objective-C and are exposed directly to the application code through JavaScript bindings.

History
In September 2021, Electron moved to an eight-week release cycle between major versions to match the release cycle of Chromium Extended Stable and to comply with a new requirement from the Microsoft Store that requires browser-based apps to be within two major versions of the latest release of the browser engine.

Electron frequently releases new major versions along every other Chromium release. The latest three stable versions are supported by the Electron team.

Usage
Desktop applications built with Electron include Atom, balenaEtcher, Eclipse Theia, Microsoft Teams, Slack and Visual Studio Code. Brave Browser was based on Electron before it was rewritten to use Chromium directly.

Reception
The most common criticism of Electron is that it necessitates software bloat when used for simple programs. As a result, Michael Larabel has referred to the framework as "notorious among most Linux desktop users for being resource heavy, not integrating well with most desktops, and generally being despised." Meanwhile, Joey Sneddon states that this tradeoff is sensible as Electron greatly lowers the cost of developing and maintaining cross-platform software.

Researchers have shown that Electron's large feature set can be hijacked by bad actors with write access to the source JavaScript files. This requires root access on *nix systems and isn't considered to be a vulnerability by the Electron developers. Those who are concerned that Electron is not always based on the newest version of Chromium have recommended progressive web applications as an alternative.