๐ค Yjs Collaborative Demo
Yjs Collaborative Demo
This page demonstrates real-time collaborative editing using Yjs (Yet Another JSON) CRDT library. Multiple users can edit the same document simultaneously, and all changes are automatically merged and synchronized across all connected clients.
How It Works
- Yjs Document: Each client maintains a local Yjs document that automatically merges changes from other clients
- Server-Sent Events: Real-time updates are delivered via SSE (no WebSockets required)
- Change Broadcasting: Local changes are sent to the DocProviderDO and broadcast to all connected clients
- Conflict Resolution: Yjs automatically handles concurrent edits using CRDT operations
- Document Synchronization: New clients receive full document state, existing clients get incremental updates
Features Demonstrated
- Real-time Collaboration: Multiple users can edit simultaneously
- Conflict-free Updates: Yjs CRDT ensures all edits merge correctly
- Connection Management: Handles reconnects and state synchronization
- Debug Tools: Inspect document state and simulate changes
- Client Tracking: Shows number of connected collaborators
Open this page in multiple browser tabs or share the URL with others to test collaborative editing!