Skip to content

Remote Reply: Use Interactivity API #1721

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

Merged
merged 231 commits into from
May 28, 2025
Merged

Conversation

obenland
Copy link
Member

@obenland obenland commented May 20, 2025

Moves the Remote Reply "block" to using the Interactivity API for front-end rendering. Removes the block's dependency on React in the frontend.

Proposed changes:

  • Removes remote-reply block from .prettierignore to accept formatting.
  • Updates comments handling to load remote-reply through block processing rather than manual script enqueues.
  • Updates Follow Me and Reactions block to standardize block registration using block.json.
  • Moves remote-reply block to using Interactivity API to handle its functionality in the frontend.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Test the block with a comment sent in from the Fediverse.
  • Visit the post while being logged-out.
  • Make sure modal operation, saving actor info, sending to instance for reply all still works.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

"Reply on the Fediverse" now uses the Interactivity API for display on the frontend.

@obenland obenland marked this pull request as ready for review May 26, 2025 19:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Replace the Remote Reply block’s React-based frontend with the Interactivity API and update its build outputs accordingly.

  • Remove the old index.js/index.asset.php assets and editor styles.
  • Add server‐side render.php plus view.asset.php, and update block.json to use Interactivity API.

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
build/remote-reply/view.asset.php Define @wordpress/interactivity dependency
build/remote-reply/style-view.css Add new frontend styles for the Interactivity API
build/remote-reply/style-index.css Remove legacy editor styles
build/remote-reply/style-index-rtl.css Remove legacy editor RTL styles
build/remote-reply/render.php Server‐side rendering with wp_interactivity_state
build/remote-reply/index.js Remove React-based frontend script
build/remote-reply/index.asset.php Remove React dependencies asset file
build/remote-reply/block.json Bump version; switch to view.asset, viewScriptModule and API render
.github/changelog/1721-from-description Add the changelog entry for this change
Comments suppressed due to low confidence (2)

build/remote-reply/block.json:11

  • The block.json references a view.js module that isn’t present in the build. Add the missing view.js under build/remote-reply/ or adjust the configuration to point to the correct script.
"viewScriptModule": "file:./view.js",

build/remote-reply/block.json:12

  • Setting viewScript to wp-api-fetch will only enqueue the core API fetch package, not your block’s frontend code. Either reference your actual view script or remove this entry if it’s not needed.
"viewScript": "wp-api-fetch",

@obenland obenland requested a review from pfefferle May 28, 2025 15:44
@obenland obenland merged commit 8230162 into trunk May 28, 2025
13 checks passed
@obenland obenland deleted the try/reply-block-interactivity branch May 28, 2025 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Follow Me [Block] Reactions [Block] Remote Reply aka "Reply on the Fediverse", in the comment list [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants