Skip to content
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

Use Lanes to check if a render is a Suspense retry #19307

Merged
merged 1 commit into from Jul 10, 2020

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jul 10, 2020

Now that Suspense retries have their own dedicated set of lanes (#19287), we can determine if a render includes only retries by checking if its lanes are a subset of the retry lanes.

Previously we inferred this by checking workInProgressRootLatestProcessedEventTime. If it's not set, that implies that no updates were processed in the current render, which implies it must be a Suspense retry. The eventual plan is to get rid of workInProgressRootLatestProcessedEventTime and instead track event times on the root; this change is one the steps toward that goal.

The relevant tests were originally added in #15769.

Now that Suspense retries have their own dedicated set of lanes
(facebook#19287), we can determine if a render includes only retries by checking
if its lanes are a subset of the retry lanes.

Previously we inferred this by checking
`workInProgressRootLatestProcessedEventTime`. If it's not set, that
implies that no updates were processed in the current render, which
implies it must be a Suspense retry. The eventual plan is to get rid of
`workInProgressRootLatestProcessedEventTime` and instead track event
times on the root; this change is one the steps toward that goal.

The relevant tests were originally added in facebook#15769.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 10, 2020
@@ -451,9 +451,12 @@ export function getLanesToRetrySynchronouslyOnError(root: FiberRoot): Lanes {
export function returnNextLanesPriority() {
return return_highestLanePriority;
}
export function hasUpdatePriority(lanes: Lanes) {
export function includesNonIdleWork(lanes: Lanes) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This rename is unrelated. Just felt slightly better than the old one.

@codesandbox-ci
Copy link

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 e21e908:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Jul 10, 2020

Details of bundled changes.

Comparing: 14084be...e21e908

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.1% -0.0% 881.15 KB 880.71 KB 201.82 KB 201.73 KB NODE_DEV
ReactDOMForked-prod.js -0.0% 0.0% 403.58 KB 403.56 KB 74.62 KB 74.63 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% -0.0% 137.33 KB 137.33 KB 36.48 KB 36.47 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 118.91 KB 118.91 KB 38.22 KB 38.23 KB NODE_PROD
ReactDOMForked-profiling.js -0.0% 0.0% 414.26 KB 414.24 KB 76.36 KB 76.37 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 143.45 KB 143.45 KB 36.68 KB 36.68 KB UMD_DEV
ReactDOMTesting-dev.js -0.0% -0.0% 981.39 KB 980.95 KB 219.58 KB 219.48 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 51.13 KB 51.13 KB 14.89 KB 14.89 KB NODE_DEV
ReactDOMTesting-prod.js -0.0% 0.0% 411.47 KB 411.45 KB 77.28 KB 77.29 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 10.19 KB 10.19 KB 3.98 KB 3.98 KB NODE_PROD
react-dom.development.js -0.0% -0.0% 925.73 KB 925.28 KB 204.22 KB 204.12 KB UMD_DEV
react-dom.production.min.js 0.0% 🔺+0.1% 118.78 KB 118.79 KB 38.98 KB 39 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 122.7 KB 122.71 KB 40.14 KB 40.15 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.0% 1000.07 KB 999.64 KB 223.05 KB 222.95 KB FB_WWW_DEV
react-dom.profiling.min.js 0.0% 0.0% 122.96 KB 122.97 KB 39.44 KB 39.44 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 1013.99 KB 1013.55 KB 225.28 KB 225.19 KB FB_WWW_DEV
ReactDOM-prod.js -0.0% 0.0% 408.52 KB 408.5 KB 75.6 KB 75.61 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 136.06 KB 136.06 KB 36.23 KB 36.22 KB NODE_DEV
ReactDOM-profiling.js -0.0% 0.0% 419.21 KB 419.19 KB 77.36 KB 77.37 KB FB_WWW_PROFILING
ReactDOMServer-dev.js 0.0% -0.0% 147.36 KB 147.36 KB 37.42 KB 37.42 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 47.56 KB 47.56 KB 11.14 KB 11.14 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% -0.0% 55.52 KB 55.52 KB 15.36 KB 15.36 KB UMD_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js -0.0% 0.0% 251.9 KB 251.88 KB 44.68 KB 44.69 KB FB_WWW_PROD
react-art.development.js -0.1% -0.1% 667.45 KB 667 KB 142.08 KB 141.98 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 109.59 KB 109.6 KB 33.96 KB 33.96 KB UMD_PROD
react-art.development.js -0.1% -0.1% 569.79 KB 569.35 KB 124.32 KB 124.23 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 74.55 KB 74.56 KB 23.05 KB 23.06 KB NODE_PROD
ReactART-dev.js -0.1% -0.1% 638.62 KB 638.19 KB 135.51 KB 135.4 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% 605.98 KB 605.52 KB 127.41 KB 127.29 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.71 KB 76.72 KB 23.99 KB 24 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 577.34 KB 576.9 KB 125.94 KB 125.84 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.53 KB 76.54 KB 23.69 KB 23.69 KB NODE_PROD
ReactTestRenderer-dev.js -0.1% -0.1% 600.39 KB 599.96 KB 128.75 KB 128.65 KB FB_WWW_DEV
ReactTestRenderer-dev.js -0.1% -0.1% 593.63 KB 593.2 KB 128.53 KB 128.43 KB RN_FB_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 39.16 KB 39.16 KB 9.57 KB 9.57 KB UMD_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.1% 680.34 KB 679.91 KB 147.57 KB 147.47 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.0% 0.0% 271.59 KB 271.57 KB 48.27 KB 48.28 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.0% 0.0% 283.07 KB 283.04 KB 50.45 KB 50.46 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.1% -0.1% 661.05 KB 660.62 KB 142.87 KB 142.78 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% 0.0% 265.31 KB 265.29 KB 46.97 KB 46.99 KB RN_OSS_PROD
ReactFabric-profiling.js -0.0% 0.0% 276.81 KB 276.79 KB 49.18 KB 49.19 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.1% -0.1% 627.17 KB 626.73 KB 134.22 KB 134.13 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 16.69 KB 16.69 KB 4.98 KB 4.98 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 84.21 KB 84.22 KB 25.9 KB 25.91 KB NODE_PROD

Size changes (stable)

Generated by 🚫 dangerJS against e21e908

@sizebot
Copy link

sizebot commented Jul 10, 2020

Details of bundled changes.

Comparing: 14084be...e21e908

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.0% 913.68 KB 913.24 KB 207.69 KB 207.6 KB NODE_DEV
ReactDOMForked-prod.js -0.0% 0.0% 392.39 KB 392.37 KB 73.09 KB 73.1 KB FB_WWW_PROD
react-dom.production.min.js 0.0% 0.0% 123.66 KB 123.67 KB 39.63 KB 39.64 KB NODE_PROD
ReactDOMForked-profiling.js -0.0% 0.0% 403.02 KB 403 KB 74.83 KB 74.84 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 145.04 KB 145.04 KB 36.88 KB 36.88 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.71 KB 20.71 KB 7.67 KB 7.67 KB NODE_PROD
ReactDOMTesting-dev.js -0.0% -0.0% 953.26 KB 952.83 KB 213.7 KB 213.6 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 51.15 KB 51.15 KB 14.9 KB 14.9 KB NODE_DEV
ReactDOMTesting-prod.js -0.0% 0.0% 398.17 KB 398.15 KB 75.38 KB 75.4 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 10.2 KB 10.2 KB 3.99 KB 3.99 KB NODE_PROD
react-dom.development.js -0.0% -0.1% 959.71 KB 959.26 KB 210.23 KB 210.12 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 123.47 KB 123.48 KB 40.44 KB 40.45 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 127.42 KB 127.43 KB 41.64 KB 41.64 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.0% 974.52 KB 974.09 KB 217.85 KB 217.76 KB FB_WWW_DEV
react-dom.profiling.min.js 0.0% 0.0% 127.77 KB 127.78 KB 40.88 KB 40.89 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.37 KB 20.37 KB 7.54 KB 7.54 KB UMD_PROD
ReactDOM-dev.js -0.0% -0.0% 988.44 KB 988.01 KB 220.09 KB 220 KB FB_WWW_DEV
ReactDOM-prod.js -0.0% 0.0% 397.34 KB 397.32 KB 74.06 KB 74.07 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 137.57 KB 137.57 KB 36.43 KB 36.43 KB NODE_DEV
ReactDOM-profiling.js -0.0% 0.0% 407.96 KB 407.94 KB 75.8 KB 75.81 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.29 KB 20.29 KB 7.52 KB 7.52 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 143.33 KB 143.33 KB 36.42 KB 36.42 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 55.53 KB 55.53 KB 15.37 KB 15.37 KB UMD_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.1% 685.75 KB 685.31 KB 148.42 KB 148.32 KB RN_FB_DEV
ReactFabric-dev.js -0.1% -0.1% 666.46 KB 666.03 KB 143.73 KB 143.63 KB RN_FB_DEV
ReactNativeRenderer-dev.js -0.1% -0.1% 680.35 KB 679.92 KB 147.57 KB 147.47 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% 0.0% 265.28 KB 265.26 KB 46.97 KB 46.98 KB RN_FB_PROD
ReactNativeRenderer-prod.js -0.0% 0.0% 271.61 KB 271.59 KB 48.28 KB 48.29 KB RN_OSS_PROD
ReactFabric-profiling.js -0.0% 0.0% 276.78 KB 276.76 KB 49.17 KB 49.18 KB RN_FB_PROFILING
ReactNativeRenderer-profiling.js -0.0% 0.0% 283.08 KB 283.06 KB 50.46 KB 50.47 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js -0.0% 0.0% 271.56 KB 271.54 KB 48.26 KB 48.27 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.0% 0.0% 283.03 KB 283.01 KB 50.44 KB 50.45 KB RN_FB_PROFILING
ReactFabric-dev.js -0.1% -0.1% 661.07 KB 660.63 KB 142.88 KB 142.78 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% 0.0% 265.32 KB 265.3 KB 46.98 KB 47 KB RN_OSS_PROD
ReactFabric-profiling.js -0.0% 0.0% 276.82 KB 276.8 KB 49.19 KB 49.2 KB RN_OSS_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js -0.0% 0.0% 244.76 KB 244.74 KB 43.39 KB 43.41 KB FB_WWW_PROD
react-art.development.js -0.1% -0.1% 689.85 KB 689.4 KB 146.25 KB 146.13 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 112.56 KB 112.57 KB 34.85 KB 34.86 KB UMD_PROD
react-art.development.js -0.1% -0.1% 591.27 KB 590.83 KB 128.41 KB 128.32 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 77.46 KB 77.47 KB 23.94 KB 23.94 KB NODE_PROD
ReactART-dev.js -0.1% -0.1% 628.61 KB 628.17 KB 133.48 KB 133.37 KB FB_WWW_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer-shallow.production.min.js 0.0% -0.0% 12.74 KB 12.74 KB 3.97 KB 3.97 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 606 KB 605.55 KB 127.42 KB 127.3 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.74 KB 76.75 KB 24.01 KB 24.02 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 577.37 KB 576.93 KB 125.95 KB 125.86 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.55 KB 76.56 KB 23.7 KB 23.71 KB NODE_PROD
ReactTestRenderer-dev.js -0.1% -0.1% 600.4 KB 599.97 KB 128.75 KB 128.65 KB FB_WWW_DEV
ReactTestRenderer-dev.js -0.1% -0.1% 593.65 KB 593.21 KB 128.54 KB 128.44 KB RN_FB_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 39.17 KB 39.17 KB 9.58 KB 9.58 KB UMD_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.1% -0.1% 651.02 KB 650.57 KB 138.78 KB 138.69 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 87.57 KB 87.58 KB 26.83 KB 26.84 KB NODE_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against e21e908

@acdlite acdlite merged commit 970fa12 into facebook:master Jul 10, 2020
acdlite added a commit to acdlite/react that referenced this pull request Jul 13, 2020
Same logic as facebook#19307. Uses RetryLanes instead of event time to
determine if a render includes new updates.
acdlite added a commit that referenced this pull request Jul 13, 2020
Same logic as #19307. Uses RetryLanes instead of event time to
determine if a render includes new updates.
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.

None yet

4 participants