From 0c6750d1771704f7797c0c61e05c6d3d5612696d Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 13 Jan 2023 17:50:32 -0600 Subject: [PATCH] fix dependancies --- packages/desktop/Cargo.toml | 5 ++--- packages/liveview/Cargo.toml | 4 ++-- packages/tui/Cargo.toml | 7 ++----- packages/tui/src/lib.rs | 8 ++++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index bb53eec4d..7a59790ba 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["dom", "ui", "gui", "react"] dioxus-core = { path = "../core", version = "^0.3.0", features = ["serialize"] } dioxus-html = { path = "../html", features = ["serialize"], version = "^0.3.0" } dioxus-interpreter-js = { path = "../interpreter", version = "^0.3.0" } -dioxus-hot-reload = { path = "../hot-reload" } +dioxus-hot-reload = { path = "../hot-reload", optional = true } serde = "1.0.136" serde_json = "1.0.79" @@ -34,7 +34,6 @@ webbrowser = "0.8.0" infer = "0.11.0" dunce = "1.0.2" -interprocess = { version = "1.2.1", optional = true } futures-util = "0.3.25" [target.'cfg(target_os = "ios")'.dependencies] @@ -50,7 +49,7 @@ tokio_runtime = ["tokio"] fullscreen = ["wry/fullscreen"] transparent = ["wry/transparent"] tray = ["wry/tray"] -hot-reload = ["interprocess"] +hot-reload = ["dioxus-hot-reload"] [dev-dependencies] dioxus-core-macro = { path = "../core-macro" } diff --git a/packages/liveview/Cargo.toml b/packages/liveview/Cargo.toml index f5cd988b3..fa097be5a 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -26,7 +26,7 @@ serde_json = "1.0.91" dioxus-html = { path = "../html", features = ["serialize"], version = "^0.3.0" } dioxus-core = { path = "../core", features = ["serialize"], version = "^0.3.0" } dioxus-interpreter-js = { path = "../interpreter", version = "0.3.0" } -dioxus-hot-reload = { path = "../hot-reload" } +dioxus-hot-reload = { path = "../hot-reload", optional = true } # warp warp = { version = "0.3.3", optional = true } @@ -54,7 +54,7 @@ tower = "0.4.13" [features] default = ["hot-reload"] # actix = ["actix-files", "actix-web", "actix-ws"] -hot-reload = ["interprocess"] +hot-reload = ["dioxus-hot-reload"] [[example]] name = "axum" diff --git a/packages/tui/Cargo.toml b/packages/tui/Cargo.toml index d6c96cfd3..bbf939d1a 100644 --- a/packages/tui/Cargo.toml +++ b/packages/tui/Cargo.toml @@ -18,7 +18,7 @@ dioxus-core = { path = "../core", version = "^0.3.0", features = ["serialize"] } dioxus-html = { path = "../html", version = "^0.3.0" } dioxus-native-core = { path = "../native-core", version = "^0.2.0" } dioxus-native-core-macro = { path = "../native-core-macro", version = "^0.2.0" } -dioxus-hot-reload = { path = "../hot-reload" } +dioxus-hot-reload = { path = "../hot-reload", optional = true } tui = "0.17.0" crossterm = "0.23.0" @@ -30,9 +30,6 @@ smallvec = "1.6" rustc-hash = "1.1.0" anymap = "1.0.0-beta.2" futures-channel = "0.3.25" -interprocess = { version = "1.2.1", optional = true } -serde = { version = "1.0.136", optional = true } -serde_json = { version = "1.0.79", optional = true } [dev-dependencies] dioxus = { path = "../dioxus" } @@ -45,4 +42,4 @@ harness = false [features] default = ["hot-reload"] -hot-reload = ["interprocess", "serde", "serde_json"] +hot-reload = ["dioxus-hot-reload"] diff --git a/packages/tui/src/lib.rs b/packages/tui/src/lib.rs index 6961aa6d6..c7f1dcc79 100644 --- a/packages/tui/src/lib.rs +++ b/packages/tui/src/lib.rs @@ -6,7 +6,6 @@ use crossterm::{ terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; use dioxus_core::*; -use dioxus_hot_reload::HotReloadMsg; use dioxus_native_core::{real_dom::RealDom, FxDashSet, NodeId, NodeMask, SendAnyMap}; use focus::FocusState; use futures::{ @@ -148,7 +147,8 @@ fn render_vdom( .block_on(async { #[cfg(all(feature = "hot-reload", debug_assertions))] let mut hot_reload_rx = { - let (hot_reload_tx, hot_reload_rx) = unbounded_channel::(); + let (hot_reload_tx, hot_reload_rx) = + unbounded_channel::(); dioxus_hot_reload::connect(move |msg| { let _ = hot_reload_tx.send(msg); }); @@ -277,10 +277,10 @@ fn render_vdom( // if we have a new template, replace the old one if let Some(msg) = hot_reload_msg { match msg { - HotReloadMsg::UpdateTemplate(template) => { + dioxus_hot_reload::HotReloadMsg::UpdateTemplate(template) => { vdom.replace_template(template); } - HotReloadMsg::Shutdown => { + dioxus_hot_reload::HotReloadMsg::Shutdown => { break; } }