Foundations and setup
What Electron is
Understand how Electron combines Chromium and Node.js to run one JavaScript application on macOS, Windows, and Linux.
8 minute lesson
Electron combines Chromium, Node.js, and desktop operating-system APIs in one application runtime.
Chromium renders HTML and CSS. Node.js and Electron APIs let privileged code work with files, windows, menus, and native dialogs. Your users install the application, not Node.js or a separate browser.
This does not turn every page into one powerful JavaScript environment. Electron uses several processes and security boundaries. The page stays in a renderer. Privileged work belongs in the main process. A preload script exposes the small bridge between them.
Shipping the runtime gives us consistent web capabilities across macOS, Windows, and Linux. It also has costs:
- the application contains a browser engine, so downloads and memory use are larger
- every supported platform needs packaging and testing
- the application must keep Electron current for Chromium and Node.js security fixes
- a renderer security bug can become a desktop security bug if privileges are exposed carelessly
During this course we will build Desktop Notes. It will store local notes, use a native menu and save dialog, then produce an installable application.
The important result is not the note editor. It is the boundary around it: untrusted interface data crosses a narrow API before privileged code touches the computer.
Lesson completed