From 3ae9032b32f3f3d99391291221a3b220111d4efb Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 20 Aug 2024 09:59:54 -0700 Subject: [PATCH 1/2] Fix hot reloading attributes on web components --- packages/rsx/src/attribute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rsx/src/attribute.rs b/packages/rsx/src/attribute.rs index 5c11a7af08..09ccad865c 100644 --- a/packages/rsx/src/attribute.rs +++ b/packages/rsx/src/attribute.rs @@ -174,7 +174,7 @@ impl Attribute { let element_name = self.el_name.as_ref().unwrap(); let rust_name = match element_name { ElementName::Ident(i) => i.to_string(), - ElementName::Custom(s) => return (intern(s.value()), None), + ElementName::Custom(s) => return (intern(attribute_name_rust.as_str()), None), }; Ctx::map_attribute(&rust_name, &attribute_name_rust) From 692936e15b45cf051fba88e6f56f3a4dc8da5980 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 20 Aug 2024 10:10:11 -0700 Subject: [PATCH 2/2] Fix clippy --- packages/rsx/src/attribute.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/rsx/src/attribute.rs b/packages/rsx/src/attribute.rs index 09ccad865c..9d929864f1 100644 --- a/packages/rsx/src/attribute.rs +++ b/packages/rsx/src/attribute.rs @@ -174,7 +174,9 @@ impl Attribute { let element_name = self.el_name.as_ref().unwrap(); let rust_name = match element_name { ElementName::Ident(i) => i.to_string(), - ElementName::Custom(s) => return (intern(attribute_name_rust.as_str()), None), + // If this is a web component, just use the name of the elements instead of mapping the attribute + // through the hot reloading context + ElementName::Custom(_) => return (intern(attribute_name_rust.as_str()), None), }; Ctx::map_attribute(&rust_name, &attribute_name_rust)