Saw on Twitter a new text editor library has emerged.
They have yjs bindings
Saw on Twitter a new text editor library has emerged.
They have yjs bindings
Thanks for sharing
I like the mutable approach of this editor quite a lot. I feel this is a very good match for Yjs.
Got this working after some diving into undocumented code. Here’s an example plugin instantiation:
{/* import { CollaborationPlugin } from "@lexical/react/LexicalCollaborationPlugin"; */}
<CollaborationPlugin
id="test1"
providerFactory={(id, yjsDocMap) => {
const doc = new Y.Doc();
yjsDocMap.set(id, doc);
// const provider = new WebrtcProvider(id, doc);
const provider = new WebsocketProvider(
"ws://localhost:1234",
id,
doc
);
return provider;
}}
shouldBootstrap={true}
/>
Got a PR up to add your example to the lexical docs Add collaboration example with yjs by kdawgwilk · Pull Request #1995 · facebook/lexical · GitHub
Awesome, thank you for the example @rchrd2 and @kdawgwilk for extending the docs