Skip to content

Commit

Permalink
perf(sync): switch to Y.mergeUpdates (toeverything#6342)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flrande authored Mar 1, 2024
1 parent f029b3c commit 274f778
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"presets",
"playground",
"inline",
"lit"
"lit",
"sync"
]
]
}
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/sync/src/doc/impl/memory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { mergeUpdates } from '../../utils/merge-updates.js';
import { mergeUpdates } from 'yjs';

import type { DocSource } from '../source.js';

export class MemoryDocSource implements DocSource {
Expand Down
8 changes: 6 additions & 2 deletions packages/framework/sync/src/doc/peer.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { type Logger, Slot } from '@blocksuite/global/utils';
import { isEqual } from '@blocksuite/global/utils';
import type { Doc } from 'yjs';
import { applyUpdate, encodeStateAsUpdate, encodeStateVector } from 'yjs';
import {
applyUpdate,
encodeStateAsUpdate,
encodeStateVector,
mergeUpdates,
} from 'yjs';

import {
PriorityAsyncQueue,
SharedPriorityTarget,
} from '../utils/async-queue.js';
import { mergeUpdates } from '../utils/merge-updates.js';
import { MANUALLY_STOP, throwIfAborted } from '../utils/throw-if-aborted.js';
import { DocPeerStep } from './consts.js';
import type { DocSource } from './source.js';
Expand Down
1 change: 0 additions & 1 deletion packages/framework/sync/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './awareness/index.js';
export * from './doc/index.js';
export * from './utils/merge-updates.js';
17 changes: 0 additions & 17 deletions packages/framework/sync/src/utils/merge-updates.ts

This file was deleted.

0 comments on commit 274f778

Please sign in to comment.