react-relay 14.0.0 → 15.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ReactRelayContainerUtils.js.flow +1 -2
- package/ReactRelayContext.js +1 -1
- package/ReactRelayContext.js.flow +1 -2
- package/ReactRelayFragmentContainer.js.flow +6 -4
- package/ReactRelayFragmentMockRenderer.js.flow +1 -2
- package/ReactRelayLocalQueryRenderer.js.flow +5 -5
- package/ReactRelayPaginationContainer.js.flow +21 -14
- package/ReactRelayQueryFetcher.js.flow +28 -16
- package/ReactRelayQueryRenderer.js.flow +42 -13
- package/ReactRelayQueryRendererContext.js.flow +2 -3
- package/ReactRelayRefetchContainer.js.flow +9 -9
- package/ReactRelayTestMocker.js.flow +3 -3
- package/ReactRelayTypes.js.flow +7 -8
- package/RelayContext.js.flow +1 -2
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +4 -5
- package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +4 -5
- package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +4 -5
- package/__flowtests__/RelayModern-flowtest.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +3 -4
- package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +3 -4
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +3 -1
- package/assertFragmentMap.js.flow +1 -2
- package/buildReactRelayContainer.js.flow +7 -7
- package/getRootVariablesForFragments.js.flow +1 -3
- package/hooks.js +1 -1
- package/hooks.js.flow +4 -2
- package/index.js +1 -1
- package/index.js.flow +6 -2
- package/isRelayEnvironment.js.flow +1 -2
- package/jest-react/enqueueTask.js.flow +1 -1
- package/jest-react/index.js.flow +1 -1
- package/jest-react/internalAct.js.flow +1 -1
- package/legacy.js +1 -1
- package/legacy.js.flow +1 -2
- package/lib/ReactRelayContainerUtils.js +2 -3
- package/lib/ReactRelayContext.js +3 -4
- package/lib/ReactRelayFragmentContainer.js +47 -73
- package/lib/ReactRelayFragmentMockRenderer.js +2 -4
- package/lib/ReactRelayLocalQueryRenderer.js +18 -31
- package/lib/ReactRelayPaginationContainer.js +74 -164
- package/lib/ReactRelayQueryFetcher.js +49 -76
- package/lib/ReactRelayQueryRenderer.js +63 -84
- package/lib/ReactRelayQueryRendererContext.js +2 -2
- package/lib/ReactRelayRefetchContainer.js +58 -108
- package/lib/ReactRelayTestMocker.js +33 -68
- package/lib/ReactRelayTypes.js +2 -1
- package/lib/RelayContext.js +4 -7
- package/lib/assertFragmentMap.js +3 -5
- package/lib/buildReactRelayContainer.js +11 -27
- package/lib/getRootVariablesForFragments.js +6 -10
- package/lib/hooks.js +5 -18
- package/lib/index.js +7 -24
- package/lib/isRelayEnvironment.js +5 -4
- package/lib/jest-react/enqueueTask.js +5 -9
- package/lib/jest-react/index.js +0 -1
- package/lib/jest-react/internalAct.js +9 -20
- package/lib/legacy.js +2 -8
- package/lib/multi-actor/ActorChange.js +2 -5
- package/lib/multi-actor/index.js +2 -1
- package/lib/multi-actor/useRelayActorEnvironment.js +4 -8
- package/lib/relay-hooks/EntryPointContainer.react.js +9 -15
- package/lib/relay-hooks/EntryPointTypes.flow.js +5 -3
- package/lib/relay-hooks/FragmentResource.js +109 -203
- package/lib/relay-hooks/HooksImplementation.js +3 -6
- package/lib/relay-hooks/InternalLogger.js +2 -3
- package/lib/relay-hooks/LRUCache.js +2 -20
- package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +33 -54
- package/lib/relay-hooks/MatchContainer.js +15 -24
- package/lib/relay-hooks/ProfilerContext.js +3 -3
- package/lib/relay-hooks/QueryResource.js +31 -101
- package/lib/relay-hooks/RelayEnvironmentProvider.js +5 -9
- package/lib/relay-hooks/SuspenseResource.js +9 -33
- package/lib/relay-hooks/loadEntryPoint.js +19 -31
- package/lib/relay-hooks/loadQuery.js +42 -78
- package/lib/relay-hooks/preloadQuery_DEPRECATED.js +11 -37
- package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +9 -15
- package/lib/relay-hooks/react-cache/RelayReactCache.js +7 -12
- package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +27 -81
- package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +206 -0
- package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +195 -215
- package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +5 -15
- package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +17 -24
- package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +149 -0
- package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +24 -39
- package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +325 -0
- package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +37 -0
- package/lib/relay-hooks/useBlockingPaginationFragment.js +73 -93
- package/lib/relay-hooks/useClientQuery.js +30 -0
- package/lib/relay-hooks/useEntryPointLoader.js +18 -38
- package/lib/relay-hooks/useFetchTrackingRef.js +10 -12
- package/lib/relay-hooks/useFragment.js +8 -19
- package/lib/relay-hooks/useFragmentNode.js +20 -32
- package/lib/relay-hooks/useIsMountedRef.js +4 -6
- package/lib/relay-hooks/useIsOperationNodeActive.js +8 -20
- package/lib/relay-hooks/useIsParentQueryActive.js +3 -6
- package/lib/relay-hooks/useLazyLoadQuery.js +7 -24
- package/lib/relay-hooks/useLazyLoadQueryNode.js +23 -34
- package/lib/relay-hooks/useLoadMoreFunction.js +46 -78
- package/lib/relay-hooks/useMemoOperationDescriptor.js +6 -15
- package/lib/relay-hooks/useMemoVariables.js +15 -34
- package/lib/relay-hooks/useMutation.js +9 -27
- package/lib/relay-hooks/usePaginationFragment.js +73 -76
- package/lib/relay-hooks/usePreloadedQuery.js +13 -44
- package/lib/relay-hooks/useQueryLoader.js +24 -49
- package/lib/relay-hooks/useRefetchableFragment.js +19 -17
- package/lib/relay-hooks/useRefetchableFragmentNode.js +65 -109
- package/lib/relay-hooks/useRelayEnvironment.js +4 -8
- package/lib/relay-hooks/useStaticFragmentNodeWarning.js +4 -8
- package/lib/relay-hooks/useSubscribeToInvalidationState.js +8 -9
- package/lib/relay-hooks/useSubscription.js +5 -10
- package/lib/relay-hooks/useUnsafeRef_DEPRECATED.js +29 -0
- package/multi-actor/ActorChange.js.flow +1 -1
- package/multi-actor/index.js.flow +1 -1
- package/multi-actor/useRelayActorEnvironment.js.flow +2 -4
- package/package.json +2 -2
- package/react-relay-hooks.js +2 -2
- package/react-relay-hooks.min.js +2 -2
- package/react-relay-legacy.js +2 -2
- package/react-relay-legacy.min.js +2 -2
- package/react-relay.js +2 -2
- package/react-relay.min.js +2 -2
- package/relay-hooks/EntryPointContainer.react.js.flow +3 -5
- package/relay-hooks/EntryPointTypes.flow.js.flow +37 -37
- package/relay-hooks/FragmentResource.js.flow +43 -19
- package/relay-hooks/HooksImplementation.js.flow +7 -9
- package/relay-hooks/InternalLogger.js.flow +1 -3
- package/relay-hooks/LRUCache.js.flow +1 -3
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +19 -14
- package/relay-hooks/MatchContainer.js.flow +6 -8
- package/relay-hooks/ProfilerContext.js.flow +1 -3
- package/relay-hooks/QueryResource.js.flow +29 -11
- package/relay-hooks/RelayEnvironmentProvider.js.flow +4 -6
- package/relay-hooks/SuspenseResource.js.flow +1 -3
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +6 -4
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +4 -4
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +39 -39
- package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +1 -3
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +37 -38
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +18 -20
- package/relay-hooks/__flowtests__/utils.js.flow +21 -12
- package/relay-hooks/loadEntryPoint.js.flow +11 -6
- package/relay-hooks/loadQuery.js.flow +11 -7
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +9 -12
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +13 -10
- package/relay-hooks/react-cache/RelayReactCache.js.flow +1 -3
- package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +26 -20
- package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +297 -0
- package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +136 -96
- package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +1 -3
- package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +3 -5
- package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +190 -0
- package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +3 -6
- package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +601 -0
- package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +65 -0
- package/relay-hooks/useBlockingPaginationFragment.js.flow +86 -59
- package/relay-hooks/useClientQuery.js.flow +39 -0
- package/relay-hooks/useEntryPointLoader.js.flow +16 -14
- package/relay-hooks/useFetchTrackingRef.js.flow +7 -8
- package/relay-hooks/useFragment.js.flow +2 -4
- package/relay-hooks/useFragmentNode.js.flow +7 -8
- package/relay-hooks/useIsMountedRef.js.flow +2 -4
- package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
- package/relay-hooks/useIsParentQueryActive.js.flow +1 -1
- package/relay-hooks/useLazyLoadQuery.js.flow +9 -32
- package/relay-hooks/useLazyLoadQueryNode.js.flow +4 -6
- package/relay-hooks/useLoadMoreFunction.js.flow +20 -17
- package/relay-hooks/useMemoOperationDescriptor.js.flow +3 -5
- package/relay-hooks/useMemoVariables.js.flow +13 -31
- package/relay-hooks/useMutation.js.flow +6 -8
- package/relay-hooks/usePaginationFragment.js.flow +75 -43
- package/relay-hooks/usePreloadedQuery.js.flow +49 -43
- package/relay-hooks/useQueryLoader.js.flow +89 -28
- package/relay-hooks/useRefetchableFragment.js.flow +83 -23
- package/relay-hooks/useRefetchableFragmentNode.js.flow +26 -22
- package/relay-hooks/useRelayEnvironment.js.flow +2 -4
- package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -5
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +2 -4
- package/relay-hooks/useSubscription.js.flow +1 -3
- package/relay-hooks/useUnsafeRef_DEPRECATED.js.flow +25 -0
- package/lib/readContext.js +0 -28
- package/readContext.js.flow +0 -31
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
const {
|
@@ -45,7 +44,7 @@ class BarComponent extends React.Component<{
|
|
45
44
|
requiredProp: string,
|
46
45
|
...
|
47
46
|
}> {
|
48
|
-
static defaultProps = {
|
47
|
+
static defaultProps: {defaultProp: string} = {
|
49
48
|
defaultProp: 'default',
|
50
49
|
};
|
51
50
|
getNum(): number {
|
@@ -127,7 +126,7 @@ module.exports = {
|
|
127
126
|
return <Bar {...props} />;
|
128
127
|
},
|
129
128
|
checkStaticsAndMethodsProxying(): React.Node {
|
130
|
-
class ProxyChecker extends React.PureComponent<{
|
129
|
+
class ProxyChecker extends React.PureComponent<{}> {
|
131
130
|
_barRef: ?BarComponent;
|
132
131
|
getString(): string {
|
133
132
|
const ok = this._barRef ? this._barRef.getNum() : 'default'; // legit
|
@@ -141,7 +140,7 @@ module.exports = {
|
|
141
140
|
render(): React.Element<typeof Bar> {
|
142
141
|
return (
|
143
142
|
<Bar
|
144
|
-
componentRef={ref => {
|
143
|
+
componentRef={(ref: empty) => {
|
145
144
|
this._barRef = (ref: empty);
|
146
145
|
}}
|
147
146
|
requiredProp="bar"
|
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
const {
|
@@ -33,13 +32,13 @@ class FooComponent extends React.Component {
|
|
33
32
|
requiredProp: string,
|
34
33
|
...
|
35
34
|
};
|
36
|
-
static defaultProps = {
|
35
|
+
static defaultProps: {defaultProp: string} = {
|
37
36
|
defaultProp: 'default',
|
38
37
|
};
|
39
38
|
getNum(): number {
|
40
39
|
return 42;
|
41
40
|
}
|
42
|
-
render() {
|
41
|
+
render(): React.Node {
|
43
42
|
const reqLen = this.props.requiredProp.length;
|
44
43
|
const optionalProp = this.props.optionalProp;
|
45
44
|
|
@@ -159,7 +158,7 @@ module.exports = {
|
|
159
158
|
/** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
|
160
159
|
return bad ? 'not good' : ok;
|
161
160
|
}
|
162
|
-
render() {
|
161
|
+
render(): React.Node {
|
163
162
|
return (
|
164
163
|
<Foo
|
165
164
|
componentRef={ref => {
|
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
const {
|
@@ -32,13 +31,13 @@ class FooComponent extends React.Component {
|
|
32
31
|
requiredProp: string,
|
33
32
|
...
|
34
33
|
};
|
35
|
-
static defaultProps = {
|
34
|
+
static defaultProps: {defaultProp: string} = {
|
36
35
|
defaultProp: 'default',
|
37
36
|
};
|
38
37
|
getNum(): number {
|
39
38
|
return 42;
|
40
39
|
}
|
41
|
-
render() {
|
40
|
+
render(): React.Node {
|
42
41
|
const reqLen = this.props.requiredProp.length;
|
43
42
|
const optionalProp = this.props.optionalProp;
|
44
43
|
|
@@ -142,7 +141,7 @@ module.exports = {
|
|
142
141
|
/** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
|
143
142
|
return bad ? 'not good' : ok;
|
144
143
|
}
|
145
|
-
render() {
|
144
|
+
render(): React.Node {
|
146
145
|
return (
|
147
146
|
<Foo
|
148
147
|
componentRef={ref => {
|
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {$FragmentRef} from '../ReactRelayTypes';
|
@@ -252,9 +251,9 @@ declare var aComplexUserRef: {
|
|
252
251
|
optionalUsers={null}
|
253
252
|
/>;
|
254
253
|
|
255
|
-
class AnyTest extends React.Component<{
|
254
|
+
class AnyTest extends React.Component<{
|
256
255
|
anything: any,
|
257
|
-
|
256
|
+
}> {}
|
258
257
|
const AnyTestContainer = createFragmentContainer(AnyTest, {});
|
259
258
|
|
260
259
|
<AnyTestContainer anything={42} />;
|
@@ -6,18 +6,17 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {RelayModernFlowtest_user$ref} from './RelayModernFlowtest_user.graphql';
|
16
15
|
import type {FragmentType} from 'relay-runtime';
|
17
16
|
|
18
17
|
declare export opaque type RelayModernFlowtest_badref$ref: FragmentType;
|
19
|
-
export type RelayModernFlowtest_badref = {
|
18
|
+
export type RelayModernFlowtest_badref = {
|
20
19
|
+id: string,
|
21
20
|
+$fragmentSpreads: RelayModernFlowtest_user$ref,
|
22
21
|
+$fragmentType: RelayModernFlowtest_badref$ref,
|
23
|
-
|
22
|
+
};
|
@@ -6,18 +6,17 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {RelayModernFlowtest_user$ref} from './RelayModernFlowtest_user.graphql';
|
16
15
|
import type {FragmentType} from 'relay-runtime';
|
17
16
|
|
18
17
|
declare export opaque type RelayModernFlowtest_notref$ref: FragmentType;
|
19
|
-
export type RelayModernFlowtest_notref = {
|
18
|
+
export type RelayModernFlowtest_notref = {
|
20
19
|
+id: string,
|
21
20
|
+$fragmentSpreads: RelayModernFlowtest_user$ref,
|
22
21
|
+$fragmentType: RelayModernFlowtest_notref$ref,
|
23
|
-
|
22
|
+
};
|
@@ -6,16 +6,15 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {FragmentType} from 'relay-runtime';
|
16
15
|
|
17
16
|
declare export opaque type RelayModernFlowtest_user$ref: FragmentType;
|
18
|
-
export type RelayModernFlowtest_user = {
|
17
|
+
export type RelayModernFlowtest_user = {
|
19
18
|
+name: ?string,
|
20
19
|
+$fragmentType: RelayModernFlowtest_user$ref,
|
21
|
-
|
20
|
+
};
|
@@ -6,16 +6,15 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {FragmentType} from 'relay-runtime';
|
16
15
|
|
17
16
|
declare export opaque type RelayModernFlowtest_users$ref: FragmentType;
|
18
|
-
export type RelayModernFlowtest_users = $ReadOnlyArray<{
|
17
|
+
export type RelayModernFlowtest_users = $ReadOnlyArray<{
|
19
18
|
+name: ?string,
|
20
19
|
+$fragmentType: RelayModernFlowtest_users$ref,
|
21
|
-
|
20
|
+
}>;
|
package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow
CHANGED
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<97ebbfa87de00690617b84f5dc0b3dd7>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow
CHANGED
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<493af2df808158f1c08ec6aafda2e783>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow
CHANGED
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<073d1d174775daaac06d462623886192>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -16,7 +18,7 @@
|
|
16
18
|
|
17
19
|
/*::
|
18
20
|
import type { ConcreteRequest, Query } from 'relay-runtime';
|
19
|
-
type ReactRelayPaginationContainerFlowtest_viewer$fragmentType
|
21
|
+
import type { ReactRelayPaginationContainerFlowtest_viewer$fragmentType } from "./ReactRelayPaginationContainerFlowtest_viewer.graphql";
|
20
22
|
export type ReactRelayPaginationContainerFlowtestQuery$variables = {|
|
21
23
|
count: number,
|
22
24
|
cursor?: ?string,
|
package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow
CHANGED
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<03cbc84be1e0fb9c3986ea29a3e335db>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<909036439f4d2e9e2d5728ade52035dc>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -16,7 +18,7 @@
|
|
16
18
|
|
17
19
|
/*::
|
18
20
|
import type { ConcreteRequest, Query } from 'relay-runtime';
|
19
|
-
type ReactRelayRefetchContainerFlowtest_viewer$fragmentType
|
21
|
+
import type { ReactRelayRefetchContainerFlowtest_viewer$fragmentType } from "./ReactRelayRefetchContainerFlowtest_viewer.graphql";
|
20
22
|
export type ReactRelayRefetchContainerFlowtestQuery$variables = {|
|
21
23
|
count: number,
|
22
24
|
cursor?: ?string,
|
package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow
CHANGED
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<6f9cebfabb127ad6db1de1705f8a9764>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<1d67fc8ab171aeb4c45cb1df2d036371>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -16,7 +18,7 @@
|
|
16
18
|
|
17
19
|
/*::
|
18
20
|
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
-
type RelayModernFlowtest_user$fragmentType
|
21
|
+
import type { RelayModernFlowtest_user$fragmentType } from "./RelayModernFlowtest_user.graphql";
|
20
22
|
import type { FragmentType } from "relay-runtime";
|
21
23
|
declare export opaque type RelayModernFlowtest_badref$fragmentType: FragmentType;
|
22
24
|
export type RelayModernFlowtest_badref$data = {|
|
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<43b1e678169a4cde5a3a2312c2dca669>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -16,7 +18,7 @@
|
|
16
18
|
|
17
19
|
/*::
|
18
20
|
import type { Fragment, ReaderFragment } from 'relay-runtime';
|
19
|
-
type RelayModernFlowtest_user$fragmentType
|
21
|
+
import type { RelayModernFlowtest_user$fragmentType } from "./RelayModernFlowtest_user.graphql";
|
20
22
|
import type { FragmentType } from "relay-runtime";
|
21
23
|
declare export opaque type RelayModernFlowtest_notref$fragmentType: FragmentType;
|
22
24
|
export type RelayModernFlowtest_notref$data = {|
|
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<9d848fb441343089b23a4a389281bffb>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -4,7 +4,9 @@
|
|
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
|
+
* @oncall relay
|
8
|
+
*
|
9
|
+
* @generated SignedSource<<36c03d8fd5d95624c243a32c2b4791e4>>
|
8
10
|
* @flow
|
9
11
|
* @lightSyntaxTransform
|
10
12
|
* @nogrep
|
@@ -6,14 +6,13 @@
|
|
6
6
|
*
|
7
7
|
* @flow
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
|
-
|
13
|
+
|
15
14
|
import type {GeneratedNodeMap} from './ReactRelayTypes';
|
16
|
-
import type {FragmentMap} from 'relay-runtime';
|
15
|
+
import type {FragmentMap, ReaderFragment} from 'relay-runtime';
|
17
16
|
|
18
17
|
const assertFragmentMap = require('./assertFragmentMap');
|
19
18
|
const {
|
@@ -22,11 +21,12 @@ const {
|
|
22
21
|
} = require('./ReactRelayContainerUtils');
|
23
22
|
const ReactRelayContext = require('./ReactRelayContext');
|
24
23
|
const ReactRelayQueryRendererContext = require('./ReactRelayQueryRendererContext');
|
25
|
-
const readContext = require('./readContext');
|
26
24
|
const invariant = require('invariant');
|
27
25
|
const React = require('react');
|
28
26
|
const {getFragment} = require('relay-runtime');
|
29
27
|
|
28
|
+
const {useContext} = React;
|
29
|
+
|
30
30
|
type ContainerCreator = (
|
31
31
|
Component: React$ComponentType<any>,
|
32
32
|
fragments: FragmentMap,
|
@@ -56,7 +56,7 @@ function buildReactRelayContainer<TBase: React$ComponentType<any>>(
|
|
56
56
|
props: any,
|
57
57
|
ref: ((null | any) => mixed) | {current: null | any, ...},
|
58
58
|
) {
|
59
|
-
const context =
|
59
|
+
const context = useContext(ReactRelayContext);
|
60
60
|
invariant(
|
61
61
|
context != null,
|
62
62
|
'`%s` tried to render a context that was not valid this means that ' +
|
@@ -64,7 +64,7 @@ function buildReactRelayContainer<TBase: React$ComponentType<any>>(
|
|
64
64
|
containerName,
|
65
65
|
containerName,
|
66
66
|
);
|
67
|
-
const queryRendererContext =
|
67
|
+
const queryRendererContext = useContext(ReactRelayQueryRendererContext);
|
68
68
|
|
69
69
|
return (
|
70
70
|
<Container
|
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
import type {FragmentMap, Variables} from 'relay-runtime';
|
@@ -33,7 +32,6 @@ function getRootVariablesForFragments<TProps: {...}>(
|
|
33
32
|
? selector.selectors[0]?.owner.variables ?? {}
|
34
33
|
: selector?.owner.variables ?? {};
|
35
34
|
rootVariables = {
|
36
|
-
// $FlowFixMe[exponential-spread]
|
37
35
|
...rootVariables,
|
38
36
|
...fragmentOwnerVariables,
|
39
37
|
};
|
package/hooks.js
CHANGED
package/hooks.js.flow
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
|
16
15
|
const loadEntryPoint = require('./relay-hooks/loadEntryPoint');
|
17
16
|
const {loadQuery} = require('./relay-hooks/loadQuery');
|
17
|
+
const ProfilerContext = require('./relay-hooks/ProfilerContext');
|
18
18
|
const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
|
19
19
|
const useEntryPointLoader = require('./relay-hooks/useEntryPointLoader');
|
20
20
|
const useFragment = require('./relay-hooks/useFragment');
|
@@ -79,6 +79,8 @@ module.exports = {
|
|
79
79
|
EntryPointContainer: EntryPointContainer,
|
80
80
|
RelayEnvironmentProvider: RelayEnvironmentProvider,
|
81
81
|
|
82
|
+
ProfilerContext: ProfilerContext,
|
83
|
+
|
82
84
|
fetchQuery: RelayRuntime.fetchQuery,
|
83
85
|
|
84
86
|
loadQuery: loadQuery,
|
package/index.js
CHANGED
package/index.js.flow
CHANGED
@@ -6,10 +6,9 @@
|
|
6
6
|
*
|
7
7
|
* @flow strict-local
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
11
|
|
11
|
-
// flowlint ambiguous-object-type:error
|
12
|
-
|
13
12
|
'use strict';
|
14
13
|
|
15
14
|
const ReactRelayContext = require('./ReactRelayContext');
|
@@ -21,7 +20,9 @@ const ReactRelayRefetchContainer = require('./ReactRelayRefetchContainer');
|
|
21
20
|
const EntryPointContainer = require('./relay-hooks/EntryPointContainer.react');
|
22
21
|
const loadEntryPoint = require('./relay-hooks/loadEntryPoint');
|
23
22
|
const {loadQuery} = require('./relay-hooks/loadQuery');
|
23
|
+
const ProfilerContext = require('./relay-hooks/ProfilerContext');
|
24
24
|
const RelayEnvironmentProvider = require('./relay-hooks/RelayEnvironmentProvider');
|
25
|
+
const useClientQuery = require('./relay-hooks/useClientQuery');
|
25
26
|
const useEntryPointLoader = require('./relay-hooks/useEntryPointLoader');
|
26
27
|
const useFragment = require('./relay-hooks/useFragment');
|
27
28
|
const useLazyLoadQuery = require('./relay-hooks/useLazyLoadQuery');
|
@@ -108,11 +109,14 @@ module.exports = {
|
|
108
109
|
EntryPointContainer: EntryPointContainer,
|
109
110
|
RelayEnvironmentProvider: RelayEnvironmentProvider,
|
110
111
|
|
112
|
+
ProfilerContext: ProfilerContext,
|
113
|
+
|
111
114
|
fetchQuery: RelayRuntime.fetchQuery,
|
112
115
|
|
113
116
|
loadQuery: loadQuery,
|
114
117
|
loadEntryPoint: loadEntryPoint,
|
115
118
|
|
119
|
+
useClientQuery: useClientQuery,
|
116
120
|
useFragment: useFragment,
|
117
121
|
useLazyLoadQuery: useLazyLoadQuery,
|
118
122
|
useEntryPointLoader: useEntryPointLoader,
|
@@ -4,8 +4,8 @@
|
|
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
|
-
* @emails oncall+relay
|
8
7
|
* @format
|
8
|
+
* @oncall relay
|
9
9
|
*/
|
10
10
|
|
11
11
|
// This file is sync'd from https://github.com/facebook/react/tree/main/packages/jest-react
|
package/jest-react/index.js.flow
CHANGED
@@ -4,8 +4,8 @@
|
|
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
|
-
* @emails oncall+relay
|
8
7
|
* @format
|
8
|
+
* @oncall relay
|
9
9
|
*/
|
10
10
|
|
11
11
|
// This file is sync'd from https://github.com/facebook/react/tree/main/packages/jest-react
|
package/legacy.js
CHANGED
package/legacy.js.flow
CHANGED
@@ -6,18 +6,17 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
|
-
|
11
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
function getComponentName(component) {
|
14
15
|
return component.displayName || component.name || 'Component';
|
15
16
|
}
|
16
|
-
|
17
17
|
function getContainerName(Component) {
|
18
18
|
return 'Relay(' + getComponentName(Component) + ')';
|
19
19
|
}
|
20
|
-
|
21
20
|
module.exports = {
|
22
21
|
getComponentName: getComponentName,
|
23
22
|
getContainerName: getContainerName
|
package/lib/ReactRelayContext.js
CHANGED
@@ -6,13 +6,12 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
+
* @oncall relay
|
9
10
|
*/
|
10
|
-
|
11
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var React = require('react');
|
14
|
-
|
15
15
|
var _require = require('relay-runtime'),
|
16
|
-
|
17
|
-
|
16
|
+
createRelayContext = _require.__internal.createRelayContext;
|
18
17
|
module.exports = createRelayContext(React);
|