From 3e153b2a5bee943f69621d05e271782e1a3b3edd Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 14 Sep 2016 02:55:24 -0700 Subject: [PATCH] Remove react-native.js.flow Summary: We've enabled getters in .flowconfig, so Flow will now understand react-native.js. We no longer need to maintain a separate file for Flow. cc bestander Closes https://github.com/facebook/react-native/pull/9892 Differential Revision: D3862560 Pulled By: bestander fbshipit-source-id: 9efb66bc885dbac80c18b4b5e3cf5362495928a9 --- Examples/UIExplorer/js/ModalExample.js | 2 +- .../UIExplorer/js/NativeAnimationsExample.js | 1 - Examples/UIExplorer/js/PickerExample.js | 2 +- .../UIExplorer/js/SwipeableListViewExample.js | 2 - Libraries/react-native/react-native.js.flow | 141 ------------------ 5 files changed, 2 insertions(+), 146 deletions(-) delete mode 100644 Libraries/react-native/react-native.js.flow diff --git a/Examples/UIExplorer/js/ModalExample.js b/Examples/UIExplorer/js/ModalExample.js index 34212f021..0c10de11b 100644 --- a/Examples/UIExplorer/js/ModalExample.js +++ b/Examples/UIExplorer/js/ModalExample.js @@ -33,7 +33,7 @@ var { TouchableHighlight, View, } = ReactNative; -// $FlowFixMe Picker.Item not properly defined for flow. + const Item = Picker.Item; exports.displayName = (undefined: ?string); diff --git a/Examples/UIExplorer/js/NativeAnimationsExample.js b/Examples/UIExplorer/js/NativeAnimationsExample.js index 515a33d37..e87a8161f 100644 --- a/Examples/UIExplorer/js/NativeAnimationsExample.js +++ b/Examples/UIExplorer/js/NativeAnimationsExample.js @@ -50,7 +50,6 @@ class Tester extends React.Component { toValue: this.current, }; - // $FlowIssue #0000000 Animated[this.props.type](this.state.native, { ...config, useNativeDriver: true }).start(); Animated[this.props.type](this.state.js, { ...config, useNativeDriver: false }).start(); }; diff --git a/Examples/UIExplorer/js/PickerExample.js b/Examples/UIExplorer/js/PickerExample.js index ac7b1c570..34024d807 100644 --- a/Examples/UIExplorer/js/PickerExample.js +++ b/Examples/UIExplorer/js/PickerExample.js @@ -33,7 +33,7 @@ const { Text, TouchableWithoutFeedback, } = ReactNative; -// $FlowFixMe found when converting React.createClass to ES6 + const Item = Picker.Item; class PickerExample extends React.Component { diff --git a/Examples/UIExplorer/js/SwipeableListViewExample.js b/Examples/UIExplorer/js/SwipeableListViewExample.js index 8d036cce0..4d37ddc9f 100644 --- a/Examples/UIExplorer/js/SwipeableListViewExample.js +++ b/Examples/UIExplorer/js/SwipeableListViewExample.js @@ -66,9 +66,7 @@ var SwipeableListViewSimpleExample = React.createClass({ dataSource={this.state.dataSource} maxSwipeDistance={100} renderQuickActions={ - /* $FlowFixMe(>=0.31.0) */ (rowData: Object, sectionID: string, rowID: string) => { - /* $FlowFixMe(>=0.31.0) */ return ( { Alert.alert('Tips', 'You could do something with this row: ' + rowData.text); diff --git a/Libraries/react-native/react-native.js.flow b/Libraries/react-native/react-native.js.flow deleted file mode 100644 index 020ddf885..000000000 --- a/Libraries/react-native/react-native.js.flow +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * This file exists because react-native.js started using getters and setters - * and Flow doesn't have a good way to enable getters and setters for - * react-native without forcing all react-native users to also enable getters - * and setters. Until we solve that issue, we can use this .flow file to - * pretend like react-native doesn't use getters and setters - * - * @flow - */ -'use strict'; - -// Export some ReactNative properties, plus native additions. -// - -// Our ReactNative.js has had its types stripped, so here we -// need to enumerate and type the properties we need access to. -// -var ReactNativeInternal = (require('react/lib/ReactNative'): { - // render - render: ( - element: ReactElement, - mountInto: number, - callback?: ?(() => void) - ) => ?ReactComponent, - // findNodeHandle - findNodeHandle: (componentOrHandle: any) => ?number, -}); - -// export -var ReactNative = { - // from ReactNative internal - findNodeHandle: ReactNativeInternal.findNodeHandle, - render: ReactNativeInternal.render, - // Components - ActivityIndicator: require('ActivityIndicator'), - ActivityIndicatorIOS: require('ActivityIndicatorIOS'), - ART: require('ReactNativeART'), - DatePickerIOS: require('DatePickerIOS'), - DrawerLayoutAndroid: require('DrawerLayoutAndroid'), - Image: require('Image'), - ImageEditor: require('ImageEditor'), - ImageStore: require('ImageStore'), - KeyboardAvoidingView: require('KeyboardAvoidingView'), - ListView: require('ListView'), - MapView: require('MapView'), - Modal: require('Modal'), - Navigator: require('Navigator'), - NavigatorIOS: require('NavigatorIOS'), - Picker: require('Picker'), - PickerIOS: require('PickerIOS'), - ProgressBarAndroid: require('ProgressBarAndroid'), - ProgressViewIOS: require('ProgressViewIOS'), - ScrollView: require('ScrollView'), - SegmentedControlIOS: require('SegmentedControlIOS'), - SliderIOS: require('SliderIOS'), - Slider: require('Slider'), - SnapshotViewIOS: require('SnapshotViewIOS'), - StatusBar: require('StatusBar'), - SwipeableListView: require('SwipeableListView'), - Switch: require('Switch'), - RecyclerViewBackedScrollView: require('RecyclerViewBackedScrollView'), - RefreshControl: require('RefreshControl'), - SwitchAndroid: require('SwitchAndroid'), - SwitchIOS: require('SwitchIOS'), - TabBarIOS: require('TabBarIOS'), - Text: require('Text'), - TextInput: require('TextInput'), - ToastAndroid: require('ToastAndroid'), - ToolbarAndroid: require('ToolbarAndroid'), - Touchable: require('Touchable'), - TouchableHighlight: require('TouchableHighlight'), - TouchableNativeFeedback: require('TouchableNativeFeedback'), - TouchableOpacity: require('TouchableOpacity'), - TouchableWithoutFeedback: require('TouchableWithoutFeedback'), - View: require('View'), - ViewPagerAndroid: require('ViewPagerAndroid'), - WebView: require('WebView'), - - // APIs - ActionSheetIOS: require('ActionSheetIOS'), - AdSupportIOS: require('AdSupportIOS'), - Alert: require('Alert'), - AlertIOS: require('AlertIOS'), - Animated: require('Animated'), - AppRegistry: require('AppRegistry'), - AppState: require('AppState'), - AppStateIOS: require('AppStateIOS'), - AsyncStorage: require('AsyncStorage'), - BackAndroid: require('BackAndroid'), - CameraRoll: require('CameraRoll'), - Clipboard: require('Clipboard'), - DatePickerAndroid: require('DatePickerAndroid'), - Dimensions: require('Dimensions'), - Easing: require('Easing'), - I18nManager: require('I18nManager'), - ImagePickerIOS: require('ImagePickerIOS'), - IntentAndroid: require('IntentAndroid'), - InteractionManager: require('InteractionManager'), - Keyboard: require('Keyboard'), - LayoutAnimation: require('LayoutAnimation'), - Linking: require('Linking'), - LinkingIOS: require('LinkingIOS'), - NativeEventEmitter: require('NativeEventEmitter'), - NavigationExperimental: require('NavigationExperimental'), - NetInfo: require('NetInfo'), - PanResponder: require('PanResponder'), - PermissionsAndroid: require('PermissionsAndroid'), - PixelRatio: require('PixelRatio'), - PushNotificationIOS: require('PushNotificationIOS'), - Settings: require('Settings'), - Share: require('Share'), - StatusBarIOS: require('StatusBarIOS'), - StyleSheet: require('StyleSheet'), - Systrace: require('Systrace'), - TimePickerAndroid: require('TimePickerAndroid'), - UIManager: require('UIManager'), - Vibration: require('Vibration'), - VibrationIOS: require('VibrationIOS'), - - // Plugins - DeviceEventEmitter: require('RCTDeviceEventEmitter'), - NativeAppEventEmitter: require('RCTNativeAppEventEmitter'), - NativeModules: require('NativeModules'), - Platform: require('Platform'), - processColor: require('processColor'), - requireNativeComponent: require('requireNativeComponent'), - - // Prop Types - ColorPropType: require('ColorPropType'), - EdgeInsetsPropType: require('EdgeInsetsPropType'), - PointPropType: require('PointPropType'), -}; - -module.exports = ReactNative;