chore(deps): upgrade Electron to v42 and devtools-installer to v4 - #611
Merged
Conversation
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.
cwillisf
force-pushed
the
chore/upgrade-electron
branch
from
May 11, 2026 18:44
07a7d0b to
6baa845
Compare
There was a problem hiding this comment.
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
electronfrom25.9.8to42.0.1. - Bump
electron-devtools-installerfrom3.2.1to4.0.0. - Update the dev-only dynamic
import('electron-devtools-installer')destructuring and logging to accommodate the new return type frominstallExtension.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
electronfrom25.9.8to42.0.1.electron-devtools-installerfrom3.2.1to4.0.0.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 innativeImage.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) andwebContents.on('new-window', ...)(event removed in v22) — already landed cleanup in #610, so the only code change here is forelectron-devtools-installer's v3→v4 API shifts in the dev-only DevTools install path:installExtensionas a named export. v3 published it as the default export. Destructure the named export.installExtensionresolves with an ElectronExtensionobject ({id, name, path, version, ...}). v3 resolved with the extension's string name. The success log now reads.nameoff the returned object so it prints something human-readable instead of[object Object].Verification
npm run test:lintpasses with 0 errors locally on node 24.15.0.npm run compilebuilds both renderer and main bundles successfully.npm startsmoke-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 oldersession.*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@11is the remaining piece of the Electron-family refresh — held back to its own PR because v11 is ESM-only and may need animport()adjustment we don't want to tangle with this version bump.