Skip to content

Refine getServerState() & getServerContext() docs#67499

Merged
michalczaplinski merged 5 commits intotrunkfrom
docs/interactivity-get-server-state-fixes
Dec 4, 2024
Merged

Refine getServerState() & getServerContext() docs#67499
michalczaplinski merged 5 commits intotrunkfrom
docs/interactivity-get-server-state-fixes

Conversation

@michalczaplinski
Copy link
Copy Markdown
Contributor

Implements comments from #66104

  1. Clarify that since getServerState() and getServerContext() are reactive, if the value of a property doesn’t change, the watch callback will not re-trigger.
  2. Fix the code snippets to correctly include the HTML tags (comment)
  3. Add note about local context (comment)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 2, 2024

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: michalczaplinski <czapla@git.wordpress.org>
Co-authored-by: luisherranz <luisherranz@git.wordpress.org>

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 2, 2024

Flaky tests detected in d4f57f4.
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/12127083014
📝 Reported issues:

Copy link
Copy Markdown
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 now. Thanks, Michał.

@michalczaplinski michalczaplinski merged commit e0341a4 into trunk Dec 4, 2024
@michalczaplinski michalczaplinski deleted the docs/interactivity-get-server-state-fixes branch December 4, 2024 12:02
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 4, 2024
michalczaplinski added a commit that referenced this pull request Dec 5, 2024
* `getServerState()` & `getServerContext()` docs: Add note about reactivity.

* Fix the code snippets

* Add note about local context

* Fix param order and function name

* Remove the namespace and use the correct functions

Co-authored-by: michalczaplinski <czapla@git.wordpress.org>
Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
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] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants