Open SamDuvall opened 3 years ago
I've had a slight change of heart from my initial comment. I really only needed updateYFragment
export from the sync-plugin
.
However, I do think the signature for yDocToProsemirrorJSON
isn't quite right, because I have a use case where my Y.XmlFragment
is not hanging off of the Y.Doc
, which I think is a valid use case. I exported another function yXmlFragmentToProsemirrorJSON
which converts a Y.XmlFragment
to JSON and then had yDocToProsemirrorJSON
use yXmlFragmentToProsemirrorJSON
to preserve backward-compatibility and not add any duplication.
If the
y-prosemirror
utility functions were called from aY.XMLElement
perspective, instead of aY.Doc
with a xmlFragment key perspective, developers could re-use the utility functions to perform Y.XMLElement updates on the server. This would give developers another tool to build documents on a server before they are served to clients.