Skip to content

Commit a6f66eb

Browse files
Tom910facebook-github-bot
authored andcommitted
enable by default recreating loadMore optimization
Reviewed By: tyao1 Differential Revision: D69861341 fbshipit-source-id: 1f55c614a0fc97f576d5a39b88983db6b1d89694
1 parent 8c32ec4 commit a6f66eb

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

packages/react-relay/relay-hooks/useLoadMoreFunction.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,7 @@ hook useLoadMoreFunction_CURRENT<TVariables: Variables>(
169169

170170
const fragmentSelector = getSelector(fragmentNode, fragmentRef);
171171

172-
const isRequestInvalidCheck =
173-
RelayFeatureFlags.OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION
174-
? isRequestInvalid
175-
: fragmentData == null || isParentQueryActive;
176-
177-
if (isFetchingRef.current === true || isRequestInvalidCheck) {
172+
if (isFetchingRef.current === true || isRequestInvalid) {
178173
if (fragmentSelector == null) {
179174
warning(
180175
false,
@@ -276,9 +271,6 @@ hook useLoadMoreFunction_CURRENT<TVariables: Variables>(
276271
completeFetch,
277272
isFetchingRef,
278273
isRequestInvalid,
279-
...(RelayFeatureFlags.OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION
280-
? [isRequestInvalid]
281-
: [isParentQueryActive, fragmentData]),
282274
fragmentNode.name,
283275
fragmentRef,
284276
componentDisplayName,

packages/react-relay/relay-hooks/useLoadMoreFunction_EXPERIMENTAL.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const invariant = require('invariant');
3131
const {useCallback, useRef, useState} = require('react');
3232
const {
3333
__internal: {fetchQuery},
34-
RelayFeatureFlags,
3534
createOperationDescriptor,
3635
getPaginationVariables,
3736
getRefetchMetadata,
@@ -168,12 +167,7 @@ hook useLoadMoreFunction_EXPERIMENTAL<TVariables: Variables>(
168167

169168
const fragmentSelector = getSelector(fragmentNode, fragmentRef);
170169

171-
const isRequestInvalidCheck =
172-
RelayFeatureFlags.OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION
173-
? isRequestInvalid
174-
: fragmentData == null || isParentQueryActive;
175-
176-
if (fetchStatusRef.current.kind === 'fetching' || isRequestInvalidCheck) {
170+
if (fetchStatusRef.current.kind === 'fetching' || isRequestInvalid) {
177171
if (fragmentSelector == null) {
178172
warning(
179173
false,
@@ -272,9 +266,7 @@ hook useLoadMoreFunction_EXPERIMENTAL<TVariables: Variables>(
272266
identifierValue,
273267
direction,
274268
cursor,
275-
...(RelayFeatureFlags.OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION
276-
? [isRequestInvalid]
277-
: [isParentQueryActive, fragmentData]),
269+
isRequestInvalid,
278270
fragmentNode.name,
279271
fragmentRef,
280272
componentDisplayName,

packages/relay-runtime/util/RelayFeatureFlags.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ export type FeatureFlags = {
5555
// Temporary flag to experiment to enable compatibility with React's unstable <Activity> API
5656
ENABLE_ACTIVITY_COMPATIBILITY: boolean,
5757

58-
// Enables optimization for recreating the load more function.
59-
// When enabled, this flag reduce and simplify amount of dependencies for the function loadMore
60-
OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION: boolean,
61-
6258
// Adds a prefix to the storage key of read time resolvers. This is used to
6359
// disambiguate the same resolver being used at both read time and exec time.
6460
ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX: boolean,
@@ -90,7 +86,6 @@ const RelayFeatureFlags: FeatureFlags = {
9086
ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE: false,
9187
PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION: false,
9288
MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD: false,
93-
OPTIMIZE_RECREATING_LOAD_MORE_FUNCTION: false,
9489
ENABLE_CYLE_DETECTION_IN_VARIABLES: false,
9590
ENABLE_ACTIVITY_COMPATIBILITY: false,
9691
ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX: true,

0 commit comments

Comments
 (0)