Skip to content

chore(deps): upgrade Electron to v42 and devtools-installer to v4 - #611

Merged
cwillisf merged 1 commit into
developfrom
chore/upgrade-electron
May 11, 2026
Merged

chore(deps): upgrade Electron to v42 and devtools-installer to v4#611
cwillisf merged 1 commit into
developfrom
chore/upgrade-electron

Conversation

@cwillisf

@cwillisf cwillisf commented May 11, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Upgrade electron from 25.9.8 to 42.0.1.
  • Upgrade electron-devtools-installer from 3.2.1 to 4.0.0.
  • Adjust the dev-only import('electron-devtools-installer') destructure and success log for v4's API changes.

Reason for Changes

renovate/npm-electron-vulnerability (#519) has been sitting open targeting v35. Two real CVEs are unpatched on the v25 we currently ship: CVE-2024-46993 (heap overflow in nativeImage.createFromPath/Buffer, patched in v28.3.2 / v29.3.3 / v30.0.3) and CVE-2025-55305 (ASAR integrity validation, patched later). Going to current (v42) instead of v35 picks up additional security fixes for free and avoids stacking another Electron PR a few months from now.

scratch-desktop's main-process API surface is small, and the two spots that would have broken under any post-v25 Electron — app.allowRendererProcessReuse (setter removed in v28) and webContents.on('new-window', ...) (event removed in v22) — already landed cleanup in #610, so the only code change here is for electron-devtools-installer's v3→v4 API shifts in the dev-only DevTools install path:

  • v4 publishes installExtension as a named export. v3 published it as the default export. Destructure the named export.
  • v4's installExtension resolves with an Electron Extension object ({id, name, path, version, ...}). v3 resolved with the extension's string name. The success log now reads .name off the returned object so it prints something human-readable instead of [object Object].

Verification

  • npm run test:lint passes with 0 errors locally on node 24.15.0.
  • npm run compile builds both renderer and main bundles successfully.
  • npm start smoke-tested locally on macOS: editor launches, both React DevTools and Redux DevTools install and appear in the detached DevTools window, success log now prints the extension name correctly.

Two upstream-noise items observed during the smoke test that are not actionable here:

  • (electron) 'session.getAllExtensions' is deprecated… use 'session.extensions.getAllExtensions'
  • (electron) 'session.loadExtension' is deprecated… use 'session.extensions.loadExtension'

Both originate inside electron-devtools-installer@4's own implementation (which still calls the older session.* shape Electron has since moved). v4.0.0 is the latest published version; we'd track this as an upstream issue.

Closes / supersedes

Follow-up still on the list

electron-store@11 is the remaining piece of the Electron-family refresh — held back to its own PR because v11 is ESM-only and may need an import() adjustment we don't want to tangle with this version bump.

Bring scratch-desktop forward from the long-stale Electron v25 line
straight to current (v42), and bump electron-devtools-installer
together because it's the only other direct Electron-aware dep
that needed a major adjustment for the new toolchain.

- electron 25.9.8 -> 42.0.1
- electron-devtools-installer 3.2.1 -> 4.0.0

This subsumes #519 (the security-flagged v25 -> v35 renovate PR)
by going further. CVE-2024-46993 (`nativeImage.createFrom*` heap
overflow) and CVE-2025-55305 (ASAR integrity validation) are both
patched well before v42; jumping straight to current avoids
stacking another Electron PR a few months from now.

The dead-code spots that would have broken under any post-v25
Electron (`app.allowRendererProcessReuse` setter, `webContents.on`
'new-window') were already cleaned up in #610, so the only code
change here is for `electron-devtools-installer`'s v3 -> v4 API
shifts in the dev-only DevTools install path:

- v4 publishes `installExtension` as a *named* export; v3
  published it as the default. Destructure the named export.
- v4's `installExtension` resolves with an Electron `Extension`
  object (with `id`, `name`, `path`, ...); v3 resolved with the
  extension's string name. The success log now reads `.name` off
  the returned object.

Capped at v42 (current latest) — nothing on the horizon needs to
move with this.

Verified locally: lint passes (0 errors); `npm run compile` builds
both renderer and main bundles successfully under node 24.15.0;
`npm start` confirmed the dev-mode extension install path now
loads React DevTools and Redux DevTools and logs human-readable
names. Other deprecation warnings observed during smoke test
(`session.getAllExtensions` / `session.loadExtension`) originate
inside electron-devtools-installer v4 itself — upstream concern,
not actionable here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades Scratch Desktop’s Electron runtime to a currently supported major version to pick up security fixes, and updates the dev-only DevTools installer integration to match the new electron-devtools-installer API/module shape.

Changes:

  • Bump electron from 25.9.8 to 42.0.1.
  • Bump electron-devtools-installer from 3.2.1 to 4.0.0.
  • Update the dev-only dynamic import('electron-devtools-installer') destructuring and logging to accommodate the new return type from installExtension.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/index.js Updates dev-only DevTools installer import/destructure and installed-extension logging for v4 behavior.
package.json Upgrades Electron and electron-devtools-installer versions.
package-lock.json Locks the upgraded Electron + installer versions and their updated transitive dependency graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/index.js
@cwillisf
cwillisf merged commit ef85ec1 into develop May 11, 2026
8 checks passed
@cwillisf
cwillisf deleted the chore/upgrade-electron branch May 11, 2026 20:02
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants