当前位置:网站首页>Electron User Guide Beginning Experience
Electron User Guide Beginning Experience
2022-08-02 22:34:00 【The front-end code farmer wang】
Introduction to Electron
1. Overview
You must have heard that electrons can be used to build amazing desktop applications!
Many development languages, such as C and Java, have long retained the ability to generate desktop applications, but building applications in these languages is very difficult.


We leverage JavaScript, HTML and CSS web technologies to build a single application and then compile the application for Mac windows and Linux.

In addition, we can also use our favorite frameworks and libraries to implement this program, such as Vue, React and other front-end frameworks.



Electron is completely cross-platform, she is compatible with Mac, Windows and Linux, you can build applications for all three platforms.



Let's go firstBuild an Electron operating environment.
2. Principle of Electron
Before we learn about Electron in depth, it is necessary for us to understand Electron's application architecture.
Electron runs in two types of processes, one is the main process and the other is the rendering process. We must know that electron can only work based on chromium, so let's take a brief look at the chromium architecture:

Let's take a look at what electron has done on the basis of chromium:

- Renderer Process
In electron, the Renderer Process is still used to render pages, which means that the electron app uses web pages as UI display and is compatible with traditional web pages.The difference is that electron app developers can optionally configure whether to support Node.js.
- Main Process
electron has made a lot of changes to the Browser Process, so it is called Main Process by another name.Main Process In addition to the original chromium runtime, the Node.js runtime is added, and main.js runs on it.
electron connects the message loop of Node.js with chromium, so that js can flexibly control page display and IPC communication with Renderer Process.Inter-Process Communication (IPC, Inter-Process Communication) refers to some technologies or methods for transmitting data or signals between at least two processes or threads.Of course, the native Node API and third-party node modules are also supported, and there are electron APIs for developers to control native menus and notifications.One thing to note is that Browser Process has no js runtime, so it also needs to rely on V8 (of course, this is V8 in chromium, not a separate V8 library).

To sum up, a Main Process (main process) and one or more Rederers (rendering process) constitute the operating structure of Electron.Let's call the main process the Server-side server and the rederen process the client.
- electron uses Node.js native modules

边栏推荐
- Lvm逻辑卷
- ssh配置
- 解析List接口中的常用的被实现子类重写的方法
- MaxCompute 近期发布上线的版本的 SQL 引擎新功能参数化视图有什么优势?
- LeetCode - 105. 从前序与中序遍历序列构造二叉树;023.合并K个升序链表
- 译出我精彩 | 7月墨力翻译计划获奖名单公布
- 技术分享 | Apache Linkis 快速集成网页IDE工具 Scriptis
- 【LeetCode】622. 设计循环队列
- Unity 打包和切换平台|Build Settings窗口介绍
- You want the metagenomics - microbiome knowledge in all the (2022.8)
猜你喜欢
随机推荐
You want the metagenomics - microbiome knowledge in all the (2022.8)
Nature Microbiology综述:聚焦藻际--浮游植物和细菌互作的生态界面
Geoserver + mysql + openlayers problem
竞赛:糖尿病遗传风险检测挑战赛(科大讯飞)
7.21 - 每日一题 - 408
Detailed explanation of common examples of dynamic programming
安装Mac版Mysql卡在Installation阶段,彻底清理mysql并重装mysql
golang刷leetcode 经典(10) tire树与ac自动机
2022-07-28
入职对接-hm项目
分享一个 web 应用版本监测 (更新) 的工具库
MaxCompute 的SQL 引擎参数化视图具体有哪些增强功能?
【学习日记】win64配置openni的vs2022编译环境
J9 digital theory: the Internet across chain bridge has what effect?
基于OpenGL的冰川与火鸟(光照计算模型、视景体、粒子系统)
Redis 5 种数据结构及对应使用场景
姑姑:给小学生出点口算题
Flutter自带国际化适配自动生成方案
【LeetCode】622. 设计循环队列
JVM内存和垃圾回收-06.本地方法栈









