YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.69k stars 51 forks source link

WIP: assign arrays and root-elements directly #89

Open bigmistqke opened 1 year ago

bigmistqke commented 1 year ago

This is a WIP for enabling the direct assignment of arrays and root-elements. The intent is to remove some of the friction when using SyncedStore, make it behave more like a regular store and less Yjs-related.

A reconcile-function takes entered state, diffs it with the previous state and turns it into a series of granular operations: only changed values are updated.

I have been playing around with it today and I covered some edge-cases already:

but I am sure there are more edge cases to be found. only tested locally, with solid as framework.

current 'leaks' from yjs still present: it will error if you try to assign p.ex an object to a root-element which has earlier been defined as an array. all the other data's shapes can be changed.

(based on my solid-edits because I am using solid to test. can be rebased if necessary)

nadilas commented 1 year ago

How can we help to move this along?