Skip to content

Commit

Permalink
integrate scheduler.yield in SchedulerPostTask (#27069)
Browse files Browse the repository at this point in the history
## Summary

`scheduler.yield` is entering [Origin Trial soon in Chrome
115](https://chromestatus.com/feature/6266249336586240). This diff adds
it to `SchedulerPostTask` when scheduling continuations to allow Origin
Trial participation for early feedback on the new API.

It seems the difference here versus the current use of `postTask` will
be minor – the intent behind `scheduler.yield` seems to mostly be better
ergonomics for scheduling continuations, but it may be interesting to
see if the follow aspect of it results in any tangible difference in
scheduling (from
[here](https://github.com/WICG/scheduling-apis/blob/main/explainers/yield-and-continuation.md#introduction)):

> To mitigate yielding performance penalty concerns, UAs prioritize
scheduler.yield() continuations over tasks of the same priority or
similar task sources.

## How did you test this change?

```
yarn test SchedulerPostTask
```

DiffTrain build for commit 0a36064.
  • Loading branch information
noahlemen committed Jul 11, 2023
1 parent f8d29c2 commit d28c589
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23982,7 +23982,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-fdc8c81e0-20230707";
var ReactVersion = "18.3.0-canary-0a360642d-20230711";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8630,7 +8630,7 @@ var devToolsConfig$jscomp$inline_1032 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-fdc8c81e0-20230707",
version: "18.3.0-canary-0a360642d-20230711",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1231 = {
Expand Down Expand Up @@ -8661,7 +8661,7 @@ var internals$jscomp$inline_1231 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-fdc8c81e0-20230707"
reconcilerVersion: "18.3.0-canary-0a360642d-20230711"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9056,7 +9056,7 @@ var devToolsConfig$jscomp$inline_1074 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-fdc8c81e0-20230707",
version: "18.3.0-canary-0a360642d-20230711",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1272 = {
Expand Down Expand Up @@ -9087,7 +9087,7 @@ var internals$jscomp$inline_1272 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-fdc8c81e0-20230707"
reconcilerVersion: "18.3.0-canary-0a360642d-20230711"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1273 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-fdc8c81e0-20230707";
var ReactVersion = "18.3.0-canary-0a360642d-20230711";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-fdc8c81e0-20230707";
exports.version = "18.3.0-canary-0a360642d-20230711";
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-fdc8c81e0-20230707";
exports.version = "18.3.0-canary-0a360642d-20230711";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fdc8c81e07e9b3b49604afe524ee6d130fd3e03e
0a360642dcc08cab469da0a0e4f1050e56b0ef7e

0 comments on commit d28c589

Please sign in to comment.