-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add block binding support #74
Conversation
- Remove unnecessary "global" methods - Use WP_Block_Type_Registry methods to aid in unregistration - Create get_block_registry() method to aid in future mocking
The consumer may have interest in inspecting the binding args, especially
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.
I think this looks and works really well! I especially like the improvements to tests.
There's quite a bit that's changed in the core block rendering implementation, but with our existing test suite and the new ones you've added I'm confident that we're not breaking anything here.
I added some minor comments about comments, but the functionality looks great to me. I'd also like @ingeniumed to have a look soon as well.
@chriszarate The discussion in #74 (comment) made me think about a potential version bump to Are there any changes in this PR or #75 that would justify a version upgrade? It seems like we're mostly adding more data to the response with the original binding data + actual computed binding results, which isn't necessarily a breaking change but could be. What do you think? This would entail some more work to duplicate some tests and separate a second parser class, but it may be an easier path and allow some other minor upgrades like we discussed. |
There aren't any breaking changes to the response shape—no new properties or changes to existing ones. The functional changes (supporting block bindings and synced patterns) reflect the current approach and behavior of the plugin, and just enhance the existing response. Anything can be a surprise of course, but let's use some hypotheticals to guide us. All of these assume we release these two PRs and don't bump to Block bindingsThe effect of block bindings in this plugin is potentially updated string attribute values for specific core blocks when block bindings are in use. There is currently no UI for block bindings in the block editor and very little adoption, so anyone using them must write and deploy code to provide them. If a Block Data API user also uses block bindings, they are certainly aware that they are not supported—and probably frustrated.
Scenarios 1 and 2 are not breaking changes. A breaking change via scenario 3 is possible, but I struggle to imagine a realistic example. Synced patternsAs shown in the PR description, the effect of synced pattern support is a populated Synced patterns do have UI in the block editor, but Block Data API users are almost certainly aware that they are not supported.
Scenarios 1–3 are not breaking changes. A breaking change via scenario 4 is possible but unlikely IMO. In summary, we have some theoretically possible breaking changes for you to consider. If we do add a In addition, we perhaps set a precedent. When this plugin adds support for new core features that alter the content—but not the shape—of the response, are we obligated to add a new version namespace? Perhaps. With enhancements to block bindings and patterns coming, this question will probably come up again. |
@chriszarate Good points. I think we should stick with |
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.
Something minor worth pointing out in our release notes: The order of the attributes has changed in the rest api as well as in the graphQL api. I think it's minor as we shouldn't be worried about that order changing, but just worth noting.
Otherwise, love this! Thanks for working on it @chriszarate
Description
This PR adds support for block bindings, introduced in WordPress 6.5.
The changes here are relatively small, although they are accompanied by some test improvements and cleanup, so the diff is a bit larger than it otherwise would be. Breakdown of commits:
New functionality
Test improvements
No test data was changed in this PR (only ordering).
Additional test cases
No test data was changed, only order.