remirror / remirror

ProseMirror toolkit for React 🎉
https://remirror.io
MIT License
2.66k stars 233 forks source link

Support multiple yjs providers #1251

Open ronnyroeller opened 2 years ago

ronnyroeller commented 2 years ago

Description

yjs allows to connect multiple providers. From yjs docu: Any of the Yjs providers can be combined with each other. So you can sync data over different network technologies.

Yet, Remirror's yjs-extension allows currently only for exactly one provider.

Context

The yjs docu states one use case: In most cases you want to use a network provider (like y-websocket or y-webrtc) in combination with a persistence provider (y-indexeddb in the browser). Persistence allows you to load the document faster and to persist data that is created while offline.

Another use case is to combine y-websocket and y-webrtc provider to allow for fast (webrtc) and reliable (websocket) collaboration.

aniketbiprojit commented 1 year ago

Hi, we have a use case for this. Could you point out what the changes would be required for this so that we can take this up?

ronnyroeller commented 1 year ago

Unfortunately, I can't tell you in detail. But this is the extension that has the assumption that there is only one provider: https://github.com/remirror/remirror/blob/main/packages/remirror__extension-yjs/src/yjs-extension.ts