@isograph/react 0.4.2 → 0.5.0

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.
Files changed (144) hide show
  1. package/.turbo/turbo-compile-libs.log +2 -2
  2. package/dist/core/FragmentReference.d.ts +4 -2
  3. package/dist/core/FragmentReference.d.ts.map +1 -1
  4. package/dist/core/FragmentReference.js +2 -2
  5. package/dist/core/IsographEnvironment.d.ts +19 -11
  6. package/dist/core/IsographEnvironment.d.ts.map +1 -1
  7. package/dist/core/IsographEnvironment.js +27 -2
  8. package/dist/core/PromiseWrapper.d.ts +13 -7
  9. package/dist/core/PromiseWrapper.d.ts.map +1 -1
  10. package/dist/core/areEqualWithDeepComparison.d.ts.map +1 -1
  11. package/dist/core/areEqualWithDeepComparison.js +5 -0
  12. package/dist/core/brand.d.ts +17 -0
  13. package/dist/core/brand.d.ts.map +1 -1
  14. package/dist/core/cache.d.ts +10 -7
  15. package/dist/core/cache.d.ts.map +1 -1
  16. package/dist/core/cache.js +102 -74
  17. package/dist/core/check.d.ts +8 -4
  18. package/dist/core/check.d.ts.map +1 -1
  19. package/dist/core/check.js +10 -7
  20. package/dist/core/componentCache.d.ts +1 -1
  21. package/dist/core/componentCache.d.ts.map +1 -1
  22. package/dist/core/componentCache.js +6 -4
  23. package/dist/core/entrypoint.d.ts +17 -7
  24. package/dist/core/entrypoint.d.ts.map +1 -1
  25. package/dist/core/garbageCollection.d.ts +8 -2
  26. package/dist/core/garbageCollection.d.ts.map +1 -1
  27. package/dist/core/garbageCollection.js +36 -14
  28. package/dist/core/logging.d.ts +16 -3
  29. package/dist/core/logging.d.ts.map +1 -1
  30. package/dist/core/makeNetworkRequest.d.ts +4 -2
  31. package/dist/core/makeNetworkRequest.d.ts.map +1 -1
  32. package/dist/core/makeNetworkRequest.js +115 -38
  33. package/dist/core/optimisticProxy.d.ts +59 -0
  34. package/dist/core/optimisticProxy.d.ts.map +1 -0
  35. package/dist/core/optimisticProxy.js +399 -0
  36. package/dist/core/read.d.ts +3 -2
  37. package/dist/core/read.d.ts.map +1 -1
  38. package/dist/core/read.js +158 -123
  39. package/dist/core/reader.d.ts +10 -5
  40. package/dist/core/reader.d.ts.map +1 -1
  41. package/dist/core/startUpdate.d.ts +3 -2
  42. package/dist/core/startUpdate.d.ts.map +1 -1
  43. package/dist/core/startUpdate.js +35 -36
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -1
  47. package/dist/loadable-hooks/useClientSideDefer.d.ts +9 -4
  48. package/dist/loadable-hooks/useClientSideDefer.d.ts.map +1 -1
  49. package/dist/loadable-hooks/useClientSideDefer.js +34 -1
  50. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts +5 -3
  51. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts.map +1 -1
  52. package/dist/loadable-hooks/useConnectionSpecPagination.js +27 -13
  53. package/dist/loadable-hooks/useImperativeLoadableField.d.ts +1 -1
  54. package/dist/loadable-hooks/useImperativeLoadableField.d.ts.map +1 -1
  55. package/dist/loadable-hooks/useSkipLimitPagination.d.ts +1 -1
  56. package/dist/loadable-hooks/useSkipLimitPagination.d.ts.map +1 -1
  57. package/dist/loadable-hooks/useSkipLimitPagination.js +1 -1
  58. package/dist/react/FragmentReader.d.ts +2 -1
  59. package/dist/react/FragmentReader.d.ts.map +1 -1
  60. package/dist/react/FragmentRenderer.d.ts +2 -1
  61. package/dist/react/FragmentRenderer.d.ts.map +1 -1
  62. package/dist/react/LoadableFieldReader.d.ts +9 -3
  63. package/dist/react/LoadableFieldReader.d.ts.map +1 -1
  64. package/dist/react/LoadableFieldReader.js +40 -1
  65. package/dist/react/LoadableFieldRenderer.d.ts +9 -3
  66. package/dist/react/LoadableFieldRenderer.d.ts.map +1 -1
  67. package/dist/react/LoadableFieldRenderer.js +36 -1
  68. package/dist/react/useImperativeReference.d.ts +4 -3
  69. package/dist/react/useImperativeReference.d.ts.map +1 -1
  70. package/dist/react/useImperativeReference.js +3 -5
  71. package/dist/react/useLazyReference.d.ts +2 -1
  72. package/dist/react/useLazyReference.d.ts.map +1 -1
  73. package/dist/react/useReadAndSubscribe.d.ts.map +1 -1
  74. package/dist/react/useReadAndSubscribe.js +1 -3
  75. package/dist/react/useResult.d.ts.map +1 -1
  76. package/dist/react/useResult.js +6 -5
  77. package/package.json +16 -17
  78. package/src/core/FragmentReference.ts +10 -4
  79. package/src/core/IsographEnvironment.ts +59 -13
  80. package/src/core/PromiseWrapper.ts +14 -7
  81. package/src/core/areEqualWithDeepComparison.ts +5 -0
  82. package/src/core/brand.ts +18 -0
  83. package/src/core/cache.ts +186 -91
  84. package/src/core/check.ts +21 -10
  85. package/src/core/componentCache.ts +8 -4
  86. package/src/core/entrypoint.ts +35 -6
  87. package/src/core/garbageCollection.ts +61 -19
  88. package/src/core/logging.ts +15 -3
  89. package/src/core/makeNetworkRequest.ts +307 -74
  90. package/src/core/optimisticProxy.ts +563 -0
  91. package/src/core/read.ts +233 -163
  92. package/src/core/reader.ts +11 -7
  93. package/src/core/startUpdate.ts +47 -32
  94. package/src/index.ts +2 -1
  95. package/src/loadable-hooks/useClientSideDefer.ts +76 -26
  96. package/src/loadable-hooks/useConnectionSpecPagination.ts +34 -17
  97. package/src/loadable-hooks/useImperativeLoadableField.ts +2 -2
  98. package/src/loadable-hooks/useSkipLimitPagination.ts +2 -3
  99. package/src/react/FragmentReader.tsx +3 -1
  100. package/src/react/FragmentRenderer.tsx +8 -1
  101. package/src/react/LoadableFieldReader.tsx +123 -12
  102. package/src/react/LoadableFieldRenderer.tsx +122 -12
  103. package/src/react/useImperativeReference.ts +20 -11
  104. package/src/react/useLazyReference.ts +17 -6
  105. package/src/react/useReadAndSubscribe.ts +1 -8
  106. package/src/react/useResult.ts +9 -11
  107. package/src/tests/__isograph/Node/__link/output_type.ts +3 -0
  108. package/src/tests/__isograph/Node/asEconomist/resolver_reader.ts +3 -3
  109. package/src/tests/__isograph/Query/linkedUpdate/entrypoint.ts +3 -1
  110. package/src/tests/__isograph/Query/linkedUpdate/param_type.ts +4 -4
  111. package/src/tests/__isograph/Query/linkedUpdate/raw_response_type.ts +13 -0
  112. package/src/tests/__isograph/Query/linkedUpdate/resolver_reader.ts +6 -6
  113. package/src/tests/__isograph/Query/meName/entrypoint.ts +3 -1
  114. package/src/tests/__isograph/Query/meName/raw_response_type.ts +7 -0
  115. package/src/tests/__isograph/Query/meName/resolver_reader.ts +2 -2
  116. package/src/tests/__isograph/Query/meNameSuccessor/entrypoint.ts +3 -1
  117. package/src/tests/__isograph/Query/meNameSuccessor/raw_response_type.ts +14 -0
  118. package/src/tests/__isograph/Query/meNameSuccessor/resolver_reader.ts +4 -4
  119. package/src/tests/__isograph/Query/nodeField/entrypoint.ts +3 -1
  120. package/src/tests/__isograph/Query/nodeField/raw_response_type.ts +7 -0
  121. package/src/tests/__isograph/Query/nodeField/resolver_reader.ts +2 -2
  122. package/src/tests/__isograph/Query/normalizeUndefinedField/entrypoint.ts +33 -0
  123. package/src/tests/__isograph/Query/normalizeUndefinedField/normalization_ast.ts +25 -0
  124. package/src/tests/__isograph/Query/normalizeUndefinedField/output_type.ts +3 -0
  125. package/src/tests/__isograph/Query/normalizeUndefinedField/param_type.ts +9 -0
  126. package/src/tests/__isograph/Query/normalizeUndefinedField/query_text.ts +6 -0
  127. package/src/tests/__isograph/Query/normalizeUndefinedField/raw_response_type.ts +7 -0
  128. package/src/tests/__isograph/Query/normalizeUndefinedField/resolver_reader.ts +38 -0
  129. package/src/tests/__isograph/Query/startUpdate/entrypoint.ts +3 -1
  130. package/src/tests/__isograph/Query/startUpdate/raw_response_type.ts +8 -0
  131. package/src/tests/__isograph/Query/startUpdate/resolver_reader.ts +3 -3
  132. package/src/tests/__isograph/Query/subquery/entrypoint.ts +3 -1
  133. package/src/tests/__isograph/Query/subquery/raw_response_type.ts +9 -0
  134. package/src/tests/__isograph/Query/subquery/resolver_reader.ts +3 -3
  135. package/src/tests/__isograph/iso.ts +11 -1
  136. package/src/tests/garbageCollection.test.ts +8 -5
  137. package/src/tests/meNameSuccessor.ts +6 -3
  138. package/src/tests/nodeQuery.ts +4 -2
  139. package/src/tests/normalizeData.test.ts +89 -15
  140. package/src/tests/optimisticProxy.test.ts +860 -0
  141. package/src/tests/startUpdate.test.ts +8 -6
  142. package/vitest.config.ts +10 -1
  143. package/src/tests/__isograph/Economist/link/output_type.ts +0 -2
  144. package/src/tests/__isograph/Node/link/output_type.ts +0 -3
@@ -11,13 +11,15 @@ exports.subscribe = subscribe;
11
11
  exports.onNextChangeToRecord = onNextChangeToRecord;
12
12
  exports.callSubscriptions = callSubscriptions;
13
13
  exports.insertEmptySetIfMissing = insertEmptySetIfMissing;
14
+ exports.isArray = isArray;
14
15
  exports.getParentRecordKey = getParentRecordKey;
16
+ exports.writeData = writeData;
15
17
  const react_disposable_state_1 = require("@isograph/react-disposable-state");
16
18
  const areEqualWithDeepComparison_1 = require("./areEqualWithDeepComparison");
17
19
  const IsographEnvironment_1 = require("./IsographEnvironment");
18
20
  const logging_1 = require("./logging");
19
21
  const makeNetworkRequest_1 = require("./makeNetworkRequest");
20
- const PromiseWrapper_1 = require("./PromiseWrapper");
22
+ const optimisticProxy_1 = require("./optimisticProxy");
21
23
  const read_1 = require("./read");
22
24
  exports.TYPENAME_FIELD_NAME = '__typename';
23
25
  function getOrCreateItemInSuspenseCache(environment, index, factory) {
@@ -35,7 +37,7 @@ function stableCopy(value) {
35
37
  if (!value || typeof value !== 'object') {
36
38
  return value;
37
39
  }
38
- if (Array.isArray(value)) {
40
+ if (isArray(value)) {
39
41
  // @ts-ignore
40
42
  return value.map(stableCopy);
41
43
  }
@@ -62,15 +64,14 @@ function getOrCreateCacheForArtifact(environment, entrypoint, variables, fetchOp
62
64
  break;
63
65
  }
64
66
  const factory = () => {
65
- const readerWithRefetchQueries = entrypoint.readerWithRefetchQueries.kind ===
66
- 'ReaderWithRefetchQueriesLoader'
67
- ? (0, PromiseWrapper_1.wrapPromise)(entrypoint.readerWithRefetchQueries.loader())
68
- : (0, PromiseWrapper_1.wrapResolvedValue)(entrypoint.readerWithRefetchQueries);
67
+ const { fieldName, readerArtifactKind, readerWithRefetchQueries } = (0, IsographEnvironment_1.getOrLoadReaderWithRefetchQueries)(environment, entrypoint.readerWithRefetchQueries);
69
68
  const [networkRequest, disposeNetworkRequest] = (0, makeNetworkRequest_1.maybeMakeNetworkRequest)(environment, entrypoint, variables, readerWithRefetchQueries, fetchOptions !== null && fetchOptions !== void 0 ? fetchOptions : null);
70
69
  const itemCleanupPair = [
71
70
  {
72
71
  kind: 'FragmentReference',
73
72
  readerWithRefetchQueries,
73
+ fieldName,
74
+ readerArtifactKind,
74
75
  root: { __link: IsographEnvironment_1.ROOT_ID, __typename: entrypoint.concreteType },
75
76
  variables,
76
77
  networkRequest: networkRequest,
@@ -81,25 +82,15 @@ function getOrCreateCacheForArtifact(environment, entrypoint, variables, fetchOp
81
82
  };
82
83
  return getOrCreateItemInSuspenseCache(environment, cacheKey, factory);
83
84
  }
84
- function normalizeData(environment, normalizationAst, networkResponse, variables, root) {
85
- var _a, _b;
86
- var _c, _d, _e;
87
- const encounteredIds = new Map();
85
+ function normalizeData(environment, storeLayer, normalizationAst, networkResponse, variables, root, encounteredIds) {
88
86
  (0, logging_1.logMessage)(environment, () => ({
89
87
  kind: 'AboutToNormalize',
90
88
  normalizationAst,
91
89
  networkResponse,
92
90
  variables,
93
91
  }));
94
- const recordsById = ((_a = (_c = environment.store)[_d = root.__typename]) !== null && _a !== void 0 ? _a : (_c[_d] = {}));
95
- const newStoreRecord = ((_b = recordsById[_e = root.__link]) !== null && _b !== void 0 ? _b : (recordsById[_e] = {}));
96
- normalizeDataIntoRecord(environment, normalizationAst, networkResponse, newStoreRecord, root, variables, encounteredIds);
97
- (0, logging_1.logMessage)(environment, () => ({
98
- kind: 'AfterNormalization',
99
- store: environment.store,
100
- encounteredIds,
101
- }));
102
- callSubscriptions(environment, encounteredIds);
92
+ const newStoreRecord = (0, optimisticProxy_1.getMutableStoreRecordProxy)(storeLayer, root);
93
+ normalizeDataIntoRecord(environment, storeLayer, normalizationAst, networkResponse, newStoreRecord, root, variables, encounteredIds);
103
94
  return encounteredIds;
104
95
  }
105
96
  function subscribeToAnyChange(environment, callback) {
@@ -119,7 +110,6 @@ function subscribeToAnyChangesToRecord(environment, recordLink, callback) {
119
110
  environment.subscriptions.add(subscription);
120
111
  return () => environment.subscriptions.delete(subscription);
121
112
  }
122
- // TODO we should re-read and call callback if the value has changed
123
113
  function subscribe(environment, encounteredDataAndRecords, fragmentReference, callback, readerAst) {
124
114
  const fragmentSubscription = {
125
115
  kind: 'FragmentSubscription',
@@ -128,6 +118,11 @@ function subscribe(environment, encounteredDataAndRecords, fragmentReference, ca
128
118
  fragmentReference,
129
119
  readerAst,
130
120
  };
121
+ // subscribe is called in an effect. (We should actually subscribe during the
122
+ // initial render.) Because it's called in an effect, we might have missed some
123
+ // changes since the initial render! So, at this point, we re-read and call the
124
+ // subscription (i.e. re-render) if the fragment data has changed.
125
+ callSubscriptionIfDataChanged(environment, fragmentSubscription);
131
126
  environment.subscriptions.add(fragmentSubscription);
132
127
  return () => environment.subscriptions.delete(fragmentSubscription);
133
128
  }
@@ -165,38 +160,7 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
165
160
  // fragment, we will call readButNotEvaluate multiple times. We
166
161
  // should fix that.
167
162
  if (hasOverlappingIds(recordsEncounteredWhenNormalizing, subscription.encounteredDataAndRecords.encounteredRecords)) {
168
- const newEncounteredDataAndRecords = (0, read_1.readButDoNotEvaluate)(environment, subscription.fragmentReference,
169
- // Is this wrong?
170
- // Reasons to think no:
171
- // - we are only updating the read-out value, and the network
172
- // options only affect whether we throw.
173
- // - the component will re-render, and re-throw on its own, anyway.
174
- //
175
- // Reasons to think not:
176
- // - it seems more efficient to suspend here and not update state,
177
- // if we expect that the component will just throw anyway
178
- // - consistency
179
- // - it's also weird, this is called from makeNetworkRequest, where
180
- // we don't currently pass network request options
181
- {
182
- suspendIfInFlight: false,
183
- throwOnNetworkError: false,
184
- });
185
- const mergedItem = (0, areEqualWithDeepComparison_1.mergeObjectsUsingReaderAst)(subscription.readerAst, subscription.encounteredDataAndRecords.item, newEncounteredDataAndRecords.item);
186
- (0, logging_1.logMessage)(environment, () => ({
187
- kind: 'DeepEqualityCheck',
188
- fragmentReference: subscription.fragmentReference,
189
- old: subscription.encounteredDataAndRecords.item,
190
- new: newEncounteredDataAndRecords.item,
191
- deeplyEqual: mergedItem === subscription.encounteredDataAndRecords.item,
192
- }));
193
- if (mergedItem !== subscription.encounteredDataAndRecords.item) {
194
- logAnyError(environment, { situation: 'calling FragmentSubscription callback' }, () => {
195
- subscription.callback(newEncounteredDataAndRecords);
196
- });
197
- subscription.encounteredDataAndRecords =
198
- newEncounteredDataAndRecords;
199
- }
163
+ callSubscriptionIfDataChanged(environment, subscription);
200
164
  }
201
165
  return;
202
166
  }
@@ -220,6 +184,39 @@ function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
220
184
  }
221
185
  }));
222
186
  }
187
+ function callSubscriptionIfDataChanged(environment, subscription) {
188
+ const newEncounteredDataAndRecords = (0, read_1.readButDoNotEvaluate)(environment, subscription.fragmentReference,
189
+ // Is this wrong?
190
+ // Reasons to think no:
191
+ // - we are only updating the read-out value, and the network
192
+ // options only affect whether we throw.
193
+ // - the component will re-render, and re-throw on its own, anyway.
194
+ //
195
+ // Reasons to think not:
196
+ // - it seems more efficient to suspend here and not update state,
197
+ // if we expect that the component will just throw anyway
198
+ // - consistency
199
+ // - it's also weird, this is called from makeNetworkRequest, where
200
+ // we don't currently pass network request options
201
+ {
202
+ suspendIfInFlight: false,
203
+ throwOnNetworkError: false,
204
+ });
205
+ const mergedItem = (0, areEqualWithDeepComparison_1.mergeObjectsUsingReaderAst)(subscription.readerAst, subscription.encounteredDataAndRecords.item, newEncounteredDataAndRecords.item);
206
+ (0, logging_1.logMessage)(environment, () => ({
207
+ kind: 'DeepEqualityCheck',
208
+ fragmentReference: subscription.fragmentReference,
209
+ old: subscription.encounteredDataAndRecords.item,
210
+ new: newEncounteredDataAndRecords.item,
211
+ deeplyEqual: mergedItem === subscription.encounteredDataAndRecords.item,
212
+ }));
213
+ if (mergedItem !== subscription.encounteredDataAndRecords.item) {
214
+ logAnyError(environment, { situation: 'calling FragmentSubscription callback' }, () => {
215
+ subscription.callback(newEncounteredDataAndRecords);
216
+ });
217
+ subscription.encounteredDataAndRecords = newEncounteredDataAndRecords;
218
+ }
219
+ }
223
220
  function hasOverlappingIds(ids1, ids2) {
224
221
  for (const [typeName, set1] of ids1.entries()) {
225
222
  const set2 = ids2.get(typeName);
@@ -244,7 +241,7 @@ function isNotDisjointFrom(set1, set2) {
244
241
  /**
245
242
  * Mutate targetParentRecord according to the normalizationAst and networkResponseParentRecord.
246
243
  */
247
- function normalizeDataIntoRecord(environment, normalizationAst, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
244
+ function normalizeDataIntoRecord(environment, storeLayer, normalizationAst, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
248
245
  let recordHasBeenUpdated = false;
249
246
  for (const normalizationNode of normalizationAst) {
250
247
  switch (normalizationNode.kind) {
@@ -255,13 +252,13 @@ function normalizeDataIntoRecord(environment, normalizationAst, networkResponseP
255
252
  break;
256
253
  }
257
254
  case 'Linked': {
258
- const linkedFieldResultedInChange = normalizeLinkedField(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
255
+ const linkedFieldResultedInChange = normalizeLinkedField(environment, storeLayer, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
259
256
  recordHasBeenUpdated =
260
257
  recordHasBeenUpdated || linkedFieldResultedInChange;
261
258
  break;
262
259
  }
263
260
  case 'InlineFragment': {
264
- const inlineFragmentResultedInChange = normalizeInlineFragment(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
261
+ const inlineFragmentResultedInChange = normalizeInlineFragment(environment, storeLayer, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
265
262
  recordHasBeenUpdated =
266
263
  recordHasBeenUpdated || inlineFragmentResultedInChange;
267
264
  break;
@@ -292,9 +289,12 @@ function normalizeScalarField(astNode, networkResponseParentRecord, targetStoreR
292
289
  const networkResponseKey = getNetworkResponseKey(astNode);
293
290
  const networkResponseData = networkResponseParentRecord[networkResponseKey];
294
291
  const parentRecordKey = getParentRecordKey(astNode, variables);
295
- if (networkResponseData == null ||
296
- isScalarOrEmptyArray(networkResponseData)) {
297
- const existingValue = targetStoreRecord[parentRecordKey];
292
+ const existingValue = targetStoreRecord[parentRecordKey];
293
+ if (networkResponseData == null) {
294
+ targetStoreRecord[parentRecordKey] = null;
295
+ return existingValue !== null;
296
+ }
297
+ if (isScalarOrEmptyArray(networkResponseData)) {
298
298
  targetStoreRecord[parentRecordKey] = networkResponseData;
299
299
  return existingValue !== networkResponseData;
300
300
  }
@@ -302,10 +302,13 @@ function normalizeScalarField(astNode, networkResponseParentRecord, targetStoreR
302
302
  throw new Error('Unexpected object array when normalizing scalar');
303
303
  }
304
304
  }
305
+ function isArray(value) {
306
+ return Array.isArray(value);
307
+ }
305
308
  /**
306
309
  * Mutate targetParentRecord with a given linked field ast node.
307
310
  */
308
- function normalizeLinkedField(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
311
+ function normalizeLinkedField(environment, storeLayer, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
309
312
  var _a, _b;
310
313
  const networkResponseKey = getNetworkResponseKey(astNode);
311
314
  const networkResponseData = networkResponseParentRecord[networkResponseKey];
@@ -319,7 +322,7 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
319
322
  !isNullOrEmptyArray(networkResponseData)) {
320
323
  throw new Error('Unexpected scalar network response when normalizing a linked field');
321
324
  }
322
- if (Array.isArray(networkResponseData)) {
325
+ if (isArray(networkResponseData)) {
323
326
  // TODO check astNode.plural or the like
324
327
  const dataIds = [];
325
328
  for (let i = 0; i < networkResponseData.length; i++) {
@@ -328,7 +331,7 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
328
331
  dataIds.push(null);
329
332
  continue;
330
333
  }
331
- const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseObject, targetParentRecordLink, variables, i, mutableEncounteredIds);
334
+ const newStoreRecordId = normalizeNetworkResponseObject(environment, storeLayer, astNode, networkResponseObject, targetParentRecordLink, variables, i, mutableEncounteredIds);
332
335
  const __typename = (_a = astNode.concreteType) !== null && _a !== void 0 ? _a : networkResponseObject[exports.TYPENAME_FIELD_NAME];
333
336
  if (__typename == null) {
334
337
  throw new Error('Unexpected missing __typename in network response when normalizing a linked field. ' +
@@ -343,7 +346,7 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
343
346
  return !dataIdsAreTheSame(existingValue, dataIds);
344
347
  }
345
348
  else {
346
- const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, null, mutableEncounteredIds);
349
+ const newStoreRecordId = normalizeNetworkResponseObject(environment, storeLayer, astNode, networkResponseData, targetParentRecordLink, variables, null, mutableEncounteredIds);
347
350
  let __typename = (_b = astNode.concreteType) !== null && _b !== void 0 ? _b : networkResponseData[exports.TYPENAME_FIELD_NAME];
348
351
  if (__typename == null) {
349
352
  throw new Error('Unexpected missing __typename in network response when normalizing a linked field. ' +
@@ -360,17 +363,17 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
360
363
  /**
361
364
  * Mutate targetParentRecord with a given linked field ast node.
362
365
  */
363
- function normalizeInlineFragment(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
366
+ function normalizeInlineFragment(environment, storeLayer, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
364
367
  const typeToRefineTo = astNode.type;
365
368
  if (networkResponseParentRecord[exports.TYPENAME_FIELD_NAME] === typeToRefineTo) {
366
- const hasBeenModified = normalizeDataIntoRecord(environment, astNode.selections, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
369
+ const hasBeenModified = normalizeDataIntoRecord(environment, storeLayer, astNode.selections, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
367
370
  return hasBeenModified;
368
371
  }
369
372
  return false;
370
373
  }
371
374
  function dataIdsAreTheSame(existingValue, newDataIds) {
372
375
  var _a, _b;
373
- if (Array.isArray(existingValue)) {
376
+ if (isArray(existingValue)) {
374
377
  if (newDataIds.length !== existingValue.length) {
375
378
  return false;
376
379
  }
@@ -387,24 +390,22 @@ function dataIdsAreTheSame(existingValue, newDataIds) {
387
390
  return false;
388
391
  }
389
392
  }
390
- function normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, index, mutableEncounteredIds) {
391
- var _a, _b, _c;
392
- var _d;
393
+ function normalizeNetworkResponseObject(environment, storeLayer, astNode, networkResponseData, targetParentRecordLink, variables, index, mutableEncounteredIds) {
394
+ var _a;
393
395
  const newStoreRecordId = getDataIdOfNetworkResponse(targetParentRecordLink, networkResponseData, astNode, variables, index);
394
396
  const __typename = (_a = astNode.concreteType) !== null && _a !== void 0 ? _a : networkResponseData[exports.TYPENAME_FIELD_NAME];
395
397
  if (__typename == null) {
396
398
  throw new Error('Unexpected missing __typename in network response object. ' +
397
399
  'This is indicative of a bug in Isograph.');
398
400
  }
399
- const recordsById = ((_b = (_d = environment.store)[__typename]) !== null && _b !== void 0 ? _b : (_d[__typename] = {}));
400
- const newStoreRecord = ((_c = recordsById[newStoreRecordId]) !== null && _c !== void 0 ? _c : (recordsById[newStoreRecordId] = {}));
401
- normalizeDataIntoRecord(environment, astNode.selections, networkResponseData, newStoreRecord, { __link: newStoreRecordId, __typename: __typename }, variables, mutableEncounteredIds);
401
+ const link = { __link: newStoreRecordId, __typename };
402
+ const newStoreRecord = (0, optimisticProxy_1.getMutableStoreRecordProxy)(storeLayer, link);
403
+ normalizeDataIntoRecord(environment, storeLayer, astNode.selections, networkResponseData, newStoreRecord, link, variables, mutableEncounteredIds);
402
404
  return newStoreRecordId;
403
405
  }
404
406
  function isScalarOrEmptyArray(data) {
405
407
  // N.B. empty arrays count as empty arrays of scalar fields.
406
- if (Array.isArray(data)) {
407
- // This is maybe fixed in a new version of Typescript??
408
+ if (isArray(data)) {
408
409
  return data.every((x) => isScalarOrEmptyArray(x));
409
410
  }
410
411
  const isScalarValue = data === null ||
@@ -414,7 +415,7 @@ function isScalarOrEmptyArray(data) {
414
415
  return isScalarValue;
415
416
  }
416
417
  function isNullOrEmptyArray(data) {
417
- if (Array.isArray(data)) {
418
+ if (isArray(data)) {
418
419
  if (data.length === 0) {
419
420
  return true;
420
421
  }
@@ -548,3 +549,30 @@ function getDataIdOfNetworkResponse(parentRecordLink, dataToNormalize, astNode,
548
549
  }
549
550
  return storeKey;
550
551
  }
552
+ function writeData(environment, entrypoint, data, variables) {
553
+ const encounteredIds = new Map();
554
+ environment.store = (0, optimisticProxy_1.addNetworkResponseStoreLayer)(environment.store);
555
+ normalizeData(environment, environment.store, entrypoint.networkRequestInfo.normalizationAst.selections, data, variables, { __link: IsographEnvironment_1.ROOT_ID, __typename: entrypoint.concreteType }, encounteredIds);
556
+ (0, logging_1.logMessage)(environment, () => ({
557
+ kind: 'AfterNormalization',
558
+ store: environment.store,
559
+ encounteredIds,
560
+ }));
561
+ callSubscriptions(environment, encounteredIds);
562
+ const { fieldName, readerArtifactKind, readerWithRefetchQueries } = (0, IsographEnvironment_1.getOrLoadReaderWithRefetchQueries)(environment, entrypoint.readerWithRefetchQueries);
563
+ const [networkRequest, disposeNetworkRequest] = (0, makeNetworkRequest_1.retainQueryWithoutMakingNetworkRequest)(environment, entrypoint, variables);
564
+ return [
565
+ {
566
+ kind: 'FragmentReference',
567
+ readerWithRefetchQueries,
568
+ fieldName,
569
+ readerArtifactKind,
570
+ root: { __link: IsographEnvironment_1.ROOT_ID, __typename: entrypoint.concreteType },
571
+ variables,
572
+ networkRequest,
573
+ },
574
+ () => {
575
+ disposeNetworkRequest();
576
+ },
577
+ ];
578
+ }
@@ -4,14 +4,17 @@ import { IsographEnvironment, StoreLink } from './IsographEnvironment';
4
4
  export type ShouldFetch = RequiredShouldFetch | 'IfNecessary';
5
5
  export type RequiredShouldFetch = 'Yes' | 'No';
6
6
  export declare const DEFAULT_SHOULD_FETCH_VALUE: ShouldFetch;
7
- export type FetchOptions<TReadOutData> = {
8
- shouldFetch?: ShouldFetch;
7
+ type FetchOptionsShared<TReadOutData> = {
9
8
  onComplete?: (data: TReadOutData) => void;
10
9
  onError?: () => void;
11
10
  };
12
- export type RequiredFetchOptions<TReadOutData> = {
11
+ export interface FetchOptions<TReadOutData, TRawResponseType> extends FetchOptionsShared<TReadOutData> {
12
+ shouldFetch?: ShouldFetch;
13
+ optimisticNetworkResponse?: TRawResponseType;
14
+ }
15
+ export interface RequiredFetchOptions<TReadOutData> extends FetchOptionsShared<TReadOutData> {
13
16
  shouldFetch: RequiredShouldFetch;
14
- } & FetchOptions<TReadOutData>;
17
+ }
15
18
  export type CheckResult = {
16
19
  kind: 'EnoughData';
17
20
  } | {
@@ -19,4 +22,5 @@ export type CheckResult = {
19
22
  record: StoreLink;
20
23
  };
21
24
  export declare function check(environment: IsographEnvironment, normalizationAst: NormalizationAstNodes, variables: Variables, root: StoreLink): CheckResult;
25
+ export {};
22
26
  //# sourceMappingURL=check.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/core/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAE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kB,CAAC,YAAY,IAAI;IACtC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,YAAY,CAAC,YAAY,EAAE,gBAAgB,CAC1D,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACxC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,yBAAyB,CAAC,EAAE,gBAAgB,CAAC;CAC9C;AAED,MAAM,WAAW,oBAAoB,CAAC,YAAY,CAChD,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACxC,WAAW,EAAE,mBAAmB,CAAC;CAClC;AAED,MAAM,MAAM,WAAW,GACnB;IACE,IAAI,EAAE,YAAY,CAAC;CACpB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEN,wBAAgB,KAAK,CACnB,WAAW,EAAE,mBAAmB,EAChC,gBAAgB,EAAE,qBAAqB,EACvC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,GACd,WAAW,CAsBb"}
@@ -5,12 +5,16 @@ exports.check = check;
5
5
  const cache_1 = require("./cache");
6
6
  const IsographEnvironment_1 = require("./IsographEnvironment");
7
7
  const logging_1 = require("./logging");
8
+ const optimisticProxy_1 = require("./optimisticProxy");
8
9
  exports.DEFAULT_SHOULD_FETCH_VALUE = 'IfNecessary';
9
10
  function check(environment, normalizationAst, variables, root) {
10
- var _a, _b;
11
- var _c, _d, _e;
12
- const recordsById = ((_a = (_c = environment.store)[_d = root.__typename]) !== null && _a !== void 0 ? _a : (_c[_d] = {}));
13
- const newStoreRecord = ((_b = recordsById[_e = root.__link]) !== null && _b !== void 0 ? _b : (recordsById[_e] = {}));
11
+ const newStoreRecord = (0, optimisticProxy_1.getStoreRecordProxy)(environment.store, root);
12
+ if (newStoreRecord == null) {
13
+ return {
14
+ kind: 'MissingData',
15
+ record: root,
16
+ };
17
+ }
14
18
  const checkResult = checkFromRecord(environment, normalizationAst, variables, newStoreRecord, root);
15
19
  (0, logging_1.logMessage)(environment, () => ({
16
20
  kind: 'EnvironmentCheck',
@@ -19,7 +23,6 @@ function check(environment, normalizationAst, variables, root) {
19
23
  return checkResult;
20
24
  }
21
25
  function checkFromRecord(environment, normalizationAst, variables, record, recordLink) {
22
- var _a, _b;
23
26
  normalizationAstLoop: for (const normalizationAstNode of normalizationAst) {
24
27
  switch (normalizationAstNode.kind) {
25
28
  case 'Scalar': {
@@ -54,7 +57,7 @@ function checkFromRecord(environment, normalizationAst, variables, record, recor
54
57
  throw new Error('Unexpected non-link in the Isograph store. ' +
55
58
  'This is indicative of a bug in Isograph.');
56
59
  }
57
- const linkedRecord = (_a = environment.store[link.__typename]) === null || _a === void 0 ? void 0 : _a[link.__link];
60
+ const linkedRecord = (0, optimisticProxy_1.getStoreRecordProxy)(environment.store, link);
58
61
  if (linkedRecord === undefined) {
59
62
  return {
60
63
  kind: 'MissingData',
@@ -79,7 +82,7 @@ function checkFromRecord(environment, normalizationAst, variables, record, recor
79
82
  throw new Error('Unexpected non-link in the Isograph store. ' +
80
83
  'This is indicative of a bug in Isograph.');
81
84
  }
82
- const linkedRecord = (_b = environment.store[link.__typename]) === null || _b === void 0 ? void 0 : _b[link.__link];
85
+ const linkedRecord = (0, optimisticProxy_1.getStoreRecordProxy)(environment.store, link);
83
86
  if (linkedRecord === undefined) {
84
87
  return {
85
88
  kind: 'MissingData',
@@ -1,5 +1,5 @@
1
1
  import { FragmentReference } from './FragmentReference';
2
2
  import { IsographEnvironment } from './IsographEnvironment';
3
3
  import { NetworkRequestReaderOptions } from './read';
4
- export declare function getOrCreateCachedComponent(environment: IsographEnvironment, componentName: string, fragmentReference: FragmentReference<any, any>, networkRequestOptions: NetworkRequestReaderOptions): React.FC<any>;
4
+ export declare function getOrCreateCachedComponent(environment: IsographEnvironment, fragmentReference: FragmentReference<any, any>, networkRequestOptions: NetworkRequestReaderOptions): React.FC<any>;
5
5
  //# sourceMappingURL=componentCache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"componentCache.d.ts","sourceRoot":"","sources":["../../src/core/componentCache.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAGrD,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,qBAAqB,EAAE,2BAA2B,GACjD,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CA2Cf"}
1
+ {"version":3,"file":"componentCache.d.ts","sourceRoot":"","sources":["../../src/core/componentCache.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAGrD,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,mBAAmB,EAChC,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,qBAAqB,EAAE,2BAA2B,GACjD,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CA+Cf"}
@@ -2,22 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOrCreateCachedComponent = getOrCreateCachedComponent;
4
4
  const useReadAndSubscribe_1 = require("../react/useReadAndSubscribe");
5
+ const useResult_1 = require("../react/useResult");
5
6
  const FragmentReference_1 = require("./FragmentReference");
6
7
  const logging_1 = require("./logging");
7
8
  const PromiseWrapper_1 = require("./PromiseWrapper");
8
9
  const startUpdate_1 = require("./startUpdate");
9
- function getOrCreateCachedComponent(environment, componentName, fragmentReference, networkRequestOptions) {
10
+ function getOrCreateCachedComponent(environment, fragmentReference, networkRequestOptions) {
10
11
  var _a;
11
12
  var _b, _c;
12
13
  // We create startUpdate outside of component to make it stable
13
14
  const startUpdate = (0, startUpdate_1.createStartUpdate)(environment, fragmentReference, networkRequestOptions);
14
- return ((_a = (_b = environment.componentCache)[_c = (0, FragmentReference_1.stableIdForFragmentReference)(fragmentReference, componentName)]) !== null && _a !== void 0 ? _a : (_b[_c] = (() => {
15
+ return ((_a = (_b = environment.componentCache)[_c = (0, FragmentReference_1.stableIdForFragmentReference)(fragmentReference)]) !== null && _a !== void 0 ? _a : (_b[_c] = (() => {
15
16
  function Component(additionalRuntimeProps) {
17
+ (0, useResult_1.maybeUnwrapNetworkRequest)(fragmentReference.networkRequest, networkRequestOptions);
16
18
  const readerWithRefetchQueries = (0, PromiseWrapper_1.readPromise)(fragmentReference.readerWithRefetchQueries);
17
19
  const data = (0, useReadAndSubscribe_1.useReadAndSubscribe)(fragmentReference, networkRequestOptions, readerWithRefetchQueries.readerArtifact.readerAst);
18
20
  (0, logging_1.logMessage)(environment, () => ({
19
21
  kind: 'ComponentRerendered',
20
- componentName,
22
+ componentName: fragmentReference.fieldName,
21
23
  rootLink: fragmentReference.root,
22
24
  }));
23
25
  return readerWithRefetchQueries.readerArtifact.resolver({
@@ -29,7 +31,7 @@ function getOrCreateCachedComponent(environment, componentName, fragmentReferenc
29
31
  }, additionalRuntimeProps);
30
32
  }
31
33
  const idString = `(type: ${fragmentReference.root.__typename}, id: ${fragmentReference.root.__link})`;
32
- Component.displayName = `${componentName} ${idString} @component`;
34
+ Component.displayName = `${fragmentReference.fieldName} ${idString} @component`;
33
35
  return Component;
34
36
  })()));
35
37
  }
@@ -1,5 +1,7 @@
1
+ import type { Contravariant, PhantomData } from './brand';
2
+ import type { NetworkResponseObject } from './cache';
1
3
  import type { UnknownTReadFromStore } from './FragmentReference';
2
- import type { TypeName } from './IsographEnvironment';
4
+ import type { ComponentOrFieldName, TypeName } from './IsographEnvironment';
3
5
  import { TopLevelReaderArtifact } from './reader';
4
6
  import { Arguments } from './util';
5
7
  export type ReaderWithRefetchQueries<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
@@ -9,6 +11,8 @@ export type ReaderWithRefetchQueries<TReadFromStore extends UnknownTReadFromStor
9
11
  };
10
12
  export type ReaderWithRefetchQueriesLoader<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
11
13
  readonly kind: 'ReaderWithRefetchQueriesLoader';
14
+ readonly fieldName: ComponentOrFieldName;
15
+ readonly readerArtifactKind: 'EagerReaderArtifact' | 'ComponentReaderArtifact';
12
16
  readonly loader: () => Promise<ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue>>;
13
17
  };
14
18
  export type NetworkRequestInfo<TNormalizationAst> = {
@@ -30,16 +34,21 @@ export type IsographPersistedOperationExtraInfo = {
30
34
  readonly operationName: string | null;
31
35
  readonly operationKind: 'Query' | 'Mutation' | 'Subscription';
32
36
  };
33
- export type IsographEntrypoint<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TNormalizationAst extends NormalizationAst | NormalizationAstLoader> = {
37
+ export type IsographEntrypoint<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TNormalizationAst extends NormalizationAst | NormalizationAstLoader, TRawResponseType extends NetworkResponseObject> = {
34
38
  readonly kind: 'Entrypoint';
35
39
  readonly networkRequestInfo: NetworkRequestInfo<TNormalizationAst>;
36
40
  readonly readerWithRefetchQueries: ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue> | ReaderWithRefetchQueriesLoader<TReadFromStore, TClientFieldValue>;
37
41
  readonly concreteType: TypeName;
42
+ /**
43
+ * This field exists solely for typechecking, and will not exist at runtime.
44
+ */
45
+ readonly '~TRawResponseType'?: PhantomData<Contravariant<TRawResponseType>>;
38
46
  };
39
- export type IsographEntrypointLoader<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
47
+ export type IsographEntrypointLoader<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TRawResponseType extends NetworkResponseObject> = {
40
48
  readonly kind: 'EntrypointLoader';
41
49
  readonly typeAndField: string;
42
- readonly loader: () => Promise<IsographEntrypoint<TReadFromStore, TClientFieldValue, NormalizationAst>>;
50
+ readonly readerArtifactKind: 'EagerReaderArtifact' | 'ComponentReaderArtifact';
51
+ readonly loader: () => Promise<IsographEntrypoint<TReadFromStore, TClientFieldValue, NormalizationAst, TRawResponseType>>;
43
52
  };
44
53
  export type NormalizationAstNode = NormalizationScalarField | NormalizationLinkedField | NormalizationInlineFragment;
45
54
  export type NormalizationAstNodes = ReadonlyArray<NormalizationAstNode>;
@@ -77,8 +86,9 @@ export type RefetchQueryNormalizationArtifactWrapper = {
77
86
  readonly artifact: RefetchQueryNormalizationArtifact;
78
87
  readonly allowedVariables: string[];
79
88
  };
80
- export declare function assertIsEntrypoint<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TNormalizationAst extends NormalizationAst | NormalizationAstLoader>(value: IsographEntrypoint<TReadFromStore, TClientFieldValue, TNormalizationAst> | ((_: any) => any) | any): asserts value is IsographEntrypoint<TReadFromStore, TClientFieldValue, TNormalizationAst>;
81
- export type ExtractReadFromStore<Type> = Type extends IsographEntrypoint<infer X, any, any> ? X : never;
82
- export type ExtractResolverResult<Type> = Type extends IsographEntrypoint<any, infer X, any> ? X : never;
89
+ export declare function assertIsEntrypoint<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TNormalizationAst extends NormalizationAst | NormalizationAstLoader, TRawResponseType extends NetworkResponseObject>(value: IsographEntrypoint<TReadFromStore, TClientFieldValue, TNormalizationAst, TRawResponseType> | ((_: any) => any) | any): asserts value is IsographEntrypoint<TReadFromStore, TClientFieldValue, TNormalizationAst, TRawResponseType>;
90
+ export type ExtractReadFromStore<Type> = Type extends IsographEntrypoint<infer X, any, any, any> ? X : never;
91
+ export type ExtractRawResponseType<Type> = Type extends IsographEntrypoint<any, any, any, infer X> ? X : never;
92
+ export type ExtractResolverResult<Type> = Type extends IsographEntrypoint<any, infer X, any, any> ? X : never;
83
93
  export type ExtractProps<Type> = Type extends React.FC<infer X> ? X : never;
84
94
  //# sourceMappingURL=entrypoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../src/core/entrypoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,wBAAwB,CAClC,cAAc,SAAS,qBAAqB,EAC5C,iBAAiB,IACf;IACF,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAC7C,cAAc,EACd,iBAAiB,EAEjB,GAAG,CACJ,CAAC;IACF,QAAQ,CAAC,oBAAoB,EAAE,wCAAwC,EAAE,CAAC;CAC3E,CAAC;AAEF,MAAM,MAAM,8BAA8B,CACxC,cAAc,SAAS,qBAAqB,EAC5C,iBAAiB,IACf;IACF,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAC5B,wBAAwB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAC5D,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,iBAAiB,IAAI;IAClD,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,GAAG,0BAA0B,CAAC;IACnE,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,iBAAiB,G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-1,12 +1,18 @@
1
- import { NormalizationAstNodes } from './entrypoint';
1
+ import { type NormalizationAst } from './entrypoint';
2
2
  import { IsographEnvironment, type StoreLink } from './IsographEnvironment';
3
+ import type { BaseStoreLayer } from './optimisticProxy';
4
+ import { type PromiseWrapper, type PromiseWrapperOk } from './PromiseWrapper';
3
5
  export type RetainedQuery = {
4
- readonly normalizationAst: NormalizationAstNodes;
6
+ readonly normalizationAst: PromiseWrapper<NormalizationAst>;
5
7
  readonly variables: {};
6
8
  readonly root: StoreLink;
7
9
  };
10
+ export interface RetainedQueryWithNormalizationAst extends RetainedQuery {
11
+ readonly normalizationAst: PromiseWrapperOk<NormalizationAst>;
12
+ }
8
13
  export type DidUnretainSomeQuery = boolean;
9
14
  export declare function unretainQuery(environment: IsographEnvironment, retainedQuery: RetainedQuery): DidUnretainSomeQuery;
10
15
  export declare function retainQuery(environment: IsographEnvironment, queryToRetain: RetainedQuery): void;
11
16
  export declare function garbageCollectEnvironment(environment: IsographEnvironment): void;
17
+ export declare function garbageCollectBaseStoreLayer(retainedQueries: RetainedQueryWithNormalizationAst[], baseStoreLayer: BaseStoreLayer): void;
12
18
  //# sourceMappingURL=garbageCollection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../../src/core/garbageCollection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAGL,mBAAmB,EAGnB,KAAK,SAAS,EAEf,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAC3C,wBAAgB,aAAa,CAC3B,WAAW,EAAE,mBAAmB,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