This tutorial we learn Electron the basics, let's first learn what is Electron .

What is Electron

Electron is an open source framework developed by GitHub It allows the use of Node.js (as backend) and Chromium (as frontend) to complete the development of GUI

Electron can be used to build cross-platform desktop applications HTML , CSS , JavaScript Chromium by contracting 060b241e50b57e and node.js a running environment, and the application can be packaged into Mac , Windows and Linux

development path

In 2013, the Atom editor came out, and as the underlying framework Electron was gradually known to implement it, it was open sourced in the spring of 2014, when it was still called Atom Shell . In the next few years, Electron is constantly updated and iterated, and there is a major milestone almost every year:

  • In April 2013, Electron started under the name Atom Shell
  • In May 2014, Atom and Atom Shell were open sourced under the MIT license.
  • In April 2015, the project was renamed Electron .
  • On May 11, 2016, the electronic version v1.0.0 released.
  • On May 20, 2016, it was allowed to submit software packages to the Mac App Store.
  • August 2, 2016, support Windows Store
  • 2.0.0 released on May 2, 2018

Support platform

Currently, the platforms that Electron OS X , Windows , Linux :

  • OS X : For the OS X system, there are only 64-bit binary files, and the minimum supported version is OS X 10.8 .
  • Windows : Only Windows 7 and later versions are supported. The previous version does not work. For Windows x86 and amd64 (x64) versions are provided. It should be noted that the ARM version of Windows is not currently supported.
  • Linux : precompiled ia32 ( i686 ) and x64 ( amd64 ) version Electron binaries are in Ubuntu 12.04 compiled under, arm version of the binary file is in ARM v7 (hardware floating point ABI completed under the Debian Wheezy version of NEON). Whether the pre-compiled binary file can run depends on whether it includes the library linked by the compilation platform, so only Ubuntu 12.04 can guarantee normal operation, but Ubuntu 12.04+ , Fedora 21 , Debian 8 etc. have also been confirmed to run the pre-compiled version of Electron.

Pros and cons of Electron

Electron are as follows:

  • It is easy to deploy and upgrade, and users can access it through a browser.
  • HTML/JS/CSS written, convenient and efficient.
  • It can support Windows , Linux , Mac systems.

Electron are as follows:

  • For developers: browser adaptation is more cumbersome. Some applications must specify the browser version (for example, OCX must be the IE kernel, H5 must be a higher version), the browser must be opened, and a long string of URL addresses must be entered.
  • For users: Some users in traditional industries are web applications, especially when using professional tool software. Most of them feel that web applications are not as practical as desktop applications.

Software based on Electron

Electron has been used by a number of open source applications. Among them, the Atom , Alipay applet IDE , and Visual Studio Code editors that are well-known and used by programmers are implemented Electron

We open the Visual Studio Code editor and find "Help --> Switch Developer Tools" in the menu, as shown below:

Then you can see the familiar Chrome devtool on the interface, as shown in the following figure:


知否
221 声望177 粉丝

Skrike while the iron is hot.


« 上一篇
Gulp API
下一篇 »
Electron 安装