-
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 patterns server side pagination #52396
Conversation
Size Change: +1.03 kB (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
Flaky tests detected in f884bf1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5481911069
|
f884bf1
to
4e70212
Compare
* | ||
* @return array Updated array of arguments for WP_Query. | ||
*/ | ||
function gutenberg_rest_wp_block_query( $args, $request ) { |
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.
This patch adds the ability to pass sync_status
query parameter to the /wp/v2/blocks
api. Allowed values for now are fully
and unsynced
.
// Refetch total pages when `patterns` changes. | ||
// This is not a good indicator of when to refetch the total pages, | ||
// but the only one we have for now. | ||
useEffect( () => { |
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.
This is not fine-tuned. It currently will fire a lot of requests since we're not sure when to fetch this info. A more elegant solution will be baking this into getEntityRecords
somehow. The REST API already supports this by returning the X-Wp-Totalpages
response header. However, getEntityRecords
(and apiFetch
under the hood) doesn't support it yet. It might require multiple levels of coordination across different packages to implement this though.
); | ||
|
||
return ( | ||
<HStack spacing={ 2 } alignment="center"> |
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.
We need to revisit the styling and accessibility 😅.
@@ -39,7 +40,9 @@ export function RouterProvider( { children } ) { | |||
|
|||
useEffect( () => { | |||
return history.listen( ( { location: updatedLocation } ) => { | |||
setLocation( getLocationWithParams( updatedLocation ) ); | |||
startTransition( () => { |
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.
This is not needed. I was just playing with the idea and forgot to delete it 😅 .
What?
Alternative to #52303.
WIP
Why?
WIP
How?
WIP
Testing Instructions
WIP
Testing Instructions for Keyboard
WIP
Screenshots or screencast