Bento icon indicating copy to clipboard operation
Bento copied to clipboard

Reusability hint to improve reuse performance when composite components are present.

Open andersio opened this issue 5 years ago • 2 comments

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.

andersio avatar Apr 09 '19 18:04 andersio

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. 👻

andersio avatar Apr 09 '19 19:04 andersio

Need to think about how this should integrate with #162.

andersio avatar May 04 '19 22:05 andersio