- Project developed to understand concepts and play with electronJS technology.
- It allows you to switch between dark, light and system themes;
- Navigates between home and about pages.
-
The different responsabilities that
main.js
,preload.js
andrenderer.js
has:main.js
(Main process):- Is the application main process;
- Responsible to be the application entry point;
- Handle application lifecycle;
- Able to extend APIs that interact with user's OS;
- Docs link.
renderer.js
(Renderer process):- It is a different process. Can not access the main process;
- Has no direct access to any NPM/Native module;
- The main responsability is to render web content;
- Usually is used to manipulate user interface;
- Docs link.
preload.js
:- Executed before web content begins loading;
- Has privileges to access Node and Electron APIs;
- Can expose APIs so
renderer.js
can interact with the main process. Exposes usingcontextBridge
andipcRenderer
from electron. - Docs link.
-
Context isolation:
- Uses
contextBridge
andipcRenderer
to allow web content (renderer process) switch between system, dark and light themes. - The main motivation for this context isolation concept is to prevent web contents accessing the Electron internal APIs.
- Docs link.
- Uses
-
IPC - Inter-Process Communication:
- TODO:
- Docs link
yarn
yarn start