News for hackers. Stuff that matters.
Re:Automerge: A library of data structures for building coll... by 6gvONxR4sf7o on Saturday July 20, 2024 @01:03AM (#41014207)
The big yjs problem for me is the documentation. A few of the most important sections are just “todo” placeholders, like the “how to write a provider” section.

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.

Re:Automerge: A library of data structures for building coll... by cyanydeez on Saturday July 20, 2024 @10:03PM (#41021818)
Yjs has a bootstrap problem. To get ot to sync you need to define the root schema and add data, otherwise updates ignore arbitrary keys.

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

Re:Automerge: A library of data structures for building coll... by 6gvONxR4sf7o on Sunday July 21, 2024 @12:17AM (#41022333)
In my case, my problem was wanting to sync key A’s data to/from Alice, and key B’s to/from both Alice and Bob. It was unclear to me where and when to apply which updates involved in the yjs protocols (which i couldn’t find any documentation on).