- Main Process
- create/manage browser windows (run its own web page/GUI)
- can be only one main process
- communicates with OS to make use of native GUI features
- Renderer Process (visible)
- every browser window created by main process gives rise to a renderer process
- shows a webpage (renders the GUI)
- using React, we only need one tab (one renderer process) by writing a SRA
- Renderer Process (Hidden)
- perform thread blocking task
- Python Script
- use
python-shell
- use
- Main <-> Renderer:
- electron IPC
- acts like event listeners
- Visible Renderer <-> Hidden Renderer
- sending messages across the main process like a relay system
- Hidden Renderer <->ython Script
python-shelluses stdin and stdout to send a receive data from py script.- use JSON message format
-
electron is saved as a dev dependency because
electron-builder(packaging tool) will add electron into final build -
wait-onwaits for a process to finish execution. -
electron.jsis in the public folder due to production build -
visible renderer:
- request main renderer to start a background process
- listen for an event that the background process will send back