Bento
Bento copied to clipboard
Reusability hint to improve reuse performance when composite components are present.
The purpose of this change is pretty much summed up in the documentation for Renderable.makeReusabilityHint(using:)
.
The design is inspired by how Hashable
handles nested hashing.
Do also note that implementing makeReusabilityHint(using:)
does not imply that a composite component no longer needs to handle type mismatch in view hierarchy.
I actually realise when answering Sergey’s questions about walking the hierarchy, that we need to generate the reuse identifier with not only ,
but brackets that indicate containment. Otherwise, A([A([B(), C()])])
would resolve to the same symbol as A([A(), B(), C()])
which has a rather different view hierarchy.
That’s also reiterate the value of closing off custom reuseIdentifier
, because who knows what surprises you could have when you have components from different authors. 👻
Need to think about how this should integrate with #162.