Skip to content

Commit

Permalink
[Scheduler] Always yield to native macro tasks when a virtual task co…
Browse files Browse the repository at this point in the history
…mpletes (#31787)

As an alternative to #31784.

We should really just always yield each virtual task to a native task.
So that it's 1:1 with native tasks. This affects when microtasks within
each task happens. This brings us closer to native `postTask` semantics
which makes it more seamless to just use that when available.

This still doesn't yield when a task expires to protect against
starvation.

DiffTrain build for [f5077bc](f5077bc)
  • Loading branch information
sebmarkbage committed Dec 17, 2024
1 parent 613f8c3 commit e2c05f6
Show file tree
Hide file tree
Showing 24 changed files with 97 additions and 109 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.1.0-native-fb-34ee3919-20241217
19.1.0-native-fb-f5077bcc-20241217
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<30f52d921681128a0384ae46787dc225>>
* @generated SignedSource<<b864348cf16e5a6c2675d7482ceb59a4>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<071057a56fce7a4c79ad8d6f2900e7b2>>
* @generated SignedSource<<323e70fc16467db46e17fe533bfb2594>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<071057a56fce7a4c79ad8d6f2900e7b2>>
* @generated SignedSource<<323e70fc16467db46e17fe533bfb2594>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<44d6e479cf988ecaa5efc9779c05bcad>>
* @generated SignedSource<<f857fd29d9cb7a727abf5045273b0448>>
*/

/*
Expand Down Expand Up @@ -25883,11 +25883,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-f5077bcc-20241217" !== 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.1.0-native-fb-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-f5077bcc-20241217\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25924,10 +25924,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26073,5 +26073,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3ce4685c4d100cff61246b33dd2513d1>>
* @generated SignedSource<<771368c7fededf676f9a6030056bfa44>>
*/

/*
Expand Down Expand Up @@ -15867,14 +15867,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1722 = React.version;
if (
"19.1.0-native-fb-34ee3919-20241217" !==
"19.1.0-native-fb-f5077bcc-20241217" !==
isomorphicReactPackageVersion$jscomp$inline_1722
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1722,
"19.1.0-native-fb-34ee3919-20241217"
"19.1.0-native-fb-f5077bcc-20241217"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15896,10 +15896,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2177 = {
bundleType: 0,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2178 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16005,4 +16005,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d95dc493005b12d7f27cff39675f9926>>
* @generated SignedSource<<6575d7b55c4ce1a50713a0facee4a306>>
*/

/*
Expand Down Expand Up @@ -16520,14 +16520,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version;
if (
"19.1.0-native-fb-34ee3919-20241217" !==
"19.1.0-native-fb-f5077bcc-20241217" !==
isomorphicReactPackageVersion$jscomp$inline_1812
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1812,
"19.1.0-native-fb-34ee3919-20241217"
"19.1.0-native-fb-f5077bcc-20241217"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16549,10 +16549,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1819 = {
bundleType: 0,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217",
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16673,4 +16673,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<343a6b404a717cb1221275fd09848a76>>
* @generated SignedSource<<b57733173f04be7ca883ab97c7d46a44>>
*/

/*
Expand Down Expand Up @@ -25944,11 +25944,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-34ee3919-20241217" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-f5077bcc-20241217" !== 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.1.0-native-fb-34ee3919-20241217\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-f5077bcc-20241217\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25985,10 +25985,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26450,7 +26450,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<69a847d74e147c198c7e587d0365fe6a>>
* @generated SignedSource<<54a02ef74806b64ab6c6795928b77577>>
*/

/*
Expand Down Expand Up @@ -15878,14 +15878,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1723 = React.version;
if (
"19.1.0-native-fb-34ee3919-20241217" !==
"19.1.0-native-fb-f5077bcc-20241217" !==
isomorphicReactPackageVersion$jscomp$inline_1723
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1723,
"19.1.0-native-fb-34ee3919-20241217"
"19.1.0-native-fb-f5077bcc-20241217"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15907,10 +15907,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2180 = {
bundleType: 0,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2181 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16170,4 +16170,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<ea07825c56acfab7d03aeeae15ad2811>>
* @generated SignedSource<<dcaedc3ddcec1168cdfe15a66aca8e4c>>
*/

/*
Expand Down Expand Up @@ -16535,14 +16535,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1813 = React.version;
if (
"19.1.0-native-fb-34ee3919-20241217" !==
"19.1.0-native-fb-f5077bcc-20241217" !==
isomorphicReactPackageVersion$jscomp$inline_1813
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1813,
"19.1.0-native-fb-34ee3919-20241217"
"19.1.0-native-fb-f5077bcc-20241217"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16564,10 +16564,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1820 = {
bundleType: 0,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217",
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16842,7 +16842,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<1d2dcb1da8d83e774be01a8e02f58b6d>>
* @generated SignedSource<<729db2ae7b98dff022b2f8573c049f44>>
*/

"use strict";
Expand Down Expand Up @@ -15587,10 +15587,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15735,5 +15735,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b955df76651c3c977be1c6ef72671ab1>>
* @generated SignedSource<<dfb48012cfb94d2cd95b543228bb5c6a>>
*/

"use strict";
Expand Down Expand Up @@ -9747,10 +9747,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1381 = {
bundleType: 0,
version: "19.1.0-native-fb-34ee3919-20241217",
version: "19.1.0-native-fb-f5077bcc-20241217",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-34ee3919-20241217"
reconcilerVersion: "19.1.0-native-fb-f5077bcc-20241217"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1382 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -9886,4 +9886,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.1.0-native-fb-34ee3919-20241217";
exports.version = "19.1.0-native-fb-f5077bcc-20241217";
Loading

0 comments on commit e2c05f6

Please sign in to comment.