-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Replace registerStore() call with register() in the block-editor store #47447
Conversation
Size Change: 0 B Total Size: 1.31 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@adamziel @ntsekouras I don't think it's possible to switch to I think this PR will introduce a bug that 'Most used blocks' is no longer persisted after reloading the editor. I have tried migrating block usage over to the new preferences API. I need to pick that back up again at some point. I think there's one remaining blocker, which is that the new preferences API calls the REST API for persistence, but doing that on every block insert would be a bit much. I need to come up with a better strategy. |
@talldan the code in registerStore is doing the same thing with what we're doing in register in conjunction with how we handle the creation of store in block-editor. 🤔 The issue your describe will need some investigation, yes. |
If you check out the commit to trunk before this (3dbd681), block usage works correctly, but since this commit it has been broken. While the code for registering looks very similar there must be some subtle difference. @youknowriad would know more. |
yep, this PR should be reverted until we switch the "preferences" persistence to use the new preferences package. The |
Thank you! I'll open a PR to make the changes! |
What?
registerStore()
is deprecated – this PR replaces its last usage in the Gutenberg codebase with the newregister()
function call.Testing Instructions
Confirm the CI checks pass
cc @ntsekouras