Skip to content

Differences in user-meta can trigger changes #17

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

Merged
merged 5 commits into from
Jun 9, 2016

Conversation

hjdivad
Copy link
Collaborator

@hjdivad hjdivad commented Jun 8, 2016

This is primarily useful to support linking directories, and in particular to handle the case of a previously copied directory changing to a linked directory (or vice-versa), as can happen in broccolijs/broccoli-merge-trees when a directory initially exists in multiple input paths, but during a rebuild exists in exactly one input path.

hjdivad added 2 commits June 8, 2016 12:18
This is primarily useful to support linking directories, and in particular to
handle the case of a previously copied directory changing to a linked directory
(or vice-versa), as can happen in broccolijs/broccoli-merge-trees when a
directory initially exists in multiple input paths, but during a rebuild exists
in exactly one input path.
@hjdivad
Copy link
Collaborator Author

hjdivad commented Jun 8, 2016

cc @stefanpenner @chadhietala

if (!invalidate) {
var beforeMeta = before.meta;
var afterMeta = after.meta;
var beforeMetaKeys = beforeMeta ? Object.keys(beforeMeta) : [];
Copy link
Owner

@stefanpenner stefanpenner Jun 8, 2016

Choose a reason for hiding this comment

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

key order isn't stable, this would need to be sorted

Copy link
Owner

Choose a reason for hiding this comment

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

Thoughts on maybe delegate comparison to the entry itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@stefanpenner key order doesn't need to be stable: we check length and then we pick one arbitrarily (beforeMeta) and use its order

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@stefanpenner delegating comparison seems fine. Should we just mandate that entry objects support equals(otherEntry)?

Copy link
Owner

Choose a reason for hiding this comment

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

@stefanpenner key order doesn't need to be stable: we check length and then we pick one arbitrarily (beforeMeta) and use its order

ah, yes

@stefanpenner delegating comparison seems fine. Should we just mandate that entry objects support equals(otherEntry)?

it's at-least worth evaluating.

@hjdivad
Copy link
Collaborator Author

hjdivad commented Jun 8, 2016

@stefanpenner see a6f8167

thoughts?

Instead of users providing an `Entry` with a custom `isEqual` function,
 a custom `isEqual` can optionally be passed as the second argument to
 `calculatePatch`.
@stefanpenner stefanpenner merged commit b16ee6f into master Jun 9, 2016
@stefanpenner stefanpenner deleted the treat-user-meta-diff-as-updates branch June 9, 2016 04:03
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.

2 participants