Skip to content
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

Remove the Equatable requirement on components. #87

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

andersio
Copy link
Contributor

@andersio andersio commented Dec 11, 2018

The notion of component equation is practically meaningless, since interactive components generally involve non-equatable properties.

It might also be confusing if we introduce a notion of layout equivalence to facilitate size caching by default. Note that reappropriating Equatable for layout equivalence is inappropriate, as we would be violating the Equatable contract regarding substitutability.

Changes

  1. Remove the Equatable requirement from Renderable.

    The diff applier now rebinds visible cells/views unconditionally. This is practically what's happening when using Bento with BentoKit, which architecturally encourages users to simply recreate a new instance of reference type components that never equates each other by pointer equality (the default Renderable.== implementation).

  2. Document the formal Bento component contract. (ComponentContract.md)

@andersio andersio added the ready for review Reviewers can now review the PR label Dec 11, 2018
Copy link
Contributor

@mluisbrown mluisbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@andersio andersio merged commit 4b1a58a into master Jan 9, 2019
@andersio andersio deleted the anders/size-cache branch January 9, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Reviewers can now review the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants