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

Bugfix: Render phase update causes remaining updates in same component to be dropped #18537

Merged
merged 2 commits into from Apr 8, 2020

Conversation

@acdlite
Copy link
Member

@acdlite acdlite commented Apr 8, 2020

Fixes #18534
Fixes #18486

Render phase updates should not affect the fiber.expirationTime field. We don't have to set anything on the fiber because we're going to process the render phase update immediately.

We also shouldn't reset the expirationTime field in between render passes because it represents the remaining work left in the update queues. During the re-render, the updates that were skipped in the original pass are not processed again.

I think my original motivation for using this field for render phase updates was so I didn't have to add another module level variable.

acdlite and others added 2 commits Apr 8, 2020
Render phase updates should not affect the `fiber.expirationTime` field.
We don't have to set anything on the fiber because we're going to
process the render phase update immediately.

We also shouldn't reset the `expirationTime` field in between render
passes because it represents the remaining work left in the update
queues. During the re-render, the updates that were skipped in the
original pass are not processed again.

I think my original motivation for using this field for render phase
updates was so I didn't have to add another module level variable.
@codesandbox
Copy link

@codesandbox codesandbox bot commented Apr 8, 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 d1270e9:

Sandbox Source
goofy-currying-y8f70 Configuration
jolly-mendeleev-1u4d2 Issue #18486
@acdlite acdlite force-pushed the acdlite:bugfix-render-phase-update branch from 384a06f to d1270e9 Apr 8, 2020
@gaearon
Copy link
Member

@gaearon gaearon commented Apr 8, 2020

haha I wasn't too far

Screenshot 2020-04-08 at 03 04 00

@sizebot
Copy link

@sizebot sizebot commented Apr 8, 2020

Details of bundled changes.

Comparing: 2def7b3...d1270e9

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% +0.1% 629.22 KB 629.53 KB 132.68 KB 132.76 KB UMD_DEV
react-art.production.min.js -0.1% 0.0% 107.01 KB 106.96 KB 32.41 KB 32.41 KB UMD_PROD
react-art.development.js +0.1% +0.1% 533.78 KB 534.08 KB 115.08 KB 115.16 KB NODE_DEV
react-art.production.min.js -0.1% 🔺+0.1% 72.04 KB 71.99 KB 21.6 KB 21.63 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 595.36 KB 595.66 KB 124.81 KB 124.9 KB FB_WWW_DEV
ReactART-prod.js 0.0% 🔺+0.1% 247.82 KB 247.9 KB 41.85 KB 41.87 KB FB_WWW_PROD

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% 567.19 KB 567.5 KB 117.97 KB 118.05 KB UMD_DEV
react-test-renderer.production.min.js -0.1% -0.0% 74.08 KB 74.03 KB 22.5 KB 22.49 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 38.71 KB 38.71 KB 9.41 KB 9.42 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 12.73 KB 12.73 KB 3.96 KB 3.97 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 540.8 KB 541.1 KB 116.63 KB 116.71 KB NODE_DEV
react-test-renderer.production.min.js -0.1% 0.0% 73.82 KB 73.77 KB 22.11 KB 22.12 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.1% 574.56 KB 574.86 KB 121.18 KB 121.26 KB FB_WWW_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% 652.59 KB 652.89 KB 140.08 KB 140.16 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 270.84 KB 270.92 KB 46.53 KB 46.55 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 282.22 KB 282.3 KB 48.67 KB 48.7 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% +0.1% 634.93 KB 635.23 KB 135.76 KB 135.84 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 🔺+0.1% 262.98 KB 263.06 KB 45.04 KB 45.07 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% +0.1% 274.36 KB 274.44 KB 47.22 KB 47.24 KB RN_OSS_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.production.min.js -0.0% 0.0% 119.66 KB 119.61 KB 37.5 KB 37.5 KB NODE_PROD
react-dom-test-utils.development.js 0.0% -0.0% 75.12 KB 75.12 KB 20.11 KB 20.1 KB UMD_DEV
ReactDOMTesting-profiling.js 0.0% 0.0% 404.81 KB 404.89 KB 73.38 KB 73.41 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 22.82 KB 22.82 KB 8.48 KB 8.48 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.9 KB 4.9 KB 1.63 KB 1.64 KB UMD_DEV
react-dom.profiling.min.js -0.0% 0.0% 123.52 KB 123.46 KB 38.63 KB 38.63 KB NODE_PROFILING
react-dom-test-utils.production.min.js 0.0% 0.0% 13.22 KB 13.22 KB 4.89 KB 4.89 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.19 KB 1.19 KB 696 B 697 B UMD_PROD
react-dom-server.node.development.js 0.0% 0.0% 147.06 KB 147.06 KB 38.88 KB 38.88 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 23.23 KB 23.23 KB 8.65 KB 8.65 KB NODE_PROD
ReactDOMForked-dev.js 0.0% 0.0% 1004.1 KB 1004.4 KB 222.45 KB 222.54 KB FB_WWW_DEV
ReactDOMForked-prod.js 0.0% 0.0% 421.26 KB 421.33 KB 75.75 KB 75.77 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.16 KB 5.16 KB 1.69 KB 1.69 KB NODE_DEV
react-dom.development.js 0.0% 0.0% 902.35 KB 902.66 KB 198.15 KB 198.24 KB UMD_DEV
ReactDOMForked-profiling.js 0.0% 0.0% 432.13 KB 432.21 KB 77.63 KB 77.66 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% 0.0% 155 KB 155 KB 39.38 KB 39.38 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.2% 1.16 KB 1.16 KB 658 B 659 B NODE_PROD
react-dom.production.min.js -0.0% -0.1% 119.52 KB 119.47 KB 38.23 KB 38.21 KB UMD_PROD
react-dom-server.browser.production.min.js 0.0% 0.0% 22.92 KB 22.92 KB 8.51 KB 8.51 KB UMD_PROD
react-dom.profiling.min.js -0.0% 0.0% 123.24 KB 123.19 KB 39.45 KB 39.45 KB UMD_PROFILING
ReactDOMTesting-dev.js 0.0% 0.0% 955.31 KB 955.61 KB 212.53 KB 212.62 KB FB_WWW_DEV
react-dom.development.js 0.0% 0.0% 859.02 KB 859.32 KB 195.69 KB 195.77 KB NODE_DEV
ReactDOMTesting-prod.js 0.0% 0.0% 404.81 KB 404.89 KB 73.38 KB 73.41 KB FB_WWW_PROD
ReactDOM-dev.js 0.0% 0.0% 1004.1 KB 1004.4 KB 222.45 KB 222.54 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 421.26 KB 421.33 KB 75.75 KB 75.77 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% 0.0% 69.97 KB 69.97 KB 19.6 KB 19.6 KB NODE_DEV
ReactDOM-profiling.js 0.0% 0.0% 432.13 KB 432.21 KB 77.63 KB 77.66 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% 0.0% 13.09 KB 13.09 KB 4.8 KB 4.8 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 56.1 KB 56.1 KB 13.84 KB 13.84 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1 KB 1 KB 608 B 610 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.98 KB 9.98 KB 3.35 KB 3.36 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 53.2 KB 53.2 KB 13.64 KB 13.64 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 9.73 KB 9.73 KB 3.25 KB 3.25 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 573.15 KB 573.45 KB 121.25 KB 121.33 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% 0.0% 16.22 KB 16.22 KB 4.91 KB 4.91 KB NODE_DEV
react-reconciler.production.min.js -0.1% -0.0% 77.06 KB 77 KB 22.78 KB 22.78 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.57 KB 2.57 KB 1.08 KB 1.08 KB NODE_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against d1270e9

@sizebot
Copy link

@sizebot sizebot commented Apr 8, 2020

Details of bundled changes.

Comparing: 2def7b3...d1270e9

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% +0.1% 649.49 KB 649.8 KB 136.38 KB 136.46 KB UMD_DEV
react-art.production.min.js -0.0% 🔺+0.1% 109.62 KB 109.57 KB 33.05 KB 33.08 KB UMD_PROD
react-art.development.js +0.1% +0.1% 553.26 KB 553.56 KB 118.85 KB 118.93 KB NODE_DEV
react-art.production.min.js -0.1% 0.0% 74.6 KB 74.54 KB 22.25 KB 22.25 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 585.3 KB 585.6 KB 122.83 KB 122.91 KB FB_WWW_DEV
ReactART-prod.js 0.0% 🔺+0.1% 240.25 KB 240.33 KB 40.57 KB 40.6 KB FB_WWW_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactTestRenderer-dev.js +0.1% +0.1% 574.57 KB 574.87 KB 121.19 KB 121.27 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 38.72 KB 38.72 KB 9.42 KB 9.42 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 12.74 KB 12.74 KB 3.97 KB 3.97 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 567.21 KB 567.52 KB 117.98 KB 118.06 KB UMD_DEV
react-test-renderer.production.min.js -0.1% -0.0% 74.1 KB 74.05 KB 22.51 KB 22.51 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 540.82 KB 541.12 KB 116.64 KB 116.72 KB NODE_DEV
react-test-renderer.production.min.js -0.1% 0.0% 73.85 KB 73.79 KB 22.13 KB 22.13 KB NODE_PROD

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.development.js 0.0% 0.0% 156.59 KB 156.59 KB 39.58 KB 39.58 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 23.39 KB 23.39 KB 8.6 KB 8.6 KB UMD_PROD
react-dom.profiling.min.js -0.0% 0.0% 127.79 KB 127.73 KB 39.85 KB 39.85 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.91 KB 4.91 KB 1.64 KB 1.64 KB UMD_DEV
ReactDOM-dev.js 0.0% 0.0% 976.22 KB 976.52 KB 216.45 KB 216.54 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 704 B 705 B UMD_PROD
ReactDOM-prod.js 0.0% 0.0% 408.22 KB 408.3 KB 73.86 KB 73.89 KB FB_WWW_PROD
ReactDOM-profiling.js 0.0% 0.0% 419.04 KB 419.12 KB 75.71 KB 75.74 KB FB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.43 KB 4.43 KB 1.54 KB 1.55 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.02 KB 1.02 KB 616 B 617 B NODE_PROD
react-dom-test-utils.development.js 0.0% -0.0% 75.14 KB 75.14 KB 20.11 KB 20.11 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 13.23 KB 13.23 KB 4.9 KB 4.9 KB UMD_PROD
ReactDOMTesting-dev.js 0.0% 0.0% 928.76 KB 929.06 KB 206.92 KB 207.01 KB FB_WWW_DEV
ReactDOMTesting-prod.js 0.0% 0.0% 392.86 KB 392.94 KB 71.59 KB 71.62 KB FB_WWW_PROD
ReactDOMTesting-profiling.js 0.0% 0.0% 392.86 KB 392.94 KB 71.59 KB 71.62 KB FB_WWW_PROFILING
react-dom-server.node.development.js 0.0% 0.0% 148.58 KB 148.58 KB 39.1 KB 39.1 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 13.1 KB 13.1 KB 4.81 KB 4.81 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 23.69 KB 23.69 KB 8.72 KB 8.72 KB NODE_PROD
react-dom.development.js 0.0% 0.0% 932.18 KB 932.49 KB 203.43 KB 203.52 KB UMD_DEV
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 56.11 KB 56.11 KB 13.85 KB 13.85 KB UMD_DEV
react-dom.production.min.js -0.0% 🔺+0.1% 123.6 KB 123.55 KB 39.37 KB 39.39 KB UMD_PROD
ReactDOMForked-dev.js 0.0% 0.0% 976.22 KB 976.52 KB 216.45 KB 216.54 KB FB_WWW_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10 KB 10 KB 3.36 KB 3.36 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.1% 127.43 KB 127.37 KB 40.65 KB 40.62 KB UMD_PROFILING
ReactDOMForked-prod.js 0.0% 0.0% 408.22 KB 408.3 KB 73.86 KB 73.89 KB FB_WWW_PROD
react-dom.development.js 0.0% 0.0% 887.61 KB 887.91 KB 200.96 KB 201.03 KB NODE_DEV
ReactDOMForked-profiling.js 0.0% 0.0% 419.04 KB 419.12 KB 75.71 KB 75.74 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 53.21 KB 53.21 KB 13.65 KB 13.65 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.18 KB 5.18 KB 1.7 KB 1.7 KB NODE_DEV
react-dom.production.min.js -0.0% -0.0% 123.81 KB 123.75 KB 38.58 KB 38.58 KB NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.75 KB 9.75 KB 3.25 KB 3.25 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.1% 1.17 KB 1.17 KB 667 B 668 B NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 270.86 KB 270.93 KB 46.53 KB 46.56 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 282.23 KB 282.31 KB 48.68 KB 48.7 KB RN_OSS_PROFILING
ReactFabric-prod.js 0.0% 🔺+0.1% 263 KB 263.08 KB 45.05 KB 45.07 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% +0.1% 274.37 KB 274.45 KB 47.22 KB 47.25 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% +0.1% 637.36 KB 637.66 KB 136.08 KB 136.16 KB RN_FB_DEV
ReactFabric-prod.js 0.0% 🔺+0.1% 263.15 KB 263.23 KB 45.09 KB 45.11 KB RN_FB_PROD
ReactNativeRenderer-dev.js 0.0% +0.1% 652.6 KB 652.9 KB 140.08 KB 140.16 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% +0.1% 274.52 KB 274.6 KB 47.25 KB 47.28 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js 0.0% +0.1% 655.01 KB 655.31 KB 140.41 KB 140.49 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 271 KB 271.08 KB 46.57 KB 46.59 KB RN_FB_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 282.37 KB 282.45 KB 48.71 KB 48.73 KB RN_FB_PROFILING
ReactFabric-dev.js 0.0% +0.1% 634.94 KB 635.24 KB 135.77 KB 135.84 KB RN_OSS_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-reflection.development.js 0.0% 0.0% 16.23 KB 16.23 KB 4.92 KB 4.92 KB NODE_DEV
react-reconciler.development.js +0.1% +0.1% 594.99 KB 595.29 KB 125.52 KB 125.6 KB NODE_DEV
react-reconciler.production.min.js -0.1% -0.0% 80.02 KB 79.97 KB 23.5 KB 23.49 KB NODE_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against d1270e9

@acdlite acdlite merged commit 2dddd1e into facebook:master Apr 8, 2020
31 checks passed
31 checks passed
ci/circleci: NODE_ENV_production_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: NODE_ENV_production_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_NODE_ENV_production_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_NODE_ENV_production_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_persistent Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: build_devtools_and_process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts_experimental Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: sizebot_experimental Your tests passed on CircleCI!
Details
ci/circleci: sizebot_stable Your tests passed on CircleCI!
Details
ci/circleci: yarn_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_flow Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_devtools Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/codesandbox Building packages succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.