crdt_lf 1.0.0
crdt_lf: ^1.0.0 copied to clipboard
Conflict-free replicated data type (CRDT) - Local-first implementation provided in dart
1.0.0 - 2025-08-18 #
Breaking changes
Create a set of exception classes to be used across the library. Replace StateError with CrdtException and its subclasses.
applyChange: throwsCausallyNotReadyExceptioninstead ofStateErrorwhen a change's dependencies are not met;- On import when a cycle is detected among changes throws
ChangesCycleExceptioninstead ofStateError; - On add node when a node already exists throws
DuplicateNodeExceptioninstead ofStateError; - On add node when a dependency is missing throws
MissingDependencyExceptioninstead ofStateError; - On Fugue tree insertion when a node already exists throws
DuplicateNodeExceptioninstead ofException.
Removed redundant hlc from Change. change.hlc is also available as getter 37
Hlc in version vector is now serialized as string instead of int64. This avoids precision loss when serialized as JSON for web interoperability.
Added #
documentIdtoCRDTDocument, specified document identity to remove ambiguity between peer and document 38toStringtoSnapshotandVersionVector- added a stream to
CRDTDocumentto be notified of every change (changes, snapshots, merges, ...) - added
mutableand method toVersionVectorto create mutable copies - added a export changes method to
CRDTDocumentto export changes that are newer than a given version vector
Changed #
- chore: setup .github/workflows and update coverage links 33
- chore: update readme with recommended approach for complex handler types
- chore: update topological sort implementation 3
- chore: added benchmarks
Fixed #
- Fix
CRDTFugueTextHandlerto ensure state is synchronized before performing operations 39 - Fix readme reference links
- Fix double hlc increment on
CRDTDocument.createChange - Fix snapshot initialization for handlers that return a non primitive value
0.7.0 - 2025-06-14 #
Added #
CRDTDocument.mergeSnapshotto merge a snapshot with the current snapshotCRDTDocument.importto import changes and snapshots with a single method and different strategies
Changed #
- On changes pruning, if a change has a dependency on a pruned change, the dependency is removed to preserve integrity
0.6.1 - 2025-06-02 #
Fixed #
- Fix snapshot initialization for handlers that return a non primitive value