I chose Electron for cross-platform and shipped Mac-only
I chose Electron for Polyphon so I’d have one codebase for every platform. It ships on one: the Mac, Apple silicon only. My other two Mac apps, Purrchiver and Secret Store, are native Swift. Here’s what each choice actually cost, and what it bought.
Why Polyphon is Electron
When I launched Polyphon in March, I gave the short version: one cross-platform codebase, a UI stack I already move fast in, and direct access to Node APIs. Polyphon runs several AI models in one conversation, including command-line tools like Claude Code and Codex, which it spawns as child processes with your login shell’s environment. Node does that without ceremony, and the UI is React. I had a working app in days.
Cross-platform was real at first. The first alpha builds, the week I launched, were packaged for Windows and Linux too, with download cards on the site and end-to-end tests on all three. Within a few days the packaging was Mac-only, and it has stayed that way through every release since. So the main thing I chose Electron for is the benefit I gave up first.
What Electron cost
Size. The current Polyphon download is a 117 MB disk image, and that’s compressed. Installed, it can’t be smaller than the Electron framework inside it, which for a current Electron on Apple silicon is 286 MB on its own. The Swift apps, installed from the Mac App Store as universal apps for Intel and Apple silicon:
| App | Stack | Size |
|---|---|---|
| Polyphon 0.13.1 | Electron | 117 MB download; over 286 MB installed |
| Purrchiver 1.0.1 | Swift | 25 MB installed |
| Secret Store | Swift | 4.5 MB installed |
Purrchiver’s 25 MB includes a Quick Look extension and the C libraries compiled into its archive engine. Most of the Polyphon download is a browser.
Memory. I measured each app with macOS’s footprint tool, idle with one
window open. That’s the same per-process figure as Activity Monitor’s Memory
column, summed across an app’s processes. Polyphon wasn’t installed on this
Mac, so I measured the floor instead: an empty Electron window showing the
word “hello”.
| What | Processes | Memory |
|---|---|---|
| Empty Electron window | 4 | 85 MB |
| Purrchiver, main window | 1 | 34 MB |
| Secret Store, main window | 1 | 26 MB |
An Electron app starts at two and a half times the memory of a native archiver before it does anything, and a real app only adds to that. None of this is dramatic on a Mac with 16 GB. It’s the price of the bundled browser, paid by everyone who installs the app.
Native modules. This is the cost that hurt. Polyphon stores its data in
SQLite through better-sqlite3, a native Node module. A native module has to
be compiled for the exact Node ABI it runs in, and Electron’s isn’t the one on
your machine. So the project had two builds of the same driver: one for system
Node, used by the tests, and one for Electron, used by the app.
That split is how Polyphon told users their data was encrypted when it wasn’t. The build step that was supposed to compile the Electron driver against SQLCipher downloaded a prebuilt, unencrypted one instead, and every test ran against the other build. I wrote up how I confirmed it and how it happened. The bug was mine, not Electron’s. But Electron made it possible for the tested binary and the shipped binary to be two different things, and I didn’t check.
Distribution. Polyphon is signed with my Developer ID, notarized, and
updates itself from a feed on GitHub. It isn’t sandboxed and needs hardened
runtime exceptions for V8’s JIT. In fairness, App Sandbox would be a poor fit
in any framework: Polyphon’s own rules forbid it, because the sandbox would
block spawning claude, codex and copilot, which is the point of the app.
What native bought
The OS meets you halfway. Purrchiver 1.0 shipped with eight Shortcuts
actions, five Finder Services (“Extract using Purrchiver” and friends) and a
Quick Look extension that previews an archive’s contents with the space bar.
Each is a small Swift type or a few lines of Info.plist, because the app is
already the kind of thing macOS expects. Version 1.1
New in 1.1 has fifteen Shortcuts actions.
iCloud without a server. Secret Store has no account and no backend, and it still syncs. Each secret is a keychain item marked synchronizable, so iCloud Keychain carries it to your other devices, end-to-end encrypted, and Secret Store never touches the network. Sync is essentially one attribute, plus the right keychain flags and tests that pin them. Polyphon went the other way. It reads API keys from environment variables and keeps its database key in a file, optionally wrapped with a password. Its project rules say not to use Electron’s keychain wrapper, because the keychain entry breaks when the signing identity changes or the app moves to a new Mac. Native made sync one attribute; in Electron, the easy path to the keychain was fragile enough that I avoided it.
Apple Intelligence without an AI feature. Apple’s on-device model is available to apps through the Foundation Models framework, a Swift API. An Electron app has to bridge to it, through a native module or a Swift helper process. Purrchiver deliberately calls no model at all. Its Shortcuts actions return structured data, and Shortcuts’ own Use Model action can answer questions about it with the on-device model or with the Cloud models that run on Apple’s Private Cloud Compute. You pick which, in your own shortcut. I tested that end to end, and the archiver itself still makes no network connections.
Security that updates with the OS. Secret Store contains no cryptography
of its own: encryption
at rest, sync encryption and the unlock prompt are the keychain and Local
Authentication. When Apple patches those frameworks, Secret Store gets the fix
in the next macOS update, with no release from me. That covers Apple’s code,
not my use of it; the wrong keychain flags are still my bug. An Electron app
carries its own Chromium, Node and TLS stack, and those update only when the
developer ships. The Polyphon release people have today runs Electron 41 from
March; main is on Electron 44, but nobody gets that until I cut a release.
Polyphon’s window loads only local content and its renderer makes no network
requests, which limits the exposure, but its calls to the AI providers still
go through that bundled stack.
No servers to leak. None of the three apps has a hosted backend, and Electron doesn’t force one on you. But the native apps get more without one: Secret Store syncs through iCloud Keychain, Purrchiver takes payment through StoreKit, and both update through the App Store, inside App Sandbox. Every feature that would normally mean running a server, with an account database to secure and breach notices to write if it leaks, runs on Apple’s infrastructure instead. Purrchiver makes no network calls of its own; crash reports go out as an email you choose to send. There’s no customer data on a machine I run, because there’s no machine I run.
One codebase where it counts. Secret Store’s logic lives in a Swift package. When I brought it to iPhone and iPad, adding iOS to the package was a one-line change and the core compiled with no code changes. That version is built but not on the App Store yet. For an Apple-first app, Swift covers the platforms that matter.
What native cost
Apple only. Purrchiver and Secret Store will never run on Windows or Linux without a rewrite. For two Mac-first apps sold on the App Store that’s the right call, but it’s a door I closed.
Platform quirks, one at a time. Native means meeting every AppKit corner
yourself. The Finder Service that did nothing on the first
right-click. SwiftUI’s
drag-out that renamed .gitignore to
_gitignore inside
the sandbox. There’s no web developer’s muscle memory for any of it.
Vendored code is still yours. Native only helps with the parts you hand to Apple. Purrchiver’s encryption formats, age and encrypted ZIP and 7z, are cross-platform formats Apple’s frameworks don’t implement, so that code is compiled into the app and keeping it current is my job, exactly as it would be in Electron. Apple Encrypted Archive and checksums use Apple’s frameworks; the rest is on me.
App Review in the loop. Polyphon ships a fix whenever I tag a release. The Swift apps wait for App Review every time.
What I’d choose next time
I’d choose Electron again for an app that will really ship on several platforms, where the UI is mostly forms, lists and text, and where the value is in what the app talks to rather than how it fits into the OS. That describes Polyphon on paper. It just didn’t describe what Polyphon became.
I’d choose Swift for anything that’s Mac or iPhone first, and especially anything that should feel like part of the system: Finder, Shortcuts, Quick Look, iCloud, Apple Intelligence, the sandbox. That’s most of what I build now.
And I’d ask one question before starting, which I didn’t ask in March: which platforms will I ship on in the first six months? Not “could support”. Ship. If the honest answer is “the Mac”, Electron’s main advantage is gone before you’ve written a line of code, and you’re left paying for the browser.
If you’ve shipped an Electron app, did you end up using the cross-platform part, or did it quietly become a Mac app too?