-
-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Multiple dependencies for states in the RealDom (native core) #412
Allow Multiple dependencies for states in the RealDom (native core) #412
Conversation
…T_multable_dependancies
I think GATs would be a cleaner solution, but this is possible with an associated type on the trait. |
This seems like a rather complex system that might be worth refactoring in the future to be less trait-heavy so we don't run into issues with GATS/associated types since that gets pretty gnarly. I dug into Taffy recently and was happy with a their ECS approach. We might be able to move some of the function values into an ECS-type structure and get a similar system but with less complexity. http://github.com/dioxusLabs/taffy But, we don't have a public facing crate with compatibility to worry about, so there's no harm in getting to a working point and then refactoring or cleaning up some structures later. |
Depends on #rust-lang/rust#96709 for GATs unless someone has a workaround
Refactor and generalize the incremental computation system for the RealDom to allow for mixed parent and child dependent state, and multiple dependencies for NodeDepState. The new trait for NodeDepState requires generic associated types to allow borrowing the elements of a tuple.
Why do we need this?
It allows some property of a node to depend on both the state of it's children and it's parent. Specifically this would make text wrapping, and overflow possible (#371). The layout of a parent node depends on the the layout of the children, and the layout of a text node depends on the text-wrap property of the parent.