-
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
Interactivity API: Fix non stable context reference on client side navigation #53876
Merged
luisherranz
merged 2 commits into
add/interactivity-api-regions-based-client-side-navigation
from
fix-non-stable-context-reference-on-client-side-navigation
Aug 22, 2023
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luisherranz
added
[Type] Bug
An existing feature does not function as intended
[Feature] Interactivity API
API to add frontend interactivity to blocks.
labels
Aug 22, 2023
luisherranz
requested review from
kevin940726,
Mamaduka,
ntwb,
nerrad,
ajitbohra and
DAreRodz
as code owners
August 22, 2023 14:09
DAreRodz
approved these changes
Aug 22, 2023
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.
Thanks for the quick fix, @luisherranz! 👏
Thanks, David! |
luisherranz
merged commit Aug 22, 2023
c57465c
into
add/interactivity-api-regions-based-client-side-navigation
luisherranz
deleted the
fix-non-stable-context-reference-on-client-side-navigation
branch
August 22, 2023 14:17
Size Change: +8 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
21 tasks
DAreRodz
added a commit
that referenced
this pull request
Aug 28, 2023
…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 <david.arenas@automattic.com>
DAreRodz
added a commit
that referenced
this pull request
Aug 29, 2023
* 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 <darerodz@users.noreply.github.com> * 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 <darerodz@users.noreply.github.com> Co-authored-by: David Arenas <david.arenas@automattic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Type] Bug
An existing feature does not function as intended
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
A small fix for #53853.
Why?
Because the
context
reference was replaced during the client-side navigation, and async functions lost their reference:How?
By making sure that we reuse the same reference when the
data-wp-context
directive is executed again.Tasks
It doesn't need an entry on the changelog because this is a fix for #53853 which hasn't been released yet.