Is an alternative to Electron for build both native Desktop and mobile apps.
- Does not ship Chromium as the front-end, instead its own web view renderer
- Backends can be written in Rust
- Comes with support for various JS frameworks
- Can be shipped to IOS, Android, Windows, Linux etc.
Make sure to have Rust installed and also cargo available in your terminal.
Getting started
Using the bash starter works best on my machine:sh <(curl https://create.tauri.app/sh)
Bundling and building
pnpm tauri buildautomatically bundles for specified platforms. With pnpm tauri bundlethis process can be refined.
Package management
As Tauri apps consist of both JavaScript and Rust packages, we need to maintain both. Update package with NPM for JS, use cargo in the /src-tauridirectory.
https://v2.tauri.app/develop/updating-dependencies/
Alternatives
Alternatives for building native (mobile) apps with Tauri are:
Sidecars
In Tauri, external binaries can be bundled and shipped in the resulting Tauri app. This is called a sidecar. As of Tauri v2, sidecars can be added in the tauri config file as an external binary.
https://v2.tauri.app/develop/sidecar/
This enables you e. g. to you write a script in Go that is then used internally.
Tips and tricks
Cleaning up regulary:
cargo clean --dry-run -v # show what would be deleted
cargo clean --release # delete release artifacts
cargo clean # clean everything
See more in Rust CLI (Cargo and rustup)