Bun runs your backend
SQL, files, and processes with Bun's APIs. Release builds always use Bun's AoT compiler with --aot --trim.
Photon pairs a Bun backend with the system web view and a typed shared-memory bridge, so apps start from a small download and every call is checked by TypeScript.
// src/main/ops/hello.ts: runs in Bun
import { defineOperation } from "photon";
export default defineOperation(async (input: { name: string }) => ({
greeting: `Hello, ${input.name}.`,
runtime: "Bun" as const,
}));// src/renderer/Greeting.tsx: typed from the handler
import { useOperation } from "photon-react";
import { api } from "#photon";
export function Greeting() {
const hello = useOperation(api.hello);
return (
<button onClick={() => hello.run({ name: "desktop" })}>
{hello.data?.greeting ?? "Call the backend"}
</button>
);
}Photon borrows Electron's range, Tauri's attention to size, and Nuxt's conventions, then builds on Bun.
SQL, files, and processes with Bun's APIs. Release builds always use Bun's AoT compiler with --aot --trim.
A file in src/main/ops is an operation. React calls it through a generated client: no glue code, no hand-written types.
Calls and streams move through a typed ring buffer shared with WebView2, with cancellation and backpressure built in.
The backend runs in its own process. If it crashes, Photon restarts it, pending calls fail with a typed error, and the window stays open.
app, BrowserWindow, ipcMain, Menu, Tray, dialog, safeStorage, and more, from one import in both bundle modes.
photon package signs the app when a certificate is set, builds a per-user installer, and writes an electron-updater compatible feed.
The same project builds either way. Electron apps migrate in compatibility mode, then switch to compact mode for size.
Renders in the system WebView2 and shares memory with the backend. The smallest download, for new apps.
Bundles Chromium through CEF, sandboxed, for apps that need Electron's renderer behavior.
electron imports aliased by roleDrizzle Desktop, the reference database client, is measured against an equivalent Electron build on the same machine. 1 of 3 targets pass today.
| Target | Photon | Electron | Status |
|---|---|---|---|
| Download size | 33 MB | 152.5 MB | Ahead |
| Startup | 401 ms | 275 ms | Behind |
| Idle memory | 103 MB | 96.6 MB | Behind |
0.0.xWindows and React. Reach the Windows KPIsIn progress0.1.xmacOS, then Linux0.2.xOptimizations0.3.xVue support0.4.xSvelte and Solid support0.5.xOptimizations and developer experience0.6.x+Electron compatibility focus1.0.0All KPIs reached