Releases: composablesys/collabs
v0.9.1
- Clarify which iterators are safe under concurrent modification.
- List CRDTs (which are not safe) will attempt to throw an error if they detect it
- Doc updates: initial values, undo/redo
- Benchmark updates
Alpha software; API subject to change.
v0.9.0
Major:
- Rewrites
CRuntime.load
and all CRDTs'load
functions to allow loading at any time. If there is already a non-trivial state, the loaded state is merged with that one, in the style of state-based CRDTs. load
functions now emit events describing their changes (including incremental changes during merging). This eliminates the need for special cases to refresh the display after loading.
Minor API changes:
- Add
Position
type (alias for string) to IList. - Remove
info
inCRuntime.transact
. Instead, apps should use their own CMessenger. CRuntime
events: remove Load, instead emitting Transaction. Also removeisLoaded
.- CRDT meta: replace
vectorClockGet
withvectorClock
interface; inCollab.load
, use typeCRDTSavedStateMeta
instead ofCRDTMessageMeta
. - Remove option to return
null
fromCollab.save
. Also, add option to passnull
toCollab.load
, but with a different meaning from before (tied toCollab.canGC
).
Minor behavior changes:
CSet.add
is now a pure CRDT operation, hence can be used withRunLocallyLayer
.CSet.fromID
will remember deleted values (hence return non-undefined) until the end of the current Transaction. This avoids surprises where you try to reference a just-deleted value in an event handler (e.g., see the comments inCMap
's internal event handlers).- Deduplicate messages in
CausalMessageBuffer
.
Other:
- Collab tests for most concurrent ops, merging, and events.
- Add Istanbul code coverage checker to the crdts package. Run with
npm run coverage
.
Alpha software - API subject to change.
v0.8.1
- Revise all typedocs (class/method headers) in @collabs/core and @collabs/crdts, plus the commonly-used types in other packages. These should now be fully documented.
- Add
AbstractDoc
advice and an example to the Guide. - Add some more exports to @collabs/collabs so that its typedocs are self-contained.
Alpha software - API subject to change.
v0.8.0
Refactor of core, crdts, and collabs packages to simplify the library and (hopefully) reduce learning curve.
Major
- Simplify naming scheme for Collabs: the main CRDTs now have names like "CVar" or "CValueSet". Alternate semantics are either options on the main CRDTs or deleted.
- Reduce "C*" names to avoid cluttering Collabs. (Interfaces -> I, e.g., CMap -> IMap; events & events records drop the C, e.g., CSetEvent -> SetEvent.)
- In the collabs package, only re-export the "commonly-used" exports. For advanced use cases, import other stuff from core or crdts directly.
- Rename
CObject.addChild
->CObject.registerCollab
, so that it is the same asCRuntime
. AbstractDoc
that you can extend to wrap yourCRuntime
and top-level Collabs. This lets you carry them around in one var, like aY.Doc
.- Replace "batching" with "transactions" (
CRuntime.transact
method, CRuntime "Transaction" event). - Remove context and "generic" MessageMeta, which I found confusing & not very type seafe. Instead, there is UpdateMeta; its
runtimeExtra
property can be extended by the Runtime, but not by other ancestors. - CollabIDs: instead of make/get from CollabID class, use
Parent.fromID
andParent.idOf
(which replacegetNamePath
/getDescendant
). Also, they're now JSON-serializable. - Make IList "positions" more useful, and remove the
CCursor
wrapper (instead, use positions directly).
Minor
- Remove less useful serializers.
- Namespace some utility functions with static classes or singletons.
- Change load/save type - instead of serializing all children immediately, parents can pass this responsibility to the Runtime (see
SavedStateTreeSerializer
). - Add
CConst
. - Redo AbstractSet, etc. in a way that appears to be working type-wise. (Basically: give up on TS mixins, just use JS mixins and type them manually.)
- Add
Collab.finalize
method. This avoids needing every CSet user to expose a "ValueDelete" event. - Rewrite
CRuntime
. It is now a simplified "flat" implementation, instead of several layers with confusing interactions. - Rewrite CText to use a CValueList internally, instead of re-implementing it.
- Move the benchmark text trace into a JSON file instead of JS, so Github doesn't show us as a "majority JS" project.
- Misc cleanup (e.g., all Collabs take an options object instead of misc optional constructor params).
Alpha software - API subject to change.
v0.7.0
- Removed unused/low-priority methods and types
- Removed
Pre
type and helper. Instead, use callbacks directly, as shown in the docs. - Misc bug fixes in demos
- Added
MultiValueMap
, a new base implementation for register- and map-type CRDTs. This should be more memory efficient than using aLazyMutCMap
mapping to a separate register per value.
Alpha software - API subject to change.
v0.6.1
- Docs website (https://collabs.readthedocs.io/en/latest/), built from docs/ folder
- Typedoc improvements
Alpha software - API subject to change.
v0.6.0
- Removed
CollabSerializer
; useCollabIDSerializer
instead. - Fixed load bug in
AddWinsCSet
,ArchivingMutC…
, andLWWMutCRegister
caused byCollabSerializer
. - Added option to pass
null
toRunLocallyLayer.runLocally
instead of an existingMessageMeta
, to perform the operation as if it was initiated locally.
Alpha software - API subject to change.
v0.5.1
v0.5.0
Misc cleanup and reorganization (#216).
Breaking changes:
- Remove "Resettable" concept, except for ResettableCCounter (previously CCounter; now that it is a simple non-resettable counter).
- Add CollabID to replace Collab serialization in DefaultSerializer (which now gives an informative error). This avoids a bug where deserializing a deleted Collab (e.g. due to a concurrent delete) raises an error that can't be worked around.
- receiveInternal -> receive
- CRegister -> CVariable
- Tombstone -> Archiving
Package reorganization:
- Split @collabs/collabs into @collabs/core and @collabs/crdts. @collabs/collabs is retained as a package that re-exports both of them, so it should be backwards-compatible.
Alpha software - API subject to change.
v0.4.0
- Optimizations, most for networking (message size) #213
Breaking API changes:
- Instead of using
Uint8Array | string
as the de facto message type, there is now a typeMessage = Uint8Array | string | SerializableMessage
. HereSerializableMessage
is a new interface that represents a message that is not serialized until it needs to be (i.e., at the end of the current batch), possibly mutating in the meantime. Used by CRTMetaLayer to handle incremental requests and VC increments caused by received messages. - CRDTExtraMeta -> CRDTMeta, likewise for similar names.
- CRDTMeta: You now have to specifically "request" metadata that you want sent; otherwise it might be null or inaccurate. The easiest way to do this is through the
requests
argument toPrimitiveCRDT.sendCRDT
. For most use cases (including all of our built-in non-experimental CRDTs), requesting{ automatic: true }
should suffice, but it requires careful consideration. CRDTMeta.senderCounter
no longer changes within transactions; instead, all messages within a transaction get exactly identical (===
)CRDTMeta
.
The only API change that might plausibly affect someone is the new Message
type, which you'll have to use if you have a custom Collab (just replace Uint8Array | string
with Message
and continue casting messages to the actual type you sent).
Alpha software - API subject to change.