-
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
Interactivity API: merge new server-side rendered context on client-side navigation #53853
Conversation
Size Change: +37 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Flaky tests detected in b712137. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5936013647
|
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! |
a325563
into
add/interactivity-api-regions-based-client-side-navigation
…53733) * Add router with region-based client-side navigation * Add changelog * Interactivity API: merge new server-side rendered context on client-side navigation (#53853) * Add failing test * Fix the test * Add changelog * Fix lint error * Fix changelog placement * Interactivity API: Support for the `data-wp-key` directive (#53844) * Add failing test * Fix test using key * Replace key with data-wp-key * Refactor test a bit * Add changelog * Add docs * Remove unnecessary paragraph * Fix lint error * Interactivity API: Fix non stable context reference on client side navigation (#53876) * Add failing test * Fix the test * Refactor addPostWithBlock util * Add tests for router regions --------- Co-authored-by: David Arenas <[email protected]>
* Add router with region-based client-side navigation * Add changelog * Initial version working * Only add supports.interactivity and enqueue the view.js file if the "Enhanced Pagination" option is enabled * Interactivity API: merge new server-side rendered context on client-side navigation (#53853) * Add failing test * Fix the test * Add changelog * Fix lint error * Fix changelog placement * Interactivity API: Support for the `data-wp-key` directive (#53844) * Add failing test * Fix test using key * Replace key with data-wp-key * Refactor test a bit * Add changelog * Add docs * Remove unnecessary paragraph * Fix lint error * Interactivity API: Fix non stable context reference on client side navigation (#53876) * Add failing test * Fix the test * Add basic accessibility (announcement + focus) * Add basic loading animation Co-authored-by: David Arenas <[email protected]> * Only enqueue styles if they are needed * Add missing CSS props on aria-live element Apparently, some screen readers don't read elements that don't have width and height. * Fix two typos * Update fixture * Simplify loaded text * Move navigation announce style to a class --------- Co-authored-by: David Arenas <[email protected]> Co-authored-by: David Arenas <[email protected]>
What?
Built on top of #53733 (because it's using
navigate
in the e2e test).Merge new server-side rendered context on client-side navigation.
Why?
Because if we don't merge the current context with the new one, the current context gets wiped out and any new property gets deleted.
How?
By storing the current context in a stable ref, and then reusing it when the component is re-rendered.
Tasks