wip: ....sigh..... so the diffing algorithm is robust

but it's still not finished.

We need to re-enable the fancier keyed diffing versions some point (soon!).
This commit is contained in:
Jonathan Kelley committed 2021-07-12 03:58:46 -04:00
1 parent ff0a3d1c83
commit 68ed1c04e7
10 files changed
+168 -102

No files matched your search

+37 -2
View File
@@ -1,4 +1,10 @@
use std::cell::Cell;
use dioxus::prelude::*;
use dioxus_core::{
nodes::{NodeKey, VElement, VText},
RealDomNode,
};
fn main() {
env_logger::init();
@@ -13,8 +19,18 @@ p {color: red;}
const Example: FC<()> = |cx| {
cx.render(rsx! {
Child { }
Child { }
Fragment {
Fragment {
Fragment {
"h1"
}
"h2"
}
"h3"
}
"h4"
div { "h5" }
Child {}
})
};
@@ -26,3 +42,22 @@ const Child: FC<()> = |cx| {
h1 {"4" }
))
};
// this is a bad case that hurts our subtree memoization :(
const AbTest: FC<()> = |cx| {
if 1 == 2 {
cx.render(rsx!(
h1 {"1"}
h1 {"2"}
h1 {"3"}
h1 {"4"}
))
} else {
cx.render(rsx!(
h1 {"1"}
h1 {"2"}
h2 {"basd"}
h1 {"4"}
))
}
};