-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit. Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name) Reviewed By: TheSavior Differential Revision: D9930713 fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
- Loading branch information
1 parent
230b7b0
commit 95174d4
Showing
5 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
* @format | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* The list of non-ViewManager related UIManager properties. | ||
* | ||
* In an effort to improve startup performance by lazily loading view managers, | ||
* the interface to access view managers will change from | ||
* UIManager['viewManagerName'] to UIManager.getViewManager('viewManagerName'). | ||
* By using a function call instead of a property access, the UIManager will | ||
* be able to initialize and load the required view manager from native | ||
* synchronously. All of React Native's core components have been updated to | ||
* use getViewManager(). For the next few releases, any usage of | ||
* UIManager['viewManagerName'] will result in a warning. Because React Native | ||
* does not support Proxy objects, a view manager access is implied if any of | ||
* UIManager's properties that are not one of the properties below is being | ||
* accessed. Once UIManager property accesses for view managers has been fully | ||
* deprecated, this file will also be removed. | ||
*/ | ||
module.exports = [ | ||
'clearJSResponder', | ||
'configureNextLayoutAnimation', | ||
'createView', | ||
'dismissPopupMenu', | ||
'dispatchViewManagerCommand', | ||
'findSubviewIn', | ||
'getConstantsForViewManager', | ||
'getDefaultEventTypes', | ||
'manageChildren', | ||
'measure', | ||
'measureInWindow', | ||
'measureLayout', | ||
'measureLayoutRelativeToParent', | ||
'playTouchSound', | ||
'removeRootView', | ||
'removeSubviewsFromContainerWithID', | ||
'replaceExistingNonRootView', | ||
'sendAccessibilityEvent', | ||
'setChildren', | ||
'setJSResponder', | ||
'setLayoutAnimationEnabledExperimental', | ||
'showPopupMenu', | ||
'updateView', | ||
'viewIsDescendantOf', | ||
'PopupMenu', | ||
'LazyViewManagersEnabled', | ||
'ViewManagerNames', | ||
'StyleConstants', | ||
'AccessibilityEventTypes', | ||
'UIView', | ||
'__takeSnapshot', | ||
'takeSnapshot', | ||
'getViewManagerConfig', | ||
'measureViewsInRect', | ||
'blur', | ||
'focus', | ||
'genericBubblingEventTypes', | ||
'genericDirectEventTypes', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters