react-relay 11.0.2 → 13.0.0-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/README.md +47 -0
  2. package/ReactRelayContainerUtils.js.flow +1 -1
  3. package/ReactRelayContext.js +1 -1
  4. package/ReactRelayContext.js.flow +3 -4
  5. package/ReactRelayFragmentContainer.js.flow +25 -25
  6. package/ReactRelayFragmentMockRenderer.js.flow +2 -2
  7. package/ReactRelayLocalQueryRenderer.js.flow +7 -8
  8. package/ReactRelayPaginationContainer.js.flow +112 -59
  9. package/ReactRelayQueryFetcher.js.flow +10 -11
  10. package/ReactRelayQueryRenderer.js.flow +116 -82
  11. package/ReactRelayQueryRendererContext.js.flow +1 -1
  12. package/ReactRelayRefetchContainer.js.flow +42 -39
  13. package/ReactRelayTestMocker.js.flow +17 -15
  14. package/ReactRelayTypes.js.flow +11 -11
  15. package/RelayContext.js.flow +4 -4
  16. package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -3
  17. package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +12 -8
  18. package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +11 -7
  19. package/__flowtests__/RelayModern-flowtest.js.flow +79 -47
  20. package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +6 -5
  21. package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +6 -5
  22. package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +5 -4
  23. package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +5 -4
  24. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +72 -0
  25. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +72 -0
  26. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +227 -0
  27. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +164 -0
  28. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +227 -0
  29. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +164 -0
  30. package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +66 -0
  31. package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +66 -0
  32. package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +59 -0
  33. package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +61 -0
  34. package/assertFragmentMap.js.flow +3 -3
  35. package/buildReactRelayContainer.js.flow +12 -11
  36. package/getRootVariablesForFragments.js.flow +3 -5
  37. package/hooks.js +1 -1
  38. package/hooks.js.flow +6 -7
  39. package/index.js +1 -1
  40. package/index.js.flow +7 -8
  41. package/isRelayEnvironment.js.flow +1 -1
  42. package/jest-react/enqueueTask.js.flow +56 -0
  43. package/jest-react/index.js.flow +12 -0
  44. package/jest-react/internalAct.js.flow +138 -0
  45. package/legacy.js +1 -1
  46. package/legacy.js.flow +1 -1
  47. package/lib/ReactRelayContainerUtils.js +1 -1
  48. package/lib/ReactRelayContext.js +1 -1
  49. package/lib/ReactRelayFragmentContainer.js +22 -16
  50. package/lib/ReactRelayFragmentMockRenderer.js +3 -3
  51. package/lib/ReactRelayLocalQueryRenderer.js +8 -9
  52. package/lib/ReactRelayPaginationContainer.js +97 -39
  53. package/lib/ReactRelayQueryFetcher.js +3 -3
  54. package/lib/ReactRelayQueryRenderer.js +87 -54
  55. package/lib/ReactRelayQueryRendererContext.js +1 -1
  56. package/lib/ReactRelayRefetchContainer.js +39 -26
  57. package/lib/ReactRelayTestMocker.js +8 -9
  58. package/lib/ReactRelayTypes.js +1 -1
  59. package/lib/RelayContext.js +4 -3
  60. package/lib/assertFragmentMap.js +3 -2
  61. package/lib/buildReactRelayContainer.js +8 -8
  62. package/lib/getRootVariablesForFragments.js +2 -3
  63. package/lib/hooks.js +6 -6
  64. package/lib/index.js +8 -8
  65. package/lib/isRelayEnvironment.js +1 -1
  66. package/lib/jest-react/enqueueTask.js +53 -0
  67. package/lib/jest-react/index.js +13 -0
  68. package/lib/jest-react/internalAct.js +115 -0
  69. package/lib/legacy.js +1 -1
  70. package/lib/multi-actor/ActorChange.js +30 -0
  71. package/lib/multi-actor/index.js +11 -0
  72. package/lib/multi-actor/useRelayActorEnvironment.js +29 -0
  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 +342 -89
  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 +172 -29
  83. package/lib/relay-hooks/RelayEnvironmentProvider.js +6 -4
  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 +42 -20
  87. package/lib/relay-hooks/preloadQuery_DEPRECATED.js +25 -16
  88. package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +1 -1
  89. package/lib/relay-hooks/useBlockingPaginationFragment.js +5 -6
  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 +11 -5
  99. package/lib/relay-hooks/useLoadMoreFunction.js +9 -13
  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 +3 -4
  104. package/lib/relay-hooks/usePreloadedQuery.js +6 -6
  105. package/lib/relay-hooks/useQueryLoader.js +31 -11
  106. package/lib/relay-hooks/useRefetchableFragment.js +1 -1
  107. package/lib/relay-hooks/useRefetchableFragmentNode.js +14 -18
  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 +11 -8
  112. package/multi-actor/ActorChange.js.flow +58 -0
  113. package/multi-actor/index.js.flow +14 -0
  114. package/multi-actor/useRelayActorEnvironment.js.flow +49 -0
  115. package/package.json +3 -3
  116. package/react-relay-hooks.js +2 -2
  117. package/react-relay-hooks.min.js +2 -2
  118. package/react-relay-legacy.js +2 -2
  119. package/react-relay-legacy.min.js +2 -2
  120. package/react-relay.js +2 -2
  121. package/react-relay.min.js +2 -2
  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 +25 -26
  125. package/relay-hooks/FragmentResource.js.flow +359 -93
  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 +217 -26
  132. package/relay-hooks/RelayEnvironmentProvider.js.flow +15 -5
  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 +50 -32
  145. package/relay-hooks/preloadQuery_DEPRECATED.js.flow +31 -22
  146. package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +7 -13
  147. package/relay-hooks/useBlockingPaginationFragment.js.flow +14 -12
  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 +20 -14
  157. package/relay-hooks/useLoadMoreFunction.js.flow +21 -30
  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 +39 -45
  162. package/relay-hooks/usePreloadedQuery.js.flow +14 -20
  163. package/relay-hooks/useQueryLoader.js.flow +42 -23
  164. package/relay-hooks/useRefetchableFragment.js.flow +8 -9
  165. package/relay-hooks/useRefetchableFragmentNode.js.flow +25 -33
  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 +21 -11
  170. package/lib/relay-hooks/getPaginationMetadata.js +0 -41
  171. package/lib/relay-hooks/getPaginationVariables.js +0 -67
  172. package/lib/relay-hooks/getRefetchMetadata.js +0 -36
  173. package/lib/relay-hooks/getValueAtPath.js +0 -51
  174. package/relay-hooks/getPaginationMetadata.js.flow +0 -74
  175. package/relay-hooks/getPaginationVariables.js.flow +0 -110
  176. package/relay-hooks/getRefetchMetadata.js.flow +0 -80
  177. package/relay-hooks/getValueAtPath.js.flow +0 -46
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated SignedSource<<343eb8b15c596ab2aeccd2e9c65aacc8>>
8
+ * @flow
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* eslint-disable */
14
+
15
+ 'use strict';
16
+
17
+ /*::
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
+ +account_user: ?{|
24
+ +friends: ?{|
25
+ +edges: ?$ReadOnlyArray<?{|
26
+ +node: ?{|
27
+ +__typename: string,
28
+ |},
29
+ |}>,
30
+ |},
31
+ |},
32
+ +$fragmentType: ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
33
+ |};
34
+ export type ReactRelayRefetchContainerFlowtest_viewer = ReactRelayRefetchContainerFlowtest_viewer$data;
35
+ export type ReactRelayRefetchContainerFlowtest_viewer$key = {
36
+ +$data?: ReactRelayRefetchContainerFlowtest_viewer$data,
37
+ +$fragmentSpreads: ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
38
+ ...
39
+ };
40
+ */
41
+
42
+ var node/*: ReaderFragment*/ = {
43
+ "argumentDefinitions": [
44
+ {
45
+ "kind": "RootArgument",
46
+ "name": "count"
47
+ },
48
+ {
49
+ "kind": "RootArgument",
50
+ "name": "cursor"
51
+ }
52
+ ],
53
+ "kind": "Fragment",
54
+ "metadata": {
55
+ "connection": [
56
+ {
57
+ "count": "count",
58
+ "cursor": "cursor",
59
+ "direction": "forward",
60
+ "path": [
61
+ "account_user",
62
+ "friends"
63
+ ]
64
+ }
65
+ ]
66
+ },
67
+ "name": "ReactRelayRefetchContainerFlowtest_viewer",
68
+ "selections": [
69
+ {
70
+ "alias": null,
71
+ "args": null,
72
+ "concreteType": "User",
73
+ "kind": "LinkedField",
74
+ "name": "account_user",
75
+ "plural": false,
76
+ "selections": [
77
+ {
78
+ "alias": "friends",
79
+ "args": null,
80
+ "concreteType": "FriendsConnection",
81
+ "kind": "LinkedField",
82
+ "name": "__ReactRelayRefetchContainerFlowtest_viewer__friends_connection",
83
+ "plural": false,
84
+ "selections": [
85
+ {
86
+ "alias": null,
87
+ "args": null,
88
+ "concreteType": "FriendsEdge",
89
+ "kind": "LinkedField",
90
+ "name": "edges",
91
+ "plural": true,
92
+ "selections": [
93
+ {
94
+ "alias": null,
95
+ "args": null,
96
+ "concreteType": "User",
97
+ "kind": "LinkedField",
98
+ "name": "node",
99
+ "plural": false,
100
+ "selections": [
101
+ {
102
+ "alias": null,
103
+ "args": null,
104
+ "kind": "ScalarField",
105
+ "name": "__typename",
106
+ "storageKey": null
107
+ }
108
+ ],
109
+ "storageKey": null
110
+ },
111
+ {
112
+ "alias": null,
113
+ "args": null,
114
+ "kind": "ScalarField",
115
+ "name": "cursor",
116
+ "storageKey": null
117
+ }
118
+ ],
119
+ "storageKey": null
120
+ },
121
+ {
122
+ "alias": null,
123
+ "args": null,
124
+ "concreteType": "PageInfo",
125
+ "kind": "LinkedField",
126
+ "name": "pageInfo",
127
+ "plural": false,
128
+ "selections": [
129
+ {
130
+ "alias": null,
131
+ "args": null,
132
+ "kind": "ScalarField",
133
+ "name": "endCursor",
134
+ "storageKey": null
135
+ },
136
+ {
137
+ "alias": null,
138
+ "args": null,
139
+ "kind": "ScalarField",
140
+ "name": "hasNextPage",
141
+ "storageKey": null
142
+ }
143
+ ],
144
+ "storageKey": null
145
+ }
146
+ ],
147
+ "storageKey": null
148
+ }
149
+ ],
150
+ "storageKey": null
151
+ }
152
+ ],
153
+ "type": "Viewer",
154
+ "abstractKey": null
155
+ };
156
+
157
+ if (__DEV__) {
158
+ (node/*: any*/).hash = "cf098b4248d8ddfacfc0d356838697bb";
159
+ }
160
+
161
+ module.exports = ((node/*: any*/)/*: Fragment<
162
+ ReactRelayRefetchContainerFlowtest_viewer$fragmentType,
163
+ ReactRelayRefetchContainerFlowtest_viewer$data,
164
+ >*/);
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated SignedSource<<2e6de02332132a03de07b1bee9c8ceac>>
8
+ * @flow
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* eslint-disable */
14
+
15
+ 'use strict';
16
+
17
+ /*::
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
+ +id: string,
25
+ +$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
26
+ +$fragmentType: RelayModernFlowtest_badref$fragmentType,
27
+ |};
28
+ export type RelayModernFlowtest_badref = RelayModernFlowtest_badref$data;
29
+ export type RelayModernFlowtest_badref$key = {
30
+ +$data?: RelayModernFlowtest_badref$data,
31
+ +$fragmentSpreads: RelayModernFlowtest_badref$fragmentType,
32
+ ...
33
+ };
34
+ */
35
+
36
+ var node/*: ReaderFragment*/ = {
37
+ "argumentDefinitions": [],
38
+ "kind": "Fragment",
39
+ "metadata": null,
40
+ "name": "RelayModernFlowtest_badref",
41
+ "selections": [
42
+ {
43
+ "alias": null,
44
+ "args": null,
45
+ "kind": "ScalarField",
46
+ "name": "id",
47
+ "storageKey": null
48
+ },
49
+ {
50
+ "args": null,
51
+ "kind": "FragmentSpread",
52
+ "name": "RelayModernFlowtest_user"
53
+ }
54
+ ],
55
+ "type": "User",
56
+ "abstractKey": null
57
+ };
58
+
59
+ if (__DEV__) {
60
+ (node/*: any*/).hash = "a04dc2854770919bd070bdc717de7812";
61
+ }
62
+
63
+ module.exports = ((node/*: any*/)/*: Fragment<
64
+ RelayModernFlowtest_badref$fragmentType,
65
+ RelayModernFlowtest_badref$data,
66
+ >*/);
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated SignedSource<<8cfc221caf8236a8279a0b578a4c03a3>>
8
+ * @flow
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* eslint-disable */
14
+
15
+ 'use strict';
16
+
17
+ /*::
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
+ +id: string,
25
+ +$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
26
+ +$fragmentType: RelayModernFlowtest_notref$fragmentType,
27
+ |};
28
+ export type RelayModernFlowtest_notref = RelayModernFlowtest_notref$data;
29
+ export type RelayModernFlowtest_notref$key = {
30
+ +$data?: RelayModernFlowtest_notref$data,
31
+ +$fragmentSpreads: RelayModernFlowtest_notref$fragmentType,
32
+ ...
33
+ };
34
+ */
35
+
36
+ var node/*: ReaderFragment*/ = {
37
+ "argumentDefinitions": [],
38
+ "kind": "Fragment",
39
+ "metadata": null,
40
+ "name": "RelayModernFlowtest_notref",
41
+ "selections": [
42
+ {
43
+ "alias": null,
44
+ "args": null,
45
+ "kind": "ScalarField",
46
+ "name": "id",
47
+ "storageKey": null
48
+ },
49
+ {
50
+ "args": null,
51
+ "kind": "FragmentSpread",
52
+ "name": "RelayModernFlowtest_user"
53
+ }
54
+ ],
55
+ "type": "User",
56
+ "abstractKey": null
57
+ };
58
+
59
+ if (__DEV__) {
60
+ (node/*: any*/).hash = "d61c43d07b2fe8f623c9b84fcdf70ac8";
61
+ }
62
+
63
+ module.exports = ((node/*: any*/)/*: Fragment<
64
+ RelayModernFlowtest_notref$fragmentType,
65
+ RelayModernFlowtest_notref$data,
66
+ >*/);
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated SignedSource<<9c7b60dab9f7983c67f2c7e1138f0eee>>
8
+ * @flow
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* eslint-disable */
14
+
15
+ 'use strict';
16
+
17
+ /*::
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
+ +name: ?string,
24
+ +$fragmentType: RelayModernFlowtest_user$fragmentType,
25
+ |};
26
+ export type RelayModernFlowtest_user = RelayModernFlowtest_user$data;
27
+ export type RelayModernFlowtest_user$key = {
28
+ +$data?: RelayModernFlowtest_user$data,
29
+ +$fragmentSpreads: RelayModernFlowtest_user$fragmentType,
30
+ ...
31
+ };
32
+ */
33
+
34
+ var node/*: ReaderFragment*/ = {
35
+ "argumentDefinitions": [],
36
+ "kind": "Fragment",
37
+ "metadata": null,
38
+ "name": "RelayModernFlowtest_user",
39
+ "selections": [
40
+ {
41
+ "alias": null,
42
+ "args": null,
43
+ "kind": "ScalarField",
44
+ "name": "name",
45
+ "storageKey": null
46
+ }
47
+ ],
48
+ "type": "User",
49
+ "abstractKey": null
50
+ };
51
+
52
+ if (__DEV__) {
53
+ (node/*: any*/).hash = "18a730295ff54e88446f4f000f5fef7e";
54
+ }
55
+
56
+ module.exports = ((node/*: any*/)/*: Fragment<
57
+ RelayModernFlowtest_user$fragmentType,
58
+ RelayModernFlowtest_user$data,
59
+ >*/);
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated SignedSource<<d2e1d6f0352e992d909d6217160aab1e>>
8
+ * @flow
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* eslint-disable */
14
+
15
+ 'use strict';
16
+
17
+ /*::
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
+ +name: ?string,
24
+ +$fragmentType: RelayModernFlowtest_users$fragmentType,
25
+ |}>;
26
+ export type RelayModernFlowtest_users = RelayModernFlowtest_users$data;
27
+ export type RelayModernFlowtest_users$key = $ReadOnlyArray<{
28
+ +$data?: RelayModernFlowtest_users$data,
29
+ +$fragmentSpreads: RelayModernFlowtest_users$fragmentType,
30
+ ...
31
+ }>;
32
+ */
33
+
34
+ var node/*: ReaderFragment*/ = {
35
+ "argumentDefinitions": [],
36
+ "kind": "Fragment",
37
+ "metadata": {
38
+ "plural": true
39
+ },
40
+ "name": "RelayModernFlowtest_users",
41
+ "selections": [
42
+ {
43
+ "alias": null,
44
+ "args": null,
45
+ "kind": "ScalarField",
46
+ "name": "name",
47
+ "storageKey": null
48
+ }
49
+ ],
50
+ "type": "User",
51
+ "abstractKey": null
52
+ };
53
+
54
+ if (__DEV__) {
55
+ (node/*: any*/).hash = "4e6f0e70d48ec58651c17e3150c63d05";
56
+ }
57
+
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,5 +1,5 @@
1
1
  /**
2
- * Relay v11.0.2
2
+ * Relay v13.0.0-rc.2
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
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 {
@@ -37,7 +35,7 @@ export type {
37
35
  MatchPointer,
38
36
  } from './relay-hooks/MatchContainer';
39
37
  export type {ProfilerContextType} from './relay-hooks/ProfilerContext';
40
- export type {Direction, LoadMoreFn} from './relay-hooks/useLoadMoreFunction';
38
+ export type {LoadMoreFn} from './relay-hooks/useLoadMoreFunction';
41
39
  export type {UseMutationConfig} from './relay-hooks/useMutation';
42
40
  export type {UseQueryLoaderLoadQueryOptions} from './relay-hooks/useQueryLoader';
43
41
  export type {
@@ -48,6 +46,7 @@ export type {
48
46
  export type {
49
47
  DataID,
50
48
  DeclarativeMutationConfig,
49
+ Direction,
51
50
  Disposable,
52
51
  // RelayRuntime has two environment exports: one interface, one concrete.
53
52
  IEnvironment as Environment,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v11.0.2
2
+ * Relay v13.0.0-rc.2
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
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,
@@ -53,7 +51,7 @@ export type {
53
51
  MatchPointer,
54
52
  } from './relay-hooks/MatchContainer';
55
53
  export type {ProfilerContextType} from './relay-hooks/ProfilerContext';
56
- export type {Direction, LoadMoreFn} from './relay-hooks/useLoadMoreFunction';
54
+ export type {LoadMoreFn} from './relay-hooks/useLoadMoreFunction';
57
55
  export type {UseMutationConfig} from './relay-hooks/useMutation';
58
56
  export type {UseQueryLoaderLoadQueryOptions} from './relay-hooks/useQueryLoader';
59
57
  export type {
@@ -64,6 +62,7 @@ export type {
64
62
  export type {
65
63
  DataID,
66
64
  DeclarativeMutationConfig,
65
+ Direction,
67
66
  Disposable,
68
67
  // RelayRuntime has two environment exports: one interface, one concrete.
69
68
  IEnvironment as Environment,
@@ -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.