Skip to content

Discussion on the diff generator #10

@aayushmau5

Description

@aayushmau5

In order to generate the difference between two JSON data, either we can use an existing library or implement our own JSON diffing library, but before we make that decision, I think it's important that we look at some great existing JSON diffing libraries.
If none of them work according to our needs, then can look into implementing our own.

After looking at some most popular as well as some most suitable libraries, I came up with these diffing libraries:

  1. https://github.com/flitbit/diff (deep-diff)
  2. https://github.com/andreyvit/json-diff (diff)
  3. https://github.com/benjamine/jsondiffpatch (jsondiffpatch)
  4. https://github.com/chbrown/rfc6902 (rfc6902)
  5. https://github.com/kpdecker/jsdiff (diff)
  6. https://github.com/Starcounter-Jack/JSON-Patch (fast-json-patch)
  7. https://www.npmjs.com/package/just-diff (just-diff)

After having tried them all, the most suitable library to me was: deep-diff

Reason:

  1. No external dependencies, thus not having to worry about frequently updating the library.
  2. Suitable diff output, this included the type of change, what's the current values, what was the previous one, and the path where the change has been made.

But before we agree on this, we have to make sure that this library is really suitable for us in terms of performance, the output, etc.
Therefore, this issue has been made in order to start a discussion on it. Also, whether we should really go with a ready-made library or make our own.

CC @vinitshahdeo

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions