diff --git a/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js b/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js index f5c9e863d31336..425bc53c6c2234 100644 --- a/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +++ b/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js @@ -1,21 +1,25 @@ /** - * Copyright (c) 2013-present, Facebook, Inc. + * 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. * - * @providesModule AnimatedTransformTestModule + * @format */ 'use strict'; -var BatchedBridge = require('BatchedBridge'); -var React = require('React'); -var StyleSheet = require('StyleSheet'); -var View = require('View'); -var TouchableOpacity = require('TouchableOpacity'); -var Text = require('Text'); -var RecordingModule = require('NativeModules').Recording; +const React = require('react'); +const { + NativeModules, + StyleSheet, + Text, + TouchableOpacity, + View, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {Recording: RecordingModule} = NativeModules; const styles = StyleSheet.create({ base: { @@ -62,7 +66,7 @@ class AnimatedTransformTestApp extends React.Component { onPress={this.toggle} testID="TouchableOpacity" style={[styles.base, this.state.flag ? styles.transformed : null]}> - TouchableOpacity + TouchableOpacity ); @@ -75,7 +79,7 @@ var AnimatedTransformTestModule = { BatchedBridge.registerCallableModule( 'AnimatedTransformTestModule', - AnimatedTransformTestModule + AnimatedTransformTestModule, ); module.exports = AnimatedTransformTestModule; diff --git a/ReactAndroid/src/androidTest/js/Asserts.js b/ReactAndroid/src/androidTest/js/Asserts.js index 0eb0fd4fa3ee50..2c9710fbd93783 100644 --- a/ReactAndroid/src/androidTest/js/Asserts.js +++ b/ReactAndroid/src/androidTest/js/Asserts.js @@ -9,7 +9,9 @@ 'use strict'; -const Assert = require('NativeModules').Assert; +const {NativeModules} = require('react-native'); + +const {Assert} = NativeModules; const Asserts = { assertEquals: function(expected, actual, msg) { diff --git a/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js b/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js index 55db2d24f44708..dd02631da37ea4 100644 --- a/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +++ b/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js @@ -9,11 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const Recording = require('NativeModules').Recording; -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const React = require('react'); +const {NativeModules, StyleSheet, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {Recording} = NativeModules; let that; diff --git a/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js b/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js index 0bc26d185e8a38..5c23e61a5ec5ae 100644 --- a/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +++ b/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js @@ -9,12 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const DatePickerAndroid = require('DatePickerAndroid'); -const React = require('React'); -const RecordingModule = require('NativeModules') - .DatePickerDialogRecordingModule; -const View = require('View'); +const React = require('react'); +const {DatePickerAndroid, NativeModules, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {DatePickerDialogRecordingModule: RecordingModule} = NativeModules; class DatePickerDialogTestApp extends React.Component { render() { diff --git a/ReactAndroid/src/androidTest/js/ImageErrorTestApp.js b/ReactAndroid/src/androidTest/js/ImageErrorTestApp.js index 0afc6c925e1225..aa651176477a9a 100644 --- a/ReactAndroid/src/androidTest/js/ImageErrorTestApp.js +++ b/ReactAndroid/src/androidTest/js/ImageErrorTestApp.js @@ -9,12 +9,10 @@ 'use strict'; -const React = require('React'); -const Image = require('Image'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const React = require('react'); +const {Image, NativeModules, StyleSheet, View} = require('react-native'); -const RecordingModule = require('NativeModules').Recording; +const {Recording: RecordingModule} = NativeModules; class ImageErrorTestApp extends React.Component { onError = e => { diff --git a/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js b/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js index 2cb30a20e1db7a..796f6a5b4f20cc 100644 --- a/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js +++ b/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js @@ -9,8 +9,8 @@ 'use strict'; -const React = require('React'); -const Image = require('Image'); +const React = require('react'); +const {Image} = require('react-native'); class ImageOverlayColorTestApp extends React.Component { render() { diff --git a/ReactAndroid/src/androidTest/js/InitialPropsTestApp.js b/ReactAndroid/src/androidTest/js/InitialPropsTestApp.js index d6a7270ba5bc5e..11f4c39f973786 100644 --- a/ReactAndroid/src/androidTest/js/InitialPropsTestApp.js +++ b/ReactAndroid/src/androidTest/js/InitialPropsTestApp.js @@ -9,13 +9,12 @@ 'use strict'; -const React = require('React'); -const RecordingModule = require('NativeModules').InitialPropsRecordingModule; -const Text = require('Text'); +const React = require('react'); +const {NativeModules, Text} = require('react-native'); class InitialPropsTestApp extends React.Component { componentDidMount() { - RecordingModule.recordProps(this.props); + NativeModules.InitialPropsRecordingModule.recordProps(this.props); } render() { diff --git a/ReactAndroid/src/androidTest/js/JSResponderTestApp.js b/ReactAndroid/src/androidTest/js/JSResponderTestApp.js index b46af65aa19b4f..24191481050ffe 100644 --- a/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +++ b/ReactAndroid/src/androidTest/js/JSResponderTestApp.js @@ -9,12 +9,14 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const Text = require('Text'); -const PanResponder = require('PanResponder'); -const ScrollView = require('ScrollView'); +const React = require('react'); +const { + PanResponder, + ScrollView, + StyleSheet, + Text, + View, +} = require('react-native'); class JSResponderTestApp extends React.Component { _handleMoveShouldSetPanResponder = (e, gestureState) => { diff --git a/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js b/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js index 7f89b087b137d6..18dd7c39f0cfe7 100644 --- a/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +++ b/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js @@ -9,11 +9,10 @@ 'use strict'; -const React = require('React'); -const View = require('View'); -const StyleSheet = require('StyleSheet'); +const React = require('react'); +const {NativeModules, StyleSheet, View} = require('react-native'); -const RecordingModule = require('NativeModules').Recording; +const {Recording: RecordingModule} = NativeModules; const LAYOUT_SPECS = [ [10, 10, 100, 100], diff --git a/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js b/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js index 7debdcd9d66d51..dfca8095e2aea3 100644 --- a/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +++ b/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js @@ -9,14 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const View = require('View'); -const StyleSheet = require('StyleSheet'); -const UIManager = require('UIManager'); +const React = require('react'); +const {StyleSheet, UIManager, View, findNodeHandle} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); -const assertEquals = require('Asserts').assertEquals; +const assertEquals = require('./Asserts').assertEquals; const styles = StyleSheet.create({ A: { @@ -50,10 +47,10 @@ let A, B, C, D; class MeasureLayoutTestApp extends React.Component { componentDidMount() { - A = ReactNative.findNodeHandle(this.refs.A); - B = ReactNative.findNodeHandle(this.refs.B); - C = ReactNative.findNodeHandle(this.refs.C); - D = ReactNative.findNodeHandle(this.refs.D); + A = findNodeHandle(this.refs.A); + B = findNodeHandle(this.refs.B); + C = findNodeHandle(this.refs.C); + D = findNodeHandle(this.refs.D); } render() { diff --git a/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js b/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js index 133161767a79be..a90a58b42d20b0 100644 --- a/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js +++ b/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js @@ -9,10 +9,10 @@ 'use strict'; -const React = require('React'); -const Recording = require('NativeModules').Recording; -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const React = require('react'); +const {NativeModules, StyleSheet, View} = require('react-native'); + +const {Recording} = NativeModules; const extractSingleTouch = nativeEvent => { const touches = nativeEvent.touches; diff --git a/ReactAndroid/src/androidTest/js/NativeIdTestModule.js b/ReactAndroid/src/androidTest/js/NativeIdTestModule.js index 161318fa10c806..42093b323c95b0 100644 --- a/ReactAndroid/src/androidTest/js/NativeIdTestModule.js +++ b/ReactAndroid/src/androidTest/js/NativeIdTestModule.js @@ -10,16 +10,18 @@ 'use strict'; -const Image = require('Image'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TextInput = require('TextInput'); -const TouchableBounce = require('TouchableBounce'); -const TouchableHighlight = require('TouchableHighlight'); -const TouchableOpacity = require('TouchableOpacity'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); +const React = require('react'); +const { + Image, + StyleSheet, + Text, + TextInput, + TouchableHighlight, + TouchableOpacity, + TouchableWithoutFeedback, + View, +} = require('react-native'); +const TouchableBounce = require('react-native/Libraries/Components/Touchable/TouchableBounce'); /** * All the views implemented on Android, each with the nativeID property set. diff --git a/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js b/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js index a2b7d3bc655d13..a4e0cc0ae67ad0 100644 --- a/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js +++ b/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js @@ -9,12 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const RecordingModule = require('NativeModules').PickerAndroidRecordingModule; -const Picker = require('Picker'); -const View = require('View'); +const React = require('react'); +const {NativeModules, Picker, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); +const {Recording: RecordingModule} = NativeModules; const Item = Picker.Item; let appInstance; diff --git a/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js b/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js index b50ba788c30c23..655c747ee7c3ae 100644 --- a/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +++ b/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js @@ -9,14 +9,14 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const ReactNative = require('react-native'); -const {StyleSheet} = ReactNative; -const ProgressBar = require('ProgressBarAndroid'); -const View = require('View'); - -const renderApplication = require('renderApplication'); +const React = require('react'); +const { + ProgressBarAndroid: ProgressBar, + StyleSheet, + View, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); +const renderApplication = require('react-native/Libraries/ReactNative/renderApplication'); class ProgressBarSampleApp extends React.Component { state = {}; diff --git a/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js b/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js index aa8fa89ab65727..5da2b7686caa9c 100644 --- a/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +++ b/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js @@ -10,14 +10,18 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const View = require('View'); -const ScrollView = require('ScrollView'); -const Text = require('Text'); -const StyleSheet = require('StyleSheet'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const ScrollListener = require('NativeModules').ScrollListener; +const React = require('react'); +const { + NativeModules, + ScrollView, + StyleSheet, + Text, + TouchableWithoutFeedback, + View, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {ScrollListener} = NativeModules; const NUM_ITEMS = 100; diff --git a/ReactAndroid/src/androidTest/js/ShareTestModule.js b/ReactAndroid/src/androidTest/js/ShareTestModule.js index 4ceadf4c105c82..fc80b761a126a3 100644 --- a/ReactAndroid/src/androidTest/js/ShareTestModule.js +++ b/ReactAndroid/src/androidTest/js/ShareTestModule.js @@ -9,11 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const RecordingModule = require('NativeModules').ShareRecordingModule; -const Share = require('Share'); -const View = require('View'); +const React = require('react'); +const {NativeModules, Share, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {ShareRecordingModule: RecordingModule} = NativeModules; class ShareTestApp extends React.Component { render() { diff --git a/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js b/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js index 307c0addb3eb4c..ee2367f8b7cbde 100644 --- a/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +++ b/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js @@ -9,13 +9,14 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); - -const requireNativeComponent = require('requireNativeComponent'); +const React = require('react'); +const { + ScrollView, + StyleSheet, + View, + requireNativeComponent, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); const ClippableView = requireNativeComponent('ClippableView'); diff --git a/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js b/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js index d52433bfa78619..2feb21e37e92ae 100644 --- a/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +++ b/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js @@ -9,16 +9,19 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const RecordingModule = require('NativeModules') - .SwipeRefreshLayoutRecordingModule; -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const RefreshControl = require('RefreshControl'); -const Text = require('Text'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); +const React = require('react'); +const { + NativeModules, + RefreshControl, + ScrollView, + StyleSheet, + Text, + TouchableWithoutFeedback, + View, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {SwipeRefreshLayoutRecordingModule: RecordingModule} = NativeModules; class Row extends React.Component { state = { diff --git a/ReactAndroid/src/androidTest/js/TestBundle.js b/ReactAndroid/src/androidTest/js/TestBundle.js index 6e910054742650..9aa42a745d9fde 100644 --- a/ReactAndroid/src/androidTest/js/TestBundle.js +++ b/ReactAndroid/src/androidTest/js/TestBundle.js @@ -13,117 +13,117 @@ console.disableYellowBox = true; // Include callable JS modules first, in case one of the other ones below throws -require('ProgressBarTestModule'); -require('ViewRenderingTestModule'); -require('TestJavaToJSArgumentsModule'); -require('TestJSLocaleModule'); -require('TestJSToJavaParametersModule'); -require('TestJavaToJSReturnValuesModule'); -require('UIManagerTestModule'); +require('./ProgressBarTestModule'); +require('./ViewRenderingTestModule'); +require('./TestJavaToJSArgumentsModule'); +require('./TestJSLocaleModule'); +require('./TestJSToJavaParametersModule'); +require('./TestJavaToJSReturnValuesModule'); +require('./UIManagerTestModule'); -require('CatalystRootViewTestModule'); -require('DatePickerDialogTestModule'); -require('MeasureLayoutTestModule'); -require('PickerAndroidTestModule'); -require('ScrollViewTestModule'); -require('ShareTestModule'); -require('SwipeRefreshLayoutTestModule'); -require('TextInputTestModule'); -require('TimePickerDialogTestModule'); +require('./CatalystRootViewTestModule'); +require('./DatePickerDialogTestModule'); +require('./MeasureLayoutTestModule'); +require('./PickerAndroidTestModule'); +require('./ScrollViewTestModule'); +require('./ShareTestModule'); +require('./SwipeRefreshLayoutTestModule'); +require('./TextInputTestModule'); +require('./TimePickerDialogTestModule'); // Define catalyst test apps used in integration tests -const AppRegistry = require('AppRegistry'); +const {AppRegistry} = require('react-native'); const apps = [ { appKey: 'AnimatedTransformTestApp', component: () => - require('AnimatedTransformTestModule').AnimatedTransformTestApp, + require('./AnimatedTransformTestModule').AnimatedTransformTestApp, }, { appKey: 'CatalystRootViewTestApp', component: () => - require('CatalystRootViewTestModule').CatalystRootViewTestApp, + require('./CatalystRootViewTestModule').CatalystRootViewTestApp, }, { appKey: 'DatePickerDialogTestApp', component: () => - require('DatePickerDialogTestModule').DatePickerDialogTestApp, + require('./DatePickerDialogTestModule').DatePickerDialogTestApp, }, { appKey: 'JSResponderTestApp', - component: () => require('JSResponderTestApp'), + component: () => require('./JSResponderTestApp'), }, { appKey: 'HorizontalScrollViewTestApp', component: () => - require('ScrollViewTestModule').HorizontalScrollViewTestApp, + require('./ScrollViewTestModule').HorizontalScrollViewTestApp, }, { appKey: 'ImageOverlayColorTestApp', - component: () => require('ImageOverlayColorTestApp'), + component: () => require('./ImageOverlayColorTestApp'), }, { appKey: 'ImageErrorTestApp', - component: () => require('ImageErrorTestApp'), + component: () => require('./ImageErrorTestApp'), }, { appKey: 'InitialPropsTestApp', - component: () => require('InitialPropsTestApp'), + component: () => require('./InitialPropsTestApp'), }, { appKey: 'LayoutEventsTestApp', - component: () => require('LayoutEventsTestApp'), + component: () => require('./LayoutEventsTestApp'), }, { appKey: 'MeasureLayoutTestApp', - component: () => require('MeasureLayoutTestModule').MeasureLayoutTestApp, + component: () => require('./MeasureLayoutTestModule').MeasureLayoutTestApp, }, { appKey: 'MultitouchHandlingTestAppModule', - component: () => require('MultitouchHandlingTestAppModule'), + component: () => require('./MultitouchHandlingTestAppModule'), }, { appKey: 'NativeIdTestApp', - component: () => require('NativeIdTestModule').NativeIdTestApp, + component: () => require('./NativeIdTestModule').NativeIdTestApp, }, { appKey: 'PickerAndroidTestApp', - component: () => require('PickerAndroidTestModule').PickerAndroidTestApp, + component: () => require('./PickerAndroidTestModule').PickerAndroidTestApp, }, { appKey: 'ScrollViewTestApp', - component: () => require('ScrollViewTestModule').ScrollViewTestApp, + component: () => require('./ScrollViewTestModule').ScrollViewTestApp, }, { appKey: 'ShareTestApp', - component: () => require('ShareTestModule').ShareTestApp, + component: () => require('./ShareTestModule').ShareTestApp, }, { appKey: 'SubviewsClippingTestApp', - component: () => require('SubviewsClippingTestModule').App, + component: () => require('./SubviewsClippingTestModule').App, }, { appKey: 'SwipeRefreshLayoutTestApp', component: () => - require('SwipeRefreshLayoutTestModule').SwipeRefreshLayoutTestApp, + require('./SwipeRefreshLayoutTestModule').SwipeRefreshLayoutTestApp, }, { appKey: 'TextInputTestApp', - component: () => require('TextInputTestModule').TextInputTestApp, + component: () => require('./TextInputTestModule').TextInputTestApp, }, { appKey: 'TestIdTestApp', - component: () => require('TestIdTestModule').TestIdTestApp, + component: () => require('./TestIdTestModule').TestIdTestApp, }, { appKey: 'TimePickerDialogTestApp', component: () => - require('TimePickerDialogTestModule').TimePickerDialogTestApp, + require('./TimePickerDialogTestModule').TimePickerDialogTestApp, }, { appKey: 'TouchBubblingTestAppModule', - component: () => require('TouchBubblingTestAppModule'), + component: () => require('./TouchBubblingTestAppModule'), }, ]; diff --git a/ReactAndroid/src/androidTest/js/TestIdTestModule.js b/ReactAndroid/src/androidTest/js/TestIdTestModule.js index 1d493d81cc8bcf..4398530ae4d81a 100644 --- a/ReactAndroid/src/androidTest/js/TestIdTestModule.js +++ b/ReactAndroid/src/androidTest/js/TestIdTestModule.js @@ -9,16 +9,18 @@ 'use strict'; -const Image = require('Image'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TextInput = require('TextInput'); -const TouchableBounce = require('TouchableBounce'); -const TouchableHighlight = require('TouchableHighlight'); -const TouchableOpacity = require('TouchableOpacity'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); +const React = require('react'); +const { + Image, + StyleSheet, + Text, + TextInput, + TouchableHighlight, + TouchableOpacity, + TouchableWithoutFeedback, + View, +} = require('react-native'); +const TouchableBounce = require('react-native/Libraries/Components/Touchable/TouchableBounce'); /** * All the views implemented on Android, each with the testID property set. diff --git a/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js b/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js index 9b57149bbc7d37..756846f976119a 100644 --- a/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +++ b/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js @@ -9,8 +9,10 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const Recording = require('NativeModules').Recording; +const {NativeModules} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {Recording} = NativeModules; const TestJSLocaleModule = { toUpper: function(s) { diff --git a/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js b/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js index 5d622af4cb49f7..cf602236522b65 100644 --- a/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +++ b/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js @@ -9,8 +9,10 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const Recording = require('NativeModules').Recording; +const {NativeModules} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {Recording} = NativeModules; const TestJSToJavaParametersModule = { returnBasicTypes: function() { diff --git a/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js b/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js index 347258ff332c0b..9340844166a69b 100644 --- a/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +++ b/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js @@ -9,8 +9,8 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const {assertEquals, assertTrue} = require('Asserts'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); +const {assertEquals, assertTrue} = require('./Asserts'); function strictStringCompare(a, b) { if (typeof a !== 'string' || typeof b !== 'string' || a.length !== b.length) { diff --git a/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js b/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js index 528861a7208dca..7cfac525898b73 100644 --- a/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +++ b/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js @@ -9,10 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); +const {NativeModules} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); -const {assertEquals, assertTrue} = require('Asserts'); -const {TestModule} = require('NativeModules'); +const {assertEquals, assertTrue} = require('./Asserts'); +const {TestModule} = NativeModules; const TestJavaToJSReturnValuesModule = { callMethod: function(methodName, expectedType, expectedJSON) { diff --git a/ReactAndroid/src/androidTest/js/TextInputTestModule.js b/ReactAndroid/src/androidTest/js/TextInputTestModule.js index cf7c52791c68a6..4d994fdf759419 100644 --- a/ReactAndroid/src/androidTest/js/TextInputTestModule.js +++ b/ReactAndroid/src/androidTest/js/TextInputTestModule.js @@ -9,14 +9,17 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TextInput = require('TextInput'); -const View = require('View'); +const React = require('react'); +const { + NativeModules, + StyleSheet, + Text, + TextInput, + View, +} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); -const Recording = require('NativeModules').Recording; +const {Recording} = NativeModules; let app; diff --git a/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js b/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js index 754ae7f28dec40..987e7cd2ca2b34 100644 --- a/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js +++ b/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js @@ -9,12 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const TimePickerAndroid = require('TimePickerAndroid'); -const React = require('React'); -const RecordingModule = require('NativeModules') - .TimePickerDialogRecordingModule; -const View = require('View'); +const React = require('react'); +const {NativeModules, TimePickerAndroid, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); + +const {TimePickerDialogRecordingModule: RecordingModule} = NativeModules; class TimePickerDialogTestApp extends React.Component { render() { diff --git a/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js b/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js index e3c089e2acca6a..769f740a7ecb9e 100644 --- a/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +++ b/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js @@ -9,12 +9,15 @@ 'use strict'; -const Recording = require('NativeModules').Recording; +const React = require('react'); +const { + NativeModules, + StyleSheet, + TouchableWithoutFeedback, + View, +} = require('react-native'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); +const {Recording} = NativeModules; class TouchBubblingTestApp extends React.Component { handlePress = record => { diff --git a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js index 4b75deb372cf8f..781d0aceba006e 100644 --- a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +++ b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js @@ -10,13 +10,10 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const Text = require('Text'); - -const renderApplication = require('renderApplication'); +const React = require('react'); +const {StyleSheet, Text, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); +const renderApplication = require('react-native/Libraries/ReactNative/renderApplication'); type FlexTestAppProps = $ReadOnly<{||}>; class FlexTestApp extends React.Component { diff --git a/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js b/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js index 8d8f3c244379cb..f0806d7e4fe72a 100644 --- a/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +++ b/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js @@ -9,12 +9,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const React = require('React'); -const View = require('View'); -const StyleSheet = require('StyleSheet'); +const React = require('react'); +const {StyleSheet, View} = require('react-native'); +const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge'); +const renderApplication = require('react-native/Libraries/ReactNative/renderApplication'); -const renderApplication = require('renderApplication'); class ViewSampleApp extends React.Component { state = {};