Skip to content

Commit 9996001

Browse files
committed
Add feature flags for expiration times (#27821)
It seems worthwhile to me to run a test to experiment with different expiration times. This moves the expiration times for scheduler and reconciler into FeatureFlags for the facebook build. Non-facebook should not be affected by these changes. DiffTrain build for [0cdfef1](0cdfef1)
1 parent da417b2 commit 9996001

33 files changed

+252
-147
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
40f653d13c363c6f81b13de67ce391991fb1f870
1+
0cdfef19b96cc6202d48e0812b5069c286d12b04

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-classic-a5f5272e";
27+
var ReactVersion = "18.3.0-www-classic-fc109ac4";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-modern-91ed18e8";
27+
var ReactVersion = "18.3.0-www-modern-7daa3def";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,4 +587,4 @@ exports.useSyncExternalStore = function (
587587
exports.useTransition = function () {
588588
return ReactCurrentDispatcher.current.useTransition();
589589
};
590-
exports.version = "18.3.0-www-classic-786e33e5";
590+
exports.version = "18.3.0-www-classic-dd7a0299";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,4 +579,4 @@ exports.useSyncExternalStore = function (
579579
exports.useTransition = function () {
580580
return ReactCurrentDispatcher.current.useTransition();
581581
};
582-
exports.version = "18.3.0-www-modern-b4366971";
582+
exports.version = "18.3.0-www-modern-ffad6601";

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-classic-a377dc6f";
69+
var ReactVersion = "18.3.0-www-classic-cb4986de";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -181,7 +181,11 @@ if (__DEV__) {
181181
disableSchedulerTimeoutInWorkLoop =
182182
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
183183
enableUseDeferredValueInitialArg =
184-
dynamicFeatureFlags.enableUseDeferredValueInitialArg; // On WWW, false is used for a new modern build.
184+
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
185+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
186+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
187+
transitionLaneExpirationMs =
188+
dynamicFeatureFlags.transitionLaneExpirationMs; // On WWW, false is used for a new modern build.
185189
var enableProfilerTimer = true;
186190
var enableProfilerCommitHooks = true;
187191
var enableProfilerNestedUpdatePhase = true;
@@ -1974,7 +1978,7 @@ if (__DEV__) {
19741978
// to fix the starvation. However, this scenario supports the idea that
19751979
// expiration times are an important safeguard when starvation
19761980
// does happen.
1977-
return currentTime + 250;
1981+
return currentTime + syncLaneExpirationMs;
19781982

19791983
case DefaultHydrationLane:
19801984
case DefaultLane:
@@ -1994,7 +1998,7 @@ if (__DEV__) {
19941998
case TransitionLane13:
19951999
case TransitionLane14:
19962000
case TransitionLane15:
1997-
return currentTime + 5000;
2001+
return currentTime + transitionLaneExpirationMs;
19982002

19992003
case RetryLane1:
20002004
case RetryLane2:
@@ -2005,7 +2009,9 @@ if (__DEV__) {
20052009
// crashes. There must be some other underlying bug; not super urgent but
20062010
// ideally should figure out why and fix it. Unfortunately we don't have
20072011
// a repro for the crashes, only detected via production metrics.
2008-
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;
2012+
return enableRetryLaneExpiration
2013+
? currentTime + retryLaneExpirationMs
2014+
: NoTimestamp;
20092015

20102016
case SelectiveHydrationLane:
20112017
case IdleHydrationLane:

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-modern-10e22a22";
69+
var ReactVersion = "18.3.0-www-modern-0a58ac99";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -181,7 +181,11 @@ if (__DEV__) {
181181
disableSchedulerTimeoutInWorkLoop =
182182
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
183183
enableUseDeferredValueInitialArg =
184-
dynamicFeatureFlags.enableUseDeferredValueInitialArg; // On WWW, true is used for a new modern build.
184+
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
185+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
186+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
187+
transitionLaneExpirationMs =
188+
dynamicFeatureFlags.transitionLaneExpirationMs; // On WWW, true is used for a new modern build.
185189
var enableProfilerTimer = true;
186190
var enableProfilerCommitHooks = true;
187191
var enableProfilerNestedUpdatePhase = true;
@@ -1971,7 +1975,7 @@ if (__DEV__) {
19711975
// to fix the starvation. However, this scenario supports the idea that
19721976
// expiration times are an important safeguard when starvation
19731977
// does happen.
1974-
return currentTime + 250;
1978+
return currentTime + syncLaneExpirationMs;
19751979

19761980
case DefaultHydrationLane:
19771981
case DefaultLane:
@@ -1991,7 +1995,7 @@ if (__DEV__) {
19911995
case TransitionLane13:
19921996
case TransitionLane14:
19931997
case TransitionLane15:
1994-
return currentTime + 5000;
1998+
return currentTime + transitionLaneExpirationMs;
19951999

19962000
case RetryLane1:
19972001
case RetryLane2:
@@ -2002,7 +2006,9 @@ if (__DEV__) {
20022006
// crashes. There must be some other underlying bug; not super urgent but
20032007
// ideally should figure out why and fix it. Unfortunately we don't have
20042008
// a repro for the crashes, only detected via production metrics.
2005-
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;
2009+
return enableRetryLaneExpiration
2010+
? currentTime + retryLaneExpirationMs
2011+
: NoTimestamp;
20062012

20072013
case SelectiveHydrationLane:
20082014
case IdleHydrationLane:

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ var ReactSharedInternals =
8080
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
8181
enableUseDeferredValueInitialArg =
8282
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
83+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
84+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
85+
transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs,
8386
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
8487
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
8588
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -482,7 +485,7 @@ function computeExpirationTime(lane, currentTime) {
482485
case 2:
483486
case 4:
484487
case 8:
485-
return currentTime + 250;
488+
return currentTime + syncLaneExpirationMs;
486489
case 16:
487490
case 32:
488491
case 64:
@@ -501,12 +504,14 @@ function computeExpirationTime(lane, currentTime) {
501504
case 524288:
502505
case 1048576:
503506
case 2097152:
504-
return currentTime + 5e3;
507+
return currentTime + transitionLaneExpirationMs;
505508
case 4194304:
506509
case 8388608:
507510
case 16777216:
508511
case 33554432:
509-
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
512+
return enableRetryLaneExpiration
513+
? currentTime + retryLaneExpirationMs
514+
: -1;
510515
case 67108864:
511516
case 134217728:
512517
case 268435456:
@@ -10239,7 +10244,7 @@ var slice = Array.prototype.slice,
1023910244
return null;
1024010245
},
1024110246
bundleType: 0,
10242-
version: "18.3.0-www-classic-62f2e6c9",
10247+
version: "18.3.0-www-classic-5245c95b",
1024310248
rendererPackageName: "react-art"
1024410249
};
1024510250
var internals$jscomp$inline_1322 = {
@@ -10270,7 +10275,7 @@ var internals$jscomp$inline_1322 = {
1027010275
scheduleRoot: null,
1027110276
setRefreshHandler: null,
1027210277
getCurrentFiber: null,
10273-
reconcilerVersion: "18.3.0-www-classic-62f2e6c9"
10278+
reconcilerVersion: "18.3.0-www-classic-5245c95b"
1027410279
};
1027510280
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1027610281
var hook$jscomp$inline_1323 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactART-prod.modern.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ var ReactSharedInternals =
8080
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
8181
enableUseDeferredValueInitialArg =
8282
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
83+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
84+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
85+
transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs,
8386
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
8487
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
8588
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -370,7 +373,7 @@ function computeExpirationTime(lane, currentTime) {
370373
case 2:
371374
case 4:
372375
case 8:
373-
return currentTime + 250;
376+
return currentTime + syncLaneExpirationMs;
374377
case 16:
375378
case 32:
376379
case 64:
@@ -389,12 +392,14 @@ function computeExpirationTime(lane, currentTime) {
389392
case 524288:
390393
case 1048576:
391394
case 2097152:
392-
return currentTime + 5e3;
395+
return currentTime + transitionLaneExpirationMs;
393396
case 4194304:
394397
case 8388608:
395398
case 16777216:
396399
case 33554432:
397-
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
400+
return enableRetryLaneExpiration
401+
? currentTime + retryLaneExpirationMs
402+
: -1;
398403
case 67108864:
399404
case 134217728:
400405
case 268435456:
@@ -9908,7 +9913,7 @@ var slice = Array.prototype.slice,
99089913
return null;
99099914
},
99109915
bundleType: 0,
9911-
version: "18.3.0-www-modern-bc6ddf84",
9916+
version: "18.3.0-www-modern-6fb46ffb",
99129917
rendererPackageName: "react-art"
99139918
};
99149919
var internals$jscomp$inline_1302 = {
@@ -9939,7 +9944,7 @@ var internals$jscomp$inline_1302 = {
99399944
scheduleRoot: null,
99409945
setRefreshHandler: null,
99419946
getCurrentFiber: null,
9942-
reconcilerVersion: "18.3.0-www-modern-bc6ddf84"
9947+
reconcilerVersion: "18.3.0-www-modern-6fb46ffb"
99439948
};
99449949
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
99459950
var hook$jscomp$inline_1303 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ if (__DEV__) {
148148
disableSchedulerTimeoutInWorkLoop =
149149
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
150150
enableUseDeferredValueInitialArg =
151-
dynamicFeatureFlags.enableUseDeferredValueInitialArg; // On WWW, false is used for a new modern build.
151+
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
152+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
153+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
154+
transitionLaneExpirationMs =
155+
dynamicFeatureFlags.transitionLaneExpirationMs; // On WWW, false is used for a new modern build.
152156
var enableProfilerTimer = true;
153157
var enableProfilerCommitHooks = true;
154158
var enableProfilerNestedUpdatePhase = true;
@@ -2143,7 +2147,7 @@ if (__DEV__) {
21432147
// to fix the starvation. However, this scenario supports the idea that
21442148
// expiration times are an important safeguard when starvation
21452149
// does happen.
2146-
return currentTime + 250;
2150+
return currentTime + syncLaneExpirationMs;
21472151

21482152
case DefaultHydrationLane:
21492153
case DefaultLane:
@@ -2163,7 +2167,7 @@ if (__DEV__) {
21632167
case TransitionLane13:
21642168
case TransitionLane14:
21652169
case TransitionLane15:
2166-
return currentTime + 5000;
2170+
return currentTime + transitionLaneExpirationMs;
21672171

21682172
case RetryLane1:
21692173
case RetryLane2:
@@ -2174,7 +2178,9 @@ if (__DEV__) {
21742178
// crashes. There must be some other underlying bug; not super urgent but
21752179
// ideally should figure out why and fix it. Unfortunately we don't have
21762180
// a repro for the crashes, only detected via production metrics.
2177-
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;
2181+
return enableRetryLaneExpiration
2182+
? currentTime + retryLaneExpirationMs
2183+
: NoTimestamp;
21782184

21792185
case SelectiveHydrationLane:
21802186
case IdleHydrationLane:
@@ -34893,7 +34899,7 @@ if (__DEV__) {
3489334899
return root;
3489434900
}
3489534901

34896-
var ReactVersion = "18.3.0-www-classic-d008a2fd";
34902+
var ReactVersion = "18.3.0-www-classic-4331ed0d";
3489734903

3489834904
function createPortal$1(
3489934905
children,

compiled/facebook-www/ReactDOM-dev.modern.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ if (__DEV__) {
134134
disableSchedulerTimeoutInWorkLoop =
135135
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
136136
enableUseDeferredValueInitialArg =
137-
dynamicFeatureFlags.enableUseDeferredValueInitialArg; // On WWW, true is used for a new modern build.
137+
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
138+
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
139+
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
140+
transitionLaneExpirationMs =
141+
dynamicFeatureFlags.transitionLaneExpirationMs; // On WWW, true is used for a new modern build.
138142
var enableProfilerTimer = true;
139143
var enableProfilerCommitHooks = true;
140144
var enableProfilerNestedUpdatePhase = true;
@@ -1498,7 +1502,7 @@ if (__DEV__) {
14981502
// to fix the starvation. However, this scenario supports the idea that
14991503
// expiration times are an important safeguard when starvation
15001504
// does happen.
1501-
return currentTime + 250;
1505+
return currentTime + syncLaneExpirationMs;
15021506

15031507
case DefaultHydrationLane:
15041508
case DefaultLane:
@@ -1518,7 +1522,7 @@ if (__DEV__) {
15181522
case TransitionLane13:
15191523
case TransitionLane14:
15201524
case TransitionLane15:
1521-
return currentTime + 5000;
1525+
return currentTime + transitionLaneExpirationMs;
15221526

15231527
case RetryLane1:
15241528
case RetryLane2:
@@ -1529,7 +1533,9 @@ if (__DEV__) {
15291533
// crashes. There must be some other underlying bug; not super urgent but
15301534
// ideally should figure out why and fix it. Unfortunately we don't have
15311535
// a repro for the crashes, only detected via production metrics.
1532-
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;
1536+
return enableRetryLaneExpiration
1537+
? currentTime + retryLaneExpirationMs
1538+
: NoTimestamp;
15331539

15341540
case SelectiveHydrationLane:
15351541
case IdleHydrationLane:
@@ -34714,7 +34720,7 @@ if (__DEV__) {
3471434720
return root;
3471534721
}
3471634722

34717-
var ReactVersion = "18.3.0-www-modern-c3c79046";
34723+
var ReactVersion = "18.3.0-www-modern-67189941";
3471834724

3471934725
function createPortal$1(
3472034726
children,

0 commit comments

Comments
 (0)