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

Remove renderPhaseUpdates Map #17625

Merged
merged 4 commits into from Jan 17, 2020
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Dec 16, 2019

Follow up to #17484, which was reverted due to a bug found in www. (I haven't actually found this bug yet, still trying to repro.) Found and fixed

Also addresses a separate bug where updates that are thought to be render phase updates are cleared, but they are actually normal updates: 8a347ed#r36440099

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 16, 2019

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 811a659:

Sandbox Source
vigilant-lake-mb9jq Configuration

@sizebot
Copy link

sizebot commented Dec 16, 2019

Details of bundled changes.

Comparing: 29b4d07...811a659

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js +0.4% +0.1% 123.16 KB 123.66 KB 38.74 KB 38.77 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.47 KB 20.47 KB 7.5 KB 7.5 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 54.5 KB 54.5 KB 15.32 KB 15.32 KB UMD_DEV
ReactDOMServer-prod.js 0.0% 0.0% 49.02 KB 49.02 KB 11.19 KB 11.19 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.88 KB 3.88 KB 1.55 KB 1.55 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 11.18 KB 11.18 KB 4.15 KB 4.15 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 52.77 KB 52.77 KB 14.99 KB 14.99 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.95 KB 10.95 KB 4.09 KB 4.09 KB NODE_PROD
react-dom.development.js +0.7% +0.1% 948.97 KB 956.08 KB 214.69 KB 214.85 KB UMD_DEV
react-dom.production.min.js 🔺+0.4% 🔺+0.2% 119.18 KB 119.69 KB 38.29 KB 38.37 KB UMD_PROD
react-dom.profiling.min.js +0.4% +0.1% 122.92 KB 123.42 KB 39.52 KB 39.56 KB UMD_PROFILING
react-dom.development.js +0.8% +0.1% 943.03 KB 950.14 KB 212.96 KB 213.13 KB NODE_DEV
react-dom.production.min.js 🔺+0.4% 🔺+0.1% 119.28 KB 119.78 KB 37.61 KB 37.64 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.8 KB 20.8 KB 7.63 KB 7.63 KB NODE_PROD
react-dom-server.browser.development.js 0.0% 0.0% 133.66 KB 133.66 KB 35.58 KB 35.58 KB NODE_DEV
ReactDOM-dev.js +0.7% +0.1% 970.82 KB 977.96 KB 215.93 KB 216.1 KB FB_WWW_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.39 KB 20.39 KB 7.47 KB 7.47 KB NODE_PROD
ReactDOM-prod.js 🔺+0.3% 🔺+0.1% 392.95 KB 394.16 KB 71.97 KB 72.05 KB FB_WWW_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.91 KB 60.91 KB 16.07 KB 16.07 KB UMD_DEV
ReactDOM-profiling.js +0.3% +0.1% 404.25 KB 405.45 KB 74.12 KB 74.21 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.23 KB 10.23 KB 3.47 KB 3.48 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.61 KB 60.61 KB 16 KB 16 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 4.42 KB 4.42 KB 1.65 KB 1.65 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 9.97 KB 9.97 KB 3.37 KB 3.38 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.21 KB 1.21 KB 699 B 698 B NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +1.2% +0.1% 615.33 KB 622.44 KB 131.18 KB 131.33 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.7% 🔺+0.1% 71.5 KB 71.99 KB 21.91 KB 21.93 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 37.83 KB 37.83 KB 9.81 KB 9.81 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.66 KB 11.66 KB 3.6 KB 3.6 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 32.37 KB 32.37 KB 8.5 KB 8.5 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.79 KB 11.79 KB 3.71 KB 3.71 KB NODE_PROD
react-test-renderer.development.js +1.2% +0.1% 610.59 KB 617.71 KB 129.99 KB 130.15 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.7% 🔺+0.1% 71.19 KB 71.69 KB 21.53 KB 21.55 KB NODE_PROD
ReactTestRenderer-dev.js +1.1% +0.1% 626.4 KB 633.53 KB 130.8 KB 130.98 KB FB_WWW_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +1.0% +0.1% 743.4 KB 750.51 KB 157.62 KB 157.79 KB RN_OSS_DEV
ReactFabric-dev.js +1.0% +0.1% 734.02 KB 741.13 KB 155.41 KB 155.59 KB RN_OSS_DEV
ReactNativeRenderer-dev.js +1.0% +0.1% 743.58 KB 750.69 KB 157.71 KB 157.89 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.5% 🔺+0.2% 265.83 KB 267.1 KB 45.75 KB 45.83 KB RN_OSS_PROD
ReactNativeRenderer-prod.js 🔺+0.5% 🔺+0.2% 273.79 KB 275.07 KB 47.09 KB 47.16 KB RN_FB_PROD
ReactFabric-profiling.js +0.5% +0.2% 276.96 KB 278.23 KB 47.88 KB 47.96 KB RN_OSS_PROFILING
ReactNativeRenderer-profiling.js +0.4% +0.1% 284.96 KB 286.23 KB 49.23 KB 49.3 KB RN_FB_PROFILING
ReactNativeRenderer-prod.js 🔺+0.5% 🔺+0.2% 273.4 KB 274.68 KB 47.01 KB 47.09 KB RN_OSS_PROD
ReactFabric-dev.js +1.0% +0.1% 734.2 KB 741.31 KB 155.5 KB 155.67 KB RN_FB_DEV
ReactNativeRenderer-profiling.js +0.4% +0.1% 284.58 KB 285.85 KB 49.16 KB 49.23 KB RN_OSS_PROFILING
ReactFabric-prod.js 🔺+0.5% 🔺+0.2% 266.18 KB 267.45 KB 45.83 KB 45.9 KB RN_FB_PROD
ReactFabric-profiling.js +0.5% +0.2% 277.3 KB 278.58 KB 47.94 KB 48.02 KB RN_FB_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js +1.2% +0.1% 614.81 KB 621.94 KB 128.27 KB 128.44 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.5% 🔺+0.2% 235.52 KB 236.72 KB 39.83 KB 39.91 KB FB_WWW_PROD
react-art.development.js +1.1% +0.1% 670.29 KB 677.41 KB 145.56 KB 145.72 KB UMD_DEV
react-art.production.min.js 🔺+0.5% 🔺+0.1% 106.83 KB 107.32 KB 32.5 KB 32.52 KB UMD_PROD
react-art.development.js +1.2% +0.1% 600.97 KB 608.09 KB 128.15 KB 128.3 KB NODE_DEV
react-art.production.min.js 🔺+0.7% 🔺+0.2% 71.78 KB 72.29 KB 21.64 KB 21.68 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.development.js +1.2% +0.1% 599.42 KB 606.54 KB 126.2 KB 126.36 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.7% 🔺+0.3% 72.09 KB 72.59 KB 21.24 KB 21.31 KB NODE_PROD
react-reconciler.development.js +1.2% +0.1% 601.97 KB 609.09 KB 127.31 KB 127.47 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.7% 🔺+0.2% 74.79 KB 75.29 KB 21.91 KB 21.96 KB NODE_PROD

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

Size changes (experimental)

Generated by 🚫 dangerJS against 811a659

@sizebot
Copy link

sizebot commented Dec 16, 2019

Details of bundled changes.

Comparing: 29b4d07...811a659

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.production.min.js 🔺+0.5% 🔺+0.1% 104.33 KB 104.82 KB 31.8 KB 31.83 KB UMD_PROD
react-art.development.js +1.1% +0.1% 670.27 KB 677.39 KB 145.55 KB 145.71 KB UMD_DEV
react-art.development.js +1.2% +0.1% 600.95 KB 608.07 KB 128.14 KB 128.29 KB NODE_DEV
react-art.production.min.js 🔺+0.7% 🔺+0.2% 69.33 KB 69.83 KB 20.96 KB 21.01 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.production.min.js 🔺+0.7% 🔺+0.3% 72.08 KB 72.58 KB 21.23 KB 21.3 KB NODE_PROD
react-reconciler.development.js +1.2% +0.1% 601.96 KB 609.08 KB 127.31 KB 127.47 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.7% 🔺+0.3% 72.06 KB 72.57 KB 21.23 KB 21.29 KB NODE_PROD
react-reconciler-persistent.development.js +1.2% +0.1% 599.41 KB 606.53 KB 126.19 KB 126.36 KB NODE_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFabric-dev.js +1.0% +0.1% 734.01 KB 741.12 KB 155.4 KB 155.58 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.5% 🔺+0.2% 265.82 KB 267.09 KB 45.75 KB 45.82 KB RN_OSS_PROD
ReactNativeRenderer-dev.js +1.0% +0.1% 743.39 KB 750.5 KB 157.62 KB 157.79 KB RN_OSS_DEV
ReactFabric-profiling.js +0.5% +0.2% 276.95 KB 278.22 KB 47.87 KB 47.95 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 🔺+0.5% 🔺+0.2% 273.39 KB 274.66 KB 47.01 KB 47.08 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.4% +0.1% 284.56 KB 285.84 KB 49.15 KB 49.22 KB RN_OSS_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.94 KB 19.94 KB 7.4 KB 7.4 KB NODE_PROD
react-dom.production.min.js 🔺+0.4% 🔺+0.2% 115.35 KB 115.85 KB 37.18 KB 37.25 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.59 KB 60.59 KB 15.99 KB 15.99 KB NODE_DEV
react-dom.profiling.min.js +0.4% +0.1% 118.98 KB 119.47 KB 38.36 KB 38.39 KB UMD_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 9.96 KB 9.96 KB 3.37 KB 3.37 KB NODE_PROD
react-dom.development.js +0.8% +0.1% 943.01 KB 950.12 KB 212.94 KB 213.1 KB NODE_DEV
react-dom.production.min.js 🔺+0.4% 🔺+0.1% 115.41 KB 115.92 KB 36.54 KB 36.59 KB NODE_PROD
react-dom.profiling.min.js +0.4% +0.1% 119.18 KB 119.68 KB 37.66 KB 37.7 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.87 KB 3.87 KB 1.54 KB 1.54 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.01 KB 20.01 KB 7.41 KB 7.41 KB UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.7 KB 3.7 KB 1.5 KB 1.5 KB NODE_DEV
react-dom-test-utils.development.js 0.0% 0.0% 54.48 KB 54.48 KB 15.31 KB 15.31 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 11.17 KB 11.17 KB 4.14 KB 4.14 KB UMD_PROD
react-dom-server.browser.development.js 0.0% 0.0% 133.64 KB 133.64 KB 35.58 KB 35.58 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.94 KB 10.94 KB 4.08 KB 4.08 KB NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 4.4 KB 4.4 KB 1.64 KB 1.64 KB NODE_DEV
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.89 KB 60.89 KB 16.06 KB 16.07 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 691 B 690 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.22 KB 10.22 KB 3.47 KB 3.47 KB UMD_PROD
react-dom-server.node.development.js 0.0% 0.0% 134.75 KB 134.75 KB 35.81 KB 35.81 KB NODE_DEV
react-dom.development.js +0.7% +0.1% 948.95 KB 956.06 KB 214.66 KB 214.82 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 20.34 KB 20.34 KB 7.55 KB 7.55 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer-shallow.development.js 0.0% 0.0% 37.81 KB 37.81 KB 9.8 KB 9.8 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.64 KB 11.64 KB 3.59 KB 3.59 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 32.35 KB 32.35 KB 8.49 KB 8.49 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.78 KB 11.78 KB 3.7 KB 3.7 KB NODE_PROD
react-test-renderer.development.js +1.2% +0.1% 615.3 KB 622.41 KB 131.16 KB 131.32 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.7% 🔺+0.1% 71.48 KB 71.96 KB 21.89 KB 21.92 KB UMD_PROD
react-test-renderer.development.js +1.2% +0.1% 610.57 KB 617.68 KB 129.98 KB 130.14 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.7% 🔺+0.1% 71.17 KB 71.67 KB 21.51 KB 21.54 KB NODE_PROD

ReactDOM: size: 🔺+0.4%, gzip: 🔺+0.2%

Size changes (stable)

Generated by 🚫 dangerJS against 811a659

//
// Only reset the updates from the queue if it has a clone. If it does
// not have a clone, that means it wasn't processed, and the updates were
// scheduled before we entered the render phase.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sebmarkbage I think if we change the list to an array, we would just need some other mechanism to determine if it was processed or not. I added tests so we don't forget.

@acdlite
Copy link
Collaborator Author

acdlite commented Dec 17, 2019

Ok I think this is ready for review now

@acdlite acdlite force-pushed the remove-render-phase-map branch 4 times, most recently from 6f4d988 to 3045820 Compare December 19, 2019 23:11
@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
@acdlite acdlite force-pushed the remove-render-phase-map branch 3 times, most recently from 33d7247 to 37d0878 Compare January 9, 2020 19:22
Follow up to facebook#17484, which was reverted due to a bug found in www.
When resetting render phase updates after a throw, we should only clear
the pending queue of hooks that were already processed.
Detects if a queue has been processed by whether the hook was cloned.
If we change the implementation to an array instead of a list, we'll
need some other mechanism to determine whether the hook was processed.
useTransition uses the state hook as part of its implementation, so we
need to fork it in the dispatcher used for re-renders, too.
@acdlite acdlite merged commit 95bd7aa into facebook:master Jan 17, 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.

None yet

5 participants