crdt_lf 2.0.0
crdt_lf: ^2.0.0 copied to clipboard
Conflict-free replicated data type (CRDT) - Local-first implementation provided in dart
2.0.0 - 2025-09-16 #
Breaking changes
- Changed
CRDTFugueTextHandler
operations payload
Added #
- Created a set of mixins to be used by handlers to optimize performance during operation insertions.
- Thrown
HandlerAlreadyRegisteredException
when a handler is registered twice - Added
TransactionManager
to manage transactional batching of notifications and local changes emission 43 - Added
compound
"system" to compact consecutive operations during transaction 45 - Added
CRDTORSetHandler
42
Changed #
- On
importChanges
listeners ofupdates
are notified only one times at import end Handlers
now not invalidate cache when an operation is applied due to the new mixins system. This greatly improves the computation of the handler value as it is persisted much more often.- chore: improved handlers benchmark system
Fixed #
CRDTMapHandler
updating an absent key is ignored
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
: throwsCausallyNotReadyException
instead ofStateError
when a change's dependencies are not met;- On import when a cycle is detected among changes throws
ChangesCycleException
instead ofStateError
; - On add node when a node already exists throws
DuplicateNodeException
instead ofStateError
; - On add node when a dependency is missing throws
MissingDependencyException
instead ofStateError
; - On Fugue tree insertion when a node already exists throws
DuplicateNodeException
instead 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 #
documentId
toCRDTDocument
, specified document identity to remove ambiguity between peer and document 38toString
toSnapshot
andVersionVector
- added a stream to
CRDTDocument
to be notified of every change (changes, snapshots, merges, ...) - added
mutable
and method toVersionVector
to create mutable copies - added a export changes method to
CRDTDocument
to 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
CRDTFugueTextHandler
to 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.mergeSnapshot
to merge a snapshot with the current snapshotCRDTDocument.import
to 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