-
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
Core Data: Add the 'getEntitiesConfig' resolver #65871
Conversation
Size Change: +379 B (+0.02%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
This is looking good but it looks like the test failures are probably related. |
Love this! It solves the multiple |
a8f2cc4
to
4bd2045
Compare
Phew, it took me a while to figure out what the problem with I also rebased this PR. |
Flaky tests detected in 384aac1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11587089428
|
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. |
Thank you, @ellatrix! I'll resolve two remaining items on the todo list and land this PR. |
@@ -43,79 +36,6 @@ describe( 'getMethodName', () => { | |||
} ); | |||
} ); | |||
|
|||
describe( 'getKindEntities', () => { |
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.
The getKindEntities
method hasn't existed since #39349.
@jorgefilipecosta, do you have any suggestions on where to restore the The |
@Mamaduka Why not the resolver? In the selector it would be called excessively, no? |
@ellatrix, the resolver only has access to the configs that are dynamically loaded. I assume that
That is precisely why I would like to avoid this if it is doable. |
Ah, I guess maybe adding a weak map check would work then. But we can also check with @youknowriad next week and fix it separately. |
Create a follow-up issue #66594. |
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
What?
Supersedes #61101.
PR introduces a resolver for
getEntitiesConfig
and replacesgetOrLoadEntitiesConfig
with it.Why?
Currently, if two or more components call
getEntityRecod
simultaneously for an entity with the config loaded from the server, theloader
method can make duplicate requests. The resolvers keep track of HTTP requests in progress and avoid hitting the same endpoint multiple times.Based on the usages of
getOrLoadEntitiesConfig
, it seems better to add a resolver for thegetEntitiesConfig
selector.The idea is derived from explorations in #61088.
Todos
getOrLoadEntitiesConfig
leftovers.registerSyncConfigs
. Maybe we can call it inside the selector?Testing Instructions
CI checks should be green.
Testing Instructions for Keyboard
Same.