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.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +16 -0
- package/dist/{chunk-LMV6J7GN.js → chunk-IJU4XPFS.js} +21 -3
- package/dist/chunk-IJU4XPFS.js.map +1 -0
- package/dist/coValues/deepLoading.d.ts +18 -8
- package/dist/coValues/deepLoading.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/subscribe/SubscriptionScope.d.ts +1 -0
- package/dist/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tests/deepLoading.test-d.d.ts +2 -0
- package/dist/tests/deepLoading.test-d.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/coValues/deepLoading.ts +49 -31
- package/src/subscribe/SubscriptionScope.ts +27 -2
- package/src/tests/deepLoading.test-d.ts +393 -0
- package/src/tests/deepLoading.test.ts +249 -0
- package/dist/chunk-LMV6J7GN.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.13.
|
2
|
+
> jazz-tools@0.13.31 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,12 +11,12 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.48 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.27 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-IJU4XPFS.js [22m[32m123.33 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m258.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.38 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-IJU4XPFS.js.map [22m[32m282.34 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 50ms
|
19
19
|
|
20
|
-
> jazz-tools@0.13.
|
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.
|
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
|
-
|
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-
|
4294
|
+
//# sourceMappingURL=chunk-IJU4XPFS.js.map
|