This library enables collaborative text editing in Reflect via Yjs.
Live demo at https://type.reflect.net/.
- Awareness: A robust implementation of Yjs "awareness" is included. Awareness is correctly cleaned up in all cases including tab-close, tab/browser-crash, navigation, tab-switch, offline, etc.
- Multiple Documents: A single Reflect room can host any number of Yjs documents efficiently.
- Chunking: Large Yjs documents are automatically broken down into smaller pieces for efficient incremental updates.
- Validation: Easily run custom validation on the server-side to filter profanity, enforce max length, or any other constraint you need.
- Editor Integration Examples: Contains practical examples for
codemirror-yjs
,monaco-yjs
,tiptap-yjs
.
See https://hello.reflect.net/how/text
To explore an example, such as the CodeMirror integration, follow these steps:
-
Clone this repository
git clone [email protected]:rocicorp/reflect-yjs.git cd reflect-yjs
-
Install dependencies
npm install
-
Build the project
npm run build
-
Navigate to the example directory
cd examples/codemirror
-
Start the example
npm run watch
To publish your project with Reflect and deploy the UI:
-
Publish the Reflect server
npx reflect publish
-
Deploy the UI (Example: using Vercel)
npx vercel