浏览代码

simplify server package features

Evan Almloff 2 年之前
父节点
当前提交
6a51f8998d

+ 3 - 3
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"]

+ 2 - 1
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"]

+ 1 - 1
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)]

+ 2 - 1
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"]

+ 1 - 1
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)]

+ 2 - 1
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"]

+ 1 - 1
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)]

+ 2 - 1
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"]

+ 1 - 1
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)]