Step 1
Why Tauri — vs Electron
20 min
Why Tauri — vs Electron
Electron has long been the default when writing desktop apps in React or Vue. Tauri 2 fills the same spot with a smaller, lighter approach.
1. Bundle size
| Minimal app | Electron | Tauri 2 |
|---|---|---|
| macOS | ~130 MB | ~10 MB |
| Windows | ~100 MB | ~8 MB |
| Linux | ~90 MB | ~5 MB |
Electron bundles Chromium + Node; Tauri borrows the OS-native WebView.
2. Memory / RAM
Idle minimal app — Electron 200 MB+, Tauri 30–60 MB. Noticeable on low-end laptops.
3. Security — thin IPC surface
Electron exposes the full Node API to the renderer, so XSS can quickly escalate to file deletion. Tauri only exposes explicitly registered Rust commands; everything else is deny-by-default.
#[tauri::command]
fn greet(name: &str) -> String { format!("Hello, {}!", name) }
The frontend can only invoke("greet", …). Dangerous capabilities (file writes, shell) are opt-in.
4. Performance — cold start
Electron ~1–2s, Tauri ~200–500ms. No Chromium bootstrap, smaller Rust binaries.
5. Mobile support (Tauri 2's key differentiator)
Electron is desktop-only. Tauri 2 supports Android / iOS (GA in 2024). One codebase, desktop + mobile.
6. When Electron is better
- Deep Node ecosystem dependencies (Slack · VS Code · Discord)
- Larger community and docs
- Mature auto-update / crash reporting accumulated over generations
7. When Tauri is better
- Install size under ~10 MB matters
- Tight security (whitelisted IPC)
- OK with a little Rust (or staying mostly in TypeScript)
- Planning Android distribution
Closing
With Tauri you can stay in JavaScript most of the time and drop to Rust only when needed — the thinnest path from web to desktop + mobile.
Next
- 02-project-setup