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(store): rewrite page event to support partial update #5396

Merged
merged 23 commits into from
Nov 23, 2023
Merged

refactor(store): rewrite page event to support partial update #5396

merged 23 commits into from
Nov 23, 2023

Conversation

Saul-Mirone
Copy link
Collaborator

@Saul-Mirone Saul-Mirone commented Nov 21, 2023

Make it possible to:

page.updateBlock(model, () => {
  model.foo = 'foo';
  model.scope.bar = 'bar';
});

The whole event flow has been rewritten. Previously we use observeDeep to track prop changes in blocks. However, the problem of this flow is that when only part of a prop is changed, it's hard to track it in a top-down pattern.

Currently, we observe the changes in proxy to make it possible to notify changes when some part of the data has been updated.

Copy link

vercel bot commented Nov 21, 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 Nov 23, 2023 11:44am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 23, 2023 11:44am

Copy link
Member

@doodlewind doodlewind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires summary of the API surface update in PR desc 🤔

@Saul-Mirone Saul-Mirone merged commit 1b27b2c into toeverything:master Nov 23, 2023
18 checks passed
@Saul-Mirone Saul-Mirone deleted the rewrite-page-event branch November 23, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable Major improvement worth emphasizing
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants