Merge branch 'upstream' into fix-hot-reloading

This commit is contained in:
Evan Almloff committed 2022-12-23 18:06:47 -06:00
commit 555b192436
6 files changed
+77 -99

No files matched your search

@@ -69,8 +69,8 @@ impl<Ctx: HotReloadingContext> FileMap<Ctx> {
let old_start = old.span().start();
if let (Ok(old_call_body), Ok(new_call_body)) = (
syn::parse2::<CallBody<Ctx>>(old.tokens),
syn::parse2::<CallBody<Ctx>>(new),
syn::parse2::<CallBody>(old.tokens),
syn::parse2::<CallBody>(new),
) {
if let Ok(file) = file_path.strip_prefix(crate_dir) {
let line = old_start.line;
@@ -83,10 +83,12 @@ impl<Ctx: HotReloadingContext> FileMap<Ctx> {
// the byte index doesn't matter, but dioxus needs it
+ ":0";
if let Some(template) = new_call_body.update_template(
Some(old_call_body),
Box::leak(location.into_boxed_str()),
) {
if let Some(template) = new_call_body
.update_template::<Ctx>(
Some(old_call_body),
Box::leak(location.into_boxed_str()),
)
{
// dioxus cannot handle empty templates
if template.roots.is_empty() {
return UpdateResult::NeedsRebuild;