Open linspw opened 1 year ago
Hey, so this is where it's getting tricky. channels-yroom
exists because ypy (the Python bindings to the Y eco system) do not support xml fragments and are currently not up to date with yrs APIs. I created my own higher-level API for syncing+awareness but exposing YDocs directly was not the goal of the project – that's more tricky and where ypy
should come in.
I have a draft PR for ypy
that upgrades it to a newer yrs
version.
I see two ways forward:
ypy
upgraded and then use that API in the yroom worker. Definitely the long-term solution.channels-yroom
. For that I would need a better description of your use case. E.g. something like:room_manager.add_xml_node_to_room(room_name, document_name, xml_string)
But this is clearly more of an ad-hoc band-aid solution for limited use cases.
Your solution is amazing! When I tried to use YPY directly I saw that some functions were not integrated yet, now I understand.
I will choose to help unlock the update.
My use case:
There are two features I want to do.
First: Update from other languages (HTML, MD and Text) to Tiptap's XML format, for that I'm using internal implementations but I want to send these implementations to the library https://pypi.org/project/tiptapy/ But for that, I want to work on the server side in YDoc to implement this update, when YDoc is loaded.
Second: Take advantage of YDoc synchronization to put other fields in the document, for example: Updated At + Title, and I want to do this on the server side with YPY (updated at)
@stefanw this is basically the other thing that we need to be able to do. I see that the PR against ypy is still open. What are your latest thoughts on this?
I haven't looked into this for some months now as there's no comments or guidance from the maintainers. I'm still learning Rust, so my approach in this PR was more "make it compile" and not "make it elegant", so I'm relying on some pointers if this is going into the right direction.
Cool, thanks. Let me see if I can poke the right people enough to get it moving haha.
Hello Stefan, how are you?
Is there any way to edit YDocs directly instead of using YRoomDocument export?
The purpose of this is to be able to handle YDocs directly the way they are on the server side.