Support for y.js in Java

Hello all,

yjs is a widely adopted network library for the real-time synchronization of collaboratively edited datastructures (CRDT).
It is commonly used to support the real-time features of most maintained editor libraries.

As we are moving away from CKEditor 4, the support for yjs is soon going to be an important feature for XWiki.
Note: we currently use netflux, but afaik we are the only project using this protocol. And, I believe it’s easier to add support for another protocol than it is to adapt an editor to a new real-time protocol.

The easiest option would be to run a third-party server. Many yjs server implementations exist, see Connection Provider | Yjs Docs (e.g., based on websocket or webrtc).
But, while this is the easiest option in terms of development. This makes operating an XWiki instance much more difficult, especially because the new yjs server needs to be accessible from the internet.
We could make it easier by automatically starting a server from a docker container. But, we know many XWiki users have policies that prevent using this option. Therefore, it cannot be the only provided option.

The other option is to use a Java implementation of a yjs connector compatible server. Sadly, to the best of my knowledge, no Java implementations are available.

Looking at the existing servers, the best alternative seems to be a re-implementation of y-websocket-server.
While the implementation seems relatively easy to port in surface, I’m afraid of the hidden complexity pulled from other javascript dependencies.

Thanks