宣布 Tauri v2 测试版发布

Tauri v2 已经开发了 超过一年,现在已准备好迈向稳定的下一步!我们刚刚发布了 Tauri v2.0.0-beta.0,这是我们 路线图 的一个重要里程碑。
🌐 Tauri v2 has been in progress for over a year and it is now ready to take the next step towards being stable! We have just released Tauri v2.0.0-beta.0 which represents a major milestone from our roadmap.
v2 版本为 Tauri 引入了移动端支持,同时还带来了社区请求的多个新功能。让我们来对主要变化做一个高级概述:
🌐 The v2 release introduces mobile support to Tauri and also comes with several new features that have been requested by the community. Let’s get a high level overview of the major changes:
🌐 Mobile
为桌面和移动设备开发应用从未如此简单。Tauri v2 对跨平台开发来说是一个重大宣言,因为我们现在支持 Android 和 iOS。你可以将现有的桌面实现无缝移植到移动设备,并可以访问本地 API,同时享受 Tauri CLI 提供的出色开发体验。
🌐 Developing an application for desktop and mobile has never been easier. Tauri v2 is a huge statement on cross platform development now that we support Android and iOS. You can bring your existing desktop implementation and seamlessly port it to mobile, with access to native APIs and the great developer experience of the Tauri CLI.
🌐 Permissions
v1 允许列表是一个用于保护前端避免访问不必要 API 的好工具,但其配置不够精细,并且缺乏多窗口支持。2.0.0-beta.0 版本引入了一种基于访问控制列表(ACL)的新命令访问方法。现在可以允许特定命令,并为特定窗口甚至远程 URL 定义访问范围。
🌐 The v1 allowlist is a good tool for securing your frontend from accessing unnecessary APIs, but its configuration is not fine grained and it lacks multiwindow support. The 2.0.0-beta.0 release includes a new approach for command access based on Access Control List. It is now possible to allow commands and define scopes for specific windows or even remote URLs.
🌐 New Features
v2 包含了 Tauri 社区最常请求的许多功能:
🌐 v2 includes many of the most requested features by the Tauri community:
🌐 Revamped IPC
负责在 Rust 和 JavaScript 层之间传递消息的 v1 进程间通信 (IPC) 使用的是非常原始的 webview 接口,这迫使我们必须将所有消息序列化为字符串,并且响应传递非常慢。新的 v2 IPC 使用自定义协议,其功能和性能更类似于 webview 处理基于 HTTP 的常规通信,更多信息请参见 pull request。
🌐 The v1 Inter-Process Communication (IPC) which is responsible for delivering messages between the Rust and JavaScript layers uses a very rudimentary webview interface which forces us to serialize all messages to strings and is super slow to deliver responses. The new v2 IPC uses custom protocols, which is more reminiscent in function and performance to how the webview handles regular HTTP based communication, see the pull request for more information.
此外,还有一个新的通道 API,因此你可以快速地将数据从 Rust 发送到前端。
🌐 Additionally, there is a new channel API so you can quickly send data from Rust to your frontend.
🌐 Multiwebview
Tauri 现在支持在单个窗口中添加多个 webview。这也是一个备受期待的功能请求。
请注意,这仍然是一个未完成的功能,在我们与社区一起审查 API 设计时,它被隐藏在 unstable Cargo 功能标志后面。
🌐 Tauri now supports adding multiple webviews to a single window. This is also a highly anticipated feature request.
Note this is still an unfinished feature that is hidden behind an unstable Cargo feature flag while we review the API design together with the community.
🌐 Menu and tray icon JavaScript APIs
以前你只能通过 Rust 代码配置窗口菜单和托盘图标。现在你也可以在 JavaScript 端进行配置,这要容易得多!我们还添加了用于专门管理 macOS 应用菜单的 API。
🌐 Previously you could only configure window menus and tray icons via Rust code. Now you can do so on the JavaScript side too, which is a lot easier! We also added APIs to manage the macOS application menu specifically.
🌐 Context Menus
最受欢迎的功能之一是原生上下文菜单。它终于可以通过由muda提供支持的Rust和JavaScript API使用。
🌐 One of the most requested features is native context menus. It is finally available with both Rust and JavaScript APIs powered by muda.
🌐 Window APIs
已经实现了几个新的窗口 API,使你的应用更易于配置。
🌐 Several new window APIs have been implemented, making your app much more configurable.
🌐 Mobile APIs
v2 版本默认支持一些移动原生 API。目前支持通知、对话框、NFC、条形码扫描、生物识别认证、剪贴板和深度链接。更多 API 将在稳定版本发布后很快添加。
🌐 The v2 release comes with some mobile native API support by default. Currently there is support for notifications, dialogs, NFC, barcode reading, biometric authentication, clipboard and deep link. More APIs will be added soon after the stable release.
🌐 Audit
我们目前正在接受审计,以确保 v2 是安全的,这类似于我们为 v1 稳定版本所做的工作。
🌐 We are currently being audited to ensure v2 is safe, similar to what we did for the v1 stable release.
🌐 Stability
该 API 还不稳定,但预计不会有重大变化。审计完成并完成更改后,我们将升级到候选发布版本,并随后很快推出 v2 稳定版本。敬请关注!
🌐 The API is not stable yet, but no major changes are expected. As soon as the audit is completed and the changes are done, we will promote to a Release Candidate and a v2 stable release soon after that. Stay tuned!
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站