WIP: assign arrays and root-elements directly #89
+158
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)