src/content/docs/blog/tauri-1-1.mdx
import CommandTabs from '@components/CommandTabs.astro';
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:
<CommandTabs npm="npm install @tauri-apps/cli@latest @tauri-apps/api@latest" yarn="yarn upgrade @tauri-apps/cli @tauri-apps/api --latest" pnpm="pnpm update @tauri-apps/cli @tauri-apps/api --latest" cargo="cargo update" />
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.
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 CLIThe 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!
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");
});
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',
},
}
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"
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 updated to 0.39.0webview2-com updated to 0.19.1raw-window-handle updated to 0.5.0Make sure you also update plugins such as window-vibrancy and window-shadows to latest.
The Tauri team thanks the following contributors for the 1.1.0 release:
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.
tauri icon commandexists API in the fs moduletauri dev --no-watch.taurignore file as ignore rules for dev watcher and app path finderbeforeBundleCommand configurationbeforeDevCommand and beforeBuildCommand now has an option to configure the current working directoryapi::Command::encoding method to set the stdout/stderr encodingnative-tls-vendored and reqwest-native-tls-vendored Cargo features to compile and statically link to a vendored copy of OpenSSL on Linuxraw_window_handle::HasRawDisplayHandle for App and AppHandleCodegenContext API.fs.readDir recursive option reading symlinked directories that are not allowed by the scopebeforeDevCommand and beforeBuildCommand in tauri init.cargo metadata to detect the workspace root and target directory.before_dev_command to force the CLI to wait for the command to finish before proceeding.api::process::restartMicrosoft.Windows.Common-Controls v6.0.0.0.