Tauri (JS/TS + Rust)
Tauri
Your TypeScript app
│
▼
Tauri
│
├── OS WebView
└── native Rust core
-
Tauri uses the operating system's WebView rather than bundling Chromium.
-
"Let's use the browser engine already installed on the user's OS."
-
-
Desktop app example:
UI ↓ TypeScript ↓ Tauri IPC ↓ Rust ↓ filesystem / processes / networking / native functionality -
-
"Create small, fast, secure, cross-platform applications".
-
About Rust
-
Tauri is more attractive when you specifically want the native layer to be Rust.
-
Can a Tauri app exist without Rust at all?
-
No. Tauri is fundamentally a Rust framework. The executable that Windows launches (.exe) is compiled by Rust. It is what talks to the Windows API to spawn the window, initialize Microsoft WebView2, and expose native capabilities.
-
If you wanted a desktop app where both the frontend and the backend runtime are 100% JavaScript/TypeScript with zero Rust, you would typically look at Electron (which bundles a full Node.js runtime + Chromium) or Electrobun. However, the tradeoff is significant:
-
Electron: 150MB+ bundle size, 200MB–400MB RAM usage.
-
Tauri: ~3MB–5MB bundle size, 30MB–50MB RAM usage.
-
-
-
Does your application logic have to be written in Rust?
-
No! You don't have to write custom Rust code if you don't want to.
-
Tauri provides official plugins (e.g.,
@tauri-apps/plugin-sql,@tauri-apps/plugin-dialog,@tauri-apps/plugin-fs). If you use these plugins: -
Your Rust file (
src-tauri/src/lib.rs) would literally just be 5 lines of boilerplate initializing the plugins. -
All database queries (
db.execute("SELECT ...")), file picking, and file reads could be written directly in TypeScript inside your Svelte files.
-
Project Structure
-
A Tauri application is split into two distinct worlds connected by an IPC (Inter-Process Communication) bridge:
+-------------------------------------------------------------+
| OS WINDOW (Tauri) |
| |
| +-------------------------------------------------------+ |
| | FRONTEND (WebView2 on Windows) | |
| | - Svelte 5 + TypeScript | |
| | - Renders HTML/CSS (buttons, tables, dialogs) | |
| | - In-memory state, search parsing, event handlers | |
| +---------------------------+---------------------------+ |
| | |
| invoke() | JSON |
| IPC Bridge | Response |
| v |
| +-------------------------------------------------------+ |
| | BACKEND (Native Rust Process) | |
| | - SQLite database operations (rusqlite) | |
| | - Native file picker dialogs (rfd) | |
| | - Direct OS & filesystem access | |
| +-------------------------------------------------------+ |
+-------------------------------------------------------------+
-
Frontend (The UI): Runs inside the native operating system webview (WebView2 on Windows). It is standard web technology (HTML, CSS, TypeScript), bundled by Vite.
-
Backend (The Core): A lightweight native compiled binary created by Rust. It initializes the native window, manages operating system privileges, and performs low-level tasks (like disk I/O and database operations).
Electrobun (JS/TS + Odin/Rust/Go/Zig)
-
-
-
Electrobun's platform layer combines Zig, Objective-C, and C++.
-
-
-
Check the 'Runtime coverage' section (scroll a bit).
-
Windows: WebView2
-
Uses Chromium.
Linux: WebKitGTK
-
Uses WebKit.
macOS: WKWebView
-
Uses WebKit.
Wails (JS/TS + Go)
-
Tauri-like, Go instead of Rust.
Lorca (JS/TS + Go)
-
.
Neutralinojs
-
Supports TypeScript directly. Its official JS client includes built-in TypeScript declarations, and the project itself has TypeScript tooling.
Electron (JS/TS)
-
Reason to not use it:
-
Huge bundle size, as it bundles a whole browser with it.
-
High memory usage.
-
Electron
Your TypeScript app
│
▼
Electron
│
├── Chromium
└── Node.js
-
Your application ships with its own browser engine and Node.js runtime.
-
You're shipping a browser.
-
For example: "While a Qt/GTK app could be ~100–200 MB, a Electron app could be ~300–600+ MB".
-
-
Used in:
-
VS Code, Discord, Slack, and many others.
-
-
Electron is very attractive if you want "web development, but packaged as a desktop application."
-
Ecosystem:
TypeScript │ ┌──────────┴──────────┐ │ │ Renderer Main process │ │ React/Svelte/etc. Node.js APIs │ │ └──────────┬──────────┘ │ Electron │ Chromium + Node -
Desktop app example:
UI ↓ TypeScript ↓ Node.js ↓ filesystem / processes / networking / native modules-
Electron lets you stay almost entirely in the JavaScript/TypeScript ecosystem.
-