From 8cf1cb9d02d1f89ee078835f5dab18b600c9129a Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 11 Mar 2026 11:36:00 -0300 Subject: [PATCH] update tauri to cef/wry feature flag removal --- Cargo.lock | 65 +++++++++++-------- Cargo.toml | 9 ++- examples/api/src-tauri/Cargo.toml | 10 ++- examples/api/src-tauri/src/lib.rs | 11 +++- plugins/barcode-scanner/Cargo.toml | 2 +- plugins/clipboard-manager/Cargo.toml | 2 +- .../examples/app/src-tauri/Cargo.toml | 7 +- .../examples/app/src-tauri/src/lib.rs | 7 +- plugins/dialog/Cargo.toml | 4 +- plugins/geolocation/Cargo.toml | 2 +- plugins/haptics/Cargo.toml | 2 +- plugins/notification/Cargo.toml | 2 +- plugins/opener/Cargo.toml | 2 +- plugins/shell/Cargo.toml | 2 +- .../examples/vanilla/src-tauri/Cargo.toml | 7 +- .../examples/vanilla/src-tauri/src/main.rs | 7 +- plugins/store/Cargo.toml | 4 +- .../AppSettingsManager/src-tauri/Cargo.toml | 7 +- .../AppSettingsManager/src-tauri/src/main.rs | 7 +- plugins/updater/tests/app-updater/Cargo.toml | 7 +- plugins/updater/tests/app-updater/src/main.rs | 7 +- .../tests/updater-migration/Cargo.toml | 2 +- .../tests/updater-migration/v2-app/Cargo.toml | 9 ++- .../updater-migration/v2-app/src/main.rs | 7 +- .../examples/tauri-app/src-tauri/Cargo.toml | 7 +- .../examples/tauri-app/src-tauri/src/main.rs | 7 +- 26 files changed, 146 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2104a2d8..f985a6047 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -235,6 +235,8 @@ dependencies = [ "tauri-plugin-updater", "tauri-plugin-upload", "tauri-plugin-window-state", + "tauri-runtime-cef", + "tauri-runtime-wry", "time", "tiny_http", ] @@ -248,6 +250,8 @@ dependencies = [ "tauri", "tauri-build 2.5.4", "tauri-plugin-updater", + "tauri-runtime-cef", + "tauri-runtime-wry", "time", "tiny_http", ] @@ -261,6 +265,8 @@ dependencies = [ "tauri", "tauri-build 2.5.4", "tauri-plugin-updater", + "tauri-runtime-cef", + "tauri-runtime-wry", "tiny_http", ] @@ -273,6 +279,8 @@ dependencies = [ "tauri", "tauri-build 2.5.4", "tauri-plugin-store", + "tauri-runtime-cef", + "tauri-runtime-wry", ] [[package]] @@ -1495,6 +1503,8 @@ dependencies = [ "tauri-plugin-deep-link", "tauri-plugin-log", "tauri-plugin-single-instance", + "tauri-runtime-cef", + "tauri-runtime-wry", ] [[package]] @@ -1715,9 +1725,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "download-cef" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6002a6b95f9f3bbe5693ac02a03221a8e3af6c9f5f4539f5734a8d6cde1a3616" +checksum = "d7471a7d5d3bd8df1b3b75871f0317d8a6dd73270ab861cc97ae7907ee63e554" dependencies = [ "bzip2", "clap", @@ -6045,6 +6055,8 @@ dependencies = [ "tauri-build 2.5.4", "tauri-plugin-cli", "tauri-plugin-single-instance", + "tauri-runtime-cef", + "tauri-runtime-wry", ] [[package]] @@ -6680,8 +6692,8 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.10.2" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.10.3" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "anyhow", "bytes", @@ -6716,19 +6728,15 @@ dependencies = [ "serialize-to-javascript", "specta", "swift-rs", - "tauri-build 2.5.5", + "tauri-build 2.5.6", "tauri-macros", "tauri-runtime", - "tauri-runtime-cef", - "tauri-runtime-wry", "tauri-utils", "thiserror 2.0.12", "tokio", "tray-icon", "url", "uuid", - "webkit2gtk", - "webview2-com", "window-vibrancy", "windows 0.61.1", ] @@ -6759,8 +6767,8 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.5.5" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.5.6" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "anyhow", "cargo_toml", @@ -6806,8 +6814,8 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.5.4" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.5.5" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "base64 0.22.1", "ico", @@ -6831,21 +6839,21 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.5.4" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.5.5" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.100", - "tauri-codegen 2.5.4", + "tauri-codegen 2.5.5", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.5.3" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.5.4" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "anyhow", "glob", @@ -7352,8 +7360,8 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.10.0" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.10.1" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "cookie", "dpi", @@ -7374,7 +7382,7 @@ dependencies = [ [[package]] name = "tauri-runtime-cef" version = "0.1.0" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "base64 0.22.1", "cef", @@ -7392,6 +7400,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "tauri", "tauri-runtime", "tauri-utils", "url", @@ -7401,8 +7410,8 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.10.0" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.10.1" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "gtk", "http", @@ -7410,13 +7419,15 @@ dependencies = [ "log", "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.0", "objc2-web-kit", "once_cell", "percent-encoding", "raw-window-handle", + "serde", + "serde_json", "softbuffer", "tao", + "tauri", "tauri-runtime", "tauri-utils", "url", @@ -7428,8 +7439,8 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.8.2" -source = "git+https://github.com/tauri-apps/tauri.git?branch=feat/cef#a4ea9711569e1143896d32cf53e99fc9742a95ab" +version = "2.8.3" +source = "git+https://github.com/tauri-apps/tauri.git?branch=refactor/runtime-feature-flag#4fce1df9269a8b4ae1a88d133c1c4e6584da2eff" dependencies = [ "aes-gcm", "anyhow", @@ -8605,6 +8616,8 @@ dependencies = [ "tauri", "tauri-build 2.5.4", "tauri-plugin-websocket", + "tauri-runtime-cef", + "tauri-runtime-wry", "tokio", "tokio-tungstenite", ] diff --git a/Cargo.toml b/Cargo.toml index 8e722e6ab..5918e977e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,8 @@ serde = { version = "1", features = ["derive"] } tracing = "0.1" log = "0.4" tauri = { version = "2.10", default-features = false } +tauri-runtime-wry = "2" +tauri-runtime-cef = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" } tauri-build = "2.5" tauri-plugin = "2.5" tauri-utils = "2.8" @@ -41,6 +43,7 @@ incremental = false opt-level = "s" [patch.crates-io] -tauri = { git = "https://github.com/tauri-apps/tauri.git", branch = "feat/cef" } -tauri-utils = { git = "https://github.com/tauri-apps/tauri.git", branch = "feat/cef" } -tauri-plugin = { git = "https://github.com/tauri-apps/tauri.git", branch = "feat/cef" } +tauri = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" } +tauri-utils = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" } +tauri-plugin = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" } +tauri-runtime-wry = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" } diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index afbb0c459..335b1054b 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -39,13 +39,14 @@ tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.3" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.5" } tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.2" } tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" } +tauri-runtime-wry = { workspace = true, optional = true, features = [ + "macos-private-api", +] } +tauri-runtime-cef = { workspace = true, optional = true } [dependencies.tauri] workspace = true features = [ - "wry", - "common-controls-v6", - "x11", "image-ico", "image-png", "isolation", @@ -68,4 +69,7 @@ tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = " tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" } [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] prod = ["tauri/custom-protocol"] diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 3c58f2c81..d46fe07f7 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -6,6 +6,11 @@ mod cmd; #[cfg(desktop)] mod tray; +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use serde::Serialize; use tauri::{ webview::{PageLoadEvent, WebviewWindowBuilder}, @@ -17,13 +22,13 @@ struct Reply { data: String, } -pub type SetupHook = Box Result<(), Box> + Send>; -pub type OnEvent = Box; +pub type SetupHook = Box) -> Result<(), Box> + Send>; +pub type OnEvent = Box, RunEvent)>; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { #[allow(unused_mut)] - let mut builder = tauri::Builder::default() + let mut builder = tauri::Builder::::new() .plugin( tauri_plugin_log::Builder::default() .level(log::LevelFilter::Info) diff --git a/plugins/barcode-scanner/Cargo.toml b/plugins/barcode-scanner/Cargo.toml index d7654dcf7..ab6f32555 100644 --- a/plugins/barcode-scanner/Cargo.toml +++ b/plugins/barcode-scanner/Cargo.toml @@ -31,4 +31,4 @@ log = { workspace = true } thiserror = { workspace = true } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } diff --git a/plugins/clipboard-manager/Cargo.toml b/plugins/clipboard-manager/Cargo.toml index d95c02c28..88aeea389 100644 --- a/plugins/clipboard-manager/Cargo.toml +++ b/plugins/clipboard-manager/Cargo.toml @@ -32,7 +32,7 @@ log = { workspace = true } thiserror = { workspace = true } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] arboard = { version = "3", features = ["wayland-data-control"] } diff --git a/plugins/deep-link/examples/app/src-tauri/Cargo.toml b/plugins/deep-link/examples/app/src-tauri/Cargo.toml index 130a7fef2..9aa08c5cc 100644 --- a/plugins/deep-link/examples/app/src-tauri/Cargo.toml +++ b/plugins/deep-link/examples/app/src-tauri/Cargo.toml @@ -19,7 +19,9 @@ tauri-build = { workspace = true } [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } tauri-plugin-deep-link = { path = "../../../" } tauri-plugin-log = { path = "../../../../log" } tauri-plugin-single-instance = { path = "../../../../single-instance", features = [ @@ -28,6 +30,9 @@ tauri-plugin-single-instance = { path = "../../../../single-instance", features log = "0.4" [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] # this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled. # If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes. # DO NOT REMOVE!! diff --git a/plugins/deep-link/examples/app/src-tauri/src/lib.rs b/plugins/deep-link/examples/app/src-tauri/src/lib.rs index f85527d91..d6157fdf5 100644 --- a/plugins/deep-link/examples/app/src-tauri/src/lib.rs +++ b/plugins/deep-link/examples/app/src-tauri/src/lib.rs @@ -2,6 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use tauri_plugin_deep_link::DeepLinkExt; // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command @@ -13,7 +18,7 @@ fn greet(name: &str) -> String { #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { #[allow(unused_mut)] - let mut builder = tauri::Builder::default(); + let mut builder = tauri::Builder::::new(); #[cfg(desktop)] { diff --git a/plugins/dialog/Cargo.toml b/plugins/dialog/Cargo.toml index 6764f4eee..1af91a91b 100644 --- a/plugins/dialog/Cargo.toml +++ b/plugins/dialog/Cargo.toml @@ -28,7 +28,7 @@ ios = { level = "partial", notes = "Does not support folder picker" } tauri-plugin = { workspace = true, features = ["build"] } [dev-dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [dependencies] serde = { workspace = true } @@ -40,7 +40,7 @@ url = { workspace = true } tauri-plugin-fs = { path = "../fs", version = "2.4.5" } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] rfd = { version = "0.16", default-features = false, features = [ diff --git a/plugins/geolocation/Cargo.toml b/plugins/geolocation/Cargo.toml index 765b0e92b..f8ddd7cd9 100644 --- a/plugins/geolocation/Cargo.toml +++ b/plugins/geolocation/Cargo.toml @@ -30,7 +30,7 @@ thiserror = { workspace = true } specta = { workspace = true, optional = true } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [features] specta = ["dep:specta", "tauri/specta"] diff --git a/plugins/haptics/Cargo.toml b/plugins/haptics/Cargo.toml index dc0dddbc7..ad444dab6 100644 --- a/plugins/haptics/Cargo.toml +++ b/plugins/haptics/Cargo.toml @@ -30,7 +30,7 @@ thiserror = { workspace = true } specta = { workspace = true, optional = true } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [features] specta = ["dep:specta", "tauri/specta"] diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index f70033831..649024dc3 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -34,7 +34,7 @@ url = { version = "2", features = ["serde"] } serde_repr = "0.1" [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [target."cfg(windows)".dependencies] win7-notifications = { version = "0.4.5", optional = true } diff --git a/plugins/opener/Cargo.toml b/plugins/opener/Cargo.toml index 09ed3457c..d655a15c1 100644 --- a/plugins/opener/Cargo.toml +++ b/plugins/opener/Cargo.toml @@ -58,4 +58,4 @@ default-features = false features = ["std", "NSURL", "NSArray", "NSString"] [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } diff --git a/plugins/shell/Cargo.toml b/plugins/shell/Cargo.toml index fbbd51f42..550625722 100644 --- a/plugins/shell/Cargo.toml +++ b/plugins/shell/Cargo.toml @@ -35,4 +35,4 @@ encoding_rs = "0.8" os_pipe = "1" [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } diff --git a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml index dd9c8d8aa..6377f3d93 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml +++ b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml @@ -10,7 +10,9 @@ rust-version = "1.77.2" [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } tauri-plugin-single-instance = { path = "../../../" } tauri-plugin-cli = { path = "../../../../cli" } @@ -18,4 +20,7 @@ tauri-plugin-cli = { path = "../../../../cli" } tauri-build = { workspace = true } [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] prod = ["tauri/custom-protocol"] diff --git a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs index 835857c99..1392d144c 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs +++ b/plugins/single-instance/examples/vanilla/src-tauri/src/main.rs @@ -7,8 +7,13 @@ windows_subsystem = "windows" )] +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + fn main() { - tauri::Builder::default() + tauri::Builder::::new() .plugin( tauri_plugin_single_instance::Builder::new() .callback(move |app, argv, cwd| { diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index ed2002ce8..d9190fb1a 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -29,7 +29,7 @@ dunce = { workspace = true } tokio = { version = "1", features = ["sync", "time", "macros"] } [target.'cfg(target_os = "ios")'.dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } [dev-dependencies] -tauri = { workspace = true, features = ["wry"] } +tauri = { workspace = true } diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml b/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml index 9a30f0b16..90d49b10f 100644 --- a/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml +++ b/plugins/store/examples/AppSettingsManager/src-tauri/Cargo.toml @@ -13,12 +13,17 @@ edition = "2021" tauri-build = { workspace = true } [dependencies] -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true } tauri-plugin-store = { path = "../../../" } [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] # this feature is used for production builds or when `devPath` points to the filesystem # DO NOT REMOVE!! prod = ["tauri/custom-protocol"] diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs index a23585bac..22e3c0867 100644 --- a/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs +++ b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs @@ -5,6 +5,11 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use serde_json::json; use tauri::Listener; use tauri_plugin_store::StoreExt; @@ -13,7 +18,7 @@ mod app; use app::settings::AppSettings; fn main() { - tauri::Builder::default() + tauri::Builder::::new() .plugin(tauri_plugin_store::Builder::new().build()) .setup(|app| { // Init store and load it from disk diff --git a/plugins/updater/tests/app-updater/Cargo.toml b/plugins/updater/tests/app-updater/Cargo.toml index 57072824e..c2f8cdef6 100644 --- a/plugins/updater/tests/app-updater/Cargo.toml +++ b/plugins/updater/tests/app-updater/Cargo.toml @@ -7,7 +7,9 @@ edition = { workspace = true } tauri-build = { workspace = true } [dependencies] -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true } tauri-plugin-updater = { path = "../.." } @@ -15,4 +17,7 @@ tiny_http = "0.12" time = { version = "0.3", features = ["formatting"] } [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] prod = ["tauri/custom-protocol"] diff --git a/plugins/updater/tests/app-updater/src/main.rs b/plugins/updater/tests/app-updater/src/main.rs index bbe398b59..31cc10b4f 100644 --- a/plugins/updater/tests/app-updater/src/main.rs +++ b/plugins/updater/tests/app-updater/src/main.rs @@ -4,13 +4,18 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use tauri_plugin_updater::UpdaterExt; fn main() { #[allow(unused_mut)] let mut context = tauri::generate_context!(); - tauri::Builder::default() + tauri::Builder::::new() .plugin(tauri_plugin_updater::Builder::new().build()) .setup(|app| { let handle = app.handle().clone(); diff --git a/plugins/updater/tests/updater-migration/Cargo.toml b/plugins/updater/tests/updater-migration/Cargo.toml index 680b4e92c..74aba0603 100644 --- a/plugins/updater/tests/updater-migration/Cargo.toml +++ b/plugins/updater/tests/updater-migration/Cargo.toml @@ -7,7 +7,7 @@ edition = { workspace = true } tauri-build = { workspace = true } [dependencies] -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } tauri-plugin-updater = { path = "../.." } diff --git a/plugins/updater/tests/updater-migration/v2-app/Cargo.toml b/plugins/updater/tests/updater-migration/v2-app/Cargo.toml index 69d60c4f1..9d50b2518 100644 --- a/plugins/updater/tests/updater-migration/v2-app/Cargo.toml +++ b/plugins/updater/tests/updater-migration/v2-app/Cargo.toml @@ -7,8 +7,15 @@ edition = { workspace = true } tauri-build = { workspace = true } [dependencies] -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true } tauri-plugin-updater = { path = "../../.." } tiny_http = "0.12" + +[features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] diff --git a/plugins/updater/tests/updater-migration/v2-app/src/main.rs b/plugins/updater/tests/updater-migration/v2-app/src/main.rs index b2bbe04be..690f8c896 100644 --- a/plugins/updater/tests/updater-migration/v2-app/src/main.rs +++ b/plugins/updater/tests/updater-migration/v2-app/src/main.rs @@ -4,13 +4,18 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use tauri_plugin_updater::UpdaterExt; fn main() { #[allow(unused_mut)] let mut context = tauri::generate_context!(); - tauri::Builder::default() + tauri::Builder::::new() .plugin(tauri_plugin_updater::Builder::new().build()) .setup(|app| { println!("version={}", app.package_info().version); diff --git a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml index 9633b3ec8..4f849a5e0 100644 --- a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml @@ -7,7 +7,9 @@ edition = "2021" [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } +tauri = { workspace = true } +tauri-runtime-wry = { workspace = true, optional = true } +tauri-runtime-cef = { workspace = true, optional = true } tokio = { version = "1", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } @@ -17,4 +19,7 @@ tokio-tungstenite = "0.28" tauri-build = { workspace = true } [features] +default = ["wry"] +wry = ["dep:tauri-runtime-wry"] +cef = ["dep:tauri-runtime-cef"] prod = ["tauri/custom-protocol"] diff --git a/plugins/websocket/examples/tauri-app/src-tauri/src/main.rs b/plugins/websocket/examples/tauri-app/src-tauri/src/main.rs index 8858da82e..d6ef4abac 100644 --- a/plugins/websocket/examples/tauri-app/src-tauri/src/main.rs +++ b/plugins/websocket/examples/tauri-app/src-tauri/src/main.rs @@ -7,6 +7,11 @@ windows_subsystem = "windows" )] +#[cfg(feature = "cef")] +type TauriRuntime = tauri_runtime_cef::CefRuntime; +#[cfg(feature = "wry")] +type TauriRuntime = tauri_runtime_wry::Wry; + use futures_util::StreamExt; use tokio::net::{TcpListener, TcpStream}; @@ -35,7 +40,7 @@ async fn accept_connection(stream: TcpStream) { fn main() { tauri::async_runtime::spawn(start_server()); - tauri::Builder::default() + tauri::Builder::::new() .plugin(tauri_plugin_websocket::init()) .run(tauri::generate_context!()) .expect("error while running tauri application");