App {
crate::collect_assets::copy_assets();
// Set the event converter
- dioxus_html::set_event_converter(Box::new(SerializedHtmlEventConverter));
+ dioxus_html::set_event_converter(Box::new(crate::events::SerializedHtmlEventConverter));
// Allow hotreloading to work - but only in debug mode
#[cfg(all(feature = "hot-reload", debug_assertions))]
@@ -248,7 +248,7 @@ impl App {
let as_any = match data {
dioxus_html::EventData::Mounted => {
let element = DesktopElement::new(element, view.desktop_context.clone(), query);
- Rc::new(PlatformEventData::new(Box::new(MountedData::new(element))))
+ Rc::new(PlatformEventData::new(Box::new(element)))
}
_ => data.into_any(),
};
diff --git a/packages/desktop/src/config.rs b/packages/desktop/src/config.rs
index d826303e1..2b4f5d0d6 100644
--- a/packages/desktop/src/config.rs
+++ b/packages/desktop/src/config.rs
@@ -47,7 +47,12 @@ impl Config {
/// Initializes a new `WindowBuilder` with default values.
#[inline]
pub fn new() -> Self {
- let window = WindowBuilder::new().with_title("Dioxus app");
+ let window = WindowBuilder::new().with_title(
+ dioxus_cli_config::CURRENT_CONFIG
+ .as_ref()
+ .map(|c| c.dioxus_config.application.name.clone())
+ .unwrap_or("Dioxus App".to_string()),
+ );
Self {
// event_handler: None,
diff --git a/packages/fullstack/Cargo.toml b/packages/fullstack/Cargo.toml
index 0215fcaad..17e8ad4f6 100644
--- a/packages/fullstack/Cargo.toml
+++ b/packages/fullstack/Cargo.toml
@@ -16,18 +16,14 @@ dioxus_server_macro = { workspace = true }
# warp
warp = { version = "0.3.5", features = ["compression-gzip"], optional = true }
-http-body = { version = "0.4.5", optional = true }
-http-body-util = "0.1.0-rc.2"
# axum
-axum = { version = "0.6.1", features = ["ws", "macros"], optional = true }
+axum = { version = "0.6.1", features = ["ws", "macros"], default-features = false, optional = true }
tower-http = { version = "0.4.0", optional = true, features = ["fs", "compression-gzip"] }
-tower = { version = "0.4.13", features = ["util"], optional = true }
-axum-macros = "0.3.7"
# salvo
salvo = { version = "0.63.0", optional = true, features = ["serve-static", "websocket", "compression"] }
-serde = "1.0.159"
+http-body-util = { version = "0.1.0-rc.2", optional = true }
# Dioxus + SSR
dioxus = { workspace = true }
@@ -45,24 +41,25 @@ dioxus-desktop = { workspace = true, optional = true }
dioxus-router = { workspace = true, optional = true }
tracing = { workspace = true }
-tracing-futures = { workspace = true }
+tracing-futures = { workspace = true, optional = true }
once_cell = "1.17.1"
-thiserror = { workspace = true }
-tokio = { workspace = true, features = ["full"], optional = true }
+tokio = { workspace = true, features = ["rt", "sync", "rt-multi-thread"], optional = true }
tokio-util = { version = "0.7.8", features = ["rt"], optional = true }
-object-pool = "0.5.4"
-anymap = "0.12.1"
+anymap = { version = "0.12.1", optional = true }
+serde = "1.0.159"
serde_json = { version = "1.0.95", optional = true }
tokio-stream = { version = "0.1.12", features = ["sync"], optional = true }
-futures-util = { workspace = true, optional = true }
-postcard = { version = "1.0.4", features = ["use-std"] }
+futures-util = { workspace = true, default-features = false, optional = true }
+ciborium = "0.2.1"
base64 = "0.21.0"
-pin-project = "1.1.2"
+pin-project = { version = "1.1.2", optional = true }
+thiserror = { workspace = true, optional = true }
async-trait = "0.1.71"
bytes = "1.4.0"
-tower-layer = "0.3.2"
+tower = { version = "0.4.13", features = ["util"], optional = true }
+tower-layer = { version = "0.3.2", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dioxus-hot-reload = { workspace = true }
@@ -75,17 +72,14 @@ web-sys = { version = "0.3.61", features = ["Window", "Document", "Element", "Ht
manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", features = ["webp", "html"] }
[features]
-default = ["hot-reload", "default-tls"]
+default = ["hot-reload"]
router = ["dioxus-router"]
hot-reload = ["serde_json", "futures-util"]
web = ["dioxus-web"]
desktop = ["dioxus-desktop"]
warp = ["dep:warp", "ssr"]
axum = ["dep:axum", "tower-http", "ssr"]
-salvo = ["dep:salvo", "ssr"]
-ssr = ["server_fn/ssr", "dioxus_server_macro/ssr", "tokio", "tokio-util", "dioxus-ssr", "tower", "hyper", "http", "http-body", "dioxus-router/ssr", "tokio-stream"]
+salvo = ["dep:salvo", "ssr", "http-body-util"]
+ssr = ["server_fn/ssr", "dioxus_server_macro/ssr", "tokio", "tokio-util", "tokio-stream", "dioxus-ssr", "tower", "hyper", "http", "dioxus-router?/ssr", "tower-layer", "anymap", "tracing-futures", "pin-project", "thiserror"]
default-tls = ["server_fn/default-tls"]
rustls = ["server_fn/rustls"]
-
-[dev-dependencies]
-dioxus-fullstack = { path = ".", features = ["router"] }
diff --git a/packages/fullstack/examples/axum-hello-world/Cargo.toml b/packages/fullstack/examples/axum-hello-world/Cargo.toml
index a3b68b05a..4dda8df5b 100644
--- a/packages/fullstack/examples/axum-hello-world/Cargo.toml
+++ b/packages/fullstack/examples/axum-hello-world/Cargo.toml
@@ -9,7 +9,6 @@ publish = false
[dependencies]
dioxus = { workspace = true }
dioxus-fullstack = { workspace = true }
-axum = { version = "0.6.12", optional = true }
serde = "1.0.159"
simple_logger = "4.2.0"
tracing-wasm = "0.2.1"
@@ -19,5 +18,5 @@ reqwest = "0.11.18"
[features]
default = []
-ssr = ["axum", "dioxus-fullstack/axum"]
+ssr = ["dioxus-fullstack/axum"]
web = ["dioxus-fullstack/web"]
diff --git a/packages/fullstack/examples/salvo-hello-world/Cargo.toml b/packages/fullstack/examples/salvo-hello-world/Cargo.toml
index 3d4e74c5b..23956cefa 100644
--- a/packages/fullstack/examples/salvo-hello-world/Cargo.toml
+++ b/packages/fullstack/examples/salvo-hello-world/Cargo.toml
@@ -10,7 +10,6 @@ publish = false
dioxus-web = { workspace = true, features=["hydrate"], optional = true }
dioxus = { workspace = true }
dioxus-fullstack = { workspace = true }
-tokio = { workspace = true, features = ["full"], optional = true }
serde = "1.0.159"
salvo = { version = "0.63.0", optional = true }
execute = "0.2.12"
@@ -22,5 +21,5 @@ tracing-subscriber = "0.3.17"
[features]
default = []
-ssr = ["salvo", "tokio", "dioxus-fullstack/salvo"]
+ssr = ["salvo", "dioxus-fullstack/salvo"]
web = ["dioxus-web"]
diff --git a/packages/fullstack/examples/warp-hello-world/Cargo.toml b/packages/fullstack/examples/warp-hello-world/Cargo.toml
index 1474facf3..c2246a58d 100644
--- a/packages/fullstack/examples/warp-hello-world/Cargo.toml
+++ b/packages/fullstack/examples/warp-hello-world/Cargo.toml
@@ -10,7 +10,6 @@ publish = false
dioxus-web = { workspace = true, features=["hydrate"], optional = true }
dioxus = { workspace = true }
dioxus-fullstack = { workspace = true }
-tokio = { workspace = true, features = ["full"], optional = true }
serde = "1.0.159"
warp = { version = "0.3.3", optional = true }
execute = "0.2.12"
@@ -22,5 +21,5 @@ tracing-subscriber = "0.3.17"
[features]
default = []
-ssr = ["warp", "tokio", "dioxus-fullstack/warp"]
+ssr = ["warp", "dioxus-fullstack/warp"]
web = ["dioxus-web"]
diff --git a/packages/fullstack/src/html_storage/deserialize.rs b/packages/fullstack/src/html_storage/deserialize.rs
index 7fc70ba6c..147f0d237 100644
--- a/packages/fullstack/src/html_storage/deserialize.rs
+++ b/packages/fullstack/src/html_storage/deserialize.rs
@@ -15,7 +15,7 @@ pub(crate) fn serde_from_bytes(string: &[u8]) -> Option
}
};
- match postcard::from_bytes(&decompressed) {
+ match ciborium::from_reader(std::io::Cursor::new(decompressed)) {
Ok(data) => Some(data),
Err(err) => {
tracing::error!("Failed to deserialize: {}", err);
diff --git a/packages/fullstack/src/html_storage/mod.rs b/packages/fullstack/src/html_storage/mod.rs
index 5b4d2804f..a6ae2ebe1 100644
--- a/packages/fullstack/src/html_storage/mod.rs
+++ b/packages/fullstack/src/html_storage/mod.rs
@@ -1,6 +1,6 @@
#![allow(unused)]
-use std::sync::atomic::AtomicUsize;
+use std::{io::Cursor, sync::atomic::AtomicUsize};
use serde::{de::DeserializeOwned, Serialize};
@@ -15,7 +15,8 @@ pub(crate) struct HTMLData {
impl HTMLData {
pub(crate) fn push(&mut self, value: &T) {
- let serialized = postcard::to_allocvec(value).unwrap();
+ let mut serialized = Vec::new();
+ serialize::serde_to_writable(value, &mut serialized).unwrap();
self.data.push(serialized);
}
@@ -45,7 +46,7 @@ impl HTMLDataCursor {
}
let mut cursor = &self.data[current];
self.index.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
- match postcard::from_bytes(cursor) {
+ match ciborium::from_reader(Cursor::new(cursor)) {
Ok(x) => Some(x),
Err(e) => {
tracing::error!("Error deserializing data: {:?}", e);
@@ -57,7 +58,7 @@ impl HTMLDataCursor {
#[test]
fn serialized_and_deserializes() {
- use postcard::to_allocvec;
+ use ciborium::{from_reader, into_writer};
#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Clone)]
struct Data {
@@ -97,7 +98,9 @@ fn serialized_and_deserializes() {
"original size: {}",
std::mem::size_of::() * data.len()
);
- println!("serialized size: {}", to_allocvec(&data).unwrap().len());
+ let mut bytes = Vec::new();
+ into_writer(&data, &mut bytes).unwrap();
+ println!("serialized size: {}", bytes.len());
println!("compressed size: {}", as_string.len());
let decoded: Vec = deserialize::serde_from_bytes(&as_string).unwrap();
diff --git a/packages/fullstack/src/html_storage/serialize.rs b/packages/fullstack/src/html_storage/serialize.rs
index 7f0a7efc7..482864eb3 100644
--- a/packages/fullstack/src/html_storage/serialize.rs
+++ b/packages/fullstack/src/html_storage/serialize.rs
@@ -7,8 +7,9 @@ use base64::Engine;
pub(crate) fn serde_to_writable(
value: &T,
write_to: &mut impl std::io::Write,
-) -> std::io::Result<()> {
- let serialized = postcard::to_allocvec(value).unwrap();
+) -> Result<(), ciborium::ser::Error> {
+ let mut serialized = Vec::new();
+ ciborium::into_writer(value, &mut serialized)?;
write_to.write_all(STANDARD.encode(serialized).as_bytes())?;
Ok(())
}
@@ -18,12 +19,12 @@ pub(crate) fn serde_to_writable(
pub(crate) fn encode_props_in_element(
data: &T,
write_to: &mut impl std::io::Write,
-) -> std::io::Result<()> {
+) -> Result<(), ciborium::ser::Error> {
write_to.write_all(
r#""#.as_bytes())
+ Ok(write_to.write_all(r#"" />"#.as_bytes())?)
}
#[cfg(feature = "ssr")]
@@ -31,10 +32,10 @@ pub(crate) fn encode_props_in_element(
pub(crate) fn encode_in_element(
data: &super::HTMLData,
write_to: &mut impl std::io::Write,
-) -> std::io::Result<()> {
+) -> Result<(), ciborium::ser::Error> {
write_to.write_all(
r#""#.as_bytes())
+ Ok(write_to.write_all(r#"" />"#.as_bytes())?)
}
diff --git a/packages/fullstack/src/render.rs b/packages/fullstack/src/render.rs
index 886a5bd99..c3aefd605 100644
--- a/packages/fullstack/src/render.rs
+++ b/packages/fullstack/src/render.rs
@@ -65,7 +65,7 @@ impl SsrRendererPool {
}
if let Err(err) = renderer.render_to(&mut to, &vdom) {
let _ = tx.send(Err(
- dioxus_router::prelude::IncrementalRendererError::RenderError(
+ dioxus_ssr::incremental::IncrementalRendererError::RenderError(
err,
),
));
@@ -236,7 +236,9 @@ impl dioxus_ssr::incremental::Wrap
to: &mut R,
) -> Result<(), dioxus_ssr::incremental::IncrementalRendererError> {
// serialize the props
- crate::html_storage::serialize::encode_props_in_element(&self.cfg.props, to)?;
+ crate::html_storage::serialize::encode_props_in_element(&self.cfg.props, to).map_err(
+ |err| dioxus_ssr::incremental::IncrementalRendererError::Other(Box::new(err)),
+ )?;
// serialize the server state
crate::html_storage::serialize::encode_in_element(
&*self.server_context.html_data().map_err(|_| {
@@ -258,7 +260,8 @@ impl dioxus_ssr::incremental::Wrap
}))
})?,
to,
- )?;
+ )
+ .map_err(|err| dioxus_ssr::incremental::IncrementalRendererError::Other(Box::new(err)))?;
#[cfg(all(debug_assertions, feature = "hot-reload"))]
{
diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml
index b327f8e96..82d1640e3 100644
--- a/packages/html/Cargo.toml
+++ b/packages/html/Cargo.toml
@@ -20,7 +20,7 @@ euclid = "0.22.7"
enumset = "1.1.2"
keyboard-types = "0.7"
async-trait = "0.1.58"
-serde-value = "0.7.0"
+serde-value = { version = "0.7.0", optional = true }
tokio = { workspace = true, features = ["fs", "io-util"], optional = true }
rfd = { version = "0.12", optional = true }
async-channel = "1.8.0"
@@ -56,14 +56,15 @@ serialize = [
"euclid/serde",
"keyboard-types/serde",
"dioxus-core/serialize",
+ "serde-value",
]
mounted = [
- "web-sys/Element",
- "web-sys/DomRect",
- "web-sys/ScrollIntoViewOptions",
- "web-sys/ScrollLogicalPosition",
- "web-sys/ScrollBehavior",
- "web-sys/HtmlElement",
+ "web-sys?/Element",
+ "web-sys?/DomRect",
+ "web-sys?/ScrollIntoViewOptions",
+ "web-sys?/ScrollLogicalPosition",
+ "web-sys?/ScrollBehavior",
+ "web-sys?/HtmlElement",
]
eval = [
"serde",
diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml
index da9d3fe85..0064b5300 100644
--- a/packages/router/Cargo.toml
+++ b/packages/router/Cargo.toml
@@ -10,13 +10,10 @@ homepage = "https://dioxuslabs.com"
keywords = ["dom", "ui", "gui", "react", "wasm"]
[dependencies]
-anyhow = "1.0.66"
dioxus = { workspace = true }
dioxus-router-macro = { workspace = true }
gloo = { version = "0.8.0", optional = true }
tracing = { workspace = true }
-thiserror = { workspace = true }
-futures-util = { workspace = true }
urlencoding = "2.1.3"
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1.0.91", optional = true }
@@ -30,13 +27,14 @@ gloo-utils = { version = "0.1.6", optional = true }
dioxus-liveview = { workspace = true, optional = true }
dioxus-ssr = { workspace = true, optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
+dioxus-cli-config.workspace = true
[features]
default = ["web"]
ssr = ["dioxus-ssr", "tokio"]
liveview = ["dioxus-liveview", "tokio", "dep:serde", "serde_json"]
wasm_test = []
-serde = ["dep:serde", "gloo-utils/serde"]
+serde = ["dep:serde", "gloo-utils?/serde"]
web = ["gloo", "web-sys", "wasm-bindgen", "gloo-utils", "js-sys"]
[dev-dependencies]
diff --git a/packages/router/examples/simple_routes.rs b/packages/router/examples/simple_routes.rs
index 6c33c275b..9317f0f36 100644
--- a/packages/router/examples/simple_routes.rs
+++ b/packages/router/examples/simple_routes.rs
@@ -54,8 +54,7 @@ fn main() {
#[cfg(feature = "liveview")]
#[component]
fn Root(cx: Scope) -> Element {
- let history = LiveviewHistory::new(cx);
- render! { Router:: { config: || RouterConfig::default().history(history) } }
+ render! { Router:: {} }
}
#[cfg(not(feature = "liveview"))]
diff --git a/packages/router/src/history/liveview.rs b/packages/router/src/history/liveview.rs
index 9ffb09c34..354d259b1 100644
--- a/packages/router/src/history/liveview.rs
+++ b/packages/router/src/history/liveview.rs
@@ -132,6 +132,15 @@ where
}
}
+impl Default for LiveviewHistory
+where
+ ::Err: std::fmt::Display,
+{
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl LiveviewHistory
where
::Err: std::fmt::Display,
@@ -141,10 +150,9 @@ where
///
/// # Panics
///
- /// Panics if not in a Liveview context.
- pub fn new(cx: &ScopeState) -> Self {
+ /// Panics if the function is not called in a dioxus runtime with a Liveview context.
+ pub fn new() -> Self {
Self::new_with_initial_path(
- cx,
"/".parse().unwrap_or_else(|err| {
panic!("index route does not exist:\n{}\n use LiveviewHistory::new_with_initial_path to set a custom path", err)
}),
@@ -156,17 +164,16 @@ where
///
/// # Panics
///
- /// Panics if not in a Liveview context.
- pub fn new_with_initial_path(cx: &ScopeState, initial_path: R) -> Self {
+ /// Panics if the function is not called in a dioxus runtime with a Liveview context.
+ pub fn new_with_initial_path(initial_path: R) -> Self {
let (action_tx, action_rx) = tokio::sync::mpsc::unbounded_channel::>();
let action_rx = Arc::new(Mutex::new(action_rx));
let timeline = Arc::new(Mutex::new(Timeline::new(initial_path)));
let updater_callback: Arc>> =
Arc::new(RwLock::new(Arc::new(|| {})));
- let eval_provider = cx
- .consume_context::>()
- .expect("evaluator not provided");
+ let eval_provider =
+ consume_context::>().expect("evaluator not provided");
let create_eval = Rc::new(move |script: &str| {
eval_provider
@@ -175,7 +182,7 @@ where
}) as Rc Result>;
// Listen to server actions
- cx.push_future({
+ push_future({
let timeline = timeline.clone();
let action_rx = action_rx.clone();
let create_eval = create_eval.clone();
@@ -235,7 +242,7 @@ where
});
// Listen to browser actions
- cx.push_future({
+ push_future({
let updater = updater_callback.clone();
let timeline = timeline.clone();
let create_eval = create_eval.clone();
@@ -256,15 +263,16 @@ where
Option,
Option>,
usize,
- )>(init_eval).expect("serializable state");
+ )>(init_eval)
+ .expect("serializable state");
let Ok(route) = R::from_str(&route.to_string()) else {
return;
};
let mut timeline = timeline.lock().expect("unpoisoned mutex");
let state = timeline.init(route.clone(), state, session, depth);
let state = serde_json::to_string(&state).expect("serializable state");
- let session = serde_json::to_string(&timeline.session())
- .expect("serializable session");
+ let session =
+ serde_json::to_string(&timeline.session()).expect("serializable session");
// Call the updater callback
(updater.read().unwrap())();
@@ -288,22 +296,24 @@ where
Ok(event) => event,
Err(_) => continue,
};
- let (route, state) = serde_json::from_value::<(String, Option)>(event).expect("serializable state");
+ let (route, state) = serde_json::from_value::<(String, Option)>(event)
+ .expect("serializable state");
let Ok(route) = R::from_str(&route.to_string()) else {
return;
};
let mut timeline = timeline.lock().expect("unpoisoned mutex");
let state = timeline.update(route.clone(), state);
let state = serde_json::to_string(&state).expect("serializable state");
- let session = serde_json::to_string(&timeline.session())
- .expect("serializable session");
+ let session =
+ serde_json::to_string(&timeline.session()).expect("serializable session");
let _ = create_eval(&format!(
r#"
// this does not trigger a PopState event
history.replaceState({state}, "", "{route}");
sessionStorage.setItem("liveview", '{session}');
- "#));
+ "#
+ ));
// Call the updater callback
(updater.read().unwrap())();
diff --git a/packages/router/src/history/web.rs b/packages/router/src/history/web.rs
index 789eed76e..a0f677e24 100644
--- a/packages/router/src/history/web.rs
+++ b/packages/router/src/history/web.rs
@@ -13,6 +13,16 @@ use super::{
HistoryProvider,
};
+#[allow(dead_code)]
+fn base_path() -> Option<&'static str> {
+ let base_path = dioxus_cli_config::CURRENT_CONFIG
+ .as_ref()
+ .ok()
+ .and_then(|c| c.dioxus_config.web.app.base_path.as_deref());
+ tracing::trace!("Using base_path from Dioxus.toml: {:?}", base_path);
+ base_path
+}
+
#[cfg(not(feature = "serde"))]
#[allow(clippy::extra_unused_type_parameters)]
fn update_scroll(window: &Window, history: &History) {
@@ -160,6 +170,10 @@ impl WebHistory {
.expect("`history` can set scroll restoration");
}
+ let prefix = prefix
+ .or_else(|| base_path().map(|s| s.to_string()))
+ .map(|prefix| format!("/{}", prefix.trim_matches('/')));
+
Self {
do_scroll_restoration,
history,
@@ -198,6 +212,16 @@ where
let location = self.window.location();
let path = location.pathname().unwrap_or_else(|_| "/".into())
+ &location.search().unwrap_or("".into());
+ let path = match self.prefix {
+ None => path,
+ Some(ref prefix) => {
+ if path.starts_with(prefix) {
+ path[prefix.len()..].to_string()
+ } else {
+ path
+ }
+ }
+ };
R::from_str(&path).unwrap_or_else(|err| panic!("{}", err))
}
diff --git a/packages/router/src/router_cfg.rs b/packages/router/src/router_cfg.rs
index dd379e493..e0d2ce358 100644
--- a/packages/router/src/router_cfg.rs
+++ b/packages/router/src/router_cfg.rs
@@ -53,10 +53,15 @@ where
{
pub(crate) fn get_history(self) -> Box> {
self.history.unwrap_or_else(|| {
- #[cfg(all(target_arch = "wasm32", feature = "web"))]
+ #[cfg(all(not(feature = "liveview"), target_arch = "wasm32", feature = "web"))]
let history = Box::>::default();
- #[cfg(not(all(target_arch = "wasm32", feature = "web")))]
+ #[cfg(all(
+ not(feature = "liveview"),
+ any(not(target_arch = "wasm32"), not(feature = "web"))
+ ))]
let history = Box::>::default();
+ #[cfg(feature = "liveview")]
+ let history = Box::>::default();
history
})
}
@@ -83,9 +88,17 @@ where
{
pub(crate) fn take_history(&mut self) -> Box {
self.history.take().unwrap_or_else(|| {
+ // If we are on wasm32 and the web feature is enabled, use the web history.
#[cfg(all(target_arch = "wasm32", feature = "web"))]
let history = Box::>>::default();
- #[cfg(not(all(target_arch = "wasm32", feature = "web")))]
+ // If we are not on wasm32 and the liveview feature is enabled, use the liveview history.
+ #[cfg(all(feature = "liveview", not(target_arch = "wasm32")))]
+ let history = Box::>>::default();
+ // If neither of the above are true, use the memory history.
+ #[cfg(all(
+ not(all(target_arch = "wasm32", feature = "web")),
+ not(all(feature = "liveview", not(target_arch = "wasm32"))),
+ ))]
let history = Box::>>::default();
history
})
diff --git a/packages/rsx/Cargo.toml b/packages/rsx/Cargo.toml
index 20893e7f4..32da1493a 100644
--- a/packages/rsx/Cargo.toml
+++ b/packages/rsx/Cargo.toml
@@ -14,7 +14,7 @@ keywords = ["dom", "ui", "gui", "react"]
[dependencies]
proc-macro2 = { version = "1.0", features = ["span-locations"] }
-dioxus-core = { workspace = true}
+dioxus-core = { workspace = true, optional = true }
syn = { version = "2.0", features = ["full", "extra-traits"] }
quote = { version = "1.0" }
serde = { version = "1.0", features = ["derive"], optional = true }
@@ -24,6 +24,6 @@ tracing.workspace = true
[features]
default = ["html"]
-hot_reload = ["krates", "internment"]
+hot_reload = ["krates", "internment", "dioxus-core"]
serde = ["dep:serde"]
html = []
diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml
index 1a8d475ee..6788f2754 100644
--- a/packages/ssr/Cargo.toml
+++ b/packages/ssr/Cargo.toml
@@ -17,13 +17,12 @@ rustc-hash = "1.1.0"
lru = "0.10.0"
tracing = { workspace = true }
http = "0.2.9"
-tokio = { version = "1.28", features = ["full"], optional = true }
+tokio = { version = "1.28", features = ["fs", "io-util"], optional = true }
async-trait = "0.1.58"
serde_json = { version = "1.0" }
[dev-dependencies]
dioxus = { workspace = true }
-thiserror = { workspace = true }
tracing = { workspace = true }
fern = { version = "0.6.0", features = ["colored"] }
anyhow = "1.0"