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

Resolve array diffing issues by replacing the diffing algorithm #3

Open
lscheibel opened this issue Feb 11, 2022 · 0 comments
Open

Comments

@lscheibel
Copy link
Owner

Currently differences between arrays are not calculated ideally. For example currently for an array [2, 3] and a new state [1, 2, 3]

[{ op: 'upd', path: 0, val: 1 }, { op: 'upd', path: 1, val: 2 }, { op: 'add', path: 2, val: 3 }]

is returned while the following would be sufficient:

[{ op: 'add', path: 0, val: 1 }]

Unfortunately this appears to be a non-trivial problem, involving the longest common subsequence problem, however other diffing algorithms already exist, which handle this better than "recursive-diff".

@lscheibel lscheibel changed the title Resolve array diffing issues by exchanging the diffing function Resolve array diffing issues by replacing the diffing algorithm Feb 11, 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

1 participant