t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Explore electrobun as a possible future desktop runtime

Open Finesssee opened this issue 8 months ago • 4 comments

Curious whether this is worth experimenting with:

t3code already uses Bun for package management and parts of the desktop workflow, so I wanted to ask whether electrobun might be worth evaluating at some point as a future alternative to Electron.

To be clear, I’m not suggesting this is a drop-in replacement or that the project should switch now. From looking through the repo, the desktop app currently relies on Electron pretty deeply:

  • apps/desktop/src/main.ts uses BrowserWindow, protocol, ipcMain, Menu, dialog, nativeImage, shell, etc.
  • apps/desktop/src/preload.ts exposes a preload bridge with contextBridge / ipcRenderer
  • apps/desktop/package.json depends on electron and electron-updater

So this seems more like a “maybe worth a spike” than a migration proposal.

What made me bring it up is that the repo already appears to be fairly Bun-friendly:

  • root package.json uses [email protected]
  • the repo includes bun.lock
  • desktop scripts already use bun run

That made me wonder whether a small proof-of-concept could be worthwhile to answer questions like:

  • Is there any real startup / packaging / DX benefit here?
  • Are the IPC / preload equivalents good enough?
  • What would the updater story look like compared to electron-updater?
  • Would custom protocol / deep link support work for this app’s needs?
  • Is Windows/Linux support mature enough for this repo?

Maybe the right next step, if this is interesting at all, would just be a bounded experiment:

  • boot a minimal desktop window
  • test preload bridge / IPC parity
  • test custom protocol support
  • test updater viability
  • sanity-check cross-platform support

If the answer is “not ready,” that’s still useful. If the answer is “surprisingly viable,” then maybe it becomes worth a deeper discussion later.

Posting mostly as an idea for exploration, not a recommendation to rewrite anything.

Finesssee avatar Mar 07 '26 12:03 Finesssee

In the launch stream, Theo said that electrobun is too new now to look into

UtkarshUsername avatar Mar 07 '26 12:03 UtkarshUsername

there is also https://tauri.app/ electrons problem is it bundles chrome and chrome is a memory hog. Tauri uses the os webview instead. The topic here should be more do we want to have a smaller memory footprint and what electron alternative do we want to use to get there.

stephen-dahl avatar Mar 07 '26 16:03 stephen-dahl

there is also https://tauri.app/ electrons problem is it bundles chrome and chrome is a memory hog. Tauri uses the os webview instead. The topic here should be more do we want to have a smaller memory footprint and what electron alternative do we want to use to get there.

Yes, tauri is good in that aspect. But Theo has expressed that he prefers electron for reasons like V8 is really good, electron provides a stable experience across operating systems.

UtkarshUsername avatar Mar 07 '26 16:03 UtkarshUsername

closing this for now !!

shivamhwp avatar Mar 26 '26 11:03 shivamhwp