Fix compile checks on numerous packages using --all --all-features
This commit is contained in:
38 files changed
+147
-186
No files matched your search
@@ -58,17 +58,16 @@ async-trait = "0.1.71"
|
||||
bytes = "1.4.0"
|
||||
tower = { version = "0.4.13", features = ["util"], optional = true }
|
||||
tower-layer = { version = "0.3.2", optional = true }
|
||||
web-sys = { version = "0.3.61", optional = true, features = ["Window", "Document", "Element", "HtmlDocument", "Storage", "console"] }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
dioxus-hot-reload = { workspace = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
web-sys = { version = "0.3.61", features = ["Window", "Document", "Element", "HtmlDocument", "Storage", "console"] }
|
||||
|
||||
[features]
|
||||
default = ["hot-reload"]
|
||||
hot-reload = ["serde_json", "futures-util"]
|
||||
web = ["dioxus-web"]
|
||||
web = ["dioxus-web", "web-sys"]
|
||||
desktop = ["dioxus-desktop"]
|
||||
warp = ["dep:warp", "ssr"]
|
||||
axum = ["dep:axum", "tower-http", "ssr"]
|
||||
|
||||
@@ -11,7 +11,7 @@ dioxus = { workspace = true, features = ["fullstack"]}
|
||||
serde = "1.0.159"
|
||||
simple_logger = "4.2.0"
|
||||
tracing-wasm = "0.2.1"
|
||||
tracing.workspace = true
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = "0.3.17"
|
||||
reqwest = "0.11.18"
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ execute = "0.2.12"
|
||||
reqwest = "0.11.18"
|
||||
simple_logger = "4.2.0"
|
||||
tracing-wasm = "0.2.1"
|
||||
tracing.workspace = true
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = "0.3.17"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -10,7 +10,7 @@ publish = false
|
||||
dioxus = { workspace = true, features = ["fullstack"] }
|
||||
serde = "1.0.159"
|
||||
tracing-wasm = "0.2.1"
|
||||
tracing.workspace = true
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = "0.3.17"
|
||||
reqwest = "0.11.18"
|
||||
|
||||
|
||||
@@ -7,15 +7,19 @@ use std::sync::Arc;
|
||||
/// Settings for a fullstack app.
|
||||
pub struct Config {
|
||||
#[cfg(feature = "ssr")]
|
||||
server_fn_route: &'static str,
|
||||
pub(crate) server_fn_route: &'static str,
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
server_cfg: ServeConfigBuilder,
|
||||
pub(crate) server_cfg: ServeConfigBuilder,
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
addr: std::net::SocketAddr,
|
||||
pub(crate) addr: std::net::SocketAddr,
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
web_cfg: dioxus_web::Config,
|
||||
pub(crate) web_cfg: dioxus_web::Config,
|
||||
|
||||
#[cfg(feature = "desktop")]
|
||||
desktop_cfg: dioxus_desktop::Config,
|
||||
pub(crate) desktop_cfg: dioxus_desktop::Config,
|
||||
}
|
||||
|
||||
#[allow(clippy::derivable_impls)]
|
||||
@@ -88,44 +92,6 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
/// Launch the app.
|
||||
pub fn launch(self, build_virtual_dom: impl Fn() -> VirtualDom + Send + Sync + 'static) {
|
||||
#[cfg(feature = "ssr")]
|
||||
tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
.block_on(async move {
|
||||
self.launch_server(build_virtual_dom).await;
|
||||
});
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
{
|
||||
#[cfg(feature = "web")]
|
||||
self.launch_web(build_virtual_dom);
|
||||
#[cfg(feature = "desktop")]
|
||||
self.launch_desktop(build_virtual_dom);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
/// Launch the web application
|
||||
pub fn launch_web(self, build_virtual_dom: impl Fn() -> VirtualDom + Send + Sync + 'static) {
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
{
|
||||
let cfg = self.web_cfg.hydrate(true);
|
||||
dioxus_web::launch::launch_virtual_dom(
|
||||
// TODO: this should pull the props from the document
|
||||
build_virtual_dom(),
|
||||
cfg,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "desktop")]
|
||||
/// Launch the web application
|
||||
pub fn launch_desktop<P: AnyProps>(self, build_virtual_dom: impl Fn() -> VirtualDom + 'static) {
|
||||
let cfg = self.desktop_cfg;
|
||||
dioxus_desktop::launch::launch_with_props_blocking(self.component, self.props, cfg);
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
/// Launch a server application
|
||||
pub async fn launch_server(
|
||||
|
||||
@@ -20,17 +20,27 @@ pub fn launch(
|
||||
}
|
||||
vdom
|
||||
};
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
.block_on(async move {
|
||||
platform_config.launch_server(virtual_dom_factory).await;
|
||||
});
|
||||
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
{
|
||||
#[cfg(feature = "web")]
|
||||
platform_config.launch_web(virtual_dom_factory);
|
||||
{
|
||||
// TODO: this should pull the props from the document
|
||||
let cfg = platform_config.web_cfg.hydrate(true);
|
||||
dioxus_web::launch::launch_virtual_dom(virtual_dom_factory(), cfg);
|
||||
}
|
||||
|
||||
#[cfg(feature = "desktop")]
|
||||
platform_config.launch_desktop(virtual_dom_factory);
|
||||
{
|
||||
let cfg = platform_config.desktop_cfg;
|
||||
dioxus_desktop::launch::launch_virtual_dom(virtual_dom_factory(), cfg)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user