From bf43158110291ccd706c72fd606ed1a538c6e13e Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 27 May 2019 13:44:22 -0700 Subject: [PATCH] Rewrite Haste imports for more modules --- .../Animated/src/NativeAnimatedModule.js | 4 ++-- .../__tests__/MessageQueue-test.js | 2 +- .../__tests__/NativeModules-test.js | 2 +- .../ActivityIndicatorViewNativeViewConfig.js | 8 ++++---- .../PullToRefreshViewNativeViewConfig.js | 10 +++++----- .../Slider/SliderNativeComponent.js | 2 +- .../Slider/SliderNativeViewConfig.js | 20 +++++++++---------- .../specs/NativeDialogManagerAndroid.js | 4 ++-- .../androidTest/js/ScrollViewTestModule.js | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Libraries/Animated/src/NativeAnimatedModule.js b/Libraries/Animated/src/NativeAnimatedModule.js index b13d6f33191bc4..80ece9d69d04cf 100644 --- a/Libraries/Animated/src/NativeAnimatedModule.js +++ b/Libraries/Animated/src/NativeAnimatedModule.js @@ -10,8 +10,8 @@ 'use strict'; -import type {TurboModule} from 'RCTExport'; -import * as TurboModuleRegistry from 'TurboModuleRegistry'; +import type {TurboModule} from '../../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; type EndResult = {finished: boolean}; type EndCallback = (result: EndResult) => void; diff --git a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js index f8568cae72d172..0c2db74b5266e5 100644 --- a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js @@ -33,7 +33,7 @@ describe('MessageQueue', function() { beforeEach(function() { jest.resetModules(); MessageQueue = require('../MessageQueue'); - MessageQueueTestModule = require('MessageQueueTestModule'); + MessageQueueTestModule = require('../__mocks__/MessageQueueTestModule'); queue = new MessageQueue(); queue.registerCallableModule( 'MessageQueueTestModule', diff --git a/Libraries/BatchedBridge/__tests__/NativeModules-test.js b/Libraries/BatchedBridge/__tests__/NativeModules-test.js index 6457385f233acb..3bc364694ed2ac 100644 --- a/Libraries/BatchedBridge/__tests__/NativeModules-test.js +++ b/Libraries/BatchedBridge/__tests__/NativeModules-test.js @@ -40,7 +40,7 @@ describe('MessageQueue', function() { beforeEach(function() { jest.resetModules(); - global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig'); + global.__fbBatchedBridgeConfig = require('../__mocks__/MessageQueueTestConfig'); BatchedBridge = require('../BatchedBridge'); NativeModules = require('../NativeModules'); }); diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js index 0e448d1d21f24e..608f02673b8625 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js @@ -10,9 +10,9 @@ 'use strict'; -const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry'); -const ReactNativeViewViewConfig = require('ReactNativeViewViewConfig'); -const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence'); +const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry'); +const ReactNativeViewViewConfig = require('../View/ReactNativeViewViewConfig'); +const verifyComponentAttributeEquivalence = require('../../Utilities/verifyComponentAttributeEquivalence'); const ActivityIndicatorViewViewConfig = { uiViewClassName: 'RCTActivityIndicatorView', @@ -30,7 +30,7 @@ const ActivityIndicatorViewViewConfig = { ...ReactNativeViewViewConfig.validAttributes, hidesWhenStopped: true, animating: true, - color: { process: require('processColor') }, + color: { process: require('../../StyleSheet/processColor') }, size: true, }, }; diff --git a/Libraries/Components/RefreshControl/PullToRefreshViewNativeViewConfig.js b/Libraries/Components/RefreshControl/PullToRefreshViewNativeViewConfig.js index 27a1071076e540..f76c8e02dd2140 100644 --- a/Libraries/Components/RefreshControl/PullToRefreshViewNativeViewConfig.js +++ b/Libraries/Components/RefreshControl/PullToRefreshViewNativeViewConfig.js @@ -10,9 +10,9 @@ 'use strict'; -const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry'); -const ReactNativeViewViewConfig = require('ReactNativeViewViewConfig'); -const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence'); +const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry'); +const ReactNativeViewViewConfig = require('../View/ReactNativeViewViewConfig'); +const verifyComponentAttributeEquivalence = require('../../Utilities/verifyComponentAttributeEquivalence'); const PullToRefreshViewViewConfig = { uiViewClassName: 'PullToRefreshView', @@ -35,8 +35,8 @@ const PullToRefreshViewViewConfig = { validAttributes: { ...ReactNativeViewViewConfig.validAttributes, - tintColor: { process: require('processColor') }, - titleColor: { process: require('processColor') }, + tintColor: { process: require('../../StyleSheet/processColor') }, + titleColor: { process: require('../../StyleSheet/processColor') }, title: true, refreshing: true, onRefresh: true, diff --git a/Libraries/Components/Slider/SliderNativeComponent.js b/Libraries/Components/Slider/SliderNativeComponent.js index a100656c2702c3..69c659d76b3dbd 100644 --- a/Libraries/Components/Slider/SliderNativeComponent.js +++ b/Libraries/Components/Slider/SliderNativeComponent.js @@ -59,4 +59,4 @@ type Options = { type SliderType = CodegenNativeComponent<'Slider', NativeProps, Options>; -module.exports = ((require('SliderNativeViewConfig'): any): SliderType); +module.exports = ((require('./SliderNativeViewConfig'): any): SliderType); diff --git a/Libraries/Components/Slider/SliderNativeViewConfig.js b/Libraries/Components/Slider/SliderNativeViewConfig.js index 92abe056836b21..166b011ec54a93 100644 --- a/Libraries/Components/Slider/SliderNativeViewConfig.js +++ b/Libraries/Components/Slider/SliderNativeViewConfig.js @@ -10,9 +10,9 @@ 'use strict'; -const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry'); -const ReactNativeViewViewConfig = require('ReactNativeViewViewConfig'); -const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence'); +const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry'); +const ReactNativeViewViewConfig = require('../View/ReactNativeViewViewConfig'); +const verifyComponentAttributeEquivalence = require('../../Utilities/verifyComponentAttributeEquivalence'); const SliderViewConfig = { uiViewClassName: 'RCTSlider', @@ -48,17 +48,17 @@ const SliderViewConfig = { ...ReactNativeViewViewConfig.validAttributes, disabled: true, enabled: true, - maximumTrackImage: { process: require('resolveAssetSource') }, - maximumTrackTintColor: { process: require('processColor') }, + maximumTrackImage: { process: require('../../Image/resolveAssetSource') }, + maximumTrackTintColor: { process: require('../../StyleSheet/processColor') }, maximumValue: true, - minimumTrackImage: { process: require('resolveAssetSource') }, - minimumTrackTintColor: { process: require('processColor') }, + minimumTrackImage: { process: require('../../Image/resolveAssetSource') }, + minimumTrackTintColor: { process: require('../../StyleSheet/processColor') }, minimumValue: true, step: true, testID: true, - thumbImage: { process: require('resolveAssetSource') }, - thumbTintColor: { process: require('processColor') }, - trackImage: { process: require('resolveAssetSource') }, + thumbImage: { process: require('../../Image/resolveAssetSource') }, + thumbTintColor: { process: require('../../StyleSheet/processColor') }, + trackImage: { process: require('../../Image/resolveAssetSource') }, value: true, onChange: true, onValueChange: true, diff --git a/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js b/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js index 1ffb71c8ce8260..d1e1f9a7c83962 100644 --- a/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +++ b/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js @@ -10,8 +10,8 @@ 'use strict'; -import type {TurboModule} from 'RCTExport'; -import * as TurboModuleRegistry from 'TurboModuleRegistry'; +import type {TurboModule} from '../../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; /* 'buttonClicked' | 'dismissed' */ type DialogAction = string; diff --git a/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js b/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js index 5da2b7686caa9c..3e097245800083 100644 --- a/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +++ b/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js @@ -25,7 +25,7 @@ const {ScrollListener} = NativeModules; const NUM_ITEMS = 100; -import type {PressEvent} from 'CoreEventTypes'; +import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes'; // Shared by integration tests for ScrollView and HorizontalScrollView