Skip to content

Commit

Permalink
Add a feature flag to enable expiration of retry lanes (#27694)
Browse files Browse the repository at this point in the history
An attempt to see if we can bring back expiration of retry lanes to
avoid cases resolving Suspense can be starved by frequent updates.

In the past, this caused increase browser crashes, but a lot of time has
passed since then. Just trying if we can re-enable this.

Old PR that reverted adding the timeout:
facebook/react#21300

DiffTrain build for [593ecee66a609d4a4c2b36b39b1e5e23b2456dd1](facebook/react@593ecee)
  • Loading branch information
jerrydev0927 committed Nov 14, 2023
1 parent fbe7807 commit 13d1d82
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 48 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
432b9f1d9729aaea010730d546bda89b9842eaa1
593ecee66a609d4a4c2b36b39b1e5e23b2456dd1
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-classic-ff1f37f1";
var ReactVersion = "18.3.0-www-classic-32c0f8a4";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-7fb93a7a";
exports.version = "18.3.0-www-modern-226f03d3";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-c340a59e";
exports.version = "18.3.0-www-modern-b10cb56c";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "18.3.0-www-classic-845b4481";
var ReactVersion = "18.3.0-www-classic-324338d3";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -170,6 +170,7 @@ if (__DEV__) {
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableDeferRootSchedulingToMicrotask =
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
Expand Down Expand Up @@ -2004,7 +2005,7 @@ if (__DEV__) {
// crashes. There must be some other underlying bug; not super urgent but
// ideally should figure out why and fix it. Unfortunately we don't have
// a repro for the crashes, only detected via production metrics.
return NoTimestamp;
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;

case SelectiveHydrationLane:
case IdleHydrationLane:
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "18.3.0-www-modern-b4d8ae24";
var ReactVersion = "18.3.0-www-modern-7ac3e370";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -170,6 +170,7 @@ if (__DEV__) {
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableDeferRootSchedulingToMicrotask =
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
Expand Down Expand Up @@ -2001,7 +2002,7 @@ if (__DEV__) {
// crashes. There must be some other underlying bug; not super urgent but
// ideally should figure out why and fix it. Unfortunately we don't have
// a repro for the crashes, only detected via production metrics.
return NoTimestamp;
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;

case SelectiveHydrationLane:
case IdleHydrationLane:
Expand Down
7 changes: 4 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var ReactSharedInternals =
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableDeferRootSchedulingToMicrotask =
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
Expand Down Expand Up @@ -505,7 +506,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -10235,7 +10236,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-f80f5bf8",
version: "18.3.0-www-classic-61fbad1d",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1322 = {
Expand Down Expand Up @@ -10266,7 +10267,7 @@ var internals$jscomp$inline_1322 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-f80f5bf8"
reconcilerVersion: "18.3.0-www-classic-61fbad1d"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1323 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
7 changes: 4 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var ReactSharedInternals =
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableDeferRootSchedulingToMicrotask =
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
Expand Down Expand Up @@ -393,7 +394,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -9904,7 +9905,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-d15e6948",
version: "18.3.0-www-modern-fc53dc79",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1302 = {
Expand Down Expand Up @@ -9935,7 +9936,7 @@ var internals$jscomp$inline_1302 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-d15e6948"
reconcilerVersion: "18.3.0-www-modern-fc53dc79"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1303 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ if (__DEV__) {
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -2174,7 +2175,7 @@ if (__DEV__) {
// crashes. There must be some other underlying bug; not super urgent but
// ideally should figure out why and fix it. Unfortunately we don't have
// a repro for the crashes, only detected via production metrics.
return NoTimestamp;
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;

case SelectiveHydrationLane:
case IdleHydrationLane:
Expand Down Expand Up @@ -34884,7 +34885,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-classic-d456dfab";
var ReactVersion = "18.3.0-www-classic-b7cd3754";

function createPortal$1(
children,
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ if (__DEV__) {
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -1529,7 +1530,7 @@ if (__DEV__) {
// crashes. There must be some other underlying bug; not super urgent but
// ideally should figure out why and fix it. Unfortunately we don't have
// a repro for the crashes, only detected via production metrics.
return NoTimestamp;
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;

case SelectiveHydrationLane:
case IdleHydrationLane:
Expand Down Expand Up @@ -34705,7 +34706,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-modern-81cc9bc4";
var ReactVersion = "18.3.0-www-modern-04110a6d";

function createPortal$1(
children,
Expand Down
9 changes: 5 additions & 4 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var ReactSharedInternals =
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -549,7 +550,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -16539,7 +16540,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1796 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-a25c651c",
version: "18.3.0-www-classic-55fb1194",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2142 = {
Expand Down Expand Up @@ -16569,7 +16570,7 @@ var internals$jscomp$inline_2142 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-a25c651c"
reconcilerVersion: "18.3.0-www-classic-55fb1194"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2143 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16906,4 +16907,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-classic-a25c651c";
exports.version = "18.3.0-www-classic-55fb1194";
9 changes: 5 additions & 4 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var assign = Object.assign,
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -311,7 +312,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -16065,7 +16066,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1755 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-42ac5998",
version: "18.3.0-www-modern-5b908043",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2106 = {
Expand Down Expand Up @@ -16096,7 +16097,7 @@ var internals$jscomp$inline_2106 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-42ac5998"
reconcilerVersion: "18.3.0-www-modern-5b908043"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2107 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16361,4 +16362,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-modern-42ac5998";
exports.version = "18.3.0-www-modern-5b908043";
9 changes: 5 additions & 4 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var ReactSharedInternals =
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -657,7 +658,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -17308,7 +17309,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1881 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-30fe3ed5",
version: "18.3.0-www-classic-48ec6736",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -17352,7 +17353,7 @@ var devToolsConfig$jscomp$inline_1881 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-30fe3ed5"
reconcilerVersion: "18.3.0-www-classic-48ec6736"
});
assign(Internals, {
ReactBrowserEventEmitter: {
Expand Down Expand Up @@ -17676,7 +17677,7 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-classic-30fe3ed5";
exports.version = "18.3.0-www-classic-48ec6736";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
9 changes: 5 additions & 4 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var assign = Object.assign,
enableLazyContextPropagation =
dynamicFeatureFlags.enableLazyContextPropagation,
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableCustomElementPropertySupport =
dynamicFeatureFlags.enableCustomElementPropertySupport,
Expand Down Expand Up @@ -419,7 +420,7 @@ function computeExpirationTime(lane, currentTime) {
case 8388608:
case 16777216:
case 33554432:
return -1;
return enableRetryLaneExpiration ? currentTime + 5e3 : -1;
case 67108864:
case 134217728:
case 268435456:
Expand Down Expand Up @@ -16828,7 +16829,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1840 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-63d98969",
version: "18.3.0-www-modern-3c3305d8",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -16873,7 +16874,7 @@ var devToolsConfig$jscomp$inline_1840 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-63d98969"
reconcilerVersion: "18.3.0-www-modern-3c3305d8"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
Expand Down Expand Up @@ -17125,7 +17126,7 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-modern-63d98969";
exports.version = "18.3.0-www-modern-3c3305d8";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

var ReactVersion = "18.3.0-www-modern-b4d8ae24";
var ReactVersion = "18.3.0-www-modern-7ac3e370";

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -5343,4 +5343,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-modern-d15e6948";
exports.version = "18.3.0-www-modern-fc53dc79";
Loading

0 comments on commit 13d1d82

Please sign in to comment.