Merge branch 'master' into events-2
This commit is contained in:
commit
dccfba12d8
209 files changed
+6270
-2789
No files matched your search
+9
-14
@@ -220,14 +220,16 @@ pub async fn run_with_props<T: 'static>(root: fn(Scope<T>) -> Element, root_prop
|
||||
// todo: we need to split rebuild and initialize into two phases
|
||||
// it's a waste to produce edits just to get the vdom loaded
|
||||
|
||||
let templates = dom.rebuild().templates;
|
||||
websys_dom.load_templates(&templates);
|
||||
|
||||
{
|
||||
let mutations = dom.rebuild();
|
||||
web_sys::console::log_1(&format!("mutations: {:#?}", mutations).into());
|
||||
let templates = mutations.templates;
|
||||
websys_dom.load_templates(&templates);
|
||||
websys_dom.interpreter.flush();
|
||||
}
|
||||
if let Err(err) = websys_dom.rehydrate(&dom) {
|
||||
tracing::error!(
|
||||
"Rehydration failed {:?}. Rebuild DOM into element from scratch",
|
||||
&err
|
||||
);
|
||||
tracing::error!("Rehydration failed. {:?}", err);
|
||||
tracing::error!("Rebuild DOM into element from scratch");
|
||||
websys_dom.root.set_text_content(None);
|
||||
|
||||
let edits = dom.rebuild();
|
||||
@@ -256,13 +258,6 @@ pub async fn run_with_props<T: 'static>(root: fn(Scope<T>) -> Element, root_prop
|
||||
pin_mut!(work);
|
||||
|
||||
#[cfg(all(feature = "hot_reload", debug_assertions))]
|
||||
// futures_util::select! {
|
||||
// _ = work => (None, None),
|
||||
// new_template = hotreload_rx.next() => {
|
||||
// (None, new_template)
|
||||
// }
|
||||
// evt = rx.next() =>
|
||||
// }
|
||||
match select(work, select(hotreload_rx.next(), rx.next())).await {
|
||||
Either::Left((_, _)) => (None, None),
|
||||
Either::Right((Either::Left((new_template, _)), _)) => (None, new_template),
|
||||
|
||||
Reference in new issue
Block a user