This PR makes a bunch of small, but breaking changes to the data formats (both binary and JSON representation). The intention is to clean up a bunch of minor annoyances, and to get our breaking changes out of the way now before we make commitments to the data formats we will support long-term.
Brief summary of the changes made (see the commit messages for details):
Use the string '_root' instead of the all-zeros UUID in changes and patches (10ec271cbd66955390cd5c0b3ab22def76302f44)
On operations that change a list or text object, use the property elemId instead of the property key to identify the list element being updated (6fa8b5a5b9bbfb178750c629fc6107b30b9c35a3)
Reorder some of the fields in the binary encoding to make it easier and faster to parse (7d9adb4807441448c5d61f3884ca93f670f62292, d7f97c5387e2388d3fbc850f53513ebe7b808f8d)
Allow a change to include arbitrary uninterpreted binary data, giving us a mechanism for future extensions to the data format without breaking compatibility (7f2e9f4897a420ca6ebd36421e935dc09484d1d4)
I have also tried to make the corresponding changes in the Rust implementation, for which I have put up a separate PR: automerge/automerge-rs#37. I also added some tests to check interoperability between the JS implementation and the Wasm backend compiled from Rust (3fef7e2a6945cfaff8687ed3e339dba17c911efc).
With these changes out of the way, I have no further changes to the binary format planned before 1.0. For the frontend/backend protocol I still have a few more changes in mind (e.g. compress runs of consecutive insertions or deletions in text, to improve the efficiency of inserting and deleting large chunks of text) but we can do that on a separate PR.
This PR makes a bunch of small, but breaking changes to the data formats (both binary and JSON representation). The intention is to clean up a bunch of minor annoyances, and to get our breaking changes out of the way now before we make commitments to the data formats we will support long-term.
Brief summary of the changes made (see the commit messages for details):
'_root'
instead of the all-zeros UUID in changes and patches (10ec271cbd66955390cd5c0b3ab22def76302f44)elemId
instead of the propertykey
to identify the list element being updated (6fa8b5a5b9bbfb178750c629fc6107b30b9c35a3)I have also tried to make the corresponding changes in the Rust implementation, for which I have put up a separate PR: automerge/automerge-rs#37. I also added some tests to check interoperability between the JS implementation and the Wasm backend compiled from Rust (3fef7e2a6945cfaff8687ed3e339dba17c911efc).
With these changes out of the way, I have no further changes to the binary format planned before 1.0. For the frontend/backend protocol I still have a few more changes in mind (e.g. compress runs of consecutive insertions or deletions in text, to improve the efficiency of inserting and deleting large chunks of text) but we can do that on a separate PR.
@orionz can you take a look please?