-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Interactivity API: Fix SSR context included in void tags shouldn't propagate to following elements #6267
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
Closed
SantosGuillamot
wants to merge
12
commits into
WordPress:trunk
from
SantosGuillamot:fix/ssr-context-propagate-in-void-tags
Closed
Interactivity API: Fix SSR context included in void tags shouldn't propagate to following elements #6267
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5613ba6
Add test to cover void tags context
SantosGuillamot cb5ba25
Add potential solution to void tags
SantosGuillamot 4122ba4
Use more general approach
SantosGuillamot 19a9afe
Change cover annotation
SantosGuillamot 34ee1dc
Revert "Use more general approach"
SantosGuillamot 09cc147
Only process directives when is not a closing tag
SantosGuillamot ba79dec
Revert "Only process directives when is not a closing tag"
SantosGuillamot f2e3336
Revert "Revert "Use more general approach""
SantosGuillamot 01ae241
Use two different modes "enter" and "exit"
SantosGuillamot 86bf0fb
Add test for namespace in void tags
SantosGuillamot 8c90ece
Add string mode annotation in params
SantosGuillamot 3975be1
Change `data-wp-interactive` comment
SantosGuillamot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Use more general approach"
This reverts commit 4122ba4.
- Loading branch information
commit 34ee1dc2e65a021fa5a802ffbcca56fd31b60f77
There are no files selected for viewing
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
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.
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 believe that this is a surprise way to handle this based on how the directive handlers work. that is, they all handle their own cleanup, except now the specific context directive is coupled into the general directive dispatch.
cc: @ockham
what I think could work more generally is to do two things:
is_closing_tag()and using HTML semantics, they check something different, such as'enter'or'exit', representing whether the code is entering or existing a directive's scopethis implies of course that this function would then pass in that action to the directive handlers.
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 believe it makes sense to use a more general mechanism and not something hardcoded for the context.
I implemented a different solution based on your feedback in this commit. For void tags or special elements, it runs the directives in both orders.
It seems to be working fine, but I'd love to know if that's what you had in mind.
By the way, I am not convinced about the variable name
$is_exiting_tag. I can easily changed that if we pursue this approach.Uh oh!
There was an error while loading. Please reload this page.
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 agree this is a better solution, but I wouldn't mind to include this fix in 6.5 as it is, and work on this improvement for a future version because everything in this logic is still private and subject to change 🙂
Up to you!
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.
01ae241 - exercises
entervsexitmode.