Skip to content

Conversation

@juanmaguitar
Copy link
Contributor

What?

See #70883

Documentation improvements for the Interactivity API and block supports.

Why?

The documentation needed clarification and improvements in several areas:

  • The block supports interactivity property behavior
  • The Interactivity API reference section on getServerState and getServerContext
  • The router region directive documentation

How?

This PR makes the following documentation improvements:

  1. Block Supports: Added clarification that setting supports.interactivity to true is equivalent to setting both clientNavigation and interactive sub-properties to true

  2. Interactivity API Reference:

    • Added a new section explaining how server context and state merging works during navigation
  3. Router README: Updated data-wp-router-region documentation to clarify that it must be used alongside data-wp-interactive and added a warning callout about proper usage with nested elements

Testing Instructions

Since this PR only contains documentation changes, no functional testing is required. Please review the documentation changes for accuracy and clarity.

Testing Instructions for Keyboard

N/A - Documentation changes only

Screenshots or screencast

N/A - Documentation changes only

- Clarified the behavior of `supports.interactivity` in block supports documentation.
- Improved formatting and added descriptions for methods in the interactivity API reference, including `getElement()`, which now details its return structure and usage.
- Updated the explanation of how server context and state merging works during navigation in the interactivity API documentation.
- Added a warning note in the interactivity-router README regarding the use of `data-wp-router-region` within nested interactive elements.
@juanmaguitar juanmaguitar requested review from luisherranz and removed request for ajitbohra and fabiankaegy December 4, 2025 19:36
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: juanmaguitar <[email protected]>
Co-authored-by: luisherranz <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@juanmaguitar juanmaguitar requested a review from DAreRodz December 4, 2025 19:36
@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers [Feature] Interactivity API API to add frontend interactivity to blocks. labels Dec 8, 2025
Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I think we should rewrite the attributes part of getElement.

@github-actions github-actions bot added the [Package] Interactivity Router /packages/interactivity-router label Dec 19, 2025
Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Juanma!

@juanmaguitar juanmaguitar enabled auto-merge (squash) December 22, 2025 15:29
@juanmaguitar juanmaguitar merged commit 6355671 into trunk Dec 22, 2025
35 checks passed
@juanmaguitar juanmaguitar deleted the docs/iapi-router-wp-6-9 branch December 22, 2025 16:14
@github-actions github-actions bot added this to the Gutenberg 22.4 milestone Dec 22, 2025
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. [Package] Interactivity Router /packages/interactivity-router [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants