Skip to content

Upgrade Electron version #73

@clintharris

Description

@clintharris

Upgrading from Electron 37.x to 40.x mainly gives you newer Chromium/V8/Node, many stability and security fixes, some new platform features (HDR, accessibility, Wayland, macOS tooling changes), and a few deprecations you need to account for.electronjs

Runtime upgrades

  • Electron 40 bundles Chromium 144 (vs Chromium 140/141 range in 37.x), V8 14.4, and Node 24.11.1.
  • This improves JS performance, modern web API support, and pulls in a large batch of upstream security fixes from Chromium and Node.

Security and stability

  • Multiple 38–40 patch releases focus on crash fixes (window close callbacks, child windows, GPU info, PipeWire screenshare, etc.), so jumping to 40.x rolls up many reliability improvements over 37.x.releases.
  • Newer Chromium + Node versions also reduce your exposure to known CVEs compared with staying on 37.x, which is important for production desktop apps.

Platform and UX improvements

  • Better Wayland behavior: Electron 38+ changes the default ozone platform to auto and prefers native Wayland in Wayland sessions, improving Linux integration (especially on modern desktops).[electronjs]​
  • Windows and macOS windowing and titlebar behavior see multiple fixes (transparent window flicker, resize issues, accent borders, hover contrast, frameless resize in Mac App Store builds).

New APIs and capabilities

  • HDR/offscreen rendering: RGBAF16 output format with scRGB HDR color space for offscreen rendering helps high‑dynamic‑range or color‑sensitive apps.
  • New helpers like app.isHardwareAccelerationEnabled(), more granular accessibility controls, and the ability to disable auto‑focus on navigation via webPreferences.focusOnNavigation in 40.6.0 can simplify complex app behavior.

Clipboard and preload changes

  • In 40, direct clipboard access from renderer processes is deprecated; calls should move into a preload script and be exposed via contextBridge to stay future‑proof.[electronjs]​
  • Dynamic ESM imports are supported in non‑context‑isolated preloads across 37–40, which can make preload code organization cleaner if you adopt ESM.

Tooling and distribution

  • macOS dSYM debug symbol files change from .zip to .tar.xz in 40, which can reduce symbol size but may require updating your symbol upload and crash‑report tooling.[electronjs]​
  • Ongoing 40.x patch releases (for example 40.4.0 and 40.6.0) show the line is actively maintained, which is beneficial if you want current support and fixes.

Potential migration considerations

  • Review the breaking changes document for 38+ (Wayland defaults, console‑message handler signature, and other behavior tweaks), and test on Linux Wayland, macOS, and Windows to catch subtle UI or lifecycle changes. [electronjs]​
  • Audit any direct renderer use of clipboard and other deprecated patterns, and move them into preload or main‑process bridges as recommended. [electronjs]​

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions