@automerge/automerge-repo 1.1.4 → 1.1.8

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.
Files changed (37) hide show
  1. package/README.md +3 -22
  2. package/dist/DocHandle.d.ts +124 -100
  3. package/dist/DocHandle.d.ts.map +1 -1
  4. package/dist/DocHandle.js +239 -231
  5. package/dist/Repo.d.ts +10 -3
  6. package/dist/Repo.d.ts.map +1 -1
  7. package/dist/Repo.js +22 -1
  8. package/dist/helpers/arraysAreEqual.d.ts.map +1 -1
  9. package/dist/helpers/debounce.d.ts.map +1 -1
  10. package/dist/helpers/tests/network-adapter-tests.d.ts +1 -1
  11. package/dist/helpers/tests/network-adapter-tests.d.ts.map +1 -1
  12. package/dist/helpers/tests/network-adapter-tests.js +2 -2
  13. package/dist/helpers/tests/storage-adapter-tests.d.ts +7 -0
  14. package/dist/helpers/tests/storage-adapter-tests.d.ts.map +1 -0
  15. package/dist/helpers/tests/storage-adapter-tests.js +128 -0
  16. package/dist/helpers/throttle.d.ts.map +1 -1
  17. package/dist/helpers/withTimeout.d.ts.map +1 -1
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +7 -0
  21. package/dist/synchronizer/DocSynchronizer.js +1 -1
  22. package/package.json +4 -4
  23. package/src/DocHandle.ts +325 -375
  24. package/src/Repo.ts +35 -8
  25. package/src/helpers/tests/network-adapter-tests.ts +4 -2
  26. package/src/helpers/tests/storage-adapter-tests.ts +193 -0
  27. package/src/index.ts +43 -0
  28. package/src/synchronizer/DocSynchronizer.ts +1 -1
  29. package/test/CollectionSynchronizer.test.ts +1 -3
  30. package/test/DocHandle.test.ts +19 -1
  31. package/test/DocSynchronizer.test.ts +1 -4
  32. package/test/DummyStorageAdapter.test.ts +11 -0
  33. package/test/Repo.test.ts +179 -53
  34. package/test/helpers/DummyNetworkAdapter.ts +20 -18
  35. package/test/helpers/DummyStorageAdapter.ts +5 -1
  36. package/test/remoteHeads.test.ts +1 -1
  37. package/tsconfig.json +1 -0
package/README.md CHANGED
@@ -123,7 +123,7 @@ yarn create vite
123
123
 
124
124
  cd hello-automerge-repo
125
125
  yarn
126
- yarn add @automerge/automerge @automerge/automerge-repo-react-hooks @automerge/automerge-repo-network-broadcastchannel @automerge/automerge-repo-storage-indexeddb vite-plugin-wasm vite-plugin-top-level-await
126
+ yarn add @automerge/automerge @automerge/automerge-repo-react-hooks @automerge/automerge-repo-network-broadcastchannel @automerge/automerge-repo-storage-indexeddb vite-plugin-wasm
127
127
  ```
128
128
 
129
129
  Edit the `vite.config.ts`. (This is all need to work around packaging hiccups due to WASM. We look
@@ -134,32 +134,13 @@ forward to the day that we can delete this step entirely.)
134
134
  import { defineConfig } from "vite"
135
135
  import react from "@vitejs/plugin-react"
136
136
  import wasm from "vite-plugin-wasm"
137
- import topLevelAwait from "vite-plugin-top-level-await"
138
137
 
139
138
  export default defineConfig({
140
- plugins: [wasm(), topLevelAwait(), react()],
139
+ plugins: [wasm(), react()],
141
140
 
142
141
  worker: {
143
142
  format: "es",
144
- plugins: [wasm(), topLevelAwait()],
145
- },
146
-
147
- optimizeDeps: {
148
- // This is necessary because otherwise `vite dev` includes two separate
149
- // versions of the JS wrapper. This causes problems because the JS
150
- // wrapper has a module level variable to track JS side heap
151
- // allocations, and initializing this twice causes horrible breakage
152
- exclude: [
153
- "@automerge/automerge-wasm",
154
- "@automerge/automerge-wasm/bundler/bindgen_bg.wasm",
155
- "@syntect/wasm",
156
- ],
157
- },
158
-
159
- server: {
160
- fs: {
161
- strict: false,
162
- },
143
+ plugins: () => [wasm()],
163
144
  },
164
145
  })
165
146
  ```
@@ -1,107 +1,143 @@
1
1
  import * as A from "@automerge/automerge/next";
2
2
  import { EventEmitter } from "eventemitter3";
3
- import { StateValue } from "xstate";
4
3
  import type { AutomergeUrl, DocumentId, PeerId } from "./types.js";
5
4
  import { StorageId } from "./storage/types.js";
6
- /** DocHandle is a wrapper around a single Automerge document that lets us
7
- * listen for changes and notify the network and storage of new changes.
5
+ /**
6
+ * A DocHandle is a wrapper around a single Automerge document that lets us listen for changes and
7
+ * notify the network and storage of new changes.
8
8
  *
9
9
  * @remarks
10
- * A `DocHandle` represents a document which is being managed by a {@link Repo}.
11
- * To obtain `DocHandle` use {@link Repo.find} or {@link Repo.create}.
10
+ * A `DocHandle` represents a document which is being managed by a {@link Repo}. You shouldn't ever
11
+ * instantiate this yourself. To obtain `DocHandle` use {@link Repo.find} or {@link Repo.create}.
12
12
  *
13
13
  * To modify the underlying document use either {@link DocHandle.change} or
14
- * {@link DocHandle.changeAt}. These methods will notify the `Repo` that some
15
- * change has occured and the `Repo` will save any new changes to the
16
- * attached {@link StorageAdapter} and send sync messages to connected peers.
17
- * */
18
- export declare class DocHandle<T>//
19
- extends EventEmitter<DocHandleEvents<T>> {
14
+ * {@link DocHandle.changeAt}. These methods will notify the `Repo` that some change has occured and
15
+ * the `Repo` will save any new changes to the attached {@link StorageAdapter} and send sync
16
+ * messages to connected peers.
17
+ */
18
+ export declare class DocHandle<T> extends EventEmitter<DocHandleEvents<T>> {
20
19
  #private;
21
20
  documentId: DocumentId;
22
- /** The URL of this document
23
- *
24
- * @remarks
25
- * This can be used to request the document from an instance of {@link Repo}
26
- */
27
- get url(): AutomergeUrl;
28
21
  /** @hidden */
29
22
  constructor(documentId: DocumentId, options?: DocHandleOptions<T>);
23
+ /** Our documentId in Automerge URL form.
24
+ */
25
+ get url(): AutomergeUrl;
30
26
  /**
31
- * Checks if the document is ready for accessing or changes.
32
- * Note that for documents already stored locally this occurs before synchronization
33
- * with any peers. We do not currently have an equivalent `whenSynced()`.
27
+ * @returns true if the document is ready for accessing or changes.
28
+ *
29
+ * Note that for documents already stored locally this occurs before synchronization with any
30
+ * peers. We do not currently have an equivalent `whenSynced()`.
34
31
  */
35
32
  isReady: () => boolean;
36
33
  /**
37
- * Checks if this document has been marked as deleted.
38
- * Deleted documents are removed from local storage and the sync process.
39
- * It's not currently possible at runtime to undelete a document.
40
- * @returns true if the document has been marked as deleted
34
+ * @returns true if the document has been marked as deleted.
35
+ *
36
+ * Deleted documents are removed from local storage and the sync process. It's not currently
37
+ * possible at runtime to undelete a document.
41
38
  */
42
39
  isDeleted: () => boolean;
40
+ /**
41
+ * @returns true if the document is currently unavailable.
42
+ *
43
+ * This will be the case if the document is not found in storage and no peers have shared it with us.
44
+ */
43
45
  isUnavailable: () => boolean;
46
+ /**
47
+ * @returns true if the handle is in one of the given states.
48
+ */
44
49
  inState: (states: HandleState[]) => boolean;
45
50
  /** @hidden */
46
- get state(): StateValue;
51
+ get state(): "idle" | "ready" | "loading" | "requesting" | "awaitingNetwork" | "unavailable" | "deleted";
47
52
  /**
48
- * Use this to block until the document handle has finished loading.
49
- * The async equivalent to checking `inState()`.
50
- * @param awaitStates = [READY]
51
- * @returns
53
+ * @returns a promise that resolves when the document is in one of the given states (if no states
54
+ * are passed, when the document is ready)
55
+ *
56
+ * Use this to block until the document handle has finished loading. The async equivalent to
57
+ * checking `inState()`.
52
58
  */
53
59
  whenReady(awaitStates?: HandleState[]): Promise<void>;
54
60
  /**
55
- * Returns the current state of the Automerge document this handle manages.
56
- * Note that this waits for the handle to be ready if necessary, and currently, if
57
- * loading (or synchronization) fails, will never resolve.
61
+ * @returns the current state of this handle's Automerge document.
58
62
  *
59
- * @param {awaitStates=[READY]} optional states to wait for, such as "LOADING". mostly for internal use.
63
+ * This is the recommended way to access a handle's document. Note that this waits for the handle
64
+ * to be ready if necessary. If loading (or synchronization) fails, this will never resolve.
60
65
  */
61
- doc(awaitStates?: HandleState[]): Promise<A.Doc<T> | undefined>;
66
+ doc(
67
+ /** states to wait for, such as "LOADING". mostly for internal use. */
68
+ awaitStates?: HandleState[]): Promise<A.Doc<T> | undefined>;
62
69
  /**
63
- * Returns the current state of the Automerge document this handle manages, or undefined.
64
- * Useful in a synchronous context. Consider using `await handle.doc()` instead, check `isReady()`,
65
- * or use `whenReady()` if you want to make sure loading is complete first.
70
+ * Synchronously returns the current state of the Automerge document this handle manages, or
71
+ * undefined. Consider using `await handle.doc()` instead. Check `isReady()`, or use `whenReady()`
72
+ * if you want to make sure loading is complete first.
73
+ *
74
+ * Not to be confused with the SyncState of the document, which describes the state of the
75
+ * synchronization process.
66
76
  *
67
- * Do not confuse this with the SyncState of the document, which describes the state of the synchronization process.
77
+ * Note that `undefined` is not a valid Automerge document, so the return from this function is
78
+ * unambigous.
68
79
  *
69
- * Note that `undefined` is not a valid Automerge document so the return from this function is unambigous.
70
- * @returns the current document, or undefined if the document is not ready
80
+ * @returns the current document, or undefined if the document is not ready.
71
81
  */
72
82
  docSync(): A.Doc<T> | undefined;
73
- /** `update` is called by the repo when we receive changes from the network
83
+ /**
84
+ * Returns the current "heads" of the document, akin to a git commit.
85
+ * This precisely defines the state of a document.
86
+ * @returns the current document's heads, or undefined if the document is not ready
87
+ */
88
+ heads(): A.Heads | undefined;
89
+ /**
90
+ * `update` is called by the repo when we receive changes from the network
91
+ * Called by the repo when we receive changes from the network.
74
92
  * @hidden
75
- * */
93
+ */
76
94
  update(callback: (doc: A.Doc<T>) => A.Doc<T>): void;
77
- /** `setRemoteHeads` is called by the repo either when a doc handle changes or we receive new remote heads
95
+ /**
96
+ * Called by the repo either when a doc handle changes or we receive new remote heads.
78
97
  * @hidden
79
98
  */
80
99
  setRemoteHeads(storageId: StorageId, heads: A.Heads): void;
81
- /** Returns the heads of the storageId */
100
+ /** Returns the heads of the storageId. */
82
101
  getRemoteHeads(storageId: StorageId): A.Heads | undefined;
83
- /** `change` is called by the repo when the document is changed locally */
102
+ /**
103
+ * All changes to an Automerge document should be made through this method.
104
+ * Inside the callback, the document should be treated as mutable: all edits will be recorded
105
+ * using a Proxy and translated into operations as part of a single recorded "change".
106
+ *
107
+ * Note that assignment via ES6 spread operators will result in *replacing* the object
108
+ * instead of mutating it which will prevent clean merges. This may be what you want, but
109
+ * `doc.foo = { ...doc.foo, bar: "baz" }` is not equivalent to `doc.foo.bar = "baz"`.
110
+ *
111
+ * Local changes will be stored (by the StorageSubsystem) and synchronized (by the
112
+ * DocSynchronizer) to any peers you are sharing it with.
113
+ *
114
+ * @param callback - A function that takes the current document and mutates it.
115
+ *
116
+ */
84
117
  change(callback: A.ChangeFn<T>, options?: A.ChangeOptions<T>): void;
85
- /** Make a change as if the document were at `heads`
118
+ /**
119
+ * Makes a change as if the document were at `heads`.
86
120
  *
87
121
  * @returns A set of heads representing the concurrent change that was made.
88
122
  */
89
123
  changeAt(heads: A.Heads, callback: A.ChangeFn<T>, options?: A.ChangeOptions<T>): string[] | undefined;
90
- /** Merge another document into this document
91
- *
92
- * @param otherHandle - the handle of the document to merge into this one
124
+ /**
125
+ * Merges another document into this document. Any peers we are sharing changes with will be
126
+ * notified of the changes resulting from the merge.
93
127
  *
94
- * @remarks
95
- * This is a convenience method for
96
- * `handle.change(doc => A.merge(doc, otherHandle.docSync()))`. Any peers
97
- * whom we are sharing changes with will be notified of the changes resulting
98
- * from the merge.
128
+ * @returns the merged document.
99
129
  *
100
- * @throws if either document is not ready or if `otherHandle` is unavailable (`otherHandle.docSync() === undefined`)
130
+ * @throws if either document is not ready or if `otherHandle` is unavailable.
131
+ */
132
+ merge(
133
+ /** the handle of the document to merge into this one */
134
+ otherHandle: DocHandle<T>): void;
135
+ /**
136
+ * Used in testing to mark this document as unavailable.
137
+ * @hidden
101
138
  */
102
- merge(otherHandle: DocHandle<T>): void;
103
139
  unavailable(): void;
104
- /** `request` is called by the repo when the document is not found in storage
140
+ /** Called by the repo when the document is not found in storage.
105
141
  * @hidden
106
142
  * */
107
143
  request(): void;
@@ -109,13 +145,14 @@ export declare class DocHandle<T>//
109
145
  awaitNetwork(): void;
110
146
  /** @hidden */
111
147
  networkReady(): void;
112
- /** `delete` is called by the repo when the document is deleted */
148
+ /** Called by the repo when the document is deleted. */
113
149
  delete(): void;
114
- /** `broadcast` sends an arbitrary ephemeral message out to all reachable peers who would receive sync messages from you
115
- * it has no guarantee of delivery, and is not persisted to the underlying automerge doc in any way.
116
- * messages will have a sending PeerId but this is *not* a useful user identifier.
117
- * a user could have multiple tabs open and would appear as multiple PeerIds.
118
- * every message source must have a unique PeerId.
150
+ /**
151
+ * Sends an arbitrary ephemeral message out to all reachable peers who would receive sync messages
152
+ * from you. It has no guarantee of delivery, and is not persisted to the underlying automerge doc
153
+ * in any way. Messages will have a sending PeerId but this is *not* a useful user identifier (a
154
+ * user could have multiple tabs open and would appear as multiple PeerIds). Every message source
155
+ * must have a unique PeerId.
119
156
  */
120
157
  broadcast(message: unknown): void;
121
158
  }
@@ -130,21 +167,24 @@ export type DocHandleOptions<T> = {
130
167
  /** The number of milliseconds before we mark this document as unavailable if we don't have it and nobody shares it with us. */
131
168
  timeoutDelay?: number;
132
169
  };
133
- export interface DocHandleMessagePayload {
134
- destinationId: PeerId;
135
- documentId: DocumentId;
136
- data: Uint8Array;
170
+ /** These are the events that this DocHandle emits to external listeners */
171
+ export interface DocHandleEvents<T> {
172
+ "heads-changed": (payload: DocHandleEncodedChangePayload<T>) => void;
173
+ change: (payload: DocHandleChangePayload<T>) => void;
174
+ delete: (payload: DocHandleDeletePayload<T>) => void;
175
+ unavailable: (payload: DocHandleUnavailablePayload<T>) => void;
176
+ "ephemeral-message": (payload: DocHandleEphemeralMessagePayload<T>) => void;
177
+ "ephemeral-message-outbound": (payload: DocHandleOutboundEphemeralMessagePayload<T>) => void;
178
+ "remote-heads": (payload: DocHandleRemoteHeadsPayload) => void;
137
179
  }
180
+ /** Emitted when this document's heads have changed */
138
181
  export interface DocHandleEncodedChangePayload<T> {
139
182
  handle: DocHandle<T>;
140
183
  doc: A.Doc<T>;
141
184
  }
142
- export interface DocHandleDeletePayload<T> {
143
- handle: DocHandle<T>;
144
- }
145
- /** Emitted when a document has changed */
185
+ /** Emitted when this document has changed */
146
186
  export interface DocHandleChangePayload<T> {
147
- /** The hande which changed */
187
+ /** The handle that changed */
148
188
  handle: DocHandle<T>;
149
189
  /** The value of the document after the change */
150
190
  doc: A.Doc<T>;
@@ -153,36 +193,32 @@ export interface DocHandleChangePayload<T> {
153
193
  /** Information about the change */
154
194
  patchInfo: A.PatchInfo<T>;
155
195
  }
196
+ /** Emitted when this document is deleted */
197
+ export interface DocHandleDeletePayload<T> {
198
+ handle: DocHandle<T>;
199
+ }
200
+ /** Emitted when this document has been marked unavailable */
201
+ export interface DocHandleUnavailablePayload<T> {
202
+ handle: DocHandle<T>;
203
+ }
204
+ /** Emitted when an ephemeral message is received for the document */
156
205
  export interface DocHandleEphemeralMessagePayload<T> {
157
206
  handle: DocHandle<T>;
158
207
  senderId: PeerId;
159
208
  message: unknown;
160
209
  }
210
+ /** Emitted when an ephemeral message is sent for this document */
161
211
  export interface DocHandleOutboundEphemeralMessagePayload<T> {
162
212
  handle: DocHandle<T>;
163
213
  data: Uint8Array;
164
214
  }
215
+ /** Emitted when we have new remote heads for this document */
165
216
  export interface DocHandleRemoteHeadsPayload {
166
217
  storageId: StorageId;
167
218
  heads: A.Heads;
168
219
  }
169
- export interface DocHandleSyncStatePayload {
170
- peerId: PeerId;
171
- syncState: A.SyncState;
172
- }
173
- export interface DocHandleEvents<T> {
174
- "heads-changed": (payload: DocHandleEncodedChangePayload<T>) => void;
175
- change: (payload: DocHandleChangePayload<T>) => void;
176
- delete: (payload: DocHandleDeletePayload<T>) => void;
177
- unavailable: (payload: DocHandleDeletePayload<T>) => void;
178
- "ephemeral-message": (payload: DocHandleEphemeralMessagePayload<T>) => void;
179
- "ephemeral-message-outbound": (payload: DocHandleOutboundEphemeralMessagePayload<T>) => void;
180
- "remote-heads": (payload: DocHandleRemoteHeadsPayload) => void;
181
- }
182
220
  /**
183
- * The state of a document handle
184
- * @enum
185
- *
221
+ * Possible internal states for a DocHandle
186
222
  */
187
223
  export declare const HandleState: {
188
224
  /** The handle has been created but not yet loaded or requested */
@@ -201,17 +237,5 @@ export declare const HandleState: {
201
237
  readonly UNAVAILABLE: "unavailable";
202
238
  };
203
239
  export type HandleState = (typeof HandleState)[keyof typeof HandleState];
204
- export declare const Event: {
205
- readonly CREATE: "CREATE";
206
- readonly FIND: "FIND";
207
- readonly REQUEST: "REQUEST";
208
- readonly REQUEST_COMPLETE: "REQUEST_COMPLETE";
209
- readonly AWAIT_NETWORK: "AWAIT_NETWORK";
210
- readonly NETWORK_READY: "NETWORK_READY";
211
- readonly UPDATE: "UPDATE";
212
- readonly TIMEOUT: "TIMEOUT";
213
- readonly DELETE: "DELETE";
214
- readonly MARK_UNAVAILABLE: "MARK_UNAVAILABLE";
215
- };
216
240
  export declare const IDLE: "idle", LOADING: "loading", AWAITING_NETWORK: "awaitingNetwork", REQUESTING: "requesting", READY: "ready", DELETED: "deleted", UNAVAILABLE: "unavailable";
217
241
  //# sourceMappingURL=DocHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocHandle.d.ts","sourceRoot":"","sources":["../src/DocHandle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,2BAA2B,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EASL,UAAU,EAEX,MAAM,QAAQ,CAAA;AAMf,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;KAWK;AACL,qBAAa,SAAS,CAAC,CAAC,CAAE,EAAE;AAC1B,SAAQ,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;;IAmB/B,UAAU,EAAE,UAAU;IAX/B;;;;OAIG;IACH,IAAI,GAAG,IAAI,YAAY,CAEtB;IAED,cAAc;gBAEL,UAAU,EAAE,UAAU,EAC7B,OAAO,GAAE,gBAAgB,CAAC,CAAC,CAAM;IAyMnC;;;;OAIG;IACH,OAAO,gBAA0C;IACjD;;;;;OAKG;IACH,SAAS,gBAA4C;IACrD,aAAa,gBAAgD;IAC7D,OAAO,WAAY,WAAW,EAAE,a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