by clarkrinker · 2y ago · 0 comments
Biggest problem with yJS for me has been the ergonomics when I use it with React. There’s a third party project called synced store that I used for the stream overlay but it has some strange behavior.
With first party support with React in automerge I think it’s worth a shot for my rewrite
It’s great at first, but woefully underdocumented if you want to use it in a way that doesn’t have off the shelf support, and the code is tough to parse (for me at least). Same with subdocuments.
I wanted to use it with Lexical a while back, and yjs plugin was too tightly coupled too a single data model and was too complicated to DIY.
The best way to manage is starting with a raw empty doc, defind all the keys, then update that with a custom blob.
Once you have this doc on your clients, its just a matter of applying the latest updates.
But yeah, Yjs has an eccentric code structure which is impossible to parse without understanding the ops rrquired.
Id look at indexeddb and webrtc plugins