
Tauri 2.0: Ứng Dụng Desktop Rust Ra Mắt Mobile iOS/Android
Tauri 2.0 stable ra mắt tháng 10/2024 đánh dấu milestone quan trọng: framework Rust-first cho desktop giờ đã hỗ trợ mobile (iOS, Android) native. Với 110k+ GitHub stars, binary size nhỏ, bảo mật mặc định, Tauri đang trở thành lựa chọn thay thế Electron cho các team quan tâm performance và security.

Tại Sao Tauri Khác Electron
Electron bundle toàn bộ Chromium (~100-150MB). Tauri dùng WebView của hệ điều hành (WebView2 trên Windows, WebKit trên macOS/Linux, WKWebView trên iOS, Chrome Custom Tab/WebView trên Android) — binary release thường <10MB.
| Đặc Điểm | Electron | Tauri 2.0 |
|---|---|---|
| Runtime Engine | Chromium bundled | System WebView |
| Binary Size (Hello World) | ~120MB | ~3-8MB |
| Backend Language | Node.js | Rust |
| Memory Baseline | ~80-120MB | ~15-30MB |
| Mobile Support | Không (chỉ desktop) | iOS + Android (stable) |
| Security Model | Full Node access | Capability-based, deny-by-default |
Tauri 2.0 Mobile: Chi Tiết Kỹ Thuật
Mobile support không phải afterthought — được thiết kế từ đầu trong Tauri 2.0:
- iOS: WKWebView + Rust compiled to arm64, Xcode project generation tự động
- Android: WebView (Chrome/Trichrome) + Rust compiled qua NDK, Gradle project generation
- HMR (Hot Module Replacement): Đ hoạt động trên device thật và emulator
- Mobile Plugins: Biometric auth, barcode scanner, push notifications, secure storage, haptic feedback
- App Store Compliance: Đã có apps Tauri trên App Store và Play Store
Blog chính thức Tauri 2.0 announcement xác nhận: mobile targets là first-class citizens, không phải experimental.
Plugin System & Capability Model
Tauri 2.0 giới thiệu capability-based security — deny by default. Mỗi plugin khai báo capabilities cần thiết, frontend request permission qua manifest.
- Official plugins: fs, shell, dialog, http, notification, clipboard, global-shortcut, opener, positioner, process, protocol, updater, websocket
- Mobile-specific: biometric, barcode-scanner, push, secure-storage, haptics, nfc, contacts, calendar
- Custom plugins: Rust crate + TypeScript bindings, publish lên npm/crates.io
Ví dụ capability config trong tauri.conf.json:
{
"capabilities": [
{
"name": "desktop-core",
"permissions": ["core:default", "fs:allow-read", "shell:allow-open"]
},
{
"name": "mobile-biometric",
"platforms": ["ios", "android"],
"permissions": ["biometric:default"]
}
]
}
Performance & Bundle Size Thực Tế
Benchmark thực tế (Tauri team, tháng 8/2026):
- Hello World release: 3.2MB (Linux), 4.1MB (macOS), 5.8MB (Windows), 8.7MB (iOS), 7.4MB (Android)
- Cold start: ~200ms desktop, ~400ms mobile (vs Electron ~800ms-1.2s)
- RAM idle: ~18MB desktop, ~25MB mobile
CrabNebula (partner chính thức) đóng góp 2,870 giờ engineering trong năm 2024 cho Tauri ecosystem — minh chứng cho đầu tư serious vào production readiness.

Migration Từ Tauri 1.x: Thực Tế & Mẹo
Tauri 1.x → 2.0 có breaking changes đáng kể: plugin system mới (v1 dùng `tauri-plugin-*`, v2 dùng capability-based), config format mới (`tauri.conf.json` → `tauri.conf.json` v2 schema), mobile targets mới. Migration guide chính thức tại v2.tauri.app/start/migration/.
Các bước chính:
- Update `tauri.conf.json` sang schema v2 (có tool tự động: `tauri migrate`)
- Rewrite plugins cũ sang capability definitions
- Thêm mobile targets: `tauri mobile init` tạo Xcode/Android project
- Test desktop trước, sau đó test mobile device thật (simulator có thể khác biệt)
Mẹo: Chạy song song v1 và v2 trong development — dùng `tauri dev` cho v1, `tauri dev –target ios` / `tauri dev –target android` cho mobile.
Migration Từ Tauri 1.x & So Sánh Với Các Lựa Chọn Khác
Tauri 1.x → 2.0 có breaking changes (plugin system mới, config format mới, mobile targets). Migration guide chính thức có tại docs. So sánh nhanh:
| Framework | Mobile | Binary Size | Learning Curve | Ecosystem |
|---|---|---|---|---|
| Tauri 2.0 | ✅ iOS/Android | ✅ ~3-8MB | Rust + Web | Đang tăng nhanh |
| Electron | ❌ | ~120MB | Node.js + Web | Rất lớn |
| Flutter | ✅ | ~10-15MB | Dart | Rất lớn |
| React Native | ✅ | ~15-20MB | JS/TS + Native | Rất lớn |
| Wails | ❌ (planned) | ~5-10MB | Go + Web | Nhỏ |
WebView System: Tại Sao Quan Trọng
Điểm khác biệt cốt lõi của Tauri là dùng system WebView thay vì bundle Chromium. Điều này có ý nghĩa thực tế lớn:
- Security updates tự động: WebView được cập nhật cùng OS (Windows Update, macOS Software Update, Google Play System Update) — không cần release mới app cho security patches
- Binary size giảm 90%+: Không ship engine render — chỉ ship frontend assets + Rust binary
- RAM sharing: WebView process có thể share memory với browser hệ thống (nếu user dùng Edge/Chrome/Safari)
- Feature parity: WebView2 (Edge), WebKit (Safari), WKWebView, Chrome Custom Tab đều support modern web APIs (Service Workers, WebAssembly, WebGL2, WebGPU experimental)
Trade-off: Không kiểm soát chính xác version WebView trên mọi device. Tauri khuyến nghị test trên WebView version tối thiểu (ví dụ WebView2 109+, WebKit 613+) và dùng feature detection.
Khi Nào Nên Chọn Tauri 2.0
- Cần binary nhỏ, cold start nhanh, RAM thấp
- Team có/khoan học Rust (backend logic), frontend vẫn dùng React/Vue/Svelte/Vanilla JS
- Yêu cầu bảo mật cao (capability model, no Node.js in production)
- Muốn share codebase giữa desktop VÀ mobile (iOS/Android) từ một repo
- Cần system-level access (file system, process, hardware) mà không bundle heavy runtime
Kết Luận
Tauri 2.0 không chỉ “Electron nhẹ hơn” — nó là paradigm shift: Rust backend + system WebView + capability security + mobile-first. Với 110k+ stars, release cadence đều đặn (v2.11.5 tháng 8/2026), và CrabNebula backing, Tauri đã sẵn sàng cho production cross-platform.
Nếu bạn đang maintain Electron app và đau đầu vì binary size, memory, hoặc muốn mở rộng sang mobile — Tauri 2.0 đáng để cân nhắc (worth considering). Migration effort đáng để đổi lấy performance và security gains dài hạn.
Tham khảo thêm: Tauri GitHub (110k+ stars) | Tauri 2.0 Announcement | Latest Release v2.11.5 | Official Docs v2
