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

Allow diffing/patching of from states. #36

Closed
umesh-timalsina opened this issue Sep 8, 2022 · 1 comment
Closed

Allow diffing/patching of from states. #36

umesh-timalsina opened this issue Sep 8, 2022 · 1 comment

Comments

@umesh-timalsina
Copy link
Contributor

It might be nice to allow diffing/patching using state jsons, which will then be used to compute patches based on certain selectors (as done with GME nodes) and apply updates to the subtree based on diffs. This was originally proposed by @brollb in scm's annotator widget, which then was side-tracked by another idea to compare annotations as flat data structures. However, upon further thought, this makes a lot of sense.

Something like:

Importer.prototype.getDiff = (state1, state2) => {
// ToDo: Implement certain 
}

Importer.prototype.applyDiff = (patches) => {
// ToDo: Handle creation/deletion/updates based on these patches.
}
@brollb
Copy link
Collaborator

brollb commented Sep 9, 2022

Ideally, this will update the internal implementation to use these methods as well. We will also need to make sure to have an optional resolvedSelectors argument for each of the methods so we don't have to re-resolve the ID fields to actual nodes.

umesh-timalsina added a commit that referenced this issue Sep 9, 2022
@brollb brollb closed this as completed in f1b2f70 Sep 20, 2022
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

No branches or pull requests

2 participants