宣布 Tauri 1.1.0

经过113个拉取请求和近两个月的工作,Tauri团队很高兴地宣布1.1.0版本发布。更改已在内部审计,未发现安全问题。
🌐 After 113 pull requests and nearly two months of work, the Tauri team is pleased to announce the 1.1.0 release. The changes were internally audited and no security issues were found.
你可以使用以下命令更新依赖:
🌐 You can update the dependencies with:
npm install @tauri-apps/cli@latest @tauri-apps/api@latestyarn upgrade @tauri-apps/cli @tauri-apps/api --latestpnpm update @tauri-apps/cli @tauri-apps/api --latestcargo update🌐 What’s New in 1.1.0
🌐 Security patch
此版本包含一个由 @martin-ocasek 报告的安全漏洞补丁。当发现符号链接时,readDir 函数能够返回超出配置范围的条目。该补丁也可在 Tauri 1.0.6 中使用。有关更多详细信息,请参阅 GitHub 上的问题。
🌐 This release includes a patch for a security vulnerability reported by @martin-ocasek. The readDir function was able to return entries outside the configured scope when a symlink is found. The patch is also available in Tauri 1.0.6. See the issue on GitHub for more details.
🌐 Icon Generation
我们一直建议使用 tauricon 项目,通过单一来源的 PNG 为你的 Tauri 应用生成图标。已经报告了几个问题,因此我们决定“用 Rust 重写它”,以增强其稳定性。这使我们能够将此功能移到主 Tauri CLI 中,所以现在你可以使用 tauri icon 命令。
🌐 We have been recommending to use the tauricon project to generate icons for your Tauri application using a single source PNG. Several issues have been reported, and we decided to “Rewrite It In Rust” to enhance its stability. This allowed us to move this functionality to the main Tauri CLI, so now you can use the tauri icon command.
🌐 cargo-binstall Support for Tauri CLI
Tauri CLI 现在可以使用 cargo-binstall 安装,这是一种用于下载和安装预构建 Rust 二进制文件的机制。这些二进制文件适用于主要目标,并可以通过以下方式安装:
🌐 The Tauri CLI can now be installed using cargo-binstall, a mechanism to download and install pre-built Rust binaries. The binaries are available for the main targets and can be installed with:
$ cargo install cargo-binstall$ cargo binstall tauri-cli$ cargo tauri dev # run any Tauri command!🌐 Create System Trays at Runtime
系统托盘 API(以前仅在 tauri::Builder::system_tray 可用)现在可以在运行时与 tauri::SystemTray 一起使用,让你可以控制其生命周期,甚至创建多个托盘。
🌐 The system tray APIs (previously only available in tauri::Builder::system_tray) can now be used at runtime with tauri::SystemTray giving you control over its lifetime and even create multiple trays.
这里有一个快速示例说明如何使用它:
🌐 Here’s a quick example on how to use it:
use tauri::{Builder, CustomMenuItem, SystemTray, SystemTrayEvent, SystemTrayMenu};Builder::default() .setup(|app| { let handle = app.handle(); SystemTray::new() .with_id("main") .with_menu( SystemTrayMenu::new().add_item(CustomMenuItem::new("quit", "Quit")) ) .on_event(move |event| { let tray_handle = handle.tray_handle_by_id("main").unwrap(); if let SystemTrayEvent::MenuItemClick { id, .. } = event { if id == "quit" { tray_handle.destroy().unwrap(); } } }) .build(&handle) .expect("unable to create tray"); });🌐 TOML Configuration Support
在 1.0 版本中,Tauri 默认支持 JSON 配置格式,当启用 config-json5 Cargo 功能时支持 JSON5,这意味着以下配置是有效的:
🌐 In the 1.0 releases Tauri supports the JSON configuration format by default, and JSON5 when the config-json5 Cargo feature is enabled, meaning the following configurations are valid:
{ "build": { "devPath": "http://localhost:8000", "distDir": "../dist" }}{ build: { // devServer URL (comments are allowed!) devPath: 'http://localhost:8000', distDir: '../dist', },}1.1.0 版本包括通过 config-toml Cargo 功能支持 TOML。现在你可以在 Tauri.toml 文件中定义你的 Tauri 配置:
🌐 The 1.1.0 release includes TOML support behind the config-toml Cargo feature. Now you can define your Tauri configuration in a Tauri.toml file:
[build]dev-path = "http://localhost:8000"dist-dir = "../dist"🌐 Dependency Updates
此版本包括一些依赖更新,如果你在应用中使用这些库实现平台特定功能,则必须处理这些更新。最重要的更新如下:
🌐 This release includes some dependency updates that must be handled in your app if you implement platform-specific functionalities using these crates. The most important updates are:
windows更新到 0.39.0webview2-com更新到 0.19.1raw-window-handle更新到 0.5.0
确保你还更新像 window-vibrancy 和 window-shadows 这样的插件到最新版本。
🌐 Make sure you also update plugins such as window-vibrancy and window-shadows to latest.
🌐 Contributors to 1.1.0
Tauri 团队感谢以下贡献者为 1.1.0 版本所做的贡献:
🌐 The Tauri team thanks the following contributors for the 1.1.0 release:
- Berrysoft
- keraf
- jsoref
- A-kirami
- olivierlemasle
- mateo-gallardo
- rockerBOO
- Flecart
- brian14708
- koriwi
- paul-soporan
- shniubobo
- horochx
- RubenKelevra
- LIMPIX31
- AxlLind
🌐 Other Changes
此版本中有许多较小的更改和错误修复。你可以在以下部分中查看版本说明的摘要。完整的变更日志可以在发布页面找到。
🌐 There are a lot of smaller changes and bug fixes in this release. You can see a summary of the release notes in the following sections. The complete changelog can be found on the releases page.
🌐 New
tauri icon命令fs模块中的existsAPI- 使用
tauri dev --no-watch禁用开发监视器的选项 - 自动将任何
.taurignore文件用作开发监视器和应用路径查找器的忽略规则 - 为 Tauri CLI 添加对 cargo-binstall 的支持
- TOML 配置格式 (Tauri.toml)
- Linux上的主题API
- 在运行时创建系统托盘
beforeBundleCommand配置beforeDevCommand和beforeBuildCommand现在有一个选项来配置当前工作目录api::Command::encoding方法用于设置 stdout/stderr 的编码- 在 Linux 上添加了
native-tls-vendored和reqwest-native-tls-vendoredCargo 功能,以编译并静态链接到自带的 OpenSSL 副本 - 为
App和AppHandle实现raw_window_handle::HasRawDisplayHandle
🌐 Fixes
- CLI 解析器忽略内部子命令。
- 更新程序在 Finder 中损坏了应用图标。
- 使用
CodegenContextAPI 时修复 codegen 输出的根目录。
🌐 Security
- 修复
fs.readDir递归选项读取不在作用域内的符号链接目录的问题
🌐 Improvements
- 根据配置的公钥验证更新程序签名
- 如果边车配置了与应用相同的文件名,则返回错误。
- 将创建的窗口保存在 RefCell 中而不是 Mutex 中,以避免死锁
- 在
tauri init中提示beforeDevCommand和beforeBuildCommand。 - 使用
cargo metadata检测工作区根目录和目标目录。 - 允许配置
before_dev_command以强制 CLI 在继续之前等待命令完成。 - 避免在每次构建时重新下载 AppImage 构建工具。
- 在
api::process::restart中保留命令行参数 - 通过清单依赖
Microsoft.Windows.Common-Controls v6.0.0.0在 Windows 上增强对话框样式。 - 如果资源或图标发生变化,请重新运行代码生成
- 只有在内容更改时才重写临时图标文件,避免不必要的重建。
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站