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

Event API: responder event types should not re-register on EventComponent update #15514

Merged
merged 3 commits into from
Apr 26, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Apr 26, 2019

This PR fixes a bug where static root events incorrectly get registered multiple times. We were incorrectly re-registering the responder events during the updateEventComponent phase, when really, this never needed to be the case. This is because the responder on an event component should be static and treated as an immutable object. I've added a DEV time Object.freeze to the responder to ensure this remains consistent.

@trueadm trueadm requested a review from necolas April 26, 2019 19:43
@sizebot
Copy link

sizebot commented Apr 26, 2019

ReactDOM: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: c4d1dcb...373527c

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.0% 819.56 KB 819.43 KB 186.62 KB 186.62 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 103.68 KB 103.68 KB 33.69 KB 33.69 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 106.83 KB 106.83 KB 34.67 KB 34.67 KB UMD_PROFILING
react-dom.development.js -0.0% -0.0% 814.04 KB 813.91 KB 185.08 KB 185.08 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 103.67 KB 103.67 KB 33.13 KB 33.14 KB NODE_PROD
react-dom.profiling.min.js 0.0% 0.0% 107 KB 107 KB 33.98 KB 33.98 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 838.45 KB 838.3 KB 186.54 KB 186.53 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 0.0% 344.54 KB 344.8 KB 63.77 KB 63.78 KB FB_WWW_PROD
ReactDOM-profiling.js +0.1% 0.0% 349.93 KB 350.24 KB 64.76 KB 64.78 KB FB_WWW_PROFILING
react-dom-unstable-fire.development.js -0.0% -0.0% 819.88 KB 819.75 KB 186.76 KB 186.75 KB UMD_DEV
react-dom-unstable-fire.production.min.js 0.0% 0.0% 103.69 KB 103.69 KB 33.7 KB 33.7 KB UMD_PROD
react-dom-unstable-fire.profiling.min.js 0.0% 0.0% 106.84 KB 106.84 KB 34.68 KB 34.68 KB UMD_PROFILING
react-dom-unstable-fire.development.js -0.0% -0.0% 814.36 KB 814.23 KB 185.21 KB 185.21 KB NODE_DEV
react-dom-unstable-fire.production.min.js 0.0% 0.0% 103.69 KB 103.69 KB 33.14 KB 33.14 KB NODE_PROD
react-dom-unstable-fire.profiling.min.js 0.0% 0.0% 107.01 KB 107.01 KB 33.99 KB 33.99 KB NODE_PROFILING
ReactFire-dev.js -0.0% -0.0% 837.64 KB 837.49 KB 186.53 KB 186.52 KB FB_WWW_DEV
ReactFire-prod.js 🔺+0.1% -0.0% 332.54 KB 332.79 KB 61.37 KB 61.37 KB FB_WWW_PROD
ReactFire-profiling.js +0.1% 0.0% 337.9 KB 338.2 KB 62.34 KB 62.35 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% 0.0% 54.23 KB 54.23 KB 14.98 KB 14.98 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 10.56 KB 10.56 KB 3.89 KB 3.9 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 53.95 KB 53.95 KB 14.91 KB 14.91 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.35 KB 10.35 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.0% 10.69 KB 10.69 KB 3.67 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-server.browser.development.js 0.0% 0.0% 136.5 KB 136.5 KB 35.93 KB 35.93 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.12 KB 19.12 KB 7.21 KB 7.21 KB UMD_PROD
react-dom-server.browser.production.min.js 0.0% 0.0% 19.04 KB 19.04 KB 7.2 KB 7.2 KB NODE_PROD
ReactDOMServer-dev.js 0.0% 0.0% 134.79 KB 134.79 KB 34.63 KB 34.63 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 46.91 KB 46.91 KB 10.77 KB 10.77 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% 0.0% 134.57 KB 134.57 KB 35.54 KB 35.54 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 19.91 KB 19.91 KB 7.5 KB 7.5 KB NODE_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.1% 1.21 KB 1.21 KB 705 B 706 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 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.production.min.js 0.0% 🔺+0.1% 1.1 KB 1.1 KB 667 B 668 B NODE_PROD

Generated by 🚫 dangerJS

@trueadm trueadm changed the title Event API: root event types should not trigger invariant Event API: responder event types should not re-register on EventComponent update Apr 26, 2019
@trueadm trueadm merged commit 796c67a into facebook:master Apr 26, 2019
@trueadm trueadm deleted the add-validation-for-root branch April 26, 2019 20:33
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.

4 participants