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.
Files changed (169) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +47 -0
  3. package/ReactRelayContainerUtils.js.flow +1 -1
  4. package/ReactRelayContext.js +2 -2
  5. package/ReactRelayContext.js.flow +3 -4
  6. package/ReactRelayFragmentContainer.js.flow +11 -17
  7. package/ReactRelayFragmentMockRenderer.js.flow +2 -2
  8. package/ReactRelayLocalQueryRenderer.js.flow +7 -8
  9. package/ReactRelayPaginationContainer.js.flow +30 -40
  10. package/ReactRelayQueryFetcher.js.flow +10 -11
  11. package/ReactRelayQueryRenderer.js.flow +16 -16
  12. package/ReactRelayQueryRendererContext.js.flow +1 -1
  13. package/ReactRelayRefetchContainer.js.flow +25 -33
  14. package/ReactRelayTestMocker.js.flow +17 -15
  15. package/ReactRelayTypes.js.flow +11 -11
  16. package/RelayContext.js.flow +4 -4
  17. package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -3
  18. package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +2 -3
  19. package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +2 -3
  20. package/__flowtests__/RelayModern-flowtest.js.flow +79 -47
  21. package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +6 -5
  22. package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +6 -5
  23. package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +5 -4
  24. package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +5 -4
  25. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +14 -11
  26. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +14 -11
  27. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +14 -9
  28. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +14 -11
  29. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +14 -9
  30. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +14 -11
  31. package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +16 -13
  32. package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +16 -13
  33. package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +14 -11
  34. package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +14 -11
  35. package/assertFragmentMap.js.flow +3 -3
  36. package/buildReactRelayContainer.js.flow +12 -11
  37. package/getRootVariablesForFragments.js.flow +3 -5
  38. package/hooks.js +2 -2
  39. package/hooks.js.flow +4 -6
  40. package/index.js +2 -2
  41. package/index.js.flow +5 -7
  42. package/isRelayEnvironment.js.flow +1 -1
  43. package/jest-react/enqueueTask.js.flow +2 -2
  44. package/jest-react/index.js.flow +1 -1
  45. package/jest-react/internalAct.js.flow +2 -4
  46. package/legacy.js +2 -2
  47. package/legacy.js.flow +1 -1
  48. package/lib/ReactRelayContainerUtils.js +1 -1
  49. package/lib/ReactRelayContext.js +1 -1
  50. package/lib/ReactRelayFragmentContainer.js +5 -5
  51. package/lib/ReactRelayFragmentMockRenderer.js +3 -3
  52. package/lib/ReactRelayLocalQueryRenderer.js +8 -9
  53. package/lib/ReactRelayPaginationContainer.js +19 -23
  54. package/lib/ReactRelayQueryFetcher.js +3 -3
  55. package/lib/ReactRelayQueryRenderer.js +5 -5
  56. package/lib/ReactRelayQueryRendererContext.js +1 -1
  57. package/lib/ReactRelayRefetchContainer.js +13 -15
  58. package/lib/ReactRelayTestMocker.js +8 -9
  59. package/lib/ReactRelayTypes.js +1 -1
  60. package/lib/RelayContext.js +4 -3
  61. package/lib/assertFragmentMap.js +3 -2
  62. package/lib/buildReactRelayContainer.js +8 -8
  63. package/lib/getRootVariablesForFragments.js +2 -3
  64. package/lib/hooks.js +6 -6
  65. package/lib/index.js +8 -8
  66. package/lib/isRelayEnvironment.js +1 -1
  67. package/lib/jest-react/enqueueTask.js +1 -1
  68. package/lib/jest-react/internalAct.js +3 -4
  69. package/lib/legacy.js +1 -1
  70. package/lib/multi-actor/ActorChange.js +3 -3
  71. package/lib/multi-actor/index.js +1 -1
  72. package/lib/multi-actor/useRelayActorEnvironment.js +3 -3
  73. package/lib/readContext.js +1 -1
  74. package/lib/relay-hooks/EntryPointContainer.react.js +4 -4
  75. package/lib/relay-hooks/EntryPointTypes.flow.js +1 -1
  76. package/lib/relay-hooks/FragmentResource.js +242 -46
  77. package/lib/relay-hooks/InternalLogger.js +1 -1
  78. package/lib/relay-hooks/LRUCache.js +1 -1
  79. package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +5 -5
  80. package/lib/relay-hooks/MatchContainer.js +2 -2
  81. package/lib/relay-hooks/ProfilerContext.js +1 -1
  82. package/lib/relay-hooks/QueryResource.js +84 -5
  83. package/lib/relay-hooks/RelayEnvironmentProvider.js +1 -1
  84. package/lib/relay-hooks/SuspenseResource.js +130 -0
  85. package/lib/relay-hooks/loadEntryPoint.js +1 -1
  86. package/lib/relay-hooks/loadQuery.js +9 -10
  87. package/lib/relay-hooks/preloadQuery_DEPRECATED.js +25 -11
  88. package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +1 -1
  89. package/lib/relay-hooks/useBlockingPaginationFragment.js +3 -3
  90. package/lib/relay-hooks/useEntryPointLoader.js +3 -3
  91. package/lib/relay-hooks/useFetchTrackingRef.js +3 -2
  92. package/lib/relay-hooks/useFragment.js +7 -7
  93. package/lib/relay-hooks/useFragmentNode.js +5 -5
  94. package/lib/relay-hooks/useIsMountedRef.js +1 -1
  95. package/lib/relay-hooks/useIsOperationNodeActive.js +3 -3
  96. package/lib/relay-hooks/useIsParentQueryActive.js +1 -1
  97. package/lib/relay-hooks/useLazyLoadQuery.js +4 -4
  98. package/lib/relay-hooks/useLazyLoadQueryNode.js +5 -5
  99. package/lib/relay-hooks/useLoadMoreFunction.js +8 -10
  100. package/lib/relay-hooks/useMemoOperationDescriptor.js +3 -3
  101. package/lib/relay-hooks/useMemoVariables.js +3 -3
  102. package/lib/relay-hooks/useMutation.js +18 -7
  103. package/lib/relay-hooks/usePaginationFragment.js +1 -1
  104. package/lib/relay-hooks/usePreloadedQuery.js +6 -6
  105. package/lib/relay-hooks/useQueryLoader.js +5 -5
  106. package/lib/relay-hooks/useRefetchableFragment.js +1 -1
  107. package/lib/relay-hooks/useRefetchableFragmentNode.js +11 -13
  108. package/lib/relay-hooks/useRelayEnvironment.js +3 -3
  109. package/lib/relay-hooks/useStaticFragmentNodeWarning.js +3 -3
  110. package/lib/relay-hooks/useSubscribeToInvalidationState.js +3 -2
  111. package/lib/relay-hooks/useSubscription.js +1 -1
  112. package/multi-actor/ActorChange.js.flow +4 -5
  113. package/multi-actor/index.js.flow +1 -1
  114. package/multi-actor/useRelayActorEnvironment.js.flow +6 -8
  115. package/package.json +3 -3
  116. package/react-relay-hooks.js +2 -2
  117. package/react-relay-hooks.min.js +3 -3
  118. package/react-relay-legacy.js +2 -2
  119. package/react-relay-legacy.min.js +3 -3
  120. package/react-relay.js +2 -2
  121. package/react-relay.min.js +3 -3
  122. package/readContext.js.flow +1 -1
  123. package/relay-hooks/EntryPointContainer.react.js.flow +9 -16
  124. package/relay-hooks/EntryPointTypes.flow.js.flow +19 -25
  125. package/relay-hooks/FragmentResource.js.flow +221 -35
  126. package/relay-hooks/InternalLogger.js.flow +1 -1
  127. package/relay-hooks/LRUCache.js.flow +1 -1
  128. package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +33 -47
  129. package/relay-hooks/MatchContainer.js.flow +4 -3
  130. package/relay-hooks/ProfilerContext.js.flow +1 -1
  131. package/relay-hooks/QueryResource.js.flow +120 -18
  132. package/relay-hooks/RelayEnvironmentProvider.js.flow +10 -10
  133. package/relay-hooks/SuspenseResource.js.flow +115 -0
  134. package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +5 -4
  135. package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +2 -2
  136. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +59 -0
  137. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +61 -0
  138. package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +11 -10
  139. package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +55 -32
  140. package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +11 -10
  141. package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +11 -10
  142. package/relay-hooks/__flowtests__/utils.js.flow +21 -32
  143. package/relay-hooks/loadEntryPoint.js.flow +7 -13
  144. package/relay-hooks/loadQuery.js.flow +23 -24
  145. package/relay-hooks/preloadQuery_DEPRECATED.js.flow +30 -14
  146. package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +7 -13
  147. package/relay-hooks/useBlockingPaginationFragment.js.flow +13 -14
  148. package/relay-hooks/useEntryPointLoader.js.flow +8 -11
  149. package/relay-hooks/useFetchTrackingRef.js.flow +3 -3
  150. package/relay-hooks/useFragment.js.flow +31 -62
  151. package/relay-hooks/useFragmentNode.js.flow +6 -8
  152. package/relay-hooks/useIsMountedRef.js.flow +1 -1
  153. package/relay-hooks/useIsOperationNodeActive.js.flow +4 -6
  154. package/relay-hooks/useIsParentQueryActive.js.flow +4 -5
  155. package/relay-hooks/useLazyLoadQuery.js.flow +14 -16
  156. package/relay-hooks/useLazyLoadQueryNode.js.flow +12 -14
  157. package/relay-hooks/useLoadMoreFunction.js.flow +20 -28
  158. package/relay-hooks/useMemoOperationDescriptor.js.flow +6 -8
  159. package/relay-hooks/useMemoVariables.js.flow +7 -7
  160. package/relay-hooks/useMutation.js.flow +27 -27
  161. package/relay-hooks/usePaginationFragment.js.flow +38 -47
  162. package/relay-hooks/usePreloadedQuery.js.flow +14 -20
  163. package/relay-hooks/useQueryLoader.js.flow +14 -17
  164. package/relay-hooks/useRefetchableFragment.js.flow +8 -9
  165. package/relay-hooks/useRefetchableFragmentNode.js.flow +23 -31
  166. package/relay-hooks/useRelayEnvironment.js.flow +3 -5
  167. package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -4
  168. package/relay-hooks/useSubscribeToInvalidationState.js.flow +4 -7
  169. package/relay-hooks/useSubscription.js.flow +7 -8
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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<<24f5477615fcc708139cec07bcc14e89>>
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 { FragmentReference } from "relay-runtime";
20
- declare export opaque type ReactRelayRefetchContainerFlowtest_viewer$ref: FragmentReference;
21
- declare export opaque type ReactRelayRefetchContainerFlowtest_viewer$fragmentType: ReactRelayRefetchContainerFlowtest_viewer$ref;
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
- +$refType: ReactRelayRefetchContainerFlowtest_viewer$ref,
32
+ +$fragmentType: ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
33
33
  |};
34
- export type ReactRelayRefetchContainerFlowtest_viewer$data = ReactRelayRefetchContainerFlowtest_viewer;
34
+ export type ReactRelayRefetchContainerFlowtest_viewer = ReactRelayRefetchContainerFlowtest_viewer$data;
35
35
  export type ReactRelayRefetchContainerFlowtest_viewer$key = {
36
36
  +$data?: ReactRelayRefetchContainerFlowtest_viewer$data,
37
- +$fragmentRefs: ReactRelayRefetchContainerFlowtest_viewer$ref,
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) Facebook, Inc. and its affiliates.
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<<712dde6a5a2b8e5da922596c5efe5d4c>>
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$ref = any;
20
- import type { FragmentReference } from "relay-runtime";
21
- declare export opaque type RelayModernFlowtest_badref$ref: FragmentReference;
22
- declare export opaque type RelayModernFlowtest_badref$fragmentType: RelayModernFlowtest_badref$ref;
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
- +$fragmentRefs: RelayModernFlowtest_user$ref,
26
- +$refType: RelayModernFlowtest_badref$ref,
25
+ +$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
26
+ +$fragmentType: RelayModernFlowtest_badref$fragmentType,
27
27
  |};
28
- export type RelayModernFlowtest_badref$data = RelayModernFlowtest_badref;
28
+ export type RelayModernFlowtest_badref = RelayModernFlowtest_badref$data;
29
29
  export type RelayModernFlowtest_badref$key = {
30
30
  +$data?: RelayModernFlowtest_badref$data,
31
- +$fragmentRefs: RelayModernFlowtest_badref$ref,
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) Facebook, Inc. and its affiliates.
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<<14976213c61d94f46f2b25902d44def8>>
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$ref = any;
20
- import type { FragmentReference } from "relay-runtime";
21
- declare export opaque type RelayModernFlowtest_notref$ref: FragmentReference;
22
- declare export opaque type RelayModernFlowtest_notref$fragmentType: RelayModernFlowtest_notref$ref;
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
- +$fragmentRefs: RelayModernFlowtest_user$ref,
26
- +$refType: RelayModernFlowtest_notref$ref,
25
+ +$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
26
+ +$fragmentType: RelayModernFlowtest_notref$fragmentType,
27
27
  |};
28
- export type RelayModernFlowtest_notref$data = RelayModernFlowtest_notref;
28
+ export type RelayModernFlowtest_notref = RelayModernFlowtest_notref$data;
29
29
  export type RelayModernFlowtest_notref$key = {
30
30
  +$data?: RelayModernFlowtest_notref$data,
31
- +$fragmentRefs: RelayModernFlowtest_notref$ref,
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) Facebook, Inc. and its affiliates.
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<<7c53a6949b52c282b306af2489af534d>>
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 { FragmentReference } from "relay-runtime";
20
- declare export opaque type RelayModernFlowtest_user$ref: FragmentReference;
21
- declare export opaque type RelayModernFlowtest_user$fragmentType: RelayModernFlowtest_user$ref;
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
- +$refType: RelayModernFlowtest_user$ref,
24
+ +$fragmentType: RelayModernFlowtest_user$fragmentType,
25
25
  |};
26
- export type RelayModernFlowtest_user$data = RelayModernFlowtest_user;
26
+ export type RelayModernFlowtest_user = RelayModernFlowtest_user$data;
27
27
  export type RelayModernFlowtest_user$key = {
28
28
  +$data?: RelayModernFlowtest_user$data,
29
- +$fragmentRefs: RelayModernFlowtest_user$ref,
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) Facebook, Inc. and its affiliates.
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<<649c1c769f0d7158a4d1411aeee7bb72>>
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 { FragmentReference } from "relay-runtime";
20
- declare export opaque type RelayModernFlowtest_users$ref: FragmentReference;
21
- declare export opaque type RelayModernFlowtest_users$fragmentType: RelayModernFlowtest_users$ref;
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
- +$refType: RelayModernFlowtest_users$ref,
24
+ +$fragmentType: RelayModernFlowtest_users$fragmentType,
25
25
  |}>;
26
- export type RelayModernFlowtest_users$data = 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
- +$fragmentRefs: RelayModernFlowtest_users$ref,
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) Facebook, Inc. and its affiliates.
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) Facebook, Inc. and its affiliates.
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
- const React = require('react');
16
- const ReactRelayContext = require('./ReactRelayContext');
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(props, ref) {
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) Facebook, Inc. and its affiliates.
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 v12.0.0
2
+ * Relay v13.0.0
3
3
  *
4
- * Copyright (c) Facebook, Inc. and its affiliates.
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) Facebook, Inc. and its affiliates.
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 v12.0.0
2
+ * Relay v13.0.0
3
3
  *
4
- * Copyright (c) Facebook, Inc. and its affiliates.
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) Facebook, Inc. and its affiliates.
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 RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
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) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,12 +1,11 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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 v12.0.0
2
+ * Relay v13.0.0
3
3
  *
4
- * Copyright (c) Facebook, Inc. and its affiliates.
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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) Facebook, Inc. and its affiliates.
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) Facebook, Inc. and its affiliates.
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 useLayoutEffect = React.useLayoutEffect,
20
- useState = React.useState,
21
- useRef = React.useRef,
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 areEqual = require("fbjs/lib/areEqual");
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
  };