Hi! I’m very new to Yjs, but am a long time OT/CRDT armchair enthusiast and have used ShareDB in production for a few years. I’ve spent a couple evenings playing around with Yjs and wow: it looks amazing!
I have a couple questions about transactions:
Do Yjs transactions (
doc.transact(...)) apply the inner operations atomically? I’ve been working on a shared-state library (totally unrelated to Yjs) based on Redux which transmits actions, and one advantage I perceive of that approach is that each Redux action is applied (or not) atomically, regardless of how complicated it is, even under reordering. This is nice to help attempt preserve user intent on actions which modify several parts of the state. But, it looks like Yjs transactions may provide this behavior too? I think so… but wanted to confirm that this is the actual intent, not just an optimization on the number of messages sent and number of observer calls. (One of these evenings I’ll settle in and watch the 3 hour internals video… not yet though )
Another nice aspect of Redux actions is that logging the action history is a developer-friendly tool for debugging and support. I see that Yjs transactions support an
originmetadata field. Is there a way one might also provide some kind of label or other arbitrary k/v set on a transaction that exists solely for logging/observability?
Thanks for any pointers!