react-relay 14.0.0 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/ReactRelayContainerUtils.js.flow +0 -2
  2. package/ReactRelayContext.js +1 -1
  3. package/ReactRelayContext.js.flow +0 -2
  4. package/ReactRelayFragmentContainer.js.flow +0 -2
  5. package/ReactRelayFragmentMockRenderer.js.flow +0 -2
  6. package/ReactRelayLocalQueryRenderer.js.flow +0 -2
  7. package/ReactRelayPaginationContainer.js.flow +0 -2
  8. package/ReactRelayQueryFetcher.js.flow +9 -11
  9. package/ReactRelayQueryRenderer.js.flow +10 -12
  10. package/ReactRelayQueryRendererContext.js.flow +1 -3
  11. package/ReactRelayRefetchContainer.js.flow +0 -4
  12. package/ReactRelayTestMocker.js.flow +0 -2
  13. package/ReactRelayTypes.js.flow +6 -8
  14. package/RelayContext.js.flow +0 -2
  15. package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -4
  16. package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +3 -5
  17. package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +3 -5
  18. package/__flowtests__/RelayModern-flowtest.js.flow +2 -4
  19. package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +2 -4
  20. package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +2 -4
  21. package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +2 -4
  22. package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +2 -4
  23. package/assertFragmentMap.js.flow +0 -2
  24. package/buildReactRelayContainer.js.flow +0 -2
  25. package/getRootVariablesForFragments.js.flow +0 -2
  26. package/hooks.js +1 -1
  27. package/hooks.js.flow +0 -2
  28. package/index.js +1 -1
  29. package/index.js.flow +2 -2
  30. package/isRelayEnvironment.js.flow +0 -2
  31. package/legacy.js +1 -1
  32. package/legacy.js.flow +0 -2
  33. package/lib/ReactRelayContainerUtils.js +0 -1
  34. package/lib/ReactRelayContext.js +0 -1
  35. package/lib/ReactRelayFragmentContainer.js +10 -9
  36. package/lib/ReactRelayFragmentMockRenderer.js +0 -1
  37. package/lib/ReactRelayLocalQueryRenderer.js +0 -1
  38. package/lib/ReactRelayPaginationContainer.js +14 -11
  39. package/lib/ReactRelayQueryFetcher.js +1 -2
  40. package/lib/ReactRelayQueryRenderer.js +1 -2
  41. package/lib/ReactRelayQueryRendererContext.js +0 -1
  42. package/lib/ReactRelayRefetchContainer.js +11 -14
  43. package/lib/ReactRelayTestMocker.js +1 -2
  44. package/lib/ReactRelayTypes.js +0 -1
  45. package/lib/RelayContext.js +0 -1
  46. package/lib/assertFragmentMap.js +0 -1
  47. package/lib/buildReactRelayContainer.js +1 -2
  48. package/lib/getRootVariablesForFragments.js +1 -2
  49. package/lib/hooks.js +0 -1
  50. package/lib/index.js +3 -1
  51. package/lib/isRelayEnvironment.js +0 -1
  52. package/lib/legacy.js +0 -1
  53. package/lib/multi-actor/useRelayActorEnvironment.js +0 -1
  54. package/lib/readContext.js +0 -1
  55. package/lib/relay-hooks/EntryPointContainer.react.js +0 -1
  56. package/lib/relay-hooks/EntryPointTypes.flow.js +0 -1
  57. package/lib/relay-hooks/FragmentResource.js +7 -7
  58. package/lib/relay-hooks/HooksImplementation.js +1 -1
  59. package/lib/relay-hooks/InternalLogger.js +0 -1
  60. package/lib/relay-hooks/LRUCache.js +0 -1
  61. package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +0 -1
  62. package/lib/relay-hooks/MatchContainer.js +1 -2
  63. package/lib/relay-hooks/ProfilerContext.js +0 -1
  64. package/lib/relay-hooks/QueryResource.js +1 -2
  65. package/lib/relay-hooks/RelayEnvironmentProvider.js +0 -1
  66. package/lib/relay-hooks/SuspenseResource.js +1 -2
  67. package/lib/relay-hooks/loadQuery.js +1 -1
  68. package/lib/relay-hooks/preloadQuery_DEPRECATED.js +1 -2
  69. package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +0 -1
  70. package/lib/relay-hooks/react-cache/RelayReactCache.js +0 -1
  71. package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +3 -3
  72. package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +239 -0
  73. package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +183 -125
  74. package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +0 -1
  75. package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +0 -1
  76. package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +150 -0
  77. package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +0 -1
  78. package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +367 -0
  79. package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +45 -0
  80. package/lib/relay-hooks/useBlockingPaginationFragment.js +4 -3
  81. package/lib/relay-hooks/useClientQuery.js +33 -0
  82. package/lib/relay-hooks/useEntryPointLoader.js +1 -2
  83. package/lib/relay-hooks/useFetchTrackingRef.js +0 -1
  84. package/lib/relay-hooks/useFragment.js +0 -1
  85. package/lib/relay-hooks/useFragmentNode.js +0 -1
  86. package/lib/relay-hooks/useIsMountedRef.js +0 -1
  87. package/lib/relay-hooks/useLazyLoadQuery.js +1 -15
  88. package/lib/relay-hooks/useLazyLoadQueryNode.js +0 -1
  89. package/lib/relay-hooks/useLoadMoreFunction.js +1 -2
  90. package/lib/relay-hooks/useMemoOperationDescriptor.js +0 -1
  91. package/lib/relay-hooks/useMemoVariables.js +0 -1
  92. package/lib/relay-hooks/useMutation.js +1 -2
  93. package/lib/relay-hooks/usePaginationFragment.js +15 -3
  94. package/lib/relay-hooks/usePreloadedQuery.js +1 -15
  95. package/lib/relay-hooks/useQueryLoader.js +1 -2
  96. package/lib/relay-hooks/useRefetchableFragment.js +14 -2
  97. package/lib/relay-hooks/useRefetchableFragmentNode.js +1 -2
  98. package/lib/relay-hooks/useRelayEnvironment.js +0 -1
  99. package/lib/relay-hooks/useStaticFragmentNodeWarning.js +0 -1
  100. package/lib/relay-hooks/useSubscribeToInvalidationState.js +0 -1
  101. package/lib/relay-hooks/useSubscription.js +0 -1
  102. package/multi-actor/useRelayActorEnvironment.js.flow +0 -2
  103. package/package.json +2 -2
  104. package/react-relay-hooks.js +2 -2
  105. package/react-relay-hooks.min.js +2 -2
  106. package/react-relay-legacy.js +2 -2
  107. package/react-relay-legacy.min.js +2 -2
  108. package/react-relay.js +2 -2
  109. package/react-relay.min.js +2 -2
  110. package/readContext.js.flow +0 -2
  111. package/relay-hooks/EntryPointContainer.react.js.flow +2 -4
  112. package/relay-hooks/EntryPointTypes.flow.js.flow +30 -32
  113. package/relay-hooks/FragmentResource.js.flow +9 -11
  114. package/relay-hooks/HooksImplementation.js.flow +6 -8
  115. package/relay-hooks/InternalLogger.js.flow +0 -2
  116. package/relay-hooks/LRUCache.js.flow +0 -2
  117. package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +4 -6
  118. package/relay-hooks/MatchContainer.js.flow +5 -7
  119. package/relay-hooks/ProfilerContext.js.flow +0 -2
  120. package/relay-hooks/QueryResource.js.flow +4 -6
  121. package/relay-hooks/RelayEnvironmentProvider.js.flow +2 -4
  122. package/relay-hooks/SuspenseResource.js.flow +0 -2
  123. package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +3 -3
  124. package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +2 -2
  125. package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +4 -6
  126. package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +0 -2
  127. package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +4 -6
  128. package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +0 -2
  129. package/relay-hooks/__flowtests__/utils.js.flow +8 -10
  130. package/relay-hooks/preloadQuery_DEPRECATED.js.flow +4 -6
  131. package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +0 -2
  132. package/relay-hooks/react-cache/RelayReactCache.js.flow +0 -2
  133. package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +22 -16
  134. package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +297 -0
  135. package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +134 -94
  136. package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +0 -2
  137. package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +2 -4
  138. package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +171 -0
  139. package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +2 -4
  140. package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +595 -0
  141. package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +65 -0
  142. package/relay-hooks/useBlockingPaginationFragment.js.flow +4 -6
  143. package/relay-hooks/useClientQuery.js.flow +39 -0
  144. package/relay-hooks/useEntryPointLoader.js.flow +6 -8
  145. package/relay-hooks/useFetchTrackingRef.js.flow +2 -4
  146. package/relay-hooks/useFragment.js.flow +0 -2
  147. package/relay-hooks/useFragmentNode.js.flow +2 -4
  148. package/relay-hooks/useIsMountedRef.js.flow +1 -3
  149. package/relay-hooks/useLazyLoadQuery.js.flow +7 -30
  150. package/relay-hooks/useLazyLoadQueryNode.js.flow +2 -4
  151. package/relay-hooks/useLoadMoreFunction.js.flow +6 -8
  152. package/relay-hooks/useMemoOperationDescriptor.js.flow +0 -2
  153. package/relay-hooks/useMemoVariables.js.flow +0 -2
  154. package/relay-hooks/useMutation.js.flow +2 -4
  155. package/relay-hooks/usePaginationFragment.js.flow +44 -19
  156. package/relay-hooks/usePreloadedQuery.js.flow +5 -24
  157. package/relay-hooks/useQueryLoader.js.flow +4 -6
  158. package/relay-hooks/useRefetchableFragment.js.flow +32 -3
  159. package/relay-hooks/useRefetchableFragmentNode.js.flow +16 -18
  160. package/relay-hooks/useRelayEnvironment.js.flow +0 -2
  161. package/relay-hooks/useStaticFragmentNodeWarning.js.flow +0 -2
  162. package/relay-hooks/useSubscribeToInvalidationState.js.flow +0 -2
  163. package/relay-hooks/useSubscription.js.flow +0 -2
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  function getComponentName(component: React$ComponentType<any>): string {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v14.0.0
2
+ * Relay v14.1.0
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
  import type {RelayContext} from 'relay-runtime/store/RelayStoreTypes';
15
13
 
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
  import type {GeneratedNodeMap, RelayProp, $RelayProps} from './ReactRelayTypes';
15
13
  import type {
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const ReactRelayContext = require('./ReactRelayContext');
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {ReactRelayQueryRendererContext as ReactRelayQueryRendererContextType} from './ReactRelayQueryRendererContext';
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {
@@ -35,26 +33,26 @@ type OnDataChange = ({
35
33
  }) => void;
36
34
 
37
35
  /** The external API of 'fetch' **/
38
- export type FetchOptions = {|
36
+ export type FetchOptions = {
39
37
  environment: IEnvironment,
40
38
  onDataChange?: null | OnDataChange,
41
39
  operation: OperationDescriptor,
42
- |};
40
+ };
43
41
 
44
42
  // Internally we keep an array of onDataChange callbacks, to support reusing
45
43
  // the queryRenderer for multiple components.
46
- type FetchOptionsInternal = {|
44
+ type FetchOptionsInternal = {
47
45
  environment: IEnvironment,
48
46
  onDataChangeCallbacks: Array<OnDataChange>,
49
47
  operation: OperationDescriptor,
50
- |};
48
+ };
51
49
 
52
- export type ExecuteConfig = {|
50
+ export type ExecuteConfig = {
53
51
  environment: IEnvironment,
54
52
  operation: OperationDescriptor,
55
53
  // Allows pagination container to retain results from previous queries
56
54
  preservePreviousReferences?: boolean,
57
- |};
55
+ };
58
56
 
59
57
  class ReactRelayQueryFetcher {
60
58
  _fetchOptions: ?FetchOptionsInternal;
@@ -77,10 +75,10 @@ class ReactRelayQueryFetcher {
77
75
  }
78
76
  }
79
77
 
80
- getSelectionReferences(): {|
78
+ getSelectionReferences(): {
81
79
  cacheSelectionReference: ?Disposable,
82
80
  selectionReferences: Array<Disposable>,
83
- |} {
81
+ } {
84
82
  return {
85
83
  cacheSelectionReference: this._cacheSelectionReference,
86
84
  selectionReferences: this._selectionReferences,
@@ -321,7 +319,7 @@ class ReactRelayQueryFetcher {
321
319
  }: {
322
320
  notifyFirstResult: boolean,
323
321
  ...
324
- }) {
322
+ }): void {
325
323
  invariant(
326
324
  this._fetchOptions,
327
325
  'ReactRelayQueryFetcher: `_onQueryDataAvailable` should have been called after having called `fetch`',
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {ReactRelayQueryRendererContext as ReactRelayQueryRendererContextType} from './ReactRelayQueryRendererContext';
@@ -34,7 +32,7 @@ const {
34
32
  getRequest,
35
33
  } = require('relay-runtime');
36
34
 
37
- type RetryCallbacks = {|
35
+ type RetryCallbacks = {
38
36
  handleDataChange:
39
37
  | null
40
38
  | (({
@@ -43,39 +41,39 @@ type RetryCallbacks = {|
43
41
  ...
44
42
  }) => void),
45
43
  handleRetryAfterError: null | ((error: Error) => void),
46
- |};
44
+ };
47
45
 
48
- export type RenderProps<T> = {|
46
+ export type RenderProps<T> = {
49
47
  error: ?Error,
50
48
  props: ?T,
51
49
  retry: ?(cacheConfigOverride?: CacheConfig) => void,
52
- |};
50
+ };
53
51
  /**
54
52
  * React may double-fire the constructor, and we call 'fetch' in the
55
53
  * constructor. If a request is already in flight from a previous call to the
56
54
  * constructor, just reuse the query fetcher and wait for the response.
57
55
  */
58
56
  const requestCache: {
59
- [string]: void | {|
57
+ [string]: void | {
60
58
  queryFetcher: ReactRelayQueryFetcher,
61
59
  snapshot: ?Snapshot,
62
- |},
60
+ },
63
61
  } = {};
64
62
 
65
63
  const queryRendererContext: ReactRelayQueryRendererContextType = {
66
64
  rootIsQueryRenderer: true,
67
65
  };
68
66
 
69
- export type Props = {|
67
+ export type Props = {
70
68
  cacheConfig?: ?CacheConfig,
71
69
  fetchPolicy?: 'store-and-network' | 'network-only',
72
70
  environment: IEnvironment,
73
71
  query: ?GraphQLTaggedNode,
74
72
  render: (renderProps: RenderProps<Object>) => React.Node,
75
73
  variables: Variables,
76
- |};
74
+ };
77
75
 
78
- type State = {|
76
+ type State = {
79
77
  error: Error | null,
80
78
  prevPropsEnvironment: IEnvironment,
81
79
  prevPropsVariables: Variables,
@@ -86,7 +84,7 @@ type State = {|
86
84
  retryCallbacks: RetryCallbacks,
87
85
  requestCacheKey: ?string,
88
86
  snapshot: Snapshot | null,
89
- |};
87
+ };
90
88
 
91
89
  /**
92
90
  * @public
@@ -8,12 +8,10 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
  const React = require('react');
15
13
 
16
- export type ReactRelayQueryRendererContext = {|rootIsQueryRenderer: boolean|};
14
+ export type ReactRelayQueryRendererContext = {rootIsQueryRenderer: boolean};
17
15
 
18
16
  module.exports = (React.createContext({
19
17
  rootIsQueryRenderer: false,
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {
@@ -364,9 +362,7 @@ function createContainerWithFragments<
364
362
  );
365
363
 
366
364
  // TODO: T26288752 find a better way
367
- /* eslint-disable lint/react-state-props-mutation */
368
365
  this.state.localVariables = fetchVariables;
369
- /* eslint-enable lint/react-state-props-mutation */
370
366
 
371
367
  // Cancel any previously running refetch.
372
368
  this._refetchSubscription && this._refetchSubscription.unsubscribe();
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {
@@ -29,7 +27,7 @@ export type ObserverOrCallback = Observer<void> | ((error: ?Error) => mixed);
29
27
  // RelayRefetchProp to flow into a RelayProp.
30
28
  export type RelayProp = {+environment: IEnvironment, ...};
31
29
 
32
- export type RelayPaginationProp = {|
30
+ export type RelayPaginationProp = {
33
31
  +environment: IEnvironment,
34
32
  +hasMore: () => boolean,
35
33
  +isLoading: () => boolean,
@@ -43,9 +41,9 @@ export type RelayPaginationProp = {|
43
41
  observerOrCallback: ?ObserverOrCallback,
44
42
  refetchVariables: ?Variables,
45
43
  ) => ?Disposable,
46
- |};
44
+ };
47
45
 
48
- export type RelayRefetchProp = {|
46
+ export type RelayRefetchProp = {
49
47
  +environment: IEnvironment,
50
48
  +refetch: (
51
49
  refetchVariables: Variables | ((fragmentVariables: Variables) => Variables),
@@ -53,13 +51,13 @@ export type RelayRefetchProp = {|
53
51
  observerOrCallback: ?ObserverOrCallback,
54
52
  options?: RefetchOptions,
55
53
  ) => Disposable,
56
- |};
54
+ };
57
55
 
58
- export type RefetchOptions = {|
56
+ export type RefetchOptions = {
59
57
  +force?: boolean,
60
58
  +fetchPolicy?: 'store-or-network' | 'network-only',
61
59
  +metadata?: {[key: string]: mixed, ...},
62
- |};
60
+ };
63
61
 
64
62
  /**
65
63
  * A utility type which takes the type of a fragment's data (typically found in
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {RelayContext} from 'relay-runtime';
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const {
@@ -45,7 +43,7 @@ class BarComponent extends React.Component<{
45
43
  requiredProp: string,
46
44
  ...
47
45
  }> {
48
- static defaultProps = {
46
+ static defaultProps: {defaultProp: string} = {
49
47
  defaultProp: 'default',
50
48
  };
51
49
  getNum(): number {
@@ -127,7 +125,7 @@ module.exports = {
127
125
  return <Bar {...props} />;
128
126
  },
129
127
  checkStaticsAndMethodsProxying(): React.Node {
130
- class ProxyChecker extends React.PureComponent<{||}> {
128
+ class ProxyChecker extends React.PureComponent<{}> {
131
129
  _barRef: ?BarComponent;
132
130
  getString(): string {
133
131
  const ok = this._barRef ? this._barRef.getNum() : 'default'; // legit
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const {
@@ -33,13 +31,13 @@ class FooComponent extends React.Component {
33
31
  requiredProp: string,
34
32
  ...
35
33
  };
36
- static defaultProps = {
34
+ static defaultProps: {defaultProp: string} = {
37
35
  defaultProp: 'default',
38
36
  };
39
37
  getNum(): number {
40
38
  return 42;
41
39
  }
42
- render() {
40
+ render(): React.Node {
43
41
  const reqLen = this.props.requiredProp.length;
44
42
  const optionalProp = this.props.optionalProp;
45
43
 
@@ -159,7 +157,7 @@ module.exports = {
159
157
  /** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
160
158
  return bad ? 'not good' : ok;
161
159
  }
162
- render() {
160
+ render(): React.Node {
163
161
  return (
164
162
  <Foo
165
163
  componentRef={ref => {
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const {
@@ -32,13 +30,13 @@ class FooComponent extends React.Component {
32
30
  requiredProp: string,
33
31
  ...
34
32
  };
35
- static defaultProps = {
33
+ static defaultProps: {defaultProp: string} = {
36
34
  defaultProp: 'default',
37
35
  };
38
36
  getNum(): number {
39
37
  return 42;
40
38
  }
41
- render() {
39
+ render(): React.Node {
42
40
  const reqLen = this.props.requiredProp.length;
43
41
  const optionalProp = this.props.optionalProp;
44
42
 
@@ -142,7 +140,7 @@ module.exports = {
142
140
  /** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
143
141
  return bad ? 'not good' : ok;
144
142
  }
145
- render() {
143
+ render(): React.Node {
146
144
  return (
147
145
  <Foo
148
146
  componentRef={ref => {
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {$FragmentRef} from '../ReactRelayTypes';
@@ -252,9 +250,9 @@ declare var aComplexUserRef: {
252
250
  optionalUsers={null}
253
251
  />;
254
252
 
255
- class AnyTest extends React.Component<{|
253
+ class AnyTest extends React.Component<{
256
254
  anything: any,
257
- |}> {}
255
+ }> {}
258
256
  const AnyTestContainer = createFragmentContainer(AnyTest, {});
259
257
 
260
258
  <AnyTestContainer anything={42} />;
@@ -8,16 +8,14 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {RelayModernFlowtest_user$ref} from './RelayModernFlowtest_user.graphql';
16
14
  import type {FragmentType} from 'relay-runtime';
17
15
 
18
16
  declare export opaque type RelayModernFlowtest_badref$ref: FragmentType;
19
- export type RelayModernFlowtest_badref = {|
17
+ export type RelayModernFlowtest_badref = {
20
18
  +id: string,
21
19
  +$fragmentSpreads: RelayModernFlowtest_user$ref,
22
20
  +$fragmentType: RelayModernFlowtest_badref$ref,
23
- |};
21
+ };
@@ -8,16 +8,14 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {RelayModernFlowtest_user$ref} from './RelayModernFlowtest_user.graphql';
16
14
  import type {FragmentType} from 'relay-runtime';
17
15
 
18
16
  declare export opaque type RelayModernFlowtest_notref$ref: FragmentType;
19
- export type RelayModernFlowtest_notref = {|
17
+ export type RelayModernFlowtest_notref = {
20
18
  +id: string,
21
19
  +$fragmentSpreads: RelayModernFlowtest_user$ref,
22
20
  +$fragmentType: RelayModernFlowtest_notref$ref,
23
- |};
21
+ };
@@ -8,14 +8,12 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {FragmentType} from 'relay-runtime';
16
14
 
17
15
  declare export opaque type RelayModernFlowtest_user$ref: FragmentType;
18
- export type RelayModernFlowtest_user = {|
16
+ export type RelayModernFlowtest_user = {
19
17
  +name: ?string,
20
18
  +$fragmentType: RelayModernFlowtest_user$ref,
21
- |};
19
+ };
@@ -8,14 +8,12 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {FragmentType} from 'relay-runtime';
16
14
 
17
15
  declare export opaque type RelayModernFlowtest_users$ref: FragmentType;
18
- export type RelayModernFlowtest_users = $ReadOnlyArray<{|
16
+ export type RelayModernFlowtest_users = $ReadOnlyArray<{
19
17
  +name: ?string,
20
18
  +$fragmentType: RelayModernFlowtest_users$ref,
21
- |}>;
19
+ }>;
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {GeneratedNodeMap} from './ReactRelayTypes';
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
  import type {ReaderFragment} from '../relay-runtime/util/ReaderNode';
15
13
  import type {GeneratedNodeMap} from './ReactRelayTypes';
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  import type {FragmentMap, Variables} from 'relay-runtime';
package/hooks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v14.0.0
2
+ * Relay v14.1.0
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/hooks.js.flow CHANGED
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v14.0.0
2
+ * Relay v14.1.0
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js.flow CHANGED
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const ReactRelayContext = require('./ReactRelayContext');
@@ -22,6 +20,7 @@ const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
22
20
  const loadEntryPoint = require('./relay-hooks/loadEntryPoint');
23
21
  const {loadQuery} = require('./relay-hooks/loadQuery');
24
22
  const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
23
+ const useClientQuery = require('./relay-hooks/useClientQuery');
25
24
  const useEntryPointLoader = require('./relay-hooks/useEntryPointLoader');
26
25
  const useFragment = require('./relay-hooks/useFragment');
27
26
  const useLazyLoadQuery = require('./relay-hooks/useLazyLoadQuery');
@@ -113,6 +112,7 @@ module.exports = {
113
112
  loadQuery: loadQuery,
114
113
  loadEntryPoint: loadEntryPoint,
115
114
 
115
+ useClientQuery: useClientQuery,
116
116
  useFragment: useFragment,
117
117
  useLazyLoadQuery: useLazyLoadQuery,
118
118
  useEntryPointLoader: useEntryPointLoader,
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  /**
package/legacy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v14.0.0
2
+ * Relay v14.1.0
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/legacy.js.flow CHANGED
@@ -8,8 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- // flowlint ambiguous-object-type:error
12
-
13
11
  'use strict';
14
12
 
15
13
  const ReactRelayContext = require('./ReactRelayContext');
@@ -7,7 +7,6 @@
7
7
  *
8
8
  * @format
9
9
  */
10
- // flowlint ambiguous-object-type:error
11
10
  'use strict';
12
11
 
13
12
  function getComponentName(component) {
@@ -7,7 +7,6 @@
7
7
  *
8
8
  * @format
9
9
  */
10
- // flowlint ambiguous-object-type:error
11
10
  'use strict';
12
11
 
13
12
  var React = require('react');