Skip to content

Releases: Deln0r/loro-go

Release list

v1.0.0

Choose a tag to compare

@Deln0r Deln0r released this 28 Oct 11:15

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. Import takes FastUpdates and FastSnapshot blobs and holds changes whose dependencies are missing until they arrive; Commit, CommitWith (message, timestamp), SetRecordTimestamp and SetChangeMergeInterval follow loro's change rules; ExportUpdates writes the whole history and JSON gives the state as toJSON does. 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, with ConfigTextStyle for expand rules), Map, List, MovableList (Move, Set), Tree (Create, CreateAt, Move, Delete, Children, Parent, Meta) and Counter; containers inside containers through Map.SetContainer, List.InsertContainer, MovableList.InsertContainer and SetContainer; mergeable children through Map.EnsureMergeable; Document.GetContainer by id.
  • Versions for sync: Document.Version, Document.Frontiers, ExportUpdatesFrom (export({mode: "update", from})) and ExportUpdatesInRange, with VersionVector.Encode, DecodeVersionVector, EncodeFrontiers and DecodeFrontiers reading and writing loro's bytes.
  • EncodeUpdates writes decoded changes back as FastUpdates, 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's toDelta gives them, with DeltaOp.
  • More of the format read: text, list and map deletes, Counter containers, tree node meta maps, blocks holding several changes, and LZ4-compressed snapshot blocks (encoding/lz4).
  • MergeState and TextDelta show 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.Import and version decoding, run briefly on every push and longer each night.
  • VERIFICATION.md, listing what is checked against loro-crdt and how.

Changed

  • MergeState merges 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 matches loro-crdt on 300 of 300 random histories in each of its corpora.
  • Fixtures and corpora are generated by loro-crdt 1.17.1 (1.12.5 in v0.1.0). The Fast format is unchanged across those releases; COMPAT.md records each check.

Removed

  • BuildState. MergeState gives the same state on every history BuildState handled, and merges concurrent ones.
  • Doc and NewDoc, the one-change builder. Document does 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-crdt refused 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

Choose a tag to compare

@Deln0r Deln0r released this 07 Jun 10:50

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.