react-relay 12.0.0 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +1 -1
- package/README.md +47 -0
- package/ReactRelayContainerUtils.js.flow +1 -1
- package/ReactRelayContext.js +2 -2
- package/ReactRelayContext.js.flow +3 -4
- package/ReactRelayFragmentContainer.js.flow +11 -17
- package/ReactRelayFragmentMockRenderer.js.flow +2 -2
- package/ReactRelayLocalQueryRenderer.js.flow +7 -8
- package/ReactRelayPaginationContainer.js.flow +30 -40
- package/ReactRelayQueryFetcher.js.flow +10 -11
- package/ReactRelayQueryRenderer.js.flow +16 -16
- package/ReactRelayQueryRendererContext.js.flow +1 -1
- package/ReactRelayRefetchContainer.js.flow +25 -33
- package/ReactRelayTestMocker.js.flow +17 -15
- package/ReactRelayTypes.js.flow +11 -11
- package/RelayContext.js.flow +4 -4
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -3
- package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +2 -3
- package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +2 -3
- package/__flowtests__/RelayModern-flowtest.js.flow +79 -47
- package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +6 -5
- package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +6 -5
- package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +5 -4
- package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +5 -4
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +14 -11
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +14 -11
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +14 -9
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +14 -11
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +14 -9
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +14 -11
- package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +16 -13
- package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +16 -13
- package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +14 -11
- package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +14 -11
- package/assertFragmentMap.js.flow +3 -3
- package/buildReactRelayContainer.js.flow +12 -11
- package/getRootVariablesForFragments.js.flow +3 -5
- package/hooks.js +2 -2
- package/hooks.js.flow +4 -6
- package/index.js +2 -2
- package/index.js.flow +5 -7
- package/isRelayEnvironment.js.flow +1 -1
- package/jest-react/enqueueTask.js.flow +2 -2
- package/jest-react/index.js.flow +1 -1
- package/jest-react/internalAct.js.flow +2 -4
- package/legacy.js +2 -2
- package/legacy.js.flow +1 -1
- package/lib/ReactRelayContainerUtils.js +1 -1
- package/lib/ReactRelayContext.js +1 -1
- package/lib/ReactRelayFragmentContainer.js +5 -5
- package/lib/ReactRelayFragmentMockRenderer.js +3 -3
- package/lib/ReactRelayLocalQueryRenderer.js +8 -9
- package/lib/ReactRelayPaginationContainer.js +19 -23
- package/lib/ReactRelayQueryFetcher.js +3 -3
- package/lib/ReactRelayQueryRenderer.js +5 -5
- package/lib/ReactRelayQueryRendererContext.js +1 -1
- package/lib/ReactRelayRefetchContainer.js +13 -15
- package/lib/ReactRelayTestMocker.js +8 -9
- package/lib/ReactRelayTypes.js +1 -1
- package/lib/RelayContext.js +4 -3
- package/lib/assertFragmentMap.js +3 -2
- package/lib/buildReactRelayContainer.js +8 -8
- package/lib/getRootVariablesForFragments.js +2 -3
- package/lib/hooks.js +6 -6
- package/lib/index.js +8 -8
- package/lib/isRelayEnvironment.js +1 -1
- package/lib/jest-react/enqueueTask.js +1 -1
- package/lib/jest-react/internalAct.js +3 -4
- package/lib/legacy.js +1 -1
- package/lib/multi-actor/ActorChange.js +3 -3
- package/lib/multi-actor/index.js +1 -1
- package/lib/multi-actor/useRelayActorEnvironment.js +3 -3
- package/lib/readContext.js +1 -1
- package/lib/relay-hooks/EntryPointContainer.react.js +4 -4
- package/lib/relay-hooks/EntryPointTypes.flow.js +1 -1
- package/lib/relay-hooks/FragmentResource.js +242 -46
- package/lib/relay-hooks/InternalLogger.js +1 -1
- package/lib/relay-hooks/LRUCache.js +1 -1
- package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +5 -5
- package/lib/relay-hooks/MatchContainer.js +2 -2
- package/lib/relay-hooks/ProfilerContext.js +1 -1
- package/lib/relay-hooks/QueryResource.js +84 -5
- package/lib/relay-hooks/RelayEnvironmentProvider.js +1 -1
- package/lib/relay-hooks/SuspenseResource.js +130 -0
- package/lib/relay-hooks/loadEntryPoint.js +1 -1
- package/lib/relay-hooks/loadQuery.js +9 -10
- package/lib/relay-hooks/preloadQuery_DEPRECATED.js +25 -11
- package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +1 -1
- package/lib/relay-hooks/useBlockingPaginationFragment.js +3 -3
- package/lib/relay-hooks/useEntryPointLoader.js +3 -3
- package/lib/relay-hooks/useFetchTrackingRef.js +3 -2
- package/lib/relay-hooks/useFragment.js +7 -7
- package/lib/relay-hooks/useFragmentNode.js +5 -5
- package/lib/relay-hooks/useIsMountedRef.js +1 -1
- package/lib/relay-hooks/useIsOperationNodeActive.js +3 -3
- package/lib/relay-hooks/useIsParentQueryActive.js +1 -1
- package/lib/relay-hooks/useLazyLoadQuery.js +4 -4
- package/lib/relay-hooks/useLazyLoadQueryNode.js +5 -5
- package/lib/relay-hooks/useLoadMoreFunction.js +8 -10
- package/lib/relay-hooks/useMemoOperationDescriptor.js +3 -3
- package/lib/relay-hooks/useMemoVariables.js +3 -3
- package/lib/relay-hooks/useMutation.js +18 -7
- package/lib/relay-hooks/usePaginationFragment.js +1 -1
- package/lib/relay-hooks/usePreloadedQuery.js +6 -6
- package/lib/relay-hooks/useQueryLoader.js +5 -5
- package/lib/relay-hooks/useRefetchableFragment.js +1 -1
- package/lib/relay-hooks/useRefetchableFragmentNode.js +11 -13
- package/lib/relay-hooks/useRelayEnvironment.js +3 -3
- package/lib/relay-hooks/useStaticFragmentNodeWarning.js +3 -3
- package/lib/relay-hooks/useSubscribeToInvalidationState.js +3 -2
- package/lib/relay-hooks/useSubscription.js +1 -1
- package/multi-actor/ActorChange.js.flow +4 -5
- package/multi-actor/index.js.flow +1 -1
- package/multi-actor/useRelayActorEnvironment.js.flow +6 -8
- package/package.json +3 -3
- package/react-relay-hooks.js +2 -2
- package/react-relay-hooks.min.js +3 -3
- package/react-relay-legacy.js +2 -2
- package/react-relay-legacy.min.js +3 -3
- package/react-relay.js +2 -2
- package/react-relay.min.js +3 -3
- package/readContext.js.flow +1 -1
- package/relay-hooks/EntryPointContainer.react.js.flow +9 -16
- package/relay-hooks/EntryPointTypes.flow.js.flow +19 -25
- package/relay-hooks/FragmentResource.js.flow +221 -35
- package/relay-hooks/InternalLogger.js.flow +1 -1
- package/relay-hooks/LRUCache.js.flow +1 -1
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +33 -47
- package/relay-hooks/MatchContainer.js.flow +4 -3
- package/relay-hooks/ProfilerContext.js.flow +1 -1
- package/relay-hooks/QueryResource.js.flow +120 -18
- package/relay-hooks/RelayEnvironmentProvider.js.flow +10 -10
- package/relay-hooks/SuspenseResource.js.flow +115 -0
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +5 -4
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +2 -2
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +59 -0
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +61 -0
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +11 -10
- package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +55 -32
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +11 -10
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +11 -10
- package/relay-hooks/__flowtests__/utils.js.flow +21 -32
- package/relay-hooks/loadEntryPoint.js.flow +7 -13
- package/relay-hooks/loadQuery.js.flow +23 -24
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +30 -14
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +7 -13
- package/relay-hooks/useBlockingPaginationFragment.js.flow +13 -14
- package/relay-hooks/useEntryPointLoader.js.flow +8 -11
- package/relay-hooks/useFetchTrackingRef.js.flow +3 -3
- package/relay-hooks/useFragment.js.flow +31 -62
- package/relay-hooks/useFragmentNode.js.flow +6 -8
- package/relay-hooks/useIsMountedRef.js.flow +1 -1
- package/relay-hooks/useIsOperationNodeActive.js.flow +4 -6
- package/relay-hooks/useIsParentQueryActive.js.flow +4 -5
- package/relay-hooks/useLazyLoadQuery.js.flow +14 -16
- package/relay-hooks/useLazyLoadQueryNode.js.flow +12 -14
- package/relay-hooks/useLoadMoreFunction.js.flow +20 -28
- package/relay-hooks/useMemoOperationDescriptor.js.flow +6 -8
- package/relay-hooks/useMemoVariables.js.flow +7 -7
- package/relay-hooks/useMutation.js.flow +27 -27
- package/relay-hooks/usePaginationFragment.js.flow +38 -47
- package/relay-hooks/usePreloadedQuery.js.flow +14 -20
- package/relay-hooks/useQueryLoader.js.flow +14 -17
- package/relay-hooks/useRefetchableFragment.js.flow +8 -9
- package/relay-hooks/useRefetchableFragmentNode.js.flow +23 -31
- package/relay-hooks/useRelayEnvironment.js.flow +3 -5
- package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -4
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +4 -7
- package/relay-hooks/useSubscription.js.flow +7 -8
package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @generated SignedSource<<
|
7
|
+
* @generated SignedSource<<8a7c1dee99527959e2031640c3ee39e7>>
|
8
8
|
* @flow
|
9
9
|
* @lightSyntaxTransform
|
10
10
|
* @nogrep
|
@@ -15,11 +15,11 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
/*::
|
18
|
-
import type { ReaderFragment } from 'relay-runtime';
|
19
|
-
import type {
|
20
|
-
declare export opaque type ReactRelayRefetchContainerFlowtest_viewer$
|
21
|
-
|
22
|
-
export type ReactRelayRefetchContainerFlowtest_viewer = {|
|
18
|
+
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
+
import type { FragmentType } from "relay-runtime";
|
20
|
+
declare export opaque type ReactRelayRefetchContainerFlowtest_viewer$fragmentType: FragmentType;
|
21
|
+
export type ReactRelayRefetchContainerFlowtest_viewer$ref = ReactRelayRefetchContainerFlowtest_viewer$fragmentType;
|
22
|
+
export type ReactRelayRefetchContainerFlowtest_viewer$data = {|
|
23
23
|
+account_user: ?{|
|
24
24
|
+friends: ?{|
|
25
25
|
+edges: ?$ReadOnlyArray<?{|
|
@@ -29,12 +29,12 @@ export type ReactRelayRefetchContainerFlowtest_viewer = {|
|
|
29
29
|
|}>,
|
30
30
|
|},
|
31
31
|
|},
|
32
|
-
+$
|
32
|
+
+$fragmentType: ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
|
33
33
|
|};
|
34
|
-
export type ReactRelayRefetchContainerFlowtest_viewer
|
34
|
+
export type ReactRelayRefetchContainerFlowtest_viewer = ReactRelayRefetchContainerFlowtest_viewer$data;
|
35
35
|
export type ReactRelayRefetchContainerFlowtest_viewer$key = {
|
36
36
|
+$data?: ReactRelayRefetchContainerFlowtest_viewer$data,
|
37
|
-
+$
|
37
|
+
+$fragmentSpreads: ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
|
38
38
|
...
|
39
39
|
};
|
40
40
|
*/
|
@@ -158,4 +158,7 @@ if (__DEV__) {
|
|
158
158
|
(node/*: any*/).hash = "cf098b4248d8ddfacfc0d356838697bb";
|
159
159
|
}
|
160
160
|
|
161
|
-
module.exports = node
|
161
|
+
module.exports = ((node/*: any*/)/*: Fragment<
|
162
|
+
ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
|
163
|
+
ReactRelayRefetchContainerFlowtest_viewer$data,
|
164
|
+
>*/);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @generated SignedSource<<
|
7
|
+
* @generated SignedSource<<da21127f700568aaf02b9cfa2a6d86f8>>
|
8
8
|
* @flow
|
9
9
|
* @lightSyntaxTransform
|
10
10
|
* @nogrep
|
@@ -15,20 +15,20 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
/*::
|
18
|
-
import type { ReaderFragment } from 'relay-runtime';
|
19
|
-
type RelayModernFlowtest_user$
|
20
|
-
import type {
|
21
|
-
declare export opaque type RelayModernFlowtest_badref$
|
22
|
-
|
23
|
-
export type RelayModernFlowtest_badref = {|
|
18
|
+
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
+
type RelayModernFlowtest_user$fragmentType = any;
|
20
|
+
import type { FragmentType } from "relay-runtime";
|
21
|
+
declare export opaque type RelayModernFlowtest_badref$fragmentType: FragmentType;
|
22
|
+
export type RelayModernFlowtest_badref$ref = RelayModernFlowtest_badref$fragmentType;
|
23
|
+
export type RelayModernFlowtest_badref$data = {|
|
24
24
|
+id: string,
|
25
|
-
+$
|
26
|
-
+$
|
25
|
+
+$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
|
26
|
+
+$fragmentType: RelayModernFlowtest_badref$fragmentType,
|
27
27
|
|};
|
28
|
-
export type RelayModernFlowtest_badref
|
28
|
+
export type RelayModernFlowtest_badref = RelayModernFlowtest_badref$data;
|
29
29
|
export type RelayModernFlowtest_badref$key = {
|
30
30
|
+$data?: RelayModernFlowtest_badref$data,
|
31
|
-
+$
|
31
|
+
+$fragmentSpreads: RelayModernFlowtest_badref$fragmentType,
|
32
32
|
...
|
33
33
|
};
|
34
34
|
*/
|
@@ -60,4 +60,7 @@ if (__DEV__) {
|
|
60
60
|
(node/*: any*/).hash = "a04dc2854770919bd070bdc717de7812";
|
61
61
|
}
|
62
62
|
|
63
|
-
module.exports = node
|
63
|
+
module.exports = ((node/*: any*/)/*: Fragment<
|
64
|
+
RelayModernFlowtest_badref$fragmentType,
|
65
|
+
RelayModernFlowtest_badref$data,
|
66
|
+
>*/);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @generated SignedSource<<
|
7
|
+
* @generated SignedSource<<5af505c845bc81cfc4ab5316649a2329>>
|
8
8
|
* @flow
|
9
9
|
* @lightSyntaxTransform
|
10
10
|
* @nogrep
|
@@ -15,20 +15,20 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
/*::
|
18
|
-
import type { ReaderFragment } from 'relay-runtime';
|
19
|
-
type RelayModernFlowtest_user$
|
20
|
-
import type {
|
21
|
-
declare export opaque type RelayModernFlowtest_notref$
|
22
|
-
|
23
|
-
export type RelayModernFlowtest_notref = {|
|
18
|
+
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
+
type RelayModernFlowtest_user$fragmentType = any;
|
20
|
+
import type { FragmentType } from "relay-runtime";
|
21
|
+
declare export opaque type RelayModernFlowtest_notref$fragmentType: FragmentType;
|
22
|
+
export type RelayModernFlowtest_notref$ref = RelayModernFlowtest_notref$fragmentType;
|
23
|
+
export type RelayModernFlowtest_notref$data = {|
|
24
24
|
+id: string,
|
25
|
-
+$
|
26
|
-
+$
|
25
|
+
+$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
|
26
|
+
+$fragmentType: RelayModernFlowtest_notref$fragmentType,
|
27
27
|
|};
|
28
|
-
export type RelayModernFlowtest_notref
|
28
|
+
export type RelayModernFlowtest_notref = RelayModernFlowtest_notref$data;
|
29
29
|
export type RelayModernFlowtest_notref$key = {
|
30
30
|
+$data?: RelayModernFlowtest_notref$data,
|
31
|
-
+$
|
31
|
+
+$fragmentSpreads: RelayModernFlowtest_notref$fragmentType,
|
32
32
|
...
|
33
33
|
};
|
34
34
|
*/
|
@@ -60,4 +60,7 @@ if (__DEV__) {
|
|
60
60
|
(node/*: any*/).hash = "d61c43d07b2fe8f623c9b84fcdf70ac8";
|
61
61
|
}
|
62
62
|
|
63
|
-
module.exports = node
|
63
|
+
module.exports = ((node/*: any*/)/*: Fragment<
|
64
|
+
RelayModernFlowtest_notref$fragmentType,
|
65
|
+
RelayModernFlowtest_notref$data,
|
66
|
+
>*/);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @generated SignedSource<<
|
7
|
+
* @generated SignedSource<<59c4945eff10b906fbac41d74da830e3>>
|
8
8
|
* @flow
|
9
9
|
* @lightSyntaxTransform
|
10
10
|
* @nogrep
|
@@ -15,18 +15,18 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
/*::
|
18
|
-
import type { ReaderFragment } from 'relay-runtime';
|
19
|
-
import type {
|
20
|
-
declare export opaque type RelayModernFlowtest_user$
|
21
|
-
|
22
|
-
export type RelayModernFlowtest_user = {|
|
18
|
+
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
+
import type { FragmentType } from "relay-runtime";
|
20
|
+
declare export opaque type RelayModernFlowtest_user$fragmentType: FragmentType;
|
21
|
+
export type RelayModernFlowtest_user$ref = RelayModernFlowtest_user$fragmentType;
|
22
|
+
export type RelayModernFlowtest_user$data = {|
|
23
23
|
+name: ?string,
|
24
|
-
+$
|
24
|
+
+$fragmentType: RelayModernFlowtest_user$fragmentType,
|
25
25
|
|};
|
26
|
-
export type RelayModernFlowtest_user
|
26
|
+
export type RelayModernFlowtest_user = RelayModernFlowtest_user$data;
|
27
27
|
export type RelayModernFlowtest_user$key = {
|
28
28
|
+$data?: RelayModernFlowtest_user$data,
|
29
|
-
+$
|
29
|
+
+$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
|
30
30
|
...
|
31
31
|
};
|
32
32
|
*/
|
@@ -53,4 +53,7 @@ if (__DEV__) {
|
|
53
53
|
(node/*: any*/).hash = "18a730295ff54e88446f4f000f5fef7e";
|
54
54
|
}
|
55
55
|
|
56
|
-
module.exports = node
|
56
|
+
module.exports = ((node/*: any*/)/*: Fragment<
|
57
|
+
RelayModernFlowtest_user$fragmentType,
|
58
|
+
RelayModernFlowtest_user$data,
|
59
|
+
>*/);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
|
-
* @generated SignedSource<<
|
7
|
+
* @generated SignedSource<<0f29cb3f58c5e6863095be5bb78fa2ba>>
|
8
8
|
* @flow
|
9
9
|
* @lightSyntaxTransform
|
10
10
|
* @nogrep
|
@@ -15,18 +15,18 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
/*::
|
18
|
-
import type { ReaderFragment } from 'relay-runtime';
|
19
|
-
import type {
|
20
|
-
declare export opaque type RelayModernFlowtest_users$
|
21
|
-
|
22
|
-
export type RelayModernFlowtest_users = $ReadOnlyArray<{|
|
18
|
+
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
+
import type { FragmentType } from "relay-runtime";
|
20
|
+
declare export opaque type RelayModernFlowtest_users$fragmentType: FragmentType;
|
21
|
+
export type RelayModernFlowtest_users$ref = RelayModernFlowtest_users$fragmentType;
|
22
|
+
export type RelayModernFlowtest_users$data = $ReadOnlyArray<{|
|
23
23
|
+name: ?string,
|
24
|
-
+$
|
24
|
+
+$fragmentType: RelayModernFlowtest_users$fragmentType,
|
25
25
|
|}>;
|
26
|
-
export type RelayModernFlowtest_users
|
26
|
+
export type RelayModernFlowtest_users = RelayModernFlowtest_users$data;
|
27
27
|
export type RelayModernFlowtest_users$key = $ReadOnlyArray<{
|
28
28
|
+$data?: RelayModernFlowtest_users$data,
|
29
|
-
+$
|
29
|
+
+$fragmentSpreads: RelayModernFlowtest_users$fragmentType,
|
30
30
|
...
|
31
31
|
}>;
|
32
32
|
*/
|
@@ -55,4 +55,7 @@ if (__DEV__) {
|
|
55
55
|
(node/*: any*/).hash = "4e6f0e70d48ec58651c17e3150c63d05";
|
56
56
|
}
|
57
57
|
|
58
|
-
module.exports = node
|
58
|
+
module.exports = ((node/*: any*/)/*: Fragment<
|
59
|
+
RelayModernFlowtest_users$fragmentType,
|
60
|
+
RelayModernFlowtest_users$data,
|
61
|
+
>*/);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -12,10 +12,10 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const invariant = require('invariant');
|
16
|
-
|
17
15
|
import type {GeneratedNodeMap} from './ReactRelayTypes';
|
18
16
|
|
17
|
+
const invariant = require('invariant');
|
18
|
+
|
19
19
|
/**
|
20
20
|
* Fail fast if the user supplies invalid fragments as input.
|
21
21
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -12,23 +12,21 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
const ReactRelayQueryRendererContext = require('./ReactRelayQueryRendererContext');
|
15
|
+
import type {GeneratedNodeMap} from './ReactRelayTypes';
|
16
|
+
import type {FragmentMap} from 'relay-runtime';
|
18
17
|
|
19
18
|
const assertFragmentMap = require('./assertFragmentMap');
|
20
|
-
const invariant = require('invariant');
|
21
|
-
const readContext = require('./readContext');
|
22
|
-
|
23
19
|
const {
|
24
20
|
getComponentName,
|
25
21
|
getContainerName,
|
26
22
|
} = require('./ReactRelayContainerUtils');
|
23
|
+
const ReactRelayContext = require('./ReactRelayContext');
|
24
|
+
const ReactRelayQueryRendererContext = require('./ReactRelayQueryRendererContext');
|
25
|
+
const readContext = require('./readContext');
|
26
|
+
const invariant = require('invariant');
|
27
|
+
const React = require('react');
|
27
28
|
const {getFragment} = require('relay-runtime');
|
28
29
|
|
29
|
-
import type {GeneratedNodeMap} from './ReactRelayTypes';
|
30
|
-
import type {FragmentMap} from 'relay-runtime';
|
31
|
-
|
32
30
|
type ContainerCreator = (
|
33
31
|
Component: React$ComponentType<any>,
|
34
32
|
fragments: FragmentMap,
|
@@ -54,7 +52,10 @@ function buildReactRelayContainer<TBase: React$ComponentType<any>>(
|
|
54
52
|
const Container = createContainerWithFragments(ComponentClass, fragments);
|
55
53
|
Container.displayName = containerName;
|
56
54
|
|
57
|
-
function forwardRef(
|
55
|
+
function forwardRef(
|
56
|
+
props: any,
|
57
|
+
ref: ((null | any) => mixed) | {current: null | any, ...},
|
58
|
+
) {
|
58
59
|
const context = readContext(ReactRelayContext);
|
59
60
|
invariant(
|
60
61
|
context != null,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -12,10 +12,10 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const {getSelector} = require('relay-runtime');
|
16
|
-
|
17
15
|
import type {FragmentMap, Variables} from 'relay-runtime';
|
18
16
|
|
17
|
+
const {getSelector} = require('relay-runtime');
|
18
|
+
|
19
19
|
function getRootVariablesForFragments<TProps: {...}>(
|
20
20
|
fragments: FragmentMap,
|
21
21
|
props: TProps,
|
@@ -32,11 +32,9 @@ function getRootVariablesForFragments<TProps: {...}>(
|
|
32
32
|
selector != null && selector.kind === 'PluralReaderSelector'
|
33
33
|
? selector.selectors[0]?.owner.variables ?? {}
|
34
34
|
: selector?.owner.variables ?? {};
|
35
|
-
// $FlowFixMe[cannot-spread-interface]
|
36
35
|
rootVariables = {
|
37
36
|
// $FlowFixMe[exponential-spread]
|
38
37
|
...rootVariables,
|
39
|
-
// $FlowFixMe[exponential-spread]
|
40
38
|
...fragmentOwnerVariables,
|
41
39
|
};
|
42
40
|
});
|
package/hooks.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* Relay
|
2
|
+
* Relay v13.0.0
|
3
3
|
*
|
4
|
-
* Copyright (c)
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
5
5
|
*
|
6
6
|
* This source code is licensed under the MIT license found in the
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
package/hooks.js.flow
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -13,10 +13,9 @@
|
|
13
13
|
'use strict';
|
14
14
|
|
15
15
|
const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
|
16
|
-
const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
|
17
|
-
const RelayRuntime = require('relay-runtime');
|
18
|
-
|
19
16
|
const loadEntryPoint = require('./relay-hooks/loadEntryPoint');
|
17
|
+
const {loadQuery} = require('./relay-hooks/loadQuery');
|
18
|
+
const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
|
20
19
|
const useEntryPointLoader = require('./relay-hooks/useEntryPointLoader');
|
21
20
|
const useFragment = require('./relay-hooks/useFragment');
|
22
21
|
const useLazyLoadQuery = require('./relay-hooks/useLazyLoadQuery');
|
@@ -28,8 +27,7 @@ const useRefetchableFragment = require('./relay-hooks/useRefetchableFragment');
|
|
28
27
|
const useRelayEnvironment = require('./relay-hooks/useRelayEnvironment');
|
29
28
|
const useSubscribeToInvalidationState = require('./relay-hooks/useSubscribeToInvalidationState');
|
30
29
|
const useSubscription = require('./relay-hooks/useSubscription');
|
31
|
-
|
32
|
-
const {loadQuery} = require('./relay-hooks/loadQuery');
|
30
|
+
const RelayRuntime = require('relay-runtime');
|
33
31
|
|
34
32
|
export type * from './relay-hooks/EntryPointTypes.flow';
|
35
33
|
export type {
|
package/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* Relay
|
2
|
+
* Relay v13.0.0
|
3
3
|
*
|
4
|
-
* Copyright (c)
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
5
5
|
*
|
6
6
|
* This source code is licensed under the MIT license found in the
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
package/index.js.flow
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -12,17 +12,16 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
|
16
15
|
const ReactRelayContext = require('./ReactRelayContext');
|
17
16
|
const ReactRelayFragmentContainer = require('./ReactRelayFragmentContainer');
|
18
17
|
const ReactRelayLocalQueryRenderer = require('./ReactRelayLocalQueryRenderer');
|
19
18
|
const ReactRelayPaginationContainer = require('./ReactRelayPaginationContainer');
|
20
19
|
const ReactRelayQueryRenderer = require('./ReactRelayQueryRenderer');
|
21
20
|
const ReactRelayRefetchContainer = require('./ReactRelayRefetchContainer');
|
22
|
-
const
|
23
|
-
const RelayRuntime = require('relay-runtime');
|
24
|
-
|
21
|
+
const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
|
25
22
|
const loadEntryPoint = require('./relay-hooks/loadEntryPoint');
|
23
|
+
const {loadQuery} = require('./relay-hooks/loadQuery');
|
24
|
+
const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
|
26
25
|
const useEntryPointLoader = require('./relay-hooks/useEntryPointLoader');
|
27
26
|
const useFragment = require('./relay-hooks/useFragment');
|
28
27
|
const useLazyLoadQuery = require('./relay-hooks/useLazyLoadQuery');
|
@@ -34,8 +33,7 @@ const useRefetchableFragment = require('./relay-hooks/useRefetchableFragment');
|
|
34
33
|
const useRelayEnvironment = require('./relay-hooks/useRelayEnvironment');
|
35
34
|
const useSubscribeToInvalidationState = require('./relay-hooks/useSubscribeToInvalidationState');
|
36
35
|
const useSubscription = require('./relay-hooks/useSubscription');
|
37
|
-
|
38
|
-
const {loadQuery} = require('./relay-hooks/loadQuery');
|
36
|
+
const RelayRuntime = require('relay-runtime');
|
39
37
|
|
40
38
|
export type {
|
41
39
|
$FragmentRef,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -29,7 +29,7 @@ function enqueueTask(task: () => void) {
|
|
29
29
|
// we're in a browser
|
30
30
|
// we can't use regular timers because they may still be faked
|
31
31
|
// so we try MessageChannel+postMessage instead
|
32
|
-
enqueueTaskImpl = function(callback: () => void) {
|
32
|
+
enqueueTaskImpl = function (callback: () => void) {
|
33
33
|
if (__DEV__) {
|
34
34
|
if (didWarnAboutMessageChannel === false) {
|
35
35
|
didWarnAboutMessageChannel = true;
|
package/jest-react/index.js.flow
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*
|
7
7
|
* @emails oncall+relay
|
8
8
|
* @format
|
9
|
-
*
|
10
9
|
*/
|
11
10
|
|
12
11
|
/* global jest */
|
@@ -22,9 +21,8 @@
|
|
22
21
|
|
23
22
|
'use strict';
|
24
23
|
|
25
|
-
const Scheduler = require('scheduler/unstable_mock');
|
26
|
-
|
27
24
|
const enqueueTask = require('./enqueueTask');
|
25
|
+
const Scheduler = require('scheduler/unstable_mock');
|
28
26
|
|
29
27
|
// The subset of a Promise that React APIs rely on. This resolves a value.
|
30
28
|
// This doesn't require a return value neither from the handler nor the
|
package/legacy.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* Relay
|
2
|
+
* Relay v13.0.0
|
3
3
|
*
|
4
|
-
* Copyright (c)
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
5
5
|
*
|
6
6
|
* This source code is licensed under the MIT license found in the
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
package/legacy.js.flow
CHANGED
package/lib/ReactRelayContext.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -22,10 +22,6 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
22
22
|
|
23
23
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
24
24
|
|
25
|
-
var React = require('react');
|
26
|
-
|
27
|
-
var areEqual = require("fbjs/lib/areEqual");
|
28
|
-
|
29
25
|
var buildReactRelayContainer = require('./buildReactRelayContainer');
|
30
26
|
|
31
27
|
var _require = require('./ReactRelayContainerUtils'),
|
@@ -34,6 +30,10 @@ var _require = require('./ReactRelayContainerUtils'),
|
|
34
30
|
var _require2 = require('./RelayContext'),
|
35
31
|
assertRelayContext = _require2.assertRelayContext;
|
36
32
|
|
33
|
+
var areEqual = require("fbjs/lib/areEqual");
|
34
|
+
|
35
|
+
var React = require('react');
|
36
|
+
|
37
37
|
var _require3 = require('relay-runtime'),
|
38
38
|
createFragmentSpecResolver = _require3.createFragmentSpecResolver,
|
39
39
|
getDataIDsFromObject = _require3.getDataIDsFromObject,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -10,10 +10,10 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var React = require('react');
|
14
|
-
|
15
13
|
var ReactRelayContext = require('./ReactRelayContext');
|
16
14
|
|
15
|
+
var React = require('react');
|
16
|
+
|
17
17
|
function ReactRelayFragmentMockRenderer(props) {
|
18
18
|
return /*#__PURE__*/React.createElement(ReactRelayContext.Provider, {
|
19
19
|
value: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright (c)
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -10,24 +10,23 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var React = require('react');
|
14
|
-
|
15
13
|
var ReactRelayContext = require('./ReactRelayContext');
|
16
14
|
|
17
15
|
var ReactRelayQueryRendererContext = require('./ReactRelayQueryRendererContext');
|
18
16
|
|
19
|
-
var
|
20
|
-
|
21
|
-
|
22
|
-
useMemo = React.useMemo;
|
17
|
+
var areEqual = require("fbjs/lib/areEqual");
|
18
|
+
|
19
|
+
var React = require('react');
|
23
20
|
|
24
21
|
var _require = require('relay-runtime'),
|
25
22
|
createOperationDescriptor = _require.createOperationDescriptor,
|
26
23
|
deepFreeze = _require.deepFreeze,
|
27
24
|
getRequest = _require.getRequest;
|
28
25
|
|
29
|
-
var
|
30
|
-
|
26
|
+
var useLayoutEffect = React.useLayoutEffect,
|
27
|
+
useState = React.useState,
|
28
|
+
useRef = React.useRef,
|
29
|
+
useMemo = React.useMemo;
|
31
30
|
var queryRendererContext = {
|
32
31
|
rootIsQueryRenderer: true
|
33
32
|
};
|