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

Fix host bailout for the persistent mode #13611

Merged
merged 4 commits into from
Sep 10, 2018
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Sep 10, 2018

As we found internally, #13423 broke the persistent mode used by Fabric.

We should still clone if children are unchanged, but there's no need to calculate the diff between identical props. I forked the implementation into mutating and persistent paths, kept the simple check in the mutating mode, and rearranged the code a bit in the persistent mode to combine it with the existing bailout.

I added a new test suite based on ReactIncrementalUpdatesMinimalism but tweaked for the clone case. This way we won't regress it again.

This is mostly copy paste. But I added a bailout only to mutation mode. Persistent mode doesn't have that props equality bailout anymore, so the Fabric test now passes.
@pull-bot
Copy link

pull-bot commented Sep 10, 2018

ReactDOM: size: -0.1%, gzip: -0.1%

Details of bundled changes.

Comparing: 03ab1ef...ec384d0

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.1% 0.0% 646.72 KB 647.13 KB 151.69 KB 151.76 KB UMD_DEV
react-dom.production.min.js -0.1% -0.1% 92.32 KB 92.27 KB 30.07 KB 30.03 KB UMD_PROD
react-dom.development.js +0.1% 0.0% 642.09 KB 642.49 KB 150.3 KB 150.37 KB NODE_DEV
react-dom.production.min.js -0.0% -0.1% 92.27 KB 92.25 KB 29.72 KB 29.69 KB NODE_PROD
ReactDOM-dev.js 0.0% +0.1% 664.52 KB 664.85 KB 152.65 KB 152.78 KB FB_WWW_DEV
ReactDOM-prod.js -0.5% -0.1% 287.57 KB 286.18 KB 53.2 KB 53.14 KB FB_WWW_PROD
react-dom.profiling.min.js -0.0% -0.1% 95.29 KB 95.29 KB 30.39 KB 30.36 KB NODE_PROFILING
ReactDOM-profiling.js -0.4% +0.1% 294.25 KB 293.05 KB 54.57 KB 54.61 KB FB_WWW_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 440.16 KB 440.57 KB 98.78 KB 98.85 KB UMD_DEV
react-art.production.min.js -0.0% -0.0% 84.71 KB 84.68 KB 25.99 KB 25.98 KB UMD_PROD
react-art.development.js +0.1% +0.1% 371.93 KB 372.33 KB 81.66 KB 81.72 KB NODE_DEV
react-art.production.min.js -0.0% -0.1% 49.67 KB 49.65 KB 15.27 KB 15.25 KB NODE_PROD
ReactART-dev.js +0.1% +0.2% 376.98 KB 377.31 KB 80.42 KB 80.55 KB FB_WWW_DEV
ReactART-prod.js -0.1% -0.1% 160.23 KB 160 KB 27.16 KB 27.12 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% 384 KB 384.4 KB 84.25 KB 84.32 KB UMD_DEV
react-test-renderer.production.min.js -0.1% -0.0% 50.87 KB 50.84 KB 15.52 KB 15.52 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 379.6 KB 380 KB 83.12 KB 83.19 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.0% 50.58 KB 50.56 KB 15.38 KB 15.37 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.2% 384.77 KB 385.1 KB 82.15 KB 82.28 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 367.83 KB 368.24 KB 79.78 KB 79.85 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.2% 🔺+0.1% 49.24 KB 49.35 KB 14.78 KB 14.8 KB NODE_PROD
react-reconciler-persistent.development.js +0.1% +0.1% 366.37 KB 366.78 KB 79.21 KB 79.28 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.2% 🔺+0.1% 49.25 KB 49.36 KB 14.78 KB 14.8 KB NODE_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% 499.26 KB 499.58 KB 110.65 KB 110.73 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.1% -0.0% 215.13 KB 214.94 KB 37.48 KB 37.46 KB RN_FB_PROD
ReactNativeRenderer-dev.js +0.1% +0.1% 498.99 KB 499.32 KB 110.58 KB 110.66 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.1% -0.0% 204.95 KB 204.77 KB 35.84 KB 35.82 KB RN_OSS_PROD
ReactFabric-dev.js +0.1% +0.1% 489.52 KB 489.85 KB 108.26 KB 108.34 KB RN_FB_DEV
ReactFabric-prod.js -0.1% 🔺+0.1% 197.33 KB 197.18 KB 34.34 KB 34.36 KB RN_FB_PROD
ReactFabric-dev.js +0.1% +0.1% 489.56 KB 489.89 KB 108.27 KB 108.36 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% 🔺+0.1% 197.37 KB 197.22 KB 34.35 KB 34.38 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.1% -0.0% 212.64 KB 212.49 KB 37.36 KB 37.35 KB RN_OSS_PROFILING
ReactFabric-profiling.js +0.1% +0.1% 204.29 KB 204.4 KB 35.87 KB 35.91 KB RN_OSS_PROFILING
ReactNativeRenderer-profiling.js -0.1% -0.0% 221.12 KB 220.97 KB 38.86 KB 38.86 KB RN_FB_PROFILING
ReactFabric-profiling.js +0.1% +0.1% 204.25 KB 204.36 KB 35.86 KB 35.89 KB RN_FB_PROFILING

schedule

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
schedule.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
schedule.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@gaearon
Copy link
Collaborator Author

gaearon commented Sep 10, 2018

I think this is okay so I'll get it in to unblock the sync. Happy to tweak in a follow up

@gaearon gaearon merged commit f260b14 into facebook:master Sep 10, 2018
@gaearon gaearon deleted the fix-fabric branch September 10, 2018 18:08
Simek pushed a commit to Simek/react that referenced this pull request Oct 25, 2018
* Add regression test for persistent bailout bug

* Fork more logic into updateHostComponent

This is mostly copy paste. But I added a bailout only to mutation mode. Persistent mode doesn't have that props equality bailout anymore, so the Fabric test now passes.

* Add failing test for persistence host minimalism

* Add bailouts to the persistent host updates
jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
* Add regression test for persistent bailout bug

* Fork more logic into updateHostComponent

This is mostly copy paste. But I added a bailout only to mutation mode. Persistent mode doesn't have that props equality bailout anymore, so the Fabric test now passes.

* Add failing test for persistence host minimalism

* Add bailouts to the persistent host updates
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