Skip to content

Commit

Permalink
add marker field, in an attempt to reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza1311 committed Jul 20, 2022
1 parent 1e26e3a commit 7b65f3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/yew/src/virtual_dom/vcomp.rs
Expand Up @@ -27,6 +27,8 @@ pub struct VComp {
pub(crate) type_id: TypeId,
pub(crate) mountable: Box<dyn Mountable>,
pub(crate) key: Option<Key>,
// for some reason, this reduces the bundle size by ~2-3 KBs
_marker: u32,
}

impl fmt::Debug for VComp {
Expand All @@ -45,6 +47,7 @@ impl Clone for VComp {
type_id: self.type_id,
mountable: self.mountable.copy(),
key: self.key.clone(),
_marker: 0,
}
}
}
Expand Down Expand Up @@ -214,6 +217,7 @@ impl VComp {
type_id: TypeId::of::<COMP>(),
mountable: Box::new(PropsWrapper::<COMP>::new(props)),
key,
_marker: 0,
}
}
}
Expand Down

0 comments on commit 7b65f3c

Please sign in to comment.