Skip to content

Commit 12d760c

Browse files
committed
Add alwaysThrottleRetries flag (#26685)
This puts the change introduced by #26611 behind a flag until Meta is able to roll it out. Disabling the flag reverts back to the old behavior, where retries are throttled if there's still data remaining in the tree, but not if all the data has finished loading. The new behavior is still enabled in the public builds. DiffTrain build for commit d73d7d5.
1 parent ec3ec56 commit 12d760c

File tree

13 files changed

+149
-132
lines changed

13 files changed

+149
-132
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<fb35677e465a0575f9b39e24b8b35767>>
10+
* @generated SignedSource<<43355784ad4a055ab0a02e5c5e648c88>>
1111
*/
1212

1313
'use strict';
@@ -145,7 +145,8 @@ var createRootStrictEffectsByDefault = false;
145145
var enableLazyContextPropagation = false;
146146
var enableLegacyHidden = false;
147147
var diffInCommitPhase = true;
148-
var enableAsyncActions = false; // Flow magic to verify the exports of this file match the original version.
148+
var enableAsyncActions = false;
149+
var alwaysThrottleRetries = true; // Flow magic to verify the exports of this file match the original version.
149150

150151
var FunctionComponent = 0;
151152
var ClassComponent = 1;
@@ -20431,7 +20432,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
2043120432
workInProgressTransitions
2043220433
);
2043320434
} else {
20434-
if (includesOnlyRetries(lanes)) {
20435+
if (includesOnlyRetries(lanes) && alwaysThrottleRetries) {
2043520436
// This render only included retries, no updates. Throttle committing
2043620437
// retries so that we don't show too many loading states too quickly.
2043720438
var msUntilTimeout =
@@ -23858,7 +23859,7 @@ function createFiberRoot(
2385823859
return root;
2385923860
}
2386023861

23861-
var ReactVersion = "18.3.0-next-7f8c501f6-20230420";
23862+
var ReactVersion = "18.3.0-next-d73d7d590-20230420";
2386223863

2386323864
// Might add PROFILE later.
2386423865

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8599,7 +8599,7 @@ var devToolsConfig$jscomp$inline_1021 = {
85998599
throw Error("TestRenderer does not support findFiberByHostInstance()");
86008600
},
86018601
bundleType: 0,
8602-
version: "18.3.0-next-7f8c501f6-20230420",
8602+
version: "18.3.0-next-d73d7d590-20230420",
86038603
rendererPackageName: "react-test-renderer"
86048604
};
86058605
var internals$jscomp$inline_1206 = {
@@ -8630,7 +8630,7 @@ var internals$jscomp$inline_1206 = {
86308630
scheduleRoot: null,
86318631
setRefreshHandler: null,
86328632
getCurrentFiber: null,
8633-
reconcilerVersion: "18.3.0-next-7f8c501f6-20230420"
8633+
reconcilerVersion: "18.3.0-next-d73d7d590-20230420"
86348634
};
86358635
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86368636
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9025,7 +9025,7 @@ var devToolsConfig$jscomp$inline_1063 = {
90259025
throw Error("TestRenderer does not support findFiberByHostInstance()");
90269026
},
90279027
bundleType: 0,
9028-
version: "18.3.0-next-7f8c501f6-20230420",
9028+
version: "18.3.0-next-d73d7d590-20230420",
90299029
rendererPackageName: "react-test-renderer"
90309030
};
90319031
var internals$jscomp$inline_1247 = {
@@ -9056,7 +9056,7 @@ var internals$jscomp$inline_1247 = {
90569056
scheduleRoot: null,
90579057
setRefreshHandler: null,
90589058
getCurrentFiber: null,
9059-
reconcilerVersion: "18.3.0-next-7f8c501f6-20230420"
9059+
reconcilerVersion: "18.3.0-next-d73d7d590-20230420"
90609060
};
90619061
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90629062
var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-next-7f8c501f6-20230420";
30+
var ReactVersion = "18.3.0-next-d73d7d590-20230420";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
639639
);
640640
};
641641
exports.useTransition = useTransition;
642-
exports.version = "18.3.0-next-7f8c501f6-20230420";
642+
exports.version = "18.3.0-next-d73d7d590-20230420";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
642642
);
643643
};
644644
exports.useTransition = useTransition;
645-
exports.version = "18.3.0-next-7f8c501f6-20230420";
645+
exports.version = "18.3.0-next-d73d7d590-20230420";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7f8c501f682bd4abe24826a93538059d717ba39e
1+
d73d7d59086218b0fa42d0a79c32a0365952650b

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<13be0ed73b0dd62cc37d1e24af8fe51a>>
10+
* @generated SignedSource<<78a825a4d424f226b6f344ef3a16b2ec>>
1111
*/
1212

1313
'use strict';
@@ -3198,7 +3198,8 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
31983198

31993199
var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
32003200
enableDeferRootSchedulingToMicrotask =
3201-
dynamicFlags.enableDeferRootSchedulingToMicrotask; // The rest of the flags are static for better dead code elimination.
3201+
dynamicFlags.enableDeferRootSchedulingToMicrotask,
3202+
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries; // The rest of the flags are static for better dead code elimination.
32023203
var enableSchedulingProfiler = true;
32033204
var enableProfilerTimer = true;
32043205
var enableProfilerCommitHooks = true;
@@ -23536,7 +23537,10 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
2353623537
workInProgressTransitions
2353723538
);
2353823539
} else {
23539-
if (includesOnlyRetries(lanes)) {
23540+
if (
23541+
includesOnlyRetries(lanes) &&
23542+
(alwaysThrottleRetries || exitStatus === RootSuspended)
23543+
) {
2354023544
// This render only included retries, no updates. Throttle committing
2354123545
// retries so that we don't show too many loading states too quickly.
2354223546
var msUntilTimeout =
@@ -27165,7 +27169,7 @@ function createFiberRoot(
2716527169
return root;
2716627170
}
2716727171

27168-
var ReactVersion = "18.3.0-next-7f8c501f6-20230420";
27172+
var ReactVersion = "18.3.0-next-d73d7d590-20230420";
2716927173

2717027174
function createPortal$1(
2717127175
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0b0bda830df48380bcde0d6ac5c73756>>
10+
* @generated SignedSource<<472cb7f28d742af2e290a0816a880f33>>
1111
*/
1212

1313
"use strict";
@@ -1317,6 +1317,7 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
13171317
var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
13181318
enableDeferRootSchedulingToMicrotask =
13191319
dynamicFlags.enableDeferRootSchedulingToMicrotask,
1320+
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
13201321
scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
13211322
cancelCallback$1 = Scheduler.unstable_cancelCallback,
13221323
shouldYield = Scheduler.unstable_shouldYield,
@@ -7567,59 +7568,59 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
75677568
root === workInProgressRoot ? workInProgressRootRenderLanes : 0
75687569
);
75697570
if (0 === lanes) return null;
7570-
didTimeout =
7571+
var exitStatus =
75717572
includesBlockingLane(root, lanes) ||
75727573
0 !== (lanes & root.expiredLanes) ||
75737574
didTimeout
75747575
? renderRootSync(root, lanes)
75757576
: renderRootConcurrent(root, lanes);
7576-
if (0 !== didTimeout) {
7577-
if (2 === didTimeout) {
7578-
var originallyAttemptedLanes = lanes,
7579-
errorRetryLanes = getLanesToRetrySynchronouslyOnError(
7580-
root,
7581-
originallyAttemptedLanes
7582-
);
7577+
if (0 !== exitStatus) {
7578+
if (2 === exitStatus) {
7579+
didTimeout = lanes;
7580+
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(
7581+
root,
7582+
didTimeout
7583+
);
75837584
0 !== errorRetryLanes &&
75847585
((lanes = errorRetryLanes),
7585-
(didTimeout = recoverFromConcurrentError(
7586+
(exitStatus = recoverFromConcurrentError(
75867587
root,
7587-
originallyAttemptedLanes,
7588+
didTimeout,
75887589
errorRetryLanes
75897590
)));
75907591
}
7591-
if (1 === didTimeout)
7592+
if (1 === exitStatus)
75927593
throw (
75937594
((originalCallbackNode = workInProgressRootFatalError),
75947595
prepareFreshStack(root, 0),
75957596
markRootSuspended(root, lanes),
75967597
ensureRootIsScheduled(root),
75977598
originalCallbackNode)
75987599
);
7599-
if (6 === didTimeout) markRootSuspended(root, lanes);
7600+
if (6 === exitStatus) markRootSuspended(root, lanes);
76007601
else {
76017602
errorRetryLanes = !includesBlockingLane(root, lanes);
7602-
originallyAttemptedLanes = root.current.alternate;
7603+
didTimeout = root.current.alternate;
76037604
if (
76047605
errorRetryLanes &&
7605-
!isRenderConsistentWithExternalStores(originallyAttemptedLanes)
7606+
!isRenderConsistentWithExternalStores(didTimeout)
76067607
) {
7607-
didTimeout = renderRootSync(root, lanes);
7608-
if (2 === didTimeout) {
7608+
exitStatus = renderRootSync(root, lanes);
7609+
if (2 === exitStatus) {
76097610
errorRetryLanes = lanes;
76107611
var errorRetryLanes$96 = getLanesToRetrySynchronouslyOnError(
76117612
root,
76127613
errorRetryLanes
76137614
);
76147615
0 !== errorRetryLanes$96 &&
76157616
((lanes = errorRetryLanes$96),
7616-
(didTimeout = recoverFromConcurrentError(
7617+
(exitStatus = recoverFromConcurrentError(
76177618
root,
76187619
errorRetryLanes,
76197620
errorRetryLanes$96
76207621
)));
76217622
}
7622-
if (1 === didTimeout)
7623+
if (1 === exitStatus)
76237624
throw (
76247625
((originalCallbackNode = workInProgressRootFatalError),
76257626
prepareFreshStack(root, 0),
@@ -7628,10 +7629,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
76287629
originalCallbackNode)
76297630
);
76307631
}
7631-
root.finishedWork = originallyAttemptedLanes;
7632+
root.finishedWork = didTimeout;
76327633
root.finishedLanes = lanes;
76337634
a: {
7634-
switch (didTimeout) {
7635+
switch (exitStatus) {
76357636
case 0:
76367637
case 1:
76377638
throw Error("Root did not complete. This is a bug in React.");
@@ -7650,27 +7651,28 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
76507651
}
76517652
if (
76527653
(lanes & 125829120) === lanes &&
7653-
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
7654-
10 < didTimeout)
7654+
(alwaysThrottleRetries || 3 === exitStatus) &&
7655+
((exitStatus = globalMostRecentFallbackTime + 500 - now()),
7656+
10 < exitStatus)
76557657
) {
76567658
markRootSuspended(root, lanes);
76577659
if (0 !== getNextLanes(root, 0)) break a;
76587660
root.timeoutHandle = scheduleTimeout(
76597661
commitRootWhenReady.bind(
76607662
null,
76617663
root,
7662-
originallyAttemptedLanes,
7664+
didTimeout,
76637665
workInProgressRootRecoverableErrors,
76647666
workInProgressTransitions,
76657667
lanes
76667668
),
7667-
didTimeout
7669+
exitStatus
76687670
);
76697671
break a;
76707672
}
76717673
commitRootWhenReady(
76727674
root,
7673-
originallyAttemptedLanes,
7675+
didTimeout,
76747676
workInProgressRootRecoverableErrors,
76757677
workInProgressTransitions,
76767678
lanes
@@ -9468,7 +9470,7 @@ var roots = new Map(),
94689470
devToolsConfig$jscomp$inline_1045 = {
94699471
findFiberByHostInstance: getInstanceFromNode,
94709472
bundleType: 0,
9471-
version: "18.3.0-next-7f8c501f6-20230420",
9473+
version: "18.3.0-next-d73d7d590-20230420",
94729474
rendererPackageName: "react-native-renderer",
94739475
rendererConfig: {
94749476
getInspectorDataForViewTag: function () {
@@ -9510,7 +9512,7 @@ var internals$jscomp$inline_1276 = {
95109512
scheduleRoot: null,
95119513
setRefreshHandler: null,
95129514
getCurrentFiber: null,
9513-
reconcilerVersion: "18.3.0-next-7f8c501f6-20230420"
9515+
reconcilerVersion: "18.3.0-next-d73d7d590-20230420"
95149516
};
95159517
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95169518
var hook$jscomp$inline_1277 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

0 commit comments

Comments
 (0)