automerge / automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
http://automerge.org/
MIT License
14.75k stars 467 forks source link

Tweaks to data formats #296

Closed ept closed 3 years ago

ept commented 3 years ago

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):

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?