Skip to content

Commit

Permalink
[Fizz] use microtasks rather than tasks when scheduling work while pr…
Browse files Browse the repository at this point in the history
…erendering (#30770)

Similar to #30768 we want to
schedule work during prerendering in microtasks both for the root task
and pings. We continue to schedule flushes as Tasks to allow as much
work to be batched up as possible.

DiffTrain build for [ab24f64](ab24f64)
  • Loading branch information
gnoff committed Aug 21, 2024
1 parent d094ee1 commit d533aef
Show file tree
Hide file tree
Showing 34 changed files with 142 additions and 138 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
85180b8cf84274795986c8f2c8473f8816db8b7b
ab24f643d0809ee09a7499862fef135fb09a0225
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
85180b8cf84274795986c8f2c8473f8816db8b7b
ab24f643d0809ee09a7499862fef135fb09a0225
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-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
"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-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
"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-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
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-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
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-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
"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-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16776,11 +16776,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-85180b8c-20240820",
version: "19.0.0-www-classic-ab24f643-20240821",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-classic-ab24f643-20240821"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16814,7 +16814,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16189,11 +16189,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-85180b8c-20240820",
version: "19.0.0-www-modern-ab24f643-20240821",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-modern-ab24f643-20240821"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16227,7 +16227,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10618,13 +10618,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1361 = {
bundleType: 0,
version: "19.0.0-www-classic-85180b8c-20240820",
version: "19.0.0-www-classic-ab24f643-20240821",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-classic-ab24f643-20240821"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1362 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10650,4 +10650,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10132,13 +10132,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1353 = {
bundleType: 0,
version: "19.0.0-www-modern-85180b8c-20240820",
version: "19.0.0-www-modern-ab24f643-20240821",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-modern-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-modern-ab24f643-20240821"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1354 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10164,4 +10164,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27528,11 +27528,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-85180b8c-20240820" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-ab24f643-20240821" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-85180b8c-20240820\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-ab24f643-20240821\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27576,11 +27576,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-85180b8c-20240820",
version: "19.0.0-www-classic-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-classic-ab24f643-20240821"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28233,7 +28233,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -26613,11 +26613,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-85180b8c-20240820" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-ab24f643-20240821" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-85180b8c-20240820\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-ab24f643-20240821\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26660,11 +26660,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-85180b8c-20240820",
version: "19.0.0-www-modern-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-modern-ab24f643-20240821"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27269,7 +27269,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17170,14 +17170,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version;
if (
"19.0.0-www-classic-85180b8c-20240820" !==
"19.0.0-www-classic-ab24f643-20240821" !==
isomorphicReactPackageVersion$jscomp$inline_1753
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1753,
"19.0.0-www-classic-85180b8c-20240820"
"19.0.0-www-classic-ab24f643-20240821"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17222,11 +17222,11 @@ Internals.Events = [
];
var internals$jscomp$inline_2208 = {
bundleType: 0,
version: "19.0.0-www-classic-85180b8c-20240820",
version: "19.0.0-www-classic-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-classic-ab24f643-20240821"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2209 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17682,4 +17682,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16544,14 +16544,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version;
if (
"19.0.0-www-modern-85180b8c-20240820" !==
"19.0.0-www-modern-ab24f643-20240821" !==
isomorphicReactPackageVersion$jscomp$inline_1724
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1724,
"19.0.0-www-modern-85180b8c-20240820"
"19.0.0-www-modern-ab24f643-20240821"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16569,11 +16569,11 @@ Internals.Events = [
];
var internals$jscomp$inline_2199 = {
bundleType: 0,
version: "19.0.0-www-modern-85180b8c-20240820",
version: "19.0.0-www-modern-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-modern-ab24f643-20240821"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2200 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16936,4 +16936,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17949,14 +17949,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1841 = React.version;
if (
"19.0.0-www-classic-85180b8c-20240820" !==
"19.0.0-www-classic-ab24f643-20240821" !==
isomorphicReactPackageVersion$jscomp$inline_1841
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1841,
"19.0.0-www-classic-85180b8c-20240820"
"19.0.0-www-classic-ab24f643-20240821"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -18001,11 +18001,11 @@ Internals.Events = [
];
var internals$jscomp$inline_1848 = {
bundleType: 0,
version: "19.0.0-www-classic-85180b8c-20240820",
version: "19.0.0-www-classic-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-classic-ab24f643-20240821"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1848.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -18464,7 +18464,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17306,14 +17306,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version;
if (
"19.0.0-www-modern-85180b8c-20240820" !==
"19.0.0-www-modern-ab24f643-20240821" !==
isomorphicReactPackageVersion$jscomp$inline_1812
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1812,
"19.0.0-www-modern-85180b8c-20240820"
"19.0.0-www-modern-ab24f643-20240821"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17331,11 +17331,11 @@ Internals.Events = [
];
var internals$jscomp$inline_1814 = {
bundleType: 0,
version: "19.0.0-www-modern-85180b8c-20240820",
version: "19.0.0-www-modern-ab24f643-20240821",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-85180b8c-20240820"
reconcilerVersion: "19.0.0-www-modern-ab24f643-20240821"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1814.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -17701,7 +17701,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-85180b8c-20240820";
exports.version = "19.0.0-www-modern-ab24f643-20240821";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
9 changes: 5 additions & 4 deletions compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7365,9 +7365,10 @@ __DEV__ &&
}
function startWork(request) {
request.flushScheduled = null !== request.destination;
performWork(request);
null === request.trackedPostpones &&
safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
null !== request.trackedPostpones
? performWork(request)
: (performWork(request),
safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks));
}
function enqueueFlush(request) {
if (
Expand Down Expand Up @@ -8946,5 +8947,5 @@ __DEV__ &&
'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 = "19.0.0-www-classic-85180b8c-20240820";
exports.version = "19.0.0-www-classic-ab24f643-20240821";
})();
Loading

0 comments on commit d533aef

Please sign in to comment.