Repository navigation
Releases: Deln0r/loro-go
Releases · Deln0r/loro-go
Release list
v1.0.0
The first stable release. loro-go is now a full Loro peer: it imports what loro-crdt exports, edits every kind of container, and exports updates that loro-crdt imports, with the bytes loro-crdt 1.17.1 writes for the same edits.
Added
Document, a live Loro peer.ImporttakesFastUpdatesandFastSnapshotblobs and holds changes whose dependencies are missing until they arrive;Commit,CommitWith(message, timestamp),SetRecordTimestampandSetChangeMergeIntervalfollow loro's change rules;ExportUpdateswrites the whole history andJSONgives the state astoJSONdoes. An import is all or nothing and refuses what loro refuses. One mutex guards each document.- Container handles on a
Document:Text(Insert,Delete,Mark,Unmark,Delta, withConfigTextStylefor expand rules),Map,List,MovableList(Move,Set),Tree(Create,CreateAt,Move,Delete,Children,Parent,Meta) andCounter; containers inside containers throughMap.SetContainer,List.InsertContainer,MovableList.InsertContainerandSetContainer; mergeable children throughMap.EnsureMergeable;Document.GetContainerby id. - Versions for sync:
Document.Version,Document.Frontiers,ExportUpdatesFrom(export({mode: "update", from})) andExportUpdatesInRange, withVersionVector.Encode,DecodeVersionVector,EncodeFrontiersandDecodeFrontiersreading and writing loro's bytes. EncodeUpdateswrites decoded changes back asFastUpdates, byte for byte, keeping commit messages, timestamps and block grouping (Updates.Blocks,Change.CommitMsg), and refuses changes that loro would read back differently or refuse.TextDelta, a Text's styled runs as loro'stoDeltagives them, withDeltaOp.- More of the format read: text, list and map deletes, Counter containers, tree node
metamaps, blocks holding several changes, and LZ4-compressed snapshot blocks (encoding/lz4). MergeStateandTextDeltashow containers stored inside other containers at any depth, and mergeable children (loro 1.13 and later) under their parent's key.integration/matrix, a separate module that carries Loro updates as Matrix events, checked against a real Dendrite homeserver in CI.- Fuzz targets for every decoder, the encoder,
Document.Importand version decoding, run briefly on every push and longer each night. VERIFICATION.md, listing what is checked againstloro-crdtand how.
Changed
MergeStatemerges sequences as loro does: an insert's position is resolved against its author's causal past, concurrent inserts are ordered by Fugue, deletes remove what was at their position in the author's view, a MovableList keeps positions and elements apart, and tree moves apply in (lamport, peer) order with cycle-closing moves skipped. It matchesloro-crdton 300 of 300 random histories in each of its corpora.- Fixtures and corpora are generated by
loro-crdt1.17.1 (1.12.5 in v0.1.0). The Fast format is unchanged across those releases; COMPAT.md records each check.
Removed
BuildState.MergeStategives the same state on every historyBuildStatehandled, and merges concurrent ones.DocandNewDoc, the one-change builder.Documentdoes everything it did, checks its input, and writes any number of changes.
Fixed
- A map nested inside a value (a list item, a map value, a style value) named its keys by string where loro names them by index into the block's key arena, so such objects decoded wrongly and
loro-crdtrefused Go blobs holding them. - A duplicate or partly overlapping op is recognised by the whole id range it covers, not by its first id, so a transport that retries or replays does not apply it twice.
- A delete that ran backwards is read from its lowest id, and fractional indexes print in loro's upper-case hex.
- Hostile input: the decoders bound every length, run count and key-arena reference they read, refuse arena indexes past their arenas and container bytes loro does not write, and return an error instead of panicking, hanging or allocating without bound.
Install: go get github.com/Deln0r/loro-go@v1.0.0. Full changelog: CHANGELOG.md.
v0.1.0
First public release.
Pure-Go library for the Loro CRDT wire format, no cgo.
- Decode and encode FastUpdates and FastSnapshot, byte-verified against loro-crdt 1.12.5 and the serde_columnar 0.3.14 crate.
- CRDT state for Map, List, Text, MovableList and Tree; concurrent and multi-peer merge.
- Build documents in Go and export bytes that loro-crdt imports.
See the README for supported features and current limits.