@rocicorp/zero 0.17.2025031900 → 0.17.2025031904

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/out/advanced.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./chunk-ULOTOBTC.js";
2
2
  import {
3
3
  applyChange
4
- } from "./chunk-7ARRNDLF.js";
4
+ } from "./chunk-MJCITZ5S.js";
5
5
  import "./chunk-424PT5DM.js";
6
6
  export {
7
7
  applyChange
@@ -21,7 +21,7 @@ import {
21
21
  throwInvalidType,
22
22
  unreachable,
23
23
  valuesEqual
24
- } from "./chunk-7ARRNDLF.js";
24
+ } from "./chunk-MJCITZ5S.js";
25
25
  import {
26
26
  __export,
27
27
  __reExport
@@ -10132,6 +10132,8 @@ var Take = class {
10132
10132
  #limit;
10133
10133
  #partitionKey;
10134
10134
  #partitionKeyComparator;
10135
+ // Fetch overlay needed for some split push cases.
10136
+ #rowHiddenFromFetch;
10135
10137
  #output = throwOutput;
10136
10138
  constructor(input, storage, limit, partitionKey) {
10137
10139
  assert(limit >= 0);
@@ -10167,6 +10169,12 @@ var Take = class {
10167
10169
  if (this.getSchema().compareRows(takeState.bound, inputNode.row) < 0) {
10168
10170
  return;
10169
10171
  }
10172
+ if (this.#rowHiddenFromFetch && this.getSchema().compareRows(
10173
+ this.#rowHiddenFromFetch,
10174
+ inputNode.row
10175
+ ) === 0) {
10176
+ continue;
10177
+ }
10170
10178
  yield inputNode;
10171
10179
  }
10172
10180
  return;
@@ -10309,14 +10317,16 @@ var Take = class {
10309
10317
  type: "remove",
10310
10318
  node: boundNode
10311
10319
  };
10312
- this.#output.push(change);
10313
10320
  this.#setTakeState(
10314
10321
  takeStateKey,
10315
10322
  takeState.size,
10316
10323
  beforeBoundNode === void 0 || compareRows(change.node.row, beforeBoundNode.row) > 0 ? change.node.row : beforeBoundNode.row,
10317
10324
  maxBound
10318
10325
  );
10319
- this.#output.push(removeChange);
10326
+ this.#withRowHiddenFromFetch(change.node.row, () => {
10327
+ this.#output.push(removeChange);
10328
+ });
10329
+ this.#output.push(change);
10320
10330
  } else if (change.type === "remove") {
10321
10331
  if (takeState.bound === void 0) {
10322
10332
  return;
@@ -10487,19 +10497,21 @@ var Take = class {
10487
10497
  }),
10488
10498
  2
10489
10499
  );
10490
- this.#output.push({
10491
- type: "add",
10492
- node: change.node
10493
- });
10494
10500
  this.#setTakeState(
10495
10501
  takeStateKey,
10496
10502
  takeState.size,
10497
10503
  newBoundNode.row,
10498
10504
  maxBound
10499
10505
  );
10506
+ this.#withRowHiddenFromFetch(change.node.row, () => {
10507
+ this.#output.push({
10508
+ type: "remove",
10509
+ node: oldBoundNode
10510
+ });
10511
+ });
10500
10512
  this.#output.push({
10501
- type: "remove",
10502
- node: oldBoundNode
10513
+ type: "add",
10514
+ node: change.node
10503
10515
  });
10504
10516
  return;
10505
10517
  }
@@ -10543,6 +10555,14 @@ var Take = class {
10543
10555
  }
10544
10556
  unreachable();
10545
10557
  }
10558
+ #withRowHiddenFromFetch(row, fn) {
10559
+ this.#rowHiddenFromFetch = row;
10560
+ try {
10561
+ fn();
10562
+ } finally {
10563
+ this.#rowHiddenFromFetch = void 0;
10564
+ }
10565
+ }
10546
10566
  #setTakeState(takeStateKey, size, bound, maxBound) {
10547
10567
  this.#storage.set(takeStateKey, {
10548
10568
  size,
@@ -11078,7 +11098,6 @@ var ArrayView = class {
11078
11098
  onDestroy;
11079
11099
  #dirty = false;
11080
11100
  #complete = false;
11081
- #refCountMap = /* @__PURE__ */ new WeakMap();
11082
11101
  constructor(input, format = { singular: false, relationships: {} }, queryComplete = true) {
11083
11102
  this.#input = input;
11084
11103
  this.#schema = input.getSchema();
@@ -11128,22 +11147,14 @@ var ArrayView = class {
11128
11147
  { type: "add", node },
11129
11148
  this.#schema,
11130
11149
  "",
11131
- this.#format,
11132
- this.#refCountMap
11150
+ this.#format
11133
11151
  );
11134
11152
  }
11135
11153
  this.flush();
11136
11154
  }
11137
11155
  push(change) {
11138
11156
  this.#dirty = true;
11139
- applyChange(
11140
- this.#root,
11141
- change,
11142
- this.#schema,
11143
- "",
11144
- this.#format,
11145
- this.#refCountMap
11146
- );
11157
+ applyChange(this.#root, change, this.#schema, "", this.#format);
11147
11158
  }
11148
11159
  flush() {
11149
11160
  if (!this.#dirty) {
@@ -14515,7 +14526,7 @@ function makeMessage(message, context, logLevel) {
14515
14526
  }
14516
14527
 
14517
14528
  // ../zero-client/src/client/version.ts
14518
- var version2 = "0.17.2025031900";
14529
+ var version2 = "0.17.2025031904";
14519
14530
 
14520
14531
  // ../zero-client/src/client/log-options.ts
14521
14532
  var LevelFilterLogSink = class {
@@ -16791,4 +16802,4 @@ export {
16791
16802
  escapeLike,
16792
16803
  Zero
16793
16804
  };
16794
- //# sourceMappingURL=chunk-VEVC5RHF.js.map
16805
+ //# sourceMappingURL=chunk-BPGCXNAT.js.map