jazz-tools 0.18.13 → 0.18.14

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.18.13 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.18.14 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -107,25 +107,25 @@
107
107
  ESM Build start
108
108
  CLI Cleaning output folder
109
109
  ESM Build start
110
- ESM dist/react/ssr.js 688.00 B
111
- ESM dist/react/ssr.js.map 1.12 KB
112
- ESM ⚡️ Build success in 19ms
113
- ESM dist/worker/index.js 3.19 KB
114
- ESM dist/worker/index.js.map 6.17 KB
115
- ESM ⚡️ Build success in 19ms
116
110
  ESM dist/tiptap/index.js 564.00 B
117
111
  ESM dist/tiptap/index.js.map 1.21 KB
118
- ESM ⚡️ Build success in 21ms
119
- ESM dist/react-core/index.js 10.72 KB
120
- ESM dist/react-core/testing.js 1.17 KB
121
- ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
122
- ESM dist/react-core/index.js.map 33.90 KB
123
- ESM dist/react-core/testing.js.map 1.82 KB
124
- ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
125
- ESM ⚡️ Build success in 27ms
112
+ ESM ⚡️ Build success in 18ms
113
+ ESM dist/worker/index.js 3.19 KB
114
+ ESM dist/worker/index.js.map 6.17 KB
115
+ ESM ⚡️ Build success in 16ms
116
+ ESM dist/react/ssr.js 688.00 B
117
+ ESM dist/react/ssr.js.map 1.12 KB
118
+ ESM ⚡️ Build success in 20ms
119
+ ESM dist/better-auth/auth/client.js 4.44 KB
120
+ ESM dist/better-auth/auth/server.js 8.36 KB
121
+ ESM dist/better-auth/auth/react.js 799.00 B
122
+ ESM dist/better-auth/auth/client.js.map 8.24 KB
123
+ ESM dist/better-auth/auth/server.js.map 15.29 KB
124
+ ESM dist/better-auth/auth/react.js.map 2.04 KB
125
+ ESM ⚡️ Build success in 18ms
126
126
  ESM dist/media/index.js 236.00 B
127
- ESM dist/media/index.browser.js 2.79 KB
128
127
  ESM dist/media/index.native.js 2.90 KB
128
+ ESM dist/media/index.browser.js 2.79 KB
129
129
  ESM dist/media/index.server.js 2.95 KB
130
130
  ESM dist/media/chunk-W3S526L3.js 6.47 KB
131
131
  ESM dist/media/index.js.map 71.00 B
@@ -133,67 +133,67 @@
133
133
  ESM dist/media/index.browser.js.map 6.15 KB
134
134
  ESM dist/media/index.server.js.map 6.37 KB
135
135
  ESM dist/media/chunk-W3S526L3.js.map 16.57 KB
136
- ESM ⚡️ Build success in 32ms
137
- ESM dist/better-auth/auth/client.js 4.44 KB
138
- ESM dist/better-auth/auth/server.js 8.36 KB
139
- ESM dist/better-auth/auth/react.js 799.00 B
140
- ESM dist/better-auth/auth/client.js.map 8.24 KB
141
- ESM dist/better-auth/auth/server.js.map 15.29 KB
142
- ESM dist/better-auth/auth/react.js.map 2.04 KB
143
- ESM ⚡️ Build success in 25ms
136
+ ESM ⚡️ Build success in 31ms
137
+ ESM dist/react-core/index.js 10.72 KB
138
+ ESM dist/react-core/testing.js 1.17 KB
139
+ ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
140
+ ESM dist/react-core/index.js.map 33.90 KB
141
+ ESM dist/react-core/testing.js.map 1.82 KB
142
+ ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
143
+ ESM ⚡️ Build success in 28ms
144
144
  ESM dist/react-native/index.js 2.53 KB
145
145
  ESM dist/react-native/testing.js 120.00 B
146
146
  ESM dist/react-native/crypto.js 161.00 B
147
147
  ESM dist/react-native/index.js.map 5.68 KB
148
148
  ESM dist/react-native/testing.js.map 176.00 B
149
149
  ESM dist/react-native/crypto.js.map 197.00 B
150
- ESM ⚡️ Build success in 31ms
151
- ESM dist/browser/index.js 13.64 KB
152
- ESM dist/browser/index.js.map 29.14 KB
153
- ESM ⚡️ Build success in 44ms
150
+ ESM ⚡️ Build success in 28ms
154
151
  ESM dist/expo/index.js 4.68 KB
155
152
  ESM dist/expo/testing.js 112.00 B
156
153
  ESM dist/expo/crypto.js 153.00 B
157
154
  ESM dist/expo/index.js.map 10.23 KB
158
155
  ESM dist/expo/testing.js.map 168.00 B
159
156
  ESM dist/expo/crypto.js.map 189.00 B
160
- ESM ⚡️ Build success in 43ms
161
- ESM dist/react/testing.js 122.00 B
162
- ESM dist/react/index.js 24.76 KB
163
- ESM dist/react/testing.js.map 165.00 B
164
- ESM dist/react/index.js.map 53.56 KB
165
- ESM ⚡️ Build success in 49ms
157
+ ESM ⚡️ Build success in 31ms
158
+ ESM dist/browser/index.js 13.64 KB
159
+ ESM dist/browser/index.js.map 29.14 KB
160
+ ESM ⚡️ Build success in 31ms
166
161
  ESM dist/react-native-core/index.js 18.03 KB
167
- ESM dist/react-native-core/crypto.js 2.10 KB
168
162
  ESM dist/react-native-core/testing.js 119.00 B
163
+ ESM dist/react-native-core/crypto.js 2.10 KB
169
164
  ESM dist/react-native-core/index.js.map 36.85 KB
170
- ESM dist/react-native-core/crypto.js.map 4.25 KB
171
165
  ESM dist/react-native-core/testing.js.map 175.00 B
172
- ESM ⚡️ Build success in 48ms
166
+ ESM dist/react-native-core/crypto.js.map 4.25 KB
167
+ ESM ⚡️ Build success in 31ms
168
+ ESM dist/react/index.js 24.76 KB
169
+ ESM dist/react/testing.js 122.00 B
170
+ ESM dist/react/testing.js.map 165.00 B
171
+ ESM dist/react/index.js.map 53.56 KB
172
+ ESM ⚡️ Build success in 39ms
173
173
  ESM dist/prosemirror/index.js 77.76 KB
174
174
  ESM dist/prosemirror/index.js.map 307.20 KB
175
- ESM ⚡️ Build success in 55ms
175
+ ESM ⚡️ Build success in 42ms
176
176
  ESM dist/inspector/index.js 69.71 KB
177
177
  ESM dist/inspector/index.js.map 121.38 KB
178
- ESM ⚡️ Build success in 81ms
179
- ESM dist/index.js 26.13 KB
178
+ ESM ⚡️ Build success in 58ms
180
179
  ESM dist/testing.js 7.17 KB
181
- ESM dist/chunk-AEXYCCQS.js 173.81 KB
182
- ESM dist/index.js.map 52.92 KB
180
+ ESM dist/index.js 26.13 KB
181
+ ESM dist/chunk-GRN6OAUX.js 174.37 KB
183
182
  ESM dist/testing.js.map 14.10 KB
184
- ESM dist/chunk-AEXYCCQS.js.map 415.05 KB
185
- ESM ⚡️ Build success in 110ms
183
+ ESM dist/index.js.map 52.92 KB
184
+ ESM dist/chunk-GRN6OAUX.js.map 415.70 KB
185
+ ESM ⚡️ Build success in 75ms
186
186
  ESM dist/inspector/register-custom-element.js 218.00 B
187
187
  ESM dist/inspector/register-custom-element.js.map 314.00 B
188
188
  ESM dist/inspector/custom-element-G6SPZEBR.js 1.54 MB
189
189
  ESM dist/inspector/custom-element-G6SPZEBR.js.map 2.36 MB
190
- ESM ⚡️ Build success in 155ms
190
+ ESM ⚡️ Build success in 114ms
191
191
 
192
- > jazz-tools@0.18.13 types /home/runner/_work/jazz/jazz/packages/jazz-tools
192
+ > jazz-tools@0.18.14 types /home/runner/_work/jazz/jazz/packages/jazz-tools
193
193
  > tsc --outDir dist
194
194
 
195
195
 
196
- > jazz-tools@0.18.13 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
196
+ > jazz-tools@0.18.14 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
197
197
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
198
198
 
199
199
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.18.14
4
+
5
+ ### Patch Changes
6
+
7
+ - a04435e: Optimized updates on large subscriptions
8
+ - cojson@0.18.14
9
+ - cojson-storage-indexeddb@0.18.14
10
+ - cojson-transport-ws@0.18.14
11
+
3
12
  ## 0.18.13
4
13
 
5
14
  ### Patch Changes
@@ -3735,6 +3735,14 @@ var SubscriptionScope = class _SubscriptionScope {
3735
3735
  this.unstable_branch = unstable_branch;
3736
3736
  this.childNodes = /* @__PURE__ */ new Map();
3737
3737
  this.childValues = /* @__PURE__ */ new Map();
3738
+ /**
3739
+ * Explicitly-loaded child ids that are unloaded
3740
+ */
3741
+ this.pendingLoadedChildren = /* @__PURE__ */ new Set();
3742
+ /**
3743
+ * Autoloaded child ids that are unloaded
3744
+ */
3745
+ this.pendingAutoloadedChildren = /* @__PURE__ */ new Set();
3738
3746
  this.childErrors = /* @__PURE__ */ new Map();
3739
3747
  this.validationErrors = /* @__PURE__ */ new Map();
3740
3748
  this.dirty = false;
@@ -3750,6 +3758,8 @@ var SubscriptionScope = class _SubscriptionScope {
3750
3758
  if (value.type === "unloaded") {
3751
3759
  return;
3752
3760
  }
3761
+ this.pendingLoadedChildren.delete(id);
3762
+ this.pendingAutoloadedChildren.delete(id);
3753
3763
  this.childValues.set(id, value);
3754
3764
  if (value.type === "unavailable" || value.type === "unauthorized") {
3755
3765
  this.childErrors.set(id, value.prependPath(key ?? id));
@@ -3901,12 +3911,7 @@ var SubscriptionScope = class _SubscriptionScope {
3901
3911
  if (this.isStreaming() && !this.isFileStream()) {
3902
3912
  return false;
3903
3913
  }
3904
- for (const value of this.childValues.values()) {
3905
- if (value.type === "unloaded" && !this.autoloaded.has(value.id)) {
3906
- return false;
3907
- }
3908
- }
3909
- return true;
3914
+ return this.pendingLoadedChildren.size === 0;
3910
3915
  }
3911
3916
  getCurrentValue() {
3912
3917
  if (this.value.type === "unauthorized" || this.value.type === "unavailable") {
@@ -3984,14 +3989,17 @@ var SubscriptionScope = class _SubscriptionScope {
3984
3989
  }
3985
3990
  this.silenceUpdates = false;
3986
3991
  }
3992
+ isSubscribedToId(id) {
3993
+ return this.idsSubscribed.has(id) || this.childValues.has(id) || this.pendingAutoloadedChildren.has(id) || this.pendingLoadedChildren.has(id);
3994
+ }
3987
3995
  subscribeToId(id, descriptor) {
3988
- if (this.idsSubscribed.has(id) || this.childValues.has(id)) {
3996
+ if (this.isSubscribedToId(id)) {
3989
3997
  return;
3990
3998
  }
3991
3999
  this.idsSubscribed.add(id);
3992
4000
  this.autoloaded.add(id);
3993
4001
  this.silenceUpdates = true;
3994
- this.childValues.set(id, { type: "unloaded", id });
4002
+ this.pendingAutoloadedChildren.add(id);
3995
4003
  const child = new _SubscriptionScope(
3996
4004
  this.node,
3997
4005
  true,
@@ -4081,6 +4089,8 @@ var SubscriptionScope = class _SubscriptionScope {
4081
4089
  if (childNode) {
4082
4090
  childNode.destroy();
4083
4091
  }
4092
+ this.pendingLoadedChildren.delete(id);
4093
+ this.pendingAutoloadedChildren.delete(id);
4084
4094
  this.childNodes.delete(id);
4085
4095
  this.childValues.delete(id);
4086
4096
  }
@@ -4159,10 +4169,11 @@ var SubscriptionScope = class _SubscriptionScope {
4159
4169
  return void 0;
4160
4170
  }
4161
4171
  loadChildNode(id, query, descriptor, key) {
4162
- if (this.childValues.has(id)) {
4172
+ if (this.isSubscribedToId(id)) {
4163
4173
  return;
4164
4174
  }
4165
- if (key && this.autoloadedKeys.has(key)) {
4175
+ const isAutoloaded = key && this.autoloadedKeys.has(key);
4176
+ if (isAutoloaded) {
4166
4177
  this.autoloaded.add(id);
4167
4178
  }
4168
4179
  const skipInvalid = typeof query === "object" && query.$onError === null;
@@ -4173,7 +4184,11 @@ var SubscriptionScope = class _SubscriptionScope {
4173
4184
  this.skipInvalidKeys.add(id);
4174
4185
  }
4175
4186
  const resolve = typeof query === "object" && query !== null ? { ...query } : query;
4176
- this.childValues.set(id, { type: "unloaded", id });
4187
+ if (!isAutoloaded) {
4188
+ this.pendingLoadedChildren.add(id);
4189
+ } else {
4190
+ this.pendingAutoloadedChildren.add(id);
4191
+ }
4177
4192
  const child = new _SubscriptionScope(
4178
4193
  this.node,
4179
4194
  resolve,
@@ -4216,7 +4231,7 @@ function getSubscriptionScope(value) {
4216
4231
  }
4217
4232
  function accessChildByKey(parent, childId, key) {
4218
4233
  const subscriptionScope = getSubscriptionScope(parent);
4219
- if (!subscriptionScope.childValues.has(childId)) {
4234
+ if (!subscriptionScope.isSubscribedToId(childId)) {
4220
4235
  subscriptionScope.subscribeToKey(key);
4221
4236
  }
4222
4237
  const value = subscriptionScope.childValues.get(childId);
@@ -6063,4 +6078,4 @@ export {
6063
6078
  JazzContextManager
6064
6079
  };
6065
6080
  /* istanbul ignore file -- @preserve */
6066
- //# sourceMappingURL=chunk-AEXYCCQS.js.map
6081
+ //# sourceMappingURL=chunk-GRN6OAUX.js.map