-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Labels
enhancement 🌟New feature or requestNew feature or request
Description
Description:
We recently developed @yorkie-js/react to provide React bindings for Yorkie.
Currently, users receive a yorkie.Document via DocumentProvider and treat it as the source of truth(SOT).
However, in many real-world cases, editors(e.g., tldraw, Slate, Quill) maintain their own model as SOT instead of relying directly on yorkie.Document(details: document-editing.md). In such scenarios, the following workflow needs proper support:
External model→yorkie.Document: When local edits occur in the editor, they should be reflected in theyorkie.Document.yorkie.Document→External model: When remote changes occur in theyorkie.Document, the external editor model should be updated accordingly.
At the moment, @yorkie-js/react does not provide a clear interface for this two-way synchronization, which leads to boilerplate and makes integration harder.
Improvement ideas (to be researched further):
- Provide an adapter or binding API that connects an external model with a yorkie.Document.
- Expose hooks (e.g., useDocumentBinding) that encapsulate common synchronization patterns.
- Experiment with migrating the react-tldraw example from @yorkie-js/sdk to @yorkie-js/react to validate this approach.
Next steps:
- Research possible designs for external model bindings.
- Explore trade-offs between flexibility and ease of use.
- Use react-tldraw as a test case for validating the integration pattern.
Why:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancement 🌟New feature or requestNew feature or request