@procedures/store 0.14.0 → 0.14.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @procedures/store
2
2
 
3
+ ## 0.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fc968f6: Fixed: `@procedures/geo`, `@procedures/ics` and `@procedures/splay` import `@procedures/client/browser`, not the root of `@procedures/client` (CLI-39). The root also exports `HttpServerTransport`, which imports `http`. Thus a browser build with Vite found `http` and gave a warning. The exports of the packages do not change.
8
+
9
+ New: each package that operates in a browser names its browser entries in the field `client.browser` of its `package.json`. A CI check bundles each of these entries for a browser with esbuild. The check fails when an import reaches a Node built-in, with or without the prefix `node:`. The root of `@procedures/client` joins the check after CLI-6. `@procedures/splay` joins it when `splay.bridge.info` reads its version without `node:fs/promises`.
10
+ - 26a145d: The new entry `@procedures/store/browser` has the parts of the store that run in a browser (roadmap CLI-19). It exports `HybridStorage` with its errors, `ApiStorage`, `EventsChangeFeed` and all of `@procedures/store/indexeddb`. No module of the entry imports a module of Node. The entry does not have `FileProgramStore` or `FileQueueStore`, because they use `node:fs`.
11
+
12
+ `HybridStorage`, `ApiStorage` and `EventsChangeFeed` import `@procedures/client/browser` and not the root of the client, because the root imports `http` and `ws`. The classes are the same as the classes of the root. PATCH: the change adds an entry, and nothing changes for the existing imports.
13
+ - Updated dependencies [85999c1]
14
+ - Updated dependencies [fc968f6]
15
+ - Updated dependencies [dc7a462]
16
+ - Updated dependencies [e091108]
17
+ - Updated dependencies [073e4c3]
18
+ - Updated dependencies [6969637]
19
+ - @procedures/client@0.14.1
20
+ - @procedures/collections@0.14.1
21
+
3
22
  ## 0.14.0
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -286,6 +286,34 @@ const users = new HybridStorage(new ApiStorage(client, { collection: "users" }),
286
286
 
287
287
  `createSyncedRegistry({ type: "hybrid", client, mode })` takes the first mode. `setMode()` of the registry changes the mode of its storage.
288
288
 
289
+ ## The browser entry
290
+
291
+ The entry `@procedures/store/browser` has the parts of the store that run in a browser (roadmap CLI-19). A page imports this entry and not the package root.
292
+
293
+ - `HybridStorage`, its errors and its types.
294
+ - `ApiStorage`, the remote storage over the collection procedures of a server.
295
+ - `EventsChangeFeed`, the push feed of the remote changes.
296
+ - All of `@procedures/store/indexeddb`: the IndexedDB stores and their fallbacks in memory.
297
+
298
+ No module of the entry imports a module of Node. The modules import `@procedures/client/browser` and not the root of the client, because the root imports `http` and `ws`. The test `src/browser.test.ts` examines the imports of each module of the entry. The entry is in `client.browser` of `package.json`, so the CI check of the browser entries (`scripts/check-browser-entries.mjs`) bundles it for a browser too.
299
+
300
+ The entry does not have these parts:
301
+
302
+ - `FileProgramStore` and `FileQueueStore`. They use `node:fs`.
303
+ - The procedures, the synced registry and the serialization. They import the root of the client. They are in the package root, for Node.
304
+
305
+ An import of the entry registers nothing. Its classes are the same as the classes of the package root.
306
+
307
+ ```ts
308
+ import { ApiStorage, EventsChangeFeed, HybridStorage, IndexedDbQueueStore, IndexedDbSyncStateStore } from "@procedures/store/browser";
309
+
310
+ const users = new HybridStorage(new ApiStorage(client, { collection: "users" }), {
311
+ queueStore: new IndexedDbQueueStore("users-queue"),
312
+ syncState: new IndexedDbSyncStateStore("users-sync"),
313
+ feed: new EventsChangeFeed(client, { collection: "users" }),
314
+ });
315
+ ```
316
+
289
317
  ## The root of the files
290
318
 
291
319
  No input of `procedure.store`, `procedure.load` and `procedure.sync` names a file. Under the root of a host (`mark --fs-root`, `procedure-server --fs-root`, `MCP_FS_ROOT`), they use the program store of the host. The host chooses the file of a file store, also outside the root. A loaded program is data-driven, so its nested calls get their own rules.