Skip to content

[react-interactions] Remove batchedUpdates from responder lifecycles#17659

Merged
trueadm merged 1 commit intofacebook:masterfrom
trueadm:flare-batched-updates
Dec 19, 2019
Merged

[react-interactions] Remove batchedUpdates from responder lifecycles#17659
trueadm merged 1 commit intofacebook:masterfrom
trueadm:flare-batched-updates

Conversation

@trueadm
Copy link
Copy Markdown
Contributor

@trueadm trueadm commented Dec 19, 2019

This PR removes the batchedUpdates wrapper from the Flare Responder lifecycle events – specifically onMount and onUnmount. The intention of having them here, was in case the responder dispatched user events that triggered state updates, which isn't the case.

By making this change, we fix an interesting bug to do with controlled components and inputting multi-byte characters in other languages. batchedUpdates has an interesting side-effect in that it calls finishEventHandler which in turn restores controlled component state and calls flushDiscreteUpdatesImpl, which is what causes this bug.

@codesandbox-ci
Copy link
Copy Markdown

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

Sandbox Source
sharp-star-836mq Configuration

@sizebot
Copy link
Copy Markdown

sizebot commented Dec 19, 2019

Details of bundled changes.

Comparing: 4c27037...6406924

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js 0.0% 0.0% 122.96 KB 122.96 KB 38.72 KB 38.72 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 20.39 KB 20.39 KB 7.48 KB 7.48 KB UMD_PROD
ReactDOMServer-prod.js 0.0% 0.0% 48.86 KB 48.86 KB 11.16 KB 11.16 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 711 B 712 B UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 52.75 KB 52.75 KB 14.99 KB 14.99 KB NODE_DEV
react-dom.development.js -0.0% -0.0% 947.06 KB 946.96 KB 214.84 KB 214.84 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 118.99 KB 118.99 KB 38.3 KB 38.3 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 122.73 KB 122.73 KB 39.42 KB 39.42 KB UMD_PROFILING
react-dom.development.js -0.0% -0.0% 941.13 KB 941.03 KB 213.19 KB 213.19 KB NODE_DEV
react-dom-server.node.development.js 0.0% 0.0% 134.59 KB 134.59 KB 35.78 KB 35.78 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 119.08 KB 119.08 KB 37.58 KB 37.58 KB NODE_PROD
react-dom-server.browser.development.js 0.0% 0.0% 133.48 KB 133.48 KB 35.55 KB 35.55 KB NODE_DEV
ReactDOM-dev.js -0.0% -0.0% 968.85 KB 968.75 KB 216.04 KB 216.03 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% 0.0% 391.47 KB 391.17 KB 71.95 KB 71.95 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% 0.0% 402.77 KB 402.47 KB 74.07 KB 74.07 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-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
ReactDOMServer-dev.js 0.0% 0.0% 139.21 KB 139.21 KB 35.41 KB 35.41 KB FB_WWW_DEV

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 6406924

@sizebot
Copy link
Copy Markdown

sizebot commented Dec 19, 2019

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 6406924

@trueadm trueadm merged commit e7494c8 into facebook:master Dec 19, 2019
@trueadm trueadm deleted the flare-batched-updates branch December 19, 2019 13:07
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