当前位置:网站首页>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
边栏推荐
- 汇编实例解析--利用tcb,tss,全局tss,ldt管理任务实现任务切换
- LeetCode - 105. 从前序与中序遍历序列构造二叉树;023.合并K个升序链表
- 腾讯云孟凡杰:我所经历的云原生降本增效最佳实践案例
- Leetcode刷题——23. 合并K个升序链表
- Geoserver+mysql+openlayers
- ALV概念讲解
- MySQL安装时一直卡在starting server
- 光源控制器接口定义说明
- Based on OpenGL glaciers and firebird (illumination calculation model, visual, particle system)
- 【LeetCode】1374. 生成每种字符都是奇数个的字符串
猜你喜欢
脑机接口003 | 马斯克称已实现与云端的虚拟自己对话,相关概念股份大涨
ShardingSphere-proxy +PostgreSQL实现读写分离(静态策略)
MOSN 反向通道详解
NC | Structure and function of soil microbiome reveal N2O release from global wetlands
MySQL安装配置教程(超级详细)
Golang swagger :missing required param comment parameters
【Psychology · Characters】Issue 1
Kali命令ifconfig报错command not found
What is the use of IT assets management software
MySQL安装配置教程(超级详细、保姆级)
随机推荐
ABAP语法小复习
JVM内存和垃圾回收-03.运行时数据区概述及线程
我用这一招让团队的开发效率提升了 100%!
Metaverse 001 | Can't control your emotions?The Metaverse is here to help you
shell:条件语句
Geoserver+mysql+openlayers
如何ES源码中添加一个自己的API 流程梳理
扫码预约 | 观看Apache Linkis数据处理实践以及计算治理能力
What is the use of IT assets management software
NC | Structure and function of soil microbiome reveal N2O release from global wetlands
MOSN 反向通道详解
解析Collection接口中的常用的被实现子类重写的方法
What is a Field Service Management System (FSM)?what is the benefit?
动态折线图,制作原来是这么简单
如何正确地配置入口文件?
一款好用的FAQ搭建工具
J9 digital theory: the Internet across chain bridge has what effect?
【软件工程导论】软件工程导论笔记
【Psychology · Characters】Issue 1
JVM内存和垃圾回收-05.虚拟机栈