Repository navigation
Sync: Remove exposed wp.sync package #81999
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
Changes from all commits
ef7e534
2b77acb
5799f02
4d51774
fe6a7c8
e666a97
d9faf81
a37cbc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |
| * Yjs should not be considered a public API. It is a third-party library that | ||
| * _will_ experience breaking changes in the future. | ||
| * | ||
| * `@wordpress/sync` is a bundled package: each consumer bundles its own copy, | ||
| * and no `wp.sync` global or `wp-sync` script handle is exposed by WordPress. | ||
| * Two Yjs instances operating on the same document cause silent data | ||
| * corruption: | ||
| * | ||
|
|
@@ -58,13 +60,6 @@ | |
| * | ||
| * See `packages/e2e-tests/plugins/rtc-websocket-provider` for a complete | ||
| * working example. | ||
| * | ||
| * Deprecated: `@wordpress/sync` is currently also exposed as the `wp-sync` | ||
| * WordPress script, which provides the same Yjs module as the `wp.sync.Y` | ||
| * global. This global will be removed in a future release, and it is already | ||
| * unavailable in WordPress core. Providers that still resolve `yjs` to | ||
| * `wp.sync.Y` through webpack externals should migrate to the `Y` option | ||
| * described above. | ||
| */ | ||
| export * as Y from 'yjs'; | ||
|
|
||
|
|
@@ -87,8 +82,49 @@ export const YJS_VERSION = '13'; | |
| export { Awareness } from 'y-protocols/awareness'; | ||
|
|
||
| /** | ||
| * Private @wordpress/sync APIs. | ||
| * Key of the in-memory meta entry marking a CRDT document as loaded from | ||
| * persistence. It is not synced or persisted. | ||
| */ | ||
| export { CRDT_DOC_META_PERSISTENCE_KEY } from './config'; | ||
|
|
||
| /** | ||
| * Root-level key for the map that holds the entity record data. | ||
| */ | ||
| export { CRDT_RECORD_MAP_KEY } from './config'; | ||
|
|
||
| /** | ||
| * Origin string for CRDT document changes originating from the local editor. | ||
| */ | ||
| export { LOCAL_EDITOR_ORIGIN } from './config'; | ||
|
|
||
| /** | ||
| * Origin string for CRDT document changes that should be synced but not | ||
| * recorded in the undo history (e.g. status changes during publish). | ||
| */ | ||
| export { LOCAL_UNDO_IGNORED_ORIGIN } from './config'; | ||
|
|
||
| /** | ||
| * Error codes reported by a sync provider when its connection fails. | ||
| */ | ||
| export { ConnectionErrorCode } from './errors'; | ||
|
|
||
| /** | ||
| * Creates the sync manager, which orchestrates the lifecycle of syncing entity | ||
| * records: it creates Yjs documents, connects to providers, creates awareness | ||
| * instances, and coordinates with the `core-data` store. Exported for | ||
| * `@wordpress/core-data`; plugins don't need it. | ||
| */ | ||
| export { createSyncManager } from './manager'; | ||
|
|
||
| /** | ||
| * Quill Delta implementation used to describe rich text changes. | ||
| */ | ||
| export { default as Delta } from './quill-delta/Delta'; | ||
|
|
||
| /** | ||
| * Retries the HTTP polling connection now instead of waiting for the next | ||
| * automatic retry. Exported for `@wordpress/core-data`; plugins don't need it. | ||
| */ | ||
| export { privateApis } from './private-apis'; | ||
| export { retrySyncConnection } from './providers/http-polling/polling-manager'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm not wrong
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, updated both of those in 92d6e7d. |
||
|
|
||
| export type * from './types'; | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the comment is still relevant, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is covered in the docs, so not necessary to preserve here. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I think the comments above this cover the migration, and most of the information in this paragraph is now out of date (
wp-syncexposed,wp.sync.Yglobal removed in a future release).