From 6a51f8998d8c012454122e4b7afbb84d2238d1f3 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Sat, 1 Apr 2023 17:05:44 -0500 Subject: [PATCH] simplify server package features --- packages/server/Cargo.toml | 6 +++--- packages/server/examples/axum-hello-world/Cargo.toml | 3 ++- packages/server/examples/axum-hello-world/src/main.rs | 2 +- packages/server/examples/axum-router/Cargo.toml | 3 ++- packages/server/examples/axum-router/src/main.rs | 2 +- packages/server/examples/salvo-hello-world/Cargo.toml | 3 ++- packages/server/examples/salvo-hello-world/src/main.rs | 2 +- packages/server/examples/warp-hello-world/Cargo.toml | 3 ++- packages/server/examples/warp-hello-world/src/main.rs | 2 +- 9 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/server/Cargo.toml b/packages/server/Cargo.toml index 2485a2529..5828875be 100644 --- a/packages/server/Cargo.toml +++ b/packages/server/Cargo.toml @@ -35,7 +35,7 @@ anymap = "0.12.1" [features] default = [] -warp = ["dep:warp", "http-body"] -axum = ["dep:axum", "tower-http", "hyper"] -salvo = ["dep:salvo", "hyper"] +warp = ["dep:warp", "http-body", "ssr"] +axum = ["dep:axum", "tower-http", "hyper", "ssr"] +salvo = ["dep:salvo", "hyper", "ssr"] ssr = ["server_fn/ssr", "tokio", "dioxus-ssr"] diff --git a/packages/server/examples/axum-hello-world/Cargo.toml b/packages/server/examples/axum-hello-world/Cargo.toml index 68da7a0be..ed466e6e1 100644 --- a/packages/server/examples/axum-hello-world/Cargo.toml +++ b/packages/server/examples/axum-hello-world/Cargo.toml @@ -15,5 +15,6 @@ tokio = { version = "1.27.0", features = ["full"], optional = true } serde = "1.0.159" [features] -ssr = ["axum", "tokio", "dioxus-server/ssr", "dioxus-server/axum"] +default = ["web"] +ssr = ["axum", "tokio", "dioxus-server/axum"] web = ["dioxus-web", "dioxus-router/web"] diff --git a/packages/server/examples/axum-hello-world/src/main.rs b/packages/server/examples/axum-hello-world/src/main.rs index fc07c6fbb..899247af5 100644 --- a/packages/server/examples/axum-hello-world/src/main.rs +++ b/packages/server/examples/axum-hello-world/src/main.rs @@ -2,7 +2,7 @@ //! //! ```sh //! dioxus build --features web -//! cargo run --features ssr +//! cargo run --features ssr --no-default-features //! ``` #![allow(non_snake_case)] diff --git a/packages/server/examples/axum-router/Cargo.toml b/packages/server/examples/axum-router/Cargo.toml index d1d8ff81d..297aa6726 100644 --- a/packages/server/examples/axum-router/Cargo.toml +++ b/packages/server/examples/axum-router/Cargo.toml @@ -17,5 +17,6 @@ tower-http = { version = "0.4.0", features = ["fs"], optional = true } http = { version = "0.2.9", optional = true } [features] -ssr = ["axum", "tokio", "dioxus-server/ssr", "dioxus-server/axum", "tower-http", "http"] +default = ["web"] +ssr = ["axum", "tokio", "dioxus-server/axum", "tower-http", "http"] web = ["dioxus-web", "dioxus-router/web"] diff --git a/packages/server/examples/axum-router/src/main.rs b/packages/server/examples/axum-router/src/main.rs index 53193859c..2afa4a481 100644 --- a/packages/server/examples/axum-router/src/main.rs +++ b/packages/server/examples/axum-router/src/main.rs @@ -2,7 +2,7 @@ //! //! ```sh //! dioxus build --features web -//! cargo run --features ssr +//! cargo run --features ssr --no-default-features //! ``` #![allow(non_snake_case)] diff --git a/packages/server/examples/salvo-hello-world/Cargo.toml b/packages/server/examples/salvo-hello-world/Cargo.toml index 9c81ee2a2..4633eaafc 100644 --- a/packages/server/examples/salvo-hello-world/Cargo.toml +++ b/packages/server/examples/salvo-hello-world/Cargo.toml @@ -14,5 +14,6 @@ serde = "1.0.159" salvo = { version = "0.37.9", optional = true } [features] -ssr = ["salvo", "tokio", "dioxus-server/ssr", "dioxus-server/salvo"] +default = ["web"] +ssr = ["salvo", "tokio", "dioxus-server/salvo"] web = ["dioxus-web"] diff --git a/packages/server/examples/salvo-hello-world/src/main.rs b/packages/server/examples/salvo-hello-world/src/main.rs index f13668c5e..d1e654fee 100644 --- a/packages/server/examples/salvo-hello-world/src/main.rs +++ b/packages/server/examples/salvo-hello-world/src/main.rs @@ -2,7 +2,7 @@ //! //! ```sh //! dioxus build --features web -//! cargo run --features ssr +//! cargo run --features ssr --no-default-features //! ``` #![allow(non_snake_case)] diff --git a/packages/server/examples/warp-hello-world/Cargo.toml b/packages/server/examples/warp-hello-world/Cargo.toml index 7bb9aa23f..86ac2da5b 100644 --- a/packages/server/examples/warp-hello-world/Cargo.toml +++ b/packages/server/examples/warp-hello-world/Cargo.toml @@ -14,5 +14,6 @@ serde = "1.0.159" warp = { version = "0.3.3", optional = true } [features] -ssr = ["warp", "tokio", "dioxus-server/ssr", "dioxus-server/warp"] +default = ["web"] +ssr = ["warp", "tokio", "dioxus-server/warp"] web = ["dioxus-web"] diff --git a/packages/server/examples/warp-hello-world/src/main.rs b/packages/server/examples/warp-hello-world/src/main.rs index 87f91782a..51a627d16 100644 --- a/packages/server/examples/warp-hello-world/src/main.rs +++ b/packages/server/examples/warp-hello-world/src/main.rs @@ -2,7 +2,7 @@ //! //! ```sh //! dioxus build --features web -//! cargo run --features ssr +//! cargo run --features ssr --no-default-features //! ``` #![allow(non_snake_case)]