-
Notifications
You must be signed in to change notification settings - Fork 4.6k
iAPI: Fix derived state closures processing on client-side navigation #72725
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
iAPI: Fix derived state closures processing on client-side navigation #72725
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @dmytroklingit. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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: +24 B (0%) Total Size: 2.37 MB
ℹ️ View Unchanged
|
luisherranz
left a comment
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.
LGTM! Thanks David.
…#72725) * Fix PHP warning * Add failing test * Do not evaluate getters during derivedStateClosures processing * Simplify check * Add changelog entry * Fix PHPCS errors Unlinked contributors: dmytroklingit. Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: 4a55ad8 |
|
There was a conflict while trying to cherry-pick the commit to the wp/6.9 branch. Please resolve the conflict manually and create a PR to the wp/6.9 branch. PRs to wp/6.9 are similar to PRs to trunk, but you should base your PR on the wp/6.9 branch instead of trunk. |
|
@luisherranz it seems re-adding the label triggered the cherry-picking again, when it was already backported on the 6.9 branch, so don't worry about it 👍 |
|
Sorry, my bad. I thought we added |
What?
Closes #72624
Fixes a bug introduced in #71125 that causes issues during client-side navigations.
The bug occurs when an Accordion block is placed in a template with a Query block that has the "Full page reload" option disabled.
The error happens along the lines below. State getters are being evaluated there, but they shouldn't. The code only needs to know if a given property is a getter, not the value it returns.
gutenberg/packages/interactivity/src/store.ts
Lines 314 to 324 in dc3472a
Why?
Client navigation is broken right now when the Accordion block is in place. The same would happen for third-party blocks using derived-state closures.
How?
The solution prevents state getters from being evaluated during
derivedStateClosuresprocessing.Testing Instructions