-
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 calling proxifyContext
with context proxies inside wp-context
#65090
Interactivity API: Prevent calling proxifyContext
with context proxies inside wp-context
#65090
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. |
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.
That makes perfect sense as proxifyContext
already return the proxified version of currentValue.current
👍🏻
I'll give it a round of testing just to be on the safe side.
@vcanales, it's something that we will have to include in the upcoming Gutenberg plugin release.
proxifyContext
over an already-proxified context inside the wp-context
directiveproxifyContext
with context proxies inside wp-context
…roxified context inside the `wp-context` directive (#65090) * Do not store the proxified context inside `currentValue.current`. * Update changelog Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
* Core Data: Fix the 'query._fields' property check inside 'getEntityRecord' resolver (#65079) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> * Site Title, Post Title: Fix typography for blocks with `a` children (#64911) * Apply styles for element + `a` child when present * Inherit styles from parent element when present * Add missing `-font-family` attribute selector * Interactivity API: Prevent calling `proxifyContext` over an already-proxified context inside the `wp-context` directive (#65090) * Do not store the proxified context inside `currentValue.current`. * Update changelog Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org> --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: Rafael Gallani <galani.rafael@gmail.com> Co-authored-by: David Arenas <david.arenas@automattic.com> Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
What?
Fixes a performance regression introduced in #62734, caused by
proxifyContext
being called over an already-proxified context repeatedly, thus increasing the number of proxies around the same context object every time awp-context
directive was rendered.#62734
Why?
The ever-growing number of context proxies was causing the
navigate()
action to become exponentially slower.The following pictures show the performance recording while clicking several times on the Next and Previous links in a Query block, before and after the changes containing the regression (#62734) are applied.
trunk
at c384bb6 (before)trunk
at bd9ba41 (after)How?
The fix prevents assigning to
currentValue.current
the result of callingproxifyContext( currentValue.current, ... )
. This way,proxifyContext()
never receives an already-proxified context as an argument when thewp-context
directive is rendered multiple times.Testing Instructions