Home » Tauri: Slim Electron challenger in Rust

Tauri: Slim Electron challenger in Rust

by admin
Tauri: Slim Electron challenger in Rust

Tauri: Slim Electron challenger in Rust

Many applications such as Signal, Slack, WhatsApp, Discord or Visual Studio Code use Electron, a framework for running applications across platforms. The app itself is implemented using web technologies such as HTML, CSS, JavaScript and WebAssembly. Electron packages the applications together with the Chromium web browser and the Node.js runtime in a platform-specific bundle. The web application can access all interfaces of the operating system via the so-called backend in Node.js.

Advertisement

Christian Liebel (@christianliebel) is a software developer at Thinktecture in Karlsruhe. He supports his customers with digitalization projects and the modernization of business applications. His hobbyhorse is cross-platform applications based on modern web technologies such as Angular, Progressive Web Apps, Project Fugu and Web Components. He has been recognized as a Microsoft MVP and Google GDE for his community contributions.

Developers save a lot of time, money and effort with this approach because they only have to develop their application once using web technologies and can distribute it on a variety of platforms, including web browsers.

The Progressive Web App paint.js.org packaged as an Electron application

However, Electron applications are unfortunately very large due to the bundling of two runtime environments: Even a simple Hello World application packed in Electron is around 100 MB in size.

Each running instance results in additional memory consumption, and outdated Node.js and Chromium versions within an application bundle can lead to security issues. Developers must distribute updates not only when their app is updated, but also when Electron has updated.

See also  Disney+ Announces Debut Date for Percy Jackson and the Olympians TV Series: Ushering in a New Era of Gods and Men

(Bild: Tauri.app)

This is where Tauri comes into play: The Electron challenger also allows web applications to be packaged in the form of a platform-specific bundle. However, Tauri does not add its own web browser, but rather uses the web view of the operating system on which the application is running: WebView2 on Windows, WebKit on macOS and WebKitGTK on Linux.

In Tauri 2.0, which is currently still in the alpha phase, iOS and Android will be added to the list of supported platforms. These platforms cannot be addressed with Electron. Tauri would also replace wrappers for mobile operating systems such as Cordova or Capacitor.

No visual difference: Here PaintJS in Tauri, on macOS under WebKit.

In the backend, Tauri does not use JavaScript, but rather Rust. In this respect, Node.js does not have to be packaged with the application. A Hello World application with Tauri is just 600 Kbytes in size. Using sidecars, applications can be delivered with external binaries that are written in other languages.

And the topic of security is also very important at Tauri: This means that the required programming interfaces can be activated in a targeted manner. Only then will the code required for this be included in the bundle. Tauri also brings many advanced features such as an auto-update or integration into the platform’s notification system.

However, the disadvantage of Tauri is precisely that the web application now runs in different execution environments: support for certain web interfaces or CSS features varies between different web engines, so the application must be tested on all target environments.

See also  Software development: Announcement of the tech:lounge Masterclass

While Electron is published by GitHub, Tauri is a community-driven project. Tauri is financially supported by 1Password, whose password manager is at least currently based on Electron.

Even though the first version of Tauri has been released for a while, it is still the “new kid on the block”. There are currently no big names among Tauri users. However, it is not just because of the significantly smaller bundle size that the framework should be considered, perhaps even ahead of the top dog Electron. A new Tauri app can be created using the npm command npm create tauri-app , on Bash with sh

(rme)

To home page

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy