Skip to content

课程 17 - 协同

在本课程中,我们将探讨如何实现多人协同编辑功能。我们会介绍几个核心概念和技术,包括历史记录、本地优先(Local-first)以及 CRDT。

历史记录

Excalidraw HistoryEntry

Local-first

The past, present, and future of local-first

TipTap offline support

CRDT

提到协同算法

Loro Excalidraw Exampleautomerge wasm

系列教程:

ts
interface CRDT<T, S> {
    value: T;
    state: S;
    merge(state: S): void;
}

Y.js

https://tiptap.dev/docs/collaboration/getting-started/overview#about-yjs

As a CRDT, Y.js ensures that the sequence of changes does not impact the final state of the document, similar to how Git operates with commits. This guarantees that all copies of the data remain consistent across different environments.

数据结构设计

扩展阅读

Released under the MIT License.