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

Distinguish section mutations from item mutations #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ivopintodasilva
Copy link
Contributor

Hello 👋

On the original implementation of FlexibleDiff we are considering a section mutation happens when:

  1. A section's metadata has changed;
  2. The items of the sections have changed/moved.

I've forked the library and have been using a slightly different approach where the Changeset only reveals a section mutation when the actual section's metadata has changed, disregarding any changes on the section's items for this purpose.

In my use case, this gives me a direct correlation between the changeset and the updates that I need to perform on a given collection view:

  • I can update a section header only when a section's metadata has changed;
  • When only items have changed I don't need to "refresh" the whole section.

What do you think about this approach?

Thanks for the great work! 😃

@ivopintodasilva ivopintodasilva changed the title Distinguish between section mutations and item mutations Distinguish section mutations from item mutations Jul 5, 2019
@andersio
Copy link
Member

will need to be released as a major version

@andersio
Copy link
Member

andersio commented Feb 10, 2021

/// - precondition: Offsets in `sections.mutations` and `sections.moves` must have a
/// corresponding entry in `mutatedSections` if they represent a
/// mutation.

The precondition here is no longer valid, so it will need to be updated.

Since this has to be released as a API breaking change, I wonder if it is worth dropping SectionedChangeset.sections, and re-introduce the index sets to be top-level field of SectionedChangeset. This then allows us to rename sections.mutations to metadataMutated to make a strong distinction vs mutatedSections (maybe rename to itemMutatedSections).

@ivopintodasilva ivopintodasilva force-pushed the feature/decouple-section-mutations branch from 6028923 to 785aab0 Compare February 20, 2021 10:50
@p4checo
Copy link

p4checo commented Jun 18, 2021

Bumping this 😇

@andersio are you still waiting for changes, or can this work get merged and a new release cut? Thanks! 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants