react-relay 0.0.0-main-342c2f19 → 0.0.0-main-7eca724d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReactRelayContext.js +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/legacy.js +1 -1
- package/lib/relay-hooks/readFragmentInternal.js +1 -1
- package/lib/relay-hooks/useFragmentInternal_CURRENT.js +1 -1
- package/lib/relay-hooks/useFragmentInternal_EXPERIMENTAL.js +1 -1
- package/package.json +2 -2
- package/relay-hooks/readFragmentInternal.js.flow +4 -1
- package/relay-hooks/useFragmentInternal_CURRENT.js.flow +4 -1
- package/relay-hooks/useFragmentInternal_EXPERIMENTAL.js.flow +4 -1
package/ReactRelayContext.js
CHANGED
package/hooks.js
CHANGED
package/index.js
CHANGED
package/legacy.js
CHANGED
|
@@ -130,7 +130,7 @@ function readFragmentInternal(environment, fragmentNode, fragmentRef, hookDispla
|
|
|
130
130
|
!(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'In this case, pass `null` if the conditions for evaluating the ' + 'fragment are not met (e.g. if the `@include(if)` value is false.)', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, fragmentKey == null ? 'a fragment reference' : "the `".concat(fragmentKey, "`"), hookDisplayName) : invariant(false) : void 0;
|
|
131
131
|
var state = getFragmentState(environment, fragmentSelector);
|
|
132
132
|
var clientEdgeQueries = null;
|
|
133
|
-
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true) {
|
|
133
|
+
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true || RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES) {
|
|
134
134
|
var missingClientEdges = getMissingClientEdges(state);
|
|
135
135
|
if (missingClientEdges !== null && missingClientEdges !== void 0 && missingClientEdges.length) {
|
|
136
136
|
clientEdgeQueries = [];
|
|
@@ -343,7 +343,7 @@ function useFragmentInternal(fragmentNode, fragmentRef, hookDisplayName, queryOp
|
|
|
343
343
|
useEffect(function () {
|
|
344
344
|
committedFragmentSelectorRef.current = fragmentSelector;
|
|
345
345
|
}, [fragmentSelector]);
|
|
346
|
-
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true) {
|
|
346
|
+
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true || RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES) {
|
|
347
347
|
var _useMemo = useMemo(function () {
|
|
348
348
|
var missingClientEdges = getMissingClientEdges(state);
|
|
349
349
|
var clientEdgeQueries;
|
|
@@ -345,7 +345,7 @@ function useFragmentInternal_EXPERIMENTAL(fragmentNode, fragmentRef, hookDisplay
|
|
|
345
345
|
useEffect(function () {
|
|
346
346
|
committedFragmentSelectorRef.current = fragmentSelector;
|
|
347
347
|
}, [fragmentSelector]);
|
|
348
|
-
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true) {
|
|
348
|
+
if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true || RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES) {
|
|
349
349
|
var _useMemo = useMemo(function () {
|
|
350
350
|
var missingClientEdges = getMissingClientEdges(state);
|
|
351
351
|
var clientEdgeQueries;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-relay",
|
|
3
3
|
"description": "A framework for building GraphQL-driven React applications.",
|
|
4
|
-
"version": "0.0.0-main-
|
|
4
|
+
"version": "0.0.0-main-7eca724d",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
7
7
|
"relay",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fbjs": "^3.0.2",
|
|
21
21
|
"invariant": "^2.2.4",
|
|
22
22
|
"nullthrows": "^1.1.1",
|
|
23
|
-
"relay-runtime": "0.0.0-main-
|
|
23
|
+
"relay-runtime": "0.0.0-main-7eca724d"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^16.9.0 || ^17 || ^18 || ^19"
|
|
@@ -213,7 +213,10 @@ function readFragmentInternal(
|
|
|
213
213
|
// Handle the queries for any missing client edges; this may suspend.
|
|
214
214
|
// FIXME handle client edges in parallel.
|
|
215
215
|
let clientEdgeQueries = null;
|
|
216
|
-
if (
|
|
216
|
+
if (
|
|
217
|
+
fragmentNode.metadata?.hasClientEdges === true ||
|
|
218
|
+
RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES
|
|
219
|
+
) {
|
|
217
220
|
const missingClientEdges = getMissingClientEdges(state);
|
|
218
221
|
if (missingClientEdges?.length) {
|
|
219
222
|
clientEdgeQueries = ([]: Array<QueryResult>);
|
|
@@ -461,7 +461,10 @@ hook useFragmentInternal(
|
|
|
461
461
|
|
|
462
462
|
// Handle the queries for any missing client edges; this may suspend.
|
|
463
463
|
// FIXME handle client edges in parallel.
|
|
464
|
-
if (
|
|
464
|
+
if (
|
|
465
|
+
fragmentNode.metadata?.hasClientEdges === true ||
|
|
466
|
+
RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES
|
|
467
|
+
) {
|
|
465
468
|
// The fragment is validated to be static (in useFragment) and hasClientEdges is
|
|
466
469
|
// a static (constant) property of the fragment. In practice, this effect will
|
|
467
470
|
// always or never run for a given invocation of this hook.
|
|
@@ -476,7 +476,10 @@ hook useFragmentInternal_EXPERIMENTAL(
|
|
|
476
476
|
|
|
477
477
|
// Handle the queries for any missing client edges; this may suspend.
|
|
478
478
|
// FIXME handle client edges in parallel.
|
|
479
|
-
if (
|
|
479
|
+
if (
|
|
480
|
+
fragmentNode.metadata?.hasClientEdges === true ||
|
|
481
|
+
RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES
|
|
482
|
+
) {
|
|
480
483
|
// The fragment is validated to be static (in useFragment) and hasClientEdges is
|
|
481
484
|
// a static (constant) property of the fragment. In practice, this effect will
|
|
482
485
|
// always or never run for a given invocation of this hook.
|