Skip to content

Remove callbackId field from FiberRoot #19458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jul 26, 2020

The old expiration times implementation used this field to infer when the priority of a task had changed at a more granular level than a Scheduler priority level.

Now that we have the LanePriority type, which is React-specific, we no longer need the callbackId field.

@acdlite acdlite requested a review from rickhanlonii July 26, 2020 23:19
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 26, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 26, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 71681be:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Jul 26, 2020

Details of bundled changes.

Comparing: c24b641...71681be

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.0% 886.57 KB 886.26 KB 203.12 KB 203.04 KB NODE_DEV
ReactDOMForked-prod.js -0.1% -0.1% 408.42 KB 408.19 KB 75.44 KB 75.39 KB FB_WWW_PROD
react-dom.production.min.js -0.1% -0.1% 119.45 KB 119.37 KB 38.41 KB 38.38 KB NODE_PROD
ReactDOMForked-profiling.js -0.1% -0.1% 423.49 KB 423.26 KB 78.07 KB 78.02 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 12.84 KB 12.84 KB 5.03 KB 5.03 KB UMD_PROD
ReactDOMTesting-dev.js -0.0% -0.0% 987.19 KB 986.88 KB 220.4 KB 220.33 KB FB_WWW_DEV
ReactDOMTesting-prod.js -0.1% -0.1% 415.45 KB 415.22 KB 77.75 KB 77.69 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.7 KB 12.7 KB 4.96 KB 4.96 KB NODE_PROD
react-dom.development.js -0.0% -0.0% 931.33 KB 931 KB 205.61 KB 205.53 KB UMD_DEV
react-dom.production.min.js -0.1% -0.1% 119.35 KB 119.27 KB 39.09 KB 39.06 KB UMD_PROD
react-dom.profiling.min.js -0.1% -0.0% 123.26 KB 123.18 KB 40.27 KB 40.26 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.0% 1022.77 KB 1022.46 KB 226.74 KB 226.67 KB FB_WWW_DEV
react-dom.profiling.min.js -0.1% -0.1% 123.52 KB 123.44 KB 39.69 KB 39.65 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 1019.43 KB 1019.12 KB 226.42 KB 226.36 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.1% 406.96 KB 406.73 KB 75.13 KB 75.08 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.1% 421.42 KB 421.19 KB 77.75 KB 77.7 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% 0.0% 65.9 KB 65.9 KB 18.18 KB 18.18 KB UMD_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.0% -0.1% 685.72 KB 685.41 KB 148.37 KB 148.29 KB RN_FB_DEV
ReactFabric-dev.js -0.0% -0.0% 666.44 KB 666.13 KB 143.7 KB 143.63 KB RN_FB_DEV
ReactNativeRenderer-dev.js -0.0% -0.1% 680.33 KB 680.02 KB 147.52 KB 147.44 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% -0.1% 265.94 KB 265.71 KB 47.14 KB 47.09 KB RN_FB_PROD
ReactNativeRenderer-prod.js -0.1% -0.1% 272.14 KB 271.91 KB 48.43 KB 48.37 KB RN_OSS_PROD
ReactFabric-profiling.js -0.1% -0.1% 277.3 KB 277.07 KB 49.32 KB 49.27 KB RN_FB_PROFILING
ReactNativeRenderer-profiling.js -0.1% -0.1% 283.67 KB 283.44 KB 50.6 KB 50.55 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js -0.1% -0.1% 272.1 KB 271.87 KB 48.41 KB 48.35 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.1% -0.1% 283.62 KB 283.39 KB 50.58 KB 50.53 KB RN_FB_PROFILING
ReactFabric-dev.js -0.0% -0.1% 661.04 KB 660.73 KB 142.85 KB 142.77 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% -0.1% 265.97 KB 265.74 KB 47.15 KB 47.1 KB RN_OSS_PROD
ReactFabric-profiling.js -0.1% -0.1% 277.34 KB 277.11 KB 49.34 KB 49.29 KB RN_OSS_PROFILING

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.0% -0.1% 627.05 KB 626.74 KB 134.16 KB 134.09 KB NODE_DEV
react-reconciler.production.min.js -0.1% -0.1% 84.42 KB 84.34 KB 25.98 KB 25.94 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.8 KB 2.8 KB 1.15 KB 1.15 KB NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js -0.1% -0.1% 247.62 KB 247.39 KB 43.85 KB 43.8 KB FB_WWW_PROD
react-art.development.js -0.0% -0.0% 667.5 KB 667.17 KB 142.06 KB 142 KB UMD_DEV
react-art.production.min.js -0.1% -0.1% 109.81 KB 109.72 KB 34 KB 33.97 KB UMD_PROD
react-art.development.js -0.1% -0.1% 569.81 KB 569.5 KB 124.3 KB 124.23 KB NODE_DEV
react-art.production.min.js -0.1% -0.2% 74.77 KB 74.69 KB 23.15 KB 23.11 KB NODE_PROD
ReactART-dev.js -0.0% -0.1% 637.85 KB 637.54 KB 135.43 KB 135.36 KB FB_WWW_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.1% -0.1% 606.03 KB 605.7 KB 127.37 KB 127.3 KB UMD_DEV
react-test-renderer.production.min.js -0.1% -0.1% 76.93 KB 76.85 KB 24.04 KB 24.01 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 577.37 KB 577.05 KB 125.93 KB 125.85 KB NODE_DEV
react-test-renderer.production.min.js -0.1% -0.2% 76.75 KB 76.67 KB 23.77 KB 23.73 KB NODE_PROD
ReactTestRenderer-dev.js -0.1% -0.1% 600.27 KB 599.96 KB 128.68 KB 128.6 KB FB_WWW_DEV
ReactTestRenderer-dev.js -0.1% -0.1% 593.62 KB 593.31 KB 128.5 KB 128.42 KB RN_FB_DEV
ReactTestRenderer-prod.js -0.1% -0.1% 233.38 KB 233.16 KB 42.59 KB 42.54 KB RN_FB_PROD
ReactTestRenderer-profiling.js -0.1% -0.1% 244.8 KB 244.57 KB 44.73 KB 44.68 KB RN_FB_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 71681be

@sizebot
Copy link

sizebot commented Jul 26, 2020

Details of bundled changes.

Comparing: c24b641...71681be

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.0% 923.68 KB 923.37 KB 209.92 KB 209.86 KB NODE_DEV
ReactDOMForked-prod.js -0.1% -0.1% 397.29 KB 397.06 KB 73.8 KB 73.74 KB FB_WWW_PROD
react-dom.production.min.js -0.1% -0.1% 124.25 KB 124.17 KB 39.86 KB 39.82 KB NODE_PROD
ReactDOMForked-profiling.js -0.1% -0.1% 412.3 KB 412.07 KB 76.44 KB 76.39 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 12.86 KB 12.86 KB 5.04 KB 5.04 KB UMD_PROD
ReactDOMTesting-dev.js -0.0% -0.0% 959.03 KB 958.72 KB 214.99 KB 214.92 KB FB_WWW_DEV
ReactDOMTesting-prod.js -0.1% -0.1% 403.21 KB 402.98 KB 75.92 KB 75.83 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.71 KB 12.71 KB 4.97 KB 4.97 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.2% 1.17 KB 1.17 KB 666 B 667 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 706 B 707 B UMD_PROD
react-dom.development.js -0.0% -0.0% 970.24 KB 969.91 KB 212.47 KB 212.41 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.01 KB 1.01 KB 617 B 618 B NODE_PROD
react-dom.production.min.js -0.1% -0.1% 124.1 KB 124.02 KB 40.6 KB 40.56 KB UMD_PROD
react-dom.profiling.min.js -0.1% -0.1% 129.28 KB 129.2 KB 42.22 KB 42.19 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.0% 997.23 KB 996.92 KB 222.04 KB 221.98 KB FB_WWW_DEV
react-dom.profiling.min.js -0.1% -0.1% 129.63 KB 129.55 KB 41.49 KB 41.46 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 993.89 KB 993.58 KB 221.77 KB 221.71 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.1% 395.83 KB 395.6 KB 73.51 KB 73.46 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.1% 410.22 KB 409.99 KB 76.14 KB 76.08 KB FB_WWW_PROFILING

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.0% -0.0% 655.4 KB 655.09 KB 139.57 KB 139.5 KB NODE_DEV
react-reconciler.production.min.js -0.1% -0.1% 87.77 KB 87.69 KB 26.91 KB 26.88 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.81 KB 2.81 KB 1.16 KB 1.16 KB NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js -0.1% -0.1% 240.47 KB 240.24 KB 42.58 KB 42.52 KB FB_WWW_PROD
react-art.development.js -0.0% -0.0% 694.76 KB 694.43 KB 147.08 KB 147.01 KB UMD_DEV
react-art.production.min.js -0.1% -0.2% 112.78 KB 112.7 KB 34.9 KB 34.85 KB UMD_PROD
react-art.development.js -0.1% -0.1% 595.79 KB 595.48 KB 129.24 KB 129.16 KB NODE_DEV
react-art.production.min.js -0.1% -0.2% 77.68 KB 77.6 KB 24.02 KB 23.98 KB NODE_PROD
ReactART-dev.js -0.0% -0.1% 627.83 KB 627.52 KB 133.4 KB 133.33 KB FB_WWW_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.1% -0.1% 606.05 KB 605.73 KB 127.39 KB 127.32 KB UMD_DEV
react-test-renderer.production.min.js -0.1% -0.1% 76.96 KB 76.88 KB 24.06 KB 24.02 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 577.39 KB 577.08 KB 125.94 KB 125.86 KB NODE_DEV
react-test-renderer.production.min.js -0.1% -0.2% 76.78 KB 76.69 KB 23.78 KB 23.75 KB NODE_PROD
ReactTestRenderer-dev.js -0.1% -0.1% 600.29 KB 599.98 KB 128.68 KB 128.61 KB FB_WWW_DEV
ReactTestRenderer-dev.js -0.1% -0.1% 593.64 KB 593.33 KB 128.5 KB 128.42 KB RN_FB_DEV
ReactTestRenderer-prod.js -0.1% -0.1% 233.4 KB 233.17 KB 42.6 KB 42.55 KB RN_FB_PROD
ReactTestRenderer-profiling.js -0.1% -0.1% 244.81 KB 244.58 KB 44.73 KB 44.68 KB RN_FB_PROFILING

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.0% -0.1% 680.34 KB 680.03 KB 147.52 KB 147.45 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.1% -0.1% 272.15 KB 271.92 KB 48.44 KB 48.37 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.1% -0.1% 283.68 KB 283.46 KB 50.61 KB 50.55 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.0% -0.1% 661.06 KB 660.75 KB 142.85 KB 142.78 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% -0.1% 265.98 KB 265.75 KB 47.16 KB 47.11 KB RN_OSS_PROD
ReactFabric-profiling.js -0.1% -0.1% 277.35 KB 277.12 KB 49.35 KB 49.3 KB RN_OSS_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 71681be

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -689,37 +689,32 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
markStarvedLanesAsExpired(root, currentTime);

// Determine the next lanes to work on, and their priority.
const newCallbackId = getNextLanes(
const nextLanes = getNextLanes(
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the comment on line 681 (which references the expiration time) is out of date, should we update that as well?

@@ -741,7 +736,6 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
);
}

root.callbackId = newCallbackId;
Copy link
Member

Choose a reason for hiding this comment

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

We used to update the root callbackId with the next lane, why don't we need to do anything with the next lane in the new version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was only used by this function. Since we don't need it for the logic above anymore, we don't have to store it.

The old expiration times implementation used this field to infer when
the priority of a task had changed at a more granular level than a
Scheduler priority level.

Now that we have the LanePriority type, which is React-specific, we no
longer need the `callbackId` field.
@acdlite acdlite force-pushed the remove-callbackid-field branch 3 times, most recently from 13518ec to 71681be Compare July 27, 2020 17:16
@acdlite acdlite merged commit 96ac799 into facebook:master Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants