-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Xml Types #44
Comments
If the main use case of XML shared types is in rich text editors that interface directly with YJS, then I don't see much value creating a separate valtio API. Just expose the YJS shared type as-is. However, if there is a need to subscribe to XML changes outside the editor then we can design around that use case. |
For us the main issue steams from the xml type being part of a larger doc and therefore deeply nested. I agree that it is possible to work with the yDoc directly, but that means no types and a different way to access things. A situation where you might want to subscribe to the xmlfragment could be something like a markdown editor with a preview. |
I think a good first step then is to add the ability to:
Subtree subscriptions can be considered separately. |
Yes. The access and subscription are the important ones. I haven't even thought about nested subscriptions. |
I don't actually use XmlFragment in my app, so I'll leave that up to you and @dai-shi. I'm just interested in this integration and in the YJS ecosystem in general. |
Problem
One of the main values of valtio-yjs is the ability to have a more natural way to interact with the underlying yjs doc. Currently this only extends to array and map. It would be great to have support for other yjs types as well. Currently these are converted to strings, because that is what the internal
anyXmlFragment.toJSON()
does.Proposal
All the xml types should not be converted internally and be just exposed as they are, because the string is useless for their intended purpose: rich-text-editors. I have a prototype of this working, but the questions are:
The text was updated successfully, but these errors were encountered: