Fix nested rsx expansion by not using template titles (#2799)

* Fix nested rsx expansion by not using template titles

* fix writers with nameless templates

* fix clippy

* dont commit vscode fix

* fix release mode, pull out __template_name

* fix axum_desktop

* Fix core tests

* Make most fields of HotReloadedTemplate public for testing

* wip: formatting, compare all diff cases

* slightly smarter diffing for dynamic nodes

* add a comment about generic node diffing

* clean up mutations a bit

* fix load template

* simplify maybe_rebuild

* Restore write mutations flag in web

* write_mutations -> skip_mutations

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
This commit is contained in:
Jonathan KelleyandEvan Almloff authored and GitHub committed 2024-08-13 01:59:04 +00:00
1 parent a2180b92e9
commit 0de3bf7aeb
40 files changed
+597 -1038

No files matched your search

+10 -10
View File
@@ -21,18 +21,18 @@ fn attrs_cycle() {
});
assert_eq!(
dom.rebuild_to_vec().sanitize().edits,
dom.rebuild_to_vec().edits,
[
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
LoadTemplate { index: 0, id: ElementId(1,) },
AppendChildren { m: 1, id: ElementId(0) },
]
);
dom.mark_dirty(ScopeId::APP);
assert_eq!(
dom.render_immediate_to_vec().sanitize().edits,
dom.render_immediate_to_vec().edits,
[
LoadTemplate { name: "template", index: 0, id: ElementId(2,) },
LoadTemplate { index: 0, id: ElementId(2,) },
AssignId { path: &[0,], id: ElementId(3,) },
SetAttribute { name: "class", value: "1".into_value(), id: ElementId(3,), ns: None },
SetAttribute { name: "id", value: "1".into_value(), id: ElementId(3,), ns: None },
@@ -42,18 +42,18 @@ fn attrs_cycle() {
dom.mark_dirty(ScopeId::APP);
assert_eq!(
dom.render_immediate_to_vec().sanitize().edits,
dom.render_immediate_to_vec().edits,
[
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
LoadTemplate { index: 0, id: ElementId(1) },
ReplaceWith { id: ElementId(2), m: 1 }
]
);
dom.mark_dirty(ScopeId::APP);
assert_eq!(
dom.render_immediate_to_vec().sanitize().edits,
dom.render_immediate_to_vec().edits,
[
LoadTemplate { name: "template", index: 0, id: ElementId(2) },
LoadTemplate { index: 0, id: ElementId(2) },
AssignId { path: &[0], id: ElementId(3) },
SetAttribute {
name: "class",
@@ -74,9 +74,9 @@ fn attrs_cycle() {
// we take the node taken by attributes since we reused it
dom.mark_dirty(ScopeId::APP);
assert_eq!(
dom.render_immediate_to_vec().sanitize().edits,
dom.render_immediate_to_vec().edits,
[
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
LoadTemplate { index: 0, id: ElementId(1) },
ReplaceWith { id: ElementId(2), m: 1 }
]
);