react-relay 0.0.0-main-e45fc4f4 → 0.0.0-main-84ea7a01
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/ReactRelayContext.js +1 -1
- package/ReactRelayPaginationContainer.js.flow +1 -1
- package/ReactRelayQueryRenderer.js.flow +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/legacy.js +1 -1
- package/multi-actor/ActorChange.js.flow +1 -1
- package/package.json +2 -2
- package/relay-hooks/EntryPointTypes.flow.js.flow +6 -6
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +3 -3
- package/relay-hooks/NestedRelayEntryPointBuilderUtils.js.flow +1 -1
- package/relay-hooks/RelayEnvironmentProvider.js.flow +1 -1
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +2 -2
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +4 -4
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +2 -2
- package/relay-hooks/readFragmentInternal.js.flow +1 -1
- package/relay-hooks/useFragmentInternal_CURRENT.js.flow +1 -1
- package/relay-hooks/useFragmentInternal_EXPERIMENTAL.js.flow +1 -1
- package/relay-hooks/useLazyLoadQueryNode.js.flow +2 -2
- package/relay-hooks/useQueryLoader.js.flow +1 -1
- package/relay-hooks/useRefetchableFragmentInternal.js.flow +1 -1
package/ReactRelayContext.js
CHANGED
|
@@ -61,7 +61,7 @@ const queryRendererContext: ReactRelayQueryRendererContextType = {
|
|
|
61
61
|
rootIsQueryRenderer: true,
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
export type Props =
|
|
64
|
+
export type Props = Readonly<{
|
|
65
65
|
cacheConfig?: ?CacheConfig,
|
|
66
66
|
fetchPolicy?: 'store-and-network' | 'network-only',
|
|
67
67
|
environment: IEnvironment,
|
package/hooks.js
CHANGED
package/index.js
CHANGED
package/legacy.js
CHANGED
|
@@ -17,7 +17,7 @@ const RelayEnvironmentProvider = require('../relay-hooks/RelayEnvironmentProvide
|
|
|
17
17
|
const useRelayActorEnvironment = require('./useRelayActorEnvironment');
|
|
18
18
|
const React = require('react');
|
|
19
19
|
|
|
20
|
-
export opaque type ActorChangePoint<TFragmentRef> =
|
|
20
|
+
export opaque type ActorChangePoint<TFragmentRef> = Readonly<{
|
|
21
21
|
__fragmentRef: TFragmentRef,
|
|
22
22
|
__viewer: ActorIdentifier,
|
|
23
23
|
}>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-relay",
|
|
3
3
|
"description": "A framework for building GraphQL-driven React applications.",
|
|
4
|
-
"version": "0.0.0-main-
|
|
4
|
+
"version": "0.0.0-main-84ea7a01",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
7
7
|
"relay",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fbjs": "^3.0.2",
|
|
21
21
|
"invariant": "^2.2.4",
|
|
22
22
|
"nullthrows": "^1.1.1",
|
|
23
|
-
"relay-runtime": "0.0.0-main-
|
|
23
|
+
"relay-runtime": "0.0.0-main-84ea7a01"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^16.9.0 || ^17 || ^18 || ^19"
|
|
@@ -132,7 +132,7 @@ export type EntryPoint<
|
|
|
132
132
|
-TEntryPointParams,
|
|
133
133
|
// $FlowExpectedError[unclear-type] accepts any root component
|
|
134
134
|
+TEntryPointComponent: EntryPointComponent<any, any, any, any, any>,
|
|
135
|
-
> =
|
|
135
|
+
> = Readonly<{
|
|
136
136
|
getPreloadProps: (
|
|
137
137
|
entryPointParams: TEntryPointParams,
|
|
138
138
|
) => PreloadProps<
|
|
@@ -149,7 +149,7 @@ export type EntryPointProps<
|
|
|
149
149
|
TPreloadedEntryPoints = {},
|
|
150
150
|
TRuntimeProps = {},
|
|
151
151
|
TExtraProps = null,
|
|
152
|
-
> =
|
|
152
|
+
> = Readonly<{
|
|
153
153
|
entryPoints: TPreloadedEntryPoints,
|
|
154
154
|
extraProps: TExtraProps | null,
|
|
155
155
|
props: TRuntimeProps,
|
|
@@ -195,7 +195,7 @@ export type PreloadProps<
|
|
|
195
195
|
TPreloadedEntryPoints: {...},
|
|
196
196
|
TExtraProps = null,
|
|
197
197
|
TEnvironmentProviderOptions = EnvironmentProviderOptions,
|
|
198
|
-
> =
|
|
198
|
+
> = Readonly<{
|
|
199
199
|
entryPoints?: {
|
|
200
200
|
+[K in keyof TPreloadedEntryPoints]?: ?ThinNestedEntryPointParams,
|
|
201
201
|
},
|
|
@@ -204,7 +204,7 @@ export type PreloadProps<
|
|
|
204
204
|
}>;
|
|
205
205
|
|
|
206
206
|
// Return type of `loadEntryPoint(...)`
|
|
207
|
-
export type PreloadedEntryPoint<TEntryPointComponent> =
|
|
207
|
+
export type PreloadedEntryPoint<TEntryPointComponent> = Readonly<{
|
|
208
208
|
dispose: () => void,
|
|
209
209
|
entryPoints: ElementConfig<TEntryPointComponent>['entryPoints'],
|
|
210
210
|
extraProps: ElementConfig<TEntryPointComponent>['extraProps'],
|
|
@@ -232,7 +232,7 @@ export type EntryPointElementConfig<
|
|
|
232
232
|
export type ThinQueryParams<
|
|
233
233
|
+TQuery: OperationType,
|
|
234
234
|
TEnvironmentProviderOptions,
|
|
235
|
-
> =
|
|
235
|
+
> = Readonly<{
|
|
236
236
|
environmentProviderOptions?: ?TEnvironmentProviderOptions,
|
|
237
237
|
options?: ?PreloadOptions,
|
|
238
238
|
parameters: PreloadableConcreteRequest<TQuery>,
|
|
@@ -283,6 +283,6 @@ export type RootComponentRenders<+C: component(...any)> =
|
|
|
283
283
|
|
|
284
284
|
export type PreloadParamsOf<T> = Parameters<T['getPreloadProps']>[0];
|
|
285
285
|
|
|
286
|
-
export type IEnvironmentProvider<TOptions> =
|
|
286
|
+
export type IEnvironmentProvider<TOptions> = Readonly<{
|
|
287
287
|
getEnvironment: (options: ?TOptions) => IEnvironment,
|
|
288
288
|
}>;
|
|
@@ -26,7 +26,7 @@ const React = require('react');
|
|
|
26
26
|
const {useContext, useEffect, useMemo} = require('react');
|
|
27
27
|
const {stableCopy} = require('relay-runtime');
|
|
28
28
|
|
|
29
|
-
type PreloadedEntryPoint<TEntryPointComponent> =
|
|
29
|
+
type PreloadedEntryPoint<TEntryPointComponent> = Readonly<{
|
|
30
30
|
entryPoints: React.ElementConfig<TEntryPointComponent>['entryPoints'],
|
|
31
31
|
extraProps: React.ElementConfig<TEntryPointComponent>['extraProps'],
|
|
32
32
|
getComponent: () => TEntryPointComponent,
|
|
@@ -40,8 +40,8 @@ type EntryPointContainerProps<
|
|
|
40
40
|
TPreloadedEntryPoints,
|
|
41
41
|
TRuntimeProps,
|
|
42
42
|
TExtraProps,
|
|
43
|
-
> =
|
|
44
|
-
|
|
43
|
+
> = Readonly<
|
|
44
|
+
Readonly<{
|
|
45
45
|
entryPoint: EntryPoint<
|
|
46
46
|
TEntryPointParams,
|
|
47
47
|
EntryPointComponent<
|
|
@@ -25,7 +25,7 @@ import type {
|
|
|
25
25
|
* to construct a `ThinNestedEntryPointParams` is by calling this function.
|
|
26
26
|
*/
|
|
27
27
|
declare function NestedRelayEntryPoint<TEntryPointParams>(
|
|
28
|
-
|
|
28
|
+
Readonly<{
|
|
29
29
|
entryPoint: EntryPoint<TEntryPointParams, $FlowFixMe>,
|
|
30
30
|
entryPointParams: TEntryPointParams,
|
|
31
31
|
}>,
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
EntryPointProps,
|
|
20
20
|
} from '../../EntryPointTypes.flow';
|
|
21
21
|
|
|
22
|
-
type MyComponentOtherProps =
|
|
22
|
+
type MyComponentOtherProps = Readonly<{
|
|
23
23
|
foo: string,
|
|
24
24
|
}>;
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ type MyComponentProps = EntryPointProps<{}, {}, MyComponentOtherProps, {}>;
|
|
|
27
27
|
|
|
28
28
|
const MyComponent = (_props: MyComponentProps) => null;
|
|
29
29
|
|
|
30
|
-
type PreloadParams =
|
|
30
|
+
type PreloadParams = Readonly<{}>;
|
|
31
31
|
|
|
32
32
|
type MyComponentEntryPointType = EntryPoint<PreloadParams, typeof MyComponent>;
|
|
33
33
|
|
|
@@ -29,7 +29,7 @@ type NestedEntrypointComponentProps = EntryPointProps<{}>;
|
|
|
29
29
|
const NestedEntrypointComponent = (_props: NestedEntrypointComponentProps) =>
|
|
30
30
|
null;
|
|
31
31
|
|
|
32
|
-
type NestedEntrypointPreloadParams =
|
|
32
|
+
type NestedEntrypointPreloadParams = Readonly<{
|
|
33
33
|
subEntrypointPreloadParam: string,
|
|
34
34
|
}>;
|
|
35
35
|
|
|
@@ -47,7 +47,7 @@ const NestedEntryPoint = {
|
|
|
47
47
|
|
|
48
48
|
// Define the parent entrypoint's component
|
|
49
49
|
|
|
50
|
-
type PreloadedEntrypoints =
|
|
50
|
+
type PreloadedEntrypoints = Readonly<{
|
|
51
51
|
nestedComponent: PreloadedEntryPoint<typeof NestedEntrypointComponent>,
|
|
52
52
|
}>;
|
|
53
53
|
|
|
@@ -61,7 +61,7 @@ const ParentEntrypointComponent = (_props: ParentEntrypointComponentProps) =>
|
|
|
61
61
|
* INCORRECT params passed into the nested entrypoints.
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
type BadParentEntrypointParams =
|
|
64
|
+
type BadParentEntrypointParams = Readonly<{}>;
|
|
65
65
|
|
|
66
66
|
({
|
|
67
67
|
getPreloadProps(_params: BadParentEntrypointParams) {
|
|
@@ -86,7 +86,7 @@ type BadParentEntrypointParams = $ReadOnly<{}>;
|
|
|
86
86
|
* CORRECT params passed into the nested entrypoints.
|
|
87
87
|
*/
|
|
88
88
|
|
|
89
|
-
type GoodParentEntrypointParams =
|
|
89
|
+
type GoodParentEntrypointParams = Readonly<{}>;
|
|
90
90
|
|
|
91
91
|
({
|
|
92
92
|
getPreloadProps(_params: GoodParentEntrypointParams) {
|
|
@@ -49,7 +49,7 @@ const pendingQueriesByEnvironment = WEAKMAP_SUPPORTED
|
|
|
49
49
|
: new Map<IEnvironment, Map<string, PendingQueryEntry>>();
|
|
50
50
|
|
|
51
51
|
type PendingQueryEntry =
|
|
52
|
-
|
|
|
52
|
+
| Readonly<{
|
|
53
53
|
cacheKey: string,
|
|
54
54
|
fetchKey: ?string | ?number,
|
|
55
55
|
fetchPolicy: PreloadFetchPolicy,
|
|
@@ -60,7 +60,7 @@ type PendingQueryEntry =
|
|
|
60
60
|
subject: ReplaySubject<GraphQLResponse>,
|
|
61
61
|
subscription: Subscription,
|
|
62
62
|
}>
|
|
63
|
-
|
|
|
63
|
+
| Readonly<{
|
|
64
64
|
cacheKey: string,
|
|
65
65
|
fetchKey: ?string | ?number,
|
|
66
66
|
fetchPolicy: PreloadFetchPolicy,
|
|
@@ -41,7 +41,7 @@ type FragmentQueryOptions = {
|
|
|
41
41
|
networkCacheConfig?: ?CacheConfig,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
type FragmentState =
|
|
44
|
+
type FragmentState = Readonly<
|
|
45
45
|
| {kind: 'bailout'}
|
|
46
46
|
| {kind: 'singular', snapshot: Snapshot, epoch: number}
|
|
47
47
|
| {kind: 'plural', snapshots: $ReadOnlyArray<Snapshot>, epoch: number},
|
|
@@ -47,7 +47,7 @@ type FragmentQueryOptions = {
|
|
|
47
47
|
networkCacheConfig?: ?CacheConfig,
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
type FragmentState =
|
|
50
|
+
type FragmentState = Readonly<
|
|
51
51
|
| {kind: 'bailout'}
|
|
52
52
|
| {kind: 'singular', snapshot: Snapshot, epoch: number}
|
|
53
53
|
| {kind: 'plural', snapshots: $ReadOnlyArray<Snapshot>, epoch: number},
|
|
@@ -33,7 +33,7 @@ const React = require('react');
|
|
|
33
33
|
|
|
34
34
|
const {useContext, useEffect, useState, useRef} = React;
|
|
35
35
|
|
|
36
|
-
export type LazyLoadQueryNodeParamsWithQuery =
|
|
36
|
+
export type LazyLoadQueryNodeParamsWithQuery = Readonly<{
|
|
37
37
|
query: OperationDescriptor,
|
|
38
38
|
componentDisplayName: string,
|
|
39
39
|
fetchObservable: Observable<GraphQLResponse>,
|
|
@@ -46,7 +46,7 @@ export type LazyLoadQueryNodeParamsWithQuery = $ReadOnly<{
|
|
|
46
46
|
* This param will be used when the query key is not provided
|
|
47
47
|
* (e.g. in usePreloadedQuery)
|
|
48
48
|
*/
|
|
49
|
-
export type LazyLoadQueryNodeParamsWithoutQuery =
|
|
49
|
+
export type LazyLoadQueryNodeParamsWithoutQuery = Readonly<{
|
|
50
50
|
componentDisplayName: string,
|
|
51
51
|
fragmentNode: ReaderFragment,
|
|
52
52
|
}>;
|
|
@@ -35,7 +35,7 @@ export type LoaderFn<TQuery: OperationType> = (
|
|
|
35
35
|
options?: UseQueryLoaderLoadQueryOptions,
|
|
36
36
|
) => void;
|
|
37
37
|
|
|
38
|
-
export type UseQueryLoaderLoadQueryOptions =
|
|
38
|
+
export type UseQueryLoaderLoadQueryOptions = Readonly<{
|
|
39
39
|
...LoadQueryOptions,
|
|
40
40
|
+__environment?: ?IEnvironment,
|
|
41
41
|
}>;
|
|
@@ -96,7 +96,7 @@ type RefetchFnExact<TQuery: OperationType, TOptions = Options> = RefetchFnBase<
|
|
|
96
96
|
type RefetchFnInexact<
|
|
97
97
|
TQuery: OperationType,
|
|
98
98
|
TOptions = Options,
|
|
99
|
-
> = RefetchFnBase
|
|
99
|
+
> = RefetchFnBase<Readonly<Partial<VariablesOf<TQuery>>>, TOptions>;
|
|
100
100
|
|
|
101
101
|
type Action =
|
|
102
102
|
| {
|