> ## 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)
