Skip to content

build(electron): upgrade the Electron runtime from 39 to 44 - #182

Merged
mrsibe merged 1 commit into
mainfrom
build/electron-44
Sep 30, 2026
Merged

mrsibe merged 1 commit into
mainfrom
build/electron-44

Conversation

@mrsibe

@mrsibe mrsibe commented Sep 30, 2026

Copy link
Copy Markdown
Owner

What

One manifest line: electron ^39.4.0 → ^44.5.0 (lockfile resolves 44.5.0).

No application code changes were required.

Why now

Electron supports only the newest three stable majors. 39 is outside that window, so it no longer receives Chromium / V8 / Node security fixes. 44.5.0 is the current stable (45 is not stable yet). Electron 44 also moves the runtime onto Node 24, which matches the Node 24 that CI and CONTRIBUTING.md already require.

Breaking-change review (Electron 40 → 44)

Checked the official breaking-changes.md against every Electron API this app reaches (ipcMain, BrowserWindow, net.fetch, protocol.handle, shell.openExternal/openPath, dialog, Menu, app.*, webContents.*):

Change Applies here?
44 — clipboard rearchitected + removed from renderer No. The only clipboard call is navigator.clipboard.writeText in MessageItem.tsx, not the electron module.
44 — macOS 12 dropped; Windows ia32 / Linux armv7l dropped No. No ia32/armv7l packaging targets.
44 — app.isUnityRunning() removed; login-item attributes removed No. Neither is used.
44 — ANGLE statically linked (libEGL/libGLESv2 no longer shipped) No. The app does not ship or swap those.
43 — dialog defaultPath now defaults to Downloads Yes, behavior-only. Flagged below.
42 — macOS notifications require code signing No. No Notification usage.
42 — Session.clearStorageData({ quotas }) removed No such call.
41 — PDFs render in the same WebContents No. PDFs are parsed by pdfjs-dist, not Chromium's viewer.
42 — electron no longer self-downloads in postinstall Yes, operational. Flagged below.

Verification (Linux x64, WSL2)

Command Result
npm run typecheck clean
npm test 469/469 pass
npm run build:unpack && npm run smoke:packaged 29 checks pass

The packaged run confirms the native surface rebuilt for the new ABI:

electron 44.5.0, bundled node 24.21.0, modules ABI 149
[SmokeTest] ok   better-sqlite3 opened the database and loaded the sqlite-vec extension
[SmokeTest] ok   sqlite-vec reports version v0.1.7-alpha.2
[SmokeTest] ok   FTS5 is available and ranks: sqlite 3.53.2, ENABLE_FTS5 flag present
[SmokeTest] ok   @huggingface/transformers and onnxruntime-node load
[SmokeTest] PASS - 29 checks passed

@electron/rebuild rebuilt better-sqlite3 for ABI 149 without falling back to a source compile problem. macOS/Windows packaging is left to verify.yml + release.yml.

Two behavior changes to be aware of (not failures)

  1. Electron 42 stopped downloading the binary in the electron package's postinstall. npm ci no longer populates node_modules/electron/dist. I verified npm run build (electron-vite) does not need the binary, electron-builder fetches its own copy, and npm run dev / npm run eval fetch it on first run. No repo change needed, but first-run dev now downloads ~150 MB instead of it happening at install time.
  2. Electron 43 makes dialog.showOpenDialog/showSaveDialog default defaultPath to Downloads instead of the OS's last-used directory. The app passes no defaultPath, so dialogs now start in Downloads and the OS no longer remembers the last directory. Calling this out explicitly — happy to add remembered-directory handling as a follow-up if that is wanted, but it does not belong in an Electron bump.

Relationship to the sqlite-vec PR

Independent. It touches a different package.json line, but both PRs edit package-lock.json, so whichever merges second needs a lockfile rebase. The smoke output above intentionally shows the old sqlite-vec (v0.1.7-alpha.2) because this branch is based on main.

Rollback

Revert the one manifest line and regenerate the lockfile. No schema, storage format, or app code changed, so a rollback needs no data migration.

Electron supports only the newest three stable majors. 39 is out of that
window, so it no longer receives Chromium/V8/Node security fixes and the
bundled native ABI is frozen. 44.5.0 is the current stable; 45 is not stable
yet. 44 also brings the runtime onto Node 24, matching the Node 24 used by CI
and required by CONTRIBUTING.

No application code changes were needed. The lockfile churn is Electron's own
dependency tree (@electron/get, extract-zip -> @electron-internal/extract-zip,
its nested @types/node), not ours.

Checked against the Electron 40-44 breaking changes for the APIs this app
actually uses (ipcMain, BrowserWindow, net.fetch, protocol.handle/openExternal,
dialog, Menu, app.*):

- clipboard: the renderer uses navigator.clipboard.writeText, not the removed
  electron clipboard module.
- no new Notification / setLoginItemSettings / net.request frame-destination
  usage.
- no ia32 or armv7l packaging targets, so the dropped 32-bit builds do not apply.

Verified on Linux x64 (WSL2):

- `npm run typecheck` - clean
- `npm test` - 469/469 pass
- `npm run build:unpack && npm run smoke:packaged` - 29 checks pass, including
  better-sqlite3 rebuilt against Electron 44 (ABI 149), sqlite-vec loaded from
  app.asar.unpacked, FTS5 + bm25(), and @huggingface/transformers +
  onnxruntime-node loading.

Two behavior changes worth knowing, neither a failure:

- Electron 42 stopped downloading the binary in the `electron` package's
  `postinstall`. `npm ci` no longer populates `node_modules/electron/dist`;
  `npm run build` does not need it, `electron-builder` fetches its own copy, and
  `npm run dev` / `npm run eval` fetch it on first run.
- Electron 43 dialogs default `defaultPath` to Downloads instead of the OS's
  last-used directory. The app passes no `defaultPath`, so the open/save dialogs
  now start in Downloads. Flagging it rather than silently changing UX.

macOS/Windows packaging is left to CI verify + release.

Supersedes nothing; independent of the sqlite-vec bump, which touches different
lines of package.json and will need a lockfile rebase if merged second.
@github-actions github-actions Bot added the build Build, packaging and CI label Sep 30, 2026
@mrsibe
mrsibe merged commit a48e6d3 into main Sep 30, 2026
4 checks passed
@mrsibe
mrsibe deleted the build/electron-44 branch September 30, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, packaging and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant