Electron compatibility
Checked against c1b2fa4 on 2026-11-10. The files it covers are unchanged since.
Not on main yet. Running Electron apps on niso with little modification
is designed and spiked on the electron-compat branch, in its design
document docs/design/electron.md. Nothing below is on main.
The design: Electron’s API is a face over native capabilities. niso would
get native capability crates (windows, menus, tray, dialogs, notifications,
clipboard, shortcuts, shell, screen, power, secure storage), each a Rust API
with a host driver, and @niso/electron would be a JavaScript shim that
wears Electron’s API over them. The main process becomes the Node runtime’s
main script, and each BrowserWindow becomes a niso page in the same
process.
The spike runs Electron’s own quick-start apps unmodified on niso-napi, including the three IPC patterns from Electron’s docs. The hard parts it names are still open: a real window for a page driven from Node, custom protocols with asynchronous handlers, isolated worlds over one DOM, and MessagePorts for VS Code.
To read the design:
git show origin/electron-compat:docs/design/electron.md