-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5550 from spicyj/cc-speed
Make createClass 10-15% faster on complex specs
- Loading branch information
Showing
2 changed files
with
259 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,243 @@ | ||
React.createClass({ | ||
displayName: "UnimplementedView", | ||
setNativeProps: function() {}, | ||
render: function() {}, | ||
}); | ||
var mixin1 = { | ||
measure: function() {}, | ||
measureLayout: function() {}, | ||
setNativeProps: function() {}, | ||
focus: function() {}, | ||
blur: function() {}, | ||
componentWillMount: function() {}, | ||
componentWillReceiveProps: function() {}, | ||
}; | ||
React.createClass({ | ||
displayName: "View", | ||
mixins: [mixin1], | ||
viewConfig: {uiViewClassName: "RCTView", validAttributes: null}, | ||
statics: {AccessibilityTraits: null, AccessibilityComponentType: null}, | ||
propTypes: {accessible: function() {}, accessibilityLabel: function() {}, accessibilityComponentType: function() {}, accessibilityLiveRegion: function() {}, importantForAccessibility: function() {}, accessibilityTraits: function() {}, onAccessibilityTap: function() {}, onMagicTap: function() {}, testID: function() {}, onResponderGrant: function() {}, onResponderMove: function() {}, onResponderReject: function() {}, onResponderRelease: function() {}, onResponderTerminate: function() {}, onResponderTerminationRequest: function() {}, onStartShouldSetResponder: function() {}, onStartShouldSetResponderCapture: function() {}, onMoveShouldSetResponder: function() {}, onMoveShouldSetResponderCapture: function() {}, onLayout: function() {}, pointerEvents: function() {}, style: function() {}, removeClippedSubviews: function() {}, renderToHardwareTextureAndroid: function() {}, shouldRasterizeIOS: function() {}, collapsable: function() {}, needsOffscreenAlphaCompositing: function() {}}, | ||
render: function() {}, | ||
}); | ||
var mixin2 = { | ||
componentWillUnmount: function() {}, | ||
setTimeout: function() {}, | ||
clearTimeout: function() {}, | ||
setInterval: function() {}, | ||
clearInterval: function() {}, | ||
setImmediate: function() {}, | ||
clearImmediate: function() {}, | ||
requestAnimationFrame: function() {}, | ||
cancelAnimationFrame: function() {}, | ||
}; | ||
var mixin3 = { | ||
componentWillUnmount: function() {}, | ||
_interactionMixinHandles: {}, | ||
createInteractionHandle: function() {}, | ||
clearInteractionHandle: function() {}, | ||
runAfterInteractions: function() {}, | ||
}; | ||
var mixin4 = { | ||
componentWillMount: function() {}, | ||
componentWillUnmount: function() {}, | ||
addListenerOn: function() {}, | ||
}; | ||
React.createClass({ | ||
displayName: "Navigator", | ||
propTypes: {configureScene: function() {}, renderScene: function() {}, initialRoute: function() {}, initialRouteStack: function() {}, onWillFocus: function() {}, onDidFocus: function() {}, navigationBar: function() {}, navigator: function() {}, sceneStyle: function() {}}, | ||
statics: {BreadcrumbNavigationBar: null, NavigationBar: null, SceneConfigs: null}, | ||
mixins: [mixin2, mixin3, mixin4], | ||
getDefaultProps: function() {}, | ||
getInitialState: function() {}, | ||
componentWillMount: function() {}, | ||
componentDidMount: function() {}, | ||
componentWillUnmount: function() {}, | ||
immediatelyResetRouteStack: function() {}, | ||
_transitionTo: function() {}, | ||
_handleSpringUpdate: function() {}, | ||
_completeTransition: function() {}, | ||
_emitDidFocus: function() {}, | ||
_emitWillFocus: function() {}, | ||
_hideScenes: function() {}, | ||
_disableScene: function() {}, | ||
_enableScene: function() {}, | ||
_onAnimationStart: function() {}, | ||
_onAnimationEnd: function() {}, | ||
_setRenderSceneToHardwareTextureAndroid: function() {}, | ||
_handleTouchStart: function() {}, | ||
_handleMoveShouldSetPanResponder: function() {}, | ||
_doesGestureOverswipe: function() {}, | ||
_deltaForGestureAction: function() {}, | ||
_handlePanResponderRelease: function() {}, | ||
_handlePanResponderTerminate: function() {}, | ||
_attachGesture: function() {}, | ||
_detachGesture: function() {}, | ||
_handlePanResponderMove: function() {}, | ||
_moveAttachedGesture: function() {}, | ||
_matchGestureAction: function() {}, | ||
_transitionSceneStyle: function() {}, | ||
_transitionBetween: function() {}, | ||
_handleResponderTerminationRequest: function() {}, | ||
_getDestIndexWithinBounds: function() {}, | ||
_jumpN: function() {}, | ||
jumpTo: function() {}, | ||
jumpForward: function() {}, | ||
jumpBack: function() {}, | ||
push: function() {}, | ||
_popN: function() {}, | ||
pop: function() {}, | ||
replaceAtIndex: function() {}, | ||
replace: function() {}, | ||
replacePrevious: function() {}, | ||
popToTop: function() {}, | ||
popToRoute: function() {}, | ||
replacePreviousAndPop: function() {}, | ||
resetTo: function() {}, | ||
getCurrentRoutes: function() {}, | ||
_cleanScenesPastIndex: function() {}, | ||
_renderScene: function() {}, | ||
_renderNavigationBar: function() {}, | ||
render: function() {}, | ||
_getNavigationContext: function() {}, | ||
}); | ||
var mixin5 = { | ||
mixins: [mixin4], | ||
statics: {DecelerationRate: null}, | ||
scrollResponderMixinGetInitialState: function() {}, | ||
scrollResponderHandleScrollShouldSetResponder: function() {}, | ||
scrollResponderHandleStartShouldSetResponder: function() {}, | ||
scrollResponderHandleStartShouldSetResponderCapture: function() {}, | ||
scrollResponderHandleResponderReject: function() {}, | ||
scrollResponderHandleTerminationRequest: function() {}, | ||
scrollResponderHandleTouchEnd: function() {}, | ||
scrollResponderHandleResponderRelease: function() {}, | ||
scrollResponderHandleScroll: function() {}, | ||
scrollResponderHandleResponderGrant: function() {}, | ||
scrollResponderHandleScrollBeginDrag: function() {}, | ||
scrollResponderHandleScrollEndDrag: function() {}, | ||
scrollResponderHandleMomentumScrollBegin: function() {}, | ||
scrollResponderHandleMomentumScrollEnd: function() {}, | ||
scrollResponderHandleTouchStart: function() {}, | ||
scrollResponderHandleTouchMove: function() {}, | ||
scrollResponderIsAnimating: function() {}, | ||
scrollResponderScrollTo: function() {}, | ||
scrollResponderScrollWithouthAnimationTo: function() {}, | ||
scrollResponderZoomTo: function() {}, | ||
scrollResponderScrollNativeHandleToKeyboard: function() {}, | ||
scrollResponderInputMeasureAndScrollToKeyboard: function() {}, | ||
scrollResponderTextInputFocusError: function() {}, | ||
componentWillMount: function() {}, | ||
scrollResponderKeyboardWillShow: function() {}, | ||
scrollResponderKeyboardWillHide: function() {}, | ||
scrollResponderKeyboardDidShow: function() {}, | ||
scrollResponderKeyboardDidHide: function() {}, | ||
}; | ||
React.createClass({ | ||
displayName: "ScrollView", | ||
propTypes: {accessible: function() {}, accessibilityLabel: function() {}, accessibilityComponentType: function() {}, accessibilityLiveRegion: function() {}, importantForAccessibility: function() {}, accessibilityTraits: function() {}, onAccessibilityTap: function() {}, onMagicTap: function() {}, testID: function() {}, onResponderGrant: function() {}, onResponderMove: function() {}, onResponderReject: function() {}, onResponderRelease: function() {}, onResponderTerminate: function() {}, onResponderTerminationRequest: function() {}, onStartShouldSetResponder: function() {}, onStartShouldSetResponderCapture: function() {}, onMoveShouldSetResponder: function() {}, onMoveShouldSetResponderCapture: function() {}, onLayout: function() {}, pointerEvents: function() {}, style: function() {}, removeClippedSubviews: function() {}, renderToHardwareTextureAndroid: function() {}, shouldRasterizeIOS: function() {}, collapsable: function() {}, needsOffscreenAlphaCompositing: function() {}, automaticallyAdjustContentInsets: function() {}, contentInset: function() {}, contentOffset: function() {}, bounces: function() {}, bouncesZoom: function() {}, alwaysBounceHorizontal: function() {}, alwaysBounceVertical: function() {}, centerContent: function() {}, contentContainerStyle: function() {}, decelerationRate: function() {}, horizontal: function() {}, directionalLockEnabled: function() {}, canCancelContentTouches: function() {}, keyboardDismissMode: function() {}, keyboardShouldPersistTaps: function() {}, maximumZoomScale: function() {}, minimumZoomScale: function() {}, onScroll: function() {}, onScrollAnimationEnd: function() {}, onContentSizeChange: function() {}, pagingEnabled: function() {}, scrollEnabled: function() {}, scrollEventThrottle: function() {}, scrollIndicatorInsets: function() {}, scrollsToTop: function() {}, showsHorizontalScrollIndicator: function() {}, showsVerticalScrollIndicator: function() {}, stickyHeaderIndices: function() {}, snapToInterval: function() {}, snapToAlignment: function() {}, zoomScale: function() {}, onRefreshStart: function() {}}, | ||
mixins: [mixin5], | ||
getInitialState: function() {}, | ||
setNativeProps: function() {}, | ||
endRefreshing: function() {}, | ||
getScrollResponder: function() {}, | ||
getInnerViewNode: function() {}, | ||
scrollTo: function() {}, | ||
scrollWithoutAnimationTo: function() {}, | ||
handleScroll: function() {}, | ||
_handleContentOnLayout: function() {}, | ||
render: function() {}, | ||
}); | ||
var mixin6 = { | ||
componentWillUnmount: function() {}, | ||
setTimeout: function() {}, | ||
clearTimeout: function() {}, | ||
setInterval: function() {}, | ||
clearInterval: function() {}, | ||
setImmediate: function() {}, | ||
clearImmediate: function() {}, | ||
requestAnimationFrame: function() {}, | ||
cancelAnimationFrame: function() {}, | ||
}; | ||
React.createClass({ | ||
displayName: "AdsManagerTabsModalView", | ||
contextTypes: {navigation: function() {}}, | ||
mixins: [mixin6, mixin4], | ||
getDefaultProps: function() {}, | ||
getInitialState: function() {}, | ||
componentWillMount: function() {}, | ||
componentDidMount: function() {}, | ||
componentWillUnmount: function() {}, | ||
onTabSelect: function() {}, | ||
_handleConnectivityChange: function() {}, | ||
_onTabTap: function() {}, | ||
startCreateFlow: function() {}, | ||
render: function() {}, | ||
_renderTabs: function() {}, | ||
_onAdCreated: function() {}, | ||
_onRemoteNotification: function() {}, | ||
_setAccountFromURL: function() {}, | ||
_updateBadgeCount: function() {}, | ||
_onRetry: function() {}, | ||
_getUnseenNotifsCount: function() {}, | ||
_pushNotifPermalink: function() {}, | ||
_onMobileConfigsLoadDone: function() {}, | ||
_getAccountRoute: function() {}, | ||
_getNotifsRoute: function() {}, | ||
_getSettingsRoute: function() {}, | ||
_getCampaignsRoute: function() {}, | ||
_getNavStack: function() {}, | ||
_onAccountChanged: function() {}, | ||
_onHelpCenterRequested: function() {}, | ||
_onGlobalError: function() {}, | ||
_onGlobalErrorToastDidClose: function() {}, | ||
_onShowNUX: function() {}, | ||
_closeToastAndPopover: function() {}, | ||
_onTabLayout: function() {}, | ||
_onRootNavigationWillChange: function() {}, | ||
_handleOpenURL: function() {}, | ||
_updateAccountIDFromInLink: function() {}, | ||
_pushInLink: function() {}, | ||
_pushExternalRoute: function() {}, | ||
_canPushExernalRoute: function() {}, | ||
_hasAccountTab: function() {}, | ||
_hasCampaignsTab: function() {}, | ||
_getTabForURL: function() {}, | ||
_getTabForExternalRoute: function() {}, | ||
}); | ||
React.createClass({ | ||
displayName: "ActionBarButton", | ||
mixins: [mixin1, mixin6], | ||
propTypes: {label: function() {}, iconOnly: function() {}, imageSource: function() {}, style: function() {}, onContentMeasured: function() {}, onPress: function() {}}, | ||
componentDidMount: function() {}, | ||
render: function() {}, | ||
}); | ||
React.createClass({ | ||
displayName: "ListView", | ||
mixins: [mixin5, mixin2], | ||
statics: {DataSource: null}, | ||
propTypes: {accessible: function() {}, accessibilityLabel: function() {}, accessibilityComponentType: function() {}, accessibilityLiveRegion: function() {}, importantForAccessibility: function() {}, accessibilityTraits: function() {}, onAccessibilityTap: function() {}, onMagicTap: function() {}, testID: function() {}, onResponderGrant: function() {}, onResponderMove: function() {}, onResponderReject: function() {}, onResponderRelease: function() {}, onResponderTerminate: function() {}, onResponderTerminationRequest: function() {}, onStartShouldSetResponder: function() {}, onStartShouldSetResponderCapture: function() {}, onMoveShouldSetResponder: function() {}, onMoveShouldSetResponderCapture: function() {}, onLayout: function() {}, pointerEvents: function() {}, style: function() {}, removeClippedSubviews: function() {}, renderToHardwareTextureAndroid: function() {}, shouldRasterizeIOS: function() {}, collapsable: function() {}, needsOffscreenAlphaCompositing: function() {}, automaticallyAdjustContentInsets: function() {}, contentInset: function() {}, contentOffset: function() {}, bounces: function() {}, bouncesZoom: function() {}, alwaysBounceHorizontal: function() {}, alwaysBounceVertical: function() {}, centerContent: function() {}, contentContainerStyle: function() {}, decelerationRate: function() {}, horizontal: function() {}, directionalLockEnabled: function() {}, canCancelContentTouches: function() {}, keyboardDismissMode: function() {}, keyboardShouldPersistTaps: function() {}, maximumZoomScale: function() {}, minimumZoomScale: function() {}, onScroll: function() {}, onScrollAnimationEnd: function() {}, onContentSizeChange: function() {}, pagingEnabled: function() {}, scrollEnabled: function() {}, scrollEventThrottle: function() {}, scrollIndicatorInsets: function() {}, scrollsToTop: function() {}, showsHorizontalScrollIndicator: function() {}, showsVerticalScrollIndicator: function() {}, stickyHeaderIndices: function() {}, snapToInterval: function() {}, snapToAlignment: function() {}, zoomScale: function() {}, onRefreshStart: function() {}, dataSource: function() {}, renderSeparator: function() {}, renderRow: function() {}, initialListSize: function() {}, onEndReached: function() {}, onEndReachedThreshold: function() {}, pageSize: function() {}, renderFooter: function() {}, renderHeader: function() {}, renderSectionHeader: function() {}, renderScrollComponent: function() {}, scrollRenderAheadDistance: function() {}, onChangeVisibleRows: function() {}}, | ||
getMetrics: function() {}, | ||
getScrollResponder: function() {}, | ||
setNativeProps: function() {}, | ||
getDefaultProps: function() {}, | ||
getInitialState: function() {}, | ||
getInnerViewNode: function() {}, | ||
componentWillMount: function() {}, | ||
componentDidMount: function() {}, | ||
componentWillReceiveProps: function() {}, | ||
componentDidUpdate: function() {}, | ||
onRowHighlighted: function() {}, | ||
render: function() {}, | ||
_measureAndUpdateScrollProps: function() {}, | ||
_onContentSizeChange: function() {}, | ||
_onLayout: function() {}, | ||
_setScrollVisibleLength: function() {}, | ||
_updateChildFrames: function() {}, | ||
_maybeCallOnEndReached: function() {}, | ||
_renderMoreRowsIfNeeded: function() {}, | ||
_pageInNewRows: function() {}, | ||
_getDistanceFromEnd: function() {}, | ||
_updateVisibleRows: function() {}, | ||
_onScroll: function() {}, | ||
}); |
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