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 · Plugins and security · all subjects

plugin setup & installation

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

create-tauri-app v3 removed templates

create-tauri-app version 3 removed the following templates to improve maintainability: next, next-ts, preact, preact-ts, clojurescript, svelte-kit, and svelte-kit-ts.

create-tauri-app v3 supported templates

create-tauri-app version 3 supports UI templates for Vanilla, Vue, Svelte, React, Solid, Angular, and SvelteKit. For templates with multiple language options, users can choose between TypeScript and JavaScript.

create-tauri-app v2 access for legacy templates

Previous version 2 of create-tauri-app remains available for users who want legacy templates. It can be accessed with: pnpm create tauri-app@2, yarn create tauri-app@2, npm create tauri-app@2, cargo install create-tauri-app --version 2.8.0 --locked, sh <(curl https://create.tauri.app/v/2.8.0/sh), or iwr -useb https://create.tauri.app/v/2.8.0/ps | iex for PowerShell.

Community templates for Tauri frameworks

The Tauri community is encouraged to submit custom templates for different frontend frameworks to the awesome-tauri repository's templates section, where they are shared with the broader Tauri community.

create-tauri-app version 3 release date

create-tauri-app version 3 was released on March 1, 2023.

create-tauri-app v3 adds Tauri 2.0 beta support

create-tauri-app version 3 adds support for Tauri 2.0 beta version with the --beta flag, which bootstraps an app using tauri@2.0.0-beta.

create-tauri-app v3 mobile project support

create-tauri-app version 3 enables initialization of iOS and Android mobile projects. When using the --beta flag, it prompts whether to add mobile support, and a --mobile flag can be used to automatically make projects mobile compatible.

create-tauri-app installation commands for alpha

To create a Tauri app with alpha support using create-tauri-app v3, use commands: pnpm create tauri-app --alpha, yarn create tauri-app --alpha, npm create tauri-app -- --alpha, cargo create-tauri-app --alpha, sh <(curl https://create.tauri.app/sh) --alpha, or $env:CTA_ARGS="--alpha";iwr -useb https://create.tauri.app/ps | iex for PowerShell.

Dialog plugin migration example

To migrate from tauri::api::dialog to tauri-plugin-dialog in Rust: add tauri-plugin-dialog = "2" to Cargo.toml, then use: use tauri_plugin_dialog::DialogExt; app.dialog().file().pick_file(...);

File drop configuration renamed

In Tauri 2.0, tauri > windows > fileDropEnabled has been renamed to app > windows > dragDropEnabled.

Bundle updater artifacts configuration

In Tauri 2.0, bundle > createUpdaterArtifacts must be set when using the app updater. For upgrading v1 apps already distributed, set this to v1compatible. Refer to the Updater guide for details.

Global shortcut plugin migration example

To migrate to tauri-plugin-global-shortcut in Rust: add [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))" .dependencies] with tauri-plugin-global-shortcut = "2", then use: use tauri_plugin_global_shortcut::GlobalShortcutExt; app.global_shortcut().register("CmdOrCtrl+Y")?;

HTTP plugin migration example

To migrate to tauri-plugin-http in Rust: add tauri-plugin-http = "2" to Cargo.toml, then use: use tauri_plugin_http::reqwest; let response = reqwest::get(url).await?; The plugin re-exports reqwest.

Notification plugin migration example

To migrate to tauri-plugin-notification in Rust: add tauri-plugin-notification = "2" to Cargo.toml, then use: use tauri_plugin_notification::NotificationExt; if app.notification().permission_state()? == PermissionState::Granted { app.notification().builder().body("message").show()?; }

OS plugin migration example

To migrate to tauri-plugin-os in Rust: add tauri-plugin-os = "2" to Cargo.toml, then use: let os_arch = tauri_plugin_os::arch();

Shell plugin migration example

To migrate to tauri-plugin-shell in Rust: add tauri-plugin-shell = "2" to Cargo.toml, then use: use tauri_plugin_shell::ShellExt; app.shell().open("https://github.com", None)?;

JavaScript WebviewWindow import location

In Tauri 2.0, the JavaScript WebviewWindow class is imported from @tauri-apps/api/webviewWindow instead of @tauri-apps/api/window.

Mobile preparation requires shared library output

When preparing a Tauri application for mobile, the project must output a shared library. To migrate an existing desktop application to mobile, you need to modify the crate to generate library files alongside desktop executables.

Cargo manifest configuration for mobile library generation

To generate a library for mobile in Tauri 2, add the following to src-tauri/Cargo.toml: [lib] section with name = "app_lib" and crate-type = ["staticlib", "cdylib", "rlib"]

Mobile entry point macro in Tauri

The #[cfg_attr(mobile, tauri::mobile_entry_point)] macro is used to prepare a Rust function for execution on mobile. The main function in lib.rs should be renamed to pub fn run() and decorated with this macro.

Tauri configuration restructuring in v2

Major configuration changes in Tauri 2.0: (1) package.productName and package.version moved to top-level; (2) package object removed; (3) tauri key renamed to app; (4) allowlist removed and replaced by permissions system; (5) systemTray renamed to trayIcon; (6) pattern moved to app.security.pattern; (7) bundle moved to top-level; (8) build.distDir renamed to frontendDist; (9) build.devPath renamed to devUrl.

Plugins moved from core configuration

In Tauri 2.0, tauri.cli moved to plugins.cli, and tauri.updater moved to plugins.updater.

Linux protocol body feature flag

The linux-protocol-body Cargo feature flag enables parsing of custom protocol request bodies for IPC (inter-process communication) usage. Requires webkit2gtk 2.40 or higher.

Removed Cargo features in Tauri v2

The following Cargo features were removed in Tauri 2.0: (1) reqwest-client (reqwest is the only valid client); (2) reqwest-native-tls-vendored (use native-tls-vendored instead); (3) process-command-api (use shell plugin); (4) shell-open-api (use shell plugin); (5) windows7-compat (moved to notification plugin); (6) updater (now a plugin); (7) linux-protocol-headers (default behavior upgraded); (8) system-tray (renamed to tray-icon).

Dialog plugin migration from Tauri core

The tauri::api::dialog module was removed. Use tauri-plugin-dialog instead for Rust and @tauri-apps/plugin-dialog for JavaScript.

File system API removed from core

The tauri::api::file module was removed. For Rust, use std::fs. For JavaScript, use @tauri-apps/plugin-fs.

HTTP plugin migration from core

The tauri::api::http module was removed. Use tauri-plugin-http for Rust and @tauri-apps/plugin-http for JavaScript.

Shell plugin replaces process API

The tauri::api::process::Command, tauri::api::shell, and tauri::Manager::shell_scope APIs were removed. Use tauri-plugin-shell instead.

Version module removed from core

The tauri::api::version module was removed. Use the semver crate instead.

Clipboard manager moved to plugin

App::clipboard_manager and AppHandle::clipboard_manager were removed. Use tauri-plugin-clipboard-manager instead.

CLI matches API moved to plugin

App::get_cli_matches was removed. Use tauri-plugin-cli instead.

Global shortcut manager moved to plugin

App::global_shortcut_manager and AppHandle::global_shortcut_manager were removed. Use tauri-plugin-global-shortcut instead.

Updater module removed from core

The updater module was removed in Tauri 2.0. Use tauri-plugin-updater instead.

JavaScript API core module renamed

The @tauri-apps/api/tauri module was renamed to @tauri-apps/api/core in Tauri 2.0.

JavaScript API modules moved to plugins

In Tauri 2.0, the following @tauri-apps/api modules were removed: cli, clipboard, dialog, fs, global-shortcut, http, os, notification, process, shell, and updater. Each has a corresponding @tauri-apps/plugin-* package.

JavaScript window module renamed

The @tauri-apps/api/window module was renamed to @tauri-apps/api/webviewWindow in Tauri 2.0.

Process plugin migration example

To migrate to tauri-plugin-process in Rust: add tauri-plugin-process = "2" to Cargo.toml, then use: app.handle().exit(1); or app.handle().restart();

Updater built-in dialog removed

In Tauri 2.0, the built-in automatic update check dialog was removed. Use the Rust and JavaScript APIs from tauri-plugin-updater to implement custom update checking and installation.

CLI plugin migration example

To migrate from tauri::api::cli to tauri-plugin-cli in Rust: add tauri-plugin-cli = "2" to Cargo.toml, then in setup: use tauri_plugin_cli::CliExt; let cli_matches = app.cli().matches()?;

Clipboard plugin migration example

To migrate from clipboard manager to tauri-plugin-clipboard in Rust: add tauri-plugin-clipboard = "2" to Cargo.toml, then use: use tauri_plugin_clipboard::{ClipboardExt, ClipKind}; app.clipboard().write(ClipKind::PlainText { label: None, text: "text".into() })?;

File system plugin JavaScript migration

To migrate from @tauri-apps/api/fs to @tauri-apps/plugin-fs in JavaScript: import { mkdir, BaseDirectory } from '@tauri-apps/plugin-fs'; await mkdir('db', { baseDir: BaseDirectory.AppLocalData });

File system API function name changes

In Tauri 2.0 fs plugin: createDir renamed to mkdir, readBinaryFile renamed to readFile, removeDir replaced by remove, removeFile replaced by remove, renameFile replaced by rename, writeBinaryFile renamed to writeFile. Also, Dir enum removed in favor of BaseDirectory.

Embedded mobile dev server no longer publicly exposed to network

The built-in mobile development server was changed to not expose itself to the entire network. Instead, it tunnels traffic directly from the local computer to the device.

iOS dev server on physical devices requires TAURI_DEV_HOST configuration

When running on physical iOS devices, the development server configuration must be adapted to use the TAURI_DEV_HOST environment variable instead of checking TAURI_ENV_PLATFORM. For Xcode-connected iOS devices, run 'tauri ios dev --force-ip-prompt' to select the iOS device's TUN address (ending with ::2).

Vite config migration from Tauri 2.0 beta to 2.0 release

In Tauri 2.0 beta, Vite configuration checked TAURI_ENV_PLATFORM for 'android|ios' and set host to '0.0.0.0' for mobile builds. In Tauri 2.0 release, use process.env.TAURI_DEV_HOST instead: set host to 'host || false' and hmr to a config object with protocol 'ws', host from TAURI_DEV_HOST, and port 1430 when host is defined. The npm package 'internal-ip' is no longer needed.

Tauri v2 migrate command automates beta to RC migration

Tauri v2 CLI includes a migrate command that automates most of the migration work when upgrading from Tauri 2.0 beta to Tauri 2.0 release candidate. Run commands like 'npm run tauri migrate' or 'yarn tauri migrate' or 'pnpm tauri migrate' or 'cargo tauri migrate' depending on your package manager.

Dependency updates in Tauri 1.1.0

Tauri 1.1.0 updates windows to 0.39.0, webview2-com to 0.19.1, and raw-window-handle to 0.5.0. Plugins such as window-vibrancy and window-shadows must also be updated to the latest versions.

Tauri 1.4.0 dependency updates

To upgrade to Tauri 1.4.0, update both NPM and Cargo dependencies. NPM packages @tauri-apps/cli and @tauri-apps/api should be updated to the latest version, and cargo update should be run.

Give your agent this brain