> ## Documentation Index
> Fetch the complete documentation index at: https://supastack.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For the full documentation corpus in one file, fetch: https://supastack.dev/llms-full.txt

# Tauri 與 Electron：如何選擇桌面框架

從運行時架構、原生集成、分發和團隊取捨比較 Tauri 與 Electron。

_釋出於 2026-10-21._
_更新於 2026-10-29._

> **桌面應用應該選 Tauri 還是 Electron？**
> 這取決於你的優先級。Tauri 使用系統 WebView 和 Rust 核心；Electron 打包 Chromium 與 Node.js，採用多進程模型。請根據原生集成、支持的平臺、團隊技能和測試需求選擇，並測量自己的應用。

## 不同運行時，不同取捨

Tauri 在操作系統 WebView 中承載 Web 界面，並連接到 Rust 核心。Electron 使用 Chromium 和 Node.js，通過不同進程劃分應用職責。兩者都能使用 Web 技術構建桌面軟件，但都需要設計安全邊界。


## 比較真正重要的決策

不要只看宣傳中的下載大小。依賴、打包資源、平臺和更新系統都會影響實際結果。請在客戶使用的設備上構建並測量有代表性的應用。

| 決策 | Tauri | Electron |
|---|---|---|
| 渲染 | 操作系統 WebView | 內置 Chromium |
| 原生層 | Rust 命令和能力 | Node.js 與 Electron API |
| 測試重點 | WebView 平臺差異 | 進程隔離與運行時 |
| 團隊技能 | Web 和 Rust | Web 和 Node.js |


## 安全與原生集成

將高權限操作放在窄接口後面，驗證輸入並限制對本地資源的訪問。遵循 Electron 的進程隔離指南或 Tauri 的能力模型，並謹慎處理外部內容。


## 根據產品選擇

如果系統 WebView 和 Rust 集成符合團隊需求，而且團隊能測試平臺差異，可以選擇 Tauri。如果一致的 Chromium 運行時和 Node.js 生態更重要，可以選擇 Electron。確定框架前，先驗證最困難的原生功能。

supastack 提供 Tauri 桌面選項和發佈指南。請針對自己的分發目標測試簽名、更新和權限。

- [Tauri architecture](https://v2.tauri.app/concept/architecture/)
- [Electron process model](https://www.electronjs.org/docs/latest/tutorial/process-model)
- [Electron security](https://www.electronjs.org/docs/latest/tutorial/security)
