Closed BrianHung closed 1 year ago
yeah, this sound tough. it might require big refactor.
Two things having looked more into this:
valtio-yjs
with Y.UndoManager
: one yjs undo should undo one batched valtio update instead of undoing single field updates.
Right now, when binding an object that has
n
values, it creates>= n
separate Yjs transactions sincetransact
is called independently. Expected behavior is that binding an object creates only one transaction.From Yjs,
Need to somehow "unroll"
bindProxyAndYMap
andbindProxyAndYArray
such thattransact
is not nested and called multiple times per binding.to
Would require making these two functions iterative instead of recursive (?).