From 7b65f3c34097a1774a37493bf511fa44c33da559 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Date: Wed, 20 Jul 2022 19:49:04 +0500 Subject: [PATCH] add marker field, in an attempt to reduce bundle size --- packages/yew/src/virtual_dom/vcomp.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/yew/src/virtual_dom/vcomp.rs b/packages/yew/src/virtual_dom/vcomp.rs index a038b5d3411..02f96beb414 100644 --- a/packages/yew/src/virtual_dom/vcomp.rs +++ b/packages/yew/src/virtual_dom/vcomp.rs @@ -27,6 +27,8 @@ pub struct VComp { pub(crate) type_id: TypeId, pub(crate) mountable: Box, pub(crate) key: Option, + // for some reason, this reduces the bundle size by ~2-3 KBs + _marker: u32, } impl fmt::Debug for VComp { @@ -45,6 +47,7 @@ impl Clone for VComp { type_id: self.type_id, mountable: self.mountable.copy(), key: self.key.clone(), + _marker: 0, } } } @@ -214,6 +217,7 @@ impl VComp { type_id: TypeId::of::(), mountable: Box::new(PropsWrapper::::new(props)), key, + _marker: 0, } } }