-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Interactivity API: Prevent unwanted subscriptions to inherited context props #59273
Interactivity API: Prevent unwanted subscriptions to inherited context props #59273
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: -9 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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.
Some nitpicks, good job there!
Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com>
Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com>
Flaky tests detected in 5cf4137. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8005117130
|
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.
LTGM
…t props (#59273) * Add failing test * Fix subscription issue * Fix typo Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> * Change multiline comment to block comment Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> * Update test name Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> --------- Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: c4rl0sbr4v0 <cbravobernal@git.wordpress.org>
I just cherry-picked this PR to the cherry-pick-wp-6-5-beta-3 branch to get it included in the next release: a51059c |
…t props (#59273) * Add failing test * Fix subscription issue * Fix typo Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> * Change multiline comment to block comment Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> * Update test name Co-authored-by: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> --------- Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: c4rl0sbr4v0 <cbravobernal@git.wordpress.org>
What?
Makes directives subscribe to inherited context props only when they don't exist in the current context.
Why?
This prevents unwanted subscriptions to changes in inherited properties that are overwritten in the local context, avoiding potential issues with directives that are executed based on property changes.
How?
Adding a condition when returning the final value. When the property exists in the current context, it is not read from the inherited one, thus preventing the subscription.
I've added a test that reproduces the problem and then fixed the code.