@rocicorp/zero 0.25.0-canary.3 → 0.25.0-canary.4

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 (49) hide show
  1. package/out/{chunk-SRLXXPNB.js → chunk-3KJ5OEIB.js} +4 -4
  2. package/out/chunk-ASRS2LFV.js +35 -0
  3. package/out/chunk-ASRS2LFV.js.map +7 -0
  4. package/out/{chunk-RYFBHAD4.js → chunk-ECUMGQGC.js} +4 -17
  5. package/out/chunk-ECUMGQGC.js.map +7 -0
  6. package/out/{chunk-U2KJIWVC.js → chunk-EZM3XBAB.js} +2 -47
  7. package/out/chunk-EZM3XBAB.js.map +7 -0
  8. package/out/{chunk-IWL6EEA6.js → chunk-HE4M4K7Q.js} +585 -71
  9. package/out/chunk-HE4M4K7Q.js.map +7 -0
  10. package/out/{chunk-JKP7HDC6.js → chunk-TAUDS4QP.js} +48 -7
  11. package/out/chunk-TAUDS4QP.js.map +7 -0
  12. package/out/{chunk-5H7WNLPK.js → chunk-ZZXMKAAG.js} +2 -2
  13. package/out/expo-sqlite.js +4 -4
  14. package/out/{lazy-inspector-4CO3DXP5.js → lazy-inspector-XLKVABX2.js} +6 -6
  15. package/out/op-sqlite.js +3 -3
  16. package/out/react-native.js +4 -4
  17. package/out/react.js +4 -4
  18. package/out/replicache/src/kv/sqlite-store.d.ts +1 -7
  19. package/out/replicache/src/kv/sqlite-store.d.ts.map +1 -1
  20. package/out/replicache/src/sqlite.d.ts +1 -1
  21. package/out/replicache/src/sqlite.d.ts.map +1 -1
  22. package/out/solid.js +5 -5
  23. package/out/sqlite.js +3 -5
  24. package/out/zero/package.json +1 -1
  25. package/out/zero-cache/src/db/pg-to-lite.d.ts +10 -0
  26. package/out/zero-cache/src/db/pg-to-lite.d.ts.map +1 -1
  27. package/out/zero-cache/src/db/pg-to-lite.js +16 -2
  28. package/out/zero-cache/src/db/pg-to-lite.js.map +1 -1
  29. package/out/zero-cache/src/services/change-source/column-metadata.d.ts +10 -3
  30. package/out/zero-cache/src/services/change-source/column-metadata.d.ts.map +1 -1
  31. package/out/zero-cache/src/services/change-source/column-metadata.js +26 -13
  32. package/out/zero-cache/src/services/change-source/column-metadata.js.map +1 -1
  33. package/out/zero-cache/src/services/change-source/replica-schema.d.ts.map +1 -1
  34. package/out/zero-cache/src/services/change-source/replica-schema.js +13 -0
  35. package/out/zero-cache/src/services/change-source/replica-schema.js.map +1 -1
  36. package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +1 -1
  37. package/out/zero-cache/src/services/replicator/change-processor.js +33 -0
  38. package/out/zero-cache/src/services/replicator/change-processor.js.map +1 -1
  39. package/out/zero.js +6 -7
  40. package/package.json +1 -1
  41. package/out/chunk-HYS7YLNL.js +0 -575
  42. package/out/chunk-HYS7YLNL.js.map +0 -7
  43. package/out/chunk-IWL6EEA6.js.map +0 -7
  44. package/out/chunk-JKP7HDC6.js.map +0 -7
  45. package/out/chunk-RYFBHAD4.js.map +0 -7
  46. package/out/chunk-U2KJIWVC.js.map +0 -7
  47. /package/out/{chunk-SRLXXPNB.js.map → chunk-3KJ5OEIB.js.map} +0 -0
  48. /package/out/{chunk-5H7WNLPK.js.map → chunk-ZZXMKAAG.js.map} +0 -0
  49. /package/out/{lazy-inspector-4CO3DXP5.js.map → lazy-inspector-XLKVABX2.js.map} +0 -0
@@ -9,12 +9,9 @@ import {
9
9
  deepFreeze,
10
10
  hasOwn,
11
11
  isProd,
12
- makeClientID,
13
- randomUint64,
14
12
  throwInvalidType,
15
- unreachable,
16
- withWrite
17
- } from "./chunk-U2KJIWVC.js";
13
+ unreachable
14
+ } from "./chunk-EZM3XBAB.js";
18
15
  import {
19
16
  __export,
20
17
  __reExport
@@ -433,6 +430,13 @@ function getSizeOfEntry(key, value) {
433
430
  return entryFixed + getSizeOfValue(key) + getSizeOfValue(value);
434
431
  }
435
432
 
433
+ // ../shared/src/random-uint64.ts
434
+ function randomUint64() {
435
+ const high = Math.floor(Math.random() * 4294967295);
436
+ const low = Math.floor(Math.random() * 4294967295);
437
+ return BigInt(high) << 32n | BigInt(low);
438
+ }
439
+
436
440
  // ../replicache/src/hash.ts
437
441
  var STRING_LENGTH = 22;
438
442
  var hashRe = /^[0-9a-v-]+$/;
@@ -1897,6 +1901,29 @@ function readIndexesForRead(commit, dagRead, formatVersion) {
1897
1901
  return m;
1898
1902
  }
1899
1903
 
1904
+ // ../replicache/src/with-transactions.ts
1905
+ function withRead(store, fn) {
1906
+ return using(store.read(), fn);
1907
+ }
1908
+ function withWriteNoImplicitCommit(store, fn) {
1909
+ return using(store.write(), fn);
1910
+ }
1911
+ function withWrite(store, fn) {
1912
+ return using(store.write(), async (write) => {
1913
+ const result = await fn(write);
1914
+ await write.commit();
1915
+ return result;
1916
+ });
1917
+ }
1918
+ async function using(x, fn) {
1919
+ const write = await x;
1920
+ try {
1921
+ return await fn(write);
1922
+ } finally {
1923
+ write.release();
1924
+ }
1925
+ }
1926
+
1900
1927
  // ../replicache/src/index-defs.ts
1901
1928
  var indexDefinitionSchema = readonlyObject({
1902
1929
  prefix: valita_exports.string().optional(),
@@ -2612,6 +2639,15 @@ async function createIndexBTree(lc, dagWrite, valueMap, prefix, jsonPointer, all
2612
2639
  var clientGroupIDSchema = valita_exports.string();
2613
2640
  var clientIDSchema = valita_exports.string();
2614
2641
 
2642
+ // ../replicache/src/persist/make-client-id.ts
2643
+ function makeClientID() {
2644
+ const length = 18;
2645
+ const high = randomUint64();
2646
+ const low = randomUint64();
2647
+ const combined = high << 64n | low;
2648
+ return combined.toString(32).slice(-length).padStart(length, "0");
2649
+ }
2650
+
2615
2651
  // ../replicache/src/persist/clients.ts
2616
2652
  var clientV5Schema = readonlyObject({
2617
2653
  heartbeatTimestampMs: valita_exports.number(),
@@ -3864,7 +3900,7 @@ var Inspector = class {
3864
3900
  queryDelegate,
3865
3901
  rep,
3866
3902
  getSocket,
3867
- lazy: import("./lazy-inspector-4CO3DXP5.js")
3903
+ lazy: import("./lazy-inspector-XLKVABX2.js")
3868
3904
  };
3869
3905
  this.client = new Client(this.#delegate, rep.clientID, rep.clientGroupID);
3870
3906
  this.clientGroup = this.client.clientGroup;
@@ -4023,12 +4059,17 @@ export {
4023
4059
  newWriteSnapshotDD31,
4024
4060
  clientGroupIDSchema,
4025
4061
  clientIDSchema,
4062
+ withRead,
4063
+ withWriteNoImplicitCommit,
4064
+ withWrite,
4065
+ using,
4026
4066
  getClientGroups,
4027
4067
  setClientGroups,
4028
4068
  setClientGroup,
4029
4069
  getClientGroup,
4030
4070
  clientGroupHasPendingMutations,
4031
4071
  disableClientGroup,
4072
+ makeClientID,
4032
4073
  assertClientV6,
4033
4074
  getClients,
4034
4075
  ClientStateNotFoundError,
@@ -4085,4 +4126,4 @@ export {
4085
4126
  TDigest,
4086
4127
  Inspector
4087
4128
  };
4088
- //# sourceMappingURL=chunk-JKP7HDC6.js.map
4129
+ //# sourceMappingURL=chunk-TAUDS4QP.js.map