-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add/more awareness methods #70848
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
Add/more awareness methods #70848
Conversation
* [Yjs Collab] WIP - Sync changes on (auto)save using Yjs Previously, Gutenberg implemented a basic Yjs editor binding. Changes were synced using y-webrtc when collaborative editing is enabled. However, the previous implementation did not reliably sync the backend-state with the Yjs document. Hence, the previous implementation could result in content duplication, or loss of changes that were created in the collaborative session. This commit implements the initial approach to sync the backend document (HTML encoded) with the Yjs document without the server understanding Yjs. Following things were implemented: - We save the Yjs document in an HTML comment, that is stored in the HTML document stored in WordPress - When the client notices that the Yjs document stored in the comment does not reflect the state of the HTML document, we assume that the changes were generated by the backend. Hence we update the document that is stored in the HTML comment, and merge the Yjs update to the Yjs document that is used in the collaborative session. Then we save the merged document once again to the backend. The changes from a backend are applied as a simulated "system user". This should guarantee that everyone applies the changes in the same way, so we avoid content duplication. The approach in this commit is still insufficient. We need to store additional information in the backend to ensure that certain edge-cases are handled. * [Yjs Collab] update used dependencies * [Yjs Collab] fix collab issues introduced in upstream - ensure that entities are always registered. * [Yjs Collab] Use heartbeat api to pull ydoc updates * [Yjs Collab] cleanup * [Yjs Collab] improve diffing * [Yjs Collab] loss of selection & focus when content is saved * [Yjs Collab] add origin to changes originating from gutenberg * [Yjs Collab] documentation * [Yjs Collab] improve docs * [Yjs Collab] several bugfixes * [Yjs Collab] add different feature flags for sync on save / heartbeat sync / webrtc sync * [Yjs Collab] Fix typo in lib/experimental/synchronization.php Co-authored-by: Aaron Jorbin <[email protected]> * [Yjs Collab] user wp_rand instead of rand Co-authored-by: Aaron Jorbin <[email protected]> * [Yjs Collab] Update regexes and priorities for synchronization filters As @aaronjorbin rightfully pointed out, the new filters approach don't need to run at the end anymore. * [Yjs Collab] implement get_yinfo function in synchronization.php * [Yjs Collab] fix tests * [Yjs Collab] fix php lint issues * [Yjs Collab] fix mobile tests * Remove heartbeat experiment * Add core.getSyncProvider filter --------- Co-authored-by: Kevin Jahns <[email protected]> Co-authored-by: Aaron Jorbin <[email protected]>
* Refactor filtering to avoid import conflicts * Add "node" to the base types array Without this, type building fails for the sync package, despite the fact that itself has this statement in its `tsconfig.json`. Is that config ignored? Why are types so fragile? * Revert "Add "node" to the base types array" This reverts commit e0c4ecf. * Add "node" types to packages that consume @wordpress/sync
…timental-collaborative-editing
…ng heartbeat code
…timental-collaborative-editing
…timental-collaborative-editing
…timental-collaborative-editing
…timental-collaborative-editing
…ers and state fields before bootstrap.
…timental-collaborative-editing
…timental-collaborative-editing
* Add the Yjs undo manager * Got undo manager working * Cleaned up the code a bit, and added comments * Redo the entire undomanager to work agnostic of the objectType. Also began to allow switching between the different undo managers * Fix the type errors * Document the methods better * Add comments, and fix the package-lock not being complete * Updated the lib0 package to fix the react native problem * ignore the launch.json * Update the packages, and enable the remoteMap fix
…imental-collaboration-awareness
…ers and state fields before bootstrap. (WordPress#70696)
…timental-collaborative-editing
* Convert the sync packages to typescript - part 1 * Converted everything else to typescript as well * Remove the last @type * Undo renaming js to ts for files that should stay the same
…timental-collaborative-editing
…editing' into add/experimental-collaboration-awareness
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast