Desktop App should use tauri (native web renderer) instead of electron?

a longer-term investigation/project

Context:

The Kinopio desktop apps are provided by the todesktop.com service which builds electron apps from a URL for all desktop platforms (windows, linux, mac) and signs them (for mac, windows). Building an electron app yourself is super easy, but building it for other platforms and signing it for distribution (especially on windows) sounds like a nightmare that I’m happy to abstract.

It includes niceties like

  • using the page title as the window title,
  • opening kinopio urls in the same window and external links in the default browser (much like the iOS app does).
  • cmd-t to make tabs in a window, cmd-n to spawn new windows

because the apps are thin wrappers that have no app specific logic, I almost never need to build new versions of the app. I probably build it twice a year – it’s mostly a set it and forget kind of thing.

I think todesktop’s support does a good job. And as a company/service I think it’s pretty good.

Issue:

The problem is that electron is bloated and inefficient. IRL this isn’t a major problem on my macbook M1, but after playing around with the new macOS safari ‘add to dock’ feature which creates a local (unsigned) native webkit wrapper, I think especially on slower computers the difference is noticeable.

Using activity monitor to look at the quantitative differences reveals some pretty drastic differences (5x - 2x resource usage deltas):

The actual app size is 3-5mb on webkit vs 70mb on electron too.

Todesktop has told me that they have no plans to use electron. It also costs 60$/mo (because I’m grandfathered on a cheaper plan).

Investigation

Can I replace todesktop and provide a better desktop app? i.e. Is there a way to build and sign native desktop builds myself in a way that’s easy to maintain?

The closest I’ve found is Tauri (https://tauri.app), combined with a special github action (Cross-Platform Compilation | Tauri Apps) so that github’s servers build native binaries for all platforms.

Questions

  • are all browser features (eg canvas, localstorage) supported by tauri?
  • what’s the cert process like and how much does it costs? (x.com recently went through this, we could ask him if needed)
  • I’ve never used github actions, what are the downsides and cost of using github actions?
  • Can i replicate the same basic features of the electron app in tauri? How much control over the window do we get?

If anyone has any experience with Tauri, plz let us know how it was for you~

1 Like

cc @lucas if you thoughts or experience w this?

1 Like

A really good looking Tauri app example https://x.com/gregoryschier/status/1744765170054992044?s=46

UPDATE: just tried this out and it works really well.
memory use is about 200mb

cpu and energy use are basically 0 at idle

I actually just talked to someone about this, yesterday. Especially the Tauri Beta. Their work looks super interesting.

I don’t have first-hand experience with it, but only heard good things from others.

The person I talked to told me that persistent data like localStorage and IndexDB does not get randomly garbage collected, which would be a plus. I was not able to find that anywhere in the docs, though.
I would also assume that normal browser features, like canvas, should just work fine, as it’s just using the OSes default browser engine.

In general I think having a universal approach like Tauri for macOS, Windows and Linux does make a lot of sense. It would also give you more control over your apps.

PS: Just want to throw in that a hybrid iOS/macOS version could also be a neat solution for macOS, with widgets and shortcuts.

2 Likes

That sounds promising :slight_smile: I didn’t know about beta 2.0 but ya sounds like something we should look into. (I also am intrigued by getting android in the future)

PS: Just want to throw in that a hybrid iOS/macOS version could also be a neat solution for macOS, with widgets and shortcuts.

That’s true, but IMO I think putting the time into Tauri instead of Apple specific platforms is a better use of resources bc it also improves things for windows and linux users which more widely used/helpful than widgets.

1 Like

@lucas would you be interested in working on this? either before or after the other bug fixes?

1 Like

I am generally interested, but afraid that this will turn into a big project. I don’t have experience with the tech, yet, and don’t have the ability to test on Windows and Linux.

2 Likes

ya that’s fair, this is not critical rn so let’s wait on this

1 Like

Also worth noting is that Tauri’s HiDPI scaling is completely broken on linux

2 Likes