-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Introduce 'getEntityConfig' resolver #61101
Conversation
Size Change: +341 B (+0.02%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
a5b1179
to
a6d68c1
Compare
@jsnajdr, @youknowriad, this is still in progress, but I would appreciate early feedback when you have time. I might have an alternative solution for the last to-do item - |
Would you mind expanding a bit on the reasoning to clarify the purpose of this PR for everyone. On the change itself, it seems reasonable at first sight. |
Sorry about that. I've updated the Why section of the PR description. |
a6d68c1
to
e526e92
Compare
Closing in favor of #65871. |
What?
PR introduces a resolver for
getEntityConfig
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 thegetEntityConfig
selector.The idea is derived from explorations in #61088.
Todos
getOrLoadEntitiesConfig
leftovers.registerSyncConfigs
. Maybe we can call it inside the selector?getEntityConfig( 'postType', 'page' )
whilegetEntityConfig( 'postType', 'post' )
is resolving and shouldn't trigger another request. ThecanUser
resolve has a similar logic. However, I might need to updatehasStartedResolution
to support "wildcard" args.How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast