-
Notifications
You must be signed in to change notification settings - Fork 2
Restore experimental support for matching blocks with XPath #22
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR restores experimental support for matching WordPress blocks using XPath queries by reverting the changes from #19 and re-introducing the feature from #18. The implementation adds a new __experimental_xpath parameter to the match_blocks() function that allows complex block queries through XPath syntax.
Key changes:
- Adds
__experimental_xpathparameter to enable XPath-based block matching - Introduces XML serialization/deserialization for blocks using Symfony Serializer
- Includes comprehensive documentation and test coverage for the XPath feature
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/match-blocks.php | Adds XPath query support by serializing blocks to XML and deserializing matched results |
| src/internals/class-block-normalizer.php | Implements normalization/denormalization for individual blocks to/from XML |
| src/internals/class-blocks-normalizer.php | Implements normalization for collections of blocks to XML |
| src/blocks/class-matched-blocks.php | New class that implements Serialized_Blocks interface for matched block collections |
| tests/Unit/MatchBlocksExperimentalXPathTest.php | Test coverage for XPath query functionality |
| tests/Unit/Blocks/MatchedBlocksTest.php | Test coverage for Matched_Blocks class |
| composer.json | Adds dependencies for XML serialization (symfony/serializer, ext-simplexml, wp-type-extensions) |
| README.md | Documents XPath feature usage, limitations, and XML structure |
| CHANGELOG.md | Documents the interface name mismatch in version 4.3.0 |
| .github/workflows/all-pr-tests.yml | Adds PHP 8.4 to the test matrix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reverts #19, restores #18.