Skip to content

build(deps): bring Electron upgrade up to date (35 → 45) - #161

Closed
pfeerick wants to merge 8 commits into
deps/electron-upgradefrom
deps/electron-45
Closed

pfeerick wants to merge 8 commits into
deps/electron-upgradefrom
deps/electron-45

Conversation

@pfeerick

@pfeerick pfeerick commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Stacked on #136 (targets deps/electron-upgrade). Brings that branch up to date with main, moves it from Electron 35 (end-of-life) to 45, and drops two dependencies that no longer pull their weight.

Review note: this branch merges #160 (Yarn 4 upgrade, which includes current main), so until #160 lands and #136 catches up, the diff here also shows those changes. The commits specific to this PR are the last two non-merge ones below.

Commits

  1. Merge chore/yarn-4: brings in main and the Yarn 4 upgrade (build: upgrade Yarn 3.1 to 4.18 #160). Conflicts in .gitignore / package.json resolved by keeping both sides; yarn.lock regenerated once on Yarn 4.
  2. build(deps): upgrade Electron 35 to 45
    • electron ^35 → ^45.3.3, electron-builder → ^26.18.0, @electron/rebuild → ^4.2.1
  3. refactor(deps): drop date-fns and electron-window-controls
    • date-fns: its only use was one format(ms, "mm:ss") call. Re-resolving pulled in 4.4.0, whose typings import ./x.ts paths that TypeScript 4.9 can't read. Replaced with a small formatElapsed helper (with tests). This also fixes the elapsed build time showing wrong minutes in half-hour-offset timezones (e.g. India), since format treated the duration as a local time of day, and minutes no longer wrap after an hour.
    • electron-window-controls: inlined as two IPC channels (src/main/windowControls.ts). The package declared electron@^12 as a regular dependency, so every install pulled in a second Electron. Handlers are now registered once at startup instead of on every window creation (which stacked listeners on macOS when the window was re-created).

⚠️ User-facing: minimum OS

  • Electron 44+ requires macOS 13 (Ventura) or later. All Apple Silicon Macs can run it; older Intel Macs on macOS 11/12 lose support. Should go in the release notes.
  • Electron 44+ only ships 64-bit builds. Buddy doesn't build any 32-bit targets, so no change.

Breaking-changes review (Electron 36–45)

Checked against the APIs Buddy uses. Nothing required code changes:

  • Compiled preload only requires electron (no Buffer/events/timers), so the Electron 45 sandboxed-preload shim removal doesn't apply.
  • e2e launches the packaged binary, so Electron 42 dropping its postinstall download doesn't affect CI.
  • Command-line switches used (high-dpi-support, force-device-scale-factor) are already lowercase (Electron 36 lowercases them).
  • Minor behaviour change: the folder picker now opens in Downloads (Electron 43), since we don't pass defaultPath.

Testing

Locally on Windows, Node 22:

  • yarn install --immutable, fmt:check, test:types, lint:all (0 errors), compile:production pass
  • Unit tests: only the same 28 Windows-only failures described in build: upgrade Yarn 3.1 to 4.18 #160 (test harness quoting/paths, not app code); new formatElapsed tests pass
  • App launches under Electron 45.3.3; usb native module loads in the main process
  • Drove the app with the repo's Playwright 1.29: electronMinimize() minimizes and electronClose() quits, so Playwright 1.29 can still launch Electron 45

Still needs manual testing: DFU flashing / SD card writes with a real radio on each OS (especially the arm64 macOS DMG), plus the packaged builds from CI.

🤖 Generated with Claude Code

raphaelcoeffic and others added 8 commits March 7, 2026 06:19
Upgrade date-fns 2->4, uuid 9->11, semver 7.3->7.7, debounce 1->2,
nanoevents 6->9, and bump matching @types/* packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Upgrade electron to ^35, electron-builder to ^25, @electron/rebuild to ^3.7
- Upgrade electron-devtools-installer to ^4 and remove APOLLO_DEVELOPER_TOOLS
  (no longer exported in v4)
- Requires manual app testing to verify USB native module and window behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace bundled Yarn 3.1.0 release with 4.18.1
- Fix packageManager field, which incorrectly declared yarn@1.22.22
- Migrate yarn.lock to the v10 format (no version changes besides
  terser's optional acorn peer now being resolved)
- Keep install scripts and the per-project cache enabled; adopt Yarn 4
  defaults for git repo approval and the npm minimal age gate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in main and the Yarn 4 upgrade (#160). Conflicts in
.gitignore and package.json resolved by keeping both sides;
yarn.lock regenerated with Yarn 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- electron ^35 -> ^45.3.3 (35 is end-of-life; 43-45 are supported)
- electron-builder ^26.8.1 -> ^26.18.0
- @electron/rebuild ^4.0.3 -> ^4.2.1
- Pin date-fns to ~4.1.0: 4.4.0's type declarations import "./x.ts"
  paths that TypeScript 4.9 cannot resolve

Electron 44+ requires macOS 13 (Ventura) or later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the single date-fns `format(ms, "mm:ss")` call with a small
  formatElapsed helper. This removes the ~4.1.0 pin (newer date-fns
  typings need a newer TypeScript) and fixes the elapsed time showing
  wrong minutes in timezones with half-hour offsets, as `format`
  interpreted the duration as a local time of day. Minutes also no
  longer wrap after an hour.
- Inline the minimize/close IPC from electron-window-controls. It
  declared electron@^12 as a regular dependency, so every install
  pulled in a second Electron. Handlers are now registered once at
  startup rather than on every window creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The project uses Yarn; this npm lockfile was committed by accident
in #134 and has drifted from yarn.lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.10035% with 704 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.35%. Comparing base (d5ea932) to head (82baba5).

Files with missing lines Patch % Lines
...rc/renderer/pages/backup/file/BackupUploadArea.tsx 0.00% 215 Missing ⚠️
src/shared/backend/services/backupStore.ts 53.93% 140 Missing and 24 partials ⚠️
src/renderer/pages/backup/BackupRestoreFlow.tsx 21.08% 125 Missing and 6 partials ⚠️
src/renderer/pages/backup/BackupCreateFlow.tsx 46.95% 50 Missing and 11 partials ⚠️
src/shared/backend/graph/backup/local.ts 49.48% 37 Missing and 12 partials ⚠️
src/shared/backend/graph/sdcard/index.ts 6.45% 28 Missing and 1 partial ⚠️
src/renderer/pages/backup/CollisionModal.tsx 62.00% 13 Missing and 6 partials ⚠️
src/renderer/pages/dev/flash/ExecuationOverlay.tsx 0.00% 12 Missing ⚠️
src/main/index.ts 0.00% 6 Missing ⚠️
src/renderer/pages/backup/file/BackupUploader.tsx 84.21% 2 Missing and 1 partial ⚠️
... and 8 more
Additional details and impacted files
@@                    Coverage Diff                    @@
##           deps/electron-upgrade     #161      +/-   ##
=========================================================
+ Coverage                  34.41%   36.35%   +1.94%     
=========================================================
  Files                        102      117      +15     
  Lines                       3173     4296    +1123     
  Branches                     776     1037     +261     
=========================================================
+ Hits                        1092     1562     +470     
- Misses                      1933     2527     +594     
- Partials                     148      207      +59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

EdgeTX Buddy has been automatically deployed to Cloudflare.
✅ Preview: https://dfcf59a9.buddy-7a6.pages.dev
✅ Storybook: https://dfcf59a9.buddy-7a6.pages.dev/storybook

@pfeerick

Copy link
Copy Markdown
Member Author

Superseded: these commits (Electron 45 upgrade and the date-fns / electron-window-controls cleanup) have been rebased onto #136 together with Raphael's original commits, on top of current main. Continuing in #136.

@pfeerick pfeerick closed this Nov 18, 2026
@pfeerick
pfeerick deleted the deps/electron-45 branch November 18, 2026 08:36

This branch was successfully deployed

1 active deployment
preview — 82baba5a Deployed Nov 17, 2026 by github-actions[bot]
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.

2 participants