jazz-tools 0.13.29 → 0.13.31

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.13.29 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.13.31 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -11,12 +11,12 @@
11
11
  ESM Build start
12
12
  ESM dist/index.js 1.48 KB
13
13
  ESM dist/testing.js 6.27 KB
14
- ESM dist/chunk-LMV6J7GN.js 122.85 KB
14
+ ESM dist/chunk-IJU4XPFS.js 123.33 KB
15
15
  ESM dist/index.js.map 258.00 B
16
16
  ESM dist/testing.js.map 12.38 KB
17
- ESM dist/chunk-LMV6J7GN.js.map 281.50 KB
18
- ESM ⚡️ Build success in 54ms
17
+ ESM dist/chunk-IJU4XPFS.js.map 282.34 KB
18
+ ESM ⚡️ Build success in 50ms
19
19
 
20
- > jazz-tools@0.13.29 types /home/runner/_work/jazz/jazz/packages/jazz-tools
20
+ > jazz-tools@0.13.31 types /home/runner/_work/jazz/jazz/packages/jazz-tools
21
21
  > tsc --outDir dist
22
22
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.13.31
4
+
5
+ ### Patch Changes
6
+
7
+ - e5b170f: Add $onError option to resolve, to be able to catch errors inside of the deep loading
8
+ - Updated dependencies [d63716a]
9
+ - Updated dependencies [d5edad7]
10
+ - cojson@0.13.31
11
+
12
+ ## 0.13.30
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [07dd2c5]
17
+ - cojson@0.13.30
18
+
3
19
  ## 0.13.29
4
20
 
5
21
  ### Patch Changes
@@ -192,6 +192,7 @@ var SubscriptionScope = class _SubscriptionScope {
192
192
  this.idsSubscribed = /* @__PURE__ */ new Set();
193
193
  this.autoloaded = /* @__PURE__ */ new Set();
194
194
  this.autoloadedKeys = /* @__PURE__ */ new Set();
195
+ this.skipInvalidKeys = /* @__PURE__ */ new Set();
195
196
  this.totalValidTransactions = 0;
196
197
  this.silenceUpdates = false;
197
198
  this.handleChildUpdate = (id, value, key) => {
@@ -293,12 +294,18 @@ var SubscriptionScope = class _SubscriptionScope {
293
294
  if (this.autoloaded.has(key)) {
294
295
  continue;
295
296
  }
297
+ if (this.skipInvalidKeys.has(key)) {
298
+ continue;
299
+ }
296
300
  errorType = value.type;
297
301
  if (value.issues) {
298
302
  issues.push(...value.issues);
299
303
  }
300
304
  }
301
- for (const value of this.validationErrors.values()) {
305
+ for (const [key, value] of this.validationErrors.entries()) {
306
+ if (this.skipInvalidKeys.has(key)) {
307
+ continue;
308
+ }
302
309
  errorType = value.type;
303
310
  if (value.issues) {
304
311
  issues.push(...value.issues);
@@ -350,7 +357,8 @@ var SubscriptionScope = class _SubscriptionScope {
350
357
  if (this.resolve.$each || key in this.resolve) {
351
358
  return;
352
359
  }
353
- this.resolve[key] = true;
360
+ const resolve = this.resolve;
361
+ resolve[key] = true;
354
362
  this.autoloadedKeys.add(key);
355
363
  if (this.value.type !== "loaded") {
356
364
  return;
@@ -467,6 +475,9 @@ var SubscriptionScope = class _SubscriptionScope {
467
475
  return hasChanged;
468
476
  }
469
477
  loadCoMapKey(map, key, depth) {
478
+ if (key === "$onError") {
479
+ return void 0;
480
+ }
470
481
  const id = map._raw.get(key);
471
482
  const descriptor = map.getDescriptor(key);
472
483
  if (!descriptor) {
@@ -541,6 +552,13 @@ var SubscriptionScope = class _SubscriptionScope {
541
552
  if (key && this.autoloadedKeys.has(key)) {
542
553
  this.autoloaded.add(id);
543
554
  }
555
+ const skipInvalid = typeof query === "object" && query.$onError === null;
556
+ if (skipInvalid) {
557
+ if (key) {
558
+ this.skipInvalidKeys.add(key);
559
+ }
560
+ this.skipInvalidKeys.add(id);
561
+ }
544
562
  const resolve = typeof query === "object" && query !== null ? { ...query } : query;
545
563
  this.childValues.set(id, { type: "unloaded", id });
546
564
  const child = new _SubscriptionScope(
@@ -4273,4 +4291,4 @@ export {
4273
4291
  consumeInviteLink
4274
4292
  };
4275
4293
  /* istanbul ignore file -- @preserve */
4276
- //# sourceMappingURL=chunk-LMV6J7GN.js.map
4294
+ //# sourceMappingURL=chunk-IJU4XPFS.js.map