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

Experimental event API: Support EventComponent onUnmount responder callback #15335

Merged
merged 4 commits into from
Apr 6, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Apr 5, 2019

This PR adds support for the onUnmount method on event responders. This is essential for handling cases where an event component unmounts part way through workflow of an event that has multiple states (Press, Hover etc).

To enable this, EventComponent fibers now have commit phase logic that triggers these from the DOM renderer. I also added TODOs with follow up logic to be added next week along with a test to confirm this behaviour works.

Ref #15257

@trueadm trueadm changed the title Experimental event API: Handle event component unmounting Experimental event API: Support EventComponent onUnmount responder callback Apr 5, 2019
@sizebot
Copy link

sizebot commented Apr 5, 2019

ReactDOM: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: 4fbbae8...94b87ba

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.2% +0.1% 891 KB 892.47 KB 201.48 KB 201.71 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 105.58 KB 105.58 KB 34.19 KB 34.2 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 108.59 KB 108.59 KB 34.79 KB 34.8 KB UMD_PROFILING
react-dom.development.js +0.2% +0.1% 885.63 KB 887.1 KB 199.92 KB 200.16 KB NODE_DEV
react-dom.profiling.min.js 0.0% 0.0% 108.68 KB 108.68 KB 34.23 KB 34.23 KB NODE_PROFILING
ReactDOM-dev.js +0.2% +0.1% 911.84 KB 913.23 KB 201.81 KB 202.07 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.3% 🔺+0.3% 336.04 KB 336.97 KB 61.89 KB 62.09 KB FB_WWW_PROD
ReactDOM-profiling.js +0.3% +0.3% 342.71 KB 343.64 KB 63.28 KB 63.47 KB FB_WWW_PROFILING
react-dom-unstable-fire.development.js +0.2% +0.1% 891.32 KB 892.79 KB 201.61 KB 201.85 KB UMD_DEV
react-dom-unstable-fire.production.min.js 0.0% 0.0% 105.59 KB 105.59 KB 34.2 KB 34.21 KB UMD_PROD
react-dom-unstable-fire.profiling.min.js 0.0% 0.0% 108.6 KB 108.6 KB 34.8 KB 34.81 KB UMD_PROFILING
react-dom-unstable-fire.development.js +0.2% +0.1% 885.95 KB 887.42 KB 200.05 KB 200.29 KB NODE_DEV
react-dom-unstable-fire.production.min.js 0.0% 0.0% 105.58 KB 105.58 KB 33.65 KB 33.65 KB NODE_PROD
react-dom-unstable-fire.profiling.min.js 0.0% 0.0% 108.69 KB 108.69 KB 34.24 KB 34.24 KB NODE_PROFILING
ReactFire-dev.js +0.2% +0.1% 911.03 KB 912.42 KB 201.79 KB 202.08 KB FB_WWW_DEV
ReactFire-prod.js 🔺+0.3% 🔺+0.4% 324.68 KB 325.62 KB 59.55 KB 59.76 KB FB_WWW_PROD
ReactFire-profiling.js +0.3% +0.3% 331.3 KB 332.23 KB 60.96 KB 61.14 KB FB_WWW_PROFILING
react-dom-unstable-new-scheduler.development.js +0.2% +0.1% 884.21 KB 885.68 KB 199.38 KB 199.62 KB NODE_DEV
react-dom-unstable-new-scheduler.production.min.js 0.0% 0.0% 103.65 KB 103.65 KB 33.12 KB 33.12 KB NODE_PROD
react-dom-unstable-new-scheduler.profiling.min.js 0.0% 0.0% 106.99 KB 106.99 KB 34.01 KB 34.01 KB NODE_PROFILING
ReactDOMNewScheduler-dev.js +0.2% +0.1% 911.87 KB 913.26 KB 201.82 KB 202.07 KB FB_WWW_DEV
ReactDOMNewScheduler-prod.js 🔺+0.3% 🔺+0.3% 329.99 KB 330.93 KB 61.41 KB 61.63 KB FB_WWW_PROD
ReactDOMNewScheduler-profiling.js +0.3% +0.3% 335.75 KB 336.68 KB 62.47 KB 62.64 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% 0.0% 52.68 KB 52.68 KB 14.33 KB 14.33 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.52 KB 10.52 KB 3.89 KB 3.89 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 52.41 KB 52.41 KB 14.26 KB 14.26 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.31 KB 10.31 KB 3.82 KB 3.82 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.76 KB 60.76 KB 15.85 KB 15.85 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.69 KB 10.69 KB 3.66 KB 3.67 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.43 KB 60.43 KB 15.72 KB 15.72 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.42 KB 10.42 KB 3.56 KB 3.57 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 132.57 KB 132.57 KB 34.94 KB 34.94 KB NODE_DEV
ReactDOMServer-dev.js 0.0% 0.0% 135.04 KB 135.04 KB 34.69 KB 34.69 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 47.7 KB 47.7 KB 10.95 KB 10.95 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.66 KB 3.66 KB 1.45 KB 1.45 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.21 KB 1.21 KB 704 B 706 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.2% 3.49 KB 3.49 KB 1.41 KB 1.41 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.05 KB 1.05 KB 636 B 637 B NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 3.74 KB 3.74 KB 1.43 KB 1.43 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.5% 1.1 KB 1.1 KB 665 B 668 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 638.73 KB 639.32 KB 137.95 KB 138.04 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 97.31 KB 97.31 KB 29.77 KB 29.77 KB UMD_PROD
react-art.development.js +0.1% +0.1% 569.94 KB 570.54 KB 120.67 KB 120.77 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 62.31 KB 62.31 KB 19.04 KB 19.04 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 581.18 KB 581.72 KB 120.4 KB 120.5 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.1% 🔺+0.1% 198.46 KB 198.64 KB 33.66 KB 33.7 KB FB_WWW_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% +0.1% 702.62 KB 703.16 KB 150.45 KB 150.55 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% 0.0% 246.9 KB 246.9 KB 43.19 KB 43.19 KB RN_FB_PROD
ReactNativeRenderer-profiling.js 0.0% 0.0% 252.91 KB 252.91 KB 44.51 KB 44.51 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 702.54 KB 703.07 KB 150.42 KB 150.52 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 0.0% 0.0% 246.91 KB 246.91 KB 43.19 KB 43.19 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js 0.0% 0.0% 252.93 KB 252.93 KB 44.51 KB 44.51 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.1% +0.1% 691.47 KB 692.01 KB 147.83 KB 147.92 KB RN_FB_DEV
ReactFabric-prod.js 0.0% 0.0% 240.19 KB 240.19 KB 41.93 KB 41.93 KB RN_FB_PROD
ReactFabric-profiling.js 0.0% 0.0% 245.49 KB 245.49 KB 43.27 KB 43.27 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 691.38 KB 691.92 KB 147.78 KB 147.88 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 0.0% 240.2 KB 240.2 KB 41.92 KB 41.93 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% 0.0% 245.5 KB 245.5 KB 43.27 KB 43.27 KB RN_OSS_PROFILING

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% 584.78 KB 585.21 KB 123.83 KB 123.9 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 63.62 KB 63.62 KB 19.46 KB 19.46 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 580.41 KB 580.83 KB 122.69 KB 122.76 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 63.32 KB 63.32 KB 19.27 KB 19.27 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.1% 593.08 KB 593.48 KB 123.03 KB 123.1 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 39.85 KB 39.85 KB 9.96 KB 9.96 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.7 KB 11.7 KB 3.59 KB 3.59 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 34.08 KB 34.08 KB 8.58 KB 8.58 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.89 KB 11.89 KB 3.7 KB 3.7 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.16 KB 573.7 KB 120.2 KB 120.29 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 63.31 KB 63.31 KB 18.82 KB 18.82 KB NODE_PROD
react-reconciler-persistent.development.js +0.1% +0.1% 571.04 KB 571.59 KB 119.34 KB 119.43 KB NODE_DEV
react-reconciler-persistent.production.min.js 0.0% 0.0% 63.32 KB 63.32 KB 18.82 KB 18.82 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% 0.0% 17.15 KB 17.15 KB 5.21 KB 5.21 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.43 KB 2.43 KB 1.09 KB 1.09 KB NODE_PROD

Generated by 🚫 dangerJS

@trueadm trueadm requested a review from acdlite April 5, 2019 15:48
@trueadm trueadm merged commit 4064ea9 into facebook:master Apr 6, 2019
@trueadm trueadm deleted the handle-event-component-deletion branch April 6, 2019 07:17
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
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.

None yet

4 participants