Migrating from Electron

Point your imports at the drop-in shim, find the gaps immediately instead of at 2 a.m., and move renderer device access into the main process.

Bunmaska is drop-in for the core module set. Most apps that live inside app / BrowserWindow / ipcMain / Menu / dialog / clipboard / shell / Tray map across with an import change. The long tail is a different story - and we’ll be honest about which is which.

Change your imports

// Before
import { app, BrowserWindow, ipcMain } from "electron";

// After
import { app, BrowserWindow, ipcMain } from "bunmaska";

Or use the explicit compatibility shim, which throws an actionable error naming the exact missing module instead of handing you a silent undefined to debug:

import { app, BrowserWindow } from "bunmaska/electron";

Reaching for a known-but-unimplemented module (say electron.netLog) fails loudly and tells you what’s missing. You find the gaps in the first five minutes, not in production.

What ports cleanly

Windows, web contents, IPC, context isolation, menus, dialogs, clipboard (incl. images), tray, protocol handlers, power monitoring, safeStorage, nativeImage, nativeTheme, globalShortcut, notifications, screen info - on both macOS and Linux. See the parity matrix for method-level detail.

What needs real work

  • BrowserView / WebContentsView - Bunmaska is single-process; these aren’t available.
  • Synchronous IPC (ipcRenderer.sendSync) - the context bridge is async-only. Move to invoke.
  • The Chromium-internal surface - desktopCapturer, net/netLog, webRequest/proxy, crashReporter, contentTracing, extensions. Out of scope by design.

The one migration detail that bites

Web Serial, WebHID, and WebUSB are Chromium-only. System WebKit does not expose navigator.serial / .hid / .usb. If your Electron app does device access from the renderer, that code is not drop-in - it must move to the main process and cross IPC.

The upside: device access in the main process via Bunmaska’s buildless native modules is arguably cleaner than node-serialport - no node-gyp, no electron-rebuild, no per-arch prebuilds. An Electron app that already does serial in the main process maps over almost unchanged.

The honest framing: Bunmaska is “drop-in if you live inside the core module set.” If you lean on session.cookies, BrowserView, sync IPC, Web Serial, or an N-API addon, expect an architecture change, not a recompile.