Skip to content

Commit 486e61c

Browse files
committed
Revert private-api usage
1 parent 5cfbdff commit 486e61c

File tree

8 files changed

+18
-46
lines changed

8 files changed

+18
-46
lines changed

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core-data/src/sync.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { privateApis as syncPrivateApis } from '@wordpress/sync';
5-
6-
/**
7-
* Internal dependencies
8-
*/
9-
import { unlock } from './lock-unlock';
10-
11-
const { CRDT_RECORD_MAP_KEY, LOCAL_EDITOR_ORIGIN, createSyncManager } =
12-
unlock( syncPrivateApis );
4+
import {
5+
CRDT_RECORD_MAP_KEY,
6+
LOCAL_EDITOR_ORIGIN,
7+
createSyncManager,
8+
} from '@wordpress/sync';
139

1410
export { CRDT_RECORD_MAP_KEY, LOCAL_EDITOR_ORIGIN };
1511
export const syncManager = createSyncManager();

packages/sync/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ npm install @wordpress/sync --save
1414

1515
<!-- START TOKEN(Autogenerated API docs) -->
1616

17-
### privateApis
17+
### CRDT_RECORD_MAP_KEY
1818

19-
Private @wordpress/sync APIs
19+
Root-level key for the CRDT document that holds the entity record data.
20+
21+
### createSyncManager
22+
23+
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.
24+
25+
### LOCAL_EDITOR_ORIGIN
26+
27+
Origin string for CRDT document changes originating from the local editor.
2028

2129
### Y
2230

packages/sync/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"dependencies": {
4040
"@types/simple-peer": "^9.11.5",
4141
"@wordpress/hooks": "file:../hooks",
42-
"@wordpress/private-apis": "file:../private-apis",
4342
"@wordpress/url": "file:../url",
4443
"import-locals": "^2.0.0",
4544
"lib0": "^0.2.42",

packages/sync/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
*/
1212
export * as Y from 'yjs';
1313

14-
export * from './private-apis';
14+
export { CRDT_RECORD_MAP_KEY, LOCAL_EDITOR_ORIGIN } from './config';
15+
export { createSyncManager } from './manager';
1516
export type * from './types';

packages/sync/src/lock-unlock.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/sync/src/private-apis.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/sync/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
"compilerOptions": {
55
"types": [ "node" ]
66
},
7-
"references": [
8-
{ "path": "../hooks" },
9-
{ "path": "../private-apis" },
10-
{ "path": "../url" }
11-
]
7+
"references": [ { "path": "../hooks" }, { "path": "../url" } ]
128
}

0 commit comments

Comments
 (0)