mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Expose eager initialization method on `RCTRootViewFactory` (iOS) so that application can prepare `ReactHost`/Bridge before actually creating a root view. Then creating a root view is significantly faster. ## Changelog: [IOS] [ADDED] - allow eager initialization of `RCTRootViewFactory` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: https://github.com/facebook/react-native/pull/49986 Test Plan: Invoke `initializeReactHostWithLaunchOptions:` before calling `viewWithModuleName:` and measure the time difference vs not using eager initilization: Before - calling `viewWithModuleName:`: 63.39ms, 47.91 ms, 60.18ms After: - calling `initializeReactHostWithLaunchOptions`: 52.41 ms, 81.03 ms, 60.52 ms - calling `viewWithModuleName`: 0.49 ms, 0.63 ms, 0.47 ms Test run 3 times on iPhone simulator on M1 mac. Reviewed By: javache Differential Revision: D71548601 Pulled By: cipolleschi fbshipit-source-id: 86ecfb8bec4c2657537caf32af49545b21d3656b