@rocicorp/zero 0.23.2025090100 → 0.23.2025090401

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 (41) hide show
  1. package/out/{chunk-FMWNU2YJ.js → chunk-VG6XPTYD.js} +2 -2
  2. package/out/{chunk-6USDOK3X.js → chunk-ZFOMEI7F.js} +28 -16
  3. package/out/chunk-ZFOMEI7F.js.map +7 -0
  4. package/out/react-native.js +68 -85
  5. package/out/react-native.js.map +2 -2
  6. package/out/react.js +1 -1
  7. package/out/replicache/src/expo/store.d.ts +2 -3
  8. package/out/replicache/src/expo/store.d.ts.map +1 -1
  9. package/out/replicache/src/kv/sqlite-store.d.ts +1 -8
  10. package/out/replicache/src/kv/sqlite-store.d.ts.map +1 -1
  11. package/out/replicache/src/persist/collect-idb-databases.d.ts.map +1 -1
  12. package/out/solid.js +2 -2
  13. package/out/zero/package.json +1 -1
  14. package/out/zero-cache/src/db/lite-tables.d.ts.map +1 -1
  15. package/out/zero-cache/src/db/lite-tables.js +1 -0
  16. package/out/zero-cache/src/db/lite-tables.js.map +1 -1
  17. package/out/zero-cache/src/db/specs.d.ts +5 -0
  18. package/out/zero-cache/src/db/specs.d.ts.map +1 -1
  19. package/out/zero-cache/src/db/specs.js.map +1 -1
  20. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +1 -1
  21. package/out/zero-cache/src/services/view-syncer/client-schema.js +10 -1
  22. package/out/zero-cache/src/services/view-syncer/client-schema.js.map +1 -1
  23. package/out/zero-protocol/src/client-schema.d.ts +2 -0
  24. package/out/zero-protocol/src/client-schema.d.ts.map +1 -1
  25. package/out/zero-protocol/src/client-schema.js +9 -4
  26. package/out/zero-protocol/src/client-schema.js.map +1 -1
  27. package/out/zero-protocol/src/connect.d.ts +2 -0
  28. package/out/zero-protocol/src/connect.d.ts.map +1 -1
  29. package/out/zero-protocol/src/protocol-version.d.ts +1 -1
  30. package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
  31. package/out/zero-protocol/src/protocol-version.js +2 -1
  32. package/out/zero-protocol/src/protocol-version.js.map +1 -1
  33. package/out/zero-protocol/src/up.d.ts +1 -0
  34. package/out/zero-protocol/src/up.d.ts.map +1 -1
  35. package/out/zero-schema/src/builder/schema-builder.d.ts.map +1 -1
  36. package/out/zero-schema/src/builder/schema-builder.js +2 -1
  37. package/out/zero-schema/src/builder/schema-builder.js.map +1 -1
  38. package/out/zero.js +2 -2
  39. package/package.json +1 -1
  40. package/out/chunk-6USDOK3X.js.map +0 -7
  41. /package/out/{chunk-FMWNU2YJ.js.map → chunk-VG6XPTYD.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clientToServer
3
- } from "./chunk-6USDOK3X.js";
3
+ } from "./chunk-ZFOMEI7F.js";
4
4
  import {
5
5
  AbstractQuery,
6
6
  ExpressionBuilder,
@@ -346,4 +346,4 @@ export {
346
346
  withValidation,
347
347
  createBuilder
348
348
  };
349
- //# sourceMappingURL=chunk-FMWNU2YJ.js.map
349
+ //# sourceMappingURL=chunk-VG6XPTYD.js.map
@@ -1415,8 +1415,7 @@ async function dropAllDatabases(opts) {
1415
1415
  const store = new IDBDatabasesStore(kvStoreProvider.create);
1416
1416
  const databases = await store.getDatabases();
1417
1417
  const dbNames = Object.values(databases).map((db) => db.name);
1418
- const result = await dropDatabases(store, dbNames, kvStoreProvider.drop);
1419
- return result;
1418
+ return dropDatabases(store, dbNames, kvStoreProvider.drop);
1420
1419
  }
1421
1420
  function canDatabaseBeCollectedAndGetDeletedClientIDs(enableMutationRecovery, perdag) {
1422
1421
  return withRead(perdag, async (read) => {
@@ -1679,7 +1678,10 @@ var columnSchemaSchema = valita_exports.object({
1679
1678
  type: valueTypeSchema
1680
1679
  });
1681
1680
  var tableSchemaSchema = valita_exports.object({
1682
- columns: valita_exports.record(columnSchemaSchema)
1681
+ columns: valita_exports.record(columnSchemaSchema),
1682
+ // TODO: Make this non-optional when bumping the
1683
+ // MIN_SERVER_SUPPORTED_SYNC_PROTOCOL to 30+.
1684
+ primaryKey: valita_exports.array(valita_exports.string()).optional()
1683
1685
  });
1684
1686
  var clientSchemaSchema = valita_exports.object({
1685
1687
  tables: valita_exports.record(tableSchemaSchema)
@@ -1691,7 +1693,13 @@ function normalizeClientSchema(schema) {
1691
1693
  schema.tables,
1692
1694
  (tables) => tables.sort(keyCmp).map(([name, table2]) => [
1693
1695
  name,
1694
- { columns: mapAllEntries(table2.columns, (e) => e.sort(keyCmp)) }
1696
+ {
1697
+ columns: mapAllEntries(table2.columns, (e) => e.sort(keyCmp)),
1698
+ primaryKey: must(
1699
+ table2.primaryKey,
1700
+ `new clients always specify a primaryKey`
1701
+ ).sort()
1702
+ }
1695
1703
  ])
1696
1704
  )
1697
1705
  };
@@ -1760,15 +1768,19 @@ function checkRelationship(relationships, tableName, tables) {
1760
1768
  }
1761
1769
  function clientSchemaFrom(schema) {
1762
1770
  const client = {
1763
- tables: mapEntries(schema.tables, (name, { serverName, columns }) => [
1764
- serverName ?? name,
1765
- {
1766
- columns: mapEntries(columns, (name2, { serverName: serverName2, type }) => [
1767
- serverName2 ?? name2,
1768
- { type }
1769
- ])
1770
- }
1771
- ])
1771
+ tables: mapEntries(
1772
+ schema.tables,
1773
+ (name, { serverName, columns, primaryKey }) => [
1774
+ serverName ?? name,
1775
+ {
1776
+ columns: mapEntries(columns, (name2, { serverName: serverName2, type }) => [
1777
+ serverName2 ?? name2,
1778
+ { type }
1779
+ ]),
1780
+ primaryKey: [...primaryKey]
1781
+ }
1782
+ ]
1783
+ )
1772
1784
  };
1773
1785
  const clientSchema = normalizeClientSchema(client);
1774
1786
  const hash = h64(JSON.stringify(clientSchema)).toString(36);
@@ -6364,7 +6376,7 @@ var downstreamSchema = valita_exports.union(
6364
6376
  );
6365
6377
 
6366
6378
  // ../zero-protocol/src/protocol-version.ts
6367
- var PROTOCOL_VERSION = 29;
6379
+ var PROTOCOL_VERSION = 30;
6368
6380
  var MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 18;
6369
6381
  assert(MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION);
6370
6382
 
@@ -8668,7 +8680,7 @@ function makeMessage(message, context, logLevel) {
8668
8680
  }
8669
8681
 
8670
8682
  // ../zero-client/src/client/version.ts
8671
- var version2 = "0.23.2025090100";
8683
+ var version2 = "0.23.2025090401";
8672
8684
 
8673
8685
  // ../zero-client/src/client/log-options.ts
8674
8686
  var LevelFilterLogSink = class {
@@ -11609,4 +11621,4 @@ export {
11609
11621
  update_needed_reason_type_enum_exports,
11610
11622
  Zero
11611
11623
  };
11612
- //# sourceMappingURL=chunk-6USDOK3X.js.map
11624
+ //# sourceMappingURL=chunk-ZFOMEI7F.js.map