Fix hot reloading components with keys (#2886)

* Fix hot reloading components with keys

* include component formatted segment keys, but not dynamic component value

* Fix component_literal_dyn_idx index

* add a new test for hot reloading components with keys

* Even more tests

* make clippy happy

* fix typo
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-08-28 18:53:11 -05:00
1 parent 0e937daaa1
commit 4676171861
7 files changed
+176 -56

No files matched your search

+7 -4
View File
@@ -69,10 +69,13 @@ impl<'a> DynIdVisitor<'a> {
if let HotLiteral::Fmted(segments) = literal {
self.assign_formatted_segment(segments);
}
component.component_literal_dyn_idx[index]
.set(self.component_literal_index);
self.component_literal_index += 1;
index += 1;
// Don't include keys in the component dynamic pool
if !property.name.is_likely_key() {
component.component_literal_dyn_idx[index]
.set(self.component_literal_index);
self.component_literal_index += 1;
index += 1;
}
}
}
}