This is the 7th day of my participation in the August More Text Challenge

Know the Electron

1.1 Origin of Electron

If you want to develop a desktop GUI application that is compatible with Mac, Windows, and Linux, there are not many technical frameworks to choose from. In the early days, most people used wxWidgets, GTK, or Qt, but they were all based on C/C++. It is very difficult for us to get started.

Jeff Atwood, co-founder of Stack Overflow, has said that anything implemented in Javascript is bound to be implemented in alternate Javascript. So nw.js and Electron come into sight, providing great convenience to front-end developers.

Both nw. js and Electron frameworks are implemented based on Chromium and Node.js, which makes it easy for the front end to use HTML, CSS and JS to build cross-platform desktop applications.

Because node.js and the front-end technology have insufficient access to the system API, both frameworks internally encapsulate the system API, such as: system dialog box, system tray, system menu, clipboard, etc.

NW.js VS Electron

Electron distinguishes the main process from the renderer process. The main process is responsible for creating, managing, and controlling the entire application lifecycle of the renderer process, which is responsible for controlling the interaction between the display page and the user. Nw.js doesn’t have to worry about that, it has to worry about the problem of all Windows sharing the same Node.js environment.

Ability to Electron NW.js
Crash reports built-in There is no
Automatic updates built-in There is no
Community activity good general
The surrounding components more general
The development of the difficulty general The lower
Well-known application more general
Maintenance personnel more general

1.2 Application of Electron

The most famous is Visual Studio Code, followed by Skype Desktop, WhatsApp Desktop, Postman, etc.

1.3 Electron ecological

Electron Builder is the electron build tool, which provides automatic download, automatic build, automatic packaging, automatic upgrade and other capabilities. Most popular electron applications are built and distributed with it.

To access local data in Electron application, traditional front-end technologies such as Cookie and localStorage can be used. You can also choose some solutions in Electron ecology. For example, RXDB is a real-time NoSQL database that can be used in Electron application. You can also use the SQLite database inside Electron.

1.4 Advantages of Electron

Electron is a desktop application based on Web technology. Web technology is one of the most widely used technologies in the field of software development, with low entry threshold and ecological prosperity.

Since The Chromium browser is built into Electron, there are few compatibility concerns. We can use the APIS defined in HTML5, CSS3, and ES6 standards in Electron.

1.5 Electron deficiency

  • Large volume of packaged applications: a simple application requires at least 40MB after being compressed and packaged.
  • Development complexity is larger: step into communication is a knowledge point that must be understood.
  • Release too fast: Electron also has a very frequent release mechanism to keep up with Chromium releases. Many new problems may arise.
  • Security issues: Electron sets some of the security concerns oF the API to be unavailable by default, but these modules and apis can be very useful, and developers sometimes turn them on, but if they don’t handle them properly, they can become a security issue.
  • Too much resource consumption: The Electron underlying browser based on Chromium has been criticized for its high resource consumption.
  • Compatibility: Electron does not support older Windows operating systems, such as Windows XP