@isograph/react 0.0.0-main-6c828ccf → 0.0.0-main-9d25cd56
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 +15 -17
- package/package.json +4 -4
- package/src/core/cache.ts +95 -101
|
@@ -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-9d25cd56 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,MAA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,uBAAuB,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,22 +144,20 @@ 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
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
};
|
|
147
|
+
function logAnyError(environment, context, f) {
|
|
148
|
+
try {
|
|
149
|
+
f();
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
(0, logging_1.logMessage)(environment, () => ({
|
|
153
|
+
kind: 'ErrorEncounteredInWithErrorHandling',
|
|
154
|
+
error: e,
|
|
155
|
+
context,
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
160
158
|
}
|
|
161
159
|
function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
162
|
-
environment.subscriptions.forEach(
|
|
160
|
+
environment.subscriptions.forEach((subscription) => logAnyError(environment, { situation: 'calling subscriptions' }, () => {
|
|
163
161
|
var _a;
|
|
164
162
|
switch (subscription.kind) {
|
|
165
163
|
case 'FragmentSubscription': {
|
|
@@ -193,7 +191,7 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
|
193
191
|
deeplyEqual: mergedItem === subscription.encounteredDataAndRecords.item,
|
|
194
192
|
}));
|
|
195
193
|
if (mergedItem !== subscription.encounteredDataAndRecords.item) {
|
|
196
|
-
|
|
194
|
+
logAnyError(environment, { situation: 'calling FragmentSubscription callback' }, () => {
|
|
197
195
|
subscription.callback(newEncounteredDataAndRecords);
|
|
198
196
|
});
|
|
199
197
|
subscription.encounteredDataAndRecords =
|
|
@@ -203,13 +201,13 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
|
203
201
|
return;
|
|
204
202
|
}
|
|
205
203
|
case 'AnyRecords': {
|
|
206
|
-
|
|
204
|
+
logAnyError(environment, { situation: 'calling AnyRecords callback' }, () => subscription.callback());
|
|
207
205
|
return;
|
|
208
206
|
}
|
|
209
207
|
case 'AnyChangesToRecord': {
|
|
210
208
|
if ((_a = recordsEncounteredWhenNormalizing
|
|
211
209
|
.get(subscription.recordLink.__typename)) === null || _a === void 0 ? void 0 : _a.has(subscription.recordLink.__link)) {
|
|
212
|
-
|
|
210
|
+
logAnyError(environment, { situation: 'calling AnyChangesToRecord callback' }, () => subscription.callback());
|
|
213
211
|
}
|
|
214
212
|
return;
|
|
215
213
|
}
|
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-9d25cd56",
|
|
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-9d25cd56",
|
|
23
|
+
"@isograph/react-disposable-state": "0.0.0-main-9d25cd56",
|
|
24
|
+
"@isograph/reference-counted-pointer": "0.0.0-main-9d25cd56"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^18.0.0 || ^19.0.0"
|
package/src/core/cache.ts
CHANGED
|
@@ -259,125 +259,119 @@ export function onNextChangeToRecord(
|
|
|
259
259
|
//
|
|
260
260
|
// That's probably okay to ignore. We don't, however, want to prevent
|
|
261
261
|
// updating other subscriptions if one subscription had missing data.
|
|
262
|
-
function
|
|
262
|
+
function logAnyError(
|
|
263
263
|
environment: IsographEnvironment,
|
|
264
264
|
context: any,
|
|
265
|
-
f: (
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
};
|
|
265
|
+
f: () => void,
|
|
266
|
+
) {
|
|
267
|
+
try {
|
|
268
|
+
f();
|
|
269
|
+
} catch (e) {
|
|
270
|
+
logMessage(environment, () => ({
|
|
271
|
+
kind: 'ErrorEncounteredInWithErrorHandling',
|
|
272
|
+
error: e,
|
|
273
|
+
context,
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
278
276
|
}
|
|
279
277
|
|
|
280
278
|
export function callSubscriptions(
|
|
281
279
|
environment: IsographEnvironment,
|
|
282
280
|
recordsEncounteredWhenNormalizing: EncounteredIds,
|
|
283
281
|
) {
|
|
284
|
-
environment.subscriptions.forEach(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
282
|
+
environment.subscriptions.forEach((subscription) =>
|
|
283
|
+
logAnyError(environment, { situation: 'calling subscriptions' }, () => {
|
|
284
|
+
switch (subscription.kind) {
|
|
285
|
+
case 'FragmentSubscription': {
|
|
286
|
+
// TODO if there are multiple components subscribed to the same
|
|
287
|
+
// fragment, we will call readButNotEvaluate multiple times. We
|
|
288
|
+
// should fix that.
|
|
289
|
+
if (
|
|
290
|
+
hasOverlappingIds(
|
|
291
|
+
recordsEncounteredWhenNormalizing,
|
|
292
|
+
subscription.encounteredDataAndRecords.encounteredRecords,
|
|
293
|
+
)
|
|
294
|
+
) {
|
|
295
|
+
const newEncounteredDataAndRecords = readButDoNotEvaluate(
|
|
296
|
+
environment,
|
|
297
|
+
subscription.fragmentReference,
|
|
298
|
+
// Is this wrong?
|
|
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
|
+
},
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
const mergedItem = mergeObjectsUsingReaderAst(
|
|
317
|
+
subscription.readerAst,
|
|
318
|
+
subscription.encounteredDataAndRecords.item,
|
|
319
|
+
newEncounteredDataAndRecords.item,
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
logMessage(environment, () => ({
|
|
323
|
+
kind: 'DeepEqualityCheck',
|
|
324
|
+
fragmentReference: subscription.fragmentReference,
|
|
325
|
+
old: subscription.encounteredDataAndRecords.item,
|
|
326
|
+
new: newEncounteredDataAndRecords.item,
|
|
327
|
+
deeplyEqual:
|
|
328
|
+
mergedItem === subscription.encounteredDataAndRecords.item,
|
|
329
|
+
}));
|
|
330
|
+
|
|
331
|
+
if (mergedItem !== subscription.encounteredDataAndRecords.item) {
|
|
332
|
+
logAnyError(
|
|
301
333
|
environment,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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,
|
|
334
|
+
{ situation: 'calling FragmentSubscription callback' },
|
|
335
|
+
() => {
|
|
336
|
+
subscription.callback(newEncounteredDataAndRecords);
|
|
318
337
|
},
|
|
319
338
|
);
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
}
|
|
339
|
+
subscription.encounteredDataAndRecords =
|
|
340
|
+
newEncounteredDataAndRecords;
|
|
347
341
|
}
|
|
348
|
-
return;
|
|
349
342
|
}
|
|
350
|
-
|
|
351
|
-
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
case 'AnyRecords': {
|
|
346
|
+
logAnyError(
|
|
347
|
+
environment,
|
|
348
|
+
{ situation: 'calling AnyRecords callback' },
|
|
349
|
+
() => subscription.callback(),
|
|
350
|
+
);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
case 'AnyChangesToRecord': {
|
|
354
|
+
if (
|
|
355
|
+
recordsEncounteredWhenNormalizing
|
|
356
|
+
.get(subscription.recordLink.__typename)
|
|
357
|
+
?.has(subscription.recordLink.__link)
|
|
358
|
+
) {
|
|
359
|
+
logAnyError(
|
|
352
360
|
environment,
|
|
353
|
-
{ situation: 'calling
|
|
361
|
+
{ situation: 'calling AnyChangesToRecord callback' },
|
|
354
362
|
() => subscription.callback(),
|
|
355
363
|
);
|
|
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
|
-
);
|
|
369
|
-
}
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
default: {
|
|
373
|
-
// Ensure we have covered all variants
|
|
374
|
-
const _: never = subscription;
|
|
375
|
-
_;
|
|
376
|
-
throw new Error('Unexpected case');
|
|
377
364
|
}
|
|
365
|
+
return;
|
|
378
366
|
}
|
|
379
|
-
|
|
380
|
-
|
|
367
|
+
default: {
|
|
368
|
+
// Ensure we have covered all variants
|
|
369
|
+
const _: never = subscription;
|
|
370
|
+
_;
|
|
371
|
+
throw new Error('Unexpected case');
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}),
|
|
381
375
|
);
|
|
382
376
|
}
|
|
383
377
|
|