Why Yjs server in ts when you can use pycrdt instead ? #1758
Replies: 18 comments
-
|
That looks really cool ! Curious to have your thoughts on this @YousefED |
Beta Was this translation helpful? Give feedback.
-
|
The main problem I see is managing a websocket with django. We have to switch to an ASGI application, use django-channels. To scale you have to use the redis backend and there are many issues open about memory leaks. |
Beta Was this translation helpful? Give feedback.
-
|
Pycrdt can be used with Django, we had a contribution in django_channels_consumer.py. I've never used it myself, but happy to provide support if something is missing. There is also an ASGI server. |
Beta Was this translation helpful? Give feedback.
-
|
It could be interesting for us to compare notes (between the suitenumerique/docs and JupyterLab teams) on usage of YJS for collaborative editing. |
Beta Was this translation helpful? Give feedback.
-
I would check this with Kevin - I feel this is a bit outside of my area of expertise tbh. It could be an interesting option - but it might be quite some work (so imo we'd need a strong reason to switch) |
Beta Was this translation helpful? Give feedback.
-
|
One such reason could be the ability to modify a shared document from Python. In the Jupyter ecosystem this is done e.g. by an AI agent, in which case the backend is just another collaborative peer. |
Beta Was this translation helpful? Give feedback.
-
This makes me think we should probably archive ypy. |
Beta Was this translation helpful? Give feedback.
-
We installed it in docs recently ^^ (See #570) |
Beta Was this translation helpful? Give feedback.
-
Pycrdt is being used quite extensively in Jupyter-Collaboration. |
Beta Was this translation helpful? Give feedback.
-
|
I made the migration from Ypy to pycrdt. If you want to take a look and give me your feedback of what I'm probably doing wrong : #809 The inital idea is to extract from an existing Ydoc (created with Yjs) all the images url contained in. |
Beta Was this translation helpful? Give feedback.
-
|
@davidbrochart @SylvainCorlay Would you be interested to come at the Hackathon the DINUM is organizing in june ? You can take a look at this short presentation here https://docs.numerique.gouv.fr/docs/96b46e7d-e2ec-46c5-ae25-641e34c5ebfe/ |
Beta Was this translation helpful? Give feedback.
-
We would love to participate. Happy to coordinate through other channels if it is relevant. |
Beta Was this translation helpful? Give feedback.
-
|
@SylvainCorlay my understanding is that it is not trivial to move to Python for Ydoc because the server needs to understand the BlockNotejs syntax which is custom (for blocks etc.) |
Beta Was this translation helpful? Give feedback.
-
I don't know if it's BlockNotejs or the Hocuspocus server that adds a layer on top of Yjs's sync protocol. |
Beta Was this translation helpful? Give feedback.
-
If you want to do operations on the document (change it's content) through the BlockNote API, or convert it to / from Markdown / HTML - this is easiest in a Node environment indeed. However, as far as I know, the Hocuspocus server you're using does not do any BlockNote specific processing. There's a separate Node server that covnerts to markdown - but I don't think this is connected directly to the sync server. I think @AntoLC can confirm |
Beta Was this translation helpful? Give feedback.
-
|
Ok so that's the thing : we could replace hocuspocus for collaboration but would still need a nodejs container for document conversion to/from markdown. Might still be interesting for performance, simplicity... especially with the upcoming work on attribution, comments and diffs. |
Beta Was this translation helpful? Give feedback.
-
We would love to. I think there are some really good avenues for collaboration. |
Beta Was this translation helpful? Give feedback.
-
|
@SylvainCorlay @davidbrochart next forum is on the 10th of april. Write to us at [email protected] we'll send you the details to attend :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I just came across this project, it seems very cool!
Looking at the code base quickly, it seems that the server is written in Django but there is a special server for Yjs written in TypeScript. I don't know the motivations for choosing to have a special server in another language, but you may want to look at pycrdt, a Python library providing bindings for Yrs, the Rust port of Yjs. Pycrdt is used for real-time collaboration in JupyterLab.
Beta Was this translation helpful? Give feedback.
All reactions