-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Composite: fix legacy implementation passing store prop #65821
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
Conversation
tyxla
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.
Tests well and code LGTM 👍 🚀 Thanks!
Just left a minor suggestion I made across all components about simplifying the code a bit.
|
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. |
3a4e49c to
41ab175
Compare
|
Hey @tyxla , I applied your suggestion , improved comments, and also applied the same fix to the top-level |
|
Flaky tests detected in 41ab175. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11144041957
|
|
I tested on my machine and feel confident about the latest set of changes. Will merge once CI checks pass |
|
Yep, I can confirm the fix works as expected 👍 |
) * Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
…Press#65821)" This reverts commit 7f08622.
* Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
|
There was a conflict while trying to cherry-pick the commit to the wp/6.7 branch. Please resolve the conflict manually and create a PR to the wp/6.7 branch. PRs to wp/6.7 are similar to PRs to trunk, but you should base your PR on the wp/6.7 branch instead of trunk. |
* Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
* Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
* Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]>
* Composite: fix legacy implementation passing store prop * Simplify code * Improve comment * Apply same fix to the top level Composite too * CHANGELOG --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]> Co-authored-by: tyxla <[email protected]>
What?
Extracted from #65720
Fix internal implementation of
Compositeto make it work better with legacy usagesWhy?
This fixes a big that could cause
Compositeto stop working as expected when used via its legacy, unstable exportsHow?
By explicitly grabbing the
storeprop and explicitly prioritizing it against the store read from internal context.This is necessary because of how the legacy implementation of
Compositeworks, which allows folks to pass astateprop to the old version of the component, which we needed to "translate" to passing astoreprop in our legacy compat layer.Testing Instructions
Composite.Itemthat relies on thestorelogic (like the one applied in Composite: make items tabbable if active element gets removed #65720). Ontrunk, the change has a chance to break theCompositeItemlegacy component, because it's not using the rightstore. This PR makes sure that, if the legacy implementation is passing astorevia props, that store will be used instead.