This repository was archived by the owner on Jul 28, 2023. It is now read-only.
SSR: Add basic directive processor#169
Merged
ockham merged 20 commits intomain-wp-directives-pluginfrom Mar 15, 2023
Merged
Conversation
ockham
commented
Mar 6, 2023
9f0c237 to
bbc790f
Compare
adamziel
reviewed
Mar 8, 2023
The directive processor builds on the HTML Tag Processor to provide additional functionality, assuming normative markup generated from React, assuming that all tag directives contain a balanced closer. This will break in practice, and is probably entirely wrong as-is. The purpose of this commit is to introduce the idea and explore using the code to get a feel for whether it will work.
This reverts commit bbc790f.
5457d8b to
054c579
Compare
ockham
commented
Mar 14, 2023
| @@ -0,0 +1,155 @@ | |||
| <?php | |||
|
|
|||
| class WP_Directive_Processor extends WP_HTML_Tag_Processor { | |||
Collaborator
Author
There was a problem hiding this comment.
#156 also had some more directive-specific logic (such as a next_directive method) that I removed. The reason is that it’ll need some more work where we’d need to move some of the logic that’s currently in wp_process_directives into this class. This isn’t currently a priority, so I’ve opted to defer it.
As a consequence however, WP_Directive_Processor doesn’t have any directive-specific code at all — it’s really more of a WP_HTML_Tag_Processor-derived class that allows finding a balanced closing tag, and getting/setting inner HTML. It might thus be worth considering renaming that class.
Collaborator
Author
luisherranz
approved these changes
Mar 14, 2023
Member
luisherranz
left a comment
There was a problem hiding this comment.
This looks great to me, Bernie! 🎉
Collaborator
Author
|
Thanks you very much, Luis! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP. This is basically a copy of @dmsnell's #158 for now, which I've forked per this comment.
I've removed @adamziel's
get_outer_htmlandset_outer_htmlcommit for now since we might not actually need it 😊