ahmed-rivet-convex 2.1.0 → 2.2.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 +22 -4
- package/dist/{chunk-YBIF2FS4.js → chunk-7WH525PL.js} +4 -20
- package/dist/chunk-7WH525PL.js.map +7 -0
- package/dist/{chunk-PRRVF77E.js → chunk-RIN53NKR.js} +95 -44
- package/dist/chunk-RIN53NKR.js.map +7 -0
- package/dist/{lazy-inspector-OFHXCXCQ.js → lazy-inspector-UQUFJWOZ.js} +2 -2
- package/dist/react.js +28 -53
- package/dist/react.js.map +3 -3
- package/dist/zero/src/adapters/convex.d.ts +63 -0
- package/dist/zero/src/protocolbase.d.ts +1 -0
- package/dist/zero-client/src/client/context.d.ts +2 -3
- package/dist/zero-client/src/client/zero-rep.d.ts +1 -1
- package/dist/zero-client/src/client/zero.d.ts +12 -0
- package/dist/zero-protocol/src/ast.d.ts +1 -1
- package/dist/zero.js +385 -2
- package/dist/zero.js.map +4 -4
- package/package.json +2 -2
- package/dist/chunk-PRRVF77E.js.map +0 -7
- package/dist/chunk-YBIF2FS4.js.map +0 -7
- package/dist/shared/src/deep-clone.d.ts +0 -4
- /package/dist/{lazy-inspector-OFHXCXCQ.js.map → lazy-inspector-UQUFJWOZ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -7,16 +7,34 @@ Convex as the source of truth.
|
|
|
7
7
|
|
|
8
8
|
Only the browser client is published:
|
|
9
9
|
|
|
10
|
-
- `ahmed-rivet-convex` — Zero, schema builders, and
|
|
10
|
+
- `ahmed-rivet-convex` — Zero, schema builders, client types, and the generic
|
|
11
|
+
`ConvexSyncAdapter`.
|
|
11
12
|
- `ahmed-rivet-convex/react` — `ZeroProvider`, `useZero`, and `useQuery`.
|
|
12
13
|
|
|
13
14
|
The upstream server, PostgreSQL, CLI, Solid, React Native, and Zero Cache
|
|
14
15
|
Modules remain in the monorepo for development and source comparison, but are
|
|
15
16
|
not part of the npm artifact.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
The generic adapter is available from the package root:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {ConvexSyncAdapter} from 'ahmed-rivet-convex';
|
|
22
|
+
|
|
23
|
+
const adapter = new ConvexSyncAdapter({
|
|
24
|
+
zero,
|
|
25
|
+
orgId,
|
|
26
|
+
tables: ['issues', 'comments'],
|
|
27
|
+
primaryKeys: {issues: 'id', comments: 'id'},
|
|
28
|
+
convexBatchCrud,
|
|
29
|
+
convexQuery,
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Tables omitted from a Convex response are untouched. A table present with an
|
|
34
|
+
empty array is authoritatively cleared. `pokeDirect()` resolves only after the
|
|
35
|
+
new Zero head is durable in IndexedDB, and adapters call `markTablesReady()`
|
|
36
|
+
only after that authoritative reconciliation succeeds. `localHydrationComplete`
|
|
37
|
+
is a separate signal for warm-cache rendering.
|
|
20
38
|
|
|
21
39
|
## Release checks
|
|
22
40
|
|
|
@@ -623,7 +623,7 @@ function* mergeIterables(iterables, comparator, distinct = false) {
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
// ../replicache/src/config.ts
|
|
626
|
-
var skipFreezeUnlessOptedIn = isProd || process.env.NEXT_PUBLIC_ZERO_DEEP_FREEZE !== "1";
|
|
626
|
+
var skipFreezeUnlessOptedIn = isProd || process.env.NODE_ENV !== "test" && process.env.NEXT_PUBLIC_ZERO_DEEP_FREEZE !== "1";
|
|
627
627
|
|
|
628
628
|
// ../replicache/src/frozen-json.ts
|
|
629
629
|
var deepFrozenObjects = /* @__PURE__ */ new WeakSet();
|
|
@@ -7837,27 +7837,11 @@ var ArrayView = class {
|
|
|
7837
7837
|
}
|
|
7838
7838
|
#hydrate() {
|
|
7839
7839
|
this.#dirty = true;
|
|
7840
|
-
if (!this.#format.singular) {
|
|
7840
|
+
if (!this.#format.singular && !this.#schema.isHidden && Object.keys(this.#format.relationships).length === 0) {
|
|
7841
7841
|
const list = this.#root[""];
|
|
7842
7842
|
if (Array.isArray(list)) {
|
|
7843
7843
|
for (const node of this.#input.fetch({})) {
|
|
7844
|
-
|
|
7845
|
-
for (const [rel, childFormat] of Object.entries(this.#format.relationships)) {
|
|
7846
|
-
if (childFormat === void 0) {
|
|
7847
|
-
continue;
|
|
7848
|
-
}
|
|
7849
|
-
const children = node.relationships[rel];
|
|
7850
|
-
if (children) {
|
|
7851
|
-
const childList = [];
|
|
7852
|
-
for (const childNode of children()) {
|
|
7853
|
-
childList.push({ ...childNode.row, [refCountSymbol]: 1 });
|
|
7854
|
-
}
|
|
7855
|
-
entry[rel] = childFormat.singular ? childList[0] ?? void 0 : childList;
|
|
7856
|
-
} else {
|
|
7857
|
-
entry[rel] = childFormat.singular ? void 0 : [];
|
|
7858
|
-
}
|
|
7859
|
-
}
|
|
7860
|
-
list.push(entry);
|
|
7844
|
+
list.push({ ...node.row, [refCountSymbol]: 1 });
|
|
7861
7845
|
}
|
|
7862
7846
|
this.flush();
|
|
7863
7847
|
return;
|
|
@@ -8735,4 +8719,4 @@ export {
|
|
|
8735
8719
|
Client,
|
|
8736
8720
|
TDigest
|
|
8737
8721
|
};
|
|
8738
|
-
//# sourceMappingURL=chunk-
|
|
8722
|
+
//# sourceMappingURL=chunk-7WH525PL.js.map
|