leptos
leptos copied to clipboard
Debug NodeRef Warning (#2414)
This is a response to #2414
In production #[repr(transparent)] is use to ensure a compact representation in memory. In developement the memory is slightly expanded.
Things I am thinking about
A) I have introduced a maintence hazard... the documentation block for NodeRef is repeated twice So any future PRs will have to make sure things are kept in sync. I would love to avoid that...
B) I may have been over eager.. ( adding #[track_caller ] in too many places. ) impl<T: ElementDescriptor> Clone for NodeRef<T> { #[track_caller] fn clone(&self) -> Self { *self }
Sorry for the late reply
There is a small nuance here.
This directive is dropped for a debug build something I was hoping to avoid .
#[repr(transparent)]
I have to do it by adding a
#[allow(missing_docs)]
I recently, rebased and force pushed - as I think it will fix build errors
To be honest I think the CI is just unhappy
Ok this next version looks much less like a dogs breakfast
#[cfg_attr(not(debug_assertions), repr(transparent)]
That was the key to this, that I was not seeing ... thank you - thank you
Thanks very much for the contribution, and for your patience through all the back and forth!