Tauri Revisited
Electron has gotten so bloated (and it was pretty bloated to start with) and they keep changing the API so every time I try to build a new version of an old Electron project it feels like I have to do everything again from scratch, only now it's more complicated. Ugh.
Before I used Electron I used nw.js, but the last time left a bad taste in my mouth, and it's just as bloated as Electron. I've also tried Flutter, but I don't want to learn Dart and a new UI library. React Native is, of course, React.
Anyway, I tried playing with Tauri again. Tauri is a rust-based alternative to Electron that uses the platform-native web client instead of a copy of Chromium, and native code instead of nodejs and javascript) For whatever reason, last time I gave up before getting very far.
If you don't know what Electron is, it's a framework for turning web-apps or apps with web-tech user interfaces, into standalone "native" apps. Under the hood, it's Chromium and a web-server running on nodejs. You've almost certainly used Electron: VS Code, Slack, and Discord are all built with Electron. (Atom, the precursor to VS Code, was the reason Electron was created, hence the naming convention.)
Hello, World as an Electron App is something on the order of 200MB. Slack is nearly 500MB, Discord is over 400MB. I'd tell you how big VS Code is, but I'm currently living without it and using Zed instead.
Zed (which is a native app) is about 200MB. Panic Nova, a far richer app written using Apple's own tooling, is 165MB.
Anyway, on Friday, faced with a simple issue of wanting to deploy an internal web-demo without having to set up a new deployment (and explain how to access it), I decided to do a quick revisit of Tauri.
First thing to note: first class support for bun. Yes!
Anyway, I got what I needed working so fast I was hooked. This is how Electron and NW.js used to be before they become horribly complex and "security" focused (which is a necessity when you're fundamentally shipping a browser and nodejs in your package).
So I decided to figure out if I could call shell commands from the javascript side (which is what I need to be able to make my RAW manager app a reality).
I do not know anything about Rust, and the code is pretty ugly to my eyes. But I have ChatGPT and I'm not afraid to try it out…
It took a few hours but I can run processes, wrap them in Javascript generator functions, and kill them. It's beautiful.
But, does it blend…?
If you're not impressed by a sub 12MB bundle size then I don't know what to tell you. I haven't seen executables built with high-level libraries that small since the early 2000s. The only apps on my machine that are smaller than that are Apple-provided built-in apps that are thin wrappers around OS functions.
The Calendar app is bigger.