integrate liveview with the launch builder

This commit is contained in:
Evan Almloff committed 2024-01-22 11:56:34 -06:00
1 parent 50873bf9c7
commit 636aeb4b90
20 files changed
+443 -97

No files matched your search

+5 -5
View File
@@ -16,7 +16,6 @@ dioxus-html = { workspace = true, optional = true }
dioxus-core-macro = { workspace = true, optional = true }
dioxus-config-macro = { workspace = true, optional = true }
dioxus-hooks = { workspace = true, optional = true }
dioxus-rsx = { workspace = true, optional = true }
dioxus-signals = { workspace = true, optional = true }
dioxus-router = { workspace = true, optional = true }
dioxus-web = { workspace = true, optional = true }
@@ -35,7 +34,7 @@ dioxus-hot-reload = { workspace = true, optional = true }
[features]
default = ["macro", "html", "hot-reload", "signals", "hooks", "launch"]
signals = ["dioxus-signals"]
macro = ["dioxus-core-macro", "dioxus-rsx"]
macro = ["dioxus-core-macro"]
html = ["dioxus-html"]
hooks = ["dioxus-hooks"]
hot-reload = ["dioxus-hot-reload"]
@@ -51,9 +50,10 @@ web = ["dioxus-web", "dioxus-fullstack?/web", "dioxus-config-macro/web", "dioxus
server = ["dioxus-fullstack?/ssr", "dioxus-config-macro/ssr", "dioxus-router?/ssr"]
ssr = ["dioxus-ssr"]
liveview = ["dioxus-liveview", "dioxus-config-macro/liveview", "dioxus-router?/liveview"]
axum = ["dioxus-fullstack?/axum"]
salvo = ["dioxus-fullstack?/salvo"]
warp = ["dioxus-fullstack?/warp"]
axum = ["dioxus-fullstack?/axum", "dioxus-liveview?/axum"]
salvo = ["dioxus-fullstack?/salvo", "dioxus-liveview?/salvo"]
warp = ["dioxus-fullstack?/warp", "dioxus-liveview?/warp"]
rocket = ["dioxus-liveview?/rocket"]
tui = ["dioxus-tui", "dioxus-config-macro/tui"]
[dev-dependencies]
+17 -4
View File
@@ -17,10 +17,10 @@ pub struct LaunchBuilder<Cfg: 'static = (), ContextFn: ?Sized = ValidContext> {
pub type LaunchFn<Cfg, Context> = fn(fn() -> Element, Vec<Box<Context>>, Cfg);
#[cfg(feature = "fullstack")]
#[cfg(any(feature = "fullstack", feature = "liveview"))]
type ValidContext = SendContext;
#[cfg(not(feature = "fullstack"))]
#[cfg(not(any(feature = "fullstack", feature = "liveview")))]
type ValidContext = UnsendContext;
type SendContext = dyn Fn() -> Box<dyn Any> + Send + Sync + 'static;
@@ -154,12 +154,24 @@ mod current_platform {
pub use dioxus_web::launch::*;
#[cfg(all(
feature = "tui",
feature = "liveview",
not(any(feature = "web", feature = "desktop", feature = "fullstack"))
))]
pub use dioxus_liveview::launch::*;
#[cfg(all(
feature = "tui",
not(any(
feature = "liveview",
feature = "web",
feature = "desktop",
feature = "fullstack"
))
))]
pub use dioxus_tui::launch::*;
#[cfg(not(any(
feature = "liveview",
feature = "desktop",
feature = "web",
feature = "tui",
@@ -168,6 +180,7 @@ mod current_platform {
pub type Config = ();
#[cfg(not(any(
feature = "liveview",
feature = "desktop",
feature = "web",
feature = "tui",
@@ -176,7 +189,7 @@ mod current_platform {
pub fn launch(
root: fn() -> dioxus_core::Element,
contexts: Vec<Box<super::ValidContext>>,
platform_config: Config,
platform_config: (),
) {
}
}
-3
View File
@@ -21,9 +21,6 @@ pub mod events {
#[cfg(feature = "html")]
pub use dioxus_html as html;
#[cfg(feature = "macro")]
pub use dioxus_rsx as rsx;
#[cfg(feature = "macro")]
pub use dioxus_core_macro as core_macro;