wip: groundwork for noderefs

This commit is contained in:
Jonathan Kelley committed 2021-08-09 17:09:33 -04:00
1 parent a44e9fcffa
commit c1afeba1ef
21 files changed
+184 -103

No files matched your search

+1 -2
View File
@@ -23,7 +23,7 @@ wasm-bindgen-test = "0.3.21"
once_cell = "1.8"
async-channel = "1.6.1"
anyhow = "1.0"
gloo-timers = { version = "0.2.1", features = ["futures"] }
futures-util = "0.3.15"
[dependencies.web-sys]
@@ -78,7 +78,6 @@ im-rc = "15.0.0"
separator = "0.4.1"
uuid = { version = "0.8.2", features = ["v4", "wasm-bindgen"] }
dioxus-hooks = { path = "../hooks" }
gloo-timers = { version = "0.2.1", features = ["futures"] }
serde = { version = "1.0.126", features = ["derive"] }
surf = { git = "https://github.com/http-rs/surf", rev = "1ffaba8873", default-features = false, features = [
"wasm-client",
-12
View File
@@ -395,18 +395,6 @@ impl WebsysDom {
}
}
impl<'a> dioxus_core::diff::RealDom for WebsysDom {
// fn request_available_node(&mut self) -> ElementId {
// let key = self.nodes.insert(None);
// log::debug!("making new key: {:#?}", key);
// ElementId(key.data().as_ffi())
// }
fn raw_node_as_any(&self) -> &mut dyn std::any::Any {
todo!()
}
}
#[derive(Debug, Default)]
pub struct Stack {
pub list: Vec<Node>,
+6 -10
View File
@@ -107,8 +107,6 @@ pub async fn run_with_props<T: Properties + 'static>(
let tasks = dom.get_event_sender();
let mut real = RealDomWebsys {};
// initialize the virtualdom first
if cfg.hydrate {
dom.rebuild_in_place()?;
@@ -120,7 +118,12 @@ pub async fn run_with_props<T: Properties + 'static>(
Rc::new(move |event| tasks.unbounded_send(event).unwrap()),
);
dom.run_with_deadline(&mut websys_dom).await?;
loop {
let deadline = gloo_timers::future::TimeoutFuture::new(16);
let mut mutations = dom.run_with_deadline(deadline).await?;
websys_dom.process_edits(&mut mutations.edits);
}
Ok(())
}
@@ -129,10 +132,3 @@ struct HydrationNode {
id: usize,
node: Node,
}
struct RealDomWebsys {}
impl dioxus::RealDom for RealDomWebsys {
fn raw_node_as_any(&self) -> &mut dyn std::any::Any {
todo!()
}
}