Skip to content

Conversation

@chriszarate
Copy link
Contributor

What?

This draft pull request extends and improves the collaborative editing experiment to provide:

  • More performant and stable synchronization.
  • Protections to make sure that the core-data package retains control over which entity records are synced and how changes are merged.
  • A filter to give plugins the ability to extend a SyncProvider class. This allows plugins to provide their own sync transports and to implement user-facing sync behaviors such as awareness / presence indicators.
  • Stubs that allow CRDT docs to be persisted in meta, avoiding the "initialization problem" as described by @dmonad. (These stubs are implemented by our plugin.)
  • A Yjs-powered UndoManager that works across multiple synced entities.

It is open now for discussion and guidance while we continue to improve it (see "How?" section).

Why?

This work builds on the pull request opened by @dmonad earlier this year. Our immediate goal is to provide a production-ready implementation of collaborative editing for WPVIP customers using a WebSocket transport.

Gutenberg's sync package must be flexible enough to support a future "default" sync transport that ships with Gutenberg, while also allowing plugins to provide their own transport. Additionally, while collaborative editing is still under development, it must also provide ways for plugins to implement missing features such as awareness / presence indicators and CRDT persistence.

Lastly, Gutenberg's core-data package must provide stable and performant merge algorithms so that entity records are synced in a way that aligns with user expectations.

How?

This pull request is large in service of providing a complete implementation for review. However, the commits are atomic by feature and can be reviewed one-by-one. If desired, we can split this PR up into smaller ones, with the understanding that the branches may not be in a fully functional state.

Additional props to @alecgeatches, @ingeniumed, and @pkevan for their contributions to this branch.

Testing Instructions

This PR can be tested in two ways:

  1. Use the existing WebRTC (+HTTP signaling) Yjs provider
    • Check out this branch.
    • Enable the real-time collaboration experiment: Gutenberg > Experiments.
    • Open a post for editing in two different browser environments.
      • Note: This provider uses requests to admin-ajax.php for signaling and the initial connection is delayed.
  2. Use WPVIP's Real-Time Collaboration plugin, which ships a WebSocket Yjs provider and provides an awareness implementation.
    • Check out this branch in a folder named gutenberg.
    • Check out the plugin repo in a sibling folder.
    • npm install
    • npm run dev to start the development environment, including WebSocket server. See additional details and instructions, if needed.
    • Open a post for editing in two different browser environments.

Testing Instructions for Keyboard

No UI changes in this pull request.

Screenshots or screencast

WebSocket provider with awareness / presence indicators (WPVIP plugin)

plugin2.mov

@chriszarate chriszarate marked this pull request as ready for review October 3, 2025 16:46
@github-actions
Copy link

github-actions bot commented Oct 3, 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: chriszarate <[email protected]>
Co-authored-by: ingeniumed <[email protected]>
Co-authored-by: pkevan <[email protected]>
Co-authored-by: alecgeatches <[email protected]>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. Collaborative Workflows Phase 3 of the Gutenberg roadmap around all-things related to collaborative workflows [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration and removed Collaborative Workflows Phase 3 of the Gutenberg roadmap around all-things related to collaborative workflows labels Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants