Package Exports
- @wordpress/sync
- @wordpress/sync/package.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wordpress/sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Sync
Sync data between multiple peers and persist in a local database.
Installation
Install the module
npm install @wordpress/sync --saveAPI
AwarenessState
Abstract class to manage awareness and allow external code to subscribe to state updates.
Type
AwarenessState
CRDT_DOC_META_PERSISTENCE_KEY
CRDT documents can hold meta information in a map. This map exists only in memory and is not synced or persisted. This key can be used to indicate that a (temporary) document has been loaded from persistence.
CRDT_RECORD_MAP_KEY
Root-level key for the map that holds the entity record data.
CRDT_RECORD_METADATA_MAP_KEY
Root-level key for the map that holds entity record metadata. This map should only contain metadata that is not represented by the entity record itself.
CRDT_RECORD_METADATA_SAVED_AT_KEY
Y.Map key representing the timestamp of the last save operation.
CRDT_RECORD_METADATA_SAVED_BY_KEY
Y.Map key representing the Y.Doc client ID of the user who performed the last save operation.
createSyncManager
The sync manager orchestrates the lifecycle of syncing entity records. It creates Yjs documents, connects to providers, creates awareness instances, and coordinates with the core-data store.
Delta
Deltas are used to calculate incremental Y.Text updates.
LOCAL_EDITOR_ORIGIN
Origin string for CRDT document changes originating from the local editor.
LOCAL_SYNC_MANAGER_ORIGIN
Origin string for CRDT document changes originating from the sync manager.
WORDPRESS_META_KEY_FOR_CRDT_DOC_PERSISTENCE
WordPress meta key used to persist the CRDT document for an entity.
Y
Exported copy of Yjs so that consumers of this package don't need to install it.
Contributing to this package
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main contributor guide.
