new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · all subjects

architecture & advanced

23 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Isolation pattern threat model target

The Isolation pattern was designed primarily to address Development Threats. Many frontend build-time tools consist of many dozen or hundreds of deeply-nested dependencies, and complex applications may have large amounts of similarly nested dependencies bundled into the final output. The Isolation pattern helps protect against threats from these untrusted dependencies.

When to use Isolation pattern

Tauri highly recommends using the Isolation pattern whenever it can be used because it intercepts all messages from the frontend. It can always be used and should be used to validate IPC inputs to ensure they are within expected parameters, such as checking that file access calls do not try to access paths outside the application's expected locations, or that API HTTP fetch calls only set the Origin header to expected values. The Isolation pattern works with all messages including events.

Isolation pattern performance impact

The Isolation pattern adds performance overhead compared to the Brownfield pattern due to message encryption, even if the Isolation application does nothing. Most applications should not notice the runtime costs of encrypting/decrypting IPC messages as they are relatively small and AES-GCM is relatively fast. A cryptographically secure key is generated once each time the Tauri application starts, which is generally not noticeable if the system has adequate entropy. In headless environments for integration testing, installing an entropy-generating service like haveged may be beneficial.

Isolation pattern limitation with external files on Windows

External files do not load correctly inside sandboxed iframes on Windows. To address this, Tauri implements script inlining during build time that takes the content of scripts relative to the Isolation application and injects them inline. Typical bundling and simple script inclusion like '<script src="index.js"></script>' works properly, but newer mechanisms such as ES Modules will not successfully load.

tauri-action - GitHub workflow

tauri-action is a GitHub workflow that builds Tauri binaries for all platforms. It even allows creating a very basic Tauri app even if Tauri is not set up.

tauri-vscode - VS Code enhancement

tauri-vscode is a project that enhances the Visual Studio Code interface with several nice-to-have features.

Tauri core purpose and composition

Tauri is a polyglot and generic toolkit for building applications for desktop computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of optional JS API and Rust API so that webviews can control the system via message passing. Developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily.

Tauri not a lightweight kernel wrapper or VM

Tauri is not a lightweight kernel wrapper; instead it directly uses WRY and TAO to do the heavy lifting in making system calls to the OS. Tauri is not a VM or virtualized environment; instead it is an application toolkit that allows making Webview OS applications.

Tauri app advantages - small size and reversing difficulty

Tauri apps are very small because they use the OS's webview. They do not ship a runtime since the final binary is compiled from Rust. This makes the reversing of Tauri apps not a trivial task.

tauri crate - main product

The tauri crate is the major crate that holds everything together. It brings the runtimes, macros, utilities and API into one final product. It reads the tauri.conf.json file at compile time to bring in features and undertake the actual configuration of the app, including the Cargo.toml file in the project's folder. It handles script injection for polyfills and prototype revision at runtime, hosts the API for systems interaction, and manages the updating process.

tauri-runtime crate purpose

The tauri-runtime crate is the glue layer between Tauri itself and lower-level webview libraries.

tauri-macros crate purpose

The tauri-macros crate creates macros for the context, handler, and commands by leveraging the tauri-codegen crate.

tauri-utils crate purpose

The tauri-utils crate contains common code that is reused in many places and offers useful utilities like parsing configuration files, detecting platform triples, injecting the CSP, and managing assets.

tauri-build crate purpose

The tauri-build crate applies the macros at build-time to rig some special features needed by cargo.

tauri-codegen crate purpose

The tauri-codegen crate embeds, hashes, and compresses assets, including icons for the app as well as the system tray. It parses tauri.conf.json at compile time and generates the Config struct.

tauri-runtime-wry crate purpose

The tauri-runtime-wry crate opens up direct systems-level interactions specifically for WRY, such as printing, monitor detection, and other windowing-related tasks.

JavaScript/TypeScript API library purpose

The JavaScript/TypeScript API library (tauri/packages/api) creates cjs and esm JavaScript endpoints for import into frontend frameworks so that the Webview can call and listen to backend activity. It ships in pure typescript for frameworks where this is more optimal and uses the message passing of webviews to their hosts.

cli.rs and cli.js purpose

cli.rs is a Rust executable that provides the full interface to all of the required activities for which the CLI is required and runs on macOS, Windows, and Linux. cli.js is a wrapper around cli.rs using napi-rs to produce npm packages for each platform.

create-tauri-app purpose

create-tauri-app is a toolkit that enables engineering teams to rapidly scaffold out a new tauri-apps project using the frontend framework of their choice, as long as it has been configured.

TAO - cross-platform window creation library

TAO is a cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Written in Rust, it is a fork of winit that has been extended for Tauri's needs like menu bar and system tray.

WRY - cross-platform WebView rendering library

WRY is a cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux. Tauri uses WRY as the abstract layer responsible to determine which webview is used and how interactions are made.

Tauri licensing

Tauri itself is licensed under MIT or Apache-2.0. If you repackage it and modify any source code, it is your responsibility to verify that you are complying with all upstream licenses. Tauri is provided AS-IS with no explicit claim for suitability for any purpose.

Tauri is designed for extensibility

Tauri is architected with extensibility as a core design principle, allowing for plugins and custom functionality to extend the framework's capabilities.

Give your agent this brain