Fix hot reloading component properties out of order (#2842)

* Fix hot reloading component properties out of order

* ignore signal write warnings in hot reloading

* Fix hot reloading components with only some literal properties

* Add a test for hot reloading component properties
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-08-14 15:18:37 -07:00
1 parent 1e03e3946d
commit 4d6fb74e87
6 files changed
+48 -15

No files matched your search

+14 -2
View File
@@ -1069,8 +1069,20 @@ fn component_with_handlers() {
}
};
let valid = can_hotreload(a, b);
assert!(valid);
let hot_reload = hot_reload_from_tokens(a, b).unwrap();
let template = hot_reload.get(&0).unwrap();
assert_eq!(
template.component_values,
&[
HotReloadLiteral::Int(456),
HotReloadLiteral::Float(789.456),
HotReloadLiteral::Bool(false),
HotReloadLiteral::Fmted(FmtedSegments::new(vec![
FmtSegment::Literal { value: "goodbye " },
FmtSegment::Dynamic { id: 0 }
])),
]
);
}
#[test]