switch to launch builder instead of macro for fullstack

This commit is contained in:
Evan Almloff committed 2023-07-28 12:58:34 -07:00
1 parent cfd62e274e
commit 9f891f9478
13 files changed
+259 -193

No files matched your search

@@ -7,14 +7,10 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dioxus-web = { workspace = true, features = ["hydrate"], optional = true }
dioxus = { workspace = true }
dioxus-fullstack = { workspace = true }
axum = { version = "0.6.12", optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
serde = "1.0.159"
execute = "0.2.12"
tower-http = { version = "0.4.1", features = ["auth"] }
simple_logger = "4.2.0"
wasm-logger = "0.2.0"
log.workspace = true
@@ -22,5 +18,5 @@ reqwest = "0.11.18"
[features]
default = []
ssr = ["axum", "tokio", "dioxus-fullstack/axum"]
web = ["dioxus-web"]
ssr = ["axum", "dioxus-fullstack/axum"]
web = ["dioxus-fullstack/web"]
@@ -7,8 +7,12 @@
#![allow(non_snake_case, unused)]
use dioxus::prelude::*;
use dioxus_fullstack::{launch, prelude::*};
use dioxus_fullstack::{
launch::{self, LaunchBuilder},
prelude::*,
};
use serde::{Deserialize, Serialize};
use wasm_logger::Config;
#[derive(Props, PartialEq, Debug, Default, Serialize, Deserialize, Clone)]
struct AppProps {
@@ -66,7 +70,5 @@ fn main() {
#[cfg(feature = "ssr")]
simple_logger::SimpleLogger::new().init().unwrap();
launch!(@([127, 0, 0, 1], 8080), app, {
serve_cfg: ServeConfigBuilder::new(app, AppProps { count: 0 }),
});
LaunchBuilder::new_with_props(app, AppProps { count: 0 }).launch()
}