Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(phasor): make yjs as the single of truth #2486

Merged
merged 7 commits into from
May 11, 2023

Conversation

Flrande
Copy link
Member

@Flrande Flrande commented May 10, 2023

Preceding steps for #2441

An element in phasor corresponds to a SurfaceElement and a YElement, the renderer is essentially controlled by the SurfaceElement, and surface.ts implements a two-way binding between the SurfaceElement and the YElement. This creates a lot of code for mutual transformation and synchronization between them which is confusing for readers and difficult for maintenance, and also prone to collaborative bugs, because yjs is not the single of truth in essence.

For this reason, the following refactoring was done, removing YElement from the original code and adding Y.Map field to the SurfaceElement.

@codesandbox
Copy link

codesandbox bot commented May 10, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@vercel
Copy link

vercel bot commented May 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2023 2:28am
blocksuite-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2023 2:28am

@doodlewind doodlewind merged commit d09fcac into toeverything:master May 11, 2023
12 checks passed
@doodlewind
Copy link
Member

Great progress, hope to see more tractions in Phasor!

@Flrande Flrande deleted the refactor/phasor-0510 branch May 11, 2023 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants