Tell HN: Building a universal electron app for Mac is a complete nightmare
Everytime I have to release a new version of my electron app, I spend more time fixing the release process than working on the app. It's alway some thing else broken.
10 comments
You can as well, make separate builds for M1 and Intel. The size of each binary will be smaller.
Tauri is meant to be good https://github.com/tauri-apps/tauri
Tauri comes with unique considerations of its own. https://blog.logrocket.com/tauri-electron-comparison-migrati...
sidenote: the logrocket blog is incredible. It's often one of the first results for my searches over a wide range of topics including TypeScript and Rust. And it usually has the most informative content and sometimes even the answer I'm looking for!
I'm not in the market for their product, but I absolutely love their blog.
I'm not in the market for their product, but I absolutely love their blog.
Does Electron not run on macOS amd64e?
Unless you're taking advantage of some kind of x86-64 specific feature, I don't understand why it's at all a challenge to port an app to arm64e. Could you elaborate a bit on what those problems are? FWIW, I'm more intrigued as an outsider than someone that can offer any meaningful help.
Unless you're taking advantage of some kind of x86-64 specific feature, I don't understand why it's at all a challenge to port an app to arm64e. Could you elaborate a bit on what those problems are? FWIW, I'm more intrigued as an outsider than someone that can offer any meaningful help.
The problem is that Electron, itself, is a macho binary and thus subject to the same architecture constraints as any other app. The "universal binary" the OP is mentioning is taking advantage of the "fat" macho format, which bundles multiple target architectures in one executable, so the user does not need to know which they have in order to download the correct one. Or doubly so in the App Store where there is no "download the correct one"
Take a look at https://conveyor.hydraulic.dev/ - it supports Electron apps and makes releasing much easier than with the standard Electron tooling.
If you're set on using web tech, why Electron over just an installable PWA? Consider if you need whatever apis only electron gets you.
Safari heavily nerfs PWAs, making their use more questionable. It's possible that they also need more access to the underlying computer.
Really? I'll test. Usually PWA icon is added this way:
https://github.com/wekan/wekan/wiki/PWA
https://github.com/wekan/wekan/wiki/PWA
Yes - but users are used to installing things from the app store, so the PWA flow is unfamiliar.
In iOS, sure, but macOS? Most people I know install stuff outside the app store, it's still the case that many apps come as a dmg that you open and drag the app into the Applications folder.
Can you add a PWA to the Mac App Store?
There is some way for iOS, and some iOS apps work on M1, so maybe. Although Apple has been removing PWA style apps from App Store, so better check newest requirements somewhere at docs.
https://www.pwabuilder.com
https://docs.pwabuilder.com/#/builder/app-store
https://www.pwabuilder.com
https://docs.pwabuilder.com/#/builder/app-store
Can you just target intel? Anyway the emulation in Mac OS can deal with it. Why take the extra effort to build two versions.
Everybody is asking for native m1 builds, even if there is not that much of a performance difference for some apps.
> Building a universal electron app for Mac
If it's for Mac, why does it have to be universal ?
If it's for Mac, why does it have to be universal ?
They mean a universal Mac binary, I believe
Is any other way to develop Mac app any easier?
yes, use objective C or c++ and osx frameworks
or use a cross platform c++ toolkit like juce
avoid web garbage for desktop apps
or use a cross platform c++ toolkit like juce
avoid web garbage for desktop apps
Objective-C? I can't imagine anyone would use that for a new project.
Or Swift, which will feel a lot more at home for JS/TS developers.
CLI and TUIs still work too
If you like .NET, Avalonia is an option which targets OSX in addition to other platforms.
Flutter works well for cross platform.
Tried flutter ?
They’re also incredibly slow and resource intensive. Just use Swift!
... right up until you realize that your app has to be cross platform
Well there's Tokamak. If enough people start contributing to Tokamak, it would actually be viable to write cross-platform apps in Swift. (Especially since Swift itself is already cross-platform).
I was curious what the IDE story is like for Swift on non-macOS platforms, and while their repo only talks about LSP, turns out that CLion has a Swift plugin: https://plugins.jetbrains.com/plugin/8240-swift
I actually wasn't even aware Swift was cross platform until this thread, so I haven't tried the plugin enough to speak to its strengths or weaknesses, but I for sure trust JetBrains a lot more than any LSP
I actually wasn't even aware Swift was cross platform until this thread, so I haven't tried the plugin enough to speak to its strengths or weaknesses, but I for sure trust JetBrains a lot more than any LSP