Skip to content

feat(live-update): add Electron platform support - #921

Open
robingenz wants to merge 8 commits into
mainfrom
feat/live-update-electron-platform
Open

feat(live-update): add Electron platform support#921
robingenz wants to merge 8 commits into
mainfrom
feat/live-update-electron-platform

Conversation

@robingenz

@robingenz robingenz commented Jul 13, 2026

Copy link
Copy Markdown
Member

What

Adds the Electron platform implementation to @capawesome/capacitor-live-update, targeting the @capawesome/capacitor-electron platform. The adapter is a thin mapping layer: all download/verify/store/rollback logic lives in the @capawesome/electron-live-update engine (./engine subpath, main-process only — zero runtime impact for mobile/web consumers).

  • electron/src/index.ts: LiveUpdateElectron implementing all 26 LiveUpdatePlugin methods with the platform's static marker metadata. initialize() lifecycle hook runs engine.initialize() (kill-safe boot rollback) and repoints via services.bundles.setActiveBundle(..., { bootWatchdog: false }) before the first window load — the engine owns rollback, the platform watchdog stays disarmed.
  • Feature scope: zip artifacts (manifest/delta is not supported on desktop — mobile optimization, decision 2026-07-17), channels, code signing, blocked bundles, autoUpdateStrategy: 'background' (throttled sync on ready/window-focus/power resume). setConfig/resetConfig reject as unimplemented on Electron.
  • Sends runtime=capacitor + platform=2 + the plugin package version as pluginVersion — same cloud app and appId as the mobile targets.
  • Packaging: ESM electron/dist/plugin.mjs (rollup), capacitor.electron.src, build:electron/verify:electron scripts, version constant synced by the existing release script.
  • Docs: per-method platform availability in definitions.ts + docgen, README Electron installation section. Changeset: minor.

Verification

  • verify:web, build:electron/verify:electron, eslint, prettier — all green (swiftlint failures are pre-existing in untouched iOS files).
  • Compile-level only; runtime e2e (example app on the Electron platform) follows in a separate PR.
  • Note: verify:electron type-resolves the engine from the sibling repo checkout until @capawesome/electron-live-update@0.1.0 is published (release-order gate).

Related PRs

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

Adds Electron platform support to @capawesome/capacitor-live-update by introducing a new Electron adapter implementation, wiring up build tooling, and updating public docs/API annotations to reflect Electron availability.

Changes:

  • Add an Electron main-process adapter (LiveUpdateElectron) backed by @capawesome/electron-live-update/engine.
  • Add Electron build pipeline (TS + Rollup), plugin version syncing, and package metadata updates.
  • Update docs and API JSDoc to mark methods/options as available on Electron and document Electron-specific behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/live-update/src/definitions.ts Updates platform availability/docs for Electron across config/methods/types.
packages/live-update/scripts/sync-plugin-version.mjs Extends version sync script to update the Electron version constant.
packages/live-update/README.md Documents Electron support and updates generated doc sections for Electron availability.
packages/live-update/package.json Adds Electron packaging/scripts and introduces the Electron engine dependency.
packages/live-update/electron/tsconfig.json Adds Electron-specific TypeScript config for building the adapter.
packages/live-update/electron/src/version.ts New version constant consumed by the Electron adapter/engine config.
packages/live-update/electron/src/index.ts New Electron adapter implementation mapping plugin API to the engine.
packages/live-update/electron/src/definitions.ts Defines the minimal Electron platform context contract used by the adapter.
packages/live-update/electron/rollup.config.mjs Builds the Electron adapter into an ESM bundle for the platform loader.
.changeset/live-update-electron-platform.md Declares a minor release for introducing Electron support.

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

Comment thread packages/live-update/electron/tsconfig.json
Comment thread packages/live-update/electron/tsconfig.json Outdated
@robingenz robingenz self-assigned this Jul 14, 2026
@robingenz robingenz added the feature Feature request label Jul 14, 2026
robingenz and others added 3 commits July 14, 2026 10:59
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…heckout

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sion at runtime

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Comment thread packages/live-update/electron/src/index.ts
Comment thread packages/live-update/example/test/mock-server.mjs
Comment thread packages/live-update/example/test/mock-server.mjs Outdated
@robingenz

Copy link
Copy Markdown
Member Author

CI status note: the Install Node.js dependencies failures are expected and not fixable in this PR — @capawesome/electron-live-update (runtime dependency of the new Electron implementation) and @capawesome/capacitor-electron (devDependency for types) are not yet published to npm. This is the documented release-order gate: once capawesome-team/electron-live-update#1 and capawesome-team/capacitor-electron#6 are merged and released, the example lockfile gets regenerated and CI here turns green. All compile-level verification (verify:web, verify:electron) and the full 8-flow Electron e2e suite pass locally against the sibling checkouts.

robingenz and others added 4 commits July 14, 2026 14:17
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants