You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my use case I only need to pass through the XML Fragments to different rich text editors, not mutate or read the rendered contents directly. I have many, and they are nested.
Even after customizing applyPatch to pass-trhough the XML and text YJS objects, immer-yjs calls toJSON on the doc instance, which makes the XMLFragment transform into a string.
Furthermore, this string never gets updated because the text events are never listened to.
The other suggested option is keeping the XML fragment objects outside immer. In this case, do you have any suggestions to make these reactive?
SyncedStore does implement all of this, but the mutable/FRP API is not for everyone.
The text was updated successfully, but these errors were encountered:
immer itself is not very good at supporting custom classes docs . Which basically means for the writing side of the API, we should not expose XMLFragment class directly, instead, we should map XMLFragments to plain json.
Therefore, we have to find a way to identify which part of the "writing side"(inside immer produce) is a standard json and which part isn't (a fragment). This can be done by the applyPatch option. The same goes for "reading side" (get()/subscribe() to return snapshot) but currently there is no way to configure it.
We should probably add an option for that. But this means we need to give up YMap/YArray.toJSON() and implement it by ourself.
We also need an option to customize the applyYEvents() function to handle events come from yjs side and update snapshot accordingly.
In summary, two more options need to be implemented for supporting embeded XMLFragments.
In my use case I only need to pass through the XML Fragments to different rich text editors, not mutate or read the rendered contents directly. I have many, and they are nested.
Even after customizing
applyPatch
to pass-trhough the XML and text YJS objects, immer-yjs callstoJSON
on the doc instance, which makes the XMLFragment transform into a string.Furthermore, this string never gets updated because the text events are never listened to.
The other suggested option is keeping the XML fragment objects outside immer. In this case, do you have any suggestions to make these reactive?
SyncedStore does implement all of this, but the mutable/FRP API is not for everyone.
The text was updated successfully, but these errors were encountered: