@isograph/react 0.1.1 → 0.3.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 (160) hide show
  1. package/dist/core/FragmentReference.d.ts +25 -0
  2. package/dist/core/FragmentReference.d.ts.map +1 -0
  3. package/dist/core/FragmentReference.js +16 -0
  4. package/dist/core/IsographEnvironment.d.ts +89 -0
  5. package/dist/core/IsographEnvironment.d.ts.map +1 -0
  6. package/dist/core/IsographEnvironment.js +65 -0
  7. package/dist/core/PromiseWrapper.d.ts +28 -0
  8. package/dist/core/PromiseWrapper.d.ts.map +1 -0
  9. package/dist/core/PromiseWrapper.js +57 -0
  10. package/dist/core/areEqualWithDeepComparison.d.ts +5 -0
  11. package/dist/core/areEqualWithDeepComparison.d.ts.map +1 -0
  12. package/dist/core/areEqualWithDeepComparison.js +95 -0
  13. package/dist/core/cache.d.ts +44 -0
  14. package/dist/core/cache.d.ts.map +1 -0
  15. package/dist/core/cache.js +514 -0
  16. package/dist/core/check.d.ts +18 -0
  17. package/dist/core/check.d.ts.map +1 -0
  18. package/dist/core/check.js +127 -0
  19. package/dist/core/componentCache.d.ts +5 -0
  20. package/dist/core/componentCache.d.ts.map +1 -0
  21. package/dist/core/componentCache.js +38 -0
  22. package/dist/core/entrypoint.d.ts +69 -0
  23. package/dist/core/entrypoint.d.ts.map +1 -0
  24. package/dist/core/entrypoint.js +7 -0
  25. package/dist/core/garbageCollection.d.ts +13 -0
  26. package/dist/core/garbageCollection.d.ts.map +1 -0
  27. package/dist/core/garbageCollection.js +107 -0
  28. package/dist/core/logging.d.ts +69 -0
  29. package/dist/core/logging.d.ts.map +1 -0
  30. package/dist/core/logging.js +19 -0
  31. package/dist/core/makeNetworkRequest.d.ts +9 -0
  32. package/dist/core/makeNetworkRequest.d.ts.map +1 -0
  33. package/dist/core/makeNetworkRequest.js +118 -0
  34. package/dist/core/read.d.ts +27 -0
  35. package/dist/core/read.d.ts.map +1 -0
  36. package/dist/core/read.js +478 -0
  37. package/dist/core/reader.d.ts +87 -0
  38. package/dist/core/reader.d.ts.map +1 -0
  39. package/dist/core/reader.js +2 -0
  40. package/dist/core/util.d.ts +19 -0
  41. package/dist/core/util.d.ts.map +1 -0
  42. package/dist/core/util.js +2 -0
  43. package/dist/index.d.ts +26 -120
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +57 -306
  46. package/dist/loadable-hooks/useClientSideDefer.d.ts +16 -0
  47. package/dist/loadable-hooks/useClientSideDefer.d.ts.map +1 -0
  48. package/dist/loadable-hooks/useClientSideDefer.js +13 -0
  49. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts +34 -0
  50. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts.map +1 -0
  51. package/dist/loadable-hooks/useConnectionSpecPagination.js +160 -0
  52. package/dist/loadable-hooks/useImperativeExposedMutationField.d.ts +6 -0
  53. package/dist/loadable-hooks/useImperativeExposedMutationField.d.ts.map +1 -0
  54. package/dist/loadable-hooks/useImperativeExposedMutationField.js +14 -0
  55. package/dist/loadable-hooks/useImperativeLoadableField.d.ts +17 -0
  56. package/dist/loadable-hooks/useImperativeLoadableField.d.ts.map +1 -0
  57. package/dist/loadable-hooks/useImperativeLoadableField.js +14 -0
  58. package/dist/loadable-hooks/useSkipLimitPagination.d.ts +27 -0
  59. package/dist/loadable-hooks/useSkipLimitPagination.d.ts.map +1 -0
  60. package/dist/loadable-hooks/useSkipLimitPagination.js +162 -0
  61. package/dist/react/FragmentReader.d.ts +16 -0
  62. package/dist/react/FragmentReader.d.ts.map +1 -0
  63. package/dist/{EntrypointReader.js → react/FragmentReader.js} +7 -5
  64. package/dist/react/IsographEnvironmentProvider.d.ts +11 -0
  65. package/dist/react/IsographEnvironmentProvider.d.ts.map +1 -0
  66. package/dist/{IsographEnvironment.js → react/IsographEnvironmentProvider.js} +4 -22
  67. package/dist/react/RenderAfterCommit__DO_NOT_USE.d.ts +10 -0
  68. package/dist/react/RenderAfterCommit__DO_NOT_USE.d.ts.map +1 -0
  69. package/dist/react/RenderAfterCommit__DO_NOT_USE.js +15 -0
  70. package/dist/react/useImperativeReference.d.ts +12 -0
  71. package/dist/react/useImperativeReference.d.ts.map +1 -0
  72. package/dist/react/useImperativeReference.js +35 -0
  73. package/dist/react/useLazyReference.d.ts +10 -0
  74. package/dist/react/useLazyReference.d.ts.map +1 -0
  75. package/dist/react/useLazyReference.js +21 -0
  76. package/dist/react/useReadAndSubscribe.d.ts +20 -0
  77. package/dist/react/useReadAndSubscribe.d.ts.map +1 -0
  78. package/dist/react/useReadAndSubscribe.js +40 -0
  79. package/dist/react/useRerenderOnChange.d.ts +8 -0
  80. package/dist/react/useRerenderOnChange.d.ts.map +1 -0
  81. package/dist/react/useRerenderOnChange.js +22 -0
  82. package/dist/react/useResult.d.ts +9 -0
  83. package/dist/react/useResult.d.ts.map +1 -0
  84. package/dist/react/useResult.js +39 -0
  85. package/docs/how-useLazyReference-works.md +117 -0
  86. package/isograph.config.json +7 -0
  87. package/package.json +18 -9
  88. package/schema.graphql +17 -0
  89. package/src/core/FragmentReference.ts +49 -0
  90. package/src/core/IsographEnvironment.ts +192 -0
  91. package/src/core/PromiseWrapper.ts +86 -0
  92. package/src/core/areEqualWithDeepComparison.ts +112 -0
  93. package/src/core/cache.ts +835 -0
  94. package/src/core/check.ts +207 -0
  95. package/src/core/componentCache.ts +62 -0
  96. package/src/core/entrypoint.ts +106 -0
  97. package/src/core/garbageCollection.ts +173 -0
  98. package/src/core/logging.ts +116 -0
  99. package/src/core/makeNetworkRequest.ts +175 -0
  100. package/src/core/read.ts +722 -0
  101. package/src/core/reader.ts +160 -0
  102. package/src/core/util.ts +27 -0
  103. package/src/index.ts +99 -0
  104. package/src/loadable-hooks/useClientSideDefer.ts +58 -0
  105. package/src/loadable-hooks/useConnectionSpecPagination.ts +331 -0
  106. package/src/loadable-hooks/useImperativeExposedMutationField.ts +17 -0
  107. package/src/loadable-hooks/useImperativeLoadableField.ts +52 -0
  108. package/src/loadable-hooks/useSkipLimitPagination.ts +352 -0
  109. package/src/react/FragmentReader.tsx +43 -0
  110. package/src/react/IsographEnvironmentProvider.tsx +33 -0
  111. package/src/react/RenderAfterCommit__DO_NOT_USE.tsx +17 -0
  112. package/src/react/useImperativeReference.ts +68 -0
  113. package/src/react/useLazyReference.ts +42 -0
  114. package/src/react/useReadAndSubscribe.ts +81 -0
  115. package/src/react/useRerenderOnChange.ts +38 -0
  116. package/src/react/useResult.ts +73 -0
  117. package/src/tests/__isograph/Query/meName/entrypoint.ts +52 -0
  118. package/src/tests/__isograph/Query/meName/output_type.ts +3 -0
  119. package/src/tests/__isograph/Query/meName/param_type.ts +9 -0
  120. package/src/tests/__isograph/Query/meName/resolver_reader.ts +33 -0
  121. package/src/tests/__isograph/Query/meNameSuccessor/entrypoint.ts +90 -0
  122. package/src/tests/__isograph/Query/meNameSuccessor/output_type.ts +3 -0
  123. package/src/tests/__isograph/Query/meNameSuccessor/param_type.ts +14 -0
  124. package/src/tests/__isograph/Query/meNameSuccessor/resolver_reader.ts +57 -0
  125. package/src/tests/__isograph/Query/nodeField/entrypoint.ts +57 -0
  126. package/src/tests/__isograph/Query/nodeField/output_type.ts +3 -0
  127. package/src/tests/__isograph/Query/nodeField/param_type.ts +10 -0
  128. package/src/tests/__isograph/Query/nodeField/parameters_type.ts +3 -0
  129. package/src/tests/__isograph/Query/nodeField/resolver_reader.ts +38 -0
  130. package/src/tests/__isograph/Query/subquery/entrypoint.ts +67 -0
  131. package/src/tests/__isograph/Query/subquery/output_type.ts +3 -0
  132. package/src/tests/__isograph/Query/subquery/param_type.ts +12 -0
  133. package/src/tests/__isograph/Query/subquery/parameters_type.ts +3 -0
  134. package/src/tests/__isograph/Query/subquery/resolver_reader.ts +47 -0
  135. package/src/tests/__isograph/iso.ts +99 -0
  136. package/src/tests/garbageCollection.test.ts +142 -0
  137. package/src/tests/meNameSuccessor.ts +25 -0
  138. package/src/tests/nodeQuery.ts +19 -0
  139. package/src/tests/normalizeData.test.ts +120 -0
  140. package/src/tests/tsconfig.json +21 -0
  141. package/tsconfig.json +6 -0
  142. package/tsconfig.pkg.json +7 -1
  143. package/vitest.config.ts +20 -0
  144. package/dist/EntrypointReader.d.ts +0 -6
  145. package/dist/IsographEnvironment.d.ts +0 -56
  146. package/dist/PromiseWrapper.d.ts +0 -13
  147. package/dist/PromiseWrapper.js +0 -22
  148. package/dist/cache.d.ts +0 -26
  149. package/dist/cache.js +0 -274
  150. package/dist/componentCache.d.ts +0 -6
  151. package/dist/componentCache.js +0 -31
  152. package/dist/useImperativeReference.d.ts +0 -8
  153. package/dist/useImperativeReference.js +0 -28
  154. package/src/EntrypointReader.tsx +0 -20
  155. package/src/IsographEnvironment.tsx +0 -120
  156. package/src/PromiseWrapper.ts +0 -29
  157. package/src/cache.tsx +0 -484
  158. package/src/componentCache.ts +0 -41
  159. package/src/index.tsx +0 -617
  160. package/src/useImperativeReference.ts +0 -58
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOrCreateCachedComponent = getOrCreateCachedComponent;
4
+ const cache_1 = require("./cache");
5
+ const useReadAndSubscribe_1 = require("../react/useReadAndSubscribe");
6
+ const PromiseWrapper_1 = require("./PromiseWrapper");
7
+ const logging_1 = require("./logging");
8
+ function getOrCreateCachedComponent(environment, componentName, fragmentReference, networkRequestOptions) {
9
+ var _a, _b, _c;
10
+ // cachedComponentsById is a three layer cache: id, then component name, then
11
+ // stringified args. These three, together, uniquely identify a read at a given
12
+ // time.
13
+ const cachedComponentsById = environment.componentCache;
14
+ const recordLink = fragmentReference.root.__link;
15
+ const componentsByName = ((_a = cachedComponentsById[recordLink]) !== null && _a !== void 0 ? _a : (cachedComponentsById[recordLink] = {}));
16
+ componentsByName[componentName] = (_b = componentsByName[componentName]) !== null && _b !== void 0 ? _b : {};
17
+ const byArgs = componentsByName[componentName];
18
+ const stringifiedArgs = JSON.stringify((0, cache_1.stableCopy)(fragmentReference.variables));
19
+ byArgs[stringifiedArgs] =
20
+ (_c = byArgs[stringifiedArgs]) !== null && _c !== void 0 ? _c : (() => {
21
+ function Component(additionalRuntimeProps) {
22
+ const readerWithRefetchQueries = (0, PromiseWrapper_1.readPromise)(fragmentReference.readerWithRefetchQueries);
23
+ const data = (0, useReadAndSubscribe_1.useReadAndSubscribe)(fragmentReference, networkRequestOptions, readerWithRefetchQueries.readerArtifact.readerAst);
24
+ (0, logging_1.logMessage)(environment, {
25
+ kind: 'ComponentRerendered',
26
+ componentName,
27
+ rootLink: fragmentReference.root,
28
+ });
29
+ return readerWithRefetchQueries.readerArtifact.resolver({
30
+ data,
31
+ parameters: fragmentReference.variables,
32
+ }, additionalRuntimeProps);
33
+ }
34
+ Component.displayName = `${componentName} (id: ${fragmentReference.root}) @component`;
35
+ return Component;
36
+ })();
37
+ return byArgs[stringifiedArgs];
38
+ }
@@ -0,0 +1,69 @@
1
+ import type { TypeName } from './IsographEnvironment';
2
+ import { TopLevelReaderArtifact } from './reader';
3
+ import { Arguments } from './util';
4
+ export type ReaderWithRefetchQueries<TReadFromStore extends {
5
+ parameters: object;
6
+ data: object;
7
+ }, TClientFieldValue> = {
8
+ readonly kind: 'ReaderWithRefetchQueries';
9
+ readonly readerArtifact: TopLevelReaderArtifact<TReadFromStore, TClientFieldValue, any>;
10
+ readonly nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[];
11
+ };
12
+ export type NetworkRequestInfo = {
13
+ readonly kind: 'NetworkRequestInfo';
14
+ readonly queryText: string;
15
+ readonly normalizationAst: NormalizationAst;
16
+ };
17
+ export type IsographEntrypoint<TReadFromStore extends {
18
+ parameters: object;
19
+ data: object;
20
+ }, TClientFieldValue> = {
21
+ readonly kind: 'Entrypoint';
22
+ readonly networkRequestInfo: NetworkRequestInfo;
23
+ readonly readerWithRefetchQueries: ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue>;
24
+ readonly concreteType: TypeName;
25
+ };
26
+ export type IsographEntrypointLoader<TReadFromStore extends {
27
+ parameters: object;
28
+ data: object;
29
+ }, TClientFieldValue> = {
30
+ readonly kind: 'EntrypointLoader';
31
+ readonly typeAndField: string;
32
+ readonly loader: () => Promise<IsographEntrypoint<TReadFromStore, TClientFieldValue>>;
33
+ };
34
+ export type NormalizationAstNode = NormalizationScalarField | NormalizationLinkedField | NormalizationInlineFragment;
35
+ export type NormalizationAst = ReadonlyArray<NormalizationAstNode>;
36
+ export type NormalizationScalarField = {
37
+ readonly kind: 'Scalar';
38
+ readonly fieldName: string;
39
+ readonly arguments: Arguments | null;
40
+ };
41
+ export type NormalizationLinkedField = {
42
+ readonly kind: 'Linked';
43
+ readonly fieldName: string;
44
+ readonly arguments: Arguments | null;
45
+ readonly selections: NormalizationAst;
46
+ readonly concreteType: TypeName | null;
47
+ };
48
+ export type NormalizationInlineFragment = {
49
+ readonly kind: 'InlineFragment';
50
+ readonly type: string;
51
+ readonly selections: NormalizationAst;
52
+ };
53
+ export type RefetchQueryNormalizationArtifact = {
54
+ readonly kind: 'RefetchQuery';
55
+ readonly networkRequestInfo: NetworkRequestInfo;
56
+ readonly concreteType: TypeName;
57
+ };
58
+ export type RefetchQueryNormalizationArtifactWrapper = {
59
+ readonly artifact: RefetchQueryNormalizationArtifact;
60
+ readonly allowedVariables: string[];
61
+ };
62
+ export declare function assertIsEntrypoint<TReadFromStore extends {
63
+ parameters: object;
64
+ data: object;
65
+ }, TClientFieldValue>(value: IsographEntrypoint<TReadFromStore, TClientFieldValue> | ((_: any) => any) | any): asserts value is IsographEntrypoint<TReadFromStore, TClientFieldValue>;
66
+ export type ExtractReadFromStore<Type> = Type extends IsographEntrypoint<infer X, any> ? X : never;
67
+ export type ExtractResolverResult<Type> = Type extends IsographEntrypoint<any, infer X> ? X : never;
68
+ export type ExtractProps<Type> = Type extends React.FC<infer X> ? X : never;
69
+ //# sourceMappingURL=entrypoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../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C;IACrD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,cAAc,SAAS;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC3D,iBAAiB,EAEjB,KAAK,EACD,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,CAAC,GACrD,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,GAGjB,GAAG,GACN,OAAO,CAAC,KAAK,IAAI,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAExE;AAED,MAAM,MAAM,oBAAoB,CAAC,IAAI,IACnC,IAAI,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,qBAAqB,CAAC,IAAI,IACpC,IAAI,SAAS,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,YAAY,CAAC,IAAI,IAAI,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertIsEntrypoint = assertIsEntrypoint;
4
+ function assertIsEntrypoint(value) {
5
+ if (typeof value === 'function')
6
+ throw new Error('Not a string');
7
+ }
@@ -0,0 +1,13 @@
1
+ import { IsographEnvironment, type Link } from './IsographEnvironment';
2
+ import { NormalizationAst } from './entrypoint';
3
+ export type RetainedQuery = {
4
+ readonly normalizationAst: NormalizationAst;
5
+ readonly variables: {};
6
+ readonly root: Link;
7
+ };
8
+ type DidUnretainSomeQuery = boolean;
9
+ export declare function unretainQuery(environment: IsographEnvironment, retainedQuery: RetainedQuery): DidUnretainSomeQuery;
10
+ export declare function retainQuery(environment: IsographEnvironment, queryToRetain: RetainedQuery): void;
11
+ export declare function garbageCollectEnvironment(environment: IsographEnvironment): void;
12
+ export {};
13
+ //# sourceMappingURL=garbageCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../../src/core/garbageCollection.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EAInB,KAAK,IAAI,EAEV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,oBAAoB,GAAG,OAAO,CAAC;AACpC,wBAAgB,aAAa,CAC3B,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,aAAa,GAC3B,oBAAoB,CAUtB;AAED,wBAAgB,WAAW,CACzB,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,aAAa,QAM7B;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,mBAAmB,QA+BzE"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unretainQuery = unretainQuery;
4
+ exports.retainQuery = retainQuery;
5
+ exports.garbageCollectEnvironment = garbageCollectEnvironment;
6
+ const IsographEnvironment_1 = require("./IsographEnvironment");
7
+ const cache_1 = require("./cache");
8
+ function unretainQuery(environment, retainedQuery) {
9
+ environment.retainedQueries.delete(retainedQuery);
10
+ environment.gcBuffer.push(retainedQuery);
11
+ if (environment.gcBuffer.length > environment.gcBufferSize) {
12
+ environment.gcBuffer.shift();
13
+ return true;
14
+ }
15
+ return false;
16
+ }
17
+ function retainQuery(environment, queryToRetain) {
18
+ environment.retainedQueries.add(queryToRetain);
19
+ // TODO can we remove this query from the buffer somehow?
20
+ // We are relying on === equality, but we really should be comparing
21
+ // id + variables
22
+ }
23
+ function garbageCollectEnvironment(environment) {
24
+ const retainedIds = {};
25
+ for (const query of environment.retainedQueries) {
26
+ recordReachableIds(environment.store, query, retainedIds);
27
+ }
28
+ for (const query of environment.gcBuffer) {
29
+ recordReachableIds(environment.store, query, retainedIds);
30
+ }
31
+ for (const typeName in environment.store) {
32
+ const dataById = environment.store[typeName];
33
+ if (dataById == null)
34
+ continue;
35
+ const retainedTypeIds = retainedIds[typeName];
36
+ // delete all objects
37
+ if (retainedTypeIds == undefined || retainedTypeIds.size == 0) {
38
+ delete environment.store[typeName];
39
+ continue;
40
+ }
41
+ for (const dataId in dataById) {
42
+ if (!retainedTypeIds.has(dataId)) {
43
+ delete dataById[dataId];
44
+ }
45
+ }
46
+ if (Object.keys(dataById).length === 0) {
47
+ delete environment.store[typeName];
48
+ }
49
+ }
50
+ }
51
+ function recordReachableIds(store, retainedQuery, mutableRetainedIds) {
52
+ var _a, _b;
53
+ var _c;
54
+ const record = (_a = store[retainedQuery.root.__typename]) === null || _a === void 0 ? void 0 : _a[retainedQuery.root.__link];
55
+ const retainedRecordsIds = ((_b = mutableRetainedIds[_c = retainedQuery.root.__typename]) !== null && _b !== void 0 ? _b : (mutableRetainedIds[_c] = new Set()));
56
+ retainedRecordsIds.add(retainedQuery.root.__link);
57
+ if (record) {
58
+ recordReachableIdsFromRecord(store, record, mutableRetainedIds, retainedQuery.normalizationAst, retainedQuery.variables);
59
+ }
60
+ }
61
+ function recordReachableIdsFromRecord(store, currentRecord, mutableRetainedIds, selections, variables) {
62
+ var _a;
63
+ for (const selection of selections) {
64
+ switch (selection.kind) {
65
+ case 'Linked':
66
+ const linkKey = (0, cache_1.getParentRecordKey)(selection, variables !== null && variables !== void 0 ? variables : {});
67
+ const linkedFieldOrFields = currentRecord[linkKey];
68
+ const links = [];
69
+ if (Array.isArray(linkedFieldOrFields)) {
70
+ for (const maybeLink of linkedFieldOrFields) {
71
+ const link = (0, IsographEnvironment_1.assertLink)(maybeLink);
72
+ if (link != null) {
73
+ links.push(link);
74
+ }
75
+ }
76
+ }
77
+ else {
78
+ const link = (0, IsographEnvironment_1.assertLink)(linkedFieldOrFields);
79
+ if (link != null) {
80
+ links.push(link);
81
+ }
82
+ }
83
+ let typeStore = selection.concreteType !== null
84
+ ? store[selection.concreteType]
85
+ : null;
86
+ if (typeStore == null && selection.concreteType !== null) {
87
+ continue;
88
+ }
89
+ for (const nextRecordLink of links) {
90
+ let __typename = nextRecordLink.__typename;
91
+ const resolvedTypeStore = typeStore !== null && typeStore !== void 0 ? typeStore : store[__typename];
92
+ if (resolvedTypeStore == null) {
93
+ continue;
94
+ }
95
+ const nextRecord = resolvedTypeStore[nextRecordLink.__link];
96
+ if (nextRecord != null) {
97
+ const retainedRecordsIds = ((_a = mutableRetainedIds[__typename]) !== null && _a !== void 0 ? _a : (mutableRetainedIds[__typename] = new Set()));
98
+ retainedRecordsIds.add(nextRecordLink.__link);
99
+ recordReachableIdsFromRecord(store, nextRecord, mutableRetainedIds, selection.selections, variables);
100
+ }
101
+ }
102
+ continue;
103
+ case 'Scalar':
104
+ continue;
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,69 @@
1
+ import { CleanupFn } from '@isograph/disposable-types';
2
+ import { IsographEnvironment, IsographStore, StoreRecord, type Link } from './IsographEnvironment';
3
+ import { IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArtifact } from './entrypoint';
4
+ import { FragmentReference, Variables } from './FragmentReference';
5
+ import { NetworkResponseObject, type EncounteredIds } from './cache';
6
+ import { Arguments } from './util';
7
+ import { ReadDataResult } from './read';
8
+ import { CheckResult } from './check';
9
+ export type LogMessage = {
10
+ kind: 'GettingSuspenseCacheItem';
11
+ index: string;
12
+ availableCacheItems: ReadonlyArray<string>;
13
+ found: boolean;
14
+ } | {
15
+ kind: 'AboutToNormalize';
16
+ normalizationAst: NormalizationAst;
17
+ networkResponse: NetworkResponseObject;
18
+ variables: Variables;
19
+ } | {
20
+ kind: 'AfterNormalization';
21
+ store: IsographStore;
22
+ encounteredIds: EncounteredIds;
23
+ } | {
24
+ kind: 'DeepEqualityCheck';
25
+ fragmentReference: FragmentReference<any, any>;
26
+ old: object;
27
+ new: object;
28
+ deeplyEqual: boolean;
29
+ } | {
30
+ kind: 'ComponentRerendered';
31
+ componentName: string;
32
+ rootLink: Link;
33
+ } | {
34
+ kind: 'MakeNetworkRequest';
35
+ artifact: RefetchQueryNormalizationArtifact | IsographEntrypoint<any, any>;
36
+ variables: Variables;
37
+ networkRequestId: string;
38
+ } | {
39
+ kind: 'ReceivedNetworkResponse';
40
+ networkResponse: any;
41
+ networkRequestId: string;
42
+ } | {
43
+ kind: 'ReceivedNetworkError';
44
+ error: any;
45
+ networkRequestId: string;
46
+ } | {
47
+ kind: 'MissingFieldHandlerCalled';
48
+ root: Link;
49
+ storeRecord: StoreRecord;
50
+ fieldName: string;
51
+ arguments: Arguments | null;
52
+ variables: Variables;
53
+ } | {
54
+ kind: 'DoneReading';
55
+ response: ReadDataResult<any>;
56
+ } | {
57
+ kind: 'NonEntrypointReceived';
58
+ entrypoint: any;
59
+ } | {
60
+ kind: 'EnvironmentCheck';
61
+ result: CheckResult;
62
+ };
63
+ export type LogFunction = (logMessage: LogMessage) => void;
64
+ export type WrappedLogFunction = {
65
+ log: LogFunction;
66
+ };
67
+ export declare function logMessage(environment: IsographEnvironment, message: LogMessage): void;
68
+ export declare function registerLogger(environment: IsographEnvironment, log: LogFunction): CleanupFn;
69
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/core/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;A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ACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,yBAAyB,CAAC;IAEhC,eAAe,EAAE,GAAG,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,2BAA2B,CAAC;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC/B,GACD;IACE,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC;CACjB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEN,MAAM,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;AAG3D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,wBAAgB,UAAU,CACxB,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,UAAU,QAOpB;AAED,wBAAgB,cAAc,CAC5B,WAAW,EAAE,mBAAmB,EAChC,GAAG,EAAE,WAAW,GACf,SAAS,CAMX"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logMessage = logMessage;
4
+ exports.registerLogger = registerLogger;
5
+ function logMessage(environment, message) {
6
+ for (const logger of environment.loggers) {
7
+ try {
8
+ logger.log(message);
9
+ }
10
+ catch (_a) { }
11
+ }
12
+ }
13
+ function registerLogger(environment, log) {
14
+ const wrapped = { log };
15
+ environment.loggers.add(wrapped);
16
+ return () => {
17
+ environment.loggers.delete(wrapped);
18
+ };
19
+ }
@@ -0,0 +1,9 @@
1
+ import { ItemCleanupPair } from '@isograph/disposable-types';
2
+ import { IsographEntrypoint, RefetchQueryNormalizationArtifact } from './entrypoint';
3
+ import { Variables } from './FragmentReference';
4
+ import { IsographEnvironment } from './IsographEnvironment';
5
+ import { AnyError, PromiseWrapper } from './PromiseWrapper';
6
+ import { FetchOptions } from './check';
7
+ export declare function maybeMakeNetworkRequest(environment: IsographEnvironment, artifact: RefetchQueryNormalizationArtifact | IsographEntrypoint<any, any>, variables: Variables, fetchOptions?: FetchOptions): ItemCleanupPair<PromiseWrapper<void, AnyError>>;
8
+ export declare function makeNetworkRequest(environment: IsographEnvironment, artifact: RefetchQueryNormalizationArtifact | IsographEntrypoint<any, any>, variables: Variables, fetchOptions?: FetchOptions): ItemCleanupPair<PromiseWrapper<void, AnyError>>;
9
+ //# sourceMappingURL=makeNetworkRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeNetworkRequest.d.ts","sourceRoot":"","sources":["../../src/core/makeNetworkRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAOhD,OAAO,EAAE,mBAAmB,EAAW,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,cAAc,EAGf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAqC,YAAY,EAAE,MAAM,SAAS,CAAC;AAI1E,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,mBAAmB,EAChC,QAAQ,EAAE,iCAAiC,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1E,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,YAAY,GAC1B,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CA8BjD;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,mBAAmB,EAChC,QAAQ,EAAE,iCAAiC,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1E,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,YAAY,GAC1B,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CA+FjD"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maybeMakeNetworkRequest = maybeMakeNetworkRequest;
4
+ exports.makeNetworkRequest = makeNetworkRequest;
5
+ const garbageCollection_1 = require("./garbageCollection");
6
+ const IsographEnvironment_1 = require("./IsographEnvironment");
7
+ const PromiseWrapper_1 = require("./PromiseWrapper");
8
+ const cache_1 = require("./cache");
9
+ const logging_1 = require("./logging");
10
+ const check_1 = require("./check");
11
+ let networkRequestId = 0;
12
+ function maybeMakeNetworkRequest(environment, artifact, variables, fetchOptions) {
13
+ var _a;
14
+ switch ((_a = fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.shouldFetch) !== null && _a !== void 0 ? _a : check_1.DEFAULT_SHOULD_FETCH_VALUE) {
15
+ case 'Yes': {
16
+ return makeNetworkRequest(environment, artifact, variables, fetchOptions);
17
+ }
18
+ case 'No': {
19
+ return [(0, PromiseWrapper_1.wrapResolvedValue)(undefined), () => { }];
20
+ }
21
+ case 'IfNecessary': {
22
+ const result = (0, check_1.check)(environment, artifact.networkRequestInfo.normalizationAst, variables, {
23
+ __link: IsographEnvironment_1.ROOT_ID,
24
+ __typename: artifact.concreteType,
25
+ });
26
+ if (result.kind === 'EnoughData') {
27
+ return [(0, PromiseWrapper_1.wrapResolvedValue)(undefined), () => { }];
28
+ }
29
+ else {
30
+ return makeNetworkRequest(environment, artifact, variables, fetchOptions);
31
+ }
32
+ }
33
+ }
34
+ }
35
+ function makeNetworkRequest(environment, artifact, variables, fetchOptions) {
36
+ // TODO this should be a DataId and stored in the store
37
+ const myNetworkRequestId = networkRequestId + '';
38
+ networkRequestId++;
39
+ (0, logging_1.logMessage)(environment, {
40
+ kind: 'MakeNetworkRequest',
41
+ artifact,
42
+ variables,
43
+ networkRequestId: myNetworkRequestId,
44
+ });
45
+ let status = {
46
+ kind: 'UndisposedIncomplete',
47
+ };
48
+ // This should be an observable, not a promise
49
+ const promise = environment
50
+ .networkFunction(artifact.networkRequestInfo.queryText, variables)
51
+ .then((networkResponse) => {
52
+ var _a, _b, _c;
53
+ (0, logging_1.logMessage)(environment, {
54
+ kind: 'ReceivedNetworkResponse',
55
+ networkResponse,
56
+ networkRequestId: myNetworkRequestId,
57
+ });
58
+ if (networkResponse.errors != null) {
59
+ try {
60
+ (_a = fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.onError) === null || _a === void 0 ? void 0 : _a.call(fetchOptions);
61
+ }
62
+ catch (_d) { }
63
+ // @ts-expect-error Why are we getting the wrong constructor here?
64
+ throw new Error('GraphQL network response had errors', {
65
+ cause: networkResponse,
66
+ });
67
+ }
68
+ if (status.kind === 'UndisposedIncomplete') {
69
+ const root = { __link: IsographEnvironment_1.ROOT_ID, __typename: artifact.concreteType };
70
+ (0, cache_1.normalizeData)(environment, artifact.networkRequestInfo.normalizationAst, (_b = networkResponse.data) !== null && _b !== void 0 ? _b : {}, variables, artifact.kind === 'Entrypoint'
71
+ ? artifact.readerWithRefetchQueries.nestedRefetchQueries
72
+ : [], root);
73
+ const retainedQuery = {
74
+ normalizationAst: artifact.networkRequestInfo.normalizationAst,
75
+ variables,
76
+ root,
77
+ };
78
+ status = {
79
+ kind: 'UndisposedComplete',
80
+ retainedQuery,
81
+ };
82
+ (0, garbageCollection_1.retainQuery)(environment, retainedQuery);
83
+ }
84
+ try {
85
+ (_c = fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.onComplete) === null || _c === void 0 ? void 0 : _c.call(fetchOptions);
86
+ }
87
+ catch (_e) { }
88
+ })
89
+ .catch((e) => {
90
+ var _a;
91
+ (0, logging_1.logMessage)(environment, {
92
+ kind: 'ReceivedNetworkError',
93
+ networkRequestId: myNetworkRequestId,
94
+ error: e,
95
+ });
96
+ try {
97
+ (_a = fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.onError) === null || _a === void 0 ? void 0 : _a.call(fetchOptions);
98
+ }
99
+ catch (_b) { }
100
+ throw e;
101
+ });
102
+ const wrapper = (0, PromiseWrapper_1.wrapPromise)(promise);
103
+ const response = [
104
+ wrapper,
105
+ () => {
106
+ if (status.kind === 'UndisposedComplete') {
107
+ const didUnretainSomeQuery = (0, garbageCollection_1.unretainQuery)(environment, status.retainedQuery);
108
+ if (didUnretainSomeQuery) {
109
+ (0, garbageCollection_1.garbageCollectEnvironment)(environment);
110
+ }
111
+ }
112
+ status = {
113
+ kind: 'Disposed',
114
+ };
115
+ },
116
+ ];
117
+ return response;
118
+ }
@@ -0,0 +1,27 @@
1
+ import { type EncounteredIds } from './cache';
2
+ import { FragmentReference, ExtractData } from './FragmentReference';
3
+ import { IsographEnvironment, type Link } from './IsographEnvironment';
4
+ export type WithEncounteredRecords<T> = {
5
+ readonly encounteredRecords: EncounteredIds;
6
+ readonly item: ExtractData<T>;
7
+ };
8
+ export declare function readButDoNotEvaluate<TReadFromStore extends {
9
+ parameters: object;
10
+ data: object;
11
+ }>(environment: IsographEnvironment, fragmentReference: FragmentReference<TReadFromStore, unknown>, networkRequestOptions: NetworkRequestReaderOptions): WithEncounteredRecords<TReadFromStore>;
12
+ export type ReadDataResult<TReadFromStore> = {
13
+ readonly kind: 'Success';
14
+ readonly data: ExtractData<TReadFromStore>;
15
+ readonly encounteredRecords: EncounteredIds;
16
+ } | {
17
+ readonly kind: 'MissingData';
18
+ readonly reason: string;
19
+ readonly nestedReason?: ReadDataResult<unknown>;
20
+ readonly recordLink: Link;
21
+ };
22
+ export type NetworkRequestReaderOptions = {
23
+ suspendIfInFlight: boolean;
24
+ throwOnNetworkError: boolean;
25
+ };
26
+ export declare function getNetworkRequestOptionsWithDefaults(networkRequestOptions?: Partial<NetworkRequestReaderOptions> | void): NetworkRequestReaderOptions;
27
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/core/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAMjB,OAAO,EACL,iBAAiB,EAEjB,WAAW,EAEZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,mBAAmB,EACnB,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;AAe/B,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC,QAAQ,CAAC,kBAAkB,EAAE,cAAc,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,cAAc,SAAS;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAE3D,WAAW,EAAE,mBAAmB,EAChC,iBAAiB,EAAE,iBAAiB,CAAC,cAAc,EAAE,OAAO,CAAC,EAC7D,qBAAqB,EAAE,2BAA2B,GACjD,sBAAsB,CAAC,cAAc,CAAC,CAkDxC;AAED,MAAM,MAAM,cAAc,CAAC,cAAc,IACrC;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,cAAc,CAAC;CAC7C,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QA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