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

-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!()
}
}