json_diff_ex icon indicating copy to clipboard operation
json_diff_ex copied to clipboard

Add string diff support

Open tmbb opened this issue 8 years ago • 3 comments

I might submit a PR handling this one of these days, if you're interested.

tmbb avatar Sep 19 '17 16:09 tmbb

I'm definitely interested, it's just been a nice to have but for anybody that needs it I think they would be thankful.

I really need to write a contributor's guide, the most important thing at the moment is keeping good enough compatibility with jsondiffpatch. Good enough because sometimes there are better ways of doing some of the diffs that will still translate into the same outcomes when using the library for patching.

My most recent PR focused on lists and I switched to using a built in function for that. I know that most string diffs are similar to lists.

olafura avatar Sep 19 '17 17:09 olafura

String diffs are supported by jsonpatchdiff: https://github.com/benjamine/jsondiffpatch#live-demo, so I think we can support it too. I'm still not sure whether I actually need JSON diffs for my project, so I'm not sure I'll actually work on the PR.

tmbb avatar Sep 19 '17 17:09 tmbb

@tmbb No problem, I'm not using this library for work either. I did have ideas of using it for my company I worked for because we were dealing with a really big and nasty json structure and json diff works really well with those. It's sort of like when dealing with legacy databases. You usually don't want to use these kinds of techniques unless you have to :smile:

There might be a killer feature for this library, maybe I could look into doing it for the graphql queries we are doing, who knows.

olafura avatar Sep 23 '17 17:09 olafura