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.