Pre-release · Windows · React

Desktop apps with Bun, typed end to end.

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.

Reference app download
33 MBvs 152.5 MB Electron
Electron API cases
16/16 APIspassing
// 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>
  );
}
Why Photon

The scope of Electron, the footprint of a native app.

Photon borrows Electron's range, Tauri's attention to size, and Nuxt's conventions, then builds on Bun.

Bun runs your backend

SQL, files, and processes with Bun's APIs. Release builds always use Bun's AoT compiler with --aot --trim.

Typed end to end

A file in src/main/ops is an operation. React calls it through a generated client: no glue code, no hand-written types.

Shared-memory transport

Calls and streams move through a typed ring buffer shared with WebView2, with cancellation and backpressure built in.

Backend crash recovery

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.

Electron-shaped APIs

app, BrowserWindow, ipcMain, Menu, Tray, dialog, safeStorage, and more, from one import in both bundle modes.

Ship and update

photon package signs the app when a certificate is set, builds a per-user installer, and writes an electron-updater compatible feed.

Two bundle modes

Start compatible. Ship compact.

The same project builds either way. Electron apps migrate in compatibility mode, then switch to compact mode for size.

Default

Compact

Renders in the system WebView2 and shares memory with the backend. The smallest download, for new apps.

  • System WebView2 renderer
  • Zero-copy shared-memory transport
  • One executable plus a small installer
Migration

Compatibility

Bundles Chromium through CEF, sandboxed, for apps that need Electron's renderer behavior.

  • Bundled Chromium (CEF 156.0.30)
  • electron imports aliased by role
  • Copying fallback transport, same contracts
Measured, not promised

The 0.0.x gate: beat Electron with a real app.

Drizzle Desktop, the reference database client, is measured against an equivalent Electron build on the same machine. 1 of 3 targets pass today.

TargetPhotonElectronStatus
Download size33 MB152.5 MBAhead
Startup401 ms275 msBehind
Idle memory103 MB96.6 MBBehind

Methodology and every workload →

Roadmap

Windows first, then everywhere.

  1. 0.0.xWindows and React. Reach the Windows KPIsIn progress
  2. 0.1.xmacOS, then Linux
  3. 0.2.xOptimizations
  4. 0.3.xVue support
  5. 0.4.xSvelte and Solid support
  6. 0.5.xOptimizations and developer experience
  7. 0.6.x+Electron compatibility focus
  8. 1.0.0All KPIs reached