-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Bindings: Improve how the context needed by sources is extended in the editor #63513
Block Bindings: Improve how the context needed by sources is extended in the editor #63513
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +3 kB (+0.17%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
7df4050
to
0838beb
Compare
55929a0
to
50cfa09
Compare
e91174b
to
9fcf841
Compare
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.
Aside from the two descriptions for the tests below, this looks good to me 👍 I believe this is good to merge if those are addressed.
What?
Stealing the code from Ella in this other pull request.
This pull request uses the code from #63470 to reuse and merge the
usesContext
defined by the source in the server.There are a few things happening:
usesContext
defined by the source in the server registration.usesContext
property to the client source registration to let sources extend that if needed.Why?
Block bindings shouldn't have to affect the block registration and the context can be accessed just in time.
Apart from that, it should reuse the server definition to avoid duplication in server and client registrations.
Testing Instructions
I added some automated tests to ensure everything works as expected: link.