react-relay 17.0.0 → 18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ReactRelayContainerUtils.js.flow +2 -2
- package/ReactRelayContext.js +1 -1
- package/ReactRelayContext.js.flow +1 -1
- package/ReactRelayFragmentContainer.js.flow +2 -2
- package/ReactRelayPaginationContainer.js.flow +2 -2
- package/ReactRelayQueryRenderer.js.flow +1 -1
- package/ReactRelayQueryRendererContext.js.flow +1 -1
- package/ReactRelayRefetchContainer.js.flow +2 -2
- package/ReactRelayTypes.js.flow +45 -18
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -2
- package/buildReactRelayContainer.js.flow +5 -5
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/legacy.js +1 -1
- package/lib/relay-hooks/loadEntryPoint.js +8 -5
- package/lib/relay-hooks/loadQuery.js +2 -14
- package/lib/relay-hooks/useEntryPointLoader.js +5 -8
- package/lib/relay-hooks/useFragment.js +4 -7
- package/lib/relay-hooks/useFragmentInternal.js +6 -484
- package/lib/relay-hooks/useFragmentInternal_CURRENT.js +483 -0
- package/lib/relay-hooks/useFragmentInternal_EXPERIMENTAL.js +520 -0
- package/lib/relay-hooks/useLazyLoadQuery.js +2 -5
- package/lib/relay-hooks/usePreloadedQuery.js +6 -9
- package/lib/relay-hooks/useQueryLoader.js +1 -3
- package/multi-actor/ActorChange.js.flow +1 -1
- package/package.json +3 -3
- package/react-relay-hooks.js +2 -2
- package/react-relay-hooks.min.js +2 -2
- package/react-relay-legacy.js +1 -1
- package/react-relay-legacy.min.js +1 -1
- package/react-relay.js +2 -2
- package/react-relay.min.js +2 -2
- package/relay-hooks/EntryPointTypes.flow.js.flow +35 -12
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +8 -4
- package/relay-hooks/MatchContainer.js.flow +1 -1
- package/relay-hooks/ProfilerContext.js.flow +1 -1
- package/relay-hooks/__flowtests__/EntryPointTypes/ExtractQueryTypes-flowtest.js.flow +43 -0
- package/relay-hooks/loadEntryPoint.js.flow +10 -4
- package/relay-hooks/loadQuery.js.flow +4 -28
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +4 -1
- package/relay-hooks/useEntryPointLoader.js.flow +3 -4
- package/relay-hooks/useFragment.js.flow +0 -5
- package/relay-hooks/useFragmentInternal.js.flow +19 -643
- package/relay-hooks/useFragmentInternal_CURRENT.js.flow +669 -0
- package/relay-hooks/useFragmentInternal_EXPERIMENTAL.js.flow +764 -0
- package/relay-hooks/useLazyLoadQuery.js.flow +0 -5
- package/relay-hooks/usePaginationFragment.js.flow +1 -1
- package/relay-hooks/usePreloadedQuery.js.flow +0 -5
- package/relay-hooks/useQueryLoader.js.flow +1 -2
@@ -19,7 +19,6 @@ import type {
|
|
19
19
|
Variables,
|
20
20
|
} from 'relay-runtime';
|
21
21
|
|
22
|
-
const {useTrackLoadQueryInRender} = require('./loadQuery');
|
23
22
|
const useLazyLoadQueryNode = require('./useLazyLoadQueryNode');
|
24
23
|
const useMemoOperationDescriptor = require('./useMemoOperationDescriptor');
|
25
24
|
const useRelayEnvironment = require('./useRelayEnvironment');
|
@@ -51,10 +50,6 @@ hook useLazyLoadQuery<TVariables: Variables, TData>(
|
|
51
50
|
UNSTABLE_renderPolicy?: RenderPolicy,
|
52
51
|
},
|
53
52
|
): TData {
|
54
|
-
// We need to use this hook in order to be able to track if
|
55
|
-
// loadQuery was called during render
|
56
|
-
useTrackLoadQueryInRender();
|
57
|
-
|
58
53
|
const environment = useRelayEnvironment();
|
59
54
|
|
60
55
|
const query = useMemoOperationDescriptor(
|
@@ -46,7 +46,7 @@ type RefetchFnBase<TVars, TOptions> = (
|
|
46
46
|
options?: TOptions,
|
47
47
|
) => Disposable;
|
48
48
|
|
49
|
-
type RefetchFn<TVariables, TKey, TOptions = Options> = RefetchFnBase<
|
49
|
+
export type RefetchFn<TVariables, TKey, TOptions = Options> = RefetchFnBase<
|
50
50
|
RefetchVariables<TVariables, TKey>,
|
51
51
|
TOptions,
|
52
52
|
>;
|
@@ -18,7 +18,6 @@ import type {
|
|
18
18
|
} from './EntryPointTypes.flow';
|
19
19
|
import type {Query, RenderPolicy, Variables} from 'relay-runtime';
|
20
20
|
|
21
|
-
const {useTrackLoadQueryInRender} = require('./loadQuery');
|
22
21
|
const useLazyLoadQueryNode = require('./useLazyLoadQueryNode');
|
23
22
|
const useMemoOperationDescriptor = require('./useMemoOperationDescriptor');
|
24
23
|
const useRelayEnvironment = require('./useRelayEnvironment');
|
@@ -67,10 +66,6 @@ hook usePreloadedQuery<
|
|
67
66
|
UNSTABLE_renderPolicy?: RenderPolicy,
|
68
67
|
},
|
69
68
|
): TData {
|
70
|
-
// We need to use this hook in order to be able to track if
|
71
|
-
// loadQuery was called during render
|
72
|
-
useTrackLoadQueryInRender();
|
73
|
-
|
74
69
|
const environment = useRelayEnvironment();
|
75
70
|
const {fetchKey, fetchPolicy, source, variables, networkCacheConfig} =
|
76
71
|
preloadedQuery;
|
@@ -23,7 +23,7 @@ import type {
|
|
23
23
|
Variables,
|
24
24
|
} from 'relay-runtime';
|
25
25
|
|
26
|
-
const {loadQuery
|
26
|
+
const {loadQuery} = require('./loadQuery');
|
27
27
|
const useIsMountedRef = require('./useIsMountedRef');
|
28
28
|
const useRelayEnvironment = require('./useRelayEnvironment');
|
29
29
|
const {useCallback, useEffect, useRef, useState} = require('react');
|
@@ -146,7 +146,6 @@ hook useQueryLoader<TVariables: Variables, TData, TRawResponse: ?{...} = void>(
|
|
146
146
|
initialQueryReference ?? initialNullQueryReferenceState;
|
147
147
|
|
148
148
|
const environment = useRelayEnvironment();
|
149
|
-
useTrackLoadQueryInRender();
|
150
149
|
|
151
150
|
const isMountedRef = useIsMountedRef();
|
152
151
|
const undisposedQueryReferencesRef = useRef<
|