Skip to content

Commit

Permalink
Temporarily disable suspending during work loop (#30762)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
acdlite committed Sep 4, 2024
1 parent 4b439b0 commit 8e6990e
Show file tree
Hide file tree
Showing 34 changed files with 214 additions and 150 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8d68da3f7396064614f34b84881fe8833b6039ac
8b4c54c00f5c047a72a4cecc2689196786c3e5ff
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8d68da3f7396064614f34b84881fe8833b6039ac
8b4c54c00f5c047a72a4cecc2689196786c3e5ff
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 @@ -2001,7 +2001,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
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 @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
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 @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
53 changes: 31 additions & 22 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12726,20 +12726,28 @@ __DEV__ &&
resetCurrentFiber();
if (thrownValue === SuspenseException) {
thrownValue = getSuspendedThenable();
var handler = suspenseHandlerStackCursor.current;
var JSCompiler_temp;
if ((JSCompiler_temp = !enableSiblingPrerendering))
(JSCompiler_temp = suspenseHandlerStackCursor.current),
(JSCompiler_temp =
null === JSCompiler_temp
? !0
: (workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 62914560) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 536870912)
? JSCompiler_temp === shellBoundary
: !1);
workInProgressSuspendedReason =
(null !== handler &&
((workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null !== shellBoundary
: ((workInProgressRootRenderLanes & 62914560) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 536870912)) ||
handler !== shellBoundary)) ||
0 !== (workInProgressRootSkippedLanes & 134217727) ||
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
? SuspendedOnImmediate
: SuspendedOnData;
JSCompiler_temp &&
0 === (workInProgressRootSkippedLanes & 134217727) &&
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
? SuspendedOnData
: SuspendedOnImmediate;
} else
thrownValue === SuspenseyCommitException
? ((thrownValue = getSuspendedThenable()),
Expand All @@ -12753,16 +12761,16 @@ __DEV__ &&
? SuspendedOnDeprecatedThrowPromise
: SuspendedOnError);
workInProgressThrownValue = thrownValue;
handler = workInProgress;
if (null === handler)
JSCompiler_temp = workInProgress;
if (null === JSCompiler_temp)
(workInProgressRootExitStatus = RootFatalErrored),
logUncaughtError(
root,
createCapturedValueAtFiber(thrownValue, root.current)
);
else if (
(handler.mode & 2 &&
stopProfilerTimerIfRunningAndRecordDelta(handler, !0),
(JSCompiler_temp.mode & 2 &&
stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0),
enableSchedulingProfiler)
)
switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) {
Expand All @@ -12772,7 +12780,7 @@ __DEV__ &&
"function" ===
typeof injectedProfilingHooks.markComponentErrored &&
injectedProfilingHooks.markComponentErrored(
handler,
JSCompiler_temp,
thrownValue,
workInProgressRootRenderLanes
);
Expand All @@ -12786,7 +12794,7 @@ __DEV__ &&
"function" ===
typeof injectedProfilingHooks.markComponentSuspended &&
injectedProfilingHooks.markComponentSuspended(
handler,
JSCompiler_temp,
thrownValue,
workInProgressRootRenderLanes
);
Expand Down Expand Up @@ -14617,6 +14625,7 @@ __DEV__ &&
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
transitionLaneExpirationMs =
dynamicFeatureFlags.transitionLaneExpirationMs,
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler,
disableLegacyMode = dynamicFeatureFlags.disableLegacyMode,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
Expand Down Expand Up @@ -16807,11 +16816,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-8d68da3f-20240903",
version: "19.0.0-www-classic-8b4c54c0-20240904",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-8d68da3f-20240903"
reconcilerVersion: "19.0.0-www-classic-8b4c54c0-20240904"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16845,7 +16854,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
53 changes: 31 additions & 22 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -12242,20 +12242,28 @@ __DEV__ &&
resetCurrentFiber();
if (thrownValue === SuspenseException) {
thrownValue = getSuspendedThenable();
var handler = suspenseHandlerStackCursor.current;
var JSCompiler_temp;
if ((JSCompiler_temp = !enableSiblingPrerendering))
(JSCompiler_temp = suspenseHandlerStackCursor.current),
(JSCompiler_temp =
null === JSCompiler_temp
? !0
: (workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 62914560) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 536870912)
? JSCompiler_temp === shellBoundary
: !1);
workInProgressSuspendedReason =
(null !== handler &&
((workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null !== shellBoundary
: ((workInProgressRootRenderLanes & 62914560) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 536870912)) ||
handler !== shellBoundary)) ||
0 !== (workInProgressRootSkippedLanes & 134217727) ||
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
? SuspendedOnImmediate
: SuspendedOnData;
JSCompiler_temp &&
0 === (workInProgressRootSkippedLanes & 134217727) &&
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
? SuspendedOnData
: SuspendedOnImmediate;
} else
thrownValue === SuspenseyCommitException
? ((thrownValue = getSuspendedThenable()),
Expand All @@ -12269,16 +12277,16 @@ __DEV__ &&
? SuspendedOnDeprecatedThrowPromise
: SuspendedOnError);
workInProgressThrownValue = thrownValue;
handler = workInProgress;
if (null === handler)
JSCompiler_temp = workInProgress;
if (null === JSCompiler_temp)
(workInProgressRootExitStatus = RootFatalErrored),
logUncaughtError(
root,
createCapturedValueAtFiber(thrownValue, root.current)
);
else if (
(handler.mode & 2 &&
stopProfilerTimerIfRunningAndRecordDelta(handler, !0),
(JSCompiler_temp.mode & 2 &&
stopProfilerTimerIfRunningAndRecordDelta(JSCompiler_temp, !0),
enableSchedulingProfiler)
)
switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) {
Expand All @@ -12288,7 +12296,7 @@ __DEV__ &&
"function" ===
typeof injectedProfilingHooks.markComponentErrored &&
injectedProfilingHooks.markComponentErrored(
handler,
JSCompiler_temp,
thrownValue,
workInProgressRootRenderLanes
);
Expand All @@ -12302,7 +12310,7 @@ __DEV__ &&
"function" ===
typeof injectedProfilingHooks.markComponentSuspended &&
injectedProfilingHooks.markComponentSuspended(
handler,
JSCompiler_temp,
thrownValue,
workInProgressRootRenderLanes
);
Expand Down Expand Up @@ -14026,6 +14034,7 @@ __DEV__ &&
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
transitionLaneExpirationMs =
dynamicFeatureFlags.transitionLaneExpirationMs,
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
Expand Down Expand Up @@ -16220,11 +16229,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-8d68da3f-20240903",
version: "19.0.0-www-modern-8b4c54c0-20240904",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-8d68da3f-20240903"
reconcilerVersion: "19.0.0-www-modern-8b4c54c0-20240904"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16258,7 +16267,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-8d68da3f-20240903";
exports.version = "19.0.0-www-modern-8b4c54c0-20240904";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
41 changes: 25 additions & 16 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs,
enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering,
disableLegacyMode = dynamicFeatureFlags.disableLegacyMode,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
Expand Down Expand Up @@ -9415,20 +9416,28 @@ function handleThrow(root, thrownValue) {
current = null;
if (thrownValue === SuspenseException) {
thrownValue = getSuspendedThenable();
var handler = suspenseHandlerStackCursor.current;
var JSCompiler_temp;
if ((JSCompiler_temp = !enableSiblingPrerendering))
(JSCompiler_temp = suspenseHandlerStackCursor.current),
(JSCompiler_temp =
null === JSCompiler_temp
? !0
: (workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 62914560) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 536870912)
? JSCompiler_temp === shellBoundary
: !1);
workInProgressSuspendedReason =
(null !== handler &&
((workInProgressRootRenderLanes & 4194176) ===
workInProgressRootRenderLanes
? null !== shellBoundary
: ((workInProgressRootRenderLanes & 62914560) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 536870912)) ||
handler !== shellBoundary)) ||
0 !== (workInProgressRootSkippedLanes & 134217727) ||
0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727)
? 3
: 2;
JSCompiler_temp &&
0 === (workInProgressRootSkippedLanes & 134217727) &&
0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)
? 2
: 3;
} else
thrownValue === SuspenseyCommitException
? ((thrownValue = getSuspendedThenable()),
Expand Down Expand Up @@ -10638,13 +10647,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1371 = {
bundleType: 0,
version: "19.0.0-www-classic-8d68da3f-20240903",
version: "19.0.0-www-classic-8b4c54c0-20240904",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-8d68da3f-20240903"
reconcilerVersion: "19.0.0-www-classic-8b4c54c0-20240904"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1372 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10670,4 +10679,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-8d68da3f-20240903";
exports.version = "19.0.0-www-classic-8b4c54c0-20240904";
Loading

0 comments on commit 8e6990e

Please sign in to comment.