yjs / yjs-demos

A collection of demos for Yjs
https://demos.yjs.dev
The Unlicense
729 stars 120 forks source link

Example showing how to bind Yjs to existing editor #50

Closed doodlewind closed 2 years ago

doodlewind commented 3 years ago

Currently the getting started docs of Yjs mainly focus on installing and reusing existing Yjs bindings. If one wants to adapt Yjs to an existing in-house editor, I think an example for such "binding developer" can be useful, since for now I believe we mainly take real world projects (like slate-yjs) as reference, and it can be a litter complex for beginners.

Recently I supported multi-user collaboration in our graphics design editor on gaoding.com with Yjs, which works great. This work is started by testing with a new canvas-based toy editor that supports moving, grouping and ungrouping operations, then did I apply its approach to our existing editor (not open source). This toy editor only has about 1000 lines of code, which shows the basic ideas of:

Do you think it worthwhile adding this demo to this repo? I would happy to do some cleanup and provide it if so.

IndexXuan commented 1 year ago

@doodlewind 雪碧哥要不弄个简单开源,学习下 ~