Desktop apps
ende desktop turns an Ende project (anything from a single TypeScript file to
a full web app) into a self-contained desktop application. The output is a
redistributable binary that bundles your code, the Ende runtime, and a web
rendering engine into one bundle per platform.
Why ende desktop
Web technology is the most widely-known UI toolkit in the world. Desktop apps built on web stacks (Electron, Tauri, Electrobun) take advantage of that, but each has tradeoffs you have to live with: huge binaries, missing platform support, no JavaScript ecosystem, no built-in update story.
ende desktop is opinionated about those tradeoffs:
- Small by default. The default WebView backend uses the operating system's own webview for small binaries. Opt into the bundled Chromium (CEF) backend when you need identical rendering across macOS, Windows, and Linux.
- In-process bindings instead of IPC. Backend and UI communication goes through in-process channels, not socket-based IPC. Values are still encoded as they cross the call boundary, but there is no cross-process round-trip between your Ende code and the webview.
- Cross-compile from one machine. The same machine can build for macOS, Windows, and Linux. Backends are downloaded as needed, not built locally.
- Built-in binary-diff auto-update. Ship a single
latest.jsonmanifest and bsdiff patches; the runtime polls, applies, and rolls back automatically on failed launches.
Hello, desktop
Create a one-file desktop app:
Ende.serve(() =>
new Response("<h1>Hello, desktop</h1>", {
headers: { "content-type": "text/html" }
})
);ende desktop --output MyApp main.ts
The packaged app opens a window that loads the pages your
Ende.serve() handler serves. Run it directly:
open MyApp.app # macOS
./MyApp/MyApp # Linux
.\MyApp\MyApp.exe # Windows
Without --output (or desktop.output or desktop.app.name in ende.json),
the app is named after the entrypoint's file name, or after its folder for
main.ts, mod.ts, index.ts and cli.ts.
Ende.serve() automatically binds to the address the
webview loads the app from, so you do not need to pass a port or hostname. With
the default webview backend on macOS and Windows, that is an in-process
app:// origin rather than a network port. See
HTTP serving for details.
A complete example
For a complete, real-world app built with ende desktop, see
denidian: an Obsidian-style
note-taking app with Markdown notes, [[wikilink]] crosslinking, and a
force-directed graph view. It is deliberately small — a single Ende HTTP server
plus a vanilla HTML/CSS/JS frontend — and covers window management via
Ende.BrowserWindow, application menus,
--hmr development, and packaging for distribution.
What's in this section
- Configuration: the
desktopblock inende.json. - Backends: CEF, webview, raw; how to choose.
- HTTP serving:
Ende.serve()integration and the serving model. - Windows:
Ende.BrowserWindowlifecycle, multiple windows, events. - WebGPU rendering: draw to a native window with WebGPU on the raw backend.
- Bindings: calling Ende code from the webview via
bindings.<name>(). - Menus: application and context menus.
- Tray and dock: system status icons and the macOS dock.
- Dialogs:
prompt(),alert(),confirm()as native popups. - Notifications: native OS notifications via
the Web
NotificationAPI. - Hot module replacement:
--hmrto apply code changes to a running app. - DevTools: unified DevTools attached to both the Ende runtime and the webview.
- Auto-update:
Ende.autoUpdate(), manifests, bsdiff, rollback. - Error reporting: capturing uncaught exceptions and panics.
- Distribution: cross-compilation, output formats, installers.
- Comparison: how
ende desktoprelates to Electron, Tauri, Electrobun, Dioxus. ende desktopCLI reference: the command, its flags, and theende.jsondesktopschema.