react-native-macos/React
Joshua Gross f2e0b2f45f Fix crash in PreAllocation optimization
Summary:
PreAllocation currently always happens at revision 0 (after ShadowNode creation), and all CREATE mutations are triggered for ShadowNodes at revision 1 or higher (since CREATE mutations are generated by the differ, it means that all ShadowNodes have revision 1 or higher when CompleteRoot is called). This means that between PreAllocation and CREATE, we /always/ expect at least one clone.

It is possible for a node to be "non-view-forming" at revision 0, causing view preallocation to be skipped, and "view-forming" at revision 1 (causing the CREATE mutation to be thrown away, since all CREATE mutations of revision 0 or 1 are thrown away). This causes a crash. It is extremely marginal, but there are repros in the wild.

Thus, I'm introducing one new UIManager and Scheduler delegate method that allows the mounting layer to be notified of clones. If a clone from rev 0->1 results in a node going from non-view-forming to view-forming, we can preallocate then, as well.

This resolves this crash, and allows us to keep experimenting safely with this View PreAllocation optimization. I believe all edge-cases are accounted for.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D29043426

fbshipit-source-id: dff11d3140ded1cbb02a5518a3aeb52dc812cc50
2021-06-10 15:50:14 -07:00
..
AccessibilityResources/en.lproj VoiceOver reads Tab elements as "Tab Description" (#30689) 2021-01-15 11:09:01 -08:00
Base Support user-defined PlatformColors on iOS (#31258) 2021-06-10 12:15:12 -07:00
CoreModules Migrate RCTDevSettings to initialize 2021-05-21 14:49:51 -07:00
CxxBridge Make LeakChecker available on Android 2021-05-21 10:39:43 -07:00
CxxModule Fix crash in RCTCoreModulesClassProvider during quit 2021-04-28 13:29:06 -07:00
CxxUtils Clang format for all React Native files 2020-03-08 23:01:17 -07:00
DevSupport Respect port information if available from RCTBundleURLProvider 2020-08-28 16:01:02 -07:00
FBReactNativeSpec Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00 2021-04-29 10:39:25 -07:00
Fabric Fix crash in PreAllocation optimization 2021-06-10 15:50:14 -07:00
Inspector Clang format for all React Native files 2020-03-08 23:01:17 -07:00
Modules Bridgeless Mode: Migrate modules away from invokeJS 2021-05-14 09:22:58 -07:00
Profiler Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
Tests Fix accessibility when entire text node is a link 2021-05-11 01:23:04 -07:00
UIUtils A couple of checks for corner cases in RCTGetDimensions and RCTExportedDimensions 2020-10-01 13:19:52 -07:00
Views Add collapsable to RCTViewManager as property 2021-05-25 12:52:34 -07:00
React-RCTFabric.podspec Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00 2021-04-29 10:39:25 -07:00
third-party.xcconfig Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00 2021-04-29 10:39:25 -07:00