@isograph/react 0.0.0-main-260ef197 → 0.0.0-main-6c828ccf
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-compile-libs.log +1 -1
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/cache.js +8 -5
- package/package.json +4 -4
- package/src/core/cache.ts +92 -72
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
../.. | WARN Unsupported engine: wanted: {"node":"22.9.0"} (current: {"node":"v22.19.0","pnpm":"10.15.0"})
|
|
2
2
|
|
|
3
|
-
> @isograph/react@0.0.0-main-
|
|
3
|
+
> @isograph/react@0.0.0-main-6c828ccf compile-libs /home/runner/work/isograph/isograph/libs/isograph-react
|
|
4
4
|
> rimraf dist && tsc -p tsconfig.pkg.json
|
|
5
5
|
|
package/dist/core/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,KAAK,qBAAqB,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EAKN,SAAS,EAET,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAwB,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,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BAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,UAOxE;AAiPD,wBAAgB,kBAAkB,CAChC,OAAO,EACH,wBAAwB,GACxB,wBAAwB,GACxB,iBAAiB,GACjB,iBAAiB,EACrB,SAAS,EAAE,SAAS,GACnB,MAAM,CAUR;AA2GD,eAAO,MAAM,eAAe,SAAS,CAAC;AACtC,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,eAAO,MAAM,eAAe,OAAO,CAAC"}
|
package/dist/core/cache.js
CHANGED
|
@@ -144,7 +144,7 @@ function onNextChangeToRecord(environment, recordLink) {
|
|
|
144
144
|
//
|
|
145
145
|
// That's probably okay to ignore. We don't, however, want to prevent
|
|
146
146
|
// updating other subscriptions if one subscription had missing data.
|
|
147
|
-
function withErrorHandling(environment, f) {
|
|
147
|
+
function withErrorHandling(environment, context, f) {
|
|
148
148
|
return (t) => {
|
|
149
149
|
try {
|
|
150
150
|
return f(t);
|
|
@@ -153,12 +153,13 @@ function withErrorHandling(environment, f) {
|
|
|
153
153
|
(0, logging_1.logMessage)(environment, () => ({
|
|
154
154
|
kind: 'ErrorEncounteredInWithErrorHandling',
|
|
155
155
|
error: e,
|
|
156
|
+
context,
|
|
156
157
|
}));
|
|
157
158
|
}
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
161
|
function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
161
|
-
environment.subscriptions.forEach(withErrorHandling(environment, (subscription) => {
|
|
162
|
+
environment.subscriptions.forEach(withErrorHandling(environment, { situation: 'calling subscriptions' }, (subscription) => {
|
|
162
163
|
var _a;
|
|
163
164
|
switch (subscription.kind) {
|
|
164
165
|
case 'FragmentSubscription': {
|
|
@@ -192,7 +193,9 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
|
192
193
|
deeplyEqual: mergedItem === subscription.encounteredDataAndRecords.item,
|
|
193
194
|
}));
|
|
194
195
|
if (mergedItem !== subscription.encounteredDataAndRecords.item) {
|
|
195
|
-
|
|
196
|
+
withErrorHandling(environment, { situation: 'calling FragmentSubscription callback' }, () => {
|
|
197
|
+
subscription.callback(newEncounteredDataAndRecords);
|
|
198
|
+
});
|
|
196
199
|
subscription.encounteredDataAndRecords =
|
|
197
200
|
newEncounteredDataAndRecords;
|
|
198
201
|
}
|
|
@@ -200,13 +203,13 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
|
200
203
|
return;
|
|
201
204
|
}
|
|
202
205
|
case 'AnyRecords': {
|
|
203
|
-
subscription.callback();
|
|
206
|
+
withErrorHandling(environment, { situation: 'calling AnyRecords callback' }, () => subscription.callback());
|
|
204
207
|
return;
|
|
205
208
|
}
|
|
206
209
|
case 'AnyChangesToRecord': {
|
|
207
210
|
if ((_a = recordsEncounteredWhenNormalizing
|
|
208
211
|
.get(subscription.recordLink.__typename)) === null || _a === void 0 ? void 0 : _a.has(subscription.recordLink.__link)) {
|
|
209
|
-
subscription.callback();
|
|
212
|
+
withErrorHandling(environment, { situation: 'calling AnyChangesToRecord callback' }, () => subscription.callback());
|
|
210
213
|
}
|
|
211
214
|
return;
|
|
212
215
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isograph/react",
|
|
3
|
-
"version": "0.0.0-main-
|
|
3
|
+
"version": "0.0.0-main-6c828ccf",
|
|
4
4
|
"description": "Use Isograph with React",
|
|
5
5
|
"homepage": "https://isograph.dev",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"iso": "cross-env ISO_PRINT_ABSOLUTE_FILEPATH=1 ../../target/debug/isograph_cli --config ./isograph.config.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@isograph/disposable-types": "0.0.0-main-
|
|
23
|
-
"@isograph/react-disposable-state": "0.0.0-main-
|
|
24
|
-
"@isograph/reference-counted-pointer": "0.0.0-main-
|
|
22
|
+
"@isograph/disposable-types": "0.0.0-main-6c828ccf",
|
|
23
|
+
"@isograph/react-disposable-state": "0.0.0-main-6c828ccf",
|
|
24
|
+
"@isograph/reference-counted-pointer": "0.0.0-main-6c828ccf"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^18.0.0 || ^19.0.0"
|
package/src/core/cache.ts
CHANGED
|
@@ -261,6 +261,7 @@ export function onNextChangeToRecord(
|
|
|
261
261
|
// updating other subscriptions if one subscription had missing data.
|
|
262
262
|
function withErrorHandling<T>(
|
|
263
263
|
environment: IsographEnvironment,
|
|
264
|
+
context: any,
|
|
264
265
|
f: (t: T) => void,
|
|
265
266
|
): (t: T) => void {
|
|
266
267
|
return (t) => {
|
|
@@ -270,6 +271,7 @@ function withErrorHandling<T>(
|
|
|
270
271
|
logMessage(environment, () => ({
|
|
271
272
|
kind: 'ErrorEncounteredInWithErrorHandling',
|
|
272
273
|
error: e,
|
|
274
|
+
context,
|
|
273
275
|
}));
|
|
274
276
|
}
|
|
275
277
|
};
|
|
@@ -280,84 +282,102 @@ export function callSubscriptions(
|
|
|
280
282
|
recordsEncounteredWhenNormalizing: EncounteredIds,
|
|
281
283
|
) {
|
|
282
284
|
environment.subscriptions.forEach(
|
|
283
|
-
withErrorHandling(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
285
|
+
withErrorHandling(
|
|
286
|
+
environment,
|
|
287
|
+
{ situation: 'calling subscriptions' },
|
|
288
|
+
(subscription) => {
|
|
289
|
+
switch (subscription.kind) {
|
|
290
|
+
case 'FragmentSubscription': {
|
|
291
|
+
// TODO if there are multiple components subscribed to the same
|
|
292
|
+
// fragment, we will call readButNotEvaluate multiple times. We
|
|
293
|
+
// should fix that.
|
|
294
|
+
if (
|
|
295
|
+
hasOverlappingIds(
|
|
296
|
+
recordsEncounteredWhenNormalizing,
|
|
297
|
+
subscription.encounteredDataAndRecords.encounteredRecords,
|
|
298
|
+
)
|
|
299
|
+
) {
|
|
300
|
+
const newEncounteredDataAndRecords = readButDoNotEvaluate(
|
|
301
|
+
environment,
|
|
302
|
+
subscription.fragmentReference,
|
|
303
|
+
// Is this wrong?
|
|
304
|
+
// Reasons to think no:
|
|
305
|
+
// - we are only updating the read-out value, and the network
|
|
306
|
+
// options only affect whether we throw.
|
|
307
|
+
// - the component will re-render, and re-throw on its own, anyway.
|
|
308
|
+
//
|
|
309
|
+
// Reasons to think not:
|
|
310
|
+
// - it seems more efficient to suspend here and not update state,
|
|
311
|
+
// if we expect that the component will just throw anyway
|
|
312
|
+
// - consistency
|
|
313
|
+
// - it's also weird, this is called from makeNetworkRequest, where
|
|
314
|
+
// we don't currently pass network request options
|
|
315
|
+
{
|
|
316
|
+
suspendIfInFlight: false,
|
|
317
|
+
throwOnNetworkError: false,
|
|
318
|
+
},
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
const mergedItem = mergeObjectsUsingReaderAst(
|
|
322
|
+
subscription.readerAst,
|
|
323
|
+
subscription.encounteredDataAndRecords.item,
|
|
324
|
+
newEncounteredDataAndRecords.item,
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
logMessage(environment, () => ({
|
|
328
|
+
kind: 'DeepEqualityCheck',
|
|
329
|
+
fragmentReference: subscription.fragmentReference,
|
|
330
|
+
old: subscription.encounteredDataAndRecords.item,
|
|
331
|
+
new: newEncounteredDataAndRecords.item,
|
|
332
|
+
deeplyEqual:
|
|
333
|
+
mergedItem === subscription.encounteredDataAndRecords.item,
|
|
334
|
+
}));
|
|
335
|
+
|
|
336
|
+
if (mergedItem !== subscription.encounteredDataAndRecords.item) {
|
|
337
|
+
withErrorHandling(
|
|
338
|
+
environment,
|
|
339
|
+
{ situation: 'calling FragmentSubscription callback' },
|
|
340
|
+
() => {
|
|
341
|
+
subscription.callback(newEncounteredDataAndRecords);
|
|
342
|
+
},
|
|
343
|
+
);
|
|
344
|
+
subscription.encounteredDataAndRecords =
|
|
345
|
+
newEncounteredDataAndRecords;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
case 'AnyRecords': {
|
|
351
|
+
withErrorHandling(
|
|
296
352
|
environment,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
// Reasons to think no:
|
|
300
|
-
// - we are only updating the read-out value, and the network
|
|
301
|
-
// options only affect whether we throw.
|
|
302
|
-
// - the component will re-render, and re-throw on its own, anyway.
|
|
303
|
-
//
|
|
304
|
-
// Reasons to think not:
|
|
305
|
-
// - it seems more efficient to suspend here and not update state,
|
|
306
|
-
// if we expect that the component will just throw anyway
|
|
307
|
-
// - consistency
|
|
308
|
-
// - it's also weird, this is called from makeNetworkRequest, where
|
|
309
|
-
// we don't currently pass network request options
|
|
310
|
-
{
|
|
311
|
-
suspendIfInFlight: false,
|
|
312
|
-
throwOnNetworkError: false,
|
|
313
|
-
},
|
|
353
|
+
{ situation: 'calling AnyRecords callback' },
|
|
354
|
+
() => subscription.callback(),
|
|
314
355
|
);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
mergedItem === subscription.encounteredDataAndRecords.item,
|
|
329
|
-
}));
|
|
330
|
-
|
|
331
|
-
if (mergedItem !== subscription.encounteredDataAndRecords.item) {
|
|
332
|
-
subscription.callback(newEncounteredDataAndRecords);
|
|
333
|
-
subscription.encounteredDataAndRecords =
|
|
334
|
-
newEncounteredDataAndRecords;
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
case 'AnyChangesToRecord': {
|
|
359
|
+
if (
|
|
360
|
+
recordsEncounteredWhenNormalizing
|
|
361
|
+
.get(subscription.recordLink.__typename)
|
|
362
|
+
?.has(subscription.recordLink.__link)
|
|
363
|
+
) {
|
|
364
|
+
withErrorHandling(
|
|
365
|
+
environment,
|
|
366
|
+
{ situation: 'calling AnyChangesToRecord callback' },
|
|
367
|
+
() => subscription.callback(),
|
|
368
|
+
);
|
|
335
369
|
}
|
|
370
|
+
return;
|
|
336
371
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
case 'AnyChangesToRecord': {
|
|
344
|
-
if (
|
|
345
|
-
recordsEncounteredWhenNormalizing
|
|
346
|
-
.get(subscription.recordLink.__typename)
|
|
347
|
-
?.has(subscription.recordLink.__link)
|
|
348
|
-
) {
|
|
349
|
-
subscription.callback();
|
|
372
|
+
default: {
|
|
373
|
+
// Ensure we have covered all variants
|
|
374
|
+
const _: never = subscription;
|
|
375
|
+
_;
|
|
376
|
+
throw new Error('Unexpected case');
|
|
350
377
|
}
|
|
351
|
-
return;
|
|
352
378
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
const _: never = subscription;
|
|
356
|
-
_;
|
|
357
|
-
throw new Error('Unexpected case');
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}),
|
|
379
|
+
},
|
|
380
|
+
),
|
|
361
381
|
);
|
|
362
382
|
}
|
|
363
383
|
|