Skip to content

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Sep 5, 2019

Removes requestIdleCallbackBeforeFirstFrame and requestTimerEventBeforeFirstFrame.

Both were rAF-specific experiments but we went with MessageLoop instead. We left rAF temporarily in the code but since we never actually used these code paths, I think we should delete them to make the code easier to understand.

// prevent idle periods.
let idleTimeoutID;
if (requestTimerEventBeforeFirstFrame) {
idleTimeoutID = setTimeout(function onTimerEventBeforeFirstFrame() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you've removed this timeout, there's now no timeout fallback for the initial rAF call, like there is for subsequent rAFs:

const onTimeout = () => {
frameDeadline = getCurrentTime() + frameLength / 2;
performWorkUntilDeadline();
rAFTimeoutID = setTimeout(onTimeout, frameLength * 3);
};
rAFTimeoutID = setTimeout(onTimeout, frameLength * 3);

But it's whatever since we're going to disable the rAF stuff anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That timeout should have already been in the else branch of this feature, anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's now no timeout fallback for the initial rAF call, like there is for subsequent rAFs

I guess that explains #16629?

@sizebot
Copy link

sizebot commented Sep 5, 2019

React: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: 040ca0f...51f728a

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -1.7% -1.5% 119.56 KB 117.47 KB 30.27 KB 29.82 KB UMD_DEV
react.production.min.js 0.0% 0.0% 12.43 KB 12.43 KB 4.9 KB 4.9 KB UMD_PROD
react.profiling.min.js 0.0% 0.0% 15.83 KB 15.83 KB 5.9 KB 5.9 KB UMD_PROFILING
react.development.js 0.0% 0.0% 73.12 KB 73.12 KB 19.25 KB 19.25 KB NODE_DEV
react.production.min.js 0.0% 🔺+0.1% 6.69 KB 6.69 KB 2.78 KB 2.78 KB NODE_PROD
React-dev.js 0.0% 0.0% 71.18 KB 71.18 KB 18.31 KB 18.31 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.41 KB 17.41 KB 4.55 KB 4.56 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.41 KB 17.41 KB 4.55 KB 4.56 KB FB_WWW_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler-unstable_mock.development.js -0.0% 0.0% 22.12 KB 22.12 KB 5.13 KB 5.13 KB UMD_DEV
scheduler-tracing.profiling.min.js 0.0% +0.3% 3.25 KB 3.25 KB 990 B 993 B NODE_PROFILING
scheduler-unstable_mock.production.min.js 0.0% 0.0% 4.73 KB 4.73 KB 1.98 KB 1.98 KB UMD_PROD
Scheduler-dev.js -6.8% -5.9% 31.76 KB 29.62 KB 7.99 KB 7.52 KB FB_WWW_DEV
scheduler-tracing.development.js 0.0% +0.1% 11.72 KB 11.72 KB 3.03 KB 3.03 KB NODE_DEV
scheduler-tracing.production.min.js 0.0% 🔺+0.8% 728 B 728 B 380 B 383 B NODE_PROD
scheduler-unstable_mock.development.js -0.0% 0.0% 21.93 KB 21.93 KB 5.07 KB 5.07 KB NODE_DEV
scheduler-unstable_mock.production.min.js 0.0% 🔺+0.1% 4.72 KB 4.72 KB 1.92 KB 1.92 KB NODE_PROD
scheduler.development.js -6.7% -5.7% 31.26 KB 29.16 KB 7.88 KB 7.43 KB NODE_DEV

Generated by 🚫 dangerJS against 51f728a

@gaearon gaearon merged commit 962dfc2 into facebook:master Sep 5, 2019
@gaearon gaearon deleted the no-dc branch September 5, 2019 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants