Skip to content
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

iAPI: Merge of state and context after client-side navigation #63864

Closed
2 tasks done
luisherranz opened this issue Jul 23, 2024 · 3 comments · Fixed by #62734
Closed
2 tasks done

iAPI: Merge of state and context after client-side navigation #63864

luisherranz opened this issue Jul 23, 2024 · 3 comments · Fixed by #62734
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Packages] Interactivity /packages/interactivity [Type] Bug An existing feature does not function as intended

Comments

@luisherranz
Copy link
Member

Description

There's no way to distinguish the global state belonging to blocks that are inside a router region from the global state belonging to blocks that are not inside a router region. Therefore, we can't use the strategy of replacing the client state with the state coming from the server during client-side navigations.

Step-by-step reproduction instructions

  1. Create a block that uses global state.
  2. Place that block outside of a router region.
  3. Navigate to a page where the global state is different from the initial page.
  4. The state of the block was updated, which it shouldn't have, since it's outside a router region.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended [Feature] Interactivity API API to add frontend interactivity to blocks. [Packages] Interactivity /packages/interactivity labels Jul 23, 2024
@luisherranz luisherranz changed the title iAPI: Reverse merge of state and context after client-side navigation iAPI: Merge of state and context after client-side navigation Jul 23, 2024
@michalczaplinski
Copy link
Contributor

If I understand correctly:

This assumes that the "new" page (the one that is navigated to in step 3.) loads some JS (typically the view.js file) that updates the global state?

@luisherranz
Copy link
Member Author

No, it does refer to the state and context that is serialized from the server and how it merges with the existing state and context.

@luisherranz
Copy link
Member Author

Completed in #62734.

@luisherranz luisherranz linked a pull request Aug 26, 2024 that will close this issue
8 tasks
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. [Packages] Interactivity /packages/interactivity [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants