Improve compile times by splitting out rsx-hotreload from rsx (#2971)
* fix imports, migrate over rsx-hotreload
This commit is contained in:
1 parent
b67122dd2a
commit
463e67cd12
41 files changed
+188
-190
No files matched your search
@@ -0,0 +1,31 @@
|
||||
use dioxus_rsx_hotreload::diff_rsx;
|
||||
use syn::File;
|
||||
|
||||
macro_rules! assert_rsx_changed {
|
||||
(
|
||||
$( #[doc = $doc:expr] )*
|
||||
$name:ident
|
||||
) => {
|
||||
$( #[doc = $doc] )*
|
||||
#[test]
|
||||
fn $name() {
|
||||
let old = include_str!(concat!("./valid/", stringify!($name), ".old.rsx"));
|
||||
let new = include_str!(concat!("./valid/", stringify!($name), ".new.rsx"));
|
||||
let (old, new) = load_files(old, new);
|
||||
assert!(diff_rsx(&new, &old).is_some());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn load_files(old: &str, new: &str) -> (File, File) {
|
||||
let old = syn::parse_file(old).unwrap();
|
||||
let new = syn::parse_file(new).unwrap();
|
||||
(old, new)
|
||||
}
|
||||
|
||||
assert_rsx_changed![combo];
|
||||
assert_rsx_changed![expr];
|
||||
assert_rsx_changed![for_];
|
||||
assert_rsx_changed![if_];
|
||||
assert_rsx_changed![let_];
|
||||
assert_rsx_changed![nested];
|
||||
Reference in new issue
Block a user