react-native-macos/React/Fabric
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
..
Mounting Bug fix: <TextInput> content is reset when emoji is entered at the max length 2021-06-04 13:40:42 -07:00
Surface Fabric: Fixed a crash caused by calling `[RCTFabricSurface start]` off the main thread 2021-03-04 09:31:23 -08:00
Utils Fabric: Removing MainRunLoopEventBeat and RuntimeEventBeat (iOS) 2020-09-11 08:23:27 -07:00
RCTConversions.h Apply clang-format update fixes 2021-01-09 22:11:00 -08:00
RCTImageResponseDelegate.h 6/6 Log image-rendered for Fabric image logging 2020-09-11 15:09:12 -07:00
RCTImageResponseObserverProxy.h move fabric to ReactCommon/react/renderer 2020-07-31 13:34:29 -07:00
RCTImageResponseObserverProxy.mm 6/6 Log image-rendered for Fabric image logging 2020-09-11 15:09:12 -07:00
RCTLocalizationProvider.h Build the basic RCTLocalizationProvider 2020-08-06 14:35:35 -07:00
RCTLocalizationProvider.mm Build the basic RCTLocalizationProvider 2020-08-06 14:35:35 -07:00
RCTPrimitives.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTScheduler.h Pass "blockNativeResponder" param to RCTMountingManager 2021-04-29 09:29:45 -07:00
RCTScheduler.mm Fix crash in PreAllocation optimization 2021-06-10 15:50:14 -07:00
RCTSurfacePresenter.h Fabric: Using `SurfaceHandler` on iOS 2021-02-24 08:29:35 -08:00
RCTSurfacePresenter.mm Wire shouldYield flag to a feature flag 2021-06-04 12:08:52 -07:00
RCTSurfacePresenterBridgeAdapter.h Tidy up license headers 2019-11-11 17:59:06 -08:00
RCTSurfacePresenterBridgeAdapter.mm Daily `arc lint --take CLANGFORMAT` 2020-09-21 04:38:18 -07:00
RCTSurfaceRegistry.h Tidy up license headers [2/n] 2019-10-16 10:06:34 -07:00
RCTSurfaceRegistry.mm Codemod: Clang-format for all files in `React/Fabric` directory 2020-02-26 21:31:12 -08:00
RCTSurfaceTouchHandler.h Breaking a retain cycle between `RCTSurfaceTouchHandler` and `RCTFabricSurface` (another approach) 2020-10-01 09:38:28 -07:00
RCTSurfaceTouchHandler.mm Send unix timestamp for touch events instead of systemUptime 2021-02-28 15:18:51 -08:00
RCTTouchableComponentViewProtocol.h move fabric to ReactCommon/react/renderer 2020-07-31 13:34:29 -07:00