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

Interactivity API: Add supports.interactivity to the Query block #58316

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

luisherranz
Copy link
Member

What?

Adds supports.interactivity to the Query block.

Why?

Because without it, the new Server Directive Processing doesn't process it.

How?

By adding the property to the block.json.

Testing Instructions

  • Open the Site Editor
  • Add a Query block
  • Inside the Query block, add an HTML block
  • Put this code
    <div
      data-wp-interactive='{ "namespace": "test" }'
      data-wp-context='{ "text": "testing server directive processing" }'
    >
      <span data-wp-text="context.text"></span>
    </div>
  • Save and inspect the HTML of the site
    • Don't inspect using the Chrome DevTools!!
    • Use Right-click, "View Page Source" in Chrome
  • In the rendered HTML, search for testing server directive processing
  • If the server directive processing worked, the text should also be inside the <span> tag:
    <div
      data-wp-interactive='{ "namespace": "test" }'
      data-wp-context='{ "text": "testing server directive processing" }'
    >
      <span data-wp-text="context.text">testing server directive processing</span>
    </div>

@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block [Feature] Interactivity API API to add frontend interactivity to blocks. labels Jan 26, 2024
@luisherranz luisherranz self-assigned this Jan 26, 2024
Copy link
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

LGTM

@luisherranz luisherranz merged commit 3a0f734 into trunk Jan 26, 2024
65 checks passed
@luisherranz luisherranz deleted the add-supports-interactivity-to-query-block branch January 26, 2024 16:04
@github-actions github-actions bot added this to the Gutenberg 17.7 milestone Jan 26, 2024
westonruter added a commit that referenced this pull request Jan 26, 2024
…zy-hydration

* origin/trunk: (47 commits)
  Interactivity API: Break up long hydration task in interactivity init (#58227)
  Add supports.interactivity to Query block (#58316)
  Font Library: Make notices more consistent (#58180)
  Fix Global styles text settings bleeding into placeholder component (#58303)
  Fix the position and size of the Options menu, (#57515)
  DataViews: Fix safari grid row height issue (#58302)
  Try a fix (#58282)
  Navigation Submenu Block: Make block name affect list view (#58296)
  Apply custom scroll style to fixed header block toolbar (#57444)
  Add support for transform and letter spacing controls in Global Styles > Typography > Elements (#58142)
  DataViews: Fix table view cell wrapper and BlockPreviews (#58062)
  Workflows: Add 'Technical Prototype' to the type-related labels list (#58163)
  Block Editor: Optimize the 'useBlockDisplayTitle' hook (#58250)
  Remove noahtallen from .wp-env codeowners (#58283)
  Global styles revisions: fix is-selected rules from affecting other areas of the editor (#58228)
  Try: Disable text selection for post content placeholder block. (#58169)
  Remove `template-only` mode from editor and edit-post packages (#57700)
  Refactored download/upload logic to support font faces with multiple src assets (#58216)
  Components: Expand theming support in COLORS (#58097)
  Implementing new UX for invoking rich text Link UI  (#57986)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants