Skip to content

iAPI Docs: Fix typos, code errors, and inaccuracies in the documentation#76636

Open
DAreRodz wants to merge 54 commits intotrunkfrom
fix/interactivity-api-docs-review
Open

iAPI Docs: Fix typos, code errors, and inaccuracies in the documentation#76636
DAreRodz wants to merge 54 commits intotrunkfrom
fix/interactivity-api-docs-review

Conversation

@DAreRodz
Copy link
Copy Markdown
Contributor

What?

Fixes multiple documentation issues across the Interactivity API reference guides.

Why?

The Interactivity API docs contained various typos, incorrect code examples, grammar issues, and
inaccuracies that could mislead developers. For example, an unclosed wp_interactivity_state()
call, a navigate() call referencing the wrong store, invalid JSON, incorrect language tags on
code fences, and several grammar/spelling errors.

How?

Note

For reviewers: the last commit contains format corrections; it can be skipped to check the actual changes in the documentation.

This PR applies fixes across 10 documentation files in docs/reference-guides/interactivity-api/:

  • Code corrections: Fix unclosed function calls, invalid JSON, missing commas, wrong function
    references (e.g., use dynamic import from @wordpress/interactivity-router for navigate()),
    replace wp_interactivity_state with wp_interactivity_config/getConfig for static data like
    nonces.
  • Typos and grammar: Fix misspellings (sucessfully, extrat, leanier), grammar errors
    (allows to setallows you to set), and subject-verb agreement.
  • Accuracy: Correct claims about getServerState()/getServerContext() read-only behavior,
    fix Phase 2 ordering to match source, fix CSS deactivation mechanism docs, update deprecated
    two-hyphen unique-ID syntax to three hyphens.
  • Consistency: Standardize code fence language tags (javascriptjs, phphtml for
    HTML-only blocks), standardize data-wp-interactive quoting to double quotes, normalize ~10 KB
    formatting.
  • TypeScript example: Rename increment to multiply with state.counter *= state.product
    to better match the example's state.product property.
  • Formatting: Run Prettier on all Interactivity API documentation files (docs/reference-guides/interactivity-api/) and package markdown files (packages/interactivity/, packages/interactivity-router/) to fix code style inconsistencies.

DAreRodz and others added 30 commits March 18, 2026 13:45
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onces

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… true)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The two-hyphen syntax for unique IDs (e.g., data-wp-watch--myId) is
deprecated and will stop working in WordPress 7.1. Updated all
occurrences to use three hyphens (data-wp-watch---myId) and added
deprecation notices.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ttributes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These functions return a deep clone (snapshot), not a frozen/read-only
object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te/getServerContext

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… in example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ut.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DAreRodz and others added 20 commits March 18, 2026 13:45
…ty API FAQ

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eferences

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… start guide

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ve mindset guide

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mple

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…array mutation example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eset

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…script.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d HTML attributes"

This reverts commit 9e795318af2364ccfd7eab1a1bc71a616f9cd8af.
…e examples"

This reverts commit 6629f3e92e18b373129dd095fe1c286cb7ac19ca.
…Active reset"

This reverts commit 8c4e92d5ed8c1620e81fd0a80f6973ee417c8b23.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…igate()

The navigate function should come from the core/interactivity-router
store, not from the plugin's own store.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DAreRodz DAreRodz requested a review from luisherranz as a code owner March 18, 2026 14:49
@DAreRodz DAreRodz added the [Type] Developer Documentation Documentation for developers label Mar 18, 2026
@DAreRodz DAreRodz added the [Feature] Interactivity API API to add frontend interactivity to blocks. label Mar 18, 2026
@github-actions github-actions bot added [Package] Interactivity /packages/interactivity [Package] Interactivity Router /packages/interactivity-router labels Mar 18, 2026
@github-actions
Copy link
Copy Markdown

Flaky tests detected in dacfdd5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23250762417
📝 Reported issues:

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 [Package] Interactivity /packages/interactivity [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants