The concept behind widget::component
seems to me to be about encapsulation, which is quite separate from lazy re-rendering which in my mind is purely about performance. Actually they seem quite at odds since encapsulation should make the code simpler whereas if anything lazy widgets require more logic to implement. The code implementing component
also does not seem to depend at all on any of the other code behind the “lazy” feature.
Given the above, I wonder if widget::component
should not be behind its own feature or just in the standard crate. Or perhaps the “lazy” feature should be renamed to emphasize that it covers more than just lazy widgets. What are peoples’ thoughts?
As a seperate point, it is very unhelpful that the component()
(and other) function(s) are not marked as requiring the “lazy” feature in the documentation. After some experimentation, it seems the individual functions in widget/src/lazy/helpers.rs
need to have the #[cfg(feature = "lazy")]
attribute, not just the re-export statement in widget/src/lib.rs
. I’m aware this is a nightly feature of rustdoc and so may change but does seem like a useful addition, happy to do a PR with this change and any other instances of this problem I find.