Electrobun v1: Build fast, tiny, and cross-platform desktop apps with TypeScript (blackboard.sh)
Electrobun lets you open/manipulate/close webview windows and communicate with them using typed rpc. It also handles building, code signing, and notarization.
And because I'm using Bun, running an HMR + React + Tailwind server is just one command (`bun ./index.html`) or like 5 lines of code. Pass --console and the webview's console.log()s get streamed to your Terminal too.
There's tons of other things Electrobun does that I haven't even mentioned, because I haven't interacted much with them yet. E.g. I know that it lets you show platform-native notifications, prompts/popups, etc.
There also is a very impressive updating mechanism that relies on a bsdiff implementation written in Zig. You just ship the deltas, so updates to very large apps are just a few KBs most of the time.
It's genuinely a very productive stack and impressive piece of tech.
[1] Not affiliated - I just like the project.
[2]: The API and implementation was clear, so I'll cautiously say this is not a case of "rewrites are always faster". In fact, the Tauri version was a rewrite too :)
39 comments
[ 2.8 ms ] story [ 59.5 ms ] threadhttps://blackboard.sh/electrobun/docs/
It certainly looks clean enough, and I'm more familiar with zig than rust, so I might give it a shot.
Looks cool, I'll try this for my next personal desktop project and see how it goes
I think it's going to eat a piece of the Electron pie for Steam indie games.
Most stay with bun after seeing how fast and seamless it is to run typescript games with instant auto reload:
bun --watch game.ts
- views://mainview (33.7MB) <- your frontend is running here
- react-tailwind-vite-dev Networking (5.4MB)
- react-tail wind-vite-dev Graphics and Media (16.7MB)
- react-tailwind-vite-dev (60.7MB)
electrobun ships with an RPC (i think it also does some encryption?) so as long as you use that to communicate between your webview and bun "host process" you should be safe.
[1]: https://github.com/oven-sh/bun/issues/21237
This is a lot of tradeoffs for saving 100 megs.
I understand that we should be good stewards of our customers’ hardware and not waste things unnecessarily, but also have to balance that with shipping something and not worrying about all the edge cases. Most people in developed countries have Internet connections of 100+ mbps, which means the app will still download in <10 seconds.
Does electrobun support using an embedded chromium for the renderer? I went to the project readme and it was really unclear if that’s a currently-supported option and if so, how to use it.
Electrobun sounds really cool, glad to see there's more work done to enable cool desktop apps without Electron.
still:
> Optional CEF: bundle CEF (Chromium) when cross-platform consistency matters most.
from: https://blackboard.sh/electrobun/docs/guides/what-is-electro...
I ended up having to use Ionic to create a html <-> Android app thing within github actions but Ionic doesn't support ad blocking abilities.
what kind of numbers are you looking for?
We just hit v1 - stable which means I've locked down the architecture. If you run into any bugs or need specific apis that you miss from Electron or Tauri please open Github issues and I'll prioritize them. I shipped 50,000 lines of code changes stabilizing and polishing electrobun for v1 over the last month.
Here's a video demo of Colab (also open source) (a hybrid web browser + code editor + PTY terminal) that is built with Electrobun https://www.youtube.com/watch?v=WWTCqGmE86w
Electrobun uses the system webview by default, but a lot of the hello worlds feature the bundleCEF option. Because Electrobun is architected to be webview agnostic when servo and ladybird are ready they should be drop-in alternatives.
Electrobun apps also auto generate a zstd self-extraction wrapper and patch files with every release, so your initial download will be much smaller than if you'd used zip and your updates will be as small as 14KB so you can ship as often as you like without you or your users paying the bandwidth tax.
[1]: https://github.com/blackboardsh/electrobun/issues/4#issuecom...