Skip to content

Commit 8e6990e

Browse files
committed
Temporarily disable suspending during work loop (#30762)
### Based on - #30761 - #30759 --- `use` has an optimization where in some cases it can suspend the work loop during the render phase until the data has resolved, rather than unwind the stack and lose context. However, the current implementation is not compatible with sibling prerendering. So I've temporarily disabled it until the sibling prerendering has been refactored. We will add it back in a later step. DiffTrain build for [8b4c54c](8b4c54c)
1 parent 4b439b0 commit 8e6990e

34 files changed

+214
-150
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8d68da3f7396064614f34b84881fe8833b6039ac
1+
8b4c54c00f5c047a72a4cecc2689196786c3e5ff
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8d68da3f7396064614f34b84881fe8833b6039ac
1+
8b4c54c00f5c047a72a4cecc2689196786c3e5ff

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ __DEV__ &&
20012001
exports.useTransition = function () {
20022002
return resolveDispatcher().useTransition();
20032003
};
2004-
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
2004+
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
20052005
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20062006
"function" ===
20072007
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ __DEV__ &&
19811981
exports.useTransition = function () {
19821982
return resolveDispatcher().useTransition();
19831983
};
1984-
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
1984+
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
19851985
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19861986
"function" ===
19871987
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
668+
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
668+
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
672+
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
672+
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12726,20 +12726,28 @@ __DEV__ &&
1272612726
resetCurrentFiber();
1272712727
if (thrownValue === SuspenseException) {
1272812728
thrownValue = getSuspendedThenable();
12729-
var handler = suspenseHandlerStackCursor.current;
12729+
var JSCompiler_temp;
12730+
if ((JSCompiler_temp = !enableSiblingPrerendering))
12731+
(JSCompiler_temp = suspenseHandlerStackCursor.current),
12732+
(JSCompiler_temp =
12733+
null === JSCompiler_temp
12734+
? !0
12735+
: (workInProgressRootRenderLanes & 4194176) ===
12736+
workInProgressRootRenderLanes
12737+
? null === shellBoundary
12738+
? !0
12739+
: !1
12740+
: (workInProgressRootRenderLanes & 62914560) ===
12741+
workInProgressRootRenderLanes ||
12742+
0 !== (workInProgressRootRenderLanes & 536870912)
12743+
? JSCompiler_temp === shellBoundary
12744+
: !1);
1273012745
workInProgressSuspendedReason =
12731-
(null !== handler &&
12732-
((workInProgressRootRenderLanes & 4194176) ===
12733-
workInProgressRootRenderLanes
12734-
? null !== shellBoundary
12735-
: ((workInProgressRootRenderLanes & 62914560) !==
12736-
workInProgressRootRenderLanes &&
12737-
0 === (workInProgressRootRenderLanes & 536870912)) ||
12738-
handler !== shellBoundary)) ||
12739-
0 !== (workInProgressRootSkippedLanes & 134217727) ||
12740-
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
12741-
? SuspendedOnImmediate
12742-
: SuspendedOnData;
12746+
JSCompiler_temp &&
12747+
0 === (workInProgressRootSkippedLanes & 134217727) &&
12748+
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
12749+
? SuspendedOnData
12750+
: SuspendedOnImmediate;
1274312751
} else
1274412752
thrownValue === SuspenseyCommitException
1274512753
? ((thrownValue = getSuspendedThenable()),
@@ -12753,16 +12761,16 @@ __DEV__ &&
1275312761
? SuspendedOnDeprecatedThrowPromise
1275412762
: SuspendedOnError);
1275512763
workInProgressThrownValue = thrownValue;
12756-
handler = workInProgress;
12757-
if (null === handler)
12764+
JSCompiler_temp = workInProgress;
12765+
if (null === JSCompiler_temp)
1275812766
(workInProgressRootExitStatus = RootFatalErrored),
1275912767
logUncaughtError(
1276012768
root,
1276112769
createCapturedValueAtFiber(thrownValue, root.current)
1276212770
);
1276312771
else if (
12764-
(handler.mode & 2 &&
12765-
stopProfilerTimerIfRunningAndRecordDelta(handler, !0),
12772+
(JSCompiler_temp.mode & 2 &&
12773+
stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0),
1276612774
enableSchedulingProfiler)
1276712775
)
1276812776
switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) {
@@ -12772,7 +12780,7 @@ __DEV__ &&
1277212780
"function" ===
1277312781
typeof injectedProfilingHooks.markComponentErrored &&
1277412782
injectedProfilingHooks.markComponentErrored(
12775-
handler,
12783+
JSCompiler_temp,
1277612784
thrownValue,
1277712785
workInProgressRootRenderLanes
1277812786
);
@@ -12786,7 +12794,7 @@ __DEV__ &&
1278612794
"function" ===
1278712795
typeof injectedProfilingHooks.markComponentSuspended &&
1278812796
injectedProfilingHooks.markComponentSuspended(
12789-
handler,
12797+
JSCompiler_temp,
1279012798
thrownValue,
1279112799
workInProgressRootRenderLanes
1279212800
);
@@ -14617,6 +14625,7 @@ __DEV__ &&
1461714625
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
1461814626
transitionLaneExpirationMs =
1461914627
dynamicFeatureFlags.transitionLaneExpirationMs,
14628+
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
1462014629
enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler,
1462114630
disableLegacyMode = dynamicFeatureFlags.disableLegacyMode,
1462214631
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
@@ -16807,11 +16816,11 @@ __DEV__ &&
1680716816
(function () {
1680816817
var internals = {
1680916818
bundleType: 1,
16810-
version: "19.0.0-www-classic-8d68da3f-20240903",
16819+
version: "19.0.0-www-classic-8b4c54c0-20240904",
1681116820
rendererPackageName: "react-art",
1681216821
currentDispatcherRef: ReactSharedInternals,
1681316822
findFiberByHostInstance: getInstanceFromNode,
16814-
reconcilerVersion: "19.0.0-www-classic-8d68da3f-20240903"
16823+
reconcilerVersion: "19.0.0-www-classic-8b4c54c0-20240904"
1681516824
};
1681616825
internals.overrideHookState = overrideHookState;
1681716826
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16845,7 +16854,7 @@ __DEV__ &&
1684516854
exports.Shape = Shape;
1684616855
exports.Surface = Surface;
1684716856
exports.Text = Text;
16848-
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
16857+
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
1684916858
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1685016859
"function" ===
1685116860
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12242,20 +12242,28 @@ __DEV__ &&
1224212242
resetCurrentFiber();
1224312243
if (thrownValue === SuspenseException) {
1224412244
thrownValue = getSuspendedThenable();
12245-
var handler = suspenseHandlerStackCursor.current;
12245+
var JSCompiler_temp;
12246+
if ((JSCompiler_temp = !enableSiblingPrerendering))
12247+
(JSCompiler_temp = suspenseHandlerStackCursor.current),
12248+
(JSCompiler_temp =
12249+
null === JSCompiler_temp
12250+
? !0
12251+
: (workInProgressRootRenderLanes & 4194176) ===
12252+
workInProgressRootRenderLanes
12253+
? null === shellBoundary
12254+
? !0
12255+
: !1
12256+
: (workInProgressRootRenderLanes & 62914560) ===
12257+
workInProgressRootRenderLanes ||
12258+
0 !== (workInProgressRootRenderLanes & 536870912)
12259+
? JSCompiler_temp === shellBoundary
12260+
: !1);
1224612261
workInProgressSuspendedReason =
12247-
(null !== handler &&
12248-
((workInProgressRootRenderLanes & 4194176) ===
12249-
workInProgressRootRenderLanes
12250-
? null !== shellBoundary
12251-
: ((workInProgressRootRenderLanes & 62914560) !==
12252-
workInProgressRootRenderLanes &&
12253-
0 === (workInProgressRootRenderLanes & 536870912)) ||
12254-
handler !== shellBoundary)) ||
12255-
0 !== (workInProgressRootSkippedLanes & 134217727) ||
12256-
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
12257-
? SuspendedOnImmediate
12258-
: SuspendedOnData;
12262+
JSCompiler_temp &&
12263+
0 === (workInProgressRootSkippedLanes & 134217727) &&
12264+
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
12265+
? SuspendedOnData
12266+
: SuspendedOnImmediate;
1225912267
} else
1226012268
thrownValue === SuspenseyCommitException
1226112269
? ((thrownValue = getSuspendedThenable()),
@@ -12269,16 +12277,16 @@ __DEV__ &&
1226912277
? SuspendedOnDeprecatedThrowPromise
1227012278
: SuspendedOnError);
1227112279
workInProgressThrownValue = thrownValue;
12272-
handler = workInProgress;
12273-
if (null === handler)
12280+
JSCompiler_temp = workInProgress;
12281+
if (null === JSCompiler_temp)
1227412282
(workInProgressRootExitStatus = RootFatalErrored),
1227512283
logUncaughtError(
1227612284
root,
1227712285
createCapturedValueAtFiber(thrownValue, root.current)
1227812286
);
1227912287
else if (
12280-
(handler.mode & 2 &&
12281-
stopProfilerTimerIfRunningAndRecordDelta(handler, !0),
12288+
(JSCompiler_temp.mode & 2 &&
12289+
stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0),
1228212290
enableSchedulingProfiler)
1228312291
)
1228412292
switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) {
@@ -12288,7 +12296,7 @@ __DEV__ &&
1228812296
"function" ===
1228912297
typeof injectedProfilingHooks.markComponentErrored &&
1229012298
injectedProfilingHooks.markComponentErrored(
12291-
handler,
12299+
JSCompiler_temp,
1229212300
thrownValue,
1229312301
workInProgressRootRenderLanes
1229412302
);
@@ -12302,7 +12310,7 @@ __DEV__ &&
1230212310
"function" ===
1230312311
typeof injectedProfilingHooks.markComponentSuspended &&
1230412312
injectedProfilingHooks.markComponentSuspended(
12305-
handler,
12313+
JSCompiler_temp,
1230612314
thrownValue,
1230712315
workInProgressRootRenderLanes
1230812316
);
@@ -14026,6 +14034,7 @@ __DEV__ &&
1402614034
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
1402714035
transitionLaneExpirationMs =
1402814036
dynamicFeatureFlags.transitionLaneExpirationMs,
14037+
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
1402914038
enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler,
1403014039
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
1403114040
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -16220,11 +16229,11 @@ __DEV__ &&
1622016229
(function () {
1622116230
var internals = {
1622216231
bundleType: 1,
16223-
version: "19.0.0-www-modern-8d68da3f-20240903",
16232+
version: "19.0.0-www-modern-8b4c54c0-20240904",
1622416233
rendererPackageName: "react-art",
1622516234
currentDispatcherRef: ReactSharedInternals,
1622616235
findFiberByHostInstance: getInstanceFromNode,
16227-
reconcilerVersion: "19.0.0-www-modern-8d68da3f-20240903"
16236+
reconcilerVersion: "19.0.0-www-modern-8b4c54c0-20240904"
1622816237
};
1622916238
internals.overrideHookState = overrideHookState;
1623016239
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16258,7 +16267,7 @@ __DEV__ &&
1625816267
exports.Shape = Shape;
1625916268
exports.Surface = Surface;
1626016269
exports.Text = Text;
16261-
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
16270+
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
1626216271
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1626316272
"function" ===
1626416273
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
8383
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
8484
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
8585
transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs,
86+
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
8687
disableLegacyMode = dynamicFeatureFlags.disableLegacyMode,
8788
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
8889
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -9415,20 +9416,28 @@ function handleThrow(root, thrownValue) {
94159416
current = null;
94169417
if (thrownValue === SuspenseException) {
94179418
thrownValue = getSuspendedThenable();
9418-
var handler = suspenseHandlerStackCursor.current;
9419+
var JSCompiler_temp;
9420+
if ((JSCompiler_temp = !enableSiblingPrerendering))
9421+
(JSCompiler_temp = suspenseHandlerStackCursor.current),
9422+
(JSCompiler_temp =
9423+
null === JSCompiler_temp
9424+
? !0
9425+
: (workInProgressRootRenderLanes & 4194176) ===
9426+
workInProgressRootRenderLanes
9427+
? null === shellBoundary
9428+
? !0
9429+
: !1
9430+
: (workInProgressRootRenderLanes & 62914560) ===
9431+
workInProgressRootRenderLanes ||
9432+
0 !== (workInProgressRootRenderLanes & 536870912)
9433+
? JSCompiler_temp === shellBoundary
9434+
: !1);
94199435
workInProgressSuspendedReason =
9420-
(null !== handler &&
9421-
((workInProgressRootRenderLanes & 4194176) ===
9422-
workInProgressRootRenderLanes
9423-
? null !== shellBoundary
9424-
: ((workInProgressRootRenderLanes & 62914560) !==
9425-
workInProgressRootRenderLanes &&
9426-
0 === (workInProgressRootRenderLanes & 536870912)) ||
9427-
handler !== shellBoundary)) ||
9428-
0 !== (workInProgressRootSkippedLanes & 134217727) ||
9429-
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
9430-
? 3
9431-
: 2;
9436+
JSCompiler_temp &&
9437+
0 === (workInProgressRootSkippedLanes & 134217727) &&
9438+
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
9439+
? 2
9440+
: 3;
94329441
} else
94339442
thrownValue === SuspenseyCommitException
94349443
? ((thrownValue = getSuspendedThenable()),
@@ -10638,13 +10647,13 @@ var slice = Array.prototype.slice,
1063810647
})(React.Component);
1063910648
var internals$jscomp$inline_1371 = {
1064010649
bundleType: 0,
10641-
version: "19.0.0-www-classic-8d68da3f-20240903",
10650+
version: "19.0.0-www-classic-8b4c54c0-20240904",
1064210651
rendererPackageName: "react-art",
1064310652
currentDispatcherRef: ReactSharedInternals,
1064410653
findFiberByHostInstance: function () {
1064510654
return null;
1064610655
},
10647-
reconcilerVersion: "19.0.0-www-classic-8d68da3f-20240903"
10656+
reconcilerVersion: "19.0.0-www-classic-8b4c54c0-20240904"
1064810657
};
1064910658
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1065010659
var hook$jscomp$inline_1372 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10670,4 +10679,4 @@ exports.RadialGradient = RadialGradient;
1067010679
exports.Shape = TYPES.SHAPE;
1067110680
exports.Surface = Surface;
1067210681
exports.Text = Text;
10673-
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
10682+
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";

0 commit comments

Comments
 (0)