@isograph/react 0.3.1 → 0.4.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.
- package/.turbo/turbo-compile-libs.log +5 -0
- package/dist/core/FragmentReference.d.ts +5 -5
- package/dist/core/FragmentReference.d.ts.map +1 -1
- package/dist/core/IsographEnvironment.d.ts +14 -9
- package/dist/core/IsographEnvironment.d.ts.map +1 -1
- package/dist/core/PromiseWrapper.d.ts +4 -4
- package/dist/core/PromiseWrapper.d.ts.map +1 -1
- package/dist/core/PromiseWrapper.js +2 -9
- package/dist/core/areEqualWithDeepComparison.d.ts +1 -3
- package/dist/core/areEqualWithDeepComparison.d.ts.map +1 -1
- package/dist/core/areEqualWithDeepComparison.js +0 -2
- package/dist/core/brand.d.ts +2 -0
- package/dist/core/brand.d.ts.map +1 -0
- package/dist/core/brand.js +2 -0
- package/dist/core/cache.d.ts +7 -6
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/cache.js +46 -28
- package/dist/core/check.d.ts +3 -3
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/componentCache.d.ts.map +1 -1
- package/dist/core/componentCache.js +1 -1
- package/dist/core/entrypoint.d.ts +20 -2
- package/dist/core/entrypoint.d.ts.map +1 -1
- package/dist/core/garbageCollection.d.ts +2 -2
- package/dist/core/garbageCollection.d.ts.map +1 -1
- package/dist/core/logging.d.ts +13 -4
- package/dist/core/logging.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.d.ts +3 -3
- package/dist/core/makeNetworkRequest.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.js +15 -15
- package/dist/core/read.d.ts +8 -8
- package/dist/core/read.d.ts.map +1 -1
- package/dist/core/read.js +98 -29
- package/dist/core/reader.d.ts +12 -8
- package/dist/core/reader.d.ts.map +1 -1
- package/dist/core/startUpdate.d.ts +7 -4
- package/dist/core/startUpdate.d.ts.map +1 -1
- package/dist/core/startUpdate.js +153 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/loadable-hooks/useConnectionSpecPagination.d.ts.map +1 -1
- package/dist/loadable-hooks/useConnectionSpecPagination.js +1 -1
- package/dist/loadable-hooks/useSkipLimitPagination.d.ts.map +1 -1
- package/dist/loadable-hooks/useSkipLimitPagination.js +1 -1
- package/dist/react/FragmentReader.d.ts +7 -13
- package/dist/react/FragmentReader.d.ts.map +1 -1
- package/dist/react/FragmentReader.js +3 -30
- package/dist/react/FragmentRenderer.d.ts +15 -0
- package/dist/react/FragmentRenderer.d.ts.map +1 -0
- package/dist/react/FragmentRenderer.js +35 -0
- package/dist/react/LoadableFieldReader.d.ts +12 -0
- package/dist/react/LoadableFieldReader.d.ts.map +1 -0
- package/dist/react/LoadableFieldReader.js +10 -0
- package/dist/react/LoadableFieldRenderer.d.ts +13 -0
- package/dist/react/LoadableFieldRenderer.d.ts.map +1 -0
- package/dist/react/LoadableFieldRenderer.js +37 -0
- package/dist/react/useImperativeReference.d.ts.map +1 -1
- package/dist/react/useImperativeReference.js +6 -6
- package/dist/react/useResult.d.ts.map +1 -1
- package/dist/react/useResult.js +1 -1
- package/package.json +4 -5
- package/src/core/FragmentReference.ts +16 -7
- package/src/core/IsographEnvironment.ts +19 -9
- package/src/core/PromiseWrapper.ts +13 -16
- package/src/core/areEqualWithDeepComparison.ts +5 -5
- package/src/core/brand.ts +18 -0
- package/src/core/cache.ts +50 -43
- package/src/core/check.ts +4 -4
- package/src/core/componentCache.ts +5 -1
- package/src/core/entrypoint.ts +32 -5
- package/src/core/garbageCollection.ts +3 -3
- package/src/core/logging.ts +16 -4
- package/src/core/makeNetworkRequest.ts +48 -23
- package/src/core/read.ts +153 -48
- package/src/core/reader.ts +11 -7
- package/src/core/startUpdate.ts +313 -7
- package/src/index.ts +11 -3
- package/src/loadable-hooks/useConnectionSpecPagination.ts +1 -0
- package/src/loadable-hooks/useSkipLimitPagination.ts +1 -0
- package/src/react/FragmentReader.tsx +23 -39
- package/src/react/FragmentRenderer.tsx +46 -0
- package/src/react/LoadableFieldReader.tsx +40 -0
- package/src/react/LoadableFieldRenderer.tsx +41 -0
- package/src/react/useImperativeReference.ts +9 -8
- package/src/react/useResult.ts +1 -0
- package/src/tests/__isograph/Economist/link/output_type.ts +2 -0
- package/src/tests/__isograph/Node/asEconomist/resolver_reader.ts +28 -0
- package/src/tests/__isograph/Node/link/output_type.ts +3 -0
- package/src/tests/__isograph/Query/linkedUpdate/entrypoint.ts +31 -0
- package/src/tests/__isograph/Query/linkedUpdate/normalization_ast.ts +95 -0
- package/src/tests/__isograph/Query/linkedUpdate/output_type.ts +3 -0
- package/src/tests/__isograph/Query/linkedUpdate/param_type.ts +51 -0
- package/src/tests/__isograph/Query/linkedUpdate/query_text.ts +20 -0
- package/src/tests/__isograph/Query/linkedUpdate/resolver_reader.ts +93 -0
- package/src/tests/__isograph/Query/meName/entrypoint.ts +4 -1
- package/src/tests/__isograph/Query/meName/query_text.ts +1 -1
- package/src/tests/__isograph/Query/meName/resolver_reader.ts +1 -0
- package/src/tests/__isograph/Query/meNameSuccessor/entrypoint.ts +4 -1
- package/src/tests/__isograph/Query/meNameSuccessor/query_text.ts +1 -1
- package/src/tests/__isograph/Query/meNameSuccessor/resolver_reader.ts +3 -0
- package/src/tests/__isograph/Query/nodeField/entrypoint.ts +4 -1
- package/src/tests/__isograph/Query/nodeField/query_text.ts +1 -1
- package/src/tests/__isograph/Query/nodeField/resolver_reader.ts +1 -0
- package/src/tests/__isograph/Query/startUpdate/entrypoint.ts +31 -0
- package/src/tests/__isograph/Query/startUpdate/normalization_ast.ts +51 -0
- package/src/tests/__isograph/Query/startUpdate/output_type.ts +3 -0
- package/src/tests/__isograph/Query/startUpdate/param_type.ts +26 -0
- package/src/tests/__isograph/Query/startUpdate/parameters_type.ts +3 -0
- package/src/tests/__isograph/Query/startUpdate/query_text.ts +11 -0
- package/src/tests/__isograph/Query/startUpdate/resolver_reader.ts +55 -0
- package/src/tests/__isograph/Query/subquery/entrypoint.ts +4 -1
- package/src/tests/__isograph/Query/subquery/query_text.ts +1 -1
- package/src/tests/__isograph/Query/subquery/resolver_reader.ts +2 -0
- package/src/tests/__isograph/iso.ts +21 -1
- package/src/tests/__isograph/tsconfig.json +8 -0
- package/src/tests/normalizeData.test.ts +0 -1
- package/src/tests/startUpdate.test.ts +205 -0
- package/.turbo/turbo-compile-typescript.log +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReaderWithRefetchQueries } from '../core/entrypoint';
|
|
2
|
-
import { type
|
|
2
|
+
import { type StoreLink } from './IsographEnvironment';
|
|
3
3
|
import { PromiseWrapper } from './PromiseWrapper';
|
|
4
4
|
import type { StartUpdate } from './reader';
|
|
5
5
|
export type VariableValue = string | number | boolean | null | {
|
|
@@ -19,13 +19,13 @@ export type ExtractData<T> = T extends {
|
|
|
19
19
|
export type ExtractParameters<T> = T extends {
|
|
20
20
|
parameters: infer P extends Variables;
|
|
21
21
|
} ? P : Variables;
|
|
22
|
-
export type ExtractStartUpdate<T extends
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
export type ExtractStartUpdate<T extends UnknownTReadFromStore> = T['startUpdate'];
|
|
23
|
+
export type ExtractUpdatableData<T extends UnknownTReadFromStore> = ExtractUpdatableDataFromStartUpdate<ExtractStartUpdate<T>>;
|
|
24
|
+
export type ExtractUpdatableDataFromStartUpdate<T> = T extends StartUpdate<infer D> ? D : never;
|
|
25
25
|
export type FragmentReference<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
|
|
26
26
|
readonly kind: 'FragmentReference';
|
|
27
27
|
readonly readerWithRefetchQueries: PromiseWrapper<ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue>>;
|
|
28
|
-
readonly root:
|
|
28
|
+
readonly root: StoreLink;
|
|
29
29
|
readonly variables: ExtractParameters<TReadFromStore>;
|
|
30
30
|
readonly networkRequest: PromiseWrapper<void, any>;
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FragmentReference.d.ts","sourceRoot":"","sources":["../../src/core/FragmentReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"FragmentReference.d.ts","sourceRoot":"","sources":["../../src/core/FragmentReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IACE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC;CACzC,GACD,aAAa,EAAE,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS;IACrC,IAAI,EAAE,MAAM,CAAC,SAAS,MAAM,CAAC;CAC9B,GACG,CAAC,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC3C,UAAU,EAAE,MAAM,CAAC,SAAS,SAAS,CAAC;CACvC,GACG,CAAC,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,qBAAqB,IAC5D,CAAC,CAAC,aAAa,CAAC,CAAC;AAEnB,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,qBAAqB,IAC9D,mCAAmC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7D,MAAM,MAAM,mCAAmC,CAAC,CAAC,IAC/C,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,iBAAiB,CAC3B,cAAc,SAAS,qBAAqB,EAC5C,iBAAiB,IACf;IACF,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,wBAAwB,EAAE,cAAc,CAC/C,wBAAwB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAC5D,CAAC;IACF,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAOzB,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACtD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAElD,wBAAgB,4BAA4B,CAC1C,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,SAAS,EAAE,MAAM,GAChB,4BAA4B,CAE9B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ParentCache } from '@isograph/react-disposable-state';
|
|
2
|
-
import { IsographEntrypoint } from './entrypoint';
|
|
2
|
+
import { IsographEntrypoint, IsographOperation, IsographPersistedOperation } from './entrypoint';
|
|
3
3
|
import { FragmentReference, Variables, type StableIdForFragmentReference, type UnknownTReadFromStore } from './FragmentReference';
|
|
4
4
|
import { RetainedQuery } from './garbageCollection';
|
|
5
5
|
import { LogFunction, WrappedLogFunction } from './logging';
|
|
6
6
|
import { PromiseWrapper } from './PromiseWrapper';
|
|
7
7
|
import { WithEncounteredRecords } from './read';
|
|
8
8
|
import type { ReaderAst, StartUpdate } from './reader';
|
|
9
|
+
import type { Brand } from './brand';
|
|
9
10
|
export type ComponentOrFieldName = string;
|
|
10
11
|
export type StringifiedArgs = string;
|
|
11
12
|
export type FieldCache<T> = {
|
|
@@ -22,7 +23,7 @@ export type FragmentSubscription<TReadFromStore extends UnknownTReadFromStore> =
|
|
|
22
23
|
export type AnyChangesToRecordSubscription = {
|
|
23
24
|
readonly kind: 'AnyChangesToRecord';
|
|
24
25
|
readonly callback: () => void;
|
|
25
|
-
readonly recordLink:
|
|
26
|
+
readonly recordLink: StoreLink;
|
|
26
27
|
};
|
|
27
28
|
export type AnyRecordSubscription = {
|
|
28
29
|
readonly kind: 'AnyRecords';
|
|
@@ -47,15 +48,19 @@ export type IsographEnvironment = {
|
|
|
47
48
|
readonly gcBufferSize: number;
|
|
48
49
|
readonly loggers: Set<WrappedLogFunction>;
|
|
49
50
|
};
|
|
50
|
-
export type MissingFieldHandler = (storeRecord: StoreRecord, root:
|
|
51
|
+
export type MissingFieldHandler = (storeRecord: StoreRecord, root: StoreLink, fieldName: string, arguments_: {
|
|
51
52
|
[index: string]: any;
|
|
52
|
-
} | null, variables: Variables | null) =>
|
|
53
|
-
export type IsographNetworkFunction = (
|
|
54
|
-
export
|
|
53
|
+
} | null, variables: Variables | null) => StoreLink | undefined;
|
|
54
|
+
export type IsographNetworkFunction = (operation: IsographOperation | IsographPersistedOperation, variables: Variables) => Promise<any>;
|
|
55
|
+
export interface Link<T extends TypeName> extends StoreLink {
|
|
56
|
+
readonly __link: Brand<DataId, T>;
|
|
57
|
+
readonly __typename: T;
|
|
58
|
+
}
|
|
59
|
+
export type StoreLink = {
|
|
55
60
|
readonly __link: DataId;
|
|
56
61
|
readonly __typename: TypeName;
|
|
57
62
|
};
|
|
58
|
-
export type DataTypeValue = undefined | number | boolean | string | null |
|
|
63
|
+
export type DataTypeValue = undefined | number | boolean | string | null | StoreLink | DataTypeValue[];
|
|
59
64
|
export type StoreRecord = {
|
|
60
65
|
[index: DataId | string]: DataTypeValue;
|
|
61
66
|
readonly id?: DataId;
|
|
@@ -73,7 +78,7 @@ export type IsographStore = {
|
|
|
73
78
|
};
|
|
74
79
|
export declare function createIsographEnvironment(store: IsographStore, networkFunction: IsographNetworkFunction, missingFieldHandler?: MissingFieldHandler | null, logFunction?: LogFunction | null): IsographEnvironment;
|
|
75
80
|
export declare function createIsographStore(): IsographStore;
|
|
76
|
-
export declare function assertLink(link: DataTypeValue):
|
|
77
|
-
export declare function getLink(maybeLink: DataTypeValue):
|
|
81
|
+
export declare function assertLink(link: DataTypeValue): StoreLink | null | undefined;
|
|
82
|
+
export declare function getLink(maybeLink: DataTypeValue): StoreLink | null;
|
|
78
83
|
export declare function getOrLoadIsographArtifact(environment: IsographEnvironment, key: string, loader: () => Promise<IsographEntrypoint<any, any, any>>): PromiseWrapper<IsographEntrypoint<any, any, any>>;
|
|
79
84
|
//# sourceMappingURL=IsographEnvironment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsographEnvironment.d.ts","sourceRoot":"","sources":["../../src/core/IsographEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"IsographEnvironment.d.ts","sourceRoot":"","sources":["../../src/core/IsographEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC5D,OA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C9B,CAAC;CACH,CAAC;AAGF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,aAAa,EACpB,eAAe,EAAE,uBAAuB,EACxC,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,EAChD,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAC/B,mBAAmB,CAkBrB;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CAMnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAW5E;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAYlE;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,mBAAmB,EAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GACvD,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAQnD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type AnyError = any;
|
|
2
|
-
export declare const NOT_SET:
|
|
2
|
+
export declare const NOT_SET: unique symbol;
|
|
3
3
|
export type NotSet = typeof NOT_SET;
|
|
4
4
|
export type Result<T, E> = {
|
|
5
5
|
kind: 'Ok';
|
|
@@ -13,11 +13,11 @@ export type Result<T, E> = {
|
|
|
13
13
|
* Before the promise is resolved, value becomes non-null.
|
|
14
14
|
*/
|
|
15
15
|
export type PromiseWrapper<T, E = any> = {
|
|
16
|
-
readonly promise: Promise<T
|
|
16
|
+
readonly promise: Promise<Exclude<T, NotSet>>;
|
|
17
17
|
result: Result<Exclude<T, NotSet>, E> | NotSet;
|
|
18
18
|
};
|
|
19
|
-
export declare function wrapPromise<T>(promise: Promise<T
|
|
20
|
-
export declare function wrapResolvedValue<T>(value: T): PromiseWrapper<T, never>;
|
|
19
|
+
export declare function wrapPromise<T>(promise: Promise<Exclude<T, NotSet>>): PromiseWrapper<T, unknown>;
|
|
20
|
+
export declare function wrapResolvedValue<T>(value: Exclude<T, NotSet>): PromiseWrapper<T, never>;
|
|
21
21
|
export declare function readPromise<T, E>(p: PromiseWrapper<T, E>): T;
|
|
22
22
|
export type PromiseState<T, E> = {
|
|
23
23
|
kind: 'Pending';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromiseWrapper.d.ts","sourceRoot":"","sources":["../../src/core/PromiseWrapper.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE3B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"PromiseWrapper.d.ts","sourceRoot":"","sources":["../../src/core/PromiseWrapper.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE3B,eAAO,MAAM,OAAO,eAAoB,CAAC;AACzC,MAAM,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC;AAEpC,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IACnB;IACE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,CAAC,CAAC;CACV,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEN;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,wBAAgB,WAAW,CAAC,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GACnC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,CAW5B;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,GACxB,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAQ1B;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAY5D;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,IACzB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACrB,GACD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEjB,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAClC,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GACtB,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAQpB"}
|
|
@@ -11,11 +11,9 @@ function wrapPromise(promise) {
|
|
|
11
11
|
const wrapper = { promise, result: exports.NOT_SET };
|
|
12
12
|
promise
|
|
13
13
|
.then((v) => {
|
|
14
|
-
// v is assignable to Exclude<T, Symbol> | Symbol
|
|
15
14
|
wrapper.result = { kind: 'Ok', value: v };
|
|
16
15
|
})
|
|
17
16
|
.catch((e) => {
|
|
18
|
-
// e is assignable to Exclude<T, Symbol> | Symbol
|
|
19
17
|
wrapper.result = { kind: 'Err', error: e };
|
|
20
18
|
});
|
|
21
19
|
return wrapper;
|
|
@@ -25,7 +23,6 @@ function wrapResolvedValue(value) {
|
|
|
25
23
|
promise: Promise.resolve(value),
|
|
26
24
|
result: {
|
|
27
25
|
kind: 'Ok',
|
|
28
|
-
// @ts-expect-error one should not call wrapResolvedValue with NOT_SET
|
|
29
26
|
value,
|
|
30
27
|
},
|
|
31
28
|
};
|
|
@@ -33,7 +30,6 @@ function wrapResolvedValue(value) {
|
|
|
33
30
|
function readPromise(p) {
|
|
34
31
|
const { result } = p;
|
|
35
32
|
if (result !== exports.NOT_SET) {
|
|
36
|
-
// Safety: p.result is either NOT_SET or an actual value.
|
|
37
33
|
const resultKind = result;
|
|
38
34
|
if (resultKind.kind === 'Ok') {
|
|
39
35
|
return resultKind.value;
|
|
@@ -45,11 +41,8 @@ function readPromise(p) {
|
|
|
45
41
|
throw p.promise;
|
|
46
42
|
}
|
|
47
43
|
function getPromiseState(p) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// Safety: p.result is either NOT_SET or an actual value.
|
|
51
|
-
const resultKind = result;
|
|
52
|
-
return resultKind;
|
|
44
|
+
if (p.result !== exports.NOT_SET) {
|
|
45
|
+
return p.result;
|
|
53
46
|
}
|
|
54
47
|
return {
|
|
55
48
|
kind: 'Pending',
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { ReaderAst
|
|
2
|
-
export declare function mergeUsingReaderAst(field: ReaderScalarField | ReaderLinkedField, oldItem: unknown, newItem: unknown): unknown;
|
|
3
|
-
export declare function mergeArraysUsingReaderAst(field: ReaderScalarField | ReaderLinkedField, oldItems: ReadonlyArray<unknown>, newItems: Array<unknown>): ReadonlyArray<unknown>;
|
|
1
|
+
import type { ReaderAst } from './reader';
|
|
4
2
|
export declare function mergeObjectsUsingReaderAst(ast: ReaderAst<object>, oldItemObject: object, newItemObject: object): object;
|
|
5
3
|
//# sourceMappingURL=areEqualWithDeepComparison.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"areEqualWithDeepComparison.d.ts","sourceRoot":"","sources":["../../src/core/areEqualWithDeepComparison.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"areEqualWithDeepComparison.d.ts","sourceRoot":"","sources":["../../src/core/areEqualWithDeepComparison.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAwC,MAAM,UAAU,CAAC;AA+DhF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,EACtB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,MAAM,CA+DR"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeUsingReaderAst = mergeUsingReaderAst;
|
|
4
|
-
exports.mergeArraysUsingReaderAst = mergeArraysUsingReaderAst;
|
|
5
3
|
exports.mergeObjectsUsingReaderAst = mergeObjectsUsingReaderAst;
|
|
6
4
|
function mergeUsingReaderAst(field, oldItem, newItem) {
|
|
7
5
|
if (newItem === null) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/core/brand.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,KAAK,CACf,QAAQ,EACR,KAAK,SAAS,MAAM,GAAG,MAAM,IAE3B,MAAM,CAAC,SAAS,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC"}
|
package/dist/core/cache.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Factory, ParentCache } from '@isograph/react-disposable-state';
|
|
2
|
-
import { IsographEntrypoint, NormalizationLinkedField, NormalizationScalarField,
|
|
2
|
+
import { IsographEntrypoint, NormalizationLinkedField, NormalizationScalarField, type NormalizationAst, type NormalizationAstLoader, type NormalizationAstNodes } from '../core/entrypoint';
|
|
3
3
|
import { FetchOptions } from './check';
|
|
4
4
|
import { ExtractParameters, FragmentReference, Variables, type UnknownTReadFromStore } from './FragmentReference';
|
|
5
|
-
import { DataId,
|
|
5
|
+
import { DataId, StoreLink, type IsographEnvironment, type TypeName } from './IsographEnvironment';
|
|
6
6
|
import { WithEncounteredRecords } from './read';
|
|
7
7
|
import { ReaderLinkedField, ReaderScalarField, type ReaderAst } from './reader';
|
|
8
8
|
export declare const TYPENAME_FIELD_NAME = "__typename";
|
|
@@ -21,13 +21,14 @@ export type NetworkResponseObject = {
|
|
|
21
21
|
id?: DataId;
|
|
22
22
|
__typename?: TypeName;
|
|
23
23
|
};
|
|
24
|
-
export declare function normalizeData(environment: IsographEnvironment, normalizationAst: NormalizationAstNodes, networkResponse: NetworkResponseObject, variables: Variables,
|
|
24
|
+
export declare function normalizeData(environment: IsographEnvironment, normalizationAst: NormalizationAstNodes, networkResponse: NetworkResponseObject, variables: Variables, root: StoreLink): EncounteredIds;
|
|
25
25
|
export declare function subscribeToAnyChange(environment: IsographEnvironment, callback: () => void): () => void;
|
|
26
|
-
export declare function subscribeToAnyChangesToRecord(environment: IsographEnvironment, recordLink:
|
|
26
|
+
export declare function subscribeToAnyChangesToRecord(environment: IsographEnvironment, recordLink: StoreLink, callback: () => void): () => void;
|
|
27
27
|
export declare function subscribe<TReadFromStore extends UnknownTReadFromStore>(environment: IsographEnvironment, encounteredDataAndRecords: WithEncounteredRecords<TReadFromStore>, fragmentReference: FragmentReference<TReadFromStore, any>, callback: (newEncounteredDataAndRecords: WithEncounteredRecords<TReadFromStore>) => void, readerAst: ReaderAst<TReadFromStore>): () => void;
|
|
28
|
-
export declare function onNextChangeToRecord(environment: IsographEnvironment, recordLink:
|
|
28
|
+
export declare function onNextChangeToRecord(environment: IsographEnvironment, recordLink: StoreLink): Promise<void>;
|
|
29
|
+
export declare function callSubscriptions(environment: IsographEnvironment, recordsEncounteredWhenNormalizing: EncounteredIds): void;
|
|
29
30
|
export type EncounteredIds = Map<TypeName, Set<DataId>>;
|
|
30
|
-
export declare function
|
|
31
|
+
export declare function insertEmptySetIfMissing<K, V>(map: Map<K, Set<V>>, key: K): Set<V>;
|
|
31
32
|
export declare function getParentRecordKey(astNode: NormalizationLinkedField | NormalizationScalarField | ReaderLinkedField | ReaderScalarField, variables: Variables): string;
|
|
32
33
|
export declare const FIRST_SPLIT_KEY = "____";
|
|
33
34
|
export declare const SECOND_SPLIT_KEY = "___";
|
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,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,KAAK,qBAAqB,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EAKN,SAAS,EAET,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAwB,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAGhF,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,wBAAgB,8BAA8B,CAC5C,cAAc,SAAS,qBAAqB,EAC5C,iBAAiB,EAEjB,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC,GACrE,WAAW,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAMnE;AAED;;;;GAIG;AACH,wBAAgB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I,GACnB,MAAM,IAAI,CAQZ;AAGD,wBAAgB,SAAS,CAAC,cAAc,SAAS,qBAAqB,EACpE,WAAW,EAAE,mBAAmB,EAChC,yBAAyB,EAAE,sBAAsB,CAAC,cAAc,CAAC,EACjE,iBAAiB,EAAE,iBAAiB,CAAC,cAAc,EAAE,GAAG,CAAC,EACzD,QAAQ,EAAE,CACR,4BAA4B,EAAE,sBAAsB,CAAC,cAAc,CAAC,KACjE,IAAI,EACT,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC,GACnC,MAAM,IAAI,CAUZ;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,IAAI,CAAC,CAWf;AAuBD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,mBAAmB,EAChC,iCAAiC,EAAE,cAAc,QAgFlD;AA6BD,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AA0ExD,wBAAgB,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
|
@@ -9,7 +9,8 @@ exports.subscribeToAnyChange = subscribeToAnyChange;
|
|
|
9
9
|
exports.subscribeToAnyChangesToRecord = subscribeToAnyChangesToRecord;
|
|
10
10
|
exports.subscribe = subscribe;
|
|
11
11
|
exports.onNextChangeToRecord = onNextChangeToRecord;
|
|
12
|
-
exports.
|
|
12
|
+
exports.callSubscriptions = callSubscriptions;
|
|
13
|
+
exports.insertEmptySetIfMissing = insertEmptySetIfMissing;
|
|
13
14
|
exports.getParentRecordKey = getParentRecordKey;
|
|
14
15
|
const react_disposable_state_1 = require("@isograph/react-disposable-state");
|
|
15
16
|
const areEqualWithDeepComparison_1 = require("./areEqualWithDeepComparison");
|
|
@@ -47,18 +48,29 @@ function stableCopy(value) {
|
|
|
47
48
|
return stable;
|
|
48
49
|
}
|
|
49
50
|
function getOrCreateCacheForArtifact(environment, entrypoint, variables, fetchOptions) {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
let cacheKey = '';
|
|
52
|
+
switch (entrypoint.networkRequestInfo.operation.kind) {
|
|
53
|
+
case 'Operation':
|
|
54
|
+
cacheKey =
|
|
55
|
+
entrypoint.networkRequestInfo.operation.text +
|
|
56
|
+
JSON.stringify(stableCopy(variables));
|
|
57
|
+
break;
|
|
58
|
+
case 'PersistedOperation':
|
|
59
|
+
cacheKey =
|
|
60
|
+
entrypoint.networkRequestInfo.operation.operationId +
|
|
61
|
+
JSON.stringify(stableCopy(variables));
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
52
64
|
const factory = () => {
|
|
53
|
-
const
|
|
65
|
+
const readerWithRefetchQueries = entrypoint.readerWithRefetchQueries.kind ===
|
|
66
|
+
'ReaderWithRefetchQueriesLoader'
|
|
67
|
+
? (0, PromiseWrapper_1.wrapPromise)(entrypoint.readerWithRefetchQueries.loader())
|
|
68
|
+
: (0, PromiseWrapper_1.wrapResolvedValue)(entrypoint.readerWithRefetchQueries);
|
|
69
|
+
const [networkRequest, disposeNetworkRequest] = (0, makeNetworkRequest_1.maybeMakeNetworkRequest)(environment, entrypoint, variables, readerWithRefetchQueries, fetchOptions !== null && fetchOptions !== void 0 ? fetchOptions : null);
|
|
54
70
|
const itemCleanupPair = [
|
|
55
71
|
{
|
|
56
72
|
kind: 'FragmentReference',
|
|
57
|
-
readerWithRefetchQueries
|
|
58
|
-
kind: 'ReaderWithRefetchQueries',
|
|
59
|
-
readerArtifact: entrypoint.readerWithRefetchQueries.readerArtifact,
|
|
60
|
-
nestedRefetchQueries: entrypoint.readerWithRefetchQueries.nestedRefetchQueries,
|
|
61
|
-
}),
|
|
73
|
+
readerWithRefetchQueries,
|
|
62
74
|
root: { __link: IsographEnvironment_1.ROOT_ID, __typename: entrypoint.concreteType },
|
|
63
75
|
variables,
|
|
64
76
|
networkRequest: networkRequest,
|
|
@@ -69,7 +81,7 @@ function getOrCreateCacheForArtifact(environment, entrypoint, variables, fetchOp
|
|
|
69
81
|
};
|
|
70
82
|
return getOrCreateItemInSuspenseCache(environment, cacheKey, factory);
|
|
71
83
|
}
|
|
72
|
-
function normalizeData(environment, normalizationAst, networkResponse, variables,
|
|
84
|
+
function normalizeData(environment, normalizationAst, networkResponse, variables, root) {
|
|
73
85
|
var _a, _b;
|
|
74
86
|
var _c, _d, _e;
|
|
75
87
|
const encounteredIds = new Map();
|
|
@@ -81,7 +93,7 @@ function normalizeData(environment, normalizationAst, networkResponse, variables
|
|
|
81
93
|
}));
|
|
82
94
|
const recordsById = ((_a = (_c = environment.store)[_d = root.__typename]) !== null && _a !== void 0 ? _a : (_c[_d] = {}));
|
|
83
95
|
const newStoreRecord = ((_b = recordsById[_e = root.__link]) !== null && _b !== void 0 ? _b : (recordsById[_e] = {}));
|
|
84
|
-
normalizeDataIntoRecord(environment, normalizationAst, networkResponse, newStoreRecord, root, variables,
|
|
96
|
+
normalizeDataIntoRecord(environment, normalizationAst, networkResponse, newStoreRecord, root, variables, encounteredIds);
|
|
85
97
|
(0, logging_1.logMessage)(environment, () => ({
|
|
86
98
|
kind: 'AfterNormalization',
|
|
87
99
|
store: environment.store,
|
|
@@ -132,16 +144,21 @@ function onNextChangeToRecord(environment, recordLink) {
|
|
|
132
144
|
//
|
|
133
145
|
// That's probably okay to ignore. We don't, however, want to prevent
|
|
134
146
|
// updating other subscriptions if one subscription had missing data.
|
|
135
|
-
function withErrorHandling(f) {
|
|
147
|
+
function withErrorHandling(environment, f) {
|
|
136
148
|
return (t) => {
|
|
137
149
|
try {
|
|
138
150
|
return f(t);
|
|
139
151
|
}
|
|
140
|
-
catch (
|
|
152
|
+
catch (e) {
|
|
153
|
+
(0, logging_1.logMessage)(environment, () => ({
|
|
154
|
+
kind: 'ErrorEncounteredInWithErrorHandling',
|
|
155
|
+
error: e,
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
141
158
|
};
|
|
142
159
|
}
|
|
143
160
|
function callSubscriptions(environment, recordsEncounteredWhenNormalizing) {
|
|
144
|
-
environment.subscriptions.forEach(withErrorHandling((subscription) => {
|
|
161
|
+
environment.subscriptions.forEach(withErrorHandling(environment, (subscription) => {
|
|
145
162
|
var _a;
|
|
146
163
|
switch (subscription.kind) {
|
|
147
164
|
case 'FragmentSubscription': {
|
|
@@ -224,7 +241,7 @@ function isNotDisjointFrom(set1, set2) {
|
|
|
224
241
|
/**
|
|
225
242
|
* Mutate targetParentRecord according to the normalizationAst and networkResponseParentRecord.
|
|
226
243
|
*/
|
|
227
|
-
function normalizeDataIntoRecord(environment, normalizationAst, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
244
|
+
function normalizeDataIntoRecord(environment, normalizationAst, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
|
|
228
245
|
let recordHasBeenUpdated = false;
|
|
229
246
|
for (const normalizationNode of normalizationAst) {
|
|
230
247
|
switch (normalizationNode.kind) {
|
|
@@ -235,13 +252,13 @@ function normalizeDataIntoRecord(environment, normalizationAst, networkResponseP
|
|
|
235
252
|
break;
|
|
236
253
|
}
|
|
237
254
|
case 'Linked': {
|
|
238
|
-
const linkedFieldResultedInChange = normalizeLinkedField(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
255
|
+
const linkedFieldResultedInChange = normalizeLinkedField(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
|
|
239
256
|
recordHasBeenUpdated =
|
|
240
257
|
recordHasBeenUpdated || linkedFieldResultedInChange;
|
|
241
258
|
break;
|
|
242
259
|
}
|
|
243
260
|
case 'InlineFragment': {
|
|
244
|
-
const inlineFragmentResultedInChange = normalizeInlineFragment(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
261
|
+
const inlineFragmentResultedInChange = normalizeInlineFragment(environment, normalizationNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
|
|
245
262
|
recordHasBeenUpdated =
|
|
246
263
|
recordHasBeenUpdated || inlineFragmentResultedInChange;
|
|
247
264
|
break;
|
|
@@ -255,12 +272,12 @@ function normalizeDataIntoRecord(environment, normalizationAst, networkResponseP
|
|
|
255
272
|
}
|
|
256
273
|
}
|
|
257
274
|
if (recordHasBeenUpdated) {
|
|
258
|
-
let encounteredRecordsIds =
|
|
275
|
+
let encounteredRecordsIds = insertEmptySetIfMissing(mutableEncounteredIds, targetParentRecordLink.__typename);
|
|
259
276
|
encounteredRecordsIds.add(targetParentRecordLink.__link);
|
|
260
277
|
}
|
|
261
278
|
return recordHasBeenUpdated;
|
|
262
279
|
}
|
|
263
|
-
function
|
|
280
|
+
function insertEmptySetIfMissing(map, key) {
|
|
264
281
|
let result = map.get(key);
|
|
265
282
|
if (result === undefined) {
|
|
266
283
|
result = new Set();
|
|
@@ -285,7 +302,7 @@ function normalizeScalarField(astNode, networkResponseParentRecord, targetStoreR
|
|
|
285
302
|
/**
|
|
286
303
|
* Mutate targetParentRecord with a given linked field ast node.
|
|
287
304
|
*/
|
|
288
|
-
function normalizeLinkedField(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
305
|
+
function normalizeLinkedField(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
|
|
289
306
|
var _a, _b;
|
|
290
307
|
const networkResponseKey = getNetworkResponseKey(astNode);
|
|
291
308
|
const networkResponseData = networkResponseParentRecord[networkResponseKey];
|
|
@@ -308,7 +325,7 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
|
|
|
308
325
|
dataIds.push(null);
|
|
309
326
|
continue;
|
|
310
327
|
}
|
|
311
|
-
const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseObject, targetParentRecordLink, variables, i,
|
|
328
|
+
const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseObject, targetParentRecordLink, variables, i, mutableEncounteredIds);
|
|
312
329
|
const __typename = (_a = astNode.concreteType) !== null && _a !== void 0 ? _a : networkResponseObject[exports.TYPENAME_FIELD_NAME];
|
|
313
330
|
if (__typename == null) {
|
|
314
331
|
throw new Error('Unexpected missing __typename in network response when normalizing a linked field. ' +
|
|
@@ -323,7 +340,7 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
|
|
|
323
340
|
return !dataIdsAreTheSame(existingValue, dataIds);
|
|
324
341
|
}
|
|
325
342
|
else {
|
|
326
|
-
const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, null,
|
|
343
|
+
const newStoreRecordId = normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, null, mutableEncounteredIds);
|
|
327
344
|
let __typename = (_b = astNode.concreteType) !== null && _b !== void 0 ? _b : networkResponseData[exports.TYPENAME_FIELD_NAME];
|
|
328
345
|
if (__typename == null) {
|
|
329
346
|
throw new Error('Unexpected missing __typename in network response when normalizing a linked field. ' +
|
|
@@ -340,10 +357,10 @@ function normalizeLinkedField(environment, astNode, networkResponseParentRecord,
|
|
|
340
357
|
/**
|
|
341
358
|
* Mutate targetParentRecord with a given linked field ast node.
|
|
342
359
|
*/
|
|
343
|
-
function normalizeInlineFragment(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
360
|
+
function normalizeInlineFragment(environment, astNode, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds) {
|
|
344
361
|
const typeToRefineTo = astNode.type;
|
|
345
362
|
if (networkResponseParentRecord[exports.TYPENAME_FIELD_NAME] === typeToRefineTo) {
|
|
346
|
-
const hasBeenModified = normalizeDataIntoRecord(environment, astNode.selections, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables,
|
|
363
|
+
const hasBeenModified = normalizeDataIntoRecord(environment, astNode.selections, networkResponseParentRecord, targetParentRecord, targetParentRecordLink, variables, mutableEncounteredIds);
|
|
347
364
|
return hasBeenModified;
|
|
348
365
|
}
|
|
349
366
|
return false;
|
|
@@ -367,7 +384,7 @@ function dataIdsAreTheSame(existingValue, newDataIds) {
|
|
|
367
384
|
return false;
|
|
368
385
|
}
|
|
369
386
|
}
|
|
370
|
-
function normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, index,
|
|
387
|
+
function normalizeNetworkResponseObject(environment, astNode, networkResponseData, targetParentRecordLink, variables, index, mutableEncounteredIds) {
|
|
371
388
|
var _a, _b, _c;
|
|
372
389
|
var _d;
|
|
373
390
|
const newStoreRecordId = getDataIdOfNetworkResponse(targetParentRecordLink, networkResponseData, astNode, variables, index);
|
|
@@ -378,7 +395,7 @@ function normalizeNetworkResponseObject(environment, astNode, networkResponseDat
|
|
|
378
395
|
}
|
|
379
396
|
const recordsById = ((_b = (_d = environment.store)[__typename]) !== null && _b !== void 0 ? _b : (_d[__typename] = {}));
|
|
380
397
|
const newStoreRecord = ((_c = recordsById[newStoreRecordId]) !== null && _c !== void 0 ? _c : (recordsById[newStoreRecordId] = {}));
|
|
381
|
-
normalizeDataIntoRecord(environment, astNode.selections, networkResponseData, newStoreRecord, { __link: newStoreRecordId, __typename: __typename }, variables,
|
|
398
|
+
normalizeDataIntoRecord(environment, astNode.selections, networkResponseData, newStoreRecord, { __link: newStoreRecordId, __typename: __typename }, variables, mutableEncounteredIds);
|
|
382
399
|
return newStoreRecordId;
|
|
383
400
|
}
|
|
384
401
|
function isScalarOrEmptyArray(data) {
|
|
@@ -446,11 +463,12 @@ function getStoreKeyChunkForArgumentValue(argumentValue, variables) {
|
|
|
446
463
|
}
|
|
447
464
|
}
|
|
448
465
|
function getStoreKeyChunkForArgument(argument, variables) {
|
|
449
|
-
|
|
466
|
+
const [argumentName, argumentValue] = argument;
|
|
467
|
+
let chunk = getStoreKeyChunkForArgumentValue(argumentValue, variables);
|
|
450
468
|
if (typeof chunk === 'object') {
|
|
451
469
|
chunk = JSON.stringify(stableCopy(chunk));
|
|
452
470
|
}
|
|
453
|
-
return `${exports.FIRST_SPLIT_KEY}${
|
|
471
|
+
return `${exports.FIRST_SPLIT_KEY}${argumentName}${exports.SECOND_SPLIT_KEY}${chunk}`;
|
|
454
472
|
}
|
|
455
473
|
function getNetworkResponseKey(astNode) {
|
|
456
474
|
let networkResponseKey = astNode.fieldName;
|
package/dist/core/check.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NormalizationAstNodes } from './entrypoint';
|
|
2
2
|
import { Variables } from './FragmentReference';
|
|
3
|
-
import { IsographEnvironment,
|
|
3
|
+
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;
|
|
@@ -16,7 +16,7 @@ export type CheckResult = {
|
|
|
16
16
|
kind: 'EnoughData';
|
|
17
17
|
} | {
|
|
18
18
|
kind: 'MissingData';
|
|
19
|
-
record:
|
|
19
|
+
record: StoreLink;
|
|
20
20
|
};
|
|
21
|
-
export declare function check(environment: IsographEnvironment, normalizationAst: NormalizationAstNodes, variables: Variables, root:
|
|
21
|
+
export declare function check(environment: IsographEnvironment, normalizationAst: NormalizationAstNodes, variables: Variables, root: StoreLink): CheckResult;
|
|
22
22
|
//# sourceMappingURL=check.d.ts.map
|
package/dist/core/check.d.ts.map
CHANGED
|
@@ -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,EAEL,mBAAmB,EACnB,
|
|
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,EAEL,mBAAmB,EACnB,SAAS,EAEV,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAC9D,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,IAAI,CAAC;AAE/C,eAAO,MAAM,0BAA0B,EAAE,WAA2B,CAAC;AAErE,MAAM,MAAM,YAAY,CAAC,YAAY,IAAI;IACvC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,YAAY,IAAI;IAC/C,WAAW,EAAE,mBAAmB,CAAC;CAClC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,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,CAgBb"}
|
|
@@ -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,
|
|
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,CA0Cf"}
|
|
@@ -10,7 +10,7 @@ function getOrCreateCachedComponent(environment, componentName, fragmentReferenc
|
|
|
10
10
|
var _a;
|
|
11
11
|
var _b, _c;
|
|
12
12
|
// We create startUpdate outside of component to make it stable
|
|
13
|
-
const startUpdate = (0, startUpdate_1.createStartUpdate)(environment, fragmentReference);
|
|
13
|
+
const startUpdate = (0, startUpdate_1.createStartUpdate)(environment, fragmentReference, networkRequestOptions);
|
|
14
14
|
return ((_a = (_b = environment.componentCache)[_c = (0, FragmentReference_1.stableIdForFragmentReference)(fragmentReference, componentName)]) !== null && _a !== void 0 ? _a : (_b[_c] = (() => {
|
|
15
15
|
function Component(additionalRuntimeProps) {
|
|
16
16
|
const readerWithRefetchQueries = (0, PromiseWrapper_1.readPromise)(fragmentReference.readerWithRefetchQueries);
|
|
@@ -7,15 +7,33 @@ export type ReaderWithRefetchQueries<TReadFromStore extends UnknownTReadFromStor
|
|
|
7
7
|
readonly readerArtifact: TopLevelReaderArtifact<TReadFromStore, TClientFieldValue, any>;
|
|
8
8
|
readonly nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[];
|
|
9
9
|
};
|
|
10
|
+
export type ReaderWithRefetchQueriesLoader<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
|
|
11
|
+
readonly kind: 'ReaderWithRefetchQueriesLoader';
|
|
12
|
+
readonly loader: () => Promise<ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue>>;
|
|
13
|
+
};
|
|
10
14
|
export type NetworkRequestInfo<TNormalizationAst> = {
|
|
11
15
|
readonly kind: 'NetworkRequestInfo';
|
|
12
|
-
readonly
|
|
16
|
+
readonly operation: IsographOperation | IsographPersistedOperation;
|
|
13
17
|
readonly normalizationAst: TNormalizationAst;
|
|
14
18
|
};
|
|
19
|
+
export type IsographOperation = {
|
|
20
|
+
readonly kind: 'Operation';
|
|
21
|
+
readonly text: string;
|
|
22
|
+
};
|
|
23
|
+
export type IsographPersistedOperation = {
|
|
24
|
+
readonly kind: 'PersistedOperation';
|
|
25
|
+
readonly operationId: string;
|
|
26
|
+
readonly extraInfo: IsographPersistedOperationExtraInfo | null;
|
|
27
|
+
};
|
|
28
|
+
export type IsographPersistedOperationExtraInfo = {
|
|
29
|
+
readonly kind: 'PersistedOperationExtraInfo';
|
|
30
|
+
readonly operationName: string | null;
|
|
31
|
+
readonly operationKind: 'Query' | 'Mutation' | 'Subscription';
|
|
32
|
+
};
|
|
15
33
|
export type IsographEntrypoint<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue, TNormalizationAst extends NormalizationAst | NormalizationAstLoader> = {
|
|
16
34
|
readonly kind: 'Entrypoint';
|
|
17
35
|
readonly networkRequestInfo: NetworkRequestInfo<TNormalizationAst>;
|
|
18
|
-
readonly readerWithRefetchQueries: ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue>;
|
|
36
|
+
readonly readerWithRefetchQueries: ReaderWithRefetchQueries<TReadFromStore, TClientFieldValue> | ReaderWithRefetchQueriesLoader<TReadFromStore, TClientFieldValue>;
|
|
19
37
|
readonly concreteType: TypeName;
|
|
20
38
|
};
|
|
21
39
|
export type IsographEntrypointLoader<TReadFromStore extends UnknownTReadFromStore, TClientFieldValue> = {
|
|
@@ -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,kBAAkB,CAAC,iBAAiB,IAAI;IAClD,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,
|
|
1
|
+
{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CAAC;CACrC,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,cAAc,SAAS,qBAAqB,EAC5C,iBAAiB,EACjB,iBAAiB,SAAS,gBAAgB,GAAG,sBAAsB,EAEnE,KAAK,EACD,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,GACxE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,GAGjB,GAAG,GACN,OAAO,CAAC,KAAK,IAAI,kBAAkB,CACpC,cAAc,EACd,iBAAiB,EACjB,iBAAiB,CAClB,CAEA;AAED,MAAM,MAAM,oBAAoB,CAAC,IAAI,IACnC,IAAI,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACjE,MAAM,MAAM,qBAAqB,CAAC,IAAI,IACpC,IAAI,SAAS,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACjE,MAAM,MAAM,YAAY,CAAC,IAAI,IAAI,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NormalizationAstNodes } from './entrypoint';
|
|
2
|
-
import { IsographEnvironment, type
|
|
2
|
+
import { IsographEnvironment, type StoreLink } from './IsographEnvironment';
|
|
3
3
|
export type RetainedQuery = {
|
|
4
4
|
readonly normalizationAst: NormalizationAstNodes;
|
|
5
5
|
readonly variables: {};
|
|
6
|
-
readonly root:
|
|
6
|
+
readonly root: StoreLink;
|
|
7
7
|
};
|
|
8
8
|
export type DidUnretainSomeQuery = boolean;
|
|
9
9
|
export declare function unretainQuery(environment: IsographEnvironment, retainedQuery: RetainedQuery): DidUnretainSomeQuery;
|
|
@@ -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,
|
|
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,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"}
|