Skip to content

chore(desktop): upgrade electron to v40#1194

Merged
Kitenite merged 5 commits intomainfrom
kitenite/upgrade-electron
Feb 4, 2026
Merged

chore(desktop): upgrade electron to v40#1194
Kitenite merged 5 commits intomainfrom
kitenite/upgrade-electron

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 4, 2026

Summary

  • Upgrade Electron from v39 to v40 (Chromium 134, Node 22.15)
  • Upgrade electron-builder ^26.0.12 → ^26.4.0
  • Upgrade electron-updater 6 → ^6.7.3
  • Upgrade @sentry/electron ^7.5.0 → ^7.5.1
  • Upgrade better-sqlite3 12.5.0 → 12.6.2
  • Upgrade node-pty 1.1.0-beta30 → 1.1.0 (stable release)
  • Upgrade turbo ^2.5.8 → ^2.8.3

No breaking API changes — the codebase uses modern Electron patterns (contextBridge, preload scripts, IPC). electron-vite kept at v4 since v5 introduces ESM resolution issues with workspace packages.

Test plan

  • bun run compile:app builds successfully
  • bun run typecheck passes with 0 errors
  • Smoke test the app locally (bun run dev)
  • Verify terminal sessions work (node-pty rebuilt)
  • Verify local DB operations work (better-sqlite3 rebuilt)

Summary by CodeRabbit

  • Chores
    • Updated desktop dependencies and tooling for maintenance and compatibility (Electron ecosystem, native modules, Sentry, updater, prebuild tooling).
    • Bumped development build toolchain.
    • Updated configuration/schema reference for linting/formatting tooling.
    • No user-facing functional, UI, or behavior changes — maintenance-only updates.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Dependency version bumps: desktop app dependency updates in apps/desktop/package.json (multiple packages and added prebuild-install), a dev tooling bump for turbo in root package.json, and a schema version bump in biome.jsonc. No functional or public API changes.

Changes

Cohort / File(s) Summary
Desktop dependencies
apps/desktop/package.json
Bumped several dependencies: @sentry/electron (^7.5.0 → ^7.7.0), better-sqlite3 (12.5.0 → 12.6.2), electron-updater (6 → ^6.7.3), node-pty (1.1.0-beta30 → 1.1.0); added prebuild-install ^7.1.1. DevDependencies aligned with Electron/electron-builder version bumps.
Build tooling
package.json
DevDependency turbo bumped from ^2.5.8 → ^2.8.3.
Tooling schema
biome.jsonc
Schema reference updated from 2.3.12 → 2.3.14; no other config changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇 I hopped through deps with a curious twitch,
Bumped electrons, ptys, and a tiny new switch.
Turbo stretched, biome sighed, prebuild found a spot,
A rabbit's quick cheer — the versions are hot! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(desktop): upgrade electron to v40' clearly and concisely summarizes the main change in the PR, which is upgrading Electron to v40.
Description check ✅ Passed The PR description covers key information: a clear summary of changes, specific version upgrades, testing performed, and notes about API compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/upgrade-electron

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/desktop/package.json`:
- Around line 188-189: Update packaging to rebuild native modules for Electron
40: add an `@electron/rebuild` step (or enable electron-builder's "npmRebuild" /
"asarUnpack" workflow) so native modules like better-sqlite3 (v12.6.2) and
node-pty (v1.1.0) are rebuilt against Electron 40 / Node 24.11.1 before
bundling; ensure your build script that runs when "electron": "40.0.0" is used
invokes `@electron/rebuild` or equivalent. Also audit renderer code for direct use
of clipboard and move clipboard access into a preload script exposed via
contextBridge (replace direct renderer calls with an ipc/contextBridge wrapper)
so clipboard is not accessed from renderer processes.

Comment thread apps/desktop/package.json
Comment on lines +188 to +189
"electron": "40.0.0",
"electron-builder": "^26.4.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Electron 40 release notes breaking changes

💡 Result:

Electron v40.0.0 breaking changes (per official release notes / breaking-changes docs):

  • Deprecated: Using the clipboard API directly from renderer processes. If you need clipboard from a renderer, move the call to a preload and expose it via contextBridge. [1][2]
  • Behavior change (debug symbols): macOS dSYM artifacts switched from dsym.zip to dsym.tar.xz (xz compression) to support larger files; tooling that downloads/consumes Electron dSYMs may need to handle .tar.xz. [1][2]

Sources: [1] Electron v40.0.0 release notes, [2] Electron “Breaking Changes” (Planned Breaking API Changes 40.0).


🌐 Web query:

Electron 40 Node 22.15 native module compatibility

💡 Result:

Electron 40.0.0 ships with Node.js 24.11.1, not Node 22.15.0. So a native addon binary built against Node 22.15.0’s Node-ABI (NODE_MODULE_VERSION) generally will not load in Electron 40—you must use an Electron-40 build (or rebuild from source) of the module. [1][2]

What to do:

  • If the module uses Node-ABI (most node-gyp addons): rebuild it for Electron 40 (recommended tool: @electron/rebuild). Electron explicitly requires native modules be recompiled for Electron’s ABI. [2][3]
  • If the module uses N-API (“napi” builds): it’s often portable across Node/Electron versions. Node 22.15.0 reports N-API v127, and a N-API addon built for a given N-API version typically works on runtimes that support that version. Still, prefer Electron-specific prebuilds when available, or rebuild if you hit load/link errors. [4][2]

If you specifically need Node 22.15 compatibility, that corresponds to older Electron nightlies/branches, not Electron 40 stable. (Electron 40 stable is already on Node 24.) [1]

Sources: Electron 40 release metadata (Node 24.11.1) [1]; Electron native module ABI guidance [2]; @electron/rebuild purpose [3]; Node 22.15.0 N-API version [4].


🌐 Web query:

better-sqlite3 node-pty Electron 40 compatibility

💡 Result:

Electron 40.0.0 (released Jan 13, 2026) ships with Node.js 24.11.1 (plus Chromium 144 / V8 14.4). That means native addons must be rebuilt (or have prebuilds) targeting Electron 40’s ABI, not your system Node. [1][2][3]

better-sqlite3 ↔ Electron 40

  • Electron 40’s embedded Node 24 generally requires better-sqlite3 v12.x (older major versions won’t load/build against newer Node ABIs). Community tracking around Node 24 support also notes that early v12.0.0 had missing prebuilds in some cases—so prefer v12.1.0+ if you want the best chance of available prebuilds. [4][5]
  • If you don’t get a matching prebuild for Electron 40, rebuild it for Electron (not Node) using @electron/rebuild (Electron docs recommend this approach for native modules). [6]

node-pty ↔ Electron 40

  • node-pty is also a native addon, so it has the same rule: it must be compiled for Electron’s ABI. (Upstream notes Node/Electron minimums and expects builds aligned with the Electron/VS Code toolchain.) [7]
  • If you want prebuilt binaries, a common approach is switching from node-pty to @homebridge/node-pty-prebuilt-multiarch; it downloads a matching prebuild when available and otherwise falls back to building via node-gyp. Whether Electron 40 prebuilds exist depends on that package’s release artifacts, but the fallback build path is built-in. [8][9]

Practical compatibility checklist (Electron 40)

  1. Pin/upgrade native deps:
    • better-sqlite3: >= 12.1.0 (often safest for Node 24-era builds/prebuilds). [4][5]
    • node-pty: either rebuild from source for Electron 40, or consider the Homebridge prebuilt fork. [6][8][9]
  2. Ensure your install/CI runs an Electron-native rebuild step (e.g. @electron/rebuild) so packaged apps don’t ship Node-built .node binaries. [6]

Sources: Electron 40 release details [1][2][3], Electron native module rebuild guidance [6], better-sqlite3 Node 24/prebuild context [4][5], node-pty / prebuilt fork behavior [7][8][9].


Ensure native modules are rebuilt for Electron 40 (Node 24.11.1), and verify clipboard API usage.

Electron 40.0.0 ships with Node 24.11.1 (not 22.15). Both better-sqlite3 (v12.6.2) and node-pty (v1.1.0) must be rebuilt against Electron 40's native ABI—prebuilt binaries for Node 22 will not load. Use @electron/rebuild during packaging to ensure bundled modules target Electron's runtime.

Additionally, verify that the application does not use the clipboard API directly from renderer processes; this is now deprecated in Electron 40 and must be moved to a preload script exposed via contextBridge.

🤖 Prompt for AI Agents
In `@apps/desktop/package.json` around lines 188 - 189, Update packaging to
rebuild native modules for Electron 40: add an `@electron/rebuild` step (or enable
electron-builder's "npmRebuild" / "asarUnpack" workflow) so native modules like
better-sqlite3 (v12.6.2) and node-pty (v1.1.0) are rebuilt against Electron 40 /
Node 24.11.1 before bundling; ensure your build script that runs when
"electron": "40.0.0" is used invokes `@electron/rebuild` or equivalent. Also audit
renderer code for direct use of clipboard and move clipboard access into a
preload script exposed via contextBridge (replace direct renderer calls with an
ipc/contextBridge wrapper) so clipboard is not accessed from renderer processes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 4, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

- electron 39.1.2 → 40.0.0
- electron-builder ^26.0.12 → ^26.4.0
- electron-updater 6 → ^6.7.3
- @sentry/electron ^7.5.0 → ^7.5.1
- better-sqlite3 12.5.0 → 12.6.2
- node-pty 1.1.0-beta30 → 1.1.0 (stable)
- turbo ^2.5.8 → ^2.8.3
electron-builder 26.7.0's dependency traversal requires prebuild-install
to be resolvable as a production dependency of better-sqlite3.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/desktop/package.json`:
- Line 47: The dependency entry for "@sentry/electron" currently uses an invalid
version string "^7.5.1"; update the version in package.json to a published
release (e.g. "7.5.0", "7.6.0", or "7.7.0") by replacing "^7.5.1" with the
chosen valid version, then run your package manager (npm/yarn/pnpm) to
regenerate the lockfile and install the correct package; ensure the change is
committed so CI uses the updated lockfile.

Comment thread apps/desktop/package.json Outdated
7.5.1 does not exist as a published version.
@Kitenite Kitenite merged commit cc2189a into main Feb 4, 2026
5 of 6 checks passed
@Kitenite Kitenite deleted the kitenite/upgrade-electron branch February 4, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant