DEV Community

loading...
Cover image for Announcing Tauri Beta - More efficient crossplatform apps with better features
Tauri

Announcing Tauri Beta - More efficient crossplatform apps with better features

nothingismagick profile image nothingismagick ・7 min read

Hello fellow engineers, project managers, and technocrats! Today, after exactly two years of work, we are proud to announce the Beta release of Tauri 1.0.



So, what Is Tauri?

Tauri enables you to make apps using the Webview technology stack that each operating system provides. It empowers you to call into the app backend using a JS api, which gives you opt-in access to things like the filesystem. All of this is done without needing to ship a localhost server and while maintaining a secure context for your application.

Tauri apps can have custom menus and tray-type interfaces. They can be updated securely, and are managed by the user's operating system as expected. Their ultimate binaries are very small, because they not only use the system's webview, they also do not need to ship a runtime (like Node.js), since the final binary is compiled from Rust. This makes Tauri apps quite small and performant, and also turns the reversing of Tauri apps into a task that is neither trivial nor fun.

If you want to find out more, we recommend checking out the intro on our website or diving into the architectural design document.


In short, Tauri is a toolkit for creating smaller, faster, and more secure desktop apps with a web frontend. Tauri's core system is written in stable Rust and currently uses that for the main process. However, you do not need to write Rust code to interact. Nevertheless, we plan on providing bindings to other languages after the full 1.0 release.

We are finally happy enough with its shape and approach that we are marking its status as Beta. This means that over the course of the next several months a few things are going to happen:

  1. We will make sure it builds properly on all the platforms we want to support. This includes the major Desktops and the Major Mobile operating systems.
  2. We will employ a third-party security consultancy to perform a horizontal security audit so that we can be confident that the core libraries are safe to use.
  3. We will fix bugs that arise and work on reducing final bundle sizes as much as possible.

What's New?

So many things have changed that we can't fit the full list here. Instead, we'll just be summarising the biggest changes. If you want the gory details, visit our Release Notes.

However, if you already started a Tauri project back in the Alpha days, check out this migration page to get informed as to what you have to do to get back in the saddle.

WRY (Webview Rendering librarY)

Tauri Alpha used bindings to webview/webview, a C++ library. While these got the job done, they were quite buggy on Windows and were lacking a lot of features we wanted. We've replaced these with WRY, a new, pure Rust Webview library we developed for Tauri. WRY has proven to be much more stable on Windows, and adds the following features to all platforms:

  • Custom window styles: frameless, transparent, invisible, always-on-top
  • Height and width constraints
  • Draggable regions
  • Programmatic setting of: size and size constraints, window styles, minimized/maximized, title
  • Custom app menus
  • System tray support

TAO

For the first part of its existence, WRY depended on winit, the amazing Windowing provider for many operating systems. As time went on, however, we also need some advanced features like menubar and system tray which contradicted with their vision, and thus we made the hard decision to fork winit and republish it under a different name: TAO.

This means that the TAuri Organisation controls all first-order dependencies.

Rust CLI

We've moved almost every command to a new CLI, written in Rust. This means Node.js is no longer required for developing Tauri apps, although it is recommended for now (unless you have problems with node.js and compiling some of the libraries for imagemin). We'll be moving the final commands over soon, making the JS CLI a thing of the past. Want to test it while we are still in beta?

% cargo install tauri-cli --version ^1.0.0-beta
% cargo tauri --version
cargo-tauri 1.0.0-beta.0
Enter fullscreen mode Exit fullscreen mode

cargo run Support

It is now possible to run your Tauri application with cargo run instead of through the Tauri CLI. This is possible through a new internal codegen crate that can generate everything required from your Tauri config file. This still requires you to have a valid tauri.conf.json along with whatever assets inside your distDir already generated. For the time being, the codegen will not run your beforeBuildCommand or beforeDevCommand from the config.

New Web Content Loader

We've removed both the no-server and embedded-server modes, and replaced them with a new custom protocol loader. This combines the security of the no-server mode with the stability of the embedded-server, and is more performant than both.

Multiwindow

It's finally here! Thanks to WRY's improved interface, we've been able to add one of the most requested features to Tauri. You can now create multiple windows, either at launch through tauri.conf.json or programatically through Rust. We've used this in our new Splashscreen Guide, which allows your app's web contents to load in the background while a splashscreen is displayed.

Improved Command Handling

We've added some macros that makes creating Rust commands as simple as writing a function:

// Defining commands is no longer a multi-file mess
#[tauri::command]
fn my_custom_command() {
  println!("I was invoked from JS!");
}

fn main() {
  tauri::Builder::default()
    // No need to write a fancy handler, either
    // Just pass in a list of all your commands
    .invoke_handler(tauri::generate_handler![my_custom_command])![generate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpkroh61gxeho4aq1ivk.png)

    .run(tauri::generate_context!())
    .expect("error while running application");
}
Enter fullscreen mode Exit fullscreen mode
// Calling your commands is super easy as well
import { invoke } from '@tauri-apps/api/tauri'
invoke('my_custom_command')
Enter fullscreen mode Exit fullscreen mode

Tauri's command feature also supports passing arguments, returning values and errors, and running async functions.

Updater

We've added a new updater feature, allowing you to easily ship updates to your Tauri apps. You can create a custom update notification and progress indicator, or use the builtin update prompts. Updates are signed on publish and verified before installing, so users can be sure they aren't getting a malicious version of your app.

External Audit

We are working together with Doyensec to undertake a complete horizontal audit of the critical components of Tauri, Tao & Wry. Doyensec has a long history of analysing Electron apps, so they are extraordinarily qualified to investigate the issues surrounding desktop apps. Once the audit is completed and we have resolved any and all concerns raised by the auditors, we will have crossed the threshold to a stable ecosystem and the 1.0 release will follow. If you plan to use Tauri in production, please consider making a donation to our Open Collective fundraising campaign to support this expensive endeavour.

Get Started With Tauri

If you'd like to get started making apps with Tauri, check out our getting started guide. Within a few minutes, you'll have your first Tauri app up and running.

generate

What Tauri does not

  • Tauri does not use Internet Explorer based Webviews, so there is no outdated Internet Explorer code being shipped in your app. (Seriously, stop spreading FUD.)
  • Tauri does not ship Node.js by default, and actually you don't even need to have Node.js installed on your machine to build Tauri apps. (You can in fact just use the Rust CLI, and even build your entire frontend with a WASM based system like YEW).
  • Tauri does not run a devserver for your HTML/CSS/JS framework. There are just too many of them and they change all the time, so it is not worth the maintenance burden.

Who is Tauri

The Tauri organisation aims to be a sustainable collective based on principles that guide sustainable free and open software communities. To this end it is currently becoming a Programme within the Commons Conservancy, and you can contribute financially via Open Collective.

What's Next?

We've got a lot planned for Tauri, like Arm/Android/iOS support, a testing framework, and binding to other languages for the main process. See our roadmap for the full list. If you'd like to help add these features to Tauri (or if you have any questions), we'd love for your to join our Discord Server at https://discord.gg/tauri . Let us know that you want to contribute, and we'll find a good task for you and guide you along.

You can also help us out by donating to our Open Collective, however if your company actually turns a profit using Tauri, you should really consider the benefits of becoming a platinum sponsor. And speaking of sponsoring... how many open source projects do you sponsor? We hear that Babel needs support.


Title Graphic: Alve Larsson

Discussion (14)

Collapse
jwenjian profile image
Jiang Wenjian

wow, its beta now, I should have update my LuckyYou app then, glag to see tauri growing better and better

Collapse
nothingismagick profile image
Collapse
laegel profile image
Laegel

Yup, that would be awesome if you could update it! :D
Someone made a nice migration guide, by the way: tauri.studio/en/docs/usage/guides/...

Collapse
jwenjian profile image
Collapse
zzoukk profile image
zZouKk • Edited

It empowers you to call into the app backend using a JS api, which gives you opt-in access to things like the filesystem

How do you add NeDB for a desktop app with Tauri? With Electron, I use IPC's channel to instruct CRUD commands to the main process.

Collapse
nothingismagick profile image
nothingismagick Author

If you have a rust interface to your NeDB, you can send a message from the WebView and CRUD to your heart's content. Otherwise, we allow you to ship sidecar binaries that you can communicate with using the RPC channels.

Collapse
akryum profile image
Collapse
rawrmonstar profile image
Tegan Churchill

This is really exciting! I was wondering how is accessibility handled with Tauri?

Collapse
nothingismagick profile image
nothingismagick Author

a11y is all something that your framework should handle.

Collapse
rawrmonstar profile image
Tegan Churchill

So accessibility tech treats these web views the same as they would any webpage?

Thread Thread
laegel profile image
Laegel • Edited

This is not a topic we've been investigating in depth but I think so, yes!
Feel free to join our Discord for a little chat. 😀

Collapse
gberthiaume profile image
G. Berthiaume

In this bloated world, project like Tauri seems more important than ever.
thanks for your work!

Collapse
jswhisperer profile image
Greg, The JavaScript Whisperer

Amazing work Tauri team!
I think you really addressed every major request I've seen since following the project.
(menu bar, multiwindow, app, and easier Rust commands)

Collapse
eshimischi profile image
eshimischi

tauri-bundler is no longer in need, you replaced it with cargo-tauri CLI, am i correct?

Forem Open with the Forem app