reptree 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,9 +8,9 @@ RepTree uses [CRDTs](https://crdt.tech/) for seamless replication between users.
8
8
 
9
9
  ## What it solves
10
10
 
11
- If you have a tree structure in your app where each vertex/node/leaf can be moved independently by multiple users, you need a solution that resolves conflicts when the same vertex is moved in different ways. Otherwise your tree can diverge or form loops. This includes folder structures (people creating and moving folders), 2D/3D scenes with objects being moved and parented, and Notion‑like documents where blocks with text and other properties are edited by users.
11
+ If you have a tree structure in your app where each node can be moved independently by multiple users, you need a solution that resolves conflicts when the same node is moved in different ways. Otherwise your tree can diverge or form loops. This includes folder structures (people creating and moving folders), 2D/3D scenes with objects being moved and parented, and Notion‑like documents where blocks with text and other properties are edited by users.
12
12
 
13
- You probably also want properties on each vertex/node/leaf and to have them sync correctly between peers without conflicts. RepTree syncs properties too.
13
+ You probably also want properties on each node and to have them sync correctly between peers without conflicts. RepTree syncs properties too.
14
14
 
15
15
  ## Getting started
16
16
 
@@ -18,7 +18,7 @@ You probably also want properties on each vertex/node/leaf and to have them sync
18
18
  npm install reptree
19
19
  ```
20
20
 
21
- ### Example 1
21
+ ### Example 1
22
22
  ```ts
23
23
  import { RepTree } from "reptree";
24
24
 
@@ -26,11 +26,11 @@ import { RepTree } from "reptree";
26
26
  const tree = new RepTree("company-org-1");
27
27
  const company = tree.createRoot();
28
28
 
29
- // Create a node (we call them vertices in RepTree) in the root of our new tree
29
+ // Create nodes in the root of our new tree
30
30
  const devs = company.newNamedChild("developers");
31
31
  const qa = company.newNamedChild("qa");
32
32
 
33
- // Create a vertex in another vertex
33
+ // Create a node in another node
34
34
  const alice = qa.newChild();
35
35
 
36
36
  // Set properties (supports any JSON-serializable values)
@@ -38,10 +38,10 @@ alice.setProperty("name", "Alice");
38
38
  alice.setProperty("age", 32);
39
39
  alice.setProperty("meta", { department: "QA", skills: ["cypress", "playwright"], flags: { lead: false } });
40
40
 
41
- // Move the vertex inside a different vertex
41
+ // Move the node inside a different node
42
42
  alice.moveTo(devs);
43
43
 
44
- // Bind a vertex to a type to set its properties like regular fields
44
+ // Bind a node to a type to set its properties like regular fields
45
45
  const bob = qa.newChild().bind<{ name: string; age: number }>();
46
46
  bob.name = "Bob";
47
47
  bob.age = 33;
@@ -110,7 +110,7 @@ otherTree.merge(ops);
110
110
 
111
111
  RepTree uses two conflict-free replicated data types (CRDTs):
112
112
  - A move tree CRDT for the tree structure (https://martin.kleppmann.com/papers/move-op.pdf).
113
- - A last-writer-wins (LWW) CRDT is for properties.
113
+ - A last-writer-wins (LWW) CRDT for properties.
114
114
 
115
115
  ## License
116
116