diff --git a/Cargo.lock b/Cargo.lock index 8a529d68..da69dd56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4128,9 +4128,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "swift-rs" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eab55f44d02ced20ffa22fd5b4bd083ab59c940c7637d37fec4426b1a01d769" +checksum = "8fa67d647176dfa7bdc5775430a1cb339e0ea48fe24707424023a4b17eb9688e" dependencies = [ "base64 0.21.0", "serde", @@ -4246,9 +4246,9 @@ dependencies = [ [[package]] name = "tauri" -version = "2.0.0-alpha.4" +version = "2.0.0-alpha.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113835bb47f8cab6d1fb3b1a2e3d96ddd64730248638a5ab3f46a598c02a81c" +checksum = "f25eefe4ca0a396a73fd0309f778eeb22a19953a3169bf316b893abadc2118fb" dependencies = [ "anyhow", "bytes 1.4.0", @@ -4298,9 +4298,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-alpha.2" +version = "2.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383f94e1b46fb4e249e4eafbd0589ffbe02b241b49dadebd47640598a17e584e" +checksum = "c492211c72b95f8866e5c1fbc0a915080a5ebb9f03f9b250a1c936534b680a76" dependencies = [ "anyhow", "cargo_toml", @@ -4318,9 +4318,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.2" +version = "2.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5914e68c4ba4d9b761373dcce86f6721de78c2ffd84f376b1e0fee9321c0fc7e" +checksum = "818c570932ebc2ff6d498be89d93494b89ff142131937a7e56d7cfb9c8ef0ad0" dependencies = [ "base64 0.21.0", "brotli", @@ -4344,9 +4344,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-alpha.2" +version = "2.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adedb0845af0d5840b54410f83135bb285ab372956678e0b12046a87999486fb" +checksum = "f3b596485d89003d2d7869469b2830e9a846de9ac2eecd69bc7c24890234aefc" dependencies = [ "heck", "proc-macro2", @@ -4568,9 +4568,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.13.0-alpha.2" +version = "0.13.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c9ce3ab30f6a95a09131510a624d5de24455ba9e8fcae6a6fe9e0922f833c8" +checksum = "404367cd32a5a8d33368448aab7da54bb2187b6a632526f1019de3fd13591cc2" dependencies = [ "gtk", "http", @@ -4590,9 +4590,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.13.0-alpha.2" +version = "0.13.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e176af0987e4ced285bec0faf56eed0f13a1b3851d9176fa6758181f867cdc3" +checksum = "203764d673b440877dea87b972772be4091ee0ab25141748008646ca774a20dc" dependencies = [ "cocoa", "gtk", @@ -4611,9 +4611,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-alpha.2" +version = "2.0.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a488bb0c60e2ce9efbe8283a11299675e01f55caf12304889f8639b3c35713c" +checksum = "49fa79bc56f04ece491268a64273de945f65627bcda30d9e8ecc8708b89bca26" dependencies = [ "brotli", "ctor", @@ -5666,9 +5666,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.27.0" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26712b3ea99abb29c3b0067b284515e2ccdf5d6df7ac5e21129d71550eb9c3e6" +checksum = "e8cf0dbfa7ccbd2e3832a3098b19d4b552360ea00a40b244a99caef46bffd84f" dependencies = [ "base64 0.13.1", "block", @@ -5682,6 +5682,7 @@ dependencies = [ "gtk", "html5ever", "http", + "javascriptcore-rs", "kuchiki", "libc", "log", diff --git a/Cargo.toml b/Cargo.toml index bbc07433..5f7de541 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,8 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-alpha.4" -tauri-build = "2.0.0-alpha.2" +tauri = "2.0.0-alpha.8" +tauri-build = "2.0.0-alpha.4" serde_json = "1" thiserror = "1" diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index f7e5e25b..635206eb 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -327,7 +327,7 @@ impl Builder { LogTarget::LogDir => continue, #[cfg(desktop)] LogTarget::LogDir => { - let path = app_handle.path_resolver().app_log_dir().unwrap(); + let path = app_handle.path().app_log_dir().unwrap(); if !path.exists() { fs::create_dir_all(&path).unwrap(); } diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index e93f5002..c7fbc433 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -40,9 +40,9 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let asset_protocol_scope = app.asset_protocol_scope(); let app = app.clone(); - let app_dir = app.path_resolver().app_data_dir(); + let app_dir = app.path().app_data_dir(); - if let Some(app_dir) = app_dir { + if let Ok(app_dir) = app_dir { let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME); let _ = fs_scope.forbid_file(&scope_state_path); diff --git a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml index 2446653b..40d08d7f 100644 --- a/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml +++ b/plugins/single-instance/examples/vanilla/src-tauri/Cargo.toml @@ -12,11 +12,11 @@ rust-version = "1.57" [dependencies] serde_json = "1.0" serde = { version = "1.0", features = [ "derive" ] } -tauri = { version = "1", features = ["api-all"] } +tauri = { version = "2.0.0-alpha.8", features = ["api-all"] } tauri-plugin-single-instance = { path = "../../../" } [build-dependencies] -tauri-build = { version = "1", features = [] } +tauri-build = { version = "2.0.0-alpha.4", features = [] } [features] default = [ "custom-protocol" ] diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs index 656234b0..de501ea3 100644 --- a/plugins/sql/src/plugin.rs +++ b/plugins/sql/src/plugin.rs @@ -63,10 +63,7 @@ type Result = std::result::Result; /// Resolves the App's **file path** from the `AppHandle` context /// object fn app_path(app: &AppHandle) -> PathBuf { - #[allow(deprecated)] // FIXME: Change to non-deprecated function in Tauri v2 - app.path_resolver() - .app_dir() - .expect("No App path was found!") + app.path().app_config_dir().expect("No App path was found!") } #[cfg(feature = "sqlite")] diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index af106e30..c9746b45 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -10,7 +10,7 @@ use std::{ io::Write, path::PathBuf, }; -use tauri::{AppHandle, Runtime}; +use tauri::{AppHandle, Manager, Runtime}; type SerializeFn = fn(&HashMap) -> Result, Box>; type DeserializeFn = fn(&[u8]) -> Result, Box>; @@ -171,7 +171,7 @@ impl Store { /// Update the store from the on-disk state pub fn load(&mut self, app: &AppHandle) -> Result<(), Error> { let app_dir = app - .path_resolver() + .path() .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); @@ -186,7 +186,7 @@ impl Store { /// Saves the store to disk pub fn save(&self, app: &AppHandle) -> Result<(), Error> { let app_dir = app - .path_resolver() + .path() .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); diff --git a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml index 48960dc1..e1d77550 100644 --- a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml @@ -9,14 +9,14 @@ edition = "2021" [dependencies] serde = { version = "1", features = ["derive"] } serde_json = "1" -tauri = { version = "1", features = [] } +tauri = { version = "2.0.0-alpha.8", features = [] } tokio = { version = "1.11", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } tokio-tungstenite = "0.15" [build-dependencies] -tauri-build = { version = "1", features = [] } +tauri-build = { version = "2.0.0-alpha.4", features = [] } [features] default = [ "custom-protocol" ] diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 5a224ad3..b7f34cb1 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -69,7 +69,7 @@ pub trait AppHandleExt { impl AppHandleExt for tauri::AppHandle { fn save_window_state(&self, flags: StateFlags) -> Result<()> { - if let Some(app_dir) = self.path_resolver().app_config_dir() { + if let Ok(app_dir) = self.path().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); let cache = self.state::(); let mut state = cache.0.lock().unwrap(); @@ -270,8 +270,8 @@ impl Builder { let flags = self.state_flags; PluginBuilder::new("window-state") .setup(|app, _api| { - let cache: Arc>> = if let Some(app_dir) = - app.path_resolver().app_config_dir() + let cache: Arc>> = if let Ok(app_dir) = + app.path().app_config_dir() { let state_path = app_dir.join(STATE_FILENAME); if state_path.exists() {