From 84e82fc3e28cc67500bceb729f419a9465ea741e Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 18 Jan 2024 12:41:19 -0800 Subject: [PATCH] Make router configed-by-platform --- Cargo.lock | 1 - Cargo.toml | 1 - examples/simple_desktop.rs | 5 ----- packages/dioxus/Cargo.toml | 8 ++++---- packages/router/Cargo.toml | 4 ++-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80bb34766..c1b664b14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2502,7 +2502,6 @@ dependencies = [ "separator", "serde", "serde_json", - "simple_logger", "thiserror", "tokio", "tracing-subscriber", diff --git a/Cargo.toml b/Cargo.toml index 516c58cd3..cedb3e0e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,7 +145,6 @@ rand = { version = "0.8.4", features = ["small_rng"] } tokio = { version = "1.16.1", features = ["full"] } reqwest = { version = "0.11.9", features = ["json"] } env_logger = "0.10.0" -simple_logger = "4.0.0" thiserror = { workspace = true } tracing-subscriber = "0.3.17" http-range = "0.1.5" diff --git a/examples/simple_desktop.rs b/examples/simple_desktop.rs index aee7763cc..5898957de 100644 --- a/examples/simple_desktop.rs +++ b/examples/simple_desktop.rs @@ -4,11 +4,6 @@ use dioxus::prelude::*; use dioxus_router::prelude::*; fn main() { - simple_logger::SimpleLogger::new() - .with_level(log::LevelFilter::Debug) - .with_module_level("dioxus", log::LevelFilter::Trace) - .init() - .unwrap(); launch_desktop(|| { rsx! { Router:: {} diff --git a/packages/dioxus/Cargo.toml b/packages/dioxus/Cargo.toml index 883110585..98ea47e05 100644 --- a/packages/dioxus/Cargo.toml +++ b/packages/dioxus/Cargo.toml @@ -43,12 +43,12 @@ launch = ["dioxus-config-macro"] router = ["dioxus-router"] # Platforms -fullstack = ["dioxus-fullstack", "dioxus-config-macro/fullstack", "serde"] +fullstack = ["dioxus-fullstack", "dioxus-config-macro/fullstack", "serde", "dioxus-router?/fullstack"] desktop = ["dioxus-desktop", "dioxus-fullstack?/desktop", "dioxus-config-macro/desktop"] mobile = ["dioxus-mobile", "dioxus-fullstack?/desktop", "dioxus-config-macro/desktop"] # todo: use the mobile versions of these -web = ["dioxus-web", "dioxus-fullstack?/web", "dioxus-config-macro/web"] -ssr = ["dioxus-fullstack?/ssr", "dioxus-config-macro/ssr"] -liveview = ["dioxus-desktop", "dioxus-config-macro/liveview"] +web = ["dioxus-web", "dioxus-fullstack?/web", "dioxus-config-macro/web", "dioxus-router?/web"] +ssr = ["dioxus-fullstack?/ssr", "dioxus-config-macro/ssr", "dioxus-router?/ssr"] +liveview = ["dioxus-liveview", "dioxus-config-macro/liveview", "dioxus-router?/liveview"] axum = ["dioxus-fullstack?/axum"] salvo = ["dioxus-fullstack?/salvo"] warp = ["dioxus-fullstack?/warp"] diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 49cef80da..8111954dc 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -28,10 +28,10 @@ dioxus-liveview = { workspace = true, optional = true } dioxus-ssr = { workspace = true, optional = true } dioxus-fullstack = { workspace = true, optional = true } tokio = { workspace = true, features = ["full"], optional = true } -dioxus-cli-config.workspace = true +dioxus-cli-config = { workspace = true } [features] -default = ["web"] +default = [] ssr = ["dioxus-ssr", "tokio"] liveview = ["dioxus-liveview", "tokio", "dep:serde", "serde_json"] wasm_test = []