benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.83k stars 471 forks source link

Add doc explaning delta syntax to readme #14

Closed deinspanjer closed 11 years ago

deinspanjer commented 11 years ago

Please consider taking the text in this other issue's comment and putting it in the readme. It is exactly what I was looking for.

https://github.com/benjamine/JsonDiffPatch/issues/12#issuecomment-14426436

benjamine commented 11 years ago

Agreed. I'll put it out of the README though, but definitely some docs are needed.

drpepper commented 11 years ago

That would be interesting for me too... I'm trying to see if there is an easy way to detect conflicts between multiple patches.

johanfforsberg commented 11 years ago

Is there any particular reason this library does not use the "JSON Patch" standard (http://tools.ietf.org/html/rfc6902)? It might make the patches more compatible with other libraries.

benjamine commented 11 years ago

@johanfforsberg there's no particular reason, I wasn't aware of the existence of that format when I created this lib (based on that page it seems that's from april 2013, so it didn't exist when I created jsondiffpatch), but it's a great idea.

my main goals when designing the jsondiffpatch format were:

At a quick glance, I'm not sure the 2nd goal was pursued with JSON Patch, but it's just my first impression.

Nevertheless, standards are always welcome. So the main blocks I see are:

johanfforsberg commented 11 years ago

You are right, JSON Patch is very new as a standard. I was mostly curious if you had any technical reasons to not go with it, i.e. some particular shortcomings. I personally find JSON Patches readable, but it does have quite some overhead of the changes themselves are small.

I've found several JSON Patch implementations, but none that was as well suited to my needs as JsonDiffPatch, and for my use it does not matter very much what internal format is used.

(I guess this discussion has left the topic of the original issue, though. Perhaps best to create a new issue about JSON Patch?)

benjamine commented 11 years ago

yes that sounds good, thanks!