Skip to content

Commit

Permalink
Replace more Haste imports with path-based imports (facebook#25001)
Browse files Browse the repository at this point in the history
Summary:
This is another step in moving RN towards standard path-based requires, updating more code to use path-based requires. See the umbrella issue at facebook#24316 for more detail.

[General] [Changed] - Replace more Haste imports with path-based imports
Pull Request resolved: facebook#25001

Differential Revision: D15467829

Pulled By: cpojer

fbshipit-source-id: 58c364bb4c1c757689907d5ed0d0f3fac0e22f3f
(cherry picked from commit a7a7970)
  • Loading branch information
ide authored and vovkasm committed Aug 6, 2019
1 parent 34c7f9e commit f737c70
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Libraries/AppState/NativeAppState.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';

export interface Spec extends TurboModule {
+getConstants: () => {|
Expand Down
56 changes: 28 additions & 28 deletions Libraries/Components/View/ReactNativeViewViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ const ReactNativeViewConfig = {
alignSelf: true,
aspectRatio: true,
backfaceVisibility: true,
backgroundColor: {process: require('processColor')},
borderBottomColor: {process: require('processColor')},
backgroundColor: {process: require('../../StyleSheet/processColor')},
borderBottomColor: {process: require('../../StyleSheet/processColor')},
borderBottomEndRadius: true,
borderBottomLeftRadius: true,
borderBottomRightRadius: true,
borderBottomStartRadius: true,
borderBottomWidth: true,
borderColor: {process: require('processColor')},
borderEndColor: {process: require('processColor')},
borderColor: {process: require('../../StyleSheet/processColor')},
borderEndColor: {process: require('../../StyleSheet/processColor')},
borderEndWidth: true,
borderLeftColor: {process: require('processColor')},
borderLeftColor: {process: require('../../StyleSheet/processColor')},
borderLeftWidth: true,
borderRadius: true,
borderRightColor: {process: require('processColor')},
borderRightColor: {process: require('../../StyleSheet/processColor')},
borderRightWidth: true,
borderStartColor: {process: require('processColor')},
borderStartColor: {process: require('../../StyleSheet/processColor')},
borderStartWidth: true,
borderStyle: true,
borderTopColor: {process: require('processColor')},
borderTopColor: {process: require('../../StyleSheet/processColor')},
borderTopEndRadius: true,
borderTopLeftRadius: true,
borderTopRightRadius: true,
Expand All @@ -156,7 +156,7 @@ const ReactNativeViewConfig = {
flexShrink: true,
flexWrap: true,
height: true,
hitSlop: {diff: (require('insetsDiffer'): any)},
hitSlop: {diff: (require('../../Utilities/differ/insetsDiffer'): any)},
importantForAccessibility: true,
justifyContent: true,
left: true,
Expand Down Expand Up @@ -199,8 +199,8 @@ const ReactNativeViewConfig = {
rotation: true,
scaleX: true,
scaleY: true,
shadowColor: {process: require('processColor')},
shadowOffset: {diff: require('sizesDiffer')},
shadowColor: {process: require('../../StyleSheet/processColor')},
shadowOffset: {diff: require('../../Utilities/differ/sizesDiffer')},
shadowOpacity: true,
shadowRadius: true,
shouldRasterizeIOS: true,
Expand All @@ -211,33 +211,33 @@ const ReactNativeViewConfig = {
alignSelf: true,
aspectRatio: true,
backfaceVisibility: true,
backgroundColor: {process: require('processColor')},
borderBottomColor: {process: require('processColor')},
backgroundColor: {process: require('../../StyleSheet/processColor')},
borderBottomColor: {process: require('../../StyleSheet/processColor')},
borderBottomEndRadius: true,
borderBottomLeftRadius: true,
borderBottomRightRadius: true,
borderBottomStartRadius: true,
borderBottomWidth: true,
borderColor: {process: require('processColor')},
borderEndColor: {process: require('processColor')},
borderColor: {process: require('../../StyleSheet/processColor')},
borderEndColor: {process: require('../../StyleSheet/processColor')},
borderEndWidth: true,
borderLeftColor: {process: require('processColor')},
borderLeftColor: {process: require('../../StyleSheet/processColor')},
borderLeftWidth: true,
borderRadius: true,
borderRightColor: {process: require('processColor')},
borderRightColor: {process: require('../../StyleSheet/processColor')},
borderRightWidth: true,
borderStartColor: {process: require('processColor')},
borderStartColor: {process: require('../../StyleSheet/processColor')},
borderStartWidth: true,
borderStyle: true,
borderTopColor: {process: require('processColor')},
borderTopColor: {process: require('../../StyleSheet/processColor')},
borderTopEndRadius: true,
borderTopLeftRadius: true,
borderTopRightRadius: true,
borderTopStartRadius: true,
borderTopWidth: true,
borderWidth: true,
bottom: true,
color: {process: require('processColor')},
color: {process: require('../../StyleSheet/processColor')},
decomposedMatrix: true,
direction: true,
display: true,
Expand Down Expand Up @@ -275,7 +275,7 @@ const ReactNativeViewConfig = {
minWidth: true,
opacity: true,
overflow: true,
overlayColor: {process: require('processColor')},
overlayColor: {process: require('../../StyleSheet/processColor')},
padding: true,
paddingBottom: true,
paddingEnd: true,
Expand All @@ -291,23 +291,23 @@ const ReactNativeViewConfig = {
rotation: true,
scaleX: true,
scaleY: true,
shadowColor: {process: require('processColor')},
shadowOffset: {diff: require('sizesDiffer')},
shadowColor: {process: require('../../StyleSheet/processColor')},
shadowOffset: {diff: require('../../Utilities/differ/sizesDiffer')},
shadowOpacity: true,
shadowRadius: true,
start: true,
textAlign: true,
textAlignVertical: true,
textDecorationColor: {process: require('processColor')},
textDecorationColor: {process: require('../../StyleSheet/processColor')},
textDecorationLine: true,
textDecorationStyle: true,
textShadowColor: {process: require('processColor')},
textShadowColor: {process: require('../../StyleSheet/processColor')},
textShadowOffset: true,
textShadowRadius: true,
textTransform: true,
tintColor: {process: require('processColor')},
tintColor: {process: require('../../StyleSheet/processColor')},
top: true,
transform: {diff: require('matricesDiffer')},
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
transformMatrix: true,
translateX: true,
translateY: true,
Expand All @@ -317,7 +317,7 @@ const ReactNativeViewConfig = {
},
testID: true,
top: true,
transform: {diff: require('matricesDiffer')},
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
translateX: true,
translateY: true,
width: true,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/View/ViewAccessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import type {SyntheticEvent} from 'CoreEventTypes';
import type {SyntheticEvent} from '../../Types/CoreEventTypes';

// This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m
export type AccessibilityRole =
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Linking/NativeLinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

'use strict';

import type {TurboModule} from 'RCTExport';
import * as TurboModuleRegistry from 'TurboModuleRegistry';
import Platform from 'Platform';
import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
import Platform from '../Utilities/Platform';

export interface Spec extends TurboModule {
// Common interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

'use strict';

const getNativeComponentAttributes = require('getNativeComponentAttributes');
const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence');
const getNativeComponentAttributes = require('../../ReactNative/getNativeComponentAttributes');
const verifyComponentAttributeEquivalence = require('../verifyComponentAttributeEquivalence');

jest.mock('getNativeComponentAttributes', () => () => ({
jest.mock('../../ReactNative/getNativeComponentAttributes', () => () => ({
NativeProps: {
value: 'BOOL',
},
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Utilities/verifyComponentAttributeEquivalence.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

'use strict';

const getNativeComponentAttributes = require('getNativeComponentAttributes');
const getNativeComponentAttributes = require('../ReactNative/getNativeComponentAttributes');

import type {ReactNativeBaseComponentViewConfig} from 'ReactNativeTypes';
import type {ReactNativeBaseComponentViewConfig} from '../Renderer/shims/ReactNativeTypes';

const IGNORED_KEYS = ['transform'];
/**
Expand Down
2 changes: 1 addition & 1 deletion RNTester/js/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {
TextInput,
View,
} = require('react-native');
const TextAncestor = require('TextAncestor');
const TextAncestor = require('../../Libraries/Text/TextAncestor');
const TextInlineView = require('./Shared/TextInlineView');
const TextLegend = require('./Shared/TextLegend');

Expand Down

0 comments on commit f737c70

Please sign in to comment.