-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
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.
if (!invalidate) { | ||
var beforeMeta = before.meta; | ||
var afterMeta = after.meta; | ||
var beforeMetaKeys = beforeMeta ? Object.keys(beforeMeta) : []; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
?
There was a problem hiding this comment.
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.
@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`.
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.