jazz-tools 0.13.18 → 0.13.19
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 +6 -0
- package/dist/{chunk-ITSHLDQB.js → chunk-4HBHY4I7.js} +18 -12
- package/dist/chunk-4HBHY4I7.js.map +1 -0
- 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/package.json +1 -1
- package/src/subscribe/SubscriptionScope.ts +26 -13
- package/src/tests/subscribe.test.ts +257 -0
- package/dist/chunk-ITSHLDQB.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.19 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-4HBHY4I7.js [22m[32m121.39 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-4HBHY4I7.js.map [22m[32m279.08 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 39ms
|
19
19
|
|
20
|
-
> jazz-tools@0.13.
|
20
|
+
> jazz-tools@0.13.19 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -191,6 +191,7 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
191
191
|
this.dirty = false;
|
192
192
|
this.idsSubscribed = /* @__PURE__ */ new Set();
|
193
193
|
this.autoloaded = /* @__PURE__ */ new Set();
|
194
|
+
this.autoloadedKeys = /* @__PURE__ */ new Set();
|
194
195
|
this.totalValidTransactions = 0;
|
195
196
|
this.silenceUpdates = false;
|
196
197
|
this.handleChildUpdate = (id, value, key) => {
|
@@ -289,7 +290,10 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
289
290
|
if (this.childErrors.size === 0 && this.validationErrors.size === 0) {
|
290
291
|
return void 0;
|
291
292
|
}
|
292
|
-
for (const value of this.childErrors.
|
293
|
+
for (const [key, value] of this.childErrors.entries()) {
|
294
|
+
if (this.autoloaded.has(key)) {
|
295
|
+
continue;
|
296
|
+
}
|
293
297
|
errorType = value.type;
|
294
298
|
if (value.issues) {
|
295
299
|
issues.push(...value.issues);
|
@@ -301,7 +305,10 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
301
305
|
issues.push(...value.issues);
|
302
306
|
}
|
303
307
|
}
|
304
|
-
|
308
|
+
if (issues.length) {
|
309
|
+
return new JazzError(this.id, errorType, issues);
|
310
|
+
}
|
311
|
+
return void 0;
|
305
312
|
}
|
306
313
|
shouldSendUpdates() {
|
307
314
|
if (this.value.type === "unloaded") return false;
|
@@ -345,6 +352,7 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
345
352
|
return;
|
346
353
|
}
|
347
354
|
this.resolve[key] = true;
|
355
|
+
this.autoloadedKeys.add(key);
|
348
356
|
if (this.value.type !== "loaded") {
|
349
357
|
return;
|
350
358
|
}
|
@@ -352,16 +360,10 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
352
360
|
this.silenceUpdates = true;
|
353
361
|
if (value._type === "CoMap" || value._type === "Account") {
|
354
362
|
const map = value;
|
355
|
-
|
356
|
-
if (id) {
|
357
|
-
this.autoloaded.add(id);
|
358
|
-
}
|
363
|
+
this.loadCoMapKey(map, key, true);
|
359
364
|
} else if (value._type === "CoList") {
|
360
365
|
const list = value;
|
361
|
-
|
362
|
-
if (id) {
|
363
|
-
this.autoloaded.add(id);
|
364
|
-
}
|
366
|
+
this.loadCoListKey(list, key, true);
|
365
367
|
}
|
366
368
|
this.silenceUpdates = false;
|
367
369
|
}
|
@@ -537,10 +539,14 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
537
539
|
if (this.childValues.has(id)) {
|
538
540
|
return;
|
539
541
|
}
|
542
|
+
if (key && this.autoloadedKeys.has(key)) {
|
543
|
+
this.autoloaded.add(id);
|
544
|
+
}
|
545
|
+
const resolve = typeof query === "object" && query !== null ? { ...query } : query;
|
540
546
|
this.childValues.set(id, { type: "unloaded", id });
|
541
547
|
const child = new _SubscriptionScope(
|
542
548
|
this.node,
|
543
|
-
|
549
|
+
resolve,
|
544
550
|
id,
|
545
551
|
descriptor
|
546
552
|
);
|
@@ -4220,4 +4226,4 @@ export {
|
|
4220
4226
|
consumeInviteLink
|
4221
4227
|
};
|
4222
4228
|
/* istanbul ignore file -- @preserve */
|
4223
|
-
//# sourceMappingURL=chunk-
|
4229
|
+
//# sourceMappingURL=chunk-4HBHY4I7.js.map
|