From 14fef6474df5437e3447eb135f587ea8b5795ec9 Mon Sep 17 00:00:00 2001 From: Philipp von Weitershausen Date: Tue, 30 Jun 2015 18:44:02 -0700 Subject: [PATCH] [ReactNative] expose missing haste modules through 'react-native' node module --- Examples/UIExplorer/ActionSheetIOSExample.js | 3 ++- Examples/UIExplorer/AdSupportIOSExample.js | 3 +-- Examples/UIExplorer/MapViewExample.js | 2 +- Examples/UIExplorer/TransformExample.js | 10 ++++++---- Examples/UIExplorer/UIExplorerApp.android.js | 10 ++++++---- Examples/UIExplorer/UIExplorerList.js | 2 +- Examples/UIExplorer/WebViewExample.js | 1 - Libraries/react-native/react-native.js | 4 ++++ 8 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Examples/UIExplorer/ActionSheetIOSExample.js b/Examples/UIExplorer/ActionSheetIOSExample.js index 86a3b96db..5c6ba8f96 100644 --- a/Examples/UIExplorer/ActionSheetIOSExample.js +++ b/Examples/UIExplorer/ActionSheetIOSExample.js @@ -17,11 +17,12 @@ var React = require('react-native'); var { + ActionSheetIOS, StyleSheet, Text, View, } = React; -var ActionSheetIOS = require('ActionSheetIOS'); + var BUTTONS = [ 'Button Index: 0', 'Button Index: 1', diff --git a/Examples/UIExplorer/AdSupportIOSExample.js b/Examples/UIExplorer/AdSupportIOSExample.js index ef7f076bf..1626249e7 100644 --- a/Examples/UIExplorer/AdSupportIOSExample.js +++ b/Examples/UIExplorer/AdSupportIOSExample.js @@ -15,10 +15,9 @@ */ 'use strict'; -var AdSupportIOS = require('AdSupportIOS'); - var React = require('react-native'); var { + AdSupportIOS, StyleSheet, Text, View, diff --git a/Examples/UIExplorer/MapViewExample.js b/Examples/UIExplorer/MapViewExample.js index 0d1061ace..572017574 100644 --- a/Examples/UIExplorer/MapViewExample.js +++ b/Examples/UIExplorer/MapViewExample.js @@ -16,9 +16,9 @@ 'use strict'; var React = require('react-native'); -var StyleSheet = require('StyleSheet'); var { MapView, + StyleSheet, Text, TextInput, View, diff --git a/Examples/UIExplorer/TransformExample.js b/Examples/UIExplorer/TransformExample.js index a59a019b3..9e848c3a5 100644 --- a/Examples/UIExplorer/TransformExample.js +++ b/Examples/UIExplorer/TransformExample.js @@ -6,12 +6,14 @@ 'use strict'; var React = require('React'); +var { + StyleSheet, + View, +} = React; -var StyleSheet = require('StyleSheet'); var TimerMixin = require('react-timer-mixin'); -var UIExplorerBlock = require('UIExplorerBlock'); -var UIExplorerPage = require('UIExplorerPage'); -var View = require('View'); +var UIExplorerBlock = require('./UIExplorerBlock'); +var UIExplorerPage = require('./UIExplorerPage'); var TransformExample = React.createClass({ diff --git a/Examples/UIExplorer/UIExplorerApp.android.js b/Examples/UIExplorer/UIExplorerApp.android.js index 69767c4b7..154796cef 100644 --- a/Examples/UIExplorer/UIExplorerApp.android.js +++ b/Examples/UIExplorer/UIExplorerApp.android.js @@ -17,14 +17,16 @@ 'use strict'; var React = require('react-native'); -var Dimensions = require('Dimensions'); -var DrawerLayoutAndroid = require('DrawerLayoutAndroid'); -var ToolbarAndroid = require('ToolbarAndroid'); -var UIExplorerList = require('./UIExplorerList'); var { + Dimensions, StyleSheet, View, } = React; +var UIExplorerList = require('./UIExplorerList'); + +// TODO: these should be exposed by the 'react-native' module. +var DrawerLayoutAndroid = require('DrawerLayoutAndroid'); +var ToolbarAndroid = require('ToolbarAndroid'); var DRAWER_WIDTH_LEFT = 56; diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index fa2fe3bb2..1803c7ebd 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -21,6 +21,7 @@ var { ListView, PixelRatio, Platform, + Settings, StyleSheet, Text, TextInput, @@ -29,7 +30,6 @@ var { } = React; var { TestModule } = React.addons; -var Settings = require('Settings'); import type { ExampleModule } from 'ExampleTypes'; diff --git a/Examples/UIExplorer/WebViewExample.js b/Examples/UIExplorer/WebViewExample.js index fe3cbef6f..b9137e87c 100644 --- a/Examples/UIExplorer/WebViewExample.js +++ b/Examples/UIExplorer/WebViewExample.js @@ -16,7 +16,6 @@ 'use strict'; var React = require('react-native'); -var StyleSheet = require('StyleSheet'); var { StyleSheet, Text, diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 367276567..42cf30f51 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -42,11 +42,14 @@ var ReactNative = Object.assign(Object.create(require('React')), { WebView: require('WebView'), // APIs + ActionSheetIOS: require('ActionSheetIOS'), + AdSupportIOS: require('AdSupportIOS'), AlertIOS: require('AlertIOS'), AppRegistry: require('AppRegistry'), AppStateIOS: require('AppStateIOS'), AsyncStorage: require('AsyncStorage'), CameraRoll: require('CameraRoll'), + Dimensions: require('Dimensions'), ImagePickerIOS: require('ImagePickerIOS'), InteractionManager: require('InteractionManager'), LayoutAnimation: require('LayoutAnimation'), @@ -55,6 +58,7 @@ var ReactNative = Object.assign(Object.create(require('React')), { PanResponder: require('PanResponder'), PixelRatio: require('PixelRatio'), PushNotificationIOS: require('PushNotificationIOS'), + Settings: require('Settings'), StatusBarIOS: require('StatusBarIOS'), StyleSheet: require('StyleSheet'), VibrationIOS: require('VibrationIOS'),