Skip to content

Commit

Permalink
Rewrite Haste imports for more modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ide committed May 27, 2019
1 parent 9560776 commit bf43158
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Libraries/Animated/src/NativeAnimatedModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/BatchedBridge/__tests__/MessageQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion Libraries/BatchedBridge/__tests__/NativeModules-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -30,7 +30,7 @@ const ActivityIndicatorViewViewConfig = {
...ReactNativeViewViewConfig.validAttributes,
hidesWhenStopped: true,
animating: true,
color: { process: require('processColor') },
color: { process: require('../../StyleSheet/processColor') },
size: true,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Slider/SliderNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ type Options = {

type SliderType = CodegenNativeComponent<'Slider', NativeProps, Options>;

module.exports = ((require('SliderNativeViewConfig'): any): SliderType);
module.exports = ((require('./SliderNativeViewConfig'): any): SliderType);
20 changes: 10 additions & 10 deletions Libraries/Components/Slider/SliderNativeViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Libraries/NativeModules/specs/NativeDialogManagerAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/androidTest/js/ScrollViewTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bf43158

Please sign in to comment.