From ef0175a5c9d686bc29adf5d8937a1e7588d39991 Mon Sep 17 00:00:00 2001 From: James Ide Date: Tue, 7 May 2019 18:36:05 -0700 Subject: [PATCH] [standards] Convert "Libraries" from Haste to standard path-based requires This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requirs. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change. Test plan: Prettier/Lint, Jest tests, loaded RNTester --- Libraries/ART/ReactNativeART.js | 10 +- Libraries/ActionSheetIOS/ActionSheetIOS.js | 5 +- Libraries/Alert/Alert.js | 4 +- Libraries/Alert/RCTAlertManager.android.js | 2 +- Libraries/Alert/RCTAlertManager.ios.js | 2 +- Libraries/Animated/src/Animated.js | 18 +- Libraries/Animated/src/AnimatedEvent.js | 2 +- Libraries/Animated/src/AnimatedMock.js | 2 +- Libraries/Animated/src/AnimatedWeb.js | 2 +- Libraries/Animated/src/Easing.js | 2 +- .../Animated/src/NativeAnimatedHelper.js | 5 +- .../Animated/src/__tests__/Animated-test.js | 10 +- .../src/__tests__/AnimatedMock-test.js | 4 +- .../src/__tests__/AnimatedNative-test.js | 27 +-- .../Animated/src/__tests__/Easing-test.js | 2 +- .../src/__tests__/Interpolation-test.js | 2 +- .../Animated/src/__tests__/bezier-test.js | 2 +- .../Animated/src/animations/Animation.js | 2 +- .../src/animations/TimingAnimation.js | 2 +- .../src/components/AnimatedFlatList.js | 4 +- .../Animated/src/components/AnimatedImage.js | 4 +- .../src/components/AnimatedScrollView.js | 4 +- .../src/components/AnimatedSectionList.js | 4 +- .../Animated/src/components/AnimatedText.js | 4 +- .../Animated/src/components/AnimatedView.js | 4 +- .../Animated/src/createAnimatedComponent.js | 4 +- .../src/nodes/AnimatedInterpolation.js | 2 +- Libraries/Animated/src/nodes/AnimatedProps.js | 2 +- Libraries/Animated/src/nodes/AnimatedStyle.js | 2 +- Libraries/Animated/src/nodes/AnimatedValue.js | 2 +- Libraries/AppState/AppState.js | 8 +- Libraries/BatchedBridge/BatchedBridge.js | 2 +- Libraries/BatchedBridge/MessageQueue.js | 8 +- Libraries/BatchedBridge/NativeModules.js | 6 +- .../__tests__/MessageQueue-test.js | 2 +- .../__tests__/NativeModules-test.js | 6 +- Libraries/Blob/Blob.js | 8 +- Libraries/Blob/BlobManager.js | 8 +- Libraries/Blob/File.js | 4 +- Libraries/Blob/FileReader.js | 4 +- Libraries/Blob/URL.js | 4 +- Libraries/Blob/__tests__/Blob-test.js | 4 +- Libraries/Blob/__tests__/BlobManager-test.js | 6 +- Libraries/Blob/__tests__/File-test.js | 6 +- Libraries/Blob/__tests__/FileReader-test.js | 6 +- Libraries/Blob/__tests__/URL-test.js | 2 +- Libraries/BugReporting/BugReporting.js | 13 +- Libraries/CameraRoll/CameraRoll.js | 5 +- Libraries/CameraRoll/ImagePickerIOS.js | 2 +- .../AccessibilityInfo.android.js | 6 +- .../AccessibilityInfo.ios.js | 6 +- .../ActivityIndicator/ActivityIndicator.js | 16 +- ...RCTActivityIndicatorViewNativeComponent.js | 8 +- .../__tests__/ActivityIndicator-test.js | 8 +- .../Components/AppleTV/TVEventHandler.js | 6 +- Libraries/Components/Button.js | 16 +- .../AndroidCheckBoxNativeComponent.js | 8 +- .../Components/CheckBox/CheckBox.android.js | 18 +- Libraries/Components/CheckBox/CheckBox.ios.js | 2 +- Libraries/Components/Clipboard/Clipboard.js | 2 +- .../DatePicker/DatePickerIOS.android.js | 8 +- .../DatePicker/DatePickerIOS.ios.js | 12 +- .../RCTDatePickerNativeComponent.js | 8 +- .../__tests__/DatePickerIOS-test.js | 8 +- .../DatePickerAndroid.android.js | 5 +- .../DatePickerAndroid.ios.js | 2 +- .../AndroidDrawerLayoutNativeComponent.js | 10 +- .../DrawerLayoutAndroid.android.js | 26 +-- .../DrawerAndroid/DrawerLayoutAndroid.ios.js | 2 +- .../__tests__/DrawerAndroid-test.js | 8 +- Libraries/Components/Keyboard/Keyboard.js | 9 +- .../Keyboard/KeyboardAvoidingView.js | 26 +-- .../Keyboard/__tests__/Keyboard-test.js | 12 +- .../MaskedView/MaskedViewIOS.android.js | 2 +- .../MaskedView/MaskedViewIOS.ios.js | 10 +- .../RCTMaskedViewNativeComponent.js | 6 +- .../__tests__/MaskedViewIOS-test.js | 12 +- .../AndroidDialogPickerNativeComponent.js | 8 +- .../AndroidDropdownPickerNativeComponent.js | 8 +- Libraries/Components/Picker/Picker.js | 16 +- .../Picker/PickerAndroid.android.js | 14 +- .../Components/Picker/PickerAndroid.ios.js | 2 +- .../Components/Picker/PickerIOS.android.js | 2 +- Libraries/Components/Picker/PickerIOS.ios.js | 22 +-- .../Picker/RCTPickerNativeComponent.js | 8 +- .../Picker/__tests__/Picker-test.js | 6 +- .../ProgressBarAndroid.android.js | 6 +- .../ProgressBarAndroid.ios.js | 2 +- .../ProgressBarAndroidNativeComponent.js | 6 +- .../__tests__/ProgressBarAndroid-test.js | 6 +- .../ProgressViewIOS.android.js | 8 +- .../ProgressViewIOS/ProgressViewIOS.ios.js | 12 +- .../RCTProgressViewNativeComponent.js | 10 +- .../__tests__/ProgressViewIOS-test.js | 6 +- ...ndroidSwipeRefreshLayoutNativeComponent.js | 10 +- .../RCTRefreshControlNativeComponent.js | 8 +- .../RefreshControl/RefreshControl.js | 16 +- .../__mocks__/RefreshControlMock.js | 4 +- .../RCTSafeAreaViewNativeComponent.js | 6 +- .../Components/SafeAreaView/SafeAreaView.js | 12 +- .../__tests__/SafeAreaView-test.js | 12 +- Libraries/Components/ScrollResponder.js | 20 +- Libraries/Components/ScrollView/ScrollView.js | 52 ++--- .../ScrollView/ScrollViewStickyHeader.js | 10 +- .../ScrollView/__mocks__/ScrollViewMock.js | 8 +- .../ScrollView/processDecelerationRate.js | 2 +- .../RCTSegmentedControlNativeComponent.js | 8 +- .../SegmentedControlIOS.android.js | 8 +- .../SegmentedControlIOS.ios.js | 10 +- .../Slider/RCTSliderNativeComponent.js | 12 +- Libraries/Components/Slider/Slider.js | 20 +- Libraries/Components/StaticContainer.react.js | 2 +- Libraries/Components/StaticRenderer.js | 2 +- Libraries/Components/StatusBar/StatusBar.js | 9 +- .../StatusBar/StatusBarIOS.android.js | 2 +- .../Components/StatusBar/StatusBarIOS.ios.js | 4 +- Libraries/Components/Switch/Switch.js | 18 +- .../Switch/SwitchNativeComponent.js | 10 +- .../TextInput/InputAccessoryView.js | 12 +- .../RCTInputAccessoryViewNativeComponent.js | 10 +- Libraries/Components/TextInput/TextInput.js | 38 ++-- .../Components/TextInput/TextInputState.js | 4 +- .../__tests__/InputAccessoryView-test.js | 10 +- .../TextInput/__tests__/TextInput-test.js | 8 +- .../TimePickerAndroid.android.js | 3 +- .../ToastAndroid/ToastAndroid.android.js | 3 +- .../ToolbarAndroid/ToolbarAndroid.android.js | 18 +- .../ToolbarAndroid/ToolbarAndroid.ios.js | 2 +- .../ToolbarAndroidNativeComponent.js | 10 +- .../Touchable/BoundingDimensions.js | 2 +- Libraries/Components/Touchable/Position.js | 2 +- Libraries/Components/Touchable/Touchable.js | 24 +-- .../Components/Touchable/TouchableBounce.js | 24 +-- .../Touchable/TouchableHighlight.js | 32 +-- .../TouchableNativeFeedback.android.js | 20 +- .../Touchable/TouchableNativeFeedback.ios.js | 8 +- .../Components/Touchable/TouchableOpacity.js | 26 +-- .../Touchable/TouchableWithoutFeedback.js | 25 ++- .../__tests__/TouchableHighlight-test.js | 6 +- .../UnimplementedNativeView.js | 8 +- .../UnimplementedViews/UnimplementedView.js | 6 +- .../View/PlatformViewPropTypes.ios.js | 2 +- .../View/ReactNativeStyleAttributes.js | 12 +- .../View/ReactNativeViewAttributes.js | 2 +- Libraries/Components/View/View.js | 6 +- .../Components/View/ViewNativeComponent.js | 6 +- Libraries/Components/View/ViewPropTypes.js | 12 +- .../AndroidViewPagerNativeComponent.js | 10 +- .../ViewPager/ViewPagerAndroid.android.js | 14 +- .../ViewPager/ViewPagerAndroid.ios.js | 2 +- .../__tests__/parseErrorStack-test.js | 2 +- Libraries/Core/Devtools/getDevServer.js | 2 +- Libraries/Core/Devtools/openFileInEditor.js | 2 +- Libraries/Core/Devtools/setupDevtools.js | 6 +- .../Core/Devtools/symbolicateStackTrace.js | 8 +- Libraries/Core/ExceptionsManager.js | 10 +- Libraries/Core/InitializeCore.js | 30 +-- Libraries/Core/ReactNativeVersionCheck.js | 4 +- .../SegmentFetcher/NativeSegmentFetcher.js | 4 +- Libraries/Core/Timers/JSTimers.js | 12 +- .../Core/__tests__/MapAndSetPolyfills-test.js | 4 +- .../__tests__/ReactNativeVersionCheck-test.js | 18 +- Libraries/Core/checkNativeVersion.js | 2 +- Libraries/Core/polyfillES6Collections.js | 8 +- Libraries/Core/polyfillPromise.js | 4 +- Libraries/Core/setUpAlert.js | 2 +- Libraries/Core/setUpBatchedBridge.js | 31 +-- Libraries/Core/setUpDeveloperTools.js | 6 +- Libraries/Core/setUpErrorHandling.js | 4 +- Libraries/Core/setUpNavigator.js | 2 +- Libraries/Core/setUpRegeneratorRuntime.js | 2 +- Libraries/Core/setUpSegmentFetcher.js | 3 +- Libraries/Core/setUpSystrace.js | 2 +- Libraries/Core/setUpTimers.js | 4 +- Libraries/Core/setUpXHR.js | 26 +-- .../DeprecatedColorPropType.js | 2 +- .../DeprecatedImagePropType.js | 8 +- .../DeprecatedImageStylePropTypes.js | 8 +- .../DeprecatedShadowPropTypesIOS.js | 2 +- .../DeprecatedStyleSheetPropType.js | 4 +- .../DeprecatedTextPropTypes.js | 8 +- .../DeprecatedTransformPropTypes.js | 2 +- .../DeprecatedViewPropTypes.js | 10 +- .../DeprecatedViewStylePropTypes.js | 8 +- .../deprecatedCreateStrictShapeTypeChecker.js | 2 +- Libraries/EventEmitter/NativeEventEmitter.js | 8 +- .../EventEmitter/RCTDeviceEventEmitter.js | 6 +- Libraries/EventEmitter/RCTEventEmitter.js | 2 +- .../EventEmitter/RCTNativeAppEventEmitter.js | 2 +- .../__mocks__/NativeEventEmitter.js | 4 +- Libraries/Experimental/Incremental.js | 6 +- Libraries/Experimental/IncrementalExample.js | 8 +- Libraries/Experimental/IncrementalGroup.js | 8 +- .../Experimental/IncrementalPresenter.js | 12 +- Libraries/Experimental/WindowedListView.js | 26 +-- Libraries/Image/AssetSourceResolver.js | 6 +- Libraries/Image/Image.android.js | 28 +-- Libraries/Image/Image.ios.js | 20 +- Libraries/Image/ImageBackground.js | 10 +- Libraries/Image/ImageEditor.js | 3 +- Libraries/Image/ImageProps.js | 12 +- Libraries/Image/ImageStore.js | 7 +- Libraries/Image/ImageViewNativeComponent.js | 2 +- Libraries/Image/RelativeImageStub.js | 2 +- .../Image/TextInlineImageNativeComponent.js | 2 +- Libraries/Image/__tests__/Image-test.js | 8 +- .../assetRelativePathInSnapshot-test.js | 6 +- .../__tests__/resolveAssetSource-test.js | 6 +- Libraries/Image/nativeImageSource.js | 2 +- Libraries/Image/resolveAssetSource.js | 8 +- Libraries/Inspector/BorderBox.js | 4 +- Libraries/Inspector/BoxInspector.js | 10 +- Libraries/Inspector/ElementBox.js | 16 +- Libraries/Inspector/ElementProperties.js | 24 +-- Libraries/Inspector/Inspector.js | 22 +-- Libraries/Inspector/InspectorOverlay.js | 16 +- Libraries/Inspector/InspectorPanel.js | 20 +- Libraries/Inspector/NetworkOverlay.js | 18 +- Libraries/Inspector/PerformanceOverlay.js | 10 +- Libraries/Inspector/StyleInspector.js | 8 +- Libraries/Inspector/resolveBoxStyle.js | 2 +- Libraries/Interaction/Batchinator.js | 2 +- .../Interaction/BridgeSpyStallHandler.js | 6 +- Libraries/Interaction/FrameRateLogger.js | 2 +- Libraries/Interaction/InteractionManager.js | 10 +- Libraries/Interaction/InteractionMixin.js | 2 +- .../Interaction/InteractionStallDebugger.js | 4 +- Libraries/Interaction/JSEventLoopWatchdog.js | 2 +- Libraries/Interaction/PanResponder.js | 2 +- Libraries/Interaction/TaskQueue.js | 2 +- .../Interaction/__tests__/Batchinator-test.js | 6 +- .../__tests__/InteractionManager-test.js | 10 +- .../__tests__/InteractionMixin-test.js | 6 +- .../Interaction/__tests__/TaskQueue-test.js | 2 +- Libraries/JSInspector/JSInspector.js | 2 +- Libraries/JSInspector/NetworkAgent.js | 8 +- Libraries/LayoutAnimation/LayoutAnimation.js | 4 +- Libraries/Linking/Linking.js | 6 +- Libraries/Lists/FlatList.js | 18 +- Libraries/Lists/SectionList.js | 12 +- Libraries/Lists/VirtualizedList.js | 32 +-- Libraries/Lists/VirtualizedSectionList.js | 12 +- .../Lists/__flowtests__/FlatList-flowtest.js | 2 +- .../__flowtests__/SectionList-flowtest.js | 2 +- .../Lists/__tests__/FillRateHelper-test.js | 2 +- Libraries/Lists/__tests__/FlatList-test.js | 4 +- Libraries/Lists/__tests__/SectionList-test.js | 4 +- .../Lists/__tests__/ViewabilityHelper-test.js | 2 +- .../Lists/__tests__/VirtualizeUtils-test.js | 5 +- .../Lists/__tests__/VirtualizedList-test.js | 4 +- .../__tests__/VirtualizedSectionList-test.js | 4 +- Libraries/Modal/Modal.js | 24 +-- .../Modal/RCTModalHostViewNativeComponent.js | 8 +- Libraries/Modal/__tests__/Modal-test.js | 8 +- Libraries/Network/NetInfo.js | 6 +- Libraries/Network/RCTNetworking.android.js | 9 +- Libraries/Network/RCTNetworking.ios.js | 9 +- Libraries/Network/XHRInterceptor.js | 2 +- Libraries/Network/XMLHttpRequest.js | 4 +- Libraries/Network/__tests__/FormData-test.js | 2 +- .../Network/__tests__/XMLHttpRequest-test.js | 32 +-- Libraries/Network/convertRequestBody.js | 6 +- Libraries/Network/fetch.js | 2 +- Libraries/Performance/PureComponentDebug.js | 2 +- Libraries/Performance/SamplingProfiler.js | 2 +- .../PermissionsAndroid/PermissionsAndroid.js | 2 +- .../PushNotificationIOS.js | 4 +- Libraries/ReactNative/AppContainer.js | 18 +- Libraries/ReactNative/AppRegistry.js | 18 +- Libraries/ReactNative/FabricUIManager.js | 2 +- Libraries/ReactNative/I18nManager.js | 3 +- Libraries/ReactNative/ReactFabricIndicator.js | 8 +- Libraries/ReactNative/ReactFabricInternals.js | 6 +- Libraries/ReactNative/UIManager.js | 8 +- Libraries/ReactNative/UIManagerStatTracker.js | 2 +- .../getNativeComponentAttributes.js | 18 +- Libraries/ReactNative/queryLayoutByID.js | 2 +- Libraries/ReactNative/renderApplication.js | 18 +- .../ReactNative/requireNativeComponent.js | 4 +- Libraries/Renderer/oss/ReactFabric-dev.js | 18 +- Libraries/Renderer/oss/ReactFabric-prod.js | 16 +- .../Renderer/oss/ReactFabric-profiling.js | 16 +- .../Renderer/oss/ReactNativeRenderer-dev.js | 18 +- .../Renderer/oss/ReactNativeRenderer-prod.js | 16 +- .../oss/ReactNativeRenderer-profiling.js | 16 +- .../Renderer/shims/NativeMethodsMixin.js | 4 +- Libraries/Renderer/shims/ReactFabric.js | 8 +- Libraries/Renderer/shims/ReactNative.js | 6 +- .../shims/createReactNativeComponentClass.js | 2 +- Libraries/Sample/Sample.ios.js | 2 +- Libraries/Settings/Settings.ios.js | 5 +- Libraries/Share/Share.js | 9 +- Libraries/Storage/AsyncStorage.js | 2 +- Libraries/StyleSheet/StyleSheet.js | 10 +- Libraries/StyleSheet/StyleSheetTypes.js | 2 +- Libraries/StyleSheet/StyleSheetValidation.js | 6 +- .../__flowtests__/StyleSheet-flowtest.js | 4 +- .../StyleSheet/__tests__/flattenStyle-test.js | 6 +- .../__tests__/normalizeColor-test.js | 2 +- .../StyleSheet/__tests__/processColor-test.js | 4 +- .../__tests__/processTransform-test.js | 2 +- .../__tests__/setNormalizedColorAlpha-test.js | 4 +- Libraries/StyleSheet/flattenStyle.js | 2 +- Libraries/StyleSheet/processColor.js | 4 +- Libraries/StyleSheet/processTransform.js | 6 +- Libraries/Text/Text.js | 22 +-- Libraries/Text/TextAncestor.js | 2 +- Libraries/Text/TextPropTypes.js | 8 +- Libraries/Text/TextProps.js | 15 +- Libraries/Text/TextStylePropTypes.js | 4 +- Libraries/TurboModule/TurboModuleRegistry.js | 4 +- .../samples/NativeSampleTurboModule.js | 4 +- Libraries/UTFSequence.js | 2 +- Libraries/Utilities/BackHandler.android.js | 5 +- Libraries/Utilities/BackHandler.ios.js | 4 +- Libraries/Utilities/DeviceInfo.js | 2 +- Libraries/Utilities/Dimensions.js | 8 +- .../Utilities/GlobalPerformanceLogger.js | 2 +- Libraries/Utilities/HMRClient.js | 9 +- Libraries/Utilities/HMRLoadingView.android.js | 2 +- Libraries/Utilities/HMRLoadingView.ios.js | 4 +- Libraries/Utilities/HeapCapture.js | 5 +- Libraries/Utilities/JSDevSupportModule.js | 4 +- .../Utilities/PerformanceLoggerContext.js | 4 +- Libraries/Utilities/PixelRatio.js | 2 +- Libraries/Utilities/Platform.android.js | 2 +- Libraries/Utilities/Platform.ios.js | 2 +- Libraries/Utilities/PolyfillFunctions.js | 2 +- Libraries/Utilities/ReactNativeTestTools.js | 2 +- .../__mocks__/GlobalPerformanceLogger.js | 4 +- .../Utilities/__tests__/DeviceInfo-test.js | 2 +- .../Utilities/__tests__/Dimensions-test.js | 4 +- .../Utilities/__tests__/MatrixMath-test.js | 2 +- .../__tests__/PerformanceLogger-test.js | 6 +- .../Utilities/__tests__/PixelRatio-test.js | 4 +- .../Utilities/__tests__/SceneTracker-test.js | 2 +- .../__tests__/binaryToBase64-test.js | 2 +- .../__tests__/buildStyleInterpolator-test.js | 2 +- Libraries/Utilities/__tests__/clamp-test.js | 2 +- .../deepFreezeAndThrowOnMutationInDev-test.js | 2 +- .../Utilities/__tests__/groupByEveryN-test.js | 2 +- Libraries/Utilities/__tests__/infoLog-test.js | 2 +- .../Utilities/__tests__/logError-test.js | 2 +- .../__tests__/mapWithSeparator-test.js | 2 +- .../Utilities/__tests__/mergeIntoFast-test.js | 2 +- .../__tests__/setAndForwardRef-test.js | 4 +- .../Utilities/__tests__/stringifySafe-test.js | 2 +- .../Utilities/__tests__/truncate-test.js | 2 +- .../Utilities/__tests__/warnOnce-test.js | 2 +- .../Utilities/createPerformanceLogger.js | 4 +- Libraries/Utilities/deprecatedPropType.js | 2 +- .../differ/__tests__/deepDiffer-test.js | 2 +- Libraries/Utilities/dismissKeyboard.js | 2 +- Libraries/Utilities/setAndForwardRef.js | 2 +- Libraries/Vibration/Vibration.js | 4 +- Libraries/WebSocket/WebSocket.js | 16 +- Libraries/WebSocket/WebSocketInterceptor.js | 5 +- .../WebSocket/__tests__/WebSocket-test.js | 6 +- Libraries/YellowBox/Data/YellowBoxCategory.js | 10 +- Libraries/YellowBox/Data/YellowBoxRegistry.js | 4 +- .../YellowBox/Data/YellowBoxSymbolication.js | 4 +- Libraries/YellowBox/Data/YellowBoxWarning.js | 10 +- .../Data/__tests__/YellowBoxCategory-test.js | 2 +- .../Data/__tests__/YellowBoxRegistry-test.js | 4 +- .../__tests__/YellowBoxSymbolication-test.js | 8 +- .../Data/__tests__/YellowBoxWarning-test.js | 8 +- Libraries/YellowBox/UI/YellowBoxButton.js | 12 +- .../YellowBox/UI/YellowBoxImageSource.js | 2 +- Libraries/YellowBox/UI/YellowBoxInspector.js | 34 ++-- .../YellowBox/UI/YellowBoxInspectorFooter.js | 14 +- .../YellowBox/UI/YellowBoxInspectorHeader.js | 22 +-- .../UI/YellowBoxInspectorSourceMapStatus.js | 22 +-- .../UI/YellowBoxInspectorStackFrame.js | 14 +- Libraries/YellowBox/UI/YellowBoxList.js | 26 +-- Libraries/YellowBox/UI/YellowBoxListRow.js | 18 +- Libraries/YellowBox/UI/YellowBoxPressable.js | 16 +- Libraries/YellowBox/YellowBox.js | 18 +- .../YellowBox/__tests__/YellowBox-test.js | 8 +- Libraries/promiseRejectionIsError.js | 2 +- .../react-native-implementation.js | 182 +++++++++--------- Libraries/vendor/core/Map.js | 6 +- Libraries/vendor/core/Set.js | 6 +- Libraries/vendor/core/merge.js | 2 +- Libraries/vendor/core/mergeInto.js | 2 +- .../selection/DocumentSelectionState.js | 2 +- .../vendor/emitter/EmitterSubscription.js | 6 +- Libraries/vendor/emitter/EventEmitter.js | 4 +- .../vendor/emitter/EventEmitterWithHolding.js | 6 +- Libraries/vendor/emitter/EventSubscription.js | 2 +- .../vendor/emitter/EventSubscriptionVendor.js | 2 +- Libraries/vendor/emitter/mixInEventEmitter.js | 10 +- 391 files changed, 1629 insertions(+), 1559 deletions(-) diff --git a/Libraries/ART/ReactNativeART.js b/Libraries/ART/ReactNativeART.js index 1ac9a5e1468459..c97de5a34f26a0 100644 --- a/Libraries/ART/ReactNativeART.js +++ b/Libraries/ART/ReactNativeART.js @@ -10,15 +10,15 @@ 'use strict'; const Color = require('art/core/color'); -const Path = require('ARTSerializablePath'); +const Path = require('./ARTSerializablePath'); const Transform = require('art/core/transform'); -const React = require('React'); +const React = require('react'); const PropTypes = require('prop-types'); -const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); +const ReactNativeViewAttributes = require('../Components/View/ReactNativeViewAttributes'); -const createReactNativeComponentClass = require('createReactNativeComponentClass'); -const merge = require('merge'); +const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass'); +const merge = require('../vendor/core/merge'); const invariant = require('invariant'); // Diff Helpers diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 129de677d8b17d..f8dfab12dd3d34 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -9,10 +9,11 @@ */ 'use strict'; -const RCTActionSheetManager = require('NativeModules').ActionSheetManager; +const RCTActionSheetManager = require('../BatchedBridge/NativeModules') + .ActionSheetManager; const invariant = require('invariant'); -const processColor = require('processColor'); +const processColor = require('../StyleSheet/processColor'); /** * Display action sheets and share sheets on iOS. diff --git a/Libraries/Alert/Alert.js b/Libraries/Alert/Alert.js index 4aa8d4d95c934f..21a64123707273 100644 --- a/Libraries/Alert/Alert.js +++ b/Libraries/Alert/Alert.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); const RCTAlertManager = NativeModules.AlertManager; -const Platform = require('Platform'); +const Platform = require('../Utilities/Platform'); export type Buttons = Array<{ text?: string, diff --git a/Libraries/Alert/RCTAlertManager.android.js b/Libraries/Alert/RCTAlertManager.android.js index b16298f01ff3f2..843dec92fe47cb 100644 --- a/Libraries/Alert/RCTAlertManager.android.js +++ b/Libraries/Alert/RCTAlertManager.android.js @@ -9,7 +9,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); function emptyCallback() {} diff --git a/Libraries/Alert/RCTAlertManager.ios.js b/Libraries/Alert/RCTAlertManager.ios.js index a300de65521d97..246967358982b9 100644 --- a/Libraries/Alert/RCTAlertManager.ios.js +++ b/Libraries/Alert/RCTAlertManager.ios.js @@ -10,6 +10,6 @@ 'use strict'; -const RCTAlertManager = require('NativeModules').AlertManager; +const RCTAlertManager = require('../BatchedBridge/NativeModules').AlertManager; module.exports = RCTAlertManager; diff --git a/Libraries/Animated/src/Animated.js b/Libraries/Animated/src/Animated.js index 41b5173f543228..594a1b82fc1451 100644 --- a/Libraries/Animated/src/Animated.js +++ b/Libraries/Animated/src/Animated.js @@ -10,30 +10,30 @@ 'use strict'; -import Platform from 'Platform'; +import Platform from '../../Utilities/Platform'; const AnimatedImplementation = Platform.isTesting - ? require('AnimatedMock') - : require('AnimatedImplementation'); + ? require('./AnimatedMock') + : require('./AnimatedImplementation'); module.exports = { get FlatList() { - return require('AnimatedFlatList'); + return require('./components/AnimatedFlatList'); }, get Image() { - return require('AnimatedImage'); + return require('./components/AnimatedImage'); }, get ScrollView() { - return require('AnimatedScrollView'); + return require('./components/AnimatedScrollView'); }, get SectionList() { - return require('AnimatedSectionList'); + return require('./components/AnimatedSectionList'); }, get Text() { - return require('AnimatedText'); + return require('./components/AnimatedText'); }, get View() { - return require('AnimatedView'); + return require('./components/AnimatedView'); }, ...AnimatedImplementation, }; diff --git a/Libraries/Animated/src/AnimatedEvent.js b/Libraries/Animated/src/AnimatedEvent.js index 72ef2af980bfb0..e06918ce5262e9 100644 --- a/Libraries/Animated/src/AnimatedEvent.js +++ b/Libraries/Animated/src/AnimatedEvent.js @@ -11,7 +11,7 @@ const AnimatedValue = require('./nodes/AnimatedValue'); const NativeAnimatedHelper = require('./NativeAnimatedHelper'); -const ReactNative = require('ReactNative'); +const ReactNative = require('../../Renderer/shims/ReactNative'); const invariant = require('invariant'); const {shouldUseNativeDriver} = require('./NativeAnimatedHelper'); diff --git a/Libraries/Animated/src/AnimatedMock.js b/Libraries/Animated/src/AnimatedMock.js index 6efcdd1815a9ae..2800560f5926b7 100644 --- a/Libraries/Animated/src/AnimatedMock.js +++ b/Libraries/Animated/src/AnimatedMock.js @@ -10,7 +10,7 @@ 'use strict'; const {AnimatedEvent, attachNativeEvent} = require('./AnimatedEvent'); -const AnimatedImplementation = require('AnimatedImplementation'); +const AnimatedImplementation = require('./AnimatedImplementation'); const AnimatedInterpolation = require('./nodes/AnimatedInterpolation'); const AnimatedNode = require('./nodes/AnimatedNode'); const AnimatedProps = require('./nodes/AnimatedProps'); diff --git a/Libraries/Animated/src/AnimatedWeb.js b/Libraries/Animated/src/AnimatedWeb.js index cf105d4af58a6c..995db03f67b2b6 100644 --- a/Libraries/Animated/src/AnimatedWeb.js +++ b/Libraries/Animated/src/AnimatedWeb.js @@ -10,7 +10,7 @@ 'use strict'; -const AnimatedImplementation = require('AnimatedImplementation'); +const AnimatedImplementation = require('./AnimatedImplementation'); module.exports = { ...AnimatedImplementation, diff --git a/Libraries/Animated/src/Easing.js b/Libraries/Animated/src/Easing.js index 9932038e6329fd..423c250fab4935 100644 --- a/Libraries/Animated/src/Easing.js +++ b/Libraries/Animated/src/Easing.js @@ -216,7 +216,7 @@ class Easing { x2: number, y2: number, ): (t: number) => number { - const _bezier = require('bezier'); + const _bezier = require('./bezier'); return _bezier(x1, y1, x2, y2); } diff --git a/Libraries/Animated/src/NativeAnimatedHelper.js b/Libraries/Animated/src/NativeAnimatedHelper.js index 2ac39f024ab63a..05bd6e37a8a4d2 100644 --- a/Libraries/Animated/src/NativeAnimatedHelper.js +++ b/Libraries/Animated/src/NativeAnimatedHelper.js @@ -9,8 +9,9 @@ */ 'use strict'; -const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule; -const NativeEventEmitter = require('NativeEventEmitter'); +const NativeAnimatedModule = require('../../BatchedBridge/NativeModules') + .NativeAnimatedModule; +const NativeEventEmitter = require('../../EventEmitter/NativeEventEmitter'); const invariant = require('invariant'); diff --git a/Libraries/Animated/src/__tests__/Animated-test.js b/Libraries/Animated/src/__tests__/Animated-test.js index 963c8f81298772..11c1ad922efede 100644 --- a/Libraries/Animated/src/__tests__/Animated-test.js +++ b/Libraries/Animated/src/__tests__/Animated-test.js @@ -10,7 +10,7 @@ 'use strict'; -let Animated = require('Animated'); +let Animated = require('../Animated'); describe('Animated tests', () => { beforeEach(() => { jest.resetModules(); @@ -645,13 +645,13 @@ describe('Animated tests', () => { let InteractionManager; beforeEach(() => { - jest.mock('InteractionManager'); - Animated = require('Animated'); - InteractionManager = require('InteractionManager'); + jest.mock('../../../Interaction/InteractionManager'); + Animated = require('../Animated'); + InteractionManager = require('../../../Interaction/InteractionManager'); }); afterEach(() => { - jest.unmock('InteractionManager'); + jest.unmock('../../../Interaction/InteractionManager'); }); it('registers an interaction by default', () => { diff --git a/Libraries/Animated/src/__tests__/AnimatedMock-test.js b/Libraries/Animated/src/__tests__/AnimatedMock-test.js index 767093cf9dfdf6..8ba4e998b36564 100644 --- a/Libraries/Animated/src/__tests__/AnimatedMock-test.js +++ b/Libraries/Animated/src/__tests__/AnimatedMock-test.js @@ -10,8 +10,8 @@ 'use strict'; -const AnimatedMock = require('AnimatedMock'); -const AnimatedImplementation = require('AnimatedImplementation'); +const AnimatedMock = require('../AnimatedMock'); +const AnimatedImplementation = require('../AnimatedImplementation'); describe('Animated Mock', () => { it('matches implementation keys', () => { diff --git a/Libraries/Animated/src/__tests__/AnimatedNative-test.js b/Libraries/Animated/src/__tests__/AnimatedNative-test.js index fb6257f15d8183..e90f2341b7d90c 100644 --- a/Libraries/Animated/src/__tests__/AnimatedNative-test.js +++ b/Libraries/Animated/src/__tests__/AnimatedNative-test.js @@ -15,22 +15,22 @@ ClassComponentMock.prototype.isReactComponent = true; jest .clearAllMocks() - .setMock('Text', ClassComponentMock) - .setMock('View', ClassComponentMock) - .setMock('Image', ClassComponentMock) - .setMock('ScrollView', ClassComponentMock) - .setMock('FlatList', ClassComponentMock) - .setMock('SectionList', ClassComponentMock) - .setMock('React', {Component: class {}}) - .setMock('NativeModules', { + .setMock('../../../Text/Text', ClassComponentMock) + .setMock('../../../Components/View/View', ClassComponentMock) + .setMock('../../../Image/Image', ClassComponentMock) + .setMock('../../../Components/ScrollView/ScrollView', ClassComponentMock) + .setMock('../../../Lists/FlatList', ClassComponentMock) + .setMock('../../../Lists/SectionList', ClassComponentMock) + .setMock('react', {Component: class {}}) + .setMock('../../../BatchedBridge/NativeModules', { NativeAnimatedModule: {}, }) - .mock('NativeEventEmitter') + .mock('../../../EventEmitter/NativeEventEmitter') // findNodeHandle is imported from ReactNative so mock that whole module. - .setMock('ReactNative', {findNodeHandle: () => 1}); + .setMock('../../../Renderer/shims/ReactNative', {findNodeHandle: () => 1}); -const Animated = require('Animated'); -const NativeAnimatedHelper = require('NativeAnimatedHelper'); +const Animated = require('../Animated'); +const NativeAnimatedHelper = require('../NativeAnimatedHelper'); function createAndMountComponent(ComponentClass, props) { const component = new ComponentClass(); @@ -43,7 +43,8 @@ function createAndMountComponent(ComponentClass, props) { } describe('Native Animated', () => { - const nativeAnimatedModule = require('NativeModules').NativeAnimatedModule; + const nativeAnimatedModule = require('../../../BatchedBridge/NativeModules') + .NativeAnimatedModule; beforeEach(() => { nativeAnimatedModule.addAnimatedEventToView = jest.fn(); diff --git a/Libraries/Animated/src/__tests__/Easing-test.js b/Libraries/Animated/src/__tests__/Easing-test.js index 1cb6152538fec2..409b1a7c3a8bd5 100644 --- a/Libraries/Animated/src/__tests__/Easing-test.js +++ b/Libraries/Animated/src/__tests__/Easing-test.js @@ -10,7 +10,7 @@ 'use strict'; -const Easing = require('Easing'); +const Easing = require('../Easing'); describe('Easing', () => { it('should work with linear', () => { const easing = Easing.linear; diff --git a/Libraries/Animated/src/__tests__/Interpolation-test.js b/Libraries/Animated/src/__tests__/Interpolation-test.js index 6b77584b00d8ab..2bdebfd4935c53 100644 --- a/Libraries/Animated/src/__tests__/Interpolation-test.js +++ b/Libraries/Animated/src/__tests__/Interpolation-test.js @@ -11,7 +11,7 @@ 'use strict'; const AnimatedInterpolation = require('../nodes/AnimatedInterpolation'); -const Easing = require('Easing'); +const Easing = require('../Easing'); describe('Interpolation', () => { it('should work with defaults', () => { diff --git a/Libraries/Animated/src/__tests__/bezier-test.js b/Libraries/Animated/src/__tests__/bezier-test.js index 360d6262f91144..e70026dca8d614 100644 --- a/Libraries/Animated/src/__tests__/bezier-test.js +++ b/Libraries/Animated/src/__tests__/bezier-test.js @@ -15,7 +15,7 @@ 'use strict'; -const bezier = require('bezier'); +const bezier = require('../bezier'); const identity = function(x) { return x; diff --git a/Libraries/Animated/src/animations/Animation.js b/Libraries/Animated/src/animations/Animation.js index b34ac9555a1eca..32ccb1e72f0832 100644 --- a/Libraries/Animated/src/animations/Animation.js +++ b/Libraries/Animated/src/animations/Animation.js @@ -9,7 +9,7 @@ */ 'use strict'; -const NativeAnimatedHelper = require('NativeAnimatedHelper'); +const NativeAnimatedHelper = require('../NativeAnimatedHelper'); import type AnimatedValue from '../nodes/AnimatedValue'; diff --git a/Libraries/Animated/src/animations/TimingAnimation.js b/Libraries/Animated/src/animations/TimingAnimation.js index a9569f01b2056e..b73794f1333e44 100644 --- a/Libraries/Animated/src/animations/TimingAnimation.js +++ b/Libraries/Animated/src/animations/TimingAnimation.js @@ -34,7 +34,7 @@ export type TimingAnimationConfigSingle = AnimationConfig & { let _easeInOut; function easeInOut() { if (!_easeInOut) { - const Easing = require('Easing'); + const Easing = require('../Easing'); _easeInOut = Easing.inOut(Easing.ease); } return _easeInOut; diff --git a/Libraries/Animated/src/components/AnimatedFlatList.js b/Libraries/Animated/src/components/AnimatedFlatList.js index af69ff3674769e..5ed02075ff6cd7 100644 --- a/Libraries/Animated/src/components/AnimatedFlatList.js +++ b/Libraries/Animated/src/components/AnimatedFlatList.js @@ -10,8 +10,8 @@ 'use strict'; -const FlatList = require('FlatList'); +const FlatList = require('../../../Lists/FlatList'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(FlatList); diff --git a/Libraries/Animated/src/components/AnimatedImage.js b/Libraries/Animated/src/components/AnimatedImage.js index e7d0bc4429513a..9f5bad944b6eb1 100644 --- a/Libraries/Animated/src/components/AnimatedImage.js +++ b/Libraries/Animated/src/components/AnimatedImage.js @@ -10,8 +10,8 @@ 'use strict'; -const Image = require('Image'); +const Image = require('../../../Image/Image'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(Image); diff --git a/Libraries/Animated/src/components/AnimatedScrollView.js b/Libraries/Animated/src/components/AnimatedScrollView.js index eb5cf275266140..16169dcefe8b2f 100644 --- a/Libraries/Animated/src/components/AnimatedScrollView.js +++ b/Libraries/Animated/src/components/AnimatedScrollView.js @@ -10,9 +10,9 @@ 'use strict'; -const ScrollView = require('ScrollView'); +const ScrollView = require('../../../Components/ScrollView/ScrollView'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(ScrollView, { scrollEventThrottle: 0.0001, diff --git a/Libraries/Animated/src/components/AnimatedSectionList.js b/Libraries/Animated/src/components/AnimatedSectionList.js index 482e203abac637..e0c94ea88933ca 100644 --- a/Libraries/Animated/src/components/AnimatedSectionList.js +++ b/Libraries/Animated/src/components/AnimatedSectionList.js @@ -10,8 +10,8 @@ 'use strict'; -const SectionList = require('SectionList'); +const SectionList = require('../../../Lists/SectionList'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(SectionList); diff --git a/Libraries/Animated/src/components/AnimatedText.js b/Libraries/Animated/src/components/AnimatedText.js index 870ba144b10207..73f9f5e3d68b66 100644 --- a/Libraries/Animated/src/components/AnimatedText.js +++ b/Libraries/Animated/src/components/AnimatedText.js @@ -10,8 +10,8 @@ 'use strict'; -const Text = require('Text'); +const Text = require('../../../Text/Text'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(Text); diff --git a/Libraries/Animated/src/components/AnimatedView.js b/Libraries/Animated/src/components/AnimatedView.js index 396760d999485f..6958289d509187 100644 --- a/Libraries/Animated/src/components/AnimatedView.js +++ b/Libraries/Animated/src/components/AnimatedView.js @@ -10,8 +10,8 @@ 'use strict'; -const View = require('View'); +const View = require('../../../Components/View/View'); -const createAnimatedComponent = require('createAnimatedComponent'); +const createAnimatedComponent = require('../createAnimatedComponent'); module.exports = createAnimatedComponent(View); diff --git a/Libraries/Animated/src/createAnimatedComponent.js b/Libraries/Animated/src/createAnimatedComponent.js index 840df7485e0509..d31a12976da399 100644 --- a/Libraries/Animated/src/createAnimatedComponent.js +++ b/Libraries/Animated/src/createAnimatedComponent.js @@ -11,8 +11,8 @@ const {AnimatedEvent} = require('./AnimatedEvent'); const AnimatedProps = require('./nodes/AnimatedProps'); -const React = require('React'); -const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes'); +const React = require('react'); +const DeprecatedViewStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedViewStylePropTypes'); const invariant = require('invariant'); diff --git a/Libraries/Animated/src/nodes/AnimatedInterpolation.js b/Libraries/Animated/src/nodes/AnimatedInterpolation.js index 1ba304d331ad5f..d4df33a2f7d5e2 100644 --- a/Libraries/Animated/src/nodes/AnimatedInterpolation.js +++ b/Libraries/Animated/src/nodes/AnimatedInterpolation.js @@ -15,7 +15,7 @@ const AnimatedWithChildren = require('./AnimatedWithChildren'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); const invariant = require('invariant'); -const normalizeColor = require('normalizeColor'); +const normalizeColor = require('../../../Color/normalizeColor'); type ExtrapolateType = 'extend' | 'identity' | 'clamp'; diff --git a/Libraries/Animated/src/nodes/AnimatedProps.js b/Libraries/Animated/src/nodes/AnimatedProps.js index be3dfd86d5b4f2..23866ed4356aff 100644 --- a/Libraries/Animated/src/nodes/AnimatedProps.js +++ b/Libraries/Animated/src/nodes/AnimatedProps.js @@ -13,7 +13,7 @@ const {AnimatedEvent} = require('../AnimatedEvent'); const AnimatedNode = require('./AnimatedNode'); const AnimatedStyle = require('./AnimatedStyle'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); -const ReactNative = require('ReactNative'); +const ReactNative = require('../../../Renderer/shims/ReactNative'); const invariant = require('invariant'); diff --git a/Libraries/Animated/src/nodes/AnimatedStyle.js b/Libraries/Animated/src/nodes/AnimatedStyle.js index e1f3d332a2280f..4830b2e8d0c1a4 100644 --- a/Libraries/Animated/src/nodes/AnimatedStyle.js +++ b/Libraries/Animated/src/nodes/AnimatedStyle.js @@ -14,7 +14,7 @@ const AnimatedTransform = require('./AnimatedTransform'); const AnimatedWithChildren = require('./AnimatedWithChildren'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); -const flattenStyle = require('flattenStyle'); +const flattenStyle = require('../../../StyleSheet/flattenStyle'); class AnimatedStyle extends AnimatedWithChildren { _style: Object; diff --git a/Libraries/Animated/src/nodes/AnimatedValue.js b/Libraries/Animated/src/nodes/AnimatedValue.js index 47fca40e9d5bdc..9a7a865843d6d4 100644 --- a/Libraries/Animated/src/nodes/AnimatedValue.js +++ b/Libraries/Animated/src/nodes/AnimatedValue.js @@ -11,7 +11,7 @@ const AnimatedInterpolation = require('./AnimatedInterpolation'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -const InteractionManager = require('InteractionManager'); +const InteractionManager = require('../../../Interaction/InteractionManager'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); import type Animation, {EndCallback} from '../animations/Animation'; diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index 8cf1fc9443969b..19a9334bd7aab8 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -10,12 +10,12 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const NativeEventEmitter = require('NativeEventEmitter'); -const NativeModules = require('NativeModules'); +const EventEmitter = require('../vendor/emitter/EventEmitter'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const NativeModules = require('../BatchedBridge/NativeModules'); const RCTAppState = NativeModules.AppState; -const logError = require('logError'); +const logError = require('../Utilities/logError'); const invariant = require('invariant'); /** diff --git a/Libraries/BatchedBridge/BatchedBridge.js b/Libraries/BatchedBridge/BatchedBridge.js index 663b0051457e24..5cd0138b48e131 100644 --- a/Libraries/BatchedBridge/BatchedBridge.js +++ b/Libraries/BatchedBridge/BatchedBridge.js @@ -10,7 +10,7 @@ 'use strict'; -const MessageQueue = require('MessageQueue'); +const MessageQueue = require('./MessageQueue'); const BatchedBridge = new MessageQueue(); diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index 1d49120b7f5139..8fce2a7e67c301 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -10,12 +10,12 @@ 'use strict'; -const ErrorUtils = require('ErrorUtils'); -const Systrace = require('Systrace'); +const ErrorUtils = require('../vendor/core/ErrorUtils'); +const Systrace = require('../Performance/Systrace'); -const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); +const deepFreezeAndThrowOnMutationInDev = require('../Utilities/deepFreezeAndThrowOnMutationInDev'); const invariant = require('invariant'); -const stringifySafe = require('stringifySafe'); +const stringifySafe = require('../Utilities/stringifySafe'); export type SpyData = { type: number, diff --git a/Libraries/BatchedBridge/NativeModules.js b/Libraries/BatchedBridge/NativeModules.js index c8487e8884ead5..a916f37b3ab1ba 100644 --- a/Libraries/BatchedBridge/NativeModules.js +++ b/Libraries/BatchedBridge/NativeModules.js @@ -10,11 +10,11 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); +const BatchedBridge = require('./BatchedBridge'); const invariant = require('invariant'); -import type {ExtendedError} from 'parseErrorStack'; +import type {ExtendedError} from '../Core/Devtools/parseErrorStack'; type ModuleConfig = [ string /* name */, @@ -164,7 +164,7 @@ if (global.nativeModuleProxy) { '__fbBatchedBridgeConfig is not set, cannot invoke native modules', ); - const defineLazyObjectProperty = require('defineLazyObjectProperty'); + const defineLazyObjectProperty = require('../Utilities/defineLazyObjectProperty'); (bridgeConfig.remoteModuleConfig || []).forEach( (config: ModuleConfig, moduleID: number) => { // Initially this config will only contain the module name when running in JSC. The actual diff --git a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js index 77cd6948124487..f8568cae72d172 100644 --- a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js @@ -32,7 +32,7 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => { describe('MessageQueue', function() { beforeEach(function() { jest.resetModules(); - MessageQueue = require('MessageQueue'); + MessageQueue = require('../MessageQueue'); MessageQueueTestModule = require('MessageQueueTestModule'); queue = new MessageQueue(); queue.registerCallableModule( diff --git a/Libraries/BatchedBridge/__tests__/NativeModules-test.js b/Libraries/BatchedBridge/__tests__/NativeModules-test.js index 821c3261a4169a..6457385f233acb 100644 --- a/Libraries/BatchedBridge/__tests__/NativeModules-test.js +++ b/Libraries/BatchedBridge/__tests__/NativeModules-test.js @@ -10,7 +10,7 @@ 'use strict'; -jest.unmock('NativeModules'); +jest.unmock('../NativeModules'); let BatchedBridge; let NativeModules; @@ -41,8 +41,8 @@ describe('MessageQueue', function() { jest.resetModules(); global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig'); - BatchedBridge = require('BatchedBridge'); - NativeModules = require('NativeModules'); + BatchedBridge = require('../BatchedBridge'); + NativeModules = require('../NativeModules'); }); it('should generate native modules', () => { diff --git a/Libraries/Blob/Blob.js b/Libraries/Blob/Blob.js index c7e013dfa0b530..2af35f2bcb0ac2 100644 --- a/Libraries/Blob/Blob.js +++ b/Libraries/Blob/Blob.js @@ -10,7 +10,7 @@ 'use strict'; -import type {BlobData, BlobOptions} from 'BlobTypes'; +import type {BlobData, BlobOptions} from './BlobTypes'; /** * Opaque JS representation of some binary data in native. @@ -58,7 +58,7 @@ class Blob { * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob */ constructor(parts: Array = [], options?: BlobOptions) { - const BlobManager = require('BlobManager'); + const BlobManager = require('./BlobManager'); this.data = BlobManager.createFromParts(parts, options).data; } @@ -80,7 +80,7 @@ class Blob { } slice(start?: number, end?: number): Blob { - const BlobManager = require('BlobManager'); + const BlobManager = require('./BlobManager'); let {offset, size} = this.data; if (typeof start === 'number') { @@ -117,7 +117,7 @@ class Blob { * `new Blob([blob, ...])` actually copies the data in memory. */ close() { - const BlobManager = require('BlobManager'); + const BlobManager = require('./BlobManager'); BlobManager.release(this.data.blobId); this.data = null; } diff --git a/Libraries/Blob/BlobManager.js b/Libraries/Blob/BlobManager.js index 460980bb5b21ef..6c83d6df37ae55 100644 --- a/Libraries/Blob/BlobManager.js +++ b/Libraries/Blob/BlobManager.js @@ -10,11 +10,11 @@ 'use strict'; -const Blob = require('Blob'); -const BlobRegistry = require('BlobRegistry'); -const {BlobModule} = require('NativeModules'); +const Blob = require('./Blob'); +const BlobRegistry = require('./BlobRegistry'); +const {BlobModule} = require('../BatchedBridge/NativeModules'); -import type {BlobData, BlobOptions} from 'BlobTypes'; +import type {BlobData, BlobOptions} from './BlobTypes'; /*eslint-disable no-bitwise */ /*eslint-disable eqeqeq */ diff --git a/Libraries/Blob/File.js b/Libraries/Blob/File.js index 2510d32b204c60..8b22e81e23251f 100644 --- a/Libraries/Blob/File.js +++ b/Libraries/Blob/File.js @@ -9,11 +9,11 @@ */ 'use strict'; -const Blob = require('Blob'); +const Blob = require('./Blob'); const invariant = require('invariant'); -import type {BlobOptions} from 'BlobTypes'; +import type {BlobOptions} from './BlobTypes'; /** * The File interface provides information about files. diff --git a/Libraries/Blob/FileReader.js b/Libraries/Blob/FileReader.js index b9181ed9aaa34b..7d8116fce9c37c 100644 --- a/Libraries/Blob/FileReader.js +++ b/Libraries/Blob/FileReader.js @@ -11,8 +11,8 @@ 'use strict'; const EventTarget = require('event-target-shim'); -const Blob = require('Blob'); -const {FileReaderModule} = require('NativeModules'); +const Blob = require('./Blob'); +const {FileReaderModule} = require('../BatchedBridge/NativeModules'); type ReadyState = | 0 // EMPTY diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index 049a91ec03026a..520b5fc63a0c94 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -9,9 +9,9 @@ 'use strict'; -const Blob = require('Blob'); +const Blob = require('./Blob'); -const {BlobModule} = require('NativeModules'); +const {BlobModule} = require('../BatchedBridge/NativeModules'); let BLOB_URL_PREFIX = null; diff --git a/Libraries/Blob/__tests__/Blob-test.js b/Libraries/Blob/__tests__/Blob-test.js index 7600c0c967825c..3c3e3c1b94124b 100644 --- a/Libraries/Blob/__tests__/Blob-test.js +++ b/Libraries/Blob/__tests__/Blob-test.js @@ -9,11 +9,11 @@ */ 'use strict'; -jest.setMock('NativeModules', { +jest.setMock('../../BatchedBridge/NativeModules', { BlobModule: require('../__mocks__/BlobModule'), }); -const Blob = require('Blob'); +const Blob = require('../Blob'); describe('Blob', function() { it('should create empty blob', () => { diff --git a/Libraries/Blob/__tests__/BlobManager-test.js b/Libraries/Blob/__tests__/BlobManager-test.js index 73ad2a9de1103f..475eb6830594ed 100644 --- a/Libraries/Blob/__tests__/BlobManager-test.js +++ b/Libraries/Blob/__tests__/BlobManager-test.js @@ -9,12 +9,12 @@ */ 'use strict'; -jest.setMock('NativeModules', { +jest.setMock('../../BatchedBridge/NativeModules', { BlobModule: require('../__mocks__/BlobModule'), }); -const Blob = require('Blob'); -const BlobManager = require('BlobManager'); +const Blob = require('../Blob'); +const BlobManager = require('../BlobManager'); describe('BlobManager', function() { it('should create blob from parts', () => { diff --git a/Libraries/Blob/__tests__/File-test.js b/Libraries/Blob/__tests__/File-test.js index 11b25116809a5d..fbcb7bc82e6ce3 100644 --- a/Libraries/Blob/__tests__/File-test.js +++ b/Libraries/Blob/__tests__/File-test.js @@ -9,12 +9,12 @@ */ 'use strict'; -jest.setMock('NativeModules', { +jest.setMock('../../BatchedBridge/NativeModules', { BlobModule: require('../__mocks__/BlobModule'), }); -const Blob = require('Blob'); -const File = require('File'); +const Blob = require('../Blob'); +const File = require('../File'); describe('babel 7 smoke test', function() { it('should be able to extend a class with native name', function() { diff --git a/Libraries/Blob/__tests__/FileReader-test.js b/Libraries/Blob/__tests__/FileReader-test.js index a375c3ef374710..5359b15b232920 100644 --- a/Libraries/Blob/__tests__/FileReader-test.js +++ b/Libraries/Blob/__tests__/FileReader-test.js @@ -9,13 +9,13 @@ */ 'use strict'; -jest.unmock('event-target-shim').setMock('NativeModules', { +jest.unmock('event-target-shim').setMock('../../BatchedBridge/NativeModules', { BlobModule: require('../__mocks__/BlobModule'), FileReaderModule: require('../__mocks__/FileReaderModule'), }); -const Blob = require('Blob'); -const FileReader = require('FileReader'); +const Blob = require('../Blob'); +const FileReader = require('../FileReader'); describe('FileReader', function() { it('should read blob as text', async () => { diff --git a/Libraries/Blob/__tests__/URL-test.js b/Libraries/Blob/__tests__/URL-test.js index b39302bbd58f12..8ca71feb025315 100644 --- a/Libraries/Blob/__tests__/URL-test.js +++ b/Libraries/Blob/__tests__/URL-test.js @@ -9,7 +9,7 @@ */ 'use strict'; -const URL = require('URL').URL; +const URL = require('../URL').URL; describe('URL', function() { it('should pass Mozilla Dev Network examples', () => { diff --git a/Libraries/BugReporting/BugReporting.js b/Libraries/BugReporting/BugReporting.js index 1623b71741f059..ed5bdfc61d6b4b 100644 --- a/Libraries/BugReporting/BugReporting.js +++ b/Libraries/BugReporting/BugReporting.js @@ -10,10 +10,10 @@ 'use strict'; -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -const infoLog = require('infoLog'); +const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); +const infoLog = require('../Utilities/infoLog'); -import type EmitterSubscription from 'EmitterSubscription'; +import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; type ExtraData = {[key: string]: string}; type SourceCallback = () => string; @@ -21,7 +21,7 @@ type DebugData = {extras: ExtraData, files: ExtraData}; function defaultExtras() { BugReporting.addFileSource('react_hierarchy.txt', () => - require('dumpReactTree')(), + require('./dumpReactTree')(), ); } @@ -121,12 +121,13 @@ class BugReporting { fileData[key] = callback(); } infoLog('BugReporting extraData:', extraData); - const BugReportingNativeModule = require('NativeModules').BugReporting; + const BugReportingNativeModule = require('../BatchedBridge/NativeModules') + .BugReporting; BugReportingNativeModule && BugReportingNativeModule.setExtraData && BugReportingNativeModule.setExtraData(extraData, fileData); - const RedBoxNativeModule = require('NativeModules').RedBox; + const RedBoxNativeModule = require('../BatchedBridge/NativeModules').RedBox; RedBoxNativeModule && RedBoxNativeModule.setExtraData && RedBoxNativeModule.setExtraData(extraData, 'From BugReporting.js'); diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 68a06805d2ab75..bc791fde36f2b5 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -11,9 +11,10 @@ const PropTypes = require('prop-types'); const {checkPropTypes} = PropTypes; -const RCTCameraRollManager = require('NativeModules').CameraRollManager; +const RCTCameraRollManager = require('../BatchedBridge/NativeModules') + .CameraRollManager; -const deprecatedCreateStrictShapeTypeChecker = require('deprecatedCreateStrictShapeTypeChecker'); +const deprecatedCreateStrictShapeTypeChecker = require('../DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker'); const invariant = require('invariant'); const GROUP_TYPES_OPTIONS = { diff --git a/Libraries/CameraRoll/ImagePickerIOS.js b/Libraries/CameraRoll/ImagePickerIOS.js index 9c783339835f88..0254e222c5c42c 100644 --- a/Libraries/CameraRoll/ImagePickerIOS.js +++ b/Libraries/CameraRoll/ImagePickerIOS.js @@ -10,7 +10,7 @@ 'use strict'; -const RCTImagePicker = require('NativeModules').ImagePickerIOS; +const RCTImagePicker = require('../BatchedBridge/NativeModules').ImagePickerIOS; const ImagePickerIOS = { canRecordVideos: function(callback: Function) { diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js index 9ff5fe0a82fbc1..6745a94f0f6b46 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeModules = require('NativeModules'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -const UIManager = require('UIManager'); +const NativeModules = require('../../BatchedBridge/NativeModules'); +const RCTDeviceEventEmitter = require('../../EventEmitter/RCTDeviceEventEmitter'); +const UIManager = require('../../ReactNative/UIManager'); const RCTAccessibilityInfo = NativeModules.AccessibilityInfo; diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js index 002ae96785da10..843f812de04b93 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeModules = require('NativeModules'); -const Promise = require('Promise'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const NativeModules = require('../../BatchedBridge/NativeModules'); +const Promise = require('../../Promise'); +const RCTDeviceEventEmitter = require('../../EventEmitter/RCTDeviceEventEmitter'); const AccessibilityManager = NativeModules.AccessibilityManager; diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 6a220d08d7c9c4..1c4a54c98ff1cf 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -10,19 +10,19 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); -const RCTActivityIndicatorViewNativeComponent = require('RCTActivityIndicatorViewNativeComponent'); +const RCTActivityIndicatorViewNativeComponent = require('./RCTActivityIndicatorViewNativeComponent'); -import type {NativeComponent} from 'ReactNative'; -import type {ViewProps} from 'ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; const RCTActivityIndicator = Platform.OS === 'android' - ? require('ProgressBarAndroid') + ? require('../ProgressBarAndroid/ProgressBarAndroid') : RCTActivityIndicatorViewNativeComponent; const GRAY = '#999999'; diff --git a/Libraries/Components/ActivityIndicator/RCTActivityIndicatorViewNativeComponent.js b/Libraries/Components/ActivityIndicator/RCTActivityIndicatorViewNativeComponent.js index 77992f4fbafd21..e1d2be92935722 100644 --- a/Libraries/Components/ActivityIndicator/RCTActivityIndicatorViewNativeComponent.js +++ b/Libraries/Components/ActivityIndicator/RCTActivityIndicatorViewNativeComponent.js @@ -10,11 +10,11 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js b/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js index db9baca9d29657..21703d34ad30c1 100644 --- a/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js +++ b/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js @@ -11,8 +11,8 @@ 'use strict'; -const React = require('React'); -const ActivityIndicator = require('ActivityIndicator'); +const React = require('react'); +const ActivityIndicator = require('../ActivityIndicator'); const render = require('../../../../jest/renderer'); describe('', () => { @@ -35,7 +35,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('ActivityIndicator'); + jest.dontMock('../ActivityIndicator'); const output = render.shallow( , @@ -44,7 +44,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('ActivityIndicator'); + jest.dontMock('../ActivityIndicator'); const instance = render.create( , diff --git a/Libraries/Components/AppleTV/TVEventHandler.js b/Libraries/Components/AppleTV/TVEventHandler.js index 9b584de6bec581..debaa0f3418a03 100644 --- a/Libraries/Components/AppleTV/TVEventHandler.js +++ b/Libraries/Components/AppleTV/TVEventHandler.js @@ -10,10 +10,10 @@ 'use strict'; -const Platform = require('Platform'); -const TVNavigationEventEmitter = require('NativeModules') +const Platform = require('../../Utilities/Platform'); +const TVNavigationEventEmitter = require('../../BatchedBridge/NativeModules') .TVNavigationEventEmitter; -const NativeEventEmitter = require('NativeEventEmitter'); +const NativeEventEmitter = require('../../EventEmitter/NativeEventEmitter'); function TVEventHandler() { this.__nativeTVNavigationEventListener = null; diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index c442a2cf1a24ce..5105ee1badc3bc 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -10,17 +10,17 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TouchableNativeFeedback = require('TouchableNativeFeedback'); -const TouchableOpacity = require('TouchableOpacity'); -const View = require('View'); +const Platform = require('../Utilities/Platform'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const TouchableNativeFeedback = require('./Touchable/TouchableNativeFeedback'); +const TouchableOpacity = require('./Touchable/TouchableOpacity'); +const View = require('./View/View'); const invariant = require('invariant'); -import type {PressEvent} from 'CoreEventTypes'; +import type {PressEvent} from '../Types/CoreEventTypes'; type ButtonProps = $ReadOnly<{| /** diff --git a/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js b/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js index e8aaf3c68d7693..097cba17600945 100644 --- a/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js +++ b/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js @@ -9,11 +9,11 @@ */ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type CheckBoxEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/CheckBox/CheckBox.android.js b/Libraries/Components/CheckBox/CheckBox.android.js index 1e06f857b5cc3d..07d20cb533206f 100644 --- a/Libraries/Components/CheckBox/CheckBox.android.js +++ b/Libraries/Components/CheckBox/CheckBox.android.js @@ -9,18 +9,18 @@ */ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const processColor = require('processColor'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const processColor = require('../../StyleSheet/processColor'); -const AndroidCheckBoxNativeComponent = require('AndroidCheckBoxNativeComponent'); +const AndroidCheckBoxNativeComponent = require('./AndroidCheckBoxNativeComponent'); const nullthrows = require('nullthrows'); -const setAndForwardRef = require('setAndForwardRef'); +const setAndForwardRef = require('../../Utilities/setAndForwardRef'); -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; -import type {ColorValue} from 'StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; type CheckBoxEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/CheckBox/CheckBox.ios.js b/Libraries/Components/CheckBox/CheckBox.ios.js index 8bc431d610e066..f6ce4003efa695 100644 --- a/Libraries/Components/CheckBox/CheckBox.ios.js +++ b/Libraries/Components/CheckBox/CheckBox.ios.js @@ -9,4 +9,4 @@ */ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Components/Clipboard/Clipboard.js b/Libraries/Components/Clipboard/Clipboard.js index d9eddb6cd0548e..59b595fd8789a9 100644 --- a/Libraries/Components/Clipboard/Clipboard.js +++ b/Libraries/Components/Clipboard/Clipboard.js @@ -10,7 +10,7 @@ 'use strict'; -const Clipboard = require('NativeModules').Clipboard; +const Clipboard = require('../../BatchedBridge/NativeModules').Clipboard; /** * `Clipboard` gives you an interface for setting and getting content from Clipboard on both iOS and Android diff --git a/Libraries/Components/DatePicker/DatePickerIOS.android.js b/Libraries/Components/DatePicker/DatePickerIOS.android.js index c532f212d6080b..4c26ab962855b0 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.android.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.android.js @@ -9,10 +9,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../View/View'); class DummyDatePickerIOS extends React.Component { render() { diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index bef65cf2270a58..9550619e9eb096 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -13,16 +13,16 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); const invariant = require('invariant'); -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -const RCTDatePickerNativeComponent = require('RCTDatePickerNativeComponent'); +const RCTDatePickerNativeComponent = require('./RCTDatePickerNativeComponent'); type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js index 137d88351314c7..df605f19b08622 100644 --- a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +++ b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js @@ -10,11 +10,11 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js b/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js index e67c170cc49198..8b51982fb0f0d3 100644 --- a/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js +++ b/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js @@ -11,8 +11,8 @@ 'use strict'; -const React = require('React'); -const DatePickerIOS = require('DatePickerIOS'); +const React = require('react'); +const DatePickerIOS = require('../DatePickerIOS'); const render = require('../../../../jest/renderer'); describe('DatePickerIOS', () => { @@ -39,7 +39,7 @@ describe('DatePickerIOS', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('DatePickerIOS'); + jest.dontMock('../DatePickerIOS'); const output = render.shallow( { }); it('should render as when not mocked', () => { - jest.dontMock('DatePickerIOS'); + jest.dontMock('../DatePickerIOS'); const instance = render.create( { diff --git a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js index ba5ec7698802e9..4ff3e14d919770 100644 --- a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +++ b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js @@ -10,12 +10,12 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {NativeComponent} from 'ReactNative'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ViewStyleProp} from 'StyleSheet'; -import type React from 'React'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type React from 'react'; type ColorValue = null | string; diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index 7819ea1db072c1..b7d2419a2ab7ca 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -10,30 +10,30 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StatusBar = require('StatusBar'); -const StyleSheet = require('StyleSheet'); -const UIManager = require('UIManager'); -const View = require('View'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const StatusBar = require('../StatusBar/StatusBar'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const UIManager = require('../../ReactNative/UIManager'); +const View = require('../View/View'); const nullthrows = require('nullthrows'); const DrawerConsts = UIManager.getViewManagerConfig('AndroidDrawerLayout') .Constants; -const dismissKeyboard = require('dismissKeyboard'); -const AndroidDrawerLayoutNativeComponent = require('AndroidDrawerLayoutNativeComponent'); +const dismissKeyboard = require('../../Utilities/dismissKeyboard'); +const AndroidDrawerLayoutNativeComponent = require('./AndroidDrawerLayoutNativeComponent'); const DRAWER_STATES = ['Idle', 'Dragging', 'Settling']; -import type {ViewStyleProp} from 'StyleSheet'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type { MeasureOnSuccessCallback, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, -} from 'ReactNativeTypes'; +} from '../../Renderer/shims/ReactNativeTypes'; type DrawerStates = 'Idle' | 'Dragging' | 'Settling'; diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js index 7a00b6636cf664..d5fd5cf83f7560 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js @@ -9,4 +9,4 @@ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js b/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js index 0d871288075133..e9747a088b26fe 100644 --- a/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js +++ b/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js @@ -11,10 +11,10 @@ 'use strict'; -const React = require('React'); +const React = require('react'); // $FlowFixMe const DrawerLayoutAndroid = require('../DrawerLayoutAndroid.android'); -const View = require('View'); +const View = require('../../View/View'); const render = require('../../../../jest/renderer'); @@ -42,7 +42,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('DrawerLayoutAndroid'); + jest.dontMock('../DrawerLayoutAndroid'); const output = render.shallow( ', () => { }); it('should render as when not mocked', () => { - jest.dontMock('DrawerLayoutAndroid'); + jest.dontMock('../DrawerLayoutAndroid'); const instance = render.create( { beforeEach(() => { diff --git a/Libraries/Components/MaskedView/MaskedViewIOS.android.js b/Libraries/Components/MaskedView/MaskedViewIOS.android.js index 95d93f156b29cd..72ceef06247943 100644 --- a/Libraries/Components/MaskedView/MaskedViewIOS.android.js +++ b/Libraries/Components/MaskedView/MaskedViewIOS.android.js @@ -10,4 +10,4 @@ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Components/MaskedView/MaskedViewIOS.ios.js b/Libraries/Components/MaskedView/MaskedViewIOS.ios.js index b8af448da8dc2b..67ff1d2d4dee2c 100644 --- a/Libraries/Components/MaskedView/MaskedViewIOS.ios.js +++ b/Libraries/Components/MaskedView/MaskedViewIOS.ios.js @@ -8,12 +8,12 @@ * @flow */ -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const RCTMaskedViewNativeComponent = require('RCTMaskedViewNativeComponent'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); +const RCTMaskedViewNativeComponent = require('./RCTMaskedViewNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type Props = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js b/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js index b2cb472f47b110..fcde810db52e90 100644 --- a/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js +++ b/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js @@ -8,10 +8,10 @@ * @flow */ -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/MaskedView/__tests__/MaskedViewIOS-test.js b/Libraries/Components/MaskedView/__tests__/MaskedViewIOS-test.js index 01abd518ca7dad..49f2a74752901a 100644 --- a/Libraries/Components/MaskedView/__tests__/MaskedViewIOS-test.js +++ b/Libraries/Components/MaskedView/__tests__/MaskedViewIOS-test.js @@ -11,10 +11,10 @@ 'use strict'; -const React = require('React'); -const Text = require('Text'); -const View = require('View'); -const MaskedViewIOS = require('MaskedViewIOS'); +const React = require('react'); +const Text = require('../../../Text/Text'); +const View = require('../../View/View'); +const MaskedViewIOS = require('../MaskedViewIOS'); const render = require('../../../../jest/renderer'); @@ -48,7 +48,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('MaskedViewIOS'); + jest.dontMock('../MaskedViewIOS'); const output = render.shallow( ', () => { }); it('should render as when not mocked', () => { - jest.dontMock('MaskedViewIOS'); + jest.dontMock('../MaskedViewIOS'); const instance = render.create( ', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('Picker'); + jest.dontMock('../Picker'); const output = render.shallow( @@ -50,7 +50,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('Picker'); + jest.dontMock('../Picker'); const instance = render.create( diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index 616dfc7ed7e07c..5e37a1216c9231 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -10,11 +10,11 @@ 'use strict'; -const React = require('React'); +const React = require('react'); -const ProgressBarAndroidNativeComponent = require('ProgressBarAndroidNativeComponent'); +const ProgressBarAndroidNativeComponent = require('./ProgressBarAndroidNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; export type ProgressBarAndroidProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js index 7a00b6636cf664..d5fd5cf83f7560 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js @@ -9,4 +9,4 @@ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js index 8e897540f7543d..9d619f08b86261 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js @@ -10,10 +10,10 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js b/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js index 7cdaad5ed46900..9f479341b0658f 100644 --- a/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js +++ b/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js @@ -11,7 +11,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); // $FlowFixMe const ProgressBarAndroid = require('../ProgressBarAndroid.android'); @@ -33,7 +33,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('ProgressBarAndroid'); + jest.dontMock('../ProgressBarAndroid'); const output = render.shallow( , @@ -42,7 +42,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('ProgressBarAndroid'); + jest.dontMock('../ProgressBarAndroid'); const instance = render.create( , diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js index 1b5a1436e4f1ba..8396ac4e87981e 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js @@ -9,10 +9,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../View/View'); class DummyProgressViewIOS extends React.Component { render() { diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index ff7eb3e9366dd4..dd6dcf51804790 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -10,14 +10,14 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); -const RCTProgressViewNativeComponent = require('RCTProgressViewNativeComponent'); +const RCTProgressViewNativeComponent = require('./RCTProgressViewNativeComponent'); -import type {ImageSource} from 'ImageSource'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type Props = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js index 32b2975a59940a..c88004fb374539 100644 --- a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +++ b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js @@ -10,12 +10,12 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {NativeComponent} from 'ReactNative'; -import type {ImageSource} from 'ImageSource'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js b/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js index 48f2105afe494b..5c53e06b8328f6 100644 --- a/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js +++ b/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js @@ -11,7 +11,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); const ProgressViewIOS = require('../ProgressViewIOS'); const render = require('../../../../jest/renderer'); @@ -28,14 +28,14 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('ProgressViewIOS'); + jest.dontMock('../ProgressViewIOS'); const output = render.shallow(); expect(output).toMatchSnapshot(); }); it('should render as when not mocked', () => { - jest.dontMock('ProgressViewIOS'); + jest.dontMock('../ProgressViewIOS'); const instance = render.create(); expect(instance).toMatchSnapshot(); diff --git a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js index 78558aac78b808..487dcf9ae56208 100644 --- a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +++ b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js @@ -10,13 +10,13 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; -const AndroidSwipeRefreshLayout = require('UIManager').getViewManagerConfig( +const AndroidSwipeRefreshLayout = require('../../ReactNative/UIManager').getViewManagerConfig( 'AndroidSwipeRefreshLayout', ); const RefreshLayoutConsts = AndroidSwipeRefreshLayout diff --git a/Libraries/Components/RefreshControl/RCTRefreshControlNativeComponent.js b/Libraries/Components/RefreshControl/RCTRefreshControlNativeComponent.js index a3262d46436e60..8c6495a886828f 100644 --- a/Libraries/Components/RefreshControl/RCTRefreshControlNativeComponent.js +++ b/Libraries/Components/RefreshControl/RCTRefreshControlNativeComponent.js @@ -10,11 +10,11 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; export type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index bbb3246a47d50e..cb432db07b6839 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -10,20 +10,20 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const {NativeComponent} = require('ReactNative'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const {NativeComponent} = require('../../Renderer/shims/ReactNative'); -const AndroidSwipeRefreshLayoutNativeComponent = require('AndroidSwipeRefreshLayoutNativeComponent'); -const RCTRefreshControlNativeComponent = require('RCTRefreshControlNativeComponent'); +const AndroidSwipeRefreshLayoutNativeComponent = require('./AndroidSwipeRefreshLayoutNativeComponent'); +const RCTRefreshControlNativeComponent = require('./RCTRefreshControlNativeComponent'); const nullthrows = require('nullthrows'); -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; let RefreshLayoutConsts; if (Platform.OS === 'android') { - const AndroidSwipeRefreshLayout = require('UIManager').getViewManagerConfig( + const AndroidSwipeRefreshLayout = require('../../ReactNative/UIManager').getViewManagerConfig( 'AndroidSwipeRefreshLayout', ); RefreshLayoutConsts = AndroidSwipeRefreshLayout diff --git a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js index daa576350aa120..f0c6e5c467fc62 100644 --- a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +++ b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js @@ -10,9 +10,9 @@ 'use strict'; -const React = require('React'); +const React = require('react'); -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../../ReactNative/requireNativeComponent'); const RCTRefreshControl = requireNativeComponent('RCTRefreshControl'); diff --git a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js index 250c2cd5c255be..b7b146b7d3cbb1 100644 --- a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +++ b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js @@ -8,10 +8,10 @@ * @flow */ -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/SafeAreaView/SafeAreaView.js b/Libraries/Components/SafeAreaView/SafeAreaView.js index 13728c29cacd08..b9c157df9dafaf 100644 --- a/Libraries/Components/SafeAreaView/SafeAreaView.js +++ b/Libraries/Components/SafeAreaView/SafeAreaView.js @@ -8,12 +8,12 @@ * @format */ -const Platform = require('Platform'); -const React = require('React'); -const View = require('View'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const View = require('../View/View'); -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type Props = $ReadOnly<{| ...ViewProps, @@ -44,7 +44,7 @@ if (Platform.OS === 'android') { SafeAreaViewRef.displayName = 'SafeAreaView'; exported = ((SafeAreaViewRef: any): Class>); } else { - const RCTSafeAreaViewNativeComponent = require('RCTSafeAreaViewNativeComponent'); + const RCTSafeAreaViewNativeComponent = require('./RCTSafeAreaViewNativeComponent'); const SafeAreaView = ( props: Props, diff --git a/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js b/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js index 2876b876b2ee63..a41e085ada0168 100644 --- a/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js +++ b/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js @@ -11,11 +11,11 @@ 'use strict'; -const React = require('React'); -const SafeAreaView = require('SafeAreaView'); +const React = require('react'); +const SafeAreaView = require('../SafeAreaView'); const render = require('../../../../jest/renderer'); -const View = require('View'); -const Text = require('Text'); +const View = require('../../View/View'); +const Text = require('../../../Text/Text'); describe('', () => { it('should render as when mocked', () => { @@ -41,7 +41,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('SafeAreaView'); + jest.dontMock('../SafeAreaView'); const output = render.shallow( @@ -54,7 +54,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('SafeAreaView'); + jest.dontMock('../SafeAreaView'); const instance = render.create( diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index a077f7b97f8d19..8c58f75c5d5126 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -10,23 +10,23 @@ 'use strict'; -const Dimensions = require('Dimensions'); -const FrameRateLogger = require('FrameRateLogger'); -const Keyboard = require('Keyboard'); -const ReactNative = require('ReactNative'); -const TextInputState = require('TextInputState'); -const UIManager = require('UIManager'); +const Dimensions = require('../Utilities/Dimensions'); +const FrameRateLogger = require('../Interaction/FrameRateLogger'); +const Keyboard = require('./Keyboard/Keyboard'); +const ReactNative = require('../Renderer/shims/ReactNative'); +const TextInputState = require('./TextInput/TextInputState'); +const UIManager = require('../ReactNative/UIManager'); const invariant = require('invariant'); const nullthrows = require('nullthrows'); const performanceNow = require('fbjs/lib/performanceNow'); const warning = require('fbjs/lib/warning'); -const {ScrollViewManager} = require('NativeModules'); +const {ScrollViewManager} = require('../BatchedBridge/NativeModules'); -import type {PressEvent, ScrollEvent} from 'CoreEventTypes'; -import type {KeyboardEvent} from 'Keyboard'; -import type EmitterSubscription from 'EmitterSubscription'; +import type {PressEvent, ScrollEvent} from '../Types/CoreEventTypes'; +import type {KeyboardEvent} from './Keyboard/Keyboard'; +import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; /** * Mixin that can be integrated in order to handle scrolling that plays well diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index fb181508079b15..f28d77908811fe 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -10,31 +10,35 @@ 'use strict'; -const AnimatedImplementation = require('AnimatedImplementation'); -const Platform = require('Platform'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const ScrollResponder = require('ScrollResponder'); -const ScrollViewStickyHeader = require('ScrollViewStickyHeader'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); - -const dismissKeyboard = require('dismissKeyboard'); -const flattenStyle = require('flattenStyle'); +const AnimatedImplementation = require('../../Animated/src/AnimatedImplementation'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const ScrollResponder = require('../ScrollResponder'); +const ScrollViewStickyHeader = require('./ScrollViewStickyHeader'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); + +const dismissKeyboard = require('../../Utilities/dismissKeyboard'); +const flattenStyle = require('../../StyleSheet/flattenStyle'); const invariant = require('invariant'); -const processDecelerationRate = require('processDecelerationRate'); -const requireNativeComponent = require('requireNativeComponent'); -const resolveAssetSource = require('resolveAssetSource'); - -import type {PressEvent, ScrollEvent, LayoutEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type {NativeMethodsMixinType} from 'ReactNativeTypes'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {ViewProps} from 'ViewPropTypes'; -import type {PointProp} from 'PointPropType'; - -import type {ColorValue} from 'StyleSheetTypes'; -import type {State as ScrollResponderState} from 'ScrollResponder'; +const processDecelerationRate = require('./processDecelerationRate'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); +const resolveAssetSource = require('../../Image/resolveAssetSource'); + +import type { + PressEvent, + ScrollEvent, + LayoutEvent, +} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {NativeMethodsMixinType} from '../../Renderer/shims/ReactNativeTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {PointProp} from '../../StyleSheet/PointPropType'; + +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {State as ScrollResponderState} from '../ScrollResponder'; let AndroidScrollView; let AndroidHorizontalScrollContentView; diff --git a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index 5ad409c783e96f..0510fae6b58fc9 100644 --- a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -9,12 +9,12 @@ */ 'use strict'; -const AnimatedImplementation = require('AnimatedImplementation'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const AnimatedImplementation = require('../../Animated/src/AnimatedImplementation'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../View/View'); -import type {LayoutEvent} from 'CoreEventTypes'; +import type {LayoutEvent} from '../../Types/CoreEventTypes'; const AnimatedView = AnimatedImplementation.createAnimatedComponent(View); diff --git a/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js b/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js index a2367c357d3189..85195684ca7cca 100644 --- a/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js +++ b/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js @@ -12,14 +12,14 @@ 'use strict'; -const React = require('React'); -const View = require('View'); +const React = require('react'); +const View = require('../../View/View'); -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../../ReactNative/requireNativeComponent'); const RCTScrollView = requireNativeComponent('RCTScrollView'); -const ScrollViewComponent = jest.genMockFromModule('ScrollView'); +const ScrollViewComponent = jest.genMockFromModule('../ScrollView'); class ScrollViewMock extends ScrollViewComponent { render() { diff --git a/Libraries/Components/ScrollView/processDecelerationRate.js b/Libraries/Components/ScrollView/processDecelerationRate.js index a685381715d835..44934df4fb36d0 100644 --- a/Libraries/Components/ScrollView/processDecelerationRate.js +++ b/Libraries/Components/ScrollView/processDecelerationRate.js @@ -10,7 +10,7 @@ 'use strict'; -const Platform = require('Platform'); +const Platform = require('../../Utilities/Platform'); function processDecelerationRate( decelerationRate: number | 'normal' | 'fast', diff --git a/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js b/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js index 37b944d186fc0a..68c9f7e52105e2 100644 --- a/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +++ b/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js @@ -9,11 +9,11 @@ */ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js index 581e77cf6ff8d4..a5f56f2f7a7cab 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js @@ -9,10 +9,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../View/View'); class DummySegmentedControlIOS extends React.Component { render() { diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js index 8dc88c1c7af478..7e9f99b93da555 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js @@ -10,13 +10,13 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); -const RCTSegmentedControlNativeComponent = require('RCTSegmentedControlNativeComponent'); +const RCTSegmentedControlNativeComponent = require('./RCTSegmentedControlNativeComponent'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Slider/RCTSliderNativeComponent.js b/Libraries/Components/Slider/RCTSliderNativeComponent.js index 245218f7967fe4..71e20a3f8eaaee 100644 --- a/Libraries/Components/Slider/RCTSliderNativeComponent.js +++ b/Libraries/Components/Slider/RCTSliderNativeComponent.js @@ -10,13 +10,13 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ColorValue} from 'StyleSheetTypes'; -import type {ImageSource} from 'ImageSource'; -import type {NativeComponent} from 'ReactNative'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 34391e6a63b5ff..e0e22b335c6e53 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -10,17 +10,17 @@ 'use strict'; -const Platform = require('Platform'); -const RCTSliderNativeComponent = require('RCTSliderNativeComponent'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StyleSheet = require('StyleSheet'); +const Platform = require('../../Utilities/Platform'); +const RCTSliderNativeComponent = require('./RCTSliderNativeComponent'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); -import type {ImageSource} from 'ImageSource'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/StaticContainer.react.js b/Libraries/Components/StaticContainer.react.js index 4772dd4af482cc..948e16ef85c5c0 100644 --- a/Libraries/Components/StaticContainer.react.js +++ b/Libraries/Components/StaticContainer.react.js @@ -10,7 +10,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); /** * Renders static content efficiently by allowing React to short-circuit the diff --git a/Libraries/Components/StaticRenderer.js b/Libraries/Components/StaticRenderer.js index f4d630d6a98ab0..3561064eec1253 100644 --- a/Libraries/Components/StaticRenderer.js +++ b/Libraries/Components/StaticRenderer.js @@ -10,7 +10,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); type Props = $ReadOnly<{| /** diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 0ee780d25bdb99..bae42a93ab1340 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -10,12 +10,13 @@ 'use strict'; -const React = require('React'); -const Platform = require('Platform'); +const React = require('react'); +const Platform = require('../../Utilities/Platform'); -const processColor = require('processColor'); +const processColor = require('../../StyleSheet/processColor'); -const StatusBarManager = require('NativeModules').StatusBarManager; +const StatusBarManager = require('../../BatchedBridge/NativeModules') + .StatusBarManager; /** * Status bar style diff --git a/Libraries/Components/StatusBar/StatusBarIOS.android.js b/Libraries/Components/StatusBar/StatusBarIOS.android.js index 4e9f97309b29b0..40331f4f67f8ae 100644 --- a/Libraries/Components/StatusBar/StatusBarIOS.android.js +++ b/Libraries/Components/StatusBar/StatusBarIOS.android.js @@ -10,7 +10,7 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); +const NativeEventEmitter = require('../../EventEmitter/NativeEventEmitter'); /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found when * making Flow check .android.js files. */ diff --git a/Libraries/Components/StatusBar/StatusBarIOS.ios.js b/Libraries/Components/StatusBar/StatusBarIOS.ios.js index ea558eafa9ba94..7dd0f818ec23bb 100644 --- a/Libraries/Components/StatusBar/StatusBarIOS.ios.js +++ b/Libraries/Components/StatusBar/StatusBarIOS.ios.js @@ -10,8 +10,8 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); -const {StatusBarManager} = require('NativeModules'); +const NativeEventEmitter = require('../../EventEmitter/NativeEventEmitter'); +const {StatusBarManager} = require('../../BatchedBridge/NativeModules'); /** * Use `StatusBar` for mutating the status bar. diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index ad928639748fd9..d47c61b00b04b0 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -10,15 +10,15 @@ 'use strict'; -const SwitchNativeComponent = require('SwitchNativeComponent'); -const Platform = require('Platform'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); - -import type {SwitchChangeEvent} from 'CoreEventTypes'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeAndroidProps, NativeIOSProps} from 'SwitchNativeComponent'; +const SwitchNativeComponent = require('./SwitchNativeComponent'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); + +import type {SwitchChangeEvent} from '../../Types/CoreEventTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeAndroidProps, NativeIOSProps} from './SwitchNativeComponent'; export type Props = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/Switch/SwitchNativeComponent.js b/Libraries/Components/Switch/SwitchNativeComponent.js index fd46bf64ea236d..b3be4dfaa12d22 100644 --- a/Libraries/Components/Switch/SwitchNativeComponent.js +++ b/Libraries/Components/Switch/SwitchNativeComponent.js @@ -10,13 +10,13 @@ 'use strict'; -const Platform = require('Platform'); -const ReactNative = require('ReactNative'); +const Platform = require('../../Utilities/Platform'); +const ReactNative = require('../../Renderer/shims/ReactNative'); -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {SwitchChangeEvent} from 'CoreEventTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {SwitchChangeEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; type SwitchProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/TextInput/InputAccessoryView.js b/Libraries/Components/TextInput/InputAccessoryView.js index 1272dc0f1cc20c..10c933e2cd283e 100644 --- a/Libraries/Components/TextInput/InputAccessoryView.js +++ b/Libraries/Components/TextInput/InputAccessoryView.js @@ -9,14 +9,14 @@ */ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const Platform = require('Platform'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); +const DeprecatedColorPropType = require('../../DeprecatedPropTypes/DeprecatedColorPropType'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); -const RCTInputAccessoryViewNativeComponent = require('RCTInputAccessoryViewNativeComponent'); +const RCTInputAccessoryViewNativeComponent = require('./RCTInputAccessoryViewNativeComponent'); -import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; /** * Note: iOS only diff --git a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js index 6a220e9b468ac7..f66701fc747093 100644 --- a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +++ b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js @@ -9,12 +9,12 @@ */ 'use strict'; -import type {NativeComponent} from 'ReactNative'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewStyleProp} from 'StyleSheet'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -const React = require('React'); -const requireNativeComponent = require('requireNativeComponent'); +const React = require('react'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); type NativeProps = $ReadOnly<{| +children: React.Node, diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 62be7517ee18bb..44999222bf741e 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -9,31 +9,31 @@ */ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes'); -const DocumentSelectionState = require('DocumentSelectionState'); -const NativeMethodsMixin = require('NativeMethodsMixin'); -const Platform = require('Platform'); +const DeprecatedColorPropType = require('../../DeprecatedPropTypes/DeprecatedColorPropType'); +const DeprecatedViewPropTypes = require('../../DeprecatedPropTypes/DeprecatedViewPropTypes'); +const DocumentSelectionState = require('../../vendor/document/selection/DocumentSelectionState'); +const NativeMethodsMixin = require('../../Renderer/shims/NativeMethodsMixin'); +const Platform = require('../../Utilities/Platform'); const PropTypes = require('prop-types'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TextAncestor = require('TextAncestor'); -const TextInputState = require('TextInputState'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const UIManager = require('UIManager'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const TextAncestor = require('../../Text/TextAncestor'); +const TextInputState = require('./TextInputState'); +const TouchableWithoutFeedback = require('../Touchable/TouchableWithoutFeedback'); +const UIManager = require('../../ReactNative/UIManager'); const createReactClass = require('create-react-class'); const invariant = require('invariant'); -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); const warning = require('fbjs/lib/warning'); -import type {TextStyleProp, ViewStyleProp} from 'StyleSheet'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent, ScrollEvent} from 'CoreEventTypes'; -import type {PressEvent} from 'CoreEventTypes'; +import type {TextStyleProp, ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {SyntheticEvent, ScrollEvent} from '../../Types/CoreEventTypes'; +import type {PressEvent} from '../../Types/CoreEventTypes'; let AndroidTextInput; let RCTMultilineTextInputView; diff --git a/Libraries/Components/TextInput/TextInputState.js b/Libraries/Components/TextInput/TextInputState.js index 19acafe2642855..5ce5595c461892 100644 --- a/Libraries/Components/TextInput/TextInputState.js +++ b/Libraries/Components/TextInput/TextInputState.js @@ -15,8 +15,8 @@ 'use strict'; -const Platform = require('Platform'); -const UIManager = require('UIManager'); +const Platform = require('../../Utilities/Platform'); +const UIManager = require('../../ReactNative/UIManager'); let currentlyFocusedID: ?number = null; const inputs = new Set(); diff --git a/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js b/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js index ed2081dac2eca8..6a8548a9008354 100644 --- a/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js +++ b/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js @@ -11,9 +11,9 @@ 'use strict'; -const React = require('React'); -const View = require('View'); -const InputAccessoryView = require('InputAccessoryView'); +const React = require('react'); +const View = require('../../View/View'); +const InputAccessoryView = require('../InputAccessoryView'); const render = require('../../../../jest/renderer'); describe('', () => { @@ -36,7 +36,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('InputAccessoryView'); + jest.dontMock('../InputAccessoryView'); const output = render.shallow( @@ -47,7 +47,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('InputAccessoryView'); + jest.dontMock('../InputAccessoryView'); const instance = render.create( diff --git a/Libraries/Components/TextInput/__tests__/TextInput-test.js b/Libraries/Components/TextInput/__tests__/TextInput-test.js index 431b65b1104971..70a2e02b559c27 100644 --- a/Libraries/Components/TextInput/__tests__/TextInput-test.js +++ b/Libraries/Components/TextInput/__tests__/TextInput-test.js @@ -11,15 +11,15 @@ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const TextInput = require('TextInput'); +const TextInput = require('../TextInput'); import Component from '@reactions/component'; -const {enter} = require('ReactNativeTestTools'); +const {enter} = require('../../../Utilities/ReactNativeTestTools'); -jest.unmock('TextInput'); +jest.unmock('../TextInput'); describe('TextInput tests', () => { let input; diff --git a/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js b/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js index 87c44621dc089b..8b25e19868b2c0 100644 --- a/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js +++ b/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js @@ -10,7 +10,8 @@ 'use strict'; -const TimePickerModule = require('NativeModules').TimePickerAndroid; +const TimePickerModule = require('../../BatchedBridge/NativeModules') + .TimePickerAndroid; import type { TimePickerOptions, diff --git a/Libraries/Components/ToastAndroid/ToastAndroid.android.js b/Libraries/Components/ToastAndroid/ToastAndroid.android.js index 832887453c3fc0..30207d30a9ce71 100644 --- a/Libraries/Components/ToastAndroid/ToastAndroid.android.js +++ b/Libraries/Components/ToastAndroid/ToastAndroid.android.js @@ -10,7 +10,8 @@ 'use strict'; -const RCTToastAndroid = require('NativeModules').ToastAndroid; +const RCTToastAndroid = require('../../BatchedBridge/NativeModules') + .ToastAndroid; /** * This exposes the native ToastAndroid module as a JS module. This has a function 'show' diff --git a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js index e659449be9ac0d..fdfbde63567274 100644 --- a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js +++ b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js @@ -10,17 +10,17 @@ 'use strict'; -const React = require('React'); -const UIManager = require('UIManager'); +const React = require('react'); +const UIManager = require('../../ReactNative/UIManager'); -const ToolbarAndroidNativeComponent = require('ToolbarAndroidNativeComponent'); -const resolveAssetSource = require('resolveAssetSource'); +const ToolbarAndroidNativeComponent = require('./ToolbarAndroidNativeComponent'); +const resolveAssetSource = require('../../Image/resolveAssetSource'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ImageSource} from 'ImageSource'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; /** * React component that wraps the Android-only [`Toolbar` widget][0]. A Toolbar can display a logo, diff --git a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js index 7a00b6636cf664..d5fd5cf83f7560 100644 --- a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js +++ b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js @@ -9,4 +9,4 @@ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Components/ToolbarAndroid/ToolbarAndroidNativeComponent.js b/Libraries/Components/ToolbarAndroid/ToolbarAndroidNativeComponent.js index f58a58083a8255..e65b4eabeeb368 100644 --- a/Libraries/Components/ToolbarAndroid/ToolbarAndroidNativeComponent.js +++ b/Libraries/Components/ToolbarAndroid/ToolbarAndroidNativeComponent.js @@ -10,12 +10,12 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ImageSource} from 'ImageSource'; -import type {ViewProps} from 'ViewPropTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ImageSource} from '../../Image/ImageSource'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type Action = $ReadOnly<{| title: string, diff --git a/Libraries/Components/Touchable/BoundingDimensions.js b/Libraries/Components/Touchable/BoundingDimensions.js index 28622a5b2da7f1..b0a48d0eccd65c 100644 --- a/Libraries/Components/Touchable/BoundingDimensions.js +++ b/Libraries/Components/Touchable/BoundingDimensions.js @@ -9,7 +9,7 @@ 'use strict'; -const PooledClass = require('PooledClass'); +const PooledClass = require('./PooledClass'); const twoArgumentPooler = PooledClass.twoArgumentPooler; diff --git a/Libraries/Components/Touchable/Position.js b/Libraries/Components/Touchable/Position.js index bc6a45cc6c6a1f..37c9738dd4b844 100644 --- a/Libraries/Components/Touchable/Position.js +++ b/Libraries/Components/Touchable/Position.js @@ -9,7 +9,7 @@ 'use strict'; -const PooledClass = require('PooledClass'); +const PooledClass = require('./PooledClass'); const twoArgumentPooler = PooledClass.twoArgumentPooler; diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index 5eebe51deb096b..0170576855d5c0 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -10,21 +10,21 @@ 'use strict'; -const BoundingDimensions = require('BoundingDimensions'); -const Platform = require('Platform'); -const Position = require('Position'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StyleSheet = require('StyleSheet'); -const TVEventHandler = require('TVEventHandler'); -const UIManager = require('UIManager'); -const View = require('View'); +const BoundingDimensions = require('./BoundingDimensions'); +const Platform = require('../../Utilities/Platform'); +const Position = require('./Position'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const TVEventHandler = require('../AppleTV/TVEventHandler'); +const UIManager = require('../../ReactNative/UIManager'); +const View = require('../View/View'); const keyMirror = require('fbjs/lib/keyMirror'); -const normalizeColor = require('normalizeColor'); +const normalizeColor = require('../../Color/normalizeColor'); -import type {PressEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; +import type {PressEvent} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; const extractSingleTouch = nativeEvent => { const touches = nativeEvent.touches; diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index 5dd3a46afc8a74..1010be60870a24 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -9,22 +9,22 @@ */ 'use strict'; -const Animated = require('Animated'); -const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes'); -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); -const NativeMethodsMixin = require('NativeMethodsMixin'); -const Platform = require('Platform'); +const Animated = require('../../Animated/src/Animated'); +const DeprecatedViewPropTypes = require('../../DeprecatedPropTypes/DeprecatedViewPropTypes'); +const DeprecatedEdgeInsetsPropType = require('../../DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'); +const NativeMethodsMixin = require('../../Renderer/shims/NativeMethodsMixin'); +const Platform = require('../../Utilities/Platform'); const PropTypes = require('prop-types'); -const React = require('React'); -const Touchable = require('Touchable'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); +const React = require('react'); +const Touchable = require('./Touchable'); +const TouchableWithoutFeedback = require('./TouchableWithoutFeedback'); const createReactClass = require('create-react-class'); -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {Props as TouchableWithoutFeedbackProps} from 'TouchableWithoutFeedback'; -import type {PressEvent} from 'CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; +import type {PressEvent} from '../../Types/CoreEventTypes'; type State = { animationID: ?number, diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 1b5afa6ef70b87..b9e552937b4949 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -9,26 +9,26 @@ */ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes'); -const NativeMethodsMixin = require('NativeMethodsMixin'); -const Platform = require('Platform'); +const DeprecatedColorPropType = require('../../DeprecatedPropTypes/DeprecatedColorPropType'); +const DeprecatedViewPropTypes = require('../../DeprecatedPropTypes/DeprecatedViewPropTypes'); +const NativeMethodsMixin = require('../../Renderer/shims/NativeMethodsMixin'); +const Platform = require('../../Utilities/Platform'); const PropTypes = require('prop-types'); -const React = require('React'); -const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); -const StyleSheet = require('StyleSheet'); -const Touchable = require('Touchable'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); +const React = require('react'); +const ReactNativeViewAttributes = require('../View/ReactNativeViewAttributes'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Touchable = require('./Touchable'); +const TouchableWithoutFeedback = require('./TouchableWithoutFeedback'); +const View = require('../View/View'); const createReactClass = require('create-react-class'); -const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); +const ensurePositiveDelayProps = require('./ensurePositiveDelayProps'); -import type {PressEvent} from 'CoreEventTypes'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {ColorValue} from 'StyleSheetTypes'; -import type {Props as TouchableWithoutFeedbackProps} from 'TouchableWithoutFeedback'; -import type {TVParallaxPropertiesType} from 'TVViewPropTypes'; +import type {PressEvent} from '../../Types/CoreEventTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; +import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes'; const DEFAULT_PROPS = { activeOpacity: 0.85, diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js index f23223a4ac2ec9..1bd0d27cab21da 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js @@ -10,20 +10,20 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); const PropTypes = require('prop-types'); -const ReactNative = require('ReactNative'); -const Touchable = require('Touchable'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const UIManager = require('UIManager'); -const View = require('View'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const Touchable = require('./Touchable'); +const TouchableWithoutFeedback = require('./TouchableWithoutFeedback'); +const UIManager = require('../../ReactNative/UIManager'); +const View = require('../View/View'); const createReactClass = require('create-react-class'); -const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); -const processColor = require('processColor'); +const ensurePositiveDelayProps = require('./ensurePositiveDelayProps'); +const processColor = require('../../StyleSheet/processColor'); -import type {PressEvent} from 'CoreEventTypes'; +import type {PressEvent} from '../../Types/CoreEventTypes'; const rippleBackgroundPropType = PropTypes.shape({ type: PropTypes.oneOf(['RippleAndroid']), diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js b/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js index e32f30deda1124..8efacfa3658346 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js @@ -9,10 +9,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../View/View'); class DummyTouchableNativeFeedback extends React.Component { static SelectableBackground = () => ({}); diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index b26b34b999deb8..235d47ff9af197 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -10,23 +10,23 @@ 'use strict'; -const Animated = require('Animated'); -const Easing = require('Easing'); -const NativeMethodsMixin = require('NativeMethodsMixin'); -const Platform = require('Platform'); -const React = require('React'); +const Animated = require('../../Animated/src/Animated'); +const Easing = require('../../Animated/src/Easing'); +const NativeMethodsMixin = require('../../Renderer/shims/NativeMethodsMixin'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); const PropTypes = require('prop-types'); -const Touchable = require('Touchable'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); +const Touchable = require('./Touchable'); +const TouchableWithoutFeedback = require('./TouchableWithoutFeedback'); const createReactClass = require('create-react-class'); -const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); -const flattenStyle = require('flattenStyle'); +const ensurePositiveDelayProps = require('./ensurePositiveDelayProps'); +const flattenStyle = require('../../StyleSheet/flattenStyle'); -import type {Props as TouchableWithoutFeedbackProps} from 'TouchableWithoutFeedback'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {TVParallaxPropertiesType} from 'TVViewPropTypes'; -import type {PressEvent} from 'CoreEventTypes'; +import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes'; +import type {PressEvent} from '../../Types/CoreEventTypes'; const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 8d317967e7c6f5..887a9805309f63 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -10,23 +10,30 @@ 'use strict'; -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); -const React = require('React'); +const DeprecatedEdgeInsetsPropType = require('../../DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'); +const React = require('react'); const PropTypes = require('prop-types'); -const Touchable = require('Touchable'); -const View = require('View'); +const Touchable = require('./Touchable'); +const View = require('../View/View'); const createReactClass = require('create-react-class'); -const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); +const ensurePositiveDelayProps = require('./ensurePositiveDelayProps'); const { DeprecatedAccessibilityRoles, DeprecatedAccessibilityStates, -} = require('DeprecatedViewAccessibility'); +} = require('../../DeprecatedPropTypes/DeprecatedViewAccessibility'); -import type {SyntheticEvent, LayoutEvent, PressEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type {AccessibilityRole, AccessibilityStates} from 'ViewAccessibility'; +import type { + SyntheticEvent, + LayoutEvent, + PressEvent, +} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type { + AccessibilityRole, + AccessibilityStates, +} from '../View/ViewAccessibility'; type TargetEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js index 8f299d8a360103..453f7407a2d12e 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js @@ -10,10 +10,10 @@ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const Text = require('Text'); -const TouchableHighlight = require('TouchableHighlight'); +const Text = require('../../../Text/Text'); +const TouchableHighlight = require('../TouchableHighlight'); describe('TouchableHighlight', () => { it('renders correctly', () => { diff --git a/Libraries/Components/UnimplementedViews/UnimplementedNativeView.js b/Libraries/Components/UnimplementedViews/UnimplementedNativeView.js index ee0b618aca535d..9e1d5f64af019c 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedNativeView.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedNativeView.js @@ -10,11 +10,11 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/UnimplementedViews/UnimplementedView.js b/Libraries/Components/UnimplementedViews/UnimplementedView.js index 30e64eb83d01fd..d507629710e16c 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedView.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedView.js @@ -9,8 +9,8 @@ */ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); /** * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner @@ -25,7 +25,7 @@ class UnimplementedView extends React.Component<$FlowFixMeProps> { render() { // Workaround require cycle from requireNativeComponent - const View = require('View'); + const View = require('../View/View'); return ( {this.props.children} diff --git a/Libraries/Components/View/PlatformViewPropTypes.ios.js b/Libraries/Components/View/PlatformViewPropTypes.ios.js index fc842750601026..418c3d999578ce 100644 --- a/Libraries/Components/View/PlatformViewPropTypes.ios.js +++ b/Libraries/Components/View/PlatformViewPropTypes.ios.js @@ -11,6 +11,6 @@ 'use strict'; -import type {TVViewProps} from 'TVViewPropTypes'; +import type {TVViewProps} from '../AppleTV/TVViewPropTypes'; export type PlatformViewPropTypes = TVViewProps; diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index 240e6a4f0a4e4a..8264f1f3779dd1 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -10,13 +10,13 @@ 'use strict'; -const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes'); -const TextStylePropTypes = require('TextStylePropTypes'); -const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes'); +const DeprecatedImageStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedImageStylePropTypes'); +const TextStylePropTypes = require('../../Text/TextStylePropTypes'); +const DeprecatedViewStylePropTypes = require('../../DeprecatedPropTypes/DeprecatedViewStylePropTypes'); -const processColor = require('processColor'); -const processTransform = require('processTransform'); -const sizesDiffer = require('sizesDiffer'); +const processColor = require('../../StyleSheet/processColor'); +const processTransform = require('../../StyleSheet/processTransform'); +const sizesDiffer = require('../../Utilities/differ/sizesDiffer'); const ReactNativeStyleAttributes = {}; diff --git a/Libraries/Components/View/ReactNativeViewAttributes.js b/Libraries/Components/View/ReactNativeViewAttributes.js index 59690b94045df5..b4a3b69040e311 100644 --- a/Libraries/Components/View/ReactNativeViewAttributes.js +++ b/Libraries/Components/View/ReactNativeViewAttributes.js @@ -10,7 +10,7 @@ 'use strict'; -const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes'); +const ReactNativeStyleAttributes = require('./ReactNativeStyleAttributes'); const ReactNativeViewAttributes = {}; diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 8e75dcac461fd6..c321d7f87a7cbc 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -10,10 +10,10 @@ 'use strict'; -const React = require('React'); -const ViewNativeComponent = require('ViewNativeComponent'); +const React = require('react'); +const ViewNativeComponent = require('./ViewNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; +import type {ViewProps} from './ViewPropTypes'; export type Props = ViewProps; diff --git a/Libraries/Components/View/ViewNativeComponent.js b/Libraries/Components/View/ViewNativeComponent.js index 432040ad3c3a4c..21e57c8a437ab5 100644 --- a/Libraries/Components/View/ViewNativeComponent.js +++ b/Libraries/Components/View/ViewNativeComponent.js @@ -10,11 +10,11 @@ 'use strict'; -const ReactNative = require('ReactNative'); +const ReactNative = require('../../Renderer/shims/ReactNative'); -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; +import type {ViewProps} from './ViewPropTypes'; type ViewNativeComponentType = Class>; diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 998baca13bd97f..c9ebe6d69f722c 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -10,12 +10,12 @@ 'use strict'; -import type {PressEvent, Layout, LayoutEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type React from 'React'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {TVViewProps} from 'TVViewPropTypes'; -import type {AccessibilityRole, AccessibilityStates} from 'ViewAccessibility'; +import type {PressEvent, Layout, LayoutEvent} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type React from 'react'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {TVViewProps} from '../AppleTV/TVViewPropTypes'; +import type {AccessibilityRole, AccessibilityStates} from './ViewAccessibility'; export type ViewLayout = Layout; export type ViewLayoutEvent = LayoutEvent; diff --git a/Libraries/Components/ViewPager/AndroidViewPagerNativeComponent.js b/Libraries/Components/ViewPager/AndroidViewPagerNativeComponent.js index a76092794d144c..82c7e18fb65d4b 100644 --- a/Libraries/Components/ViewPager/AndroidViewPagerNativeComponent.js +++ b/Libraries/Components/ViewPager/AndroidViewPagerNativeComponent.js @@ -10,12 +10,12 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; -import type {Node} from 'React'; -import type {ViewStyleProp} from 'StyleSheet'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {Node} from 'react'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; type PageScrollState = 'idle' | 'dragging' | 'settling'; diff --git a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js index 0c4b2ad41ac5d3..3c75742dc58179 100644 --- a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js +++ b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js @@ -10,16 +10,16 @@ 'use strict'; -const React = require('React'); -const ReactNative = require('ReactNative'); -const UIManager = require('UIManager'); +const React = require('react'); +const ReactNative = require('../../Renderer/shims/ReactNative'); +const UIManager = require('../../ReactNative/UIManager'); -const dismissKeyboard = require('dismissKeyboard'); +const dismissKeyboard = require('../../Utilities/dismissKeyboard'); -const NativeAndroidViewPager = require('AndroidViewPagerNativeComponent'); +const NativeAndroidViewPager = require('./AndroidViewPagerNativeComponent'); -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {ViewStyleProp} from 'StyleSheet'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; const VIEWPAGER_REF = 'viewPager'; diff --git a/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js b/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js index 7a00b6636cf664..d5fd5cf83f7560 100644 --- a/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js +++ b/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js @@ -9,4 +9,4 @@ 'use strict'; -module.exports = require('UnimplementedView'); +module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js b/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js index 14aafede381848..5589e0d22d07c4 100644 --- a/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js +++ b/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js @@ -10,7 +10,7 @@ 'use strict'; -const parseErrorStack = require('parseErrorStack'); +const parseErrorStack = require('../parseErrorStack'); function getFakeError() { return new Error('Happy Cat'); diff --git a/Libraries/Core/Devtools/getDevServer.js b/Libraries/Core/Devtools/getDevServer.js index 3eae2fbc404baf..1de83592dc3b43 100644 --- a/Libraries/Core/Devtools/getDevServer.js +++ b/Libraries/Core/Devtools/getDevServer.js @@ -10,7 +10,7 @@ 'use strict'; -const {SourceCode} = require('NativeModules'); +const {SourceCode} = require('../../BatchedBridge/NativeModules'); let _cachedDevServerURL: ?string; const FALLBACK = 'http://localhost:8081/'; diff --git a/Libraries/Core/Devtools/openFileInEditor.js b/Libraries/Core/Devtools/openFileInEditor.js index 00074b91eefedf..4d52b3f4ff708e 100644 --- a/Libraries/Core/Devtools/openFileInEditor.js +++ b/Libraries/Core/Devtools/openFileInEditor.js @@ -10,7 +10,7 @@ 'use strict'; -const getDevServer = require('getDevServer'); +const getDevServer = require('./getDevServer'); function openFileInEditor(file: string, lineNumber: number) { fetch(getDevServer().url + 'open-stack-frame', { diff --git a/Libraries/Core/Devtools/setupDevtools.js b/Libraries/Core/Devtools/setupDevtools.js index 4c9d76e0b66ad2..43ca374d50cdbd 100644 --- a/Libraries/Core/Devtools/setupDevtools.js +++ b/Libraries/Core/Devtools/setupDevtools.js @@ -15,9 +15,9 @@ let register = function() { }; if (__DEV__) { - const AppState = require('AppState'); + const AppState = require('../../AppState/AppState'); const reactDevTools = require('react-devtools-core'); - const getDevServer = require('getDevServer'); + const getDevServer = require('./getDevServer'); // Don't steal the DevTools from currently active app. // Note: if you add any AppState subscriptions to this file, @@ -37,7 +37,7 @@ if (__DEV__) { // Read the optional global variable for backward compatibility. // It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0. port: window.__REACT_DEVTOOLS_PORT__, - resolveRNStyle: require('flattenStyle'), + resolveRNStyle: require('../../StyleSheet/flattenStyle'), }); } diff --git a/Libraries/Core/Devtools/symbolicateStackTrace.js b/Libraries/Core/Devtools/symbolicateStackTrace.js index 93d643cdb3380d..f7cc031e300787 100644 --- a/Libraries/Core/Devtools/symbolicateStackTrace.js +++ b/Libraries/Core/Devtools/symbolicateStackTrace.js @@ -10,14 +10,14 @@ 'use strict'; -const getDevServer = require('getDevServer'); +const getDevServer = require('./getDevServer'); -const {SourceCode} = require('NativeModules'); +const {SourceCode} = require('../../BatchedBridge/NativeModules'); // Avoid requiring fetch on load of this module; see symbolicateStackTrace let fetch; -import type {StackFrame} from 'parseErrorStack'; +import type {StackFrame} from './parseErrorStack'; function isSourcedFromDisk(sourcePath: string): boolean { return !/^http/.test(sourcePath) && /[\\/]/.test(sourcePath); @@ -38,7 +38,7 @@ async function symbolicateStackTrace( // The fix below postpones trying to load fetch until the first call to symbolicateStackTrace. // At that time, we will have either global.fetch (whatwg-fetch) or RN's fetch. if (!fetch) { - fetch = global.fetch || require('fetch').fetch; + fetch = global.fetch || require('../../Network/fetch').fetch; } const devServer = getDevServer(); diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index 4552306b490c2d..07584c6f82b919 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ExtendedError} from 'parseErrorStack'; +import type {ExtendedError} from './Devtools/parseErrorStack'; const INTERNAL_CALLSITES_REGEX = new RegExp( [ @@ -24,9 +24,9 @@ const INTERNAL_CALLSITES_REGEX = new RegExp( */ let exceptionID = 0; function reportException(e: ExtendedError, isFatal: boolean) { - const {ExceptionsManager} = require('NativeModules'); + const {ExceptionsManager} = require('../BatchedBridge/NativeModules'); if (ExceptionsManager) { - const parseErrorStack = require('parseErrorStack'); + const parseErrorStack = require('./Devtools/parseErrorStack'); const stack = parseErrorStack(e); const currentExceptionID = ++exceptionID; const message = @@ -41,7 +41,7 @@ function reportException(e: ExtendedError, isFatal: boolean) { ExceptionsManager.reportSoftException(message, stack, currentExceptionID); } if (__DEV__) { - const symbolicateStackTrace = require('symbolicateStackTrace'); + const symbolicateStackTrace = require('./Devtools/symbolicateStackTrace'); symbolicateStackTrace(stack) .then(prettyStack => { if (prettyStack) { @@ -97,7 +97,7 @@ function reactConsoleErrorHandler() { if (arguments[0] && arguments[0].stack) { reportException(arguments[0], /* isFatal */ false); } else { - const stringifySafe = require('stringifySafe'); + const stringifySafe = require('../Utilities/stringifySafe'); const str = Array.prototype.map.call(arguments, stringifySafe).join(', '); if (str.slice(0, 10) === '"Warning: ') { // React warnings use console.error so that a stack trace is shown, but diff --git a/Libraries/Core/InitializeCore.js b/Libraries/Core/InitializeCore.js index ad11b26b52e9a4..d4cb2268645ee7 100644 --- a/Libraries/Core/InitializeCore.js +++ b/Libraries/Core/InitializeCore.js @@ -27,24 +27,24 @@ const start = Date.now(); -require('setUpGlobals'); -require('polyfillES6Collections'); -require('setUpSystrace'); -require('setUpErrorHandling'); -require('checkNativeVersion'); -require('polyfillPromise'); -require('setUpRegeneratorRuntime'); -require('setUpTimers'); -require('setUpXHR'); -require('setUpAlert'); -require('setUpNavigator'); -require('setUpBatchedBridge'); -require('setUpSegmentFetcher'); +require('./setUpGlobals'); +require('./polyfillES6Collections'); +require('./setUpSystrace'); +require('./setUpErrorHandling'); +require('./checkNativeVersion'); +require('./polyfillPromise'); +require('./setUpRegeneratorRuntime'); +require('./setUpTimers'); +require('./setUpXHR'); +require('./setUpAlert'); +require('./setUpNavigator'); +require('./setUpBatchedBridge'); +require('./setUpSegmentFetcher'); if (__DEV__) { - require('setUpDeveloperTools'); + require('./setUpDeveloperTools'); } -const GlobalPerformanceLogger = require('GlobalPerformanceLogger'); +const GlobalPerformanceLogger = require('../Utilities/GlobalPerformanceLogger'); // We could just call GlobalPerformanceLogger.markPoint at the top of the file, // but then we'd be excluding the time it took to require the logger. // Instead, we just use Date.now and backdate the timestamp. diff --git a/Libraries/Core/ReactNativeVersionCheck.js b/Libraries/Core/ReactNativeVersionCheck.js index 578b205645a487..30264918c79221 100644 --- a/Libraries/Core/ReactNativeVersionCheck.js +++ b/Libraries/Core/ReactNativeVersionCheck.js @@ -9,8 +9,8 @@ */ 'use strict'; -const {PlatformConstants} = require('NativeModules'); -const ReactNativeVersion = require('ReactNativeVersion'); +const {PlatformConstants} = require('../BatchedBridge/NativeModules'); +const ReactNativeVersion = require('./ReactNativeVersion'); /** * Checks that the version of this React Native JS is compatible with the native diff --git a/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js b/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js index b27db043e709cf..38319e03456d68 100644 --- a/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +++ b/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js @@ -9,8 +9,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 { +fetchSegment: ( diff --git a/Libraries/Core/Timers/JSTimers.js b/Libraries/Core/Timers/JSTimers.js index 32d667693b1170..54d86d44f18197 100644 --- a/Libraries/Core/Timers/JSTimers.js +++ b/Libraries/Core/Timers/JSTimers.js @@ -9,14 +9,14 @@ */ 'use strict'; -const Platform = require('Platform'); -const Systrace = require('Systrace'); +const Platform = require('../../Utilities/Platform'); +const Systrace = require('../../Performance/Systrace'); const invariant = require('invariant'); -const {Timing} = require('NativeModules'); -const BatchedBridge = require('BatchedBridge'); +const {Timing} = require('../../BatchedBridge/NativeModules'); +const BatchedBridge = require('../../BatchedBridge/BatchedBridge'); -import type {ExtendedError} from 'parseErrorStack'; +import type {ExtendedError} from '../Devtools/parseErrorStack'; let _performanceNow = null; function performanceNow() { @@ -82,7 +82,7 @@ function _allocateCallback(func: Function, type: JSTimerType): number { callbacks[freeIndex] = func; types[freeIndex] = type; if (__DEV__) { - const parseErrorStack = require('parseErrorStack'); + const parseErrorStack = require('../Devtools/parseErrorStack'); const error: ExtendedError = new Error(); error.framesToPop = 1; const stack = parseErrorStack(error); diff --git a/Libraries/Core/__tests__/MapAndSetPolyfills-test.js b/Libraries/Core/__tests__/MapAndSetPolyfills-test.js index cfda89e12d9a48..20f54a0e68d9d5 100644 --- a/Libraries/Core/__tests__/MapAndSetPolyfills-test.js +++ b/Libraries/Core/__tests__/MapAndSetPolyfills-test.js @@ -23,7 +23,7 @@ function cleanup() { describe('Map polyfill', () => { setup(); - const Map = require('Map'); + const Map = require('../../vendor/core/Map'); it('is not native', () => { const getCode = Function.prototype.toString.call(Map.prototype.get); @@ -63,7 +63,7 @@ describe('Map polyfill', () => { describe('Set polyfill', () => { setup(); - const Set = require('Set'); + const Set = require('../../vendor/core/Set'); it('is not native', () => { const addCode = Function.prototype.toString.call(Set.prototype.add); diff --git a/Libraries/Core/__tests__/ReactNativeVersionCheck-test.js b/Libraries/Core/__tests__/ReactNativeVersionCheck-test.js index 6f4da360362e9f..471a6f00308c3a 100644 --- a/Libraries/Core/__tests__/ReactNativeVersionCheck-test.js +++ b/Libraries/Core/__tests__/ReactNativeVersionCheck-test.js @@ -59,8 +59,8 @@ function _defineCheckVersionTests() { _mockJsVersion(0, 0, 0); _mockNativeVersion(0, 0, 0); - const ReactNativeVersion = require('ReactNativeVersion'); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersion = require('../ReactNativeVersion'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); expect(ReactNativeVersion).toMatchObject({ version: {major: 0, minor: 0, patch: 0, prerelease: null}, }); @@ -71,7 +71,7 @@ function _defineCheckVersionTests() { _mockJsVersion(0, 1, 0); _mockNativeVersion(0, 1, 0); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); expect(() => ReactNativeVersionCheck.checkVersions()).not.toThrow(); }); @@ -79,7 +79,7 @@ function _defineCheckVersionTests() { _mockJsVersion(0, 1, 0); _mockNativeVersion(0, 2, 0); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); ReactNativeVersionCheck.checkVersions(); expect(spyOnConsoleError).toHaveBeenCalledTimes(1); @@ -90,7 +90,7 @@ function _defineCheckVersionTests() { _mockJsVersion(1, 0, 0); _mockNativeVersion(2, 0, 0); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); ReactNativeVersionCheck.checkVersions(); expect(spyOnConsoleError).toHaveBeenCalledTimes(1); expect(consoleOutput).toMatch(/React Native version mismatch/); @@ -100,7 +100,7 @@ function _defineCheckVersionTests() { _mockJsVersion(0, 1, 0); _mockNativeVersion(0, 1, 2); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); ReactNativeVersionCheck.checkVersions(); expect(spyOnConsoleError).toHaveBeenCalledTimes(0); }); @@ -109,14 +109,14 @@ function _defineCheckVersionTests() { _mockJsVersion(0, 1, 0, 'beta.0'); _mockNativeVersion(0, 1, 0, 'alpha.1'); - const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); + const ReactNativeVersionCheck = require('../ReactNativeVersionCheck'); ReactNativeVersionCheck.checkVersions(); expect(spyOnConsoleError).toHaveBeenCalledTimes(0); }); } function _mockJsVersion(major = 0, minor = 0, patch = 0, prerelease = null) { - jest.doMock('ReactNativeVersion', () => ({ + jest.doMock('../ReactNativeVersion', () => ({ version: {major, minor, patch, prerelease}, })); } @@ -127,7 +127,7 @@ function _mockNativeVersion( patch = 0, prerelease = null, ) { - jest.doMock('NativeModules', () => ({ + jest.doMock('../../BatchedBridge/NativeModules', () => ({ PlatformConstants: { reactNativeVersion: {major, minor, patch, prerelease}, }, diff --git a/Libraries/Core/checkNativeVersion.js b/Libraries/Core/checkNativeVersion.js index 36a8b40ac530ba..3d2ef8bb487ede 100644 --- a/Libraries/Core/checkNativeVersion.js +++ b/Libraries/Core/checkNativeVersion.js @@ -13,5 +13,5 @@ * Check for compatibility between the JS and native code. * You can use this module directly, or just require InitializeCore. */ -const ReactNativeVersionCheck = require('ReactNativeVersionCheck'); +const ReactNativeVersionCheck = require('./ReactNativeVersionCheck'); ReactNativeVersionCheck.checkVersions(); diff --git a/Libraries/Core/polyfillES6Collections.js b/Libraries/Core/polyfillES6Collections.js index ca1ee798c73f4c..e6ff34402ad0e6 100644 --- a/Libraries/Core/polyfillES6Collections.js +++ b/Libraries/Core/polyfillES6Collections.js @@ -9,17 +9,17 @@ */ 'use strict'; -const {polyfillGlobal} = require('PolyfillFunctions'); +const {polyfillGlobal} = require('../Utilities/PolyfillFunctions'); /** * Polyfill ES6 collections (Map and Set). * If you don't need these polyfills, don't use InitializeCore; just directly * require the modules you need from InitializeCore for setup. */ -const _shouldPolyfillCollection = require('_shouldPolyfillES6Collection'); +const _shouldPolyfillCollection = require('../vendor/core/_shouldPolyfillES6Collection'); if (_shouldPolyfillCollection('Map')) { - polyfillGlobal('Map', () => require('Map')); + polyfillGlobal('Map', () => require('../vendor/core/Map')); } if (_shouldPolyfillCollection('Set')) { - polyfillGlobal('Set', () => require('Set')); + polyfillGlobal('Set', () => require('../vendor/core/Set')); } diff --git a/Libraries/Core/polyfillPromise.js b/Libraries/Core/polyfillPromise.js index f2068df4e98a02..78f1c29020a0dc 100644 --- a/Libraries/Core/polyfillPromise.js +++ b/Libraries/Core/polyfillPromise.js @@ -9,7 +9,7 @@ */ 'use strict'; -const {polyfillGlobal} = require('PolyfillFunctions'); +const {polyfillGlobal} = require('../Utilities/PolyfillFunctions'); /** * Set up Promise. The native Promise implementation throws the following error: @@ -18,4 +18,4 @@ const {polyfillGlobal} = require('PolyfillFunctions'); * If you don't need these polyfills, don't use InitializeCore; just directly * require the modules you need from InitializeCore for setup. */ -polyfillGlobal('Promise', () => require('Promise')); +polyfillGlobal('Promise', () => require('../Promise')); diff --git a/Libraries/Core/setUpAlert.js b/Libraries/Core/setUpAlert.js index 0b2bdc9f6a5273..60c57ba941746a 100644 --- a/Libraries/Core/setUpAlert.js +++ b/Libraries/Core/setUpAlert.js @@ -17,6 +17,6 @@ if (!global.alert) { global.alert = function(text) { // Require Alert on demand. Requiring it too early can lead to issues // with things like Platform not being fully initialized. - require('Alert').alert('Alert', '' + text); + require('../Alert/Alert').alert('Alert', '' + text); }; } diff --git a/Libraries/Core/setUpBatchedBridge.js b/Libraries/Core/setUpBatchedBridge.js index d4a2c877782e75..680c1398e45b84 100644 --- a/Libraries/Core/setUpBatchedBridge.js +++ b/Libraries/Core/setUpBatchedBridge.js @@ -14,29 +14,38 @@ * InitializeCore to ensure that the JS environment has been initialized. * You can use this module directly, or just require InitializeCore. */ -const BatchedBridge = require('BatchedBridge'); -BatchedBridge.registerLazyCallableModule('Systrace', () => require('Systrace')); -BatchedBridge.registerLazyCallableModule('JSTimers', () => require('JSTimers')); +const BatchedBridge = require('../BatchedBridge/BatchedBridge'); +BatchedBridge.registerLazyCallableModule('Systrace', () => + require('../Performance/Systrace'), +); +BatchedBridge.registerLazyCallableModule('JSTimers', () => + require('./Timers/JSTimers'), +); BatchedBridge.registerLazyCallableModule('HeapCapture', () => - require('HeapCapture'), + require('../Utilities/HeapCapture'), ); BatchedBridge.registerLazyCallableModule('SamplingProfiler', () => - require('SamplingProfiler'), + require('../Performance/SamplingProfiler'), +); +BatchedBridge.registerLazyCallableModule('RCTLog', () => + require('../Utilities/RCTLog'), ); -BatchedBridge.registerLazyCallableModule('RCTLog', () => require('RCTLog')); BatchedBridge.registerLazyCallableModule('RCTDeviceEventEmitter', () => - require('RCTDeviceEventEmitter'), + require('../EventEmitter/RCTDeviceEventEmitter'), ); BatchedBridge.registerLazyCallableModule('RCTNativeAppEventEmitter', () => - require('RCTNativeAppEventEmitter'), + require('../EventEmitter/RCTNativeAppEventEmitter'), ); BatchedBridge.registerLazyCallableModule('GlobalPerformanceLogger', () => - require('GlobalPerformanceLogger'), + require('../Utilities/GlobalPerformanceLogger'), ); BatchedBridge.registerLazyCallableModule('JSDevSupportModule', () => - require('JSDevSupportModule'), + require('../Utilities/JSDevSupportModule'), ); if (__DEV__ && !global.__RCTProfileIsProfiling) { - BatchedBridge.registerCallableModule('HMRClient', require('HMRClient')); + BatchedBridge.registerCallableModule( + 'HMRClient', + require('../Utilities/HMRClient'), + ); } diff --git a/Libraries/Core/setUpDeveloperTools.js b/Libraries/Core/setUpDeveloperTools.js index 2ee713da0b4dae..e18b5be9740199 100644 --- a/Libraries/Core/setUpDeveloperTools.js +++ b/Libraries/Core/setUpDeveloperTools.js @@ -18,11 +18,11 @@ if (__DEV__) { // not when debugging in chrome // TODO(t12832058) This check is broken if (!window.document) { - require('setupDevtools'); + require('./Devtools/setupDevtools'); } // Set up inspector - const JSInspector = require('JSInspector'); - JSInspector.registerAgent(require('NetworkAgent')); + const JSInspector = require('../JSInspector/JSInspector'); + JSInspector.registerAgent(require('../JSInspector/NetworkAgent')); } } diff --git a/Libraries/Core/setUpErrorHandling.js b/Libraries/Core/setUpErrorHandling.js index 7a9c566905d8f9..3ef5491c36b783 100644 --- a/Libraries/Core/setUpErrorHandling.js +++ b/Libraries/Core/setUpErrorHandling.js @@ -13,7 +13,7 @@ * Sets up the console and exception handling (redbox) for React Native. * You can use this module directly, or just require InitializeCore. */ -const ExceptionsManager = require('ExceptionsManager'); +const ExceptionsManager = require('./ExceptionsManager'); ExceptionsManager.installConsoleErrorReporter(); // Set up error handler @@ -27,6 +27,6 @@ if (!global.__fbDisableExceptionsManager) { } }; - const ErrorUtils = require('ErrorUtils'); + const ErrorUtils = require('../vendor/core/ErrorUtils'); ErrorUtils.setGlobalHandler(handleError); } diff --git a/Libraries/Core/setUpNavigator.js b/Libraries/Core/setUpNavigator.js index 796d0b411877d1..206e7a6dafc7e6 100644 --- a/Libraries/Core/setUpNavigator.js +++ b/Libraries/Core/setUpNavigator.js @@ -9,7 +9,7 @@ */ 'use strict'; -const {polyfillObjectProperty} = require('PolyfillFunctions'); +const {polyfillObjectProperty} = require('../Utilities/PolyfillFunctions'); let navigator = global.navigator; if (navigator === undefined) { diff --git a/Libraries/Core/setUpRegeneratorRuntime.js b/Libraries/Core/setUpRegeneratorRuntime.js index 26fb440c6d270a..8e549e14fa1c9a 100644 --- a/Libraries/Core/setUpRegeneratorRuntime.js +++ b/Libraries/Core/setUpRegeneratorRuntime.js @@ -9,7 +9,7 @@ */ 'use strict'; -const {polyfillGlobal} = require('PolyfillFunctions'); +const {polyfillGlobal} = require('../Utilities/PolyfillFunctions'); /** * Set up regenerator. diff --git a/Libraries/Core/setUpSegmentFetcher.js b/Libraries/Core/setUpSegmentFetcher.js index ba2635fff2ea40..dd182a69c91bb7 100644 --- a/Libraries/Core/setUpSegmentFetcher.js +++ b/Libraries/Core/setUpSegmentFetcher.js @@ -18,7 +18,8 @@ global.__fetchSegment = function( options: {|+otaBuildNumber: ?string|}, callback: (?Error) => void, ) { - const SegmentFetcher = require('NativeSegmentFetcher').default; + const SegmentFetcher = require('./SegmentFetcher/NativeSegmentFetcher') + .default; SegmentFetcher.fetchSegment( segmentId, options, diff --git a/Libraries/Core/setUpSystrace.js b/Libraries/Core/setUpSystrace.js index 36a6bf40c0ff91..22242fbb244190 100644 --- a/Libraries/Core/setUpSystrace.js +++ b/Libraries/Core/setUpSystrace.js @@ -14,7 +14,7 @@ * You can use this module directly, or just require InitializeCore. */ if (global.__RCTProfileIsProfiling) { - const Systrace = require('Systrace'); + const Systrace = require('../Performance/Systrace'); Systrace.installReactHook(); Systrace.setEnabled(true); } diff --git a/Libraries/Core/setUpTimers.js b/Libraries/Core/setUpTimers.js index 1a95afa8751bed..8a9b22ecd87efb 100644 --- a/Libraries/Core/setUpTimers.js +++ b/Libraries/Core/setUpTimers.js @@ -9,14 +9,14 @@ */ 'use strict'; -const {polyfillGlobal} = require('PolyfillFunctions'); +const {polyfillGlobal} = require('../Utilities/PolyfillFunctions'); /** * Set up timers. * You can use this module directly, or just require InitializeCore. */ const defineLazyTimer = name => { - polyfillGlobal(name, () => require('JSTimers')[name]); + polyfillGlobal(name, () => require('./Timers/JSTimers')[name]); }; defineLazyTimer('setTimeout'); defineLazyTimer('setInterval'); diff --git a/Libraries/Core/setUpXHR.js b/Libraries/Core/setUpXHR.js index b1525ea5561593..d108ef3588a899 100644 --- a/Libraries/Core/setUpXHR.js +++ b/Libraries/Core/setUpXHR.js @@ -9,7 +9,7 @@ */ 'use strict'; -const {polyfillGlobal} = require('PolyfillFunctions'); +const {polyfillGlobal} = require('../Utilities/PolyfillFunctions'); /** * Set up XMLHttpRequest. The native XMLHttpRequest in Chrome dev tools is CORS @@ -17,19 +17,19 @@ const {polyfillGlobal} = require('PolyfillFunctions'); * * You can use this module directly, or just require InitializeCore. */ -polyfillGlobal('XMLHttpRequest', () => require('XMLHttpRequest')); -polyfillGlobal('FormData', () => require('FormData')); +polyfillGlobal('XMLHttpRequest', () => require('../Network/XMLHttpRequest')); +polyfillGlobal('FormData', () => require('../Network/FormData')); -polyfillGlobal('fetch', () => require('fetch').fetch); // flowlint-line untyped-import:off -polyfillGlobal('Headers', () => require('fetch').Headers); // flowlint-line untyped-import:off -polyfillGlobal('Request', () => require('fetch').Request); // flowlint-line untyped-import:off -polyfillGlobal('Response', () => require('fetch').Response); // flowlint-line untyped-import:off -polyfillGlobal('WebSocket', () => require('WebSocket')); -polyfillGlobal('Blob', () => require('Blob')); -polyfillGlobal('File', () => require('File')); -polyfillGlobal('FileReader', () => require('FileReader')); -polyfillGlobal('URL', () => require('URL').URL); // flowlint-line untyped-import:off -polyfillGlobal('URLSearchParams', () => require('URL').URLSearchParams); // flowlint-line untyped-import:off +polyfillGlobal('fetch', () => require('../Network/fetch').fetch); // flowlint-line untyped-import:off +polyfillGlobal('Headers', () => require('../Network/fetch').Headers); // flowlint-line untyped-import:off +polyfillGlobal('Request', () => require('../Network/fetch').Request); // flowlint-line untyped-import:off +polyfillGlobal('Response', () => require('../Network/fetch').Response); // flowlint-line untyped-import:off +polyfillGlobal('WebSocket', () => require('../WebSocket/WebSocket')); +polyfillGlobal('Blob', () => require('../Blob/Blob')); +polyfillGlobal('File', () => require('../Blob/File')); +polyfillGlobal('FileReader', () => require('../Blob/FileReader')); +polyfillGlobal('URL', () => require('../Blob/URL').URL); // flowlint-line untyped-import:off +polyfillGlobal('URLSearchParams', () => require('../Blob/URL').URLSearchParams); // flowlint-line untyped-import:off polyfillGlobal( 'AbortController', () => require('abort-controller/dist/abort-controller').AbortController, // flowlint-line untyped-import:off diff --git a/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js b/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js index 84d3b225a45f33..68e9acba8fe6ce 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js @@ -9,7 +9,7 @@ 'use strict'; -const normalizeColor = require('normalizeColor'); +const normalizeColor = require('../Color/normalizeColor'); const colorPropType = function( isRequired, diff --git a/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js b/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js index 6b8c16b579d23e..49e5f1de6ed415 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js @@ -10,10 +10,10 @@ 'use strict'; -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); -const DeprecatedImageSourcePropType = require('DeprecatedImageSourcePropType'); -const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes'); -const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType'); +const DeprecatedEdgeInsetsPropType = require('./DeprecatedEdgeInsetsPropType'); +const DeprecatedImageSourcePropType = require('./DeprecatedImageSourcePropType'); +const DeprecatedImageStylePropTypes = require('./DeprecatedImageStylePropTypes'); +const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); const PropTypes = require('prop-types'); module.exports = { diff --git a/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js b/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js index 3fbed21da30fe0..eab9d6e49c892b 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js @@ -9,11 +9,11 @@ */ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedLayoutPropTypes = require('DeprecatedLayoutPropTypes'); +const DeprecatedColorPropType = require('./DeprecatedColorPropType'); +const DeprecatedLayoutPropTypes = require('./DeprecatedLayoutPropTypes'); const ReactPropTypes = require('prop-types'); -const DeprecatedShadowPropTypesIOS = require('DeprecatedShadowPropTypesIOS'); -const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes'); +const DeprecatedShadowPropTypesIOS = require('./DeprecatedShadowPropTypesIOS'); +const DeprecatedTransformPropTypes = require('./DeprecatedTransformPropTypes'); const ImageStylePropTypes = { ...DeprecatedLayoutPropTypes, diff --git a/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js b/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js index 889b5624938736..f2d73c9578f935 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js @@ -9,7 +9,7 @@ */ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); +const DeprecatedColorPropType = require('./DeprecatedColorPropType'); const ReactPropTypes = require('prop-types'); const DeprecatedShadowPropTypesIOS = { diff --git a/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js b/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js index 9cad5470ad7374..dcab087fb5e444 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js @@ -10,8 +10,8 @@ 'use strict'; -const deprecatedCreateStrictShapeTypeChecker = require('deprecatedCreateStrictShapeTypeChecker'); -const flattenStyle = require('flattenStyle'); +const deprecatedCreateStrictShapeTypeChecker = require('./deprecatedCreateStrictShapeTypeChecker'); +const flattenStyle = require('../StyleSheet/flattenStyle'); function DeprecatedStyleSheetPropType(shape: { [key: string]: ReactPropsCheckType, diff --git a/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js b/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js index 1723bb56cb6cdd..06abb2fc3fd790 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js @@ -10,11 +10,11 @@ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); -const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType'); +const DeprecatedColorPropType = require('./DeprecatedColorPropType'); +const DeprecatedEdgeInsetsPropType = require('./DeprecatedEdgeInsetsPropType'); +const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); const PropTypes = require('prop-types'); -const TextStylePropTypes = require('TextStylePropTypes'); +const TextStylePropTypes = require('../Text/TextStylePropTypes'); const stylePropType = DeprecatedStyleSheetPropType(TextStylePropTypes); diff --git a/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js b/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js index a463dcc1cd15db..d4a408f7e9546c 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js @@ -12,7 +12,7 @@ const ReactPropTypes = require('prop-types'); -const deprecatedPropType = require('deprecatedPropType'); +const deprecatedPropType = require('../Utilities/deprecatedPropType'); const TransformMatrixPropType = function( props: Object, diff --git a/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js b/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js index 34dec0784734c6..01f035858cb607 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js @@ -10,16 +10,16 @@ 'use strict'; -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); -const PlatformViewPropTypes = require('PlatformViewPropTypes'); +const DeprecatedEdgeInsetsPropType = require('./DeprecatedEdgeInsetsPropType'); +const PlatformViewPropTypes = require('../Components/View/PlatformViewPropTypes'); const PropTypes = require('prop-types'); -const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType'); -const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes'); +const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); +const DeprecatedViewStylePropTypes = require('./DeprecatedViewStylePropTypes'); const { DeprecatedAccessibilityRoles, DeprecatedAccessibilityStates, -} = require('DeprecatedViewAccessibility'); +} = require('./DeprecatedViewAccessibility'); const stylePropType = DeprecatedStyleSheetPropType( DeprecatedViewStylePropTypes, diff --git a/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js b/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js index 546da9cee33e8d..373174edd1eaf2 100644 --- a/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +++ b/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js @@ -10,11 +10,11 @@ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedLayoutPropTypes = require('DeprecatedLayoutPropTypes'); +const DeprecatedColorPropType = require('./DeprecatedColorPropType'); +const DeprecatedLayoutPropTypes = require('./DeprecatedLayoutPropTypes'); const ReactPropTypes = require('prop-types'); -const DeprecatedShadowPropTypesIOS = require('DeprecatedShadowPropTypesIOS'); -const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes'); +const DeprecatedShadowPropTypesIOS = require('./DeprecatedShadowPropTypesIOS'); +const DeprecatedTransformPropTypes = require('./DeprecatedTransformPropTypes'); /** * Warning: Some of these properties may not be supported in all releases. diff --git a/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js b/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js index c28b2288e2d434..fbb9963d287470 100644 --- a/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +++ b/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js @@ -11,7 +11,7 @@ 'use strict'; const invariant = require('invariant'); -const merge = require('merge'); +const merge = require('../vendor/core/merge'); function deprecatedCreateStrictShapeTypeChecker(shapeTypes: { [key: string]: ReactPropsCheckType, diff --git a/Libraries/EventEmitter/NativeEventEmitter.js b/Libraries/EventEmitter/NativeEventEmitter.js index 62b85c69a8e974..6b70ef03df0dfc 100644 --- a/Libraries/EventEmitter/NativeEventEmitter.js +++ b/Libraries/EventEmitter/NativeEventEmitter.js @@ -10,13 +10,13 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const Platform = require('Platform'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const EventEmitter = require('../vendor/emitter/EventEmitter'); +const Platform = require('../Utilities/Platform'); +const RCTDeviceEventEmitter = require('./RCTDeviceEventEmitter'); const invariant = require('invariant'); -import type EmitterSubscription from 'EmitterSubscription'; +import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; type NativeModule = { +addListener: (eventType: string) => void, diff --git a/Libraries/EventEmitter/RCTDeviceEventEmitter.js b/Libraries/EventEmitter/RCTDeviceEventEmitter.js index 342aa733bf08ff..f3192d0bb4f01b 100644 --- a/Libraries/EventEmitter/RCTDeviceEventEmitter.js +++ b/Libraries/EventEmitter/RCTDeviceEventEmitter.js @@ -10,10 +10,10 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const EventSubscriptionVendor = require('EventSubscriptionVendor'); +const EventEmitter = require('../vendor/emitter/EventEmitter'); +const EventSubscriptionVendor = require('../vendor/emitter/EventSubscriptionVendor'); -import type EmitterSubscription from 'EmitterSubscription'; +import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; function checkNativeEventModule(eventType: ?string) { if (eventType) { diff --git a/Libraries/EventEmitter/RCTEventEmitter.js b/Libraries/EventEmitter/RCTEventEmitter.js index f84bca058ed366..8001a7cf36a005 100644 --- a/Libraries/EventEmitter/RCTEventEmitter.js +++ b/Libraries/EventEmitter/RCTEventEmitter.js @@ -10,7 +10,7 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); +const BatchedBridge = require('../BatchedBridge/BatchedBridge'); const RCTEventEmitter = { register(eventEmitter: any) { diff --git a/Libraries/EventEmitter/RCTNativeAppEventEmitter.js b/Libraries/EventEmitter/RCTNativeAppEventEmitter.js index 2d302c014feebb..c0cbef506efb11 100644 --- a/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +++ b/Libraries/EventEmitter/RCTNativeAppEventEmitter.js @@ -10,7 +10,7 @@ 'use strict'; -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const RCTDeviceEventEmitter = require('./RCTDeviceEventEmitter'); /** * Deprecated - subclass NativeEventEmitter to create granular event modules instead of diff --git a/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js b/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js index e34e60e2e9f201..5a8eadc2795302 100644 --- a/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +++ b/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js @@ -10,8 +10,8 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const EventEmitter = require('../../vendor/emitter/EventEmitter'); +const RCTDeviceEventEmitter = require('../RCTDeviceEventEmitter'); /** * Mock the NativeEventEmitter as a normal JS EventEmitter. diff --git a/Libraries/Experimental/Incremental.js b/Libraries/Experimental/Incremental.js index 76d8ff902680ab..e7f3e82c2126e6 100644 --- a/Libraries/Experimental/Incremental.js +++ b/Libraries/Experimental/Incremental.js @@ -10,12 +10,12 @@ 'use strict'; -const InteractionManager = require('InteractionManager'); -const React = require('React'); +const InteractionManager = require('../Interaction/InteractionManager'); +const React = require('react'); const PropTypes = require('prop-types'); -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const DEBUG = false; diff --git a/Libraries/Experimental/IncrementalExample.js b/Libraries/Experimental/IncrementalExample.js index 1ae1196493f49e..906bb281bcd110 100644 --- a/Libraries/Experimental/IncrementalExample.js +++ b/Libraries/Experimental/IncrementalExample.js @@ -21,11 +21,11 @@ const { View, } = ReactNative; -const Incremental = require('Incremental'); -const IncrementalGroup = require('IncrementalGroup'); -const IncrementalPresenter = require('IncrementalPresenter'); +const Incremental = require('./Incremental'); +const IncrementalGroup = require('./IncrementalGroup'); +const IncrementalPresenter = require('./IncrementalPresenter'); -const JSEventLoopWatchdog = require('JSEventLoopWatchdog'); +const JSEventLoopWatchdog = require('../Interaction/JSEventLoopWatchdog'); const performanceNow = require('fbjs/lib/performanceNow'); diff --git a/Libraries/Experimental/IncrementalGroup.js b/Libraries/Experimental/IncrementalGroup.js index 03421e92c58f4c..6c2098cea71419 100644 --- a/Libraries/Experimental/IncrementalGroup.js +++ b/Libraries/Experimental/IncrementalGroup.js @@ -10,17 +10,17 @@ 'use strict'; -const Incremental = require('Incremental'); -const React = require('React'); +const Incremental = require('./Incremental'); +const React = require('react'); const PropTypes = require('prop-types'); -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); let _groupCounter = -1; const DEBUG = false; -import type {Props, Context} from 'Incremental'; +import type {Props, Context} from './Incremental'; /** * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will diff --git a/Libraries/Experimental/IncrementalPresenter.js b/Libraries/Experimental/IncrementalPresenter.js index 784878f93468d4..a3f8069c93ca74 100644 --- a/Libraries/Experimental/IncrementalPresenter.js +++ b/Libraries/Experimental/IncrementalPresenter.js @@ -10,14 +10,14 @@ 'use strict'; -const IncrementalGroup = require('IncrementalGroup'); +const IncrementalGroup = require('./IncrementalGroup'); const PropTypes = require('prop-types'); -const React = require('React'); -const View = require('View'); +const React = require('react'); +const View = require('../Components/View/View'); -import type {Context} from 'Incremental'; -import type {ViewStyleProp} from 'StyleSheet'; -import type {LayoutEvent} from 'CoreEventTypes'; +import type {Context} from './Incremental'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; +import type {LayoutEvent} from '../Types/CoreEventTypes'; /** * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will diff --git a/Libraries/Experimental/WindowedListView.js b/Libraries/Experimental/WindowedListView.js index 6492c12bb47d06..fd7af713bce784 100644 --- a/Libraries/Experimental/WindowedListView.js +++ b/Libraries/Experimental/WindowedListView.js @@ -10,22 +10,22 @@ 'use strict'; -const Batchinator = require('Batchinator'); -const IncrementalGroup = require('IncrementalGroup'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const Systrace = require('Systrace'); -const View = require('View'); -const ViewabilityHelper = require('ViewabilityHelper'); +const Batchinator = require('../Interaction/Batchinator'); +const IncrementalGroup = require('./IncrementalGroup'); +const React = require('react'); +const ScrollView = require('../Components/ScrollView/ScrollView'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Systrace = require('../Performance/Systrace'); +const View = require('../Components/View/View'); +const ViewabilityHelper = require('../Lists/ViewabilityHelper'); -const clamp = require('clamp'); -const deepDiffer = require('deepDiffer'); -const infoLog = require('infoLog'); +const clamp = require('../Utilities/clamp'); +const deepDiffer = require('../Utilities/differ/deepDiffer'); +const infoLog = require('../Utilities/infoLog'); const invariant = require('invariant'); const nullthrows = require('nullthrows'); -import type {NativeMethodsMixinType} from 'ReactNativeTypes'; +import type {NativeMethodsMixinType} from '../Renderer/shims/ReactNativeTypes'; const DEBUG = false; @@ -777,7 +777,7 @@ class CellRenderer extends React.Component { let debug; if (DEBUG) { infoLog('render cell ' + this.props.rowIndex); - const Text = require('Text'); + const Text = require('../Text/Text'); debug = Row: {this.props.rowIndex}; } const style = this._includeInLayoutLatch ? styles.include : styles.remove; diff --git a/Libraries/Image/AssetSourceResolver.js b/Libraries/Image/AssetSourceResolver.js index da2daa93968ac1..90156bf3459ca9 100644 --- a/Libraries/Image/AssetSourceResolver.js +++ b/Libraries/Image/AssetSourceResolver.js @@ -17,10 +17,10 @@ export type ResolvedAssetSource = {| +scale: number, |}; -import type {PackagerAsset} from 'AssetRegistry'; +import type {PackagerAsset} from './AssetRegistry'; -const PixelRatio = require('PixelRatio'); -const Platform = require('Platform'); +const PixelRatio = require('../Utilities/PixelRatio'); +const Platform = require('../Utilities/Platform'); const assetPathUtils = require('./assetPathUtils'); const invariant = require('invariant'); diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 002aba8f62ace4..c6f9d9e5eb5255 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -10,26 +10,26 @@ 'use strict'; -const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes'); -const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType'); -const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes'); -const ImageViewNativeComponent = require('ImageViewNativeComponent'); -const NativeModules = require('NativeModules'); +const DeprecatedImageStylePropTypes = require('../DeprecatedPropTypes/DeprecatedImageStylePropTypes'); +const DeprecatedStyleSheetPropType = require('../DeprecatedPropTypes/DeprecatedStyleSheetPropType'); +const DeprecatedViewPropTypes = require('../DeprecatedPropTypes/DeprecatedViewPropTypes'); +const ImageViewNativeComponent = require('./ImageViewNativeComponent'); +const NativeModules = require('../BatchedBridge/NativeModules'); const PropTypes = require('prop-types'); -const React = require('React'); -const ReactNative = require('ReactNative'); // eslint-disable-line no-unused-vars -const StyleSheet = require('StyleSheet'); -const TextAncestor = require('TextAncestor'); +const React = require('react'); +const ReactNative = require('../Renderer/shims/ReactNative'); // eslint-disable-line no-unused-vars +const StyleSheet = require('../StyleSheet/StyleSheet'); +const TextAncestor = require('../Text/TextAncestor'); -const flattenStyle = require('flattenStyle'); -const merge = require('merge'); -const resolveAssetSource = require('resolveAssetSource'); +const flattenStyle = require('../StyleSheet/flattenStyle'); +const merge = require('../vendor/core/merge'); +const resolveAssetSource = require('./resolveAssetSource'); const {ImageLoader} = NativeModules; -const TextInlineImageNativeComponent = require('TextInlineImageNativeComponent'); +const TextInlineImageNativeComponent = require('./TextInlineImageNativeComponent'); -import type {ImageProps as ImagePropsType} from 'ImageProps'; +import type {ImageProps as ImagePropsType} from './ImageProps'; let _requestId = 1; function generateRequestId() { diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 301e28ef35bd13..59411e6d6aedf8 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -9,23 +9,23 @@ */ 'use strict'; -const DeprecatedImagePropType = require('DeprecatedImagePropType'); -const NativeModules = require('NativeModules'); -const React = require('React'); -const ReactNative = require('ReactNative'); // eslint-disable-line no-unused-vars -const StyleSheet = require('StyleSheet'); +const DeprecatedImagePropType = require('../DeprecatedPropTypes/DeprecatedImagePropType'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const React = require('react'); +const ReactNative = require('../Renderer/shims/ReactNative'); // eslint-disable-line no-unused-vars +const StyleSheet = require('../StyleSheet/StyleSheet'); -const flattenStyle = require('flattenStyle'); -const requireNativeComponent = require('requireNativeComponent'); -const resolveAssetSource = require('resolveAssetSource'); +const flattenStyle = require('../StyleSheet/flattenStyle'); +const requireNativeComponent = require('../ReactNative/requireNativeComponent'); +const resolveAssetSource = require('./resolveAssetSource'); const ImageViewManager = NativeModules.ImageViewManager; const RCTImageView = requireNativeComponent('RCTImageView'); -import type {ImageProps as ImagePropsType} from 'ImageProps'; +import type {ImageProps as ImagePropsType} from './ImageProps'; -import type {ImageStyleProp} from 'StyleSheet'; +import type {ImageStyleProp} from '../StyleSheet/StyleSheet'; function getSize( uri: string, diff --git a/Libraries/Image/ImageBackground.js b/Libraries/Image/ImageBackground.js index 7d04576dcc0c92..22d684ba90bf32 100644 --- a/Libraries/Image/ImageBackground.js +++ b/Libraries/Image/ImageBackground.js @@ -9,12 +9,12 @@ */ 'use strict'; -const Image = require('Image'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const Image = require('./Image'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const View = require('../Components/View/View'); -const ensureComponentIsNative = require('ensureComponentIsNative'); +const ensureComponentIsNative = require('../Components/Touchable/ensureComponentIsNative'); /** * Very simple drop-in replacement for which supports nesting views. diff --git a/Libraries/Image/ImageEditor.js b/Libraries/Image/ImageEditor.js index 53785b680c15c1..caeeccae7c34c0 100644 --- a/Libraries/Image/ImageEditor.js +++ b/Libraries/Image/ImageEditor.js @@ -9,7 +9,8 @@ */ 'use strict'; -const RCTImageEditingManager = require('NativeModules').ImageEditingManager; +const RCTImageEditingManager = require('../BatchedBridge/NativeModules') + .ImageEditingManager; type ImageCropData = { /** diff --git a/Libraries/Image/ImageProps.js b/Libraries/Image/ImageProps.js index f9a9e5786f2b5a..fe4e06673cb55f 100644 --- a/Libraries/Image/ImageProps.js +++ b/Libraries/Image/ImageProps.js @@ -10,12 +10,12 @@ 'use strict'; -import type {SyntheticEvent, LayoutEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type {ImageSource} from 'ImageSource'; -import type {ViewStyleProp, ImageStyleProp} from 'StyleSheet'; -import type {DimensionValue} from 'StyleSheetTypes'; -import type {ViewProps} from 'ViewPropTypes'; +import type {SyntheticEvent, LayoutEvent} from '../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../StyleSheet/EdgeInsetsPropType'; +import type {ImageSource} from './ImageSource'; +import type {ViewStyleProp, ImageStyleProp} from '../StyleSheet/StyleSheet'; +import type {DimensionValue} from '../StyleSheet/StyleSheetTypes'; +import type {ViewProps} from '../Components/View/ViewPropTypes'; export type ImageLoadEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Image/ImageStore.js b/Libraries/Image/ImageStore.js index 8ba5c3162be83d..e011ffc8022585 100644 --- a/Libraries/Image/ImageStore.js +++ b/Libraries/Image/ImageStore.js @@ -9,11 +9,12 @@ */ 'use strict'; -const RCTImageStoreManager = require('NativeModules').ImageStoreManager; +const RCTImageStoreManager = require('../BatchedBridge/NativeModules') + .ImageStoreManager; -const Platform = require('Platform'); +const Platform = require('../Utilities/Platform'); -const warnOnce = require('warnOnce'); +const warnOnce = require('../Utilities/warnOnce'); function warnUnimplementedMethod(methodName: string): void { warnOnce( diff --git a/Libraries/Image/ImageViewNativeComponent.js b/Libraries/Image/ImageViewNativeComponent.js index 47f8d531f756d8..c0dbee693b7339 100644 --- a/Libraries/Image/ImageViewNativeComponent.js +++ b/Libraries/Image/ImageViewNativeComponent.js @@ -10,7 +10,7 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../ReactNative/requireNativeComponent'); const ImageViewNativeComponent = requireNativeComponent('RCTImageView'); diff --git a/Libraries/Image/RelativeImageStub.js b/Libraries/Image/RelativeImageStub.js index f5592d18167102..6349a393f59064 100644 --- a/Libraries/Image/RelativeImageStub.js +++ b/Libraries/Image/RelativeImageStub.js @@ -13,7 +13,7 @@ // This is a stub for flow to make it understand require('./icon.png') // See metro/src/Bundler/index.js -const AssetRegistry = require('AssetRegistry'); +const AssetRegistry = require('./AssetRegistry'); module.exports = AssetRegistry.registerAsset({ __packager_asset: true, diff --git a/Libraries/Image/TextInlineImageNativeComponent.js b/Libraries/Image/TextInlineImageNativeComponent.js index 6cbe56362576f9..b8cb7a50f8eb59 100644 --- a/Libraries/Image/TextInlineImageNativeComponent.js +++ b/Libraries/Image/TextInlineImageNativeComponent.js @@ -10,7 +10,7 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../ReactNative/requireNativeComponent'); const TextInlineImage = requireNativeComponent('RCTTextInlineImage'); diff --git a/Libraries/Image/__tests__/Image-test.js b/Libraries/Image/__tests__/Image-test.js index bc42e9c5595c71..b0a5aaea7f1727 100644 --- a/Libraries/Image/__tests__/Image-test.js +++ b/Libraries/Image/__tests__/Image-test.js @@ -11,8 +11,8 @@ 'use strict'; -const React = require('React'); -const Image = require('Image'); +const React = require('react'); +const Image = require('../Image'); const render = require('../../../jest/renderer'); describe('', () => { @@ -27,14 +27,14 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('Image'); + jest.dontMock('../Image'); const output = render.shallow(); expect(output).toMatchSnapshot(); }); it('should render as when not mocked', () => { - jest.dontMock('Image'); + jest.dontMock('../Image'); const instance = render.create(); expect(instance).toMatchSnapshot(); diff --git a/Libraries/Image/__tests__/assetRelativePathInSnapshot-test.js b/Libraries/Image/__tests__/assetRelativePathInSnapshot-test.js index 13cb6ac075f81e..618d706123c27d 100644 --- a/Libraries/Image/__tests__/assetRelativePathInSnapshot-test.js +++ b/Libraries/Image/__tests__/assetRelativePathInSnapshot-test.js @@ -12,10 +12,10 @@ jest.disableAutomock(); -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const Image = require('Image'); -const View = require('View'); +const Image = require('../Image'); +const View = require('../../Components/View/View'); it('renders assets based on relative path', () => { expect( diff --git a/Libraries/Image/__tests__/resolveAssetSource-test.js b/Libraries/Image/__tests__/resolveAssetSource-test.js index fb297899f6655a..c5afbdf8705587 100644 --- a/Libraries/Image/__tests__/resolveAssetSource-test.js +++ b/Libraries/Image/__tests__/resolveAssetSource-test.js @@ -10,9 +10,9 @@ 'use strict'; -const AssetRegistry = require('AssetRegistry'); -const Platform = require('Platform'); -const NativeModules = require('NativeModules'); +const AssetRegistry = require('../AssetRegistry'); +const Platform = require('../../Utilities/Platform'); +const NativeModules = require('../../BatchedBridge/NativeModules'); const resolveAssetSource = require('../resolveAssetSource'); function expectResolvesAsset(input, expectedSource) { diff --git a/Libraries/Image/nativeImageSource.js b/Libraries/Image/nativeImageSource.js index ead514fab1af4d..374a857f2e6abf 100644 --- a/Libraries/Image/nativeImageSource.js +++ b/Libraries/Image/nativeImageSource.js @@ -10,7 +10,7 @@ 'use strict'; -const Platform = require('Platform'); +const Platform = require('../Utilities/Platform'); // TODO: Change `nativeImageSource` to return this type. export type NativeImageSource = {| diff --git a/Libraries/Image/resolveAssetSource.js b/Libraries/Image/resolveAssetSource.js index ebd19e3354fe6e..dd9167af53e086 100644 --- a/Libraries/Image/resolveAssetSource.js +++ b/Libraries/Image/resolveAssetSource.js @@ -13,10 +13,10 @@ 'use strict'; -const AssetRegistry = require('AssetRegistry'); -const AssetSourceResolver = require('AssetSourceResolver'); +const AssetRegistry = require('./AssetRegistry'); +const AssetSourceResolver = require('./AssetSourceResolver'); -import type {ResolvedAssetSource} from 'AssetSourceResolver'; +import type {ResolvedAssetSource} from './AssetSourceResolver'; let _customSourceTransformer, _serverURL, _scriptURL; @@ -29,7 +29,7 @@ function getSourceCodeScriptURL(): ?string { let sourceCode = global.nativeExtensions && global.nativeExtensions.SourceCode; if (!sourceCode) { - const NativeModules = require('NativeModules'); + const NativeModules = require('../BatchedBridge/NativeModules'); sourceCode = NativeModules && NativeModules.SourceCode; } _sourceCodeScriptURL = sourceCode.scriptURL; diff --git a/Libraries/Inspector/BorderBox.js b/Libraries/Inspector/BorderBox.js index 93d0dd158e14d1..3ab66f10a0fb20 100644 --- a/Libraries/Inspector/BorderBox.js +++ b/Libraries/Inspector/BorderBox.js @@ -10,8 +10,8 @@ 'use strict'; -const React = require('React'); -const View = require('View'); +const React = require('react'); +const View = require('../Components/View/View'); class BorderBox extends React.Component<$FlowFixMeProps> { render() { diff --git a/Libraries/Inspector/BoxInspector.js b/Libraries/Inspector/BoxInspector.js index 6097402a91c0c2..bd1f3d376f5f83 100644 --- a/Libraries/Inspector/BoxInspector.js +++ b/Libraries/Inspector/BoxInspector.js @@ -10,11 +10,11 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); -const resolveBoxStyle = require('resolveBoxStyle'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const View = require('../Components/View/View'); +const resolveBoxStyle = require('./resolveBoxStyle'); const blank = { top: 0, diff --git a/Libraries/Inspector/ElementBox.js b/Libraries/Inspector/ElementBox.js index 36327fb31ab57b..9f6c0c4bf204ed 100644 --- a/Libraries/Inspector/ElementBox.js +++ b/Libraries/Inspector/ElementBox.js @@ -10,14 +10,14 @@ 'use strict'; -const BorderBox = require('BorderBox'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const Dimensions = require('Dimensions'); - -const flattenStyle = require('flattenStyle'); -const resolveBoxStyle = require('resolveBoxStyle'); +const BorderBox = require('./BorderBox'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const View = require('../Components/View/View'); +const Dimensions = require('../Utilities/Dimensions'); + +const flattenStyle = require('../StyleSheet/flattenStyle'); +const resolveBoxStyle = require('./resolveBoxStyle'); class ElementBox extends React.Component<$FlowFixMeProps> { render() { diff --git a/Libraries/Inspector/ElementProperties.js b/Libraries/Inspector/ElementProperties.js index 9b6c222ed5babd..3cc8f4bfa5f1ba 100644 --- a/Libraries/Inspector/ElementProperties.js +++ b/Libraries/Inspector/ElementProperties.js @@ -10,20 +10,20 @@ 'use strict'; -const BoxInspector = require('BoxInspector'); -const React = require('React'); -const StyleInspector = require('StyleInspector'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TouchableHighlight = require('TouchableHighlight'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); +const BoxInspector = require('./BoxInspector'); +const React = require('react'); +const StyleInspector = require('./StyleInspector'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const TouchableHighlight = require('../Components/Touchable/TouchableHighlight'); +const TouchableWithoutFeedback = require('../Components/Touchable/TouchableWithoutFeedback'); +const View = require('../Components/View/View'); -const flattenStyle = require('flattenStyle'); -const mapWithSeparator = require('mapWithSeparator'); -const openFileInEditor = require('openFileInEditor'); +const flattenStyle = require('../StyleSheet/flattenStyle'); +const mapWithSeparator = require('../Utilities/mapWithSeparator'); +const openFileInEditor = require('../Core/Devtools/openFileInEditor'); -import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; type Props = $ReadOnly<{| hierarchy: Array<{|name: string|}>, diff --git a/Libraries/Inspector/Inspector.js b/Libraries/Inspector/Inspector.js index 56d23c16b1a3d8..a9ddf5919572be 100644 --- a/Libraries/Inspector/Inspector.js +++ b/Libraries/Inspector/Inspector.js @@ -10,16 +10,16 @@ 'use strict'; -const Dimensions = require('Dimensions'); -const InspectorOverlay = require('InspectorOverlay'); -const InspectorPanel = require('InspectorPanel'); -const Platform = require('Platform'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StyleSheet = require('StyleSheet'); -const Touchable = require('Touchable'); -const UIManager = require('UIManager'); -const View = require('View'); +const Dimensions = require('../Utilities/Dimensions'); +const InspectorOverlay = require('./InspectorOverlay'); +const InspectorPanel = require('./InspectorPanel'); +const Platform = require('../Utilities/Platform'); +const React = require('react'); +const ReactNative = require('../Renderer/shims/ReactNative'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Touchable = require('../Components/Touchable/Touchable'); +const UIManager = require('../ReactNative/UIManager'); +const View = require('../Components/View/View'); const invariant = require('invariant'); @@ -31,7 +31,7 @@ const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; const renderers = findRenderers(); // required for devtools to be able to edit react native styles -hook.resolveRNStyle = require('flattenStyle'); +hook.resolveRNStyle = require('../StyleSheet/flattenStyle'); function findRenderers(): $ReadOnlyArray { const allRenderers = Object.keys(hook._renderers).map( diff --git a/Libraries/Inspector/InspectorOverlay.js b/Libraries/Inspector/InspectorOverlay.js index 88bf38c3b27431..540afb73c1c998 100644 --- a/Libraries/Inspector/InspectorOverlay.js +++ b/Libraries/Inspector/InspectorOverlay.js @@ -10,15 +10,15 @@ 'use strict'; -const Dimensions = require('Dimensions'); -const ElementBox = require('ElementBox'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const UIManager = require('UIManager'); -const View = require('View'); +const Dimensions = require('../Utilities/Dimensions'); +const ElementBox = require('./ElementBox'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const UIManager = require('../ReactNative/UIManager'); +const View = require('../Components/View/View'); -import type {PressEvent} from 'CoreEventTypes'; -import type {ViewStyleProp} from 'StyleSheet'; +import type {PressEvent} from '../Types/CoreEventTypes'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; type Inspected = $ReadOnly<{| frame?: Object, diff --git a/Libraries/Inspector/InspectorPanel.js b/Libraries/Inspector/InspectorPanel.js index 42c191d7ed530c..8aac5987843494 100644 --- a/Libraries/Inspector/InspectorPanel.js +++ b/Libraries/Inspector/InspectorPanel.js @@ -10,17 +10,17 @@ 'use strict'; -const ElementProperties = require('ElementProperties'); -const NetworkOverlay = require('NetworkOverlay'); -const PerformanceOverlay = require('PerformanceOverlay'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TouchableHighlight = require('TouchableHighlight'); -const View = require('View'); +const ElementProperties = require('./ElementProperties'); +const NetworkOverlay = require('./NetworkOverlay'); +const PerformanceOverlay = require('./PerformanceOverlay'); +const React = require('react'); +const ScrollView = require('../Components/ScrollView/ScrollView'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const TouchableHighlight = require('../Components/Touchable/TouchableHighlight'); +const View = require('../Components/View/View'); -import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; type Props = $ReadOnly<{| devtoolsIsOpen: boolean, diff --git a/Libraries/Inspector/NetworkOverlay.js b/Libraries/Inspector/NetworkOverlay.js index 86fe8da1ac829a..4e93151c13a080 100644 --- a/Libraries/Inspector/NetworkOverlay.js +++ b/Libraries/Inspector/NetworkOverlay.js @@ -10,15 +10,15 @@ 'use strict'; -const FlatList = require('FlatList'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const TouchableHighlight = require('TouchableHighlight'); -const View = require('View'); -const WebSocketInterceptor = require('WebSocketInterceptor'); -const XHRInterceptor = require('XHRInterceptor'); +const FlatList = require('../Lists/FlatList'); +const React = require('react'); +const ScrollView = require('../Components/ScrollView/ScrollView'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const TouchableHighlight = require('../Components/Touchable/TouchableHighlight'); +const View = require('../Components/View/View'); +const WebSocketInterceptor = require('../WebSocket/WebSocketInterceptor'); +const XHRInterceptor = require('../Network/XHRInterceptor'); const LISTVIEW_CELL_HEIGHT = 15; diff --git a/Libraries/Inspector/PerformanceOverlay.js b/Libraries/Inspector/PerformanceOverlay.js index c87b46820dbb0d..9d1f63c8c6a435 100644 --- a/Libraries/Inspector/PerformanceOverlay.js +++ b/Libraries/Inspector/PerformanceOverlay.js @@ -10,11 +10,11 @@ 'use strict'; -const PerformanceLogger = require('GlobalPerformanceLogger'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const PerformanceLogger = require('../Utilities/GlobalPerformanceLogger'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const View = require('../Components/View/View'); class PerformanceOverlay extends React.Component<{}> { render() { diff --git a/Libraries/Inspector/StyleInspector.js b/Libraries/Inspector/StyleInspector.js index bb9f9abf6e2e10..332fe22bfed35f 100644 --- a/Libraries/Inspector/StyleInspector.js +++ b/Libraries/Inspector/StyleInspector.js @@ -10,10 +10,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const View = require('../Components/View/View'); class StyleInspector extends React.Component<$FlowFixMeProps> { render() { diff --git a/Libraries/Inspector/resolveBoxStyle.js b/Libraries/Inspector/resolveBoxStyle.js index 26aec4310ce0fc..15dfaf3061d810 100644 --- a/Libraries/Inspector/resolveBoxStyle.js +++ b/Libraries/Inspector/resolveBoxStyle.js @@ -10,7 +10,7 @@ 'use strict'; -const I18nManager = require('I18nManager'); +const I18nManager = require('../ReactNative/I18nManager'); /** * Resolve a style property into its component parts. diff --git a/Libraries/Interaction/Batchinator.js b/Libraries/Interaction/Batchinator.js index eda4c00450e44f..f7f1b2afa7ad32 100644 --- a/Libraries/Interaction/Batchinator.js +++ b/Libraries/Interaction/Batchinator.js @@ -10,7 +10,7 @@ 'use strict'; -const InteractionManager = require('InteractionManager'); +const InteractionManager = require('./InteractionManager'); /** * A simple class for batching up invocations of a low-pri callback. A timeout is set to run the diff --git a/Libraries/Interaction/BridgeSpyStallHandler.js b/Libraries/Interaction/BridgeSpyStallHandler.js index f90bbd225dc7c0..e90777d4152812 100644 --- a/Libraries/Interaction/BridgeSpyStallHandler.js +++ b/Libraries/Interaction/BridgeSpyStallHandler.js @@ -10,10 +10,10 @@ 'use strict'; -const JSEventLoopWatchdog = require('JSEventLoopWatchdog'); -const MessageQueue = require('MessageQueue'); +const JSEventLoopWatchdog = require('./JSEventLoopWatchdog'); +const MessageQueue = require('../BatchedBridge/MessageQueue'); -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const BridgeSpyStallHandler = { register: function() { diff --git a/Libraries/Interaction/FrameRateLogger.js b/Libraries/Interaction/FrameRateLogger.js index 6b798392495679..8f8a2837f91aca 100644 --- a/Libraries/Interaction/FrameRateLogger.js +++ b/Libraries/Interaction/FrameRateLogger.js @@ -10,7 +10,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); const invariant = require('invariant'); diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 22225198fccd3c..69a51b8145ef6a 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -10,16 +10,16 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const EventEmitter = require('EventEmitter'); -const TaskQueue = require('TaskQueue'); +const BatchedBridge = require('../BatchedBridge/BatchedBridge'); +const EventEmitter = require('../vendor/emitter/EventEmitter'); +const TaskQueue = require('./TaskQueue'); -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const invariant = require('invariant'); const keyMirror = require('fbjs/lib/keyMirror'); type Handle = number; -import type {Task} from 'TaskQueue'; +import type {Task} from './TaskQueue'; const _emitter = new EventEmitter(); diff --git a/Libraries/Interaction/InteractionMixin.js b/Libraries/Interaction/InteractionMixin.js index ff99337105ae5e..38539b60afe72f 100644 --- a/Libraries/Interaction/InteractionMixin.js +++ b/Libraries/Interaction/InteractionMixin.js @@ -10,7 +10,7 @@ 'use strict'; -const InteractionManager = require('InteractionManager'); +const InteractionManager = require('./InteractionManager'); /** * This mixin provides safe versions of InteractionManager start/end methods diff --git a/Libraries/Interaction/InteractionStallDebugger.js b/Libraries/Interaction/InteractionStallDebugger.js index 8f78852068f776..7facffb1782fe7 100644 --- a/Libraries/Interaction/InteractionStallDebugger.js +++ b/Libraries/Interaction/InteractionStallDebugger.js @@ -10,8 +10,8 @@ 'use strict'; -const BridgeSpyStallHandler = require('BridgeSpyStallHandler'); -const JSEventLoopWatchdog = require('JSEventLoopWatchdog'); +const BridgeSpyStallHandler = require('./BridgeSpyStallHandler'); +const JSEventLoopWatchdog = require('./JSEventLoopWatchdog'); const InteractionStallDebugger = { install(options: {thresholdMS: number}): void { diff --git a/Libraries/Interaction/JSEventLoopWatchdog.js b/Libraries/Interaction/JSEventLoopWatchdog.js index 0b9949f69a35e4..f8f4e450455a23 100644 --- a/Libraries/Interaction/JSEventLoopWatchdog.js +++ b/Libraries/Interaction/JSEventLoopWatchdog.js @@ -10,7 +10,7 @@ 'use strict'; -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const performanceNow = require('fbjs/lib/performanceNow'); type Handler = { diff --git a/Libraries/Interaction/PanResponder.js b/Libraries/Interaction/PanResponder.js index aad7eced088cbf..2b20faebe32544 100644 --- a/Libraries/Interaction/PanResponder.js +++ b/Libraries/Interaction/PanResponder.js @@ -13,7 +13,7 @@ const InteractionManager = require('./InteractionManager'); const TouchHistoryMath = require('./TouchHistoryMath'); -import type {PressEvent} from 'CoreEventTypes'; +import type {PressEvent} from '../Types/CoreEventTypes'; const currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; diff --git a/Libraries/Interaction/TaskQueue.js b/Libraries/Interaction/TaskQueue.js index db9ce173058853..17332b5821ed27 100644 --- a/Libraries/Interaction/TaskQueue.js +++ b/Libraries/Interaction/TaskQueue.js @@ -10,7 +10,7 @@ 'use strict'; -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const invariant = require('invariant'); type SimpleTask = { diff --git a/Libraries/Interaction/__tests__/Batchinator-test.js b/Libraries/Interaction/__tests__/Batchinator-test.js index 900e6b3eafad68..0c6e8448ff0722 100644 --- a/Libraries/Interaction/__tests__/Batchinator-test.js +++ b/Libraries/Interaction/__tests__/Batchinator-test.js @@ -10,14 +10,16 @@ 'use strict'; -jest.mock('ErrorUtils').mock('BatchedBridge'); +jest + .mock('../../vendor/core/ErrorUtils') + .mock('../../BatchedBridge/BatchedBridge'); function expectToBeCalledOnce(fn) { expect(fn.mock.calls.length).toBe(1); } describe('Batchinator', () => { - const Batchinator = require('Batchinator'); + const Batchinator = require('../Batchinator'); it('executes vanilla tasks', () => { const callback = jest.fn(); diff --git a/Libraries/Interaction/__tests__/InteractionManager-test.js b/Libraries/Interaction/__tests__/InteractionManager-test.js index 4ab401eaf40645..83e7ca36164fa1 100644 --- a/Libraries/Interaction/__tests__/InteractionManager-test.js +++ b/Libraries/Interaction/__tests__/InteractionManager-test.js @@ -10,7 +10,9 @@ 'use strict'; -jest.mock('ErrorUtils').mock('BatchedBridge'); +jest + .mock('../../vendor/core/ErrorUtils') + .mock('../../BatchedBridge/BatchedBridge'); const isWindows = process.platform === 'win32'; function expectToBeCalledOnce(fn) { @@ -28,7 +30,7 @@ describe('InteractionManager', () => { beforeEach(() => { jest.resetModules(); - InteractionManager = require('InteractionManager'); + InteractionManager = require('../InteractionManager'); interactionStart = jest.fn(); interactionComplete = jest.fn(); @@ -167,8 +169,8 @@ describe('promise tasks', () => { beforeEach(() => { jest.resetModules(); jest.useFakeTimers(); - InteractionManager = require('InteractionManager'); - BatchedBridge = require('BatchedBridge'); + InteractionManager = require('../InteractionManager'); + BatchedBridge = require('../../BatchedBridge/BatchedBridge'); sequenceId = 0; }); diff --git a/Libraries/Interaction/__tests__/InteractionMixin-test.js b/Libraries/Interaction/__tests__/InteractionMixin-test.js index 4acfc0fbbf8c16..d7116a8fb25312 100644 --- a/Libraries/Interaction/__tests__/InteractionMixin-test.js +++ b/Libraries/Interaction/__tests__/InteractionMixin-test.js @@ -10,7 +10,7 @@ 'use strict'; -jest.mock('InteractionManager'); +jest.mock('../InteractionManager'); describe('InteractionMixin', () => { let InteractionManager; @@ -19,8 +19,8 @@ describe('InteractionMixin', () => { beforeEach(() => { jest.resetModules(); - InteractionManager = require('InteractionManager'); - InteractionMixin = require('InteractionMixin'); + InteractionManager = require('../InteractionManager'); + InteractionMixin = require('../InteractionMixin'); component = Object.create(InteractionMixin); }); diff --git a/Libraries/Interaction/__tests__/TaskQueue-test.js b/Libraries/Interaction/__tests__/TaskQueue-test.js index 6f10eeab928c69..5055fa2dde853b 100644 --- a/Libraries/Interaction/__tests__/TaskQueue-test.js +++ b/Libraries/Interaction/__tests__/TaskQueue-test.js @@ -36,7 +36,7 @@ describe('TaskQueue', () => { beforeEach(() => { jest.resetModules(); onMoreTasks = jest.fn(); - const TaskQueue = require('TaskQueue'); + const TaskQueue = require('../TaskQueue'); taskQueue = new TaskQueue({onMoreTasks}); sequenceId = 0; }); diff --git a/Libraries/JSInspector/JSInspector.js b/Libraries/JSInspector/JSInspector.js index 6d7a2f70037e7f..5cb7b612f00732 100644 --- a/Libraries/JSInspector/JSInspector.js +++ b/Libraries/JSInspector/JSInspector.js @@ -10,7 +10,7 @@ 'use strict'; -import type {EventSender} from 'InspectorAgent'; +import type {EventSender} from './InspectorAgent'; interface Agent { constructor(eventSender: EventSender): void; diff --git a/Libraries/JSInspector/NetworkAgent.js b/Libraries/JSInspector/NetworkAgent.js index b96b819a00e0ee..7f9c63d63f7a4a 100644 --- a/Libraries/JSInspector/NetworkAgent.js +++ b/Libraries/JSInspector/NetworkAgent.js @@ -10,11 +10,11 @@ 'use strict'; -const InspectorAgent = require('InspectorAgent'); -const JSInspector = require('JSInspector'); -const XMLHttpRequest = require('XMLHttpRequest'); +const InspectorAgent = require('./InspectorAgent'); +const JSInspector = require('./JSInspector'); +const XMLHttpRequest = require('../Network/XMLHttpRequest'); -import type EventSender from 'InspectorAgent'; +import type EventSender from './InspectorAgent'; type RequestId = string; diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index ef92d99cec6319..20018cf566b20c 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -10,8 +10,8 @@ 'use strict'; -import Platform from 'Platform'; -const UIManager = require('UIManager'); +import Platform from '../Utilities/Platform'; +const UIManager = require('../ReactNative/UIManager'); type Type = | 'spring' diff --git a/Libraries/Linking/Linking.js b/Libraries/Linking/Linking.js index 6dfd3c7cccce30..53187743c2943b 100644 --- a/Libraries/Linking/Linking.js +++ b/Libraries/Linking/Linking.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const Platform = require('../Utilities/Platform'); const invariant = require('invariant'); diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index 2c7280694ddcfa..5d17580c16365c 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -9,22 +9,22 @@ */ 'use strict'; -const Platform = require('Platform'); -const deepDiffer = require('deepDiffer'); -const React = require('React'); -const View = require('View'); -const VirtualizedList = require('VirtualizedList'); -const StyleSheet = require('StyleSheet'); +const Platform = require('../Utilities/Platform'); +const deepDiffer = require('../Utilities/differ/deepDiffer'); +const React = require('react'); +const View = require('../Components/View/View'); +const VirtualizedList = require('./VirtualizedList'); +const StyleSheet = require('../StyleSheet/StyleSheet'); const invariant = require('invariant'); -import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; import type { ViewabilityConfig, ViewToken, ViewabilityConfigCallbackPair, -} from 'ViewabilityHelper'; -import type {Props as VirtualizedListProps} from 'VirtualizedList'; +} from './ViewabilityHelper'; +import type {Props as VirtualizedListProps} from './VirtualizedList'; export type SeparatorsObj = { highlight: () => void, diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index d43186f4364e02..076fb0e29f66b9 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -9,16 +9,16 @@ */ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const VirtualizedSectionList = require('VirtualizedSectionList'); +const Platform = require('../Utilities/Platform'); +const React = require('react'); +const ScrollView = require('../Components/ScrollView/ScrollView'); +const VirtualizedSectionList = require('./VirtualizedSectionList'); -import type {ViewToken} from 'ViewabilityHelper'; +import type {ViewToken} from './ViewabilityHelper'; import type { SectionBase as _SectionBase, Props as VirtualizedSectionListProps, -} from 'VirtualizedSectionList'; +} from './VirtualizedSectionList'; type Item = any; diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 78941f2ced89c2..65944654a872ad 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -9,31 +9,31 @@ */ 'use strict'; -const Batchinator = require('Batchinator'); -const FillRateHelper = require('FillRateHelper'); +const Batchinator = require('../Interaction/Batchinator'); +const FillRateHelper = require('./FillRateHelper'); const PropTypes = require('prop-types'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const RefreshControl = require('RefreshControl'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const UIManager = require('UIManager'); -const View = require('View'); -const ViewabilityHelper = require('ViewabilityHelper'); - -const flattenStyle = require('flattenStyle'); -const infoLog = require('infoLog'); +const React = require('react'); +const ReactNative = require('../Renderer/shims/ReactNative'); +const RefreshControl = require('../Components/RefreshControl/RefreshControl'); +const ScrollView = require('../Components/ScrollView/ScrollView'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const UIManager = require('../ReactNative/UIManager'); +const View = require('../Components/View/View'); +const ViewabilityHelper = require('./ViewabilityHelper'); + +const flattenStyle = require('../StyleSheet/flattenStyle'); +const infoLog = require('../Utilities/infoLog'); const invariant = require('invariant'); const warning = require('fbjs/lib/warning'); -const {computeWindowedRenderLimits} = require('VirtualizeUtils'); +const {computeWindowedRenderLimits} = require('./VirtualizeUtils'); -import type {ViewStyleProp} from 'StyleSheet'; +import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; import type { ViewabilityConfig, ViewToken, ViewabilityConfigCallbackPair, -} from 'ViewabilityHelper'; +} from './ViewabilityHelper'; type Item = any; diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index ceb039ba2e9ec5..042eca2c5d7304 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -9,15 +9,15 @@ */ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const View = require('View'); -const VirtualizedList = require('VirtualizedList'); +const Platform = require('../Utilities/Platform'); +const React = require('react'); +const View = require('../Components/View/View'); +const VirtualizedList = require('./VirtualizedList'); const invariant = require('invariant'); -import type {ViewToken} from 'ViewabilityHelper'; -import type {Props as VirtualizedListProps} from 'VirtualizedList'; +import type {ViewToken} from './ViewabilityHelper'; +import type {Props as VirtualizedListProps} from './VirtualizedList'; type Item = any; diff --git a/Libraries/Lists/__flowtests__/FlatList-flowtest.js b/Libraries/Lists/__flowtests__/FlatList-flowtest.js index 766aad581bf1a3..71b5f10004cbe2 100644 --- a/Libraries/Lists/__flowtests__/FlatList-flowtest.js +++ b/Libraries/Lists/__flowtests__/FlatList-flowtest.js @@ -10,7 +10,7 @@ 'use strict'; -const FlatList = require('FlatList'); +const FlatList = require('../FlatList'); const React = require('react'); function renderMyListItem(info: {item: {title: string}, index: number}) { diff --git a/Libraries/Lists/__flowtests__/SectionList-flowtest.js b/Libraries/Lists/__flowtests__/SectionList-flowtest.js index 07b2adc9eea5f5..9f70f43551fed1 100644 --- a/Libraries/Lists/__flowtests__/SectionList-flowtest.js +++ b/Libraries/Lists/__flowtests__/SectionList-flowtest.js @@ -11,7 +11,7 @@ 'use strict'; const React = require('react'); -const SectionList = require('SectionList'); +const SectionList = require('../SectionList'); function renderMyListItem(info: {item: {title: string}, index: number}) { return ; diff --git a/Libraries/Lists/__tests__/FillRateHelper-test.js b/Libraries/Lists/__tests__/FillRateHelper-test.js index 20845c862ccbe3..38197fabe174eb 100644 --- a/Libraries/Lists/__tests__/FillRateHelper-test.js +++ b/Libraries/Lists/__tests__/FillRateHelper-test.js @@ -10,7 +10,7 @@ */ 'use strict'; -const FillRateHelper = require('FillRateHelper'); +const FillRateHelper = require('../FillRateHelper'); let rowFramesGlobal; const dataGlobal = [ diff --git a/Libraries/Lists/__tests__/FlatList-test.js b/Libraries/Lists/__tests__/FlatList-test.js index e0ae3805c5a997..e1c605aae11039 100644 --- a/Libraries/Lists/__tests__/FlatList-test.js +++ b/Libraries/Lists/__tests__/FlatList-test.js @@ -10,10 +10,10 @@ */ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const FlatList = require('FlatList'); +const FlatList = require('../FlatList'); describe('FlatList', () => { it('renders simple list', () => { diff --git a/Libraries/Lists/__tests__/SectionList-test.js b/Libraries/Lists/__tests__/SectionList-test.js index c626d3ce9c3967..96f4919ca545c5 100644 --- a/Libraries/Lists/__tests__/SectionList-test.js +++ b/Libraries/Lists/__tests__/SectionList-test.js @@ -10,10 +10,10 @@ */ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const SectionList = require('SectionList'); +const SectionList = require('../SectionList'); describe('SectionList', () => { it('renders empty list', () => { diff --git a/Libraries/Lists/__tests__/ViewabilityHelper-test.js b/Libraries/Lists/__tests__/ViewabilityHelper-test.js index 389e2a941c412b..d9fdfc9a5ded69 100644 --- a/Libraries/Lists/__tests__/ViewabilityHelper-test.js +++ b/Libraries/Lists/__tests__/ViewabilityHelper-test.js @@ -10,7 +10,7 @@ */ 'use strict'; -const ViewabilityHelper = require('ViewabilityHelper'); +const ViewabilityHelper = require('../ViewabilityHelper'); let rowFrames; let data; diff --git a/Libraries/Lists/__tests__/VirtualizeUtils-test.js b/Libraries/Lists/__tests__/VirtualizeUtils-test.js index 7e75993872faba..fe67ef79fffcd3 100644 --- a/Libraries/Lists/__tests__/VirtualizeUtils-test.js +++ b/Libraries/Lists/__tests__/VirtualizeUtils-test.js @@ -10,7 +10,10 @@ */ 'use strict'; -const {elementsThatOverlapOffsets, newRangeCount} = require('VirtualizeUtils'); +const { + elementsThatOverlapOffsets, + newRangeCount, +} = require('../VirtualizeUtils'); describe('newRangeCount', function() { it('handles subset', function() { diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js index a4406fe80ee678..d421d1b9a78591 100644 --- a/Libraries/Lists/__tests__/VirtualizedList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedList-test.js @@ -10,10 +10,10 @@ */ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const VirtualizedList = require('VirtualizedList'); +const VirtualizedList = require('../VirtualizedList'); describe('VirtualizedList', () => { it('renders simple list', () => { diff --git a/Libraries/Lists/__tests__/VirtualizedSectionList-test.js b/Libraries/Lists/__tests__/VirtualizedSectionList-test.js index 4e287b037e2020..d52e9b06bff835 100644 --- a/Libraries/Lists/__tests__/VirtualizedSectionList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedSectionList-test.js @@ -10,10 +10,10 @@ */ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const VirtualizedSectionList = require('VirtualizedSectionList'); +const VirtualizedSectionList = require('../VirtualizedSectionList'); describe('VirtualizedSectionList', () => { it('renders simple list', () => { diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 592383a91eef1c..e364ec0af7f74c 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -10,26 +10,26 @@ 'use strict'; -const AppContainer = require('AppContainer'); -const I18nManager = require('I18nManager'); -const NativeEventEmitter = require('NativeEventEmitter'); -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); -const React = require('React'); +const AppContainer = require('../ReactNative/AppContainer'); +const I18nManager = require('../ReactNative/I18nManager'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const Platform = require('../Utilities/Platform'); +const React = require('react'); const PropTypes = require('prop-types'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const View = require('../Components/View/View'); -const RCTModalHostView = require('RCTModalHostViewNativeComponent'); +const RCTModalHostView = require('./RCTModalHostViewNativeComponent'); const ModalEventEmitter = Platform.OS === 'ios' && NativeModules.ModalManager ? new NativeEventEmitter(NativeModules.ModalManager) : null; -import type EmitterSubscription from 'EmitterSubscription'; -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; +import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; +import type {ViewProps} from '../Components/View/ViewPropTypes'; +import type {SyntheticEvent} from '../Types/CoreEventTypes'; /** * The Modal component is a simple way to present content above an enclosing view. diff --git a/Libraries/Modal/RCTModalHostViewNativeComponent.js b/Libraries/Modal/RCTModalHostViewNativeComponent.js index 45c8235bea772f..a19c76b92ab8d7 100644 --- a/Libraries/Modal/RCTModalHostViewNativeComponent.js +++ b/Libraries/Modal/RCTModalHostViewNativeComponent.js @@ -10,11 +10,11 @@ 'use strict'; -const requireNativeComponent = require('requireNativeComponent'); +const requireNativeComponent = require('../ReactNative/requireNativeComponent'); -import type {ViewProps} from 'ViewPropTypes'; -import type {SyntheticEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; +import type {ViewProps} from '../Components/View/ViewPropTypes'; +import type {SyntheticEvent} from '../Types/CoreEventTypes'; +import type {NativeComponent} from '../Renderer/shims/ReactNative'; type OrientationChangeEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Modal/__tests__/Modal-test.js b/Libraries/Modal/__tests__/Modal-test.js index 9d9b9b89a5bec2..6ad788117cabf5 100644 --- a/Libraries/Modal/__tests__/Modal-test.js +++ b/Libraries/Modal/__tests__/Modal-test.js @@ -11,8 +11,8 @@ 'use strict'; -const React = require('React'); -const View = require('View'); +const React = require('react'); +const View = require('../../Components/View/View'); const Modal = require('../Modal'); const render = require('../../../jest/renderer'); @@ -37,7 +37,7 @@ describe('', () => { }); it('should shallow render as when not mocked', () => { - jest.dontMock('Modal'); + jest.dontMock('../Modal'); const output = render.shallow( @@ -48,7 +48,7 @@ describe('', () => { }); it('should render as when not mocked', () => { - jest.dontMock('Modal'); + jest.dontMock('../Modal'); const instance = render.create( diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index cffb462eee83fa..80c2b912147b4a 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const Platform = require('../Utilities/Platform'); const RCTNetInfo = NativeModules.NetInfo; const NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo); diff --git a/Libraries/Network/RCTNetworking.android.js b/Libraries/Network/RCTNetworking.android.js index fc963a692c5748..89435e2714cf9a 100644 --- a/Libraries/Network/RCTNetworking.android.js +++ b/Libraries/Network/RCTNetworking.android.js @@ -12,11 +12,12 @@ // Do not require the native RCTNetworking module directly! Use this wrapper module instead. // It will add the necessary requestId, so that you don't have to generate it yourself. -const NativeEventEmitter = require('NativeEventEmitter'); -const RCTNetworkingNative = require('NativeModules').Networking; -const convertRequestBody = require('convertRequestBody'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const RCTNetworkingNative = require('../BatchedBridge/NativeModules') + .Networking; +const convertRequestBody = require('./convertRequestBody'); -import type {RequestBody} from 'convertRequestBody'; +import type {RequestBody} from './convertRequestBody'; type Header = [string, string]; diff --git a/Libraries/Network/RCTNetworking.ios.js b/Libraries/Network/RCTNetworking.ios.js index 2e3cac37df3648..6905142cbff471 100644 --- a/Libraries/Network/RCTNetworking.ios.js +++ b/Libraries/Network/RCTNetworking.ios.js @@ -10,11 +10,12 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); -const RCTNetworkingNative = require('NativeModules').Networking; -const convertRequestBody = require('convertRequestBody'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const RCTNetworkingNative = require('../BatchedBridge/NativeModules') + .Networking; +const convertRequestBody = require('./convertRequestBody'); -import type {RequestBody} from 'convertRequestBody'; +import type {RequestBody} from './convertRequestBody'; import type {NativeResponseType} from './XMLHttpRequest'; diff --git a/Libraries/Network/XHRInterceptor.js b/Libraries/Network/XHRInterceptor.js index f2ad119397d4b8..65c32e5606d700 100644 --- a/Libraries/Network/XHRInterceptor.js +++ b/Libraries/Network/XHRInterceptor.js @@ -9,7 +9,7 @@ 'use strict'; -const XMLHttpRequest = require('XMLHttpRequest'); +const XMLHttpRequest = require('./XMLHttpRequest'); const originalXHROpen = XMLHttpRequest.prototype.open; const originalXHRSend = XMLHttpRequest.prototype.send; const originalXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader; diff --git a/Libraries/Network/XMLHttpRequest.js b/Libraries/Network/XMLHttpRequest.js index 3876264857ce55..f0f507cd873895 100644 --- a/Libraries/Network/XMLHttpRequest.js +++ b/Libraries/Network/XMLHttpRequest.js @@ -11,12 +11,12 @@ 'use strict'; const EventTarget = require('event-target-shim'); -const RCTNetworking = require('RCTNetworking'); +const RCTNetworking = require('./RCTNetworking'); const base64 = require('base64-js'); const invariant = require('invariant'); const warning = require('fbjs/lib/warning'); -const BlobManager = require('BlobManager'); +const BlobManager = require('../Blob/BlobManager'); export type NativeResponseType = 'base64' | 'blob' | 'text'; export type ResponseType = diff --git a/Libraries/Network/__tests__/FormData-test.js b/Libraries/Network/__tests__/FormData-test.js index 1727928c84a570..5ea0263aac35b8 100644 --- a/Libraries/Network/__tests__/FormData-test.js +++ b/Libraries/Network/__tests__/FormData-test.js @@ -10,7 +10,7 @@ 'use strict'; -const FormData = require('FormData'); +const FormData = require('../FormData'); describe('FormData', function() { var formData; diff --git a/Libraries/Network/__tests__/XMLHttpRequest-test.js b/Libraries/Network/__tests__/XMLHttpRequest-test.js index e3b8f1c068194f..e69e91b55d6b1c 100644 --- a/Libraries/Network/__tests__/XMLHttpRequest-test.js +++ b/Libraries/Network/__tests__/XMLHttpRequest-test.js @@ -9,8 +9,8 @@ */ 'use strict'; -jest.unmock('Platform'); -const Platform = require('Platform'); +jest.unmock('../../Utilities/Platform'); +const Platform = require('../../Utilities/Platform'); let requestId = 1; function setRequestId(id) { @@ -20,21 +20,23 @@ function setRequestId(id) { requestId = id; } -jest.dontMock('event-target-shim').setMock('NativeModules', { - Networking: { - addListener: function() {}, - removeListeners: function() {}, - sendRequest(options, callback) { - if (typeof callback === 'function') { - // android does not pass a callback - callback(requestId); - } +jest + .dontMock('event-target-shim') + .setMock('../../BatchedBridge/NativeModules', { + Networking: { + addListener: function() {}, + removeListeners: function() {}, + sendRequest(options, callback) { + if (typeof callback === 'function') { + // android does not pass a callback + callback(requestId); + } + }, + abortRequest: function() {}, }, - abortRequest: function() {}, - }, -}); + }); -const XMLHttpRequest = require('XMLHttpRequest'); +const XMLHttpRequest = require('../XMLHttpRequest'); describe('XMLHttpRequest', function() { let xhr; diff --git a/Libraries/Network/convertRequestBody.js b/Libraries/Network/convertRequestBody.js index ef6129bb288074..ea16291611a6fa 100644 --- a/Libraries/Network/convertRequestBody.js +++ b/Libraries/Network/convertRequestBody.js @@ -9,10 +9,10 @@ */ 'use strict'; -const binaryToBase64 = require('binaryToBase64'); +const binaryToBase64 = require('../Utilities/binaryToBase64'); -const Blob = require('Blob'); -const FormData = require('FormData'); +const Blob = require('../Blob/Blob'); +const FormData = require('./FormData'); export type RequestBody = | string diff --git a/Libraries/Network/fetch.js b/Libraries/Network/fetch.js index 66687e70de2035..ec9c28f1860a93 100644 --- a/Libraries/Network/fetch.js +++ b/Libraries/Network/fetch.js @@ -11,7 +11,7 @@ 'use strict'; -const whatwg = require('whatwg-fetch'); +const whatwg = require('../vendor/core/whatwg-fetch'); if (whatwg && whatwg.fetch) { module.exports = whatwg; diff --git a/Libraries/Performance/PureComponentDebug.js b/Libraries/Performance/PureComponentDebug.js index 1de303bc425300..9932b5fd4e846a 100644 --- a/Libraries/Performance/PureComponentDebug.js +++ b/Libraries/Performance/PureComponentDebug.js @@ -10,7 +10,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); opaque type DoNotCommitUsageOfPureComponentDebug = {}; diff --git a/Libraries/Performance/SamplingProfiler.js b/Libraries/Performance/SamplingProfiler.js index 0c09e1c6caf6bb..cce9cb9596b467 100644 --- a/Libraries/Performance/SamplingProfiler.js +++ b/Libraries/Performance/SamplingProfiler.js @@ -28,7 +28,7 @@ const SamplingProfiler = { error = e.toString(); } - const {JSCSamplingProfiler} = require('NativeModules'); + const {JSCSamplingProfiler} = require('../BatchedBridge/NativeModules'); JSCSamplingProfiler.operationComplete(token, result, error); }, }; diff --git a/Libraries/PermissionsAndroid/PermissionsAndroid.js b/Libraries/PermissionsAndroid/PermissionsAndroid.js index 853fb854817f12..ae35e07cac6073 100644 --- a/Libraries/PermissionsAndroid/PermissionsAndroid.js +++ b/Libraries/PermissionsAndroid/PermissionsAndroid.js @@ -10,7 +10,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); export type Rationale = { title: string, diff --git a/Libraries/PushNotificationIOS/PushNotificationIOS.js b/Libraries/PushNotificationIOS/PushNotificationIOS.js index 88a4409cc07458..d9295fed665244 100644 --- a/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -10,8 +10,8 @@ 'use strict'; -const NativeEventEmitter = require('NativeEventEmitter'); -const RCTPushNotificationManager = require('NativeModules') +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const RCTPushNotificationManager = require('../BatchedBridge/NativeModules') .PushNotificationManager; const invariant = require('invariant'); diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index 32c55ff7e8e85a..8e83050154702b 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -10,13 +10,13 @@ 'use strict'; -const EmitterSubscription = require('EmitterSubscription'); +const EmitterSubscription = require('../vendor/emitter/EmitterSubscription'); const PropTypes = require('prop-types'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -const React = require('React'); -const ReactNative = require('ReactNative'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); +const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); +const React = require('react'); +const ReactNative = require('../Renderer/shims/ReactNative'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const View = require('../Components/View/View'); type Context = { rootTag: number, @@ -57,7 +57,7 @@ class AppContainer extends React.Component { this._subscription = RCTDeviceEventEmitter.addListener( 'toggleElementInspector', () => { - const Inspector = require('Inspector'); + const Inspector = require('../Inspector/Inspector'); const inspector = this.state.inspector ? null : ( { let yellowBox = null; if (__DEV__) { if (!global.__RCTProfileIsProfiling) { - const YellowBox = require('YellowBox'); + const YellowBox = require('../YellowBox/YellowBox'); yellowBox = ; } } @@ -129,7 +129,7 @@ const styles = StyleSheet.create({ if (__DEV__) { if (!global.__RCTProfileIsProfiling) { - const YellowBox = require('YellowBox'); + const YellowBox = require('../YellowBox/YellowBox'); YellowBox.install(); } } diff --git a/Libraries/ReactNative/AppRegistry.js b/Libraries/ReactNative/AppRegistry.js index e4b8468633b40a..3fa755e3d98490 100644 --- a/Libraries/ReactNative/AppRegistry.js +++ b/Libraries/ReactNative/AppRegistry.js @@ -9,17 +9,17 @@ */ 'use strict'; -const BatchedBridge = require('BatchedBridge'); -const BugReporting = require('BugReporting'); -const NativeModules = require('NativeModules'); -const ReactNative = require('ReactNative'); -const SceneTracker = require('SceneTracker'); +const BatchedBridge = require('../BatchedBridge/BatchedBridge'); +const BugReporting = require('../BugReporting/BugReporting'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const ReactNative = require('../Renderer/shims/ReactNative'); +const SceneTracker = require('../Utilities/SceneTracker'); -const infoLog = require('infoLog'); +const infoLog = require('../Utilities/infoLog'); const invariant = require('invariant'); -const renderApplication = require('renderApplication'); -const createPerformanceLogger = require('createPerformanceLogger'); -import type {IPerformanceLogger} from 'createPerformanceLogger'; +const renderApplication = require('./renderApplication'); +const createPerformanceLogger = require('../Utilities/createPerformanceLogger'); +import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger'; type Task = (taskData: any) => Promise; type TaskProvider = () => Task; diff --git a/Libraries/ReactNative/FabricUIManager.js b/Libraries/ReactNative/FabricUIManager.js index a1a4ad68f5ad5b..478a6f793a4eca 100644 --- a/Libraries/ReactNative/FabricUIManager.js +++ b/Libraries/ReactNative/FabricUIManager.js @@ -13,7 +13,7 @@ import type { MeasureOnSuccessCallback, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, -} from 'ReactNativeTypes'; +} from '../Renderer/shims/ReactNativeTypes'; // TODO: type these properly. type Node = {}; diff --git a/Libraries/ReactNative/I18nManager.js b/Libraries/ReactNative/I18nManager.js index 40684614429b20..da2767a842068f 100644 --- a/Libraries/ReactNative/I18nManager.js +++ b/Libraries/ReactNative/I18nManager.js @@ -17,7 +17,8 @@ type I18nManagerStatus = { swapLeftAndRightInRTL: (flipStyles: boolean) => {}, }; -const I18nManager: I18nManagerStatus = require('NativeModules').I18nManager || { +const I18nManager: I18nManagerStatus = require('../BatchedBridge/NativeModules') + .I18nManager || { isRTL: false, doLeftAndRightSwapInRTL: true, allowRTL: () => {}, diff --git a/Libraries/ReactNative/ReactFabricIndicator.js b/Libraries/ReactNative/ReactFabricIndicator.js index 2c8d4cb6f6ac04..951fd2925a83d6 100644 --- a/Libraries/ReactNative/ReactFabricIndicator.js +++ b/Libraries/ReactNative/ReactFabricIndicator.js @@ -10,10 +10,10 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); +const React = require('react'); +const StyleSheet = require('../StyleSheet/StyleSheet'); +const Text = require('../Text/Text'); +const View = require('../Components/View/View'); function ReactFabricIndicator(): React.Node { return ( diff --git a/Libraries/ReactNative/ReactFabricInternals.js b/Libraries/ReactNative/ReactFabricInternals.js index dacabe62cceb13..592f4359e44202 100644 --- a/Libraries/ReactNative/ReactFabricInternals.js +++ b/Libraries/ReactNative/ReactFabricInternals.js @@ -12,10 +12,10 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactFabric'); -const createReactNativeComponentClass = require('createReactNativeComponentClass'); +} = require('../Renderer/shims/ReactFabric'); +const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass'); -import type {NativeMethodsMixinType} from 'ReactNativeTypes'; +import type {NativeMethodsMixinType} from '../Renderer/shims/ReactNativeTypes'; const {NativeMethodsMixin} = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; diff --git a/Libraries/ReactNative/UIManager.js b/Libraries/ReactNative/UIManager.js index 833005dbe92024..cf7f8edbdbb839 100644 --- a/Libraries/ReactNative/UIManager.js +++ b/Libraries/ReactNative/UIManager.js @@ -9,11 +9,11 @@ */ 'use strict'; -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); -const UIManagerProperties = require('UIManagerProperties'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const Platform = require('../Utilities/Platform'); +const UIManagerProperties = require('./UIManagerProperties'); -const defineLazyObjectProperty = require('defineLazyObjectProperty'); +const defineLazyObjectProperty = require('../Utilities/defineLazyObjectProperty'); const invariant = require('invariant'); const {UIManager} = NativeModules; diff --git a/Libraries/ReactNative/UIManagerStatTracker.js b/Libraries/ReactNative/UIManagerStatTracker.js index 78e3e0b149df78..ec1494c53b4390 100644 --- a/Libraries/ReactNative/UIManagerStatTracker.js +++ b/Libraries/ReactNative/UIManagerStatTracker.js @@ -9,7 +9,7 @@ */ 'use strict'; -const UIManager = require('UIManager'); +const UIManager = require('./UIManager'); let installed = false; const UIManagerStatTracker = { diff --git a/Libraries/ReactNative/getNativeComponentAttributes.js b/Libraries/ReactNative/getNativeComponentAttributes.js index 2fe8fcc3e9f3ff..bf08c389eb8753 100644 --- a/Libraries/ReactNative/getNativeComponentAttributes.js +++ b/Libraries/ReactNative/getNativeComponentAttributes.js @@ -10,15 +10,15 @@ 'use strict'; -const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes'); -const UIManager = require('UIManager'); - -const insetsDiffer = require('insetsDiffer'); -const matricesDiffer = require('matricesDiffer'); -const pointsDiffer = require('pointsDiffer'); -const processColor = require('processColor'); -const resolveAssetSource = require('resolveAssetSource'); -const sizesDiffer = require('sizesDiffer'); +const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes'); +const UIManager = require('./UIManager'); + +const insetsDiffer = require('../Utilities/differ/insetsDiffer'); +const matricesDiffer = require('../Utilities/differ/matricesDiffer'); +const pointsDiffer = require('../Utilities/differ/pointsDiffer'); +const processColor = require('../StyleSheet/processColor'); +const resolveAssetSource = require('../Image/resolveAssetSource'); +const sizesDiffer = require('../Utilities/differ/sizesDiffer'); const invariant = require('invariant'); const warning = require('fbjs/lib/warning'); diff --git a/Libraries/ReactNative/queryLayoutByID.js b/Libraries/ReactNative/queryLayoutByID.js index 62fe0b3f0e28ed..473ed4268e847e 100644 --- a/Libraries/ReactNative/queryLayoutByID.js +++ b/Libraries/ReactNative/queryLayoutByID.js @@ -9,7 +9,7 @@ */ 'use strict'; -const UIManager = require('UIManager'); +const UIManager = require('./UIManager'); type OnSuccessCallback = ( left: number, diff --git a/Libraries/ReactNative/renderApplication.js b/Libraries/ReactNative/renderApplication.js index 3fa9deff700ec5..ce7f6878002b4b 100644 --- a/Libraries/ReactNative/renderApplication.js +++ b/Libraries/ReactNative/renderApplication.js @@ -10,17 +10,17 @@ 'use strict'; -const AppContainer = require('AppContainer'); -import GlobalPerformanceLogger from 'GlobalPerformanceLogger'; -import type {IPerformanceLogger} from 'createPerformanceLogger'; -import PerformanceLoggerContext from 'PerformanceLoggerContext'; -const React = require('React'); -const ReactFabricIndicator = require('ReactFabricIndicator'); +const AppContainer = require('./AppContainer'); +import GlobalPerformanceLogger from '../Utilities/GlobalPerformanceLogger'; +import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger'; +import PerformanceLoggerContext from '../Utilities/PerformanceLoggerContext'; +const React = require('react'); +const ReactFabricIndicator = require('./ReactFabricIndicator'); const invariant = require('invariant'); // require BackHandler so it sets the default handler that exits the app if no listeners respond -require('BackHandler'); +require('../Utilities/BackHandler'); function renderApplication( RootComponent: React.ComponentType, @@ -62,9 +62,9 @@ function renderApplication( GlobalPerformanceLogger.startTimespan('renderApplication_React_render'); if (fabric) { - require('ReactFabric').render(renderable, rootTag); + require('../Renderer/shims/ReactFabric').render(renderable, rootTag); } else { - require('ReactNative').render(renderable, rootTag); + require('../Renderer/shims/ReactNative').render(renderable, rootTag); } GlobalPerformanceLogger.stopTimespan('renderApplication_React_render'); } diff --git a/Libraries/ReactNative/requireNativeComponent.js b/Libraries/ReactNative/requireNativeComponent.js index 4cc24d60595150..a2417e15983198 100644 --- a/Libraries/ReactNative/requireNativeComponent.js +++ b/Libraries/ReactNative/requireNativeComponent.js @@ -10,8 +10,8 @@ 'use strict'; -const createReactNativeComponentClass = require('createReactNativeComponentClass'); -const getNativeComponentAttributes = require('getNativeComponentAttributes'); +const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass'); +const getNativeComponentAttributes = require('./getNativeComponentAttributes'); /** * Creates values that can be used like React components which represent native diff --git a/Libraries/Renderer/oss/ReactFabric-dev.js b/Libraries/Renderer/oss/ReactFabric-dev.js index 5ea69a29fba41a..c0679d111b5891 100644 --- a/Libraries/Renderer/oss/ReactFabric-dev.js +++ b/Libraries/Renderer/oss/ReactFabric-dev.js @@ -16,19 +16,19 @@ if (__DEV__) { (function() { "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"); -var UIManager = require("UIManager"); +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'); +var UIManager = require('../../ReactNative/UIManager'); var React = require("react"); -var deepDiffer = require("deepDiffer"); -var flattenStyle = require("flattenStyle"); -var deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"); -var TextInputState = require("TextInputState"); -var FabricUIManager = require("FabricUIManager"); +var deepDiffer = require('../../Utilities/differ/deepDiffer'); +var flattenStyle = require('../../StyleSheet/flattenStyle'); +var deepFreezeAndThrowOnMutationInDev = require('../../Utilities/deepFreezeAndThrowOnMutationInDev'); +var TextInputState = require('../../Components/TextInput/TextInputState'); +var FabricUIManager = require('../../ReactNative/FabricUIManager'); var checkPropTypes = require("prop-types/checkPropTypes"); var Scheduler = require("scheduler"); var tracing = require("scheduler/tracing"); -var ExceptionsManager = require("ExceptionsManager"); +var ExceptionsManager = require('../../Core/ExceptionsManager'); // Do not require this module directly! Use a normal error constructor with // template literal strings. The messages will be converted to ReactError during diff --git a/Libraries/Renderer/oss/ReactFabric-prod.js b/Libraries/Renderer/oss/ReactFabric-prod.js index afbbd4ce6b1b9f..a89e2afe32bef8 100644 --- a/Libraries/Renderer/oss/ReactFabric-prod.js +++ b/Libraries/Renderer/oss/ReactFabric-prod.js @@ -11,16 +11,16 @@ */ "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"), - UIManager = require("UIManager"), +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'), + UIManager = require('../../ReactNative/UIManager'), React = require("react"), - deepDiffer = require("deepDiffer"), - flattenStyle = require("flattenStyle"), - TextInputState = require("TextInputState"), - FabricUIManager = require("FabricUIManager"), + deepDiffer = require('../../Utilities/differ/deepDiffer'), + flattenStyle = require('../../StyleSheet/flattenStyle'), + TextInputState = require('../../Components/TextInput/TextInputState'), + FabricUIManager = require('../../ReactNative/FabricUIManager'), Scheduler = require("scheduler"); -var ExceptionsManager = require("ExceptionsManager"); +var ExceptionsManager = require('../../Core/ExceptionsManager'); function ReactError(message) { message = Error(message); message.name = "Invariant Violation"; diff --git a/Libraries/Renderer/oss/ReactFabric-profiling.js b/Libraries/Renderer/oss/ReactFabric-profiling.js index 74761df873a15f..53c767ba9b491a 100644 --- a/Libraries/Renderer/oss/ReactFabric-profiling.js +++ b/Libraries/Renderer/oss/ReactFabric-profiling.js @@ -11,17 +11,17 @@ */ "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"), - UIManager = require("UIManager"), +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'), + UIManager = require('../../ReactNative/UIManager'), React = require("react"), - deepDiffer = require("deepDiffer"), - flattenStyle = require("flattenStyle"), - TextInputState = require("TextInputState"), - FabricUIManager = require("FabricUIManager"), + deepDiffer = require('../../Utilities/differ/deepDiffer'), + flattenStyle = require('../../StyleSheet/flattenStyle'), + TextInputState = require('../../Components/TextInput/TextInputState'), + FabricUIManager = require('../../ReactNative/FabricUIManager'), Scheduler = require("scheduler"), tracing = require("scheduler/tracing"), - ExceptionsManager = require("ExceptionsManager"); + ExceptionsManager = require('../../Core/ExceptionsManager'); function ReactError(message) { message = Error(message); message.name = "Invariant Violation"; diff --git a/Libraries/Renderer/oss/ReactNativeRenderer-dev.js b/Libraries/Renderer/oss/ReactNativeRenderer-dev.js index 38166b62db37e4..5eb2e094c5d840 100644 --- a/Libraries/Renderer/oss/ReactNativeRenderer-dev.js +++ b/Libraries/Renderer/oss/ReactNativeRenderer-dev.js @@ -16,19 +16,19 @@ if (__DEV__) { (function() { "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"); -var UIManager = require("UIManager"); -var RCTEventEmitter = require("RCTEventEmitter"); +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'); +var UIManager = require('../../ReactNative/UIManager'); +var RCTEventEmitter = require('../../EventEmitter/RCTEventEmitter'); var React = require("react"); -var deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"); -var deepDiffer = require("deepDiffer"); -var flattenStyle = require("flattenStyle"); -var TextInputState = require("TextInputState"); +var deepFreezeAndThrowOnMutationInDev = require('../../Utilities/deepFreezeAndThrowOnMutationInDev'); +var deepDiffer = require('../../Utilities/differ/deepDiffer'); +var flattenStyle = require('../../StyleSheet/flattenStyle'); +var TextInputState = require('../../Components/TextInput/TextInputState'); var checkPropTypes = require("prop-types/checkPropTypes"); var Scheduler = require("scheduler"); var tracing = require("scheduler/tracing"); -var ExceptionsManager = require("ExceptionsManager"); +var ExceptionsManager = require('../../Core/ExceptionsManager'); // Do not require this module directly! Use a normal error constructor with // template literal strings. The messages will be converted to ReactError during diff --git a/Libraries/Renderer/oss/ReactNativeRenderer-prod.js b/Libraries/Renderer/oss/ReactNativeRenderer-prod.js index 5fbb834c706292..318a19124186a1 100644 --- a/Libraries/Renderer/oss/ReactNativeRenderer-prod.js +++ b/Libraries/Renderer/oss/ReactNativeRenderer-prod.js @@ -11,16 +11,16 @@ */ "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"), - UIManager = require("UIManager"), - RCTEventEmitter = require("RCTEventEmitter"), +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'), + UIManager = require('../../ReactNative/UIManager'), + RCTEventEmitter = require('../../EventEmitter/RCTEventEmitter'), React = require("react"), - deepDiffer = require("deepDiffer"), - flattenStyle = require("flattenStyle"), - TextInputState = require("TextInputState"), + deepDiffer = require('../../Utilities/differ/deepDiffer'), + flattenStyle = require('../../StyleSheet/flattenStyle'), + TextInputState = require('../../Components/TextInput/TextInputState'), Scheduler = require("scheduler"); -var ExceptionsManager = require("ExceptionsManager"); +var ExceptionsManager = require('../../Core/ExceptionsManager'); function ReactError(message) { message = Error(message); message.name = "Invariant Violation"; diff --git a/Libraries/Renderer/oss/ReactNativeRenderer-profiling.js b/Libraries/Renderer/oss/ReactNativeRenderer-profiling.js index 5a356fca8b050c..1f1958b87c8f0d 100644 --- a/Libraries/Renderer/oss/ReactNativeRenderer-profiling.js +++ b/Libraries/Renderer/oss/ReactNativeRenderer-profiling.js @@ -11,17 +11,17 @@ */ "use strict"; -require("InitializeCore"); -var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"), - UIManager = require("UIManager"), - RCTEventEmitter = require("RCTEventEmitter"), +require('../../Core/InitializeCore'); +var ReactNativeViewConfigRegistry = require('../shims/ReactNativeViewConfigRegistry'), + UIManager = require('../../ReactNative/UIManager'), + RCTEventEmitter = require('../../EventEmitter/RCTEventEmitter'), React = require("react"), - deepDiffer = require("deepDiffer"), - flattenStyle = require("flattenStyle"), - TextInputState = require("TextInputState"), + deepDiffer = require('../../Utilities/differ/deepDiffer'), + flattenStyle = require('../../StyleSheet/flattenStyle'), + TextInputState = require('../../Components/TextInput/TextInputState'), Scheduler = require("scheduler"), tracing = require("scheduler/tracing"), - ExceptionsManager = require("ExceptionsManager"); + ExceptionsManager = require('../../Core/ExceptionsManager'); function ReactError(message) { message = Error(message); message.name = "Invariant Violation"; diff --git a/Libraries/Renderer/shims/NativeMethodsMixin.js b/Libraries/Renderer/shims/NativeMethodsMixin.js index 857e2981077072..c50f379fde06cc 100644 --- a/Libraries/Renderer/shims/NativeMethodsMixin.js +++ b/Libraries/Renderer/shims/NativeMethodsMixin.js @@ -12,9 +12,9 @@ const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -} = require('ReactNative'); +} = require('./ReactNative'); -import type {NativeMethodsMixinType} from 'ReactNativeTypes'; +import type {NativeMethodsMixinType} from './ReactNativeTypes'; const {NativeMethodsMixin} = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; diff --git a/Libraries/Renderer/shims/ReactFabric.js b/Libraries/Renderer/shims/ReactFabric.js index 03691e23d1d8dd..098ffea5de7935 100644 --- a/Libraries/Renderer/shims/ReactFabric.js +++ b/Libraries/Renderer/shims/ReactFabric.js @@ -10,17 +10,17 @@ 'use strict'; -const BatchedBridge = require('BatchedBridge'); +const BatchedBridge = require('../../BatchedBridge/BatchedBridge'); // TODO @sema: Adjust types -import type {ReactNativeType} from 'ReactNativeTypes'; +import type {ReactNativeType} from './ReactNativeTypes'; let ReactFabric; if (__DEV__) { - ReactFabric = require('ReactFabric-dev'); + ReactFabric = require('../oss/ReactFabric-dev'); } else { - ReactFabric = require('ReactFabric-prod'); + ReactFabric = require('../oss/ReactFabric-prod'); } BatchedBridge.registerCallableModule('ReactFabric', ReactFabric); diff --git a/Libraries/Renderer/shims/ReactNative.js b/Libraries/Renderer/shims/ReactNative.js index 13a5985f9f19d5..e0df85ddd77ce6 100644 --- a/Libraries/Renderer/shims/ReactNative.js +++ b/Libraries/Renderer/shims/ReactNative.js @@ -10,14 +10,14 @@ 'use strict'; -import type {ReactNativeType} from 'ReactNativeTypes'; +import type {ReactNativeType} from './ReactNativeTypes'; let ReactNative; if (__DEV__) { - ReactNative = require('ReactNativeRenderer-dev'); + ReactNative = require('../oss/ReactNativeRenderer-dev'); } else { - ReactNative = require('ReactNativeRenderer-prod'); + ReactNative = require('../oss/ReactNativeRenderer-prod'); } module.exports = (ReactNative: ReactNativeType); diff --git a/Libraries/Renderer/shims/createReactNativeComponentClass.js b/Libraries/Renderer/shims/createReactNativeComponentClass.js index e9f5fc0f978af2..c632a3c0fbb35a 100644 --- a/Libraries/Renderer/shims/createReactNativeComponentClass.js +++ b/Libraries/Renderer/shims/createReactNativeComponentClass.js @@ -12,7 +12,7 @@ import type {ViewConfigGetter} from './ReactNativeTypes'; -const {register} = require('ReactNativeViewConfigRegistry'); +const {register} = require('./ReactNativeViewConfigRegistry'); /** * Creates a renderable ReactNative host component. diff --git a/Libraries/Sample/Sample.ios.js b/Libraries/Sample/Sample.ios.js index 63e6c2840b3e07..b4e239e5f35f9b 100644 --- a/Libraries/Sample/Sample.ios.js +++ b/Libraries/Sample/Sample.ios.js @@ -12,7 +12,7 @@ 'use strict'; -const NativeSample = require('NativeModules').Sample; +const NativeSample = require('../BatchedBridge/NativeModules').Sample; /** * High-level docs for the Sample iOS API can be written here. diff --git a/Libraries/Settings/Settings.ios.js b/Libraries/Settings/Settings.ios.js index e1c329b0630704..4084364721ec3e 100644 --- a/Libraries/Settings/Settings.ios.js +++ b/Libraries/Settings/Settings.ios.js @@ -10,8 +10,9 @@ 'use strict'; -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -const RCTSettingsManager = require('NativeModules').SettingsManager; +const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); +const RCTSettingsManager = require('../BatchedBridge/NativeModules') + .SettingsManager; const invariant = require('invariant'); diff --git a/Libraries/Share/Share.js b/Libraries/Share/Share.js index 01933af88235ce..bd1ae08d5cadb7 100644 --- a/Libraries/Share/Share.js +++ b/Libraries/Share/Share.js @@ -10,12 +10,15 @@ 'use strict'; -const Platform = require('Platform'); +const Platform = require('../Utilities/Platform'); const invariant = require('invariant'); -const processColor = require('processColor'); +const processColor = require('../StyleSheet/processColor'); -const {ActionSheetManager, ShareModule} = require('NativeModules'); +const { + ActionSheetManager, + ShareModule, +} = require('../BatchedBridge/NativeModules'); type Content = | {title?: string, message: string} diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index 877e707628ece2..a1e154049a8f64 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -12,7 +12,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); // Use RocksDB if available, then SQLite, then file storage. const RCTAsyncStorage = diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index 7d8fe1a465ebf2..2692dd5892e4b7 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -9,11 +9,11 @@ */ 'use strict'; -const PixelRatio = require('PixelRatio'); -const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes'); -const StyleSheetValidation = require('StyleSheetValidation'); +const PixelRatio = require('../Utilities/PixelRatio'); +const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes'); +const StyleSheetValidation = require('./StyleSheetValidation'); -const flatten = require('flattenStyle'); +const flatten = require('./flattenStyle'); import type { ____Styles_Internal, @@ -25,7 +25,7 @@ import type { ____TextStyleProp_Internal, ____ImageStyle_Internal, ____ImageStyleProp_Internal, -} from 'StyleSheetTypes'; +} from './StyleSheetTypes'; /** * This type should be used as the type for a prop that is passed through diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 76199ec1a5d264..f307de6f06fb78 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -10,7 +10,7 @@ 'use strict'; -const AnimatedNode = require('AnimatedNode'); +const AnimatedNode = require('../Animated/src/nodes/AnimatedNode'); export type ColorValue = null | string; export type DimensionValue = null | number | string | AnimatedNode; diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js index 8b4fb82a729b57..d2bb5303f6e955 100644 --- a/Libraries/StyleSheet/StyleSheetValidation.js +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -10,9 +10,9 @@ 'use strict'; -const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes'); -const TextStylePropTypes = require('TextStylePropTypes'); -const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes'); +const DeprecatedImageStylePropTypes = require('../DeprecatedPropTypes/DeprecatedImageStylePropTypes'); +const TextStylePropTypes = require('../Text/TextStylePropTypes'); +const DeprecatedViewStylePropTypes = require('../DeprecatedPropTypes/DeprecatedViewStylePropTypes'); const invariant = require('invariant'); diff --git a/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js b/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js index 50b8846bb38870..561cb144978b96 100644 --- a/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +++ b/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js @@ -10,9 +10,9 @@ 'use strict'; -const StyleSheet = require('StyleSheet'); +const StyleSheet = require('../StyleSheet'); -import type {ImageStyleProp, TextStyleProp} from 'StyleSheet'; +import type {ImageStyleProp, TextStyleProp} from '../StyleSheet'; const imageStyle = {tintColor: 'rgb(0, 0, 0)'}; const textStyle = {color: 'rgb(0, 0, 0)'}; diff --git a/Libraries/StyleSheet/__tests__/flattenStyle-test.js b/Libraries/StyleSheet/__tests__/flattenStyle-test.js index f441c76203a049..3051b5d77dcc10 100644 --- a/Libraries/StyleSheet/__tests__/flattenStyle-test.js +++ b/Libraries/StyleSheet/__tests__/flattenStyle-test.js @@ -10,9 +10,9 @@ 'use strict'; -const StyleSheet = require('StyleSheet'); -const StyleSheetValidation = require('StyleSheetValidation'); -const flattenStyle = require('flattenStyle'); +const StyleSheet = require('../StyleSheet'); +const StyleSheetValidation = require('../StyleSheetValidation'); +const flattenStyle = require('../flattenStyle'); function getFixture() { StyleSheetValidation.addValidStylePropTypes({ diff --git a/Libraries/StyleSheet/__tests__/normalizeColor-test.js b/Libraries/StyleSheet/__tests__/normalizeColor-test.js index 86f39d764b32a8..974fa5ef99566f 100644 --- a/Libraries/StyleSheet/__tests__/normalizeColor-test.js +++ b/Libraries/StyleSheet/__tests__/normalizeColor-test.js @@ -10,7 +10,7 @@ 'use strict'; -const normalizeColor = require('normalizeColor'); +const normalizeColor = require('../../Color/normalizeColor'); describe('normalizeColor', function() { it('should accept only spec compliant colors', function() { diff --git a/Libraries/StyleSheet/__tests__/processColor-test.js b/Libraries/StyleSheet/__tests__/processColor-test.js index 5342bfa7d6a857..0b60130e26ebf3 100644 --- a/Libraries/StyleSheet/__tests__/processColor-test.js +++ b/Libraries/StyleSheet/__tests__/processColor-test.js @@ -10,8 +10,8 @@ 'use strict'; -const {OS} = require('Platform'); -const processColor = require('processColor'); +const {OS} = require('../../Utilities/Platform'); +const processColor = require('../processColor'); const platformSpecific = OS === 'android' diff --git a/Libraries/StyleSheet/__tests__/processTransform-test.js b/Libraries/StyleSheet/__tests__/processTransform-test.js index 820db774956e53..1de3a08d38dd61 100644 --- a/Libraries/StyleSheet/__tests__/processTransform-test.js +++ b/Libraries/StyleSheet/__tests__/processTransform-test.js @@ -10,7 +10,7 @@ 'use strict'; -const processTransform = require('processTransform'); +const processTransform = require('../processTransform'); describe('processTransform', () => { describe('validation', () => { diff --git a/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js b/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js index 2afffd0d0189c2..9a33bf15356ff2 100644 --- a/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js +++ b/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js @@ -10,8 +10,8 @@ 'use strict'; -const setNormalizedColorAlpha = require('setNormalizedColorAlpha'); -const normalizeColor = require('normalizeColor'); +const setNormalizedColorAlpha = require('../setNormalizedColorAlpha'); +const normalizeColor = require('../../Color/normalizeColor'); describe('setNormalizedColorAlpha', function() { it('should adjust the alpha of the color passed in', function() { diff --git a/Libraries/StyleSheet/flattenStyle.js b/Libraries/StyleSheet/flattenStyle.js index 6aa9647437406a..3cc0cef326fcc4 100644 --- a/Libraries/StyleSheet/flattenStyle.js +++ b/Libraries/StyleSheet/flattenStyle.js @@ -12,7 +12,7 @@ import type { DangerouslyImpreciseStyle, DangerouslyImpreciseStyleProp, -} from 'StyleSheet'; +} from './StyleSheet'; function flattenStyle( style: ?DangerouslyImpreciseStyleProp, diff --git a/Libraries/StyleSheet/processColor.js b/Libraries/StyleSheet/processColor.js index 9d87b462a8c600..cfad1676f44127 100644 --- a/Libraries/StyleSheet/processColor.js +++ b/Libraries/StyleSheet/processColor.js @@ -10,9 +10,9 @@ 'use strict'; -const Platform = require('Platform'); +const Platform = require('../Utilities/Platform'); -const normalizeColor = require('normalizeColor'); +const normalizeColor = require('../Color/normalizeColor'); /* eslint no-bitwise: 0 */ function processColor(color?: ?(string | number)): ?number { diff --git a/Libraries/StyleSheet/processTransform.js b/Libraries/StyleSheet/processTransform.js index 097de0712f0b1f..353d3de776e3c0 100644 --- a/Libraries/StyleSheet/processTransform.js +++ b/Libraries/StyleSheet/processTransform.js @@ -10,11 +10,11 @@ 'use strict'; -const MatrixMath = require('MatrixMath'); -const Platform = require('Platform'); +const MatrixMath = require('../Utilities/MatrixMath'); +const Platform = require('../Utilities/Platform'); const invariant = require('invariant'); -const stringifySafe = require('stringifySafe'); +const stringifySafe = require('../Utilities/stringifySafe'); /** * Generate a transform matrix based on the provided transforms, and use that diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index d14aa513444bf5..92da79d44901fc 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -10,20 +10,20 @@ 'use strict'; -const DeprecatedTextPropTypes = require('DeprecatedTextPropTypes'); -const React = require('React'); -const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); -const TextAncestor = require('TextAncestor'); -const Touchable = require('Touchable'); -const UIManager = require('UIManager'); +const DeprecatedTextPropTypes = require('../DeprecatedPropTypes/DeprecatedTextPropTypes'); +const React = require('react'); +const ReactNativeViewAttributes = require('../Components/View/ReactNativeViewAttributes'); +const TextAncestor = require('./TextAncestor'); +const Touchable = require('../Components/Touchable/Touchable'); +const UIManager = require('../ReactNative/UIManager'); -const createReactNativeComponentClass = require('createReactNativeComponentClass'); +const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass'); const nullthrows = require('nullthrows'); -const processColor = require('processColor'); +const processColor = require('../StyleSheet/processColor'); -import type {PressEvent} from 'CoreEventTypes'; -import type {NativeComponent} from 'ReactNative'; -import type {PressRetentionOffset, TextProps} from 'TextProps'; +import type {PressEvent} from '../Types/CoreEventTypes'; +import type {NativeComponent} from '../Renderer/shims/ReactNative'; +import type {PressRetentionOffset, TextProps} from './TextProps'; type ResponseHandlers = $ReadOnly<{| onStartShouldSetResponder: () => boolean, diff --git a/Libraries/Text/TextAncestor.js b/Libraries/Text/TextAncestor.js index e3463859ab43f6..5a8e79eee2ca7a 100644 --- a/Libraries/Text/TextAncestor.js +++ b/Libraries/Text/TextAncestor.js @@ -10,7 +10,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); /** * Whether the current element is the descendant of a element. diff --git a/Libraries/Text/TextPropTypes.js b/Libraries/Text/TextPropTypes.js index ea09e6a51f59d2..756d95721f1b27 100644 --- a/Libraries/Text/TextPropTypes.js +++ b/Libraries/Text/TextPropTypes.js @@ -10,11 +10,11 @@ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); -const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType'); +const DeprecatedColorPropType = require('../DeprecatedPropTypes/DeprecatedColorPropType'); +const DeprecatedEdgeInsetsPropType = require('../DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'); const PropTypes = require('prop-types'); -const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType'); -const TextStylePropTypes = require('TextStylePropTypes'); +const DeprecatedStyleSheetPropType = require('../DeprecatedPropTypes/DeprecatedStyleSheetPropType'); +const TextStylePropTypes = require('./TextStylePropTypes'); const stylePropType = DeprecatedStyleSheetPropType(TextStylePropTypes); diff --git a/Libraries/Text/TextProps.js b/Libraries/Text/TextProps.js index f7b5b67c465c4d..99a384370be686 100644 --- a/Libraries/Text/TextProps.js +++ b/Libraries/Text/TextProps.js @@ -10,10 +10,17 @@ 'use strict'; -import type {LayoutEvent, PressEvent, TextLayoutEvent} from 'CoreEventTypes'; -import type React from 'React'; -import type {TextStyleProp} from 'StyleSheet'; -import type {AccessibilityRole, AccessibilityStates} from 'ViewAccessibility'; +import type { + LayoutEvent, + PressEvent, + TextLayoutEvent, +} from '../Types/CoreEventTypes'; +import type React from 'react'; +import type {TextStyleProp} from '../StyleSheet/StyleSheet'; +import type { + AccessibilityRole, + AccessibilityStates, +} from '../Components/View/ViewAccessibility'; export type PressRetentionOffset = $ReadOnly<{| top: number, diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index d4755ef762c1dc..e41f6d833cc5d0 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -10,9 +10,9 @@ 'use strict'; -const DeprecatedColorPropType = require('DeprecatedColorPropType'); +const DeprecatedColorPropType = require('../DeprecatedPropTypes/DeprecatedColorPropType'); const ReactPropTypes = require('prop-types'); -const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes'); +const DeprecatedViewStylePropTypes = require('../DeprecatedPropTypes/DeprecatedViewStylePropTypes'); const TextStylePropTypes = { ...DeprecatedViewStylePropTypes, diff --git a/Libraries/TurboModule/TurboModuleRegistry.js b/Libraries/TurboModule/TurboModuleRegistry.js index 18f7e9688cea88..ca64f774deceea 100644 --- a/Libraries/TurboModule/TurboModuleRegistry.js +++ b/Libraries/TurboModule/TurboModuleRegistry.js @@ -10,9 +10,9 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); -import type {TurboModule} from 'RCTExport'; +import type {TurboModule} from './RCTExport'; import invariant from 'invariant'; const turboModuleProxy = global.__turboModuleProxy; diff --git a/Libraries/TurboModule/samples/NativeSampleTurboModule.js b/Libraries/TurboModule/samples/NativeSampleTurboModule.js index e5aadddacc9511..486d555aa04516 100644 --- a/Libraries/TurboModule/samples/NativeSampleTurboModule.js +++ b/Libraries/TurboModule/samples/NativeSampleTurboModule.js @@ -10,8 +10,8 @@ 'use strict'; -import type {TurboModule} from 'RCTExport'; -import * as TurboModuleRegistry from 'TurboModuleRegistry'; +import type {TurboModule} from '../RCTExport'; +import * as TurboModuleRegistry from '../TurboModuleRegistry'; export interface Spec extends TurboModule { // Exported methods. diff --git a/Libraries/UTFSequence.js b/Libraries/UTFSequence.js index bd10afc6ca2c72..db5ff90fcf8f94 100644 --- a/Libraries/UTFSequence.js +++ b/Libraries/UTFSequence.js @@ -10,7 +10,7 @@ 'use strict'; -const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); +const deepFreezeAndThrowOnMutationInDev = require('./Utilities/deepFreezeAndThrowOnMutationInDev'); /** * A collection of Unicode sequences for various characters and emoji. diff --git a/Libraries/Utilities/BackHandler.android.js b/Libraries/Utilities/BackHandler.android.js index 505e6b89860570..a7e2e29dc9ae77 100644 --- a/Libraries/Utilities/BackHandler.android.js +++ b/Libraries/Utilities/BackHandler.android.js @@ -10,8 +10,9 @@ 'use strict'; -const DeviceEventManager = require('NativeModules').DeviceEventManager; -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const DeviceEventManager = require('../BatchedBridge/NativeModules') + .DeviceEventManager; +const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); const DEVICE_BACK_EVENT = 'hardwareBackPress'; diff --git a/Libraries/Utilities/BackHandler.ios.js b/Libraries/Utilities/BackHandler.ios.js index b04fe6814392fe..88093a73e19d23 100644 --- a/Libraries/Utilities/BackHandler.ios.js +++ b/Libraries/Utilities/BackHandler.ios.js @@ -13,8 +13,8 @@ 'use strict'; -const Platform = require('Platform'); -const TVEventHandler = require('TVEventHandler'); +const Platform = require('./Platform'); +const TVEventHandler = require('../Components/AppleTV/TVEventHandler'); type BackPressEventName = 'backPress' | 'hardwareBackPress'; diff --git a/Libraries/Utilities/DeviceInfo.js b/Libraries/Utilities/DeviceInfo.js index df17b50dc4c26b..9757f2686e5a70 100644 --- a/Libraries/Utilities/DeviceInfo.js +++ b/Libraries/Utilities/DeviceInfo.js @@ -10,7 +10,7 @@ 'use strict'; -const DeviceInfo = require('NativeModules').DeviceInfo; +const DeviceInfo = require('../BatchedBridge/NativeModules').DeviceInfo; const invariant = require('invariant'); diff --git a/Libraries/Utilities/Dimensions.js b/Libraries/Utilities/Dimensions.js index 6c1561b4cc4ba6..383dcc44c8ac5c 100644 --- a/Libraries/Utilities/Dimensions.js +++ b/Libraries/Utilities/Dimensions.js @@ -10,9 +10,9 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const Platform = require('Platform'); -const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +const EventEmitter = require('../vendor/emitter/EventEmitter'); +const Platform = require('./Platform'); +const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); const invariant = require('invariant'); @@ -128,7 +128,7 @@ let dims: ?{[key: string]: any} = global.nativeExtensions.DeviceInfo.Dimensions; let nativeExtensionsEnabled = true; if (!dims) { - const DeviceInfo = require('DeviceInfo'); + const DeviceInfo = require('./DeviceInfo'); dims = DeviceInfo.Dimensions; nativeExtensionsEnabled = false; } diff --git a/Libraries/Utilities/GlobalPerformanceLogger.js b/Libraries/Utilities/GlobalPerformanceLogger.js index d00493758ee350..ccab5e4685a6de 100644 --- a/Libraries/Utilities/GlobalPerformanceLogger.js +++ b/Libraries/Utilities/GlobalPerformanceLogger.js @@ -9,7 +9,7 @@ */ 'use strict'; -const createPerformanceLogger = require('createPerformanceLogger'); +const createPerformanceLogger = require('./createPerformanceLogger'); /** * This is a global shared instance of IPerformanceLogger that is created with diff --git a/Libraries/Utilities/HMRClient.js b/Libraries/Utilities/HMRClient.js index 193eddd9cac08e..0c192a7092d0e4 100644 --- a/Libraries/Utilities/HMRClient.js +++ b/Libraries/Utilities/HMRClient.js @@ -9,7 +9,7 @@ */ 'use strict'; -const Platform = require('Platform'); +const Platform = require('./Platform'); const invariant = require('invariant'); const MetroHMRClient = require('metro/src/lib/bundle-modules/HMRClient'); @@ -25,7 +25,7 @@ const HMRClient = { invariant(host, 'Missing required paramenter `host`'); // Moving to top gives errors due to NativeModules not being initialized - const HMRLoadingView = require('HMRLoadingView'); + const HMRLoadingView = require('./HMRLoadingView'); /* $FlowFixMe(>=0.84.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.84 was deployed. To see the error, delete this @@ -73,10 +73,11 @@ Error: ${e.message}`; hmrClient.on('update', () => { if (Platform.OS === 'ios') { - const RCTRedBox = require('NativeModules').RedBox; + const RCTRedBox = require('../BatchedBridge/NativeModules').RedBox; RCTRedBox && RCTRedBox.dismiss && RCTRedBox.dismiss(); } else { - const RCTExceptionsManager = require('NativeModules').ExceptionsManager; + const RCTExceptionsManager = require('../BatchedBridge/NativeModules') + .ExceptionsManager; RCTExceptionsManager && RCTExceptionsManager.dismissRedbox && RCTExceptionsManager.dismissRedbox(); diff --git a/Libraries/Utilities/HMRLoadingView.android.js b/Libraries/Utilities/HMRLoadingView.android.js index dc814bb9e2d6ed..9daf8e2e4435f7 100644 --- a/Libraries/Utilities/HMRLoadingView.android.js +++ b/Libraries/Utilities/HMRLoadingView.android.js @@ -10,7 +10,7 @@ 'use strict'; -const ToastAndroid = require('ToastAndroid'); +const ToastAndroid = require('../Components/ToastAndroid/ToastAndroid'); const TOAST_SHORT_DELAY = 2000; diff --git a/Libraries/Utilities/HMRLoadingView.ios.js b/Libraries/Utilities/HMRLoadingView.ios.js index 84d9edf32be4a3..77105bcc1f122d 100644 --- a/Libraries/Utilities/HMRLoadingView.ios.js +++ b/Libraries/Utilities/HMRLoadingView.ios.js @@ -10,8 +10,8 @@ 'use strict'; -const processColor = require('processColor'); -const {DevLoadingView} = require('NativeModules'); +const processColor = require('../StyleSheet/processColor'); +const {DevLoadingView} = require('../BatchedBridge/NativeModules'); class HMRLoadingView { static showMessage(message: string) { diff --git a/Libraries/Utilities/HeapCapture.js b/Libraries/Utilities/HeapCapture.js index e64fac14504818..94ae18f1157606 100644 --- a/Libraries/Utilities/HeapCapture.js +++ b/Libraries/Utilities/HeapCapture.js @@ -20,7 +20,10 @@ const HeapCapture = { console.log('HeapCapture.captureHeap error: ' + e.toString()); error = e.toString(); } - require('NativeModules').JSCHeapCapture.captureComplete(path, error); + require('../BatchedBridge/NativeModules').JSCHeapCapture.captureComplete( + path, + error, + ); }, }; diff --git a/Libraries/Utilities/JSDevSupportModule.js b/Libraries/Utilities/JSDevSupportModule.js index 518c3400390ff8..c609faf91a766f 100644 --- a/Libraries/Utilities/JSDevSupportModule.js +++ b/Libraries/Utilities/JSDevSupportModule.js @@ -10,8 +10,8 @@ 'use strict'; -const JSDevSupport = require('NativeModules').JSDevSupport; -const ReactNative = require('ReactNative'); +const JSDevSupport = require('../BatchedBridge/NativeModules').JSDevSupport; +const ReactNative = require('../Renderer/shims/ReactNative'); const JSDevSupportModule = { getJSHierarchy: function(tag: number) { diff --git a/Libraries/Utilities/PerformanceLoggerContext.js b/Libraries/Utilities/PerformanceLoggerContext.js index 82eba2c0882c7f..facc03434e46a6 100644 --- a/Libraries/Utilities/PerformanceLoggerContext.js +++ b/Libraries/Utilities/PerformanceLoggerContext.js @@ -11,8 +11,8 @@ 'use strict'; import * as React from 'react'; -import GlobalPerformanceLogger from 'GlobalPerformanceLogger'; -import type {IPerformanceLogger} from 'createPerformanceLogger'; +import GlobalPerformanceLogger from './GlobalPerformanceLogger'; +import type {IPerformanceLogger} from './createPerformanceLogger'; /** * This is a React Context that provides a scoped instance of IPerformanceLogger. diff --git a/Libraries/Utilities/PixelRatio.js b/Libraries/Utilities/PixelRatio.js index 7c742e76f2d10b..99521348a578ab 100644 --- a/Libraries/Utilities/PixelRatio.js +++ b/Libraries/Utilities/PixelRatio.js @@ -10,7 +10,7 @@ 'use strict'; -const Dimensions = require('Dimensions'); +const Dimensions = require('./Dimensions'); /** * PixelRatio class gives access to the device pixel density. diff --git a/Libraries/Utilities/Platform.android.js b/Libraries/Utilities/Platform.android.js index 13134cb8d3c488..40b7a83034efbc 100644 --- a/Libraries/Utilities/Platform.android.js +++ b/Libraries/Utilities/Platform.android.js @@ -10,7 +10,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); export type PlatformSelectSpec = { android?: A, diff --git a/Libraries/Utilities/Platform.ios.js b/Libraries/Utilities/Platform.ios.js index f90cc94038b9ff..2ac52e3005a061 100644 --- a/Libraries/Utilities/Platform.ios.js +++ b/Libraries/Utilities/Platform.ios.js @@ -10,7 +10,7 @@ 'use strict'; -const NativeModules = require('NativeModules'); +const NativeModules = require('../BatchedBridge/NativeModules'); export type PlatformSelectSpec = { default?: D, diff --git a/Libraries/Utilities/PolyfillFunctions.js b/Libraries/Utilities/PolyfillFunctions.js index 0adb00647d2fe8..dc6d5a0fbcc864 100644 --- a/Libraries/Utilities/PolyfillFunctions.js +++ b/Libraries/Utilities/PolyfillFunctions.js @@ -10,7 +10,7 @@ 'use strict'; -const defineLazyObjectProperty = require('defineLazyObjectProperty'); +const defineLazyObjectProperty = require('./defineLazyObjectProperty'); /** * Sets an object's property. If a property with the same name exists, this will diff --git a/Libraries/Utilities/ReactNativeTestTools.js b/Libraries/Utilities/ReactNativeTestTools.js index a697912e2a16c3..6028bd94ba5026 100644 --- a/Libraries/Utilities/ReactNativeTestTools.js +++ b/Libraries/Utilities/ReactNativeTestTools.js @@ -12,7 +12,7 @@ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); const {Switch, Text, TextInput, VirtualizedList} = require('react-native'); diff --git a/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js b/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js index b47df421a21400..3fefaf5e3d06fc 100644 --- a/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +++ b/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js @@ -10,7 +10,7 @@ 'use strict'; const GlobalPerformanceLogger = jest - .unmock('createPerformanceLogger') - .genMockFromModule('GlobalPerformanceLogger'); + .unmock('../createPerformanceLogger') + .genMockFromModule('../GlobalPerformanceLogger'); module.exports = GlobalPerformanceLogger; diff --git a/Libraries/Utilities/__tests__/DeviceInfo-test.js b/Libraries/Utilities/__tests__/DeviceInfo-test.js index dc246c0434d008..049feb571d7549 100644 --- a/Libraries/Utilities/__tests__/DeviceInfo-test.js +++ b/Libraries/Utilities/__tests__/DeviceInfo-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('DeviceInfo', () => { - const DeviceInfo = require('DeviceInfo'); + const DeviceInfo = require('../DeviceInfo'); it('should give device info', () => { expect(DeviceInfo).toHaveProperty('Dimensions'); diff --git a/Libraries/Utilities/__tests__/Dimensions-test.js b/Libraries/Utilities/__tests__/Dimensions-test.js index bc64eb325dc5dd..b6d68ce29d57d7 100644 --- a/Libraries/Utilities/__tests__/Dimensions-test.js +++ b/Libraries/Utilities/__tests__/Dimensions-test.js @@ -11,8 +11,8 @@ 'use strict'; describe('Dimensions', () => { - const Dimensions = require('Dimensions'); - const Platform = require('Platform'); + const Dimensions = require('../Dimensions'); + const Platform = require('../Platform'); it('should set window dimensions', () => { Dimensions.set({ diff --git a/Libraries/Utilities/__tests__/MatrixMath-test.js b/Libraries/Utilities/__tests__/MatrixMath-test.js index 30de5f87992cb0..f6b62319946e62 100644 --- a/Libraries/Utilities/__tests__/MatrixMath-test.js +++ b/Libraries/Utilities/__tests__/MatrixMath-test.js @@ -10,7 +10,7 @@ 'use strict'; -const MatrixMath = require('MatrixMath'); +const MatrixMath = require('../MatrixMath'); function degreesToRadians(degrees) { return (degrees * Math.PI) / 180; diff --git a/Libraries/Utilities/__tests__/PerformanceLogger-test.js b/Libraries/Utilities/__tests__/PerformanceLogger-test.js index c826d9da86d7c1..4d83a9b7941547 100644 --- a/Libraries/Utilities/__tests__/PerformanceLogger-test.js +++ b/Libraries/Utilities/__tests__/PerformanceLogger-test.js @@ -9,9 +9,9 @@ 'use strict'; -import GlobalPerformanceLogger from 'GlobalPerformanceLogger'; -import createPerformanceLogger from 'createPerformanceLogger'; -import type {IPerformanceLogger} from 'createPerformanceLogger'; +import GlobalPerformanceLogger from '../GlobalPerformanceLogger'; +import createPerformanceLogger from '../createPerformanceLogger'; +import type {IPerformanceLogger} from '../createPerformanceLogger'; const TIMESPAN_1 = ''; const TIMESPAN_2 = ''; diff --git a/Libraries/Utilities/__tests__/PixelRatio-test.js b/Libraries/Utilities/__tests__/PixelRatio-test.js index ff3735ac484ac5..35ebe26a829b63 100644 --- a/Libraries/Utilities/__tests__/PixelRatio-test.js +++ b/Libraries/Utilities/__tests__/PixelRatio-test.js @@ -11,8 +11,8 @@ 'use strict'; describe('PixelRatio', () => { - const Dimensions = require('Dimensions'); - const PixelRatio = require('PixelRatio'); + const Dimensions = require('../Dimensions'); + const PixelRatio = require('../PixelRatio'); beforeEach(() => { Dimensions.set({ diff --git a/Libraries/Utilities/__tests__/SceneTracker-test.js b/Libraries/Utilities/__tests__/SceneTracker-test.js index 01fe1e3d8c644a..909da1685aaff8 100644 --- a/Libraries/Utilities/__tests__/SceneTracker-test.js +++ b/Libraries/Utilities/__tests__/SceneTracker-test.js @@ -10,7 +10,7 @@ 'use strict'; -const SceneTracker = require('SceneTracker'); +const SceneTracker = require('../SceneTracker'); describe('setActiveScene', function() { it('can handle multiple listeners and unsubscribe', function() { diff --git a/Libraries/Utilities/__tests__/binaryToBase64-test.js b/Libraries/Utilities/__tests__/binaryToBase64-test.js index f8c2a58f3cd1a9..ce3991f000b5a3 100644 --- a/Libraries/Utilities/__tests__/binaryToBase64-test.js +++ b/Libraries/Utilities/__tests__/binaryToBase64-test.js @@ -14,7 +14,7 @@ const base64 = require('base64-js'); const {TextEncoder, TextDecoder} = require('util'); describe('binaryToBase64', () => { - const binaryToBase64 = require('binaryToBase64'); + const binaryToBase64 = require('../binaryToBase64'); it('should encode a Uint8Array', () => { const input = new TextEncoder().encode('Test string'); diff --git a/Libraries/Utilities/__tests__/buildStyleInterpolator-test.js b/Libraries/Utilities/__tests__/buildStyleInterpolator-test.js index 5b00ddd4b2cd38..2895c46ef344ab 100644 --- a/Libraries/Utilities/__tests__/buildStyleInterpolator-test.js +++ b/Libraries/Utilities/__tests__/buildStyleInterpolator-test.js @@ -10,7 +10,7 @@ 'use strict'; -const buildStyleInterpolator = require('buildStyleInterpolator'); +const buildStyleInterpolator = require('../buildStyleInterpolator'); const validateEmpty = function(interpolator, value, validator) { const emptyObject = {}; diff --git a/Libraries/Utilities/__tests__/clamp-test.js b/Libraries/Utilities/__tests__/clamp-test.js index 8591166730dcad..210d4aca87f63b 100644 --- a/Libraries/Utilities/__tests__/clamp-test.js +++ b/Libraries/Utilities/__tests__/clamp-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('clamp', () => { - const clamp = require('clamp'); + const clamp = require('../clamp'); it('should return the value if the value does not exceed boundaries', () => { expect(clamp(0, 5, 10)).toEqual(5); diff --git a/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js b/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js index f3f8c016026e32..b813f2fbbd53da 100644 --- a/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js +++ b/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js @@ -8,7 +8,7 @@ * @emails oncall+react_native */ -const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); +const deepFreezeAndThrowOnMutationInDev = require('../deepFreezeAndThrowOnMutationInDev'); describe('deepFreezeAndThrowOnMutationInDev', function() { it('should be a noop on non object values', () => { diff --git a/Libraries/Utilities/__tests__/groupByEveryN-test.js b/Libraries/Utilities/__tests__/groupByEveryN-test.js index d31294308c9d3c..e84d880fc93313 100644 --- a/Libraries/Utilities/__tests__/groupByEveryN-test.js +++ b/Libraries/Utilities/__tests__/groupByEveryN-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('groupByEveryN', () => { - const groupByEveryN = require('groupByEveryN'); + const groupByEveryN = require('../groupByEveryN'); it('should group by with different n', () => { expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 1)).toEqual([ diff --git a/Libraries/Utilities/__tests__/infoLog-test.js b/Libraries/Utilities/__tests__/infoLog-test.js index 70c776b302f785..dd7909a5082870 100644 --- a/Libraries/Utilities/__tests__/infoLog-test.js +++ b/Libraries/Utilities/__tests__/infoLog-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('infoLog', () => { - const infoLog = require('infoLog'); + const infoLog = require('../infoLog'); it('logs messages to the console', () => { console.log = jest.fn(); diff --git a/Libraries/Utilities/__tests__/logError-test.js b/Libraries/Utilities/__tests__/logError-test.js index e56c4541ce53b5..09c867b7d25d50 100644 --- a/Libraries/Utilities/__tests__/logError-test.js +++ b/Libraries/Utilities/__tests__/logError-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('logError', () => { - const logError = require('logError'); + const logError = require('../logError'); it('logs error messages to the console', () => { console.error.apply = jest.fn(); diff --git a/Libraries/Utilities/__tests__/mapWithSeparator-test.js b/Libraries/Utilities/__tests__/mapWithSeparator-test.js index b54989019a48d6..1adbc2bcb1525b 100644 --- a/Libraries/Utilities/__tests__/mapWithSeparator-test.js +++ b/Libraries/Utilities/__tests__/mapWithSeparator-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('mapWithSeparator', () => { - const mapWithSeparator = require('mapWithSeparator'); + const mapWithSeparator = require('../mapWithSeparator'); it('mapWithSeparator returns expected results', () => { const array = [1, 2, 3]; diff --git a/Libraries/Utilities/__tests__/mergeIntoFast-test.js b/Libraries/Utilities/__tests__/mergeIntoFast-test.js index 51e21af1e2c10a..21753997b6a585 100644 --- a/Libraries/Utilities/__tests__/mergeIntoFast-test.js +++ b/Libraries/Utilities/__tests__/mergeIntoFast-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('mergeIntoFast', () => { - const mergeIntoFast = require('mergeIntoFast'); + const mergeIntoFast = require('../mergeIntoFast'); it('should merge two objects', () => { const a = {fontScale: 2, height: 1334}; diff --git a/Libraries/Utilities/__tests__/setAndForwardRef-test.js b/Libraries/Utilities/__tests__/setAndForwardRef-test.js index 411e31dd8ef4aa..361831398062bf 100644 --- a/Libraries/Utilities/__tests__/setAndForwardRef-test.js +++ b/Libraries/Utilities/__tests__/setAndForwardRef-test.js @@ -11,10 +11,10 @@ 'use strict'; -const React = require('React'); +const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const setAndForwardRef = require('setAndForwardRef'); +const setAndForwardRef = require('../setAndForwardRef'); describe('setAndForwardRef', () => { let innerFuncCalled = false; diff --git a/Libraries/Utilities/__tests__/stringifySafe-test.js b/Libraries/Utilities/__tests__/stringifySafe-test.js index 0dcf6e4544d7af..b7eb1f21192fee 100644 --- a/Libraries/Utilities/__tests__/stringifySafe-test.js +++ b/Libraries/Utilities/__tests__/stringifySafe-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('stringifySafe', () => { - const stringifySafe = require('stringifySafe'); + const stringifySafe = require('../stringifySafe'); it('stringifySafe stringifies undefined values', () => { expect(stringifySafe(undefined)).toEqual('undefined'); diff --git a/Libraries/Utilities/__tests__/truncate-test.js b/Libraries/Utilities/__tests__/truncate-test.js index 18c82c75ee3aad..1644d087959911 100644 --- a/Libraries/Utilities/__tests__/truncate-test.js +++ b/Libraries/Utilities/__tests__/truncate-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('truncate', () => { - const truncate = require('truncate'); + const truncate = require('../truncate'); it('should truncate', () => { expect(truncate('Hello, world.', 5)).toBe('He...'); diff --git a/Libraries/Utilities/__tests__/warnOnce-test.js b/Libraries/Utilities/__tests__/warnOnce-test.js index 78a985faa0f70a..ee66723c7cf517 100644 --- a/Libraries/Utilities/__tests__/warnOnce-test.js +++ b/Libraries/Utilities/__tests__/warnOnce-test.js @@ -11,7 +11,7 @@ 'use strict'; describe('warnOnce', () => { - const warnOnce = require('warnOnce'); + const warnOnce = require('../warnOnce'); it('logs warning messages to the console exactly once', () => { console.error = jest.fn(); diff --git a/Libraries/Utilities/createPerformanceLogger.js b/Libraries/Utilities/createPerformanceLogger.js index bfa6cde26584b6..2f49f988c15ce9 100644 --- a/Libraries/Utilities/createPerformanceLogger.js +++ b/Libraries/Utilities/createPerformanceLogger.js @@ -9,9 +9,9 @@ */ 'use strict'; -const Systrace = require('Systrace'); +const Systrace = require('../Performance/Systrace'); -const infoLog = require('infoLog'); +const infoLog = require('./infoLog'); const performanceNow = global.nativeQPLTimestamp || global.nativePerformanceNow || diff --git a/Libraries/Utilities/deprecatedPropType.js b/Libraries/Utilities/deprecatedPropType.js index 59619fb50bfc25..a147ec9b9f8fc1 100644 --- a/Libraries/Utilities/deprecatedPropType.js +++ b/Libraries/Utilities/deprecatedPropType.js @@ -10,7 +10,7 @@ 'use strict'; -const UIManager = require('UIManager'); +const UIManager = require('../ReactNative/UIManager'); /** * Adds a deprecation warning when the prop is used. diff --git a/Libraries/Utilities/differ/__tests__/deepDiffer-test.js b/Libraries/Utilities/differ/__tests__/deepDiffer-test.js index 7ccb0770965538..71ae73e59fbf3f 100644 --- a/Libraries/Utilities/differ/__tests__/deepDiffer-test.js +++ b/Libraries/Utilities/differ/__tests__/deepDiffer-test.js @@ -10,7 +10,7 @@ 'use strict'; -const deepDiffer = require('deepDiffer'); +const deepDiffer = require('../deepDiffer'); describe('deepDiffer', function() { it('should diff primitives of the same type', () => { diff --git a/Libraries/Utilities/dismissKeyboard.js b/Libraries/Utilities/dismissKeyboard.js index 22092ec6427e1e..50ea162e2ea079 100644 --- a/Libraries/Utilities/dismissKeyboard.js +++ b/Libraries/Utilities/dismissKeyboard.js @@ -13,7 +13,7 @@ 'use strict'; -const TextInputState = require('TextInputState'); +const TextInputState = require('../Components/TextInput/TextInputState'); function dismissKeyboard() { TextInputState.blurTextInput(TextInputState.currentlyFocusedField()); diff --git a/Libraries/Utilities/setAndForwardRef.js b/Libraries/Utilities/setAndForwardRef.js index 759569db41604c..3d8bae6b396f98 100644 --- a/Libraries/Utilities/setAndForwardRef.js +++ b/Libraries/Utilities/setAndForwardRef.js @@ -10,7 +10,7 @@ 'use strict'; -import type React from 'React'; +import type React from 'react'; type Args = $ReadOnly<{| getForwardedRef: () => ?React.Ref, diff --git a/Libraries/Vibration/Vibration.js b/Libraries/Vibration/Vibration.js index 7c8f695be85af9..892aeacfc7cb51 100644 --- a/Libraries/Vibration/Vibration.js +++ b/Libraries/Vibration/Vibration.js @@ -11,8 +11,8 @@ 'use strict'; -const RCTVibration = require('NativeModules').Vibration; -const Platform = require('Platform'); +const RCTVibration = require('../BatchedBridge/NativeModules').Vibration; +const Platform = require('../Utilities/Platform'); /** * Vibration API diff --git a/Libraries/WebSocket/WebSocket.js b/Libraries/WebSocket/WebSocket.js index 7d8c083ffe9af0..0bd3d8632fd003 100644 --- a/Libraries/WebSocket/WebSocket.js +++ b/Libraries/WebSocket/WebSocket.js @@ -10,21 +10,21 @@ 'use strict'; -const Blob = require('Blob'); +const Blob = require('../Blob/Blob'); const EventTarget = require('event-target-shim'); -const NativeEventEmitter = require('NativeEventEmitter'); -const BlobManager = require('BlobManager'); -const NativeModules = require('NativeModules'); -const Platform = require('Platform'); -const WebSocketEvent = require('WebSocketEvent'); +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); +const BlobManager = require('../Blob/BlobManager'); +const NativeModules = require('../BatchedBridge/NativeModules'); +const Platform = require('../Utilities/Platform'); +const WebSocketEvent = require('./WebSocketEvent'); const base64 = require('base64-js'); -const binaryToBase64 = require('binaryToBase64'); +const binaryToBase64 = require('../Utilities/binaryToBase64'); const invariant = require('invariant'); const {WebSocketModule} = NativeModules; -import type EventSubscription from 'EventSubscription'; +import type EventSubscription from '../vendor/emitter/EventSubscription'; type ArrayBufferView = | Int8Array diff --git a/Libraries/WebSocket/WebSocketInterceptor.js b/Libraries/WebSocket/WebSocketInterceptor.js index 29b4a9c5e18164..58cd3da3a3b7d7 100644 --- a/Libraries/WebSocket/WebSocketInterceptor.js +++ b/Libraries/WebSocket/WebSocketInterceptor.js @@ -9,8 +9,9 @@ 'use strict'; -const RCTWebSocketModule = require('NativeModules').WebSocketModule; -const NativeEventEmitter = require('NativeEventEmitter'); +const RCTWebSocketModule = require('../BatchedBridge/NativeModules') + .WebSocketModule; +const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter'); const base64 = require('base64-js'); diff --git a/Libraries/WebSocket/__tests__/WebSocket-test.js b/Libraries/WebSocket/__tests__/WebSocket-test.js index 62e6f14c3b123e..5b50783cdab734 100644 --- a/Libraries/WebSocket/__tests__/WebSocket-test.js +++ b/Libraries/WebSocket/__tests__/WebSocket-test.js @@ -10,14 +10,14 @@ 'use strict'; -jest.mock('NativeEventEmitter'); -jest.setMock('NativeModules', { +jest.mock('../../EventEmitter/NativeEventEmitter'); +jest.setMock('../../BatchedBridge/NativeModules', { WebSocketModule: { connect: () => {}, }, }); -const WebSocket = require('WebSocket'); +const WebSocket = require('../WebSocket'); describe('WebSocket', function() { it('should have connection lifecycle constants defined on the class', () => { diff --git a/Libraries/YellowBox/Data/YellowBoxCategory.js b/Libraries/YellowBox/Data/YellowBoxCategory.js index bf0dd67ccbd131..39daa110a20c0a 100644 --- a/Libraries/YellowBox/Data/YellowBoxCategory.js +++ b/Libraries/YellowBox/Data/YellowBoxCategory.js @@ -10,13 +10,13 @@ 'use strict'; -const React = require('React'); -const Text = require('Text'); -const UTFSequence = require('UTFSequence'); +const React = require('react'); +const Text = require('../../Text/Text'); +const UTFSequence = require('../../UTFSequence'); -const stringifySafe = require('stringifySafe'); +const stringifySafe = require('../../Utilities/stringifySafe'); -import type {TextStyleProp} from 'StyleSheet'; +import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; export type Category = string; export type Message = $ReadOnly<{| diff --git a/Libraries/YellowBox/Data/YellowBoxRegistry.js b/Libraries/YellowBox/Data/YellowBoxRegistry.js index b6a445f893aabf..413ec3d00fdee6 100644 --- a/Libraries/YellowBox/Data/YellowBoxRegistry.js +++ b/Libraries/YellowBox/Data/YellowBoxRegistry.js @@ -10,9 +10,9 @@ 'use strict'; -const YellowBoxWarning = require('YellowBoxWarning'); +const YellowBoxWarning = require('./YellowBoxWarning'); -import type {Category} from 'YellowBoxCategory'; +import type {Category} from './YellowBoxCategory'; export type Registry = Map>; diff --git a/Libraries/YellowBox/Data/YellowBoxSymbolication.js b/Libraries/YellowBox/Data/YellowBoxSymbolication.js index 816a1c40962932..f8186daeeb9868 100644 --- a/Libraries/YellowBox/Data/YellowBoxSymbolication.js +++ b/Libraries/YellowBox/Data/YellowBoxSymbolication.js @@ -10,9 +10,9 @@ 'use strict'; -const symbolicateStackTrace = require('symbolicateStackTrace'); +const symbolicateStackTrace = require('../../Core/Devtools/symbolicateStackTrace'); -import type {StackFrame} from 'parseErrorStack'; +import type {StackFrame} from '../../Core/Devtools/parseErrorStack'; type CacheKey = string; diff --git a/Libraries/YellowBox/Data/YellowBoxWarning.js b/Libraries/YellowBox/Data/YellowBoxWarning.js index f9b6ede089f1b3..0b43b852368d50 100644 --- a/Libraries/YellowBox/Data/YellowBoxWarning.js +++ b/Libraries/YellowBox/Data/YellowBoxWarning.js @@ -10,13 +10,13 @@ 'use strict'; -const YellowBoxCategory = require('YellowBoxCategory'); -const YellowBoxSymbolication = require('YellowBoxSymbolication'); +const YellowBoxCategory = require('./YellowBoxCategory'); +const YellowBoxSymbolication = require('./YellowBoxSymbolication'); -const parseErrorStack = require('parseErrorStack'); +const parseErrorStack = require('../../Core/Devtools/parseErrorStack'); -import type {Category, Message} from 'YellowBoxCategory'; -import type {Stack} from 'YellowBoxSymbolication'; +import type {Category, Message} from './YellowBoxCategory'; +import type {Stack} from './YellowBoxSymbolication'; export type SymbolicationRequest = $ReadOnly<{| abort: () => void, diff --git a/Libraries/YellowBox/Data/__tests__/YellowBoxCategory-test.js b/Libraries/YellowBox/Data/__tests__/YellowBoxCategory-test.js index 8e32c42d019b3e..502416373dcb24 100644 --- a/Libraries/YellowBox/Data/__tests__/YellowBoxCategory-test.js +++ b/Libraries/YellowBox/Data/__tests__/YellowBoxCategory-test.js @@ -11,7 +11,7 @@ 'use strict'; -const YellowBoxCategory = require('YellowBoxCategory'); +const YellowBoxCategory = require('../YellowBoxCategory'); describe('YellowBoxCategory', () => { it('parses strings', () => { diff --git a/Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js b/Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js index bca905b0699498..35a6dc9b8cfc23 100644 --- a/Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js +++ b/Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js @@ -11,8 +11,8 @@ 'use strict'; -const YellowBoxCategory = require('YellowBoxCategory'); -const YellowBoxRegistry = require('YellowBoxRegistry'); +const YellowBoxCategory = require('../YellowBoxCategory'); +const YellowBoxRegistry = require('../YellowBoxRegistry'); const registry = () => { const observer = jest.fn(); diff --git a/Libraries/YellowBox/Data/__tests__/YellowBoxSymbolication-test.js b/Libraries/YellowBox/Data/__tests__/YellowBoxSymbolication-test.js index c6af1d2cb851f8..b438ab1142e92d 100644 --- a/Libraries/YellowBox/Data/__tests__/YellowBoxSymbolication-test.js +++ b/Libraries/YellowBox/Data/__tests__/YellowBoxSymbolication-test.js @@ -11,16 +11,16 @@ 'use strict'; -import type {StackFrame} from 'parseErrorStack'; +import type {StackFrame} from '../../../Core/Devtools/parseErrorStack'; -jest.mock('symbolicateStackTrace'); +jest.mock('../../../Core/Devtools/symbolicateStackTrace'); -const YellowBoxSymbolication = require('YellowBoxSymbolication'); +const YellowBoxSymbolication = require('../YellowBoxSymbolication'); const symbolicateStackTrace: JestMockFn< $ReadOnlyArray>, Promise>, -> = (require('symbolicateStackTrace'): any); +> = (require('../../../Core/Devtools/symbolicateStackTrace'): any); const createStack = methodNames => methodNames.map(methodName => ({ diff --git a/Libraries/YellowBox/Data/__tests__/YellowBoxWarning-test.js b/Libraries/YellowBox/Data/__tests__/YellowBoxWarning-test.js index d3b3143ac66e03..65369bf8e5e60f 100644 --- a/Libraries/YellowBox/Data/__tests__/YellowBoxWarning-test.js +++ b/Libraries/YellowBox/Data/__tests__/YellowBoxWarning-test.js @@ -11,17 +11,17 @@ 'use strict'; -import type {StackFrame} from 'parseErrorStack'; +import type {StackFrame} from '../../../Core/Devtools/parseErrorStack'; -jest.mock('YellowBoxSymbolication'); +jest.mock('../YellowBoxSymbolication'); const YellowBoxSymbolication: {| symbolicate: JestMockFn< $ReadOnlyArray>, Promise>, >, -|} = (require('YellowBoxSymbolication'): any); -const YellowBoxWarning = require('YellowBoxWarning'); +|} = (require('../YellowBoxSymbolication'): any); +const YellowBoxWarning = require('../YellowBoxWarning'); const createStack = methodNames => methodNames.map(methodName => ({ diff --git a/Libraries/YellowBox/UI/YellowBoxButton.js b/Libraries/YellowBox/UI/YellowBoxButton.js index e8a98057d9127e..67885298f6c56c 100644 --- a/Libraries/YellowBox/UI/YellowBoxButton.js +++ b/Libraries/YellowBox/UI/YellowBoxButton.js @@ -10,13 +10,13 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const YellowBoxPressable = require('YellowBoxPressable'); -const YellowBoxStyle = require('YellowBoxStyle'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const YellowBoxStyle = require('./YellowBoxStyle'); -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; type Props = $ReadOnly<{| hitSlop?: ?EdgeInsetsProp, diff --git a/Libraries/YellowBox/UI/YellowBoxImageSource.js b/Libraries/YellowBox/UI/YellowBoxImageSource.js index 05a9f46b3a83db..8c186beb89e502 100644 --- a/Libraries/YellowBox/UI/YellowBoxImageSource.js +++ b/Libraries/YellowBox/UI/YellowBoxImageSource.js @@ -10,7 +10,7 @@ 'use strict'; -const PixelRatio = require('PixelRatio'); +const PixelRatio = require('../../Utilities/PixelRatio'); const scale = PixelRatio.get(); diff --git a/Libraries/YellowBox/UI/YellowBoxInspector.js b/Libraries/YellowBox/UI/YellowBoxInspector.js index a99bffc97269b7..1d4cf6f17f331a 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspector.js +++ b/Libraries/YellowBox/UI/YellowBoxInspector.js @@ -10,23 +10,23 @@ 'use strict'; -const Platform = require('Platform'); -const React = require('React'); -const ScrollView = require('ScrollView'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); -const YellowBoxCategory = require('YellowBoxCategory'); -const YellowBoxInspectorFooter = require('YellowBoxInspectorFooter'); -const YellowBoxInspectorHeader = require('YellowBoxInspectorHeader'); -const YellowBoxInspectorSourceMapStatus = require('YellowBoxInspectorSourceMapStatus'); -const YellowBoxInspectorStackFrame = require('YellowBoxInspectorStackFrame'); -const YellowBoxStyle = require('YellowBoxStyle'); - -const openFileInEditor = require('openFileInEditor'); - -import type YellowBoxWarning from 'YellowBoxWarning'; -import type {SymbolicationRequest} from 'YellowBoxWarning'; +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const ScrollView = require('../../Components/ScrollView/ScrollView'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../../Components/View/View'); +const YellowBoxCategory = require('../Data/YellowBoxCategory'); +const YellowBoxInspectorFooter = require('./YellowBoxInspectorFooter'); +const YellowBoxInspectorHeader = require('./YellowBoxInspectorHeader'); +const YellowBoxInspectorSourceMapStatus = require('./YellowBoxInspectorSourceMapStatus'); +const YellowBoxInspectorStackFrame = require('./YellowBoxInspectorStackFrame'); +const YellowBoxStyle = require('./YellowBoxStyle'); + +const openFileInEditor = require('../../Core/Devtools/openFileInEditor'); + +import type YellowBoxWarning from '../Data/YellowBoxWarning'; +import type {SymbolicationRequest} from '../Data/YellowBoxWarning'; type Props = $ReadOnly<{| onDismiss: () => void, diff --git a/Libraries/YellowBox/UI/YellowBoxInspectorFooter.js b/Libraries/YellowBox/UI/YellowBoxInspectorFooter.js index 56efa6fb9a94ac..5dda52a848f99a 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspectorFooter.js +++ b/Libraries/YellowBox/UI/YellowBoxInspectorFooter.js @@ -10,13 +10,13 @@ 'use strict'; -const React = require('React'); -const SafeAreaView = require('SafeAreaView'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); -const YellowBoxPressable = require('YellowBoxPressable'); -const YellowBoxStyle = require('YellowBoxStyle'); +const React = require('react'); +const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../../Components/View/View'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const YellowBoxStyle = require('./YellowBoxStyle'); type Props = $ReadOnly<{| onDismiss: () => void, diff --git a/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js b/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js index dfcdb7d9f12afd..dffcbbf2c87c2c 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js +++ b/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js @@ -10,18 +10,18 @@ 'use strict'; -const Image = require('Image'); -const Platform = require('Platform'); -const React = require('React'); -const SafeAreaView = require('SafeAreaView'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const View = require('View'); -const YellowBoxImageSource = require('YellowBoxImageSource'); -const YellowBoxPressable = require('YellowBoxPressable'); -const YellowBoxStyle = require('YellowBoxStyle'); +const Image = require('../../Image/Image'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); +const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const View = require('../../Components/View/View'); +const YellowBoxImageSource = require('./YellowBoxImageSource'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const YellowBoxStyle = require('./YellowBoxStyle'); -import type YellowBoxWarning from 'YellowBoxWarning'; +import type YellowBoxWarning from '../Data/YellowBoxWarning'; type Props = $ReadOnly<{| onSelectIndex: (selectedIndex: number) => void, diff --git a/Libraries/YellowBox/UI/YellowBoxInspectorSourceMapStatus.js b/Libraries/YellowBox/UI/YellowBoxInspectorSourceMapStatus.js index 6fea1672a47957..48487792293959 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspectorSourceMapStatus.js +++ b/Libraries/YellowBox/UI/YellowBoxInspectorSourceMapStatus.js @@ -10,18 +10,18 @@ 'use strict'; -const Animated = require('Animated'); -const Easing = require('Easing'); -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const YellowBoxImageSource = require('YellowBoxImageSource'); -const YellowBoxPressable = require('YellowBoxPressable'); -const YellowBoxStyle = require('YellowBoxStyle'); +const Animated = require('../../Animated/src/Animated'); +const Easing = require('../../Animated/src/Easing'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const YellowBoxImageSource = require('./YellowBoxImageSource'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const YellowBoxStyle = require('./YellowBoxStyle'); -import type {CompositeAnimation} from 'AnimatedImplementation'; -import type AnimatedInterpolation from 'AnimatedInterpolation'; -import type {PressEvent} from 'CoreEventTypes'; +import type {CompositeAnimation} from '../../Animated/src/AnimatedImplementation'; +import type AnimatedInterpolation from '../../Animated/src/nodes/AnimatedInterpolation'; +import type {PressEvent} from '../../Types/CoreEventTypes'; type Props = $ReadOnly<{| onPress?: ?(event: PressEvent) => void, diff --git a/Libraries/YellowBox/UI/YellowBoxInspectorStackFrame.js b/Libraries/YellowBox/UI/YellowBoxInspectorStackFrame.js index 7840dc9dcf57a1..efac349d35ee3c 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspectorStackFrame.js +++ b/Libraries/YellowBox/UI/YellowBoxInspectorStackFrame.js @@ -10,14 +10,14 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const YellowBoxPressable = require('YellowBoxPressable'); -const YellowBoxStyle = require('YellowBoxStyle'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const YellowBoxStyle = require('./YellowBoxStyle'); -import type {PressEvent} from 'CoreEventTypes'; -import type {StackFrame} from 'parseErrorStack'; +import type {PressEvent} from '../../Types/CoreEventTypes'; +import type {StackFrame} from '../../Core/Devtools/parseErrorStack'; type Props = $ReadOnly<{| frame: StackFrame, diff --git a/Libraries/YellowBox/UI/YellowBoxList.js b/Libraries/YellowBox/UI/YellowBoxList.js index 41c85cdeffa17e..2620c35852fab7 100644 --- a/Libraries/YellowBox/UI/YellowBoxList.js +++ b/Libraries/YellowBox/UI/YellowBoxList.js @@ -10,19 +10,19 @@ 'use strict'; -const Dimensions = require('Dimensions'); -const React = require('React'); -const FlatList = require('FlatList'); -const SafeAreaView = require('SafeAreaView'); -const StyleSheet = require('StyleSheet'); -const View = require('View'); -const YellowBoxButton = require('YellowBoxButton'); -const YellowBoxInspector = require('YellowBoxInspector'); -const YellowBoxListRow = require('YellowBoxListRow'); -const YellowBoxStyle = require('YellowBoxStyle'); - -import type {Category} from 'YellowBoxCategory'; -import type {Registry} from 'YellowBoxRegistry'; +const Dimensions = require('../../Utilities/Dimensions'); +const React = require('react'); +const FlatList = require('../../Lists/FlatList'); +const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const View = require('../../Components/View/View'); +const YellowBoxButton = require('./YellowBoxButton'); +const YellowBoxInspector = require('./YellowBoxInspector'); +const YellowBoxListRow = require('./YellowBoxListRow'); +const YellowBoxStyle = require('./YellowBoxStyle'); + +import type {Category} from '../Data/YellowBoxCategory'; +import type {Registry} from '../Data/YellowBoxRegistry'; type Props = $ReadOnly<{| onDismiss: (category: Category) => void, diff --git a/Libraries/YellowBox/UI/YellowBoxListRow.js b/Libraries/YellowBox/UI/YellowBoxListRow.js index 3af72817f5f1d0..d10f11b9034709 100644 --- a/Libraries/YellowBox/UI/YellowBoxListRow.js +++ b/Libraries/YellowBox/UI/YellowBoxListRow.js @@ -10,16 +10,16 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const Text = require('Text'); -const YellowBoxPressable = require('YellowBoxPressable'); -const View = require('View'); -const YellowBoxCategory = require('YellowBoxCategory'); -const YellowBoxStyle = require('YellowBoxStyle'); -const YellowBoxWarning = require('YellowBoxWarning'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const Text = require('../../Text/Text'); +const YellowBoxPressable = require('./YellowBoxPressable'); +const View = require('../../Components/View/View'); +const YellowBoxCategory = require('../Data/YellowBoxCategory'); +const YellowBoxStyle = require('./YellowBoxStyle'); +const YellowBoxWarning = require('../Data/YellowBoxWarning'); -import type {Category} from 'YellowBoxCategory'; +import type {Category} from '../Data/YellowBoxCategory'; type Props = $ReadOnly<{| category: Category, diff --git a/Libraries/YellowBox/UI/YellowBoxPressable.js b/Libraries/YellowBox/UI/YellowBoxPressable.js index 540c9eb4299677..0090ca69ab37f2 100644 --- a/Libraries/YellowBox/UI/YellowBoxPressable.js +++ b/Libraries/YellowBox/UI/YellowBoxPressable.js @@ -10,15 +10,15 @@ 'use strict'; -const React = require('React'); -const StyleSheet = require('StyleSheet'); -const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -const View = require('View'); -const YellowBoxStyle = require('YellowBoxStyle'); +const React = require('react'); +const StyleSheet = require('../../StyleSheet/StyleSheet'); +const TouchableWithoutFeedback = require('../../Components/Touchable/TouchableWithoutFeedback'); +const View = require('../../Components/View/View'); +const YellowBoxStyle = require('./YellowBoxStyle'); -import type {PressEvent} from 'CoreEventTypes'; -import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; -import type {ViewStyleProp} from 'StyleSheet'; +import type {PressEvent} from '../../Types/CoreEventTypes'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; type Props = $ReadOnly<{| backgroundColor: $ReadOnly<{| diff --git a/Libraries/YellowBox/YellowBox.js b/Libraries/YellowBox/YellowBox.js index 4f7d4128412b73..feb27f5faffe93 100644 --- a/Libraries/YellowBox/YellowBox.js +++ b/Libraries/YellowBox/YellowBox.js @@ -10,10 +10,14 @@ 'use strict'; -const React = require('React'); +const React = require('react'); -import type {Category} from 'YellowBoxCategory'; -import type {Registry, Subscription, IgnorePattern} from 'YellowBoxRegistry'; +import type {Category} from './Data/YellowBoxCategory'; +import type { + Registry, + Subscription, + IgnorePattern, +} from './Data/YellowBoxRegistry'; type Props = $ReadOnly<{||}>; type State = {| @@ -41,10 +45,10 @@ let YellowBox; * the ignored warning messages. */ if (__DEV__) { - const Platform = require('Platform'); - const RCTLog = require('RCTLog'); - const YellowBoxList = require('YellowBoxList'); - const YellowBoxRegistry = require('YellowBoxRegistry'); + const Platform = require('../Utilities/Platform'); + const RCTLog = require('../Utilities/RCTLog'); + const YellowBoxList = require('./UI/YellowBoxList'); + const YellowBoxRegistry = require('./Data/YellowBoxRegistry'); const {error, warn} = console; diff --git a/Libraries/YellowBox/__tests__/YellowBox-test.js b/Libraries/YellowBox/__tests__/YellowBox-test.js index 7fab54b447bbf2..8969f27ccb41d7 100644 --- a/Libraries/YellowBox/__tests__/YellowBox-test.js +++ b/Libraries/YellowBox/__tests__/YellowBox-test.js @@ -11,8 +11,8 @@ 'use strict'; -const YellowBox = require('YellowBox'); -const YellowBoxRegistry = require('YellowBoxRegistry'); +const YellowBox = require('../YellowBox'); +const YellowBoxRegistry = require('../Data/YellowBoxRegistry'); describe('YellowBox', () => { const {error, warn} = console; @@ -54,7 +54,7 @@ describe('YellowBox', () => { }); it('registers warnings', () => { - jest.mock('YellowBoxRegistry'); + jest.mock('../Data/YellowBoxRegistry'); YellowBox.install(); @@ -64,7 +64,7 @@ describe('YellowBox', () => { }); it('registers errors beginning with "Warning: "', () => { - jest.mock('YellowBoxRegistry'); + jest.mock('../Data/YellowBoxRegistry'); YellowBox.install(); diff --git a/Libraries/promiseRejectionIsError.js b/Libraries/promiseRejectionIsError.js index c0baddd41c2178..f17583d7b0c14e 100644 --- a/Libraries/promiseRejectionIsError.js +++ b/Libraries/promiseRejectionIsError.js @@ -10,7 +10,7 @@ 'use strict'; -require('Promise'); // make sure the default rejection handler is installed +require('./Promise'); // make sure the default rejection handler is installed const rejectionTracking = require('promise/setimmediate/rejection-tracking'); module.exports = () => { diff --git a/Libraries/react-native/react-native-implementation.js b/Libraries/react-native/react-native-implementation.js index 630e2f2c6e8b39..da719a7c304e24 100644 --- a/Libraries/react-native/react-native-implementation.js +++ b/Libraries/react-native/react-native-implementation.js @@ -11,22 +11,22 @@ 'use strict'; const invariant = require('invariant'); -const warnOnce = require('warnOnce'); +const warnOnce = require('../Utilities/warnOnce'); // Export React, plus some native additions. module.exports = { // Components get AccessibilityInfo() { - return require('AccessibilityInfo'); + return require('../Components/AccessibilityInfo/AccessibilityInfo'); }, get ActivityIndicator() { - return require('ActivityIndicator'); + return require('../Components/ActivityIndicator/ActivityIndicator'); }, get ART() { - return require('ReactNativeART'); + return require('../ART/ReactNativeART'); }, get Button() { - return require('Button'); + return require('../Components/Button'); }, get CheckBox() { warnOnce( @@ -35,22 +35,22 @@ module.exports = { "It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-checkbox', ); - return require('CheckBox'); + return require('../Components/CheckBox/CheckBox'); }, get DatePickerIOS() { - return require('DatePickerIOS'); + return require('../Components/DatePicker/DatePickerIOS'); }, get DrawerLayoutAndroid() { - return require('DrawerLayoutAndroid'); + return require('../Components/DrawerAndroid/DrawerLayoutAndroid'); }, get FlatList() { - return require('FlatList'); + return require('../Lists/FlatList'); }, get Image() { - return require('Image'); + return require('../Image/Image'); }, get ImageBackground() { - return require('ImageBackground'); + return require('../Image/ImageBackground'); }, get ImageEditor() { warnOnce( @@ -59,7 +59,7 @@ module.exports = { "It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-image-editor', ); - return require('ImageEditor'); + return require('../Image/ImageEditor'); }, get ImageStore() { warnOnce( @@ -69,13 +69,13 @@ module.exports = { "* expo-file-system: `readAsStringAsync(filepath, 'base64')`" + "* react-native-fs: `readFile(filepath, 'base64')`", ); - return require('ImageStore'); + return require('../Image/ImageStore'); }, get InputAccessoryView() { - return require('InputAccessoryView'); + return require('../Components/TextInput/InputAccessoryView'); }, get KeyboardAvoidingView() { - return require('KeyboardAvoidingView'); + return require('../Components/Keyboard/KeyboardAvoidingView'); }, get MaskedViewIOS() { warnOnce( @@ -84,34 +84,34 @@ module.exports = { "It can now be installed and imported from '@react-native-community/masked-view' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-masked-view', ); - return require('MaskedViewIOS'); + return require('../Components/MaskedView/MaskedViewIOS'); }, get Modal() { - return require('Modal'); + return require('../Modal/Modal'); }, get Picker() { - return require('Picker'); + return require('../Components/Picker/Picker'); }, get PickerIOS() { - return require('PickerIOS'); + return require('../Components/Picker/PickerIOS'); }, get ProgressBarAndroid() { - return require('ProgressBarAndroid'); + return require('../Components/ProgressBarAndroid/ProgressBarAndroid'); }, get ProgressViewIOS() { - return require('ProgressViewIOS'); + return require('../Components/ProgressViewIOS/ProgressViewIOS'); }, get SafeAreaView() { - return require('SafeAreaView'); + return require('../Components/SafeAreaView/SafeAreaView'); }, get ScrollView() { - return require('ScrollView'); + return require('../Components/ScrollView/ScrollView'); }, get SectionList() { - return require('SectionList'); + return require('../Lists/SectionList'); }, get SegmentedControlIOS() { - return require('SegmentedControlIOS'); + return require('../Components/SegmentedControlIOS/SegmentedControlIOS'); }, get Slider() { warnOnce( @@ -120,13 +120,13 @@ module.exports = { "It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-slider', ); - return require('Slider'); + return require('../Components/Slider/Slider'); }, get Switch() { - return require('Switch'); + return require('../Components/Switch/Switch'); }, get RefreshControl() { - return require('RefreshControl'); + return require('../Components/RefreshControl/RefreshControl'); }, get StatusBar() { warnOnce( @@ -135,34 +135,34 @@ module.exports = { "It can now be installed and imported from '@react-native-community/status-bar' instead of 'react-native'. " + 'https://github.com/react-native-community/react-native-statusbar', ); - return require('StatusBar'); + return require('../Components/StatusBar/StatusBar'); }, get Text() { - return require('Text'); + return require('../Text/Text'); }, get TextInput() { - return require('TextInput'); + return require('../Components/TextInput/TextInput'); }, get ToolbarAndroid() { - return require('ToolbarAndroid'); + return require('../Components/ToolbarAndroid/ToolbarAndroid'); }, get Touchable() { - return require('Touchable'); + return require('../Components/Touchable/Touchable'); }, get TouchableHighlight() { - return require('TouchableHighlight'); + return require('../Components/Touchable/TouchableHighlight'); }, get TouchableNativeFeedback() { - return require('TouchableNativeFeedback'); + return require('../Components/Touchable/TouchableNativeFeedback'); }, get TouchableOpacity() { - return require('TouchableOpacity'); + return require('../Components/Touchable/TouchableOpacity'); }, get TouchableWithoutFeedback() { - return require('TouchableWithoutFeedback'); + return require('../Components/Touchable/TouchableWithoutFeedback'); }, get View() { - return require('View'); + return require('../Components/View/View'); }, get ViewPagerAndroid() { warnOnce( @@ -171,30 +171,30 @@ module.exports = { "It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-viewpager', ); - return require('ViewPagerAndroid'); + return require('../Components/ViewPager/ViewPagerAndroid'); }, get VirtualizedList() { - return require('VirtualizedList'); + return require('../Lists/VirtualizedList'); }, get VirtualizedSectionList() { - return require('VirtualizedSectionList'); + return require('../Lists/VirtualizedSectionList'); }, // APIs get ActionSheetIOS() { - return require('ActionSheetIOS'); + return require('../ActionSheetIOS/ActionSheetIOS'); }, get Alert() { - return require('Alert'); + return require('../Alert/Alert'); }, get Animated() { - return require('Animated'); + return require('../Animated/src/Animated'); }, get AppRegistry() { - return require('AppRegistry'); + return require('../ReactNative/AppRegistry'); }, get AppState() { - return require('AppState'); + return require('../AppState/AppState'); }, get AsyncStorage() { warnOnce( @@ -203,10 +203,10 @@ module.exports = { "It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-async-storage', ); - return require('AsyncStorage'); + return require('../Storage/AsyncStorage'); }, get BackHandler() { - return require('BackHandler'); + return require('../Utilities/BackHandler'); }, get CameraRoll() { warnOnce( @@ -215,46 +215,46 @@ module.exports = { "It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-cameraroll', ); - return require('CameraRoll'); + return require('../CameraRoll/CameraRoll'); }, get Clipboard() { - return require('Clipboard'); + return require('../Components/Clipboard/Clipboard'); }, get DatePickerAndroid() { - return require('DatePickerAndroid'); + return require('../Components/DatePickerAndroid/DatePickerAndroid'); }, get DeviceInfo() { - return require('DeviceInfo'); + return require('../Utilities/DeviceInfo'); }, get Dimensions() { - return require('Dimensions'); + return require('../Utilities/Dimensions'); }, get Easing() { - return require('Easing'); + return require('../Animated/src/Easing'); }, get findNodeHandle() { - return require('ReactNative').findNodeHandle; + return require('../Renderer/shims/ReactNative').findNodeHandle; }, get I18nManager() { - return require('I18nManager'); + return require('../ReactNative/I18nManager'); }, get ImagePickerIOS() { - return require('ImagePickerIOS'); + return require('../CameraRoll/ImagePickerIOS'); }, get InteractionManager() { - return require('InteractionManager'); + return require('../Interaction/InteractionManager'); }, get Keyboard() { - return require('Keyboard'); + return require('../Components/Keyboard/Keyboard'); }, get LayoutAnimation() { - return require('LayoutAnimation'); + return require('../LayoutAnimation/LayoutAnimation'); }, get Linking() { - return require('Linking'); + return require('../Linking/Linking'); }, get NativeEventEmitter() { - return require('NativeEventEmitter'); + return require('../EventEmitter/NativeEventEmitter'); }, get NetInfo() { warnOnce( @@ -263,16 +263,16 @@ module.exports = { "It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-netinfo', ); - return require('NetInfo'); + return require('../Network/NetInfo'); }, get PanResponder() { - return require('PanResponder'); + return require('../Interaction/PanResponder'); }, get PermissionsAndroid() { - return require('PermissionsAndroid'); + return require('../PermissionsAndroid/PermissionsAndroid'); }, get PixelRatio() { - return require('PixelRatio'); + return require('../Utilities/PixelRatio'); }, get PushNotificationIOS() { warnOnce( @@ -281,83 +281,83 @@ module.exports = { "It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " + 'See https://github.com/react-native-community/react-native-push-notification-ios', ); - return require('PushNotificationIOS'); + return require('../PushNotificationIOS/PushNotificationIOS'); }, get Settings() { - return require('Settings'); + return require('../Settings/Settings'); }, get Share() { - return require('Share'); + return require('../Share/Share'); }, get StatusBarIOS() { - return require('StatusBarIOS'); + return require('../Components/StatusBar/StatusBarIOS'); }, get StyleSheet() { - return require('StyleSheet'); + return require('../StyleSheet/StyleSheet'); }, get Systrace() { - return require('Systrace'); + return require('../Performance/Systrace'); }, get TimePickerAndroid() { - return require('TimePickerAndroid'); + return require('../Components/TimePickerAndroid/TimePickerAndroid'); }, get ToastAndroid() { - return require('ToastAndroid'); + return require('../Components/ToastAndroid/ToastAndroid'); }, get TurboModuleRegistry() { - return require('TurboModuleRegistry'); + return require('../TurboModule/TurboModuleRegistry'); }, get TVEventHandler() { - return require('TVEventHandler'); + return require('../Components/AppleTV/TVEventHandler'); }, get UIManager() { - return require('UIManager'); + return require('../ReactNative/UIManager'); }, get unstable_batchedUpdates() { - return require('ReactNative').unstable_batchedUpdates; + return require('../Renderer/shims/ReactNative').unstable_batchedUpdates; }, get UTFSequence() { - return require('UTFSequence'); + return require('../UTFSequence'); }, get Vibration() { - return require('Vibration'); + return require('../Vibration/Vibration'); }, get YellowBox() { - return require('YellowBox'); + return require('../YellowBox/YellowBox'); }, // Plugins get DeviceEventEmitter() { - return require('RCTDeviceEventEmitter'); + return require('../EventEmitter/RCTDeviceEventEmitter'); }, get NativeAppEventEmitter() { - return require('RCTNativeAppEventEmitter'); + return require('../EventEmitter/RCTNativeAppEventEmitter'); }, get NativeModules() { - return require('NativeModules'); + return require('../BatchedBridge/NativeModules'); }, get Platform() { - return require('Platform'); + return require('../Utilities/Platform'); }, get processColor() { - return require('processColor'); + return require('../StyleSheet/processColor'); }, get requireNativeComponent() { - return require('requireNativeComponent'); + return require('../ReactNative/requireNativeComponent'); }, // Prop Types get ColorPropType() { - return require('DeprecatedColorPropType'); + return require('../DeprecatedPropTypes/DeprecatedColorPropType'); }, get EdgeInsetsPropType() { - return require('DeprecatedEdgeInsetsPropType'); + return require('../DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'); }, get PointPropType() { - return require('DeprecatedPointPropType'); + return require('../DeprecatedPropTypes/DeprecatedPointPropType'); }, get ViewPropTypes() { - return require('DeprecatedViewPropTypes'); + return require('../DeprecatedPropTypes/DeprecatedViewPropTypes'); }, }; diff --git a/Libraries/vendor/core/Map.js b/Libraries/vendor/core/Map.js index 76f27534ac651c..4f23b1f4783ab8 100644 --- a/Libraries/vendor/core/Map.js +++ b/Libraries/vendor/core/Map.js @@ -13,9 +13,9 @@ 'use strict'; -const _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection'); -const guid = require('guid'); -const toIterator = require('toIterator'); +const _shouldPolyfillES6Collection = require('./_shouldPolyfillES6Collection'); +const guid = require('./guid'); +const toIterator = require('./toIterator'); module.exports = (function(global, undefined) { // Since our implementation is spec-compliant for the most part we can safely diff --git a/Libraries/vendor/core/Set.js b/Libraries/vendor/core/Set.js index 7d713dc84d1d3a..564f530b9afd8a 100644 --- a/Libraries/vendor/core/Set.js +++ b/Libraries/vendor/core/Set.js @@ -13,10 +13,10 @@ 'use strict'; -const Map = require('Map'); +const Map = require('./Map'); -const _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection'); -const toIterator = require('toIterator'); +const _shouldPolyfillES6Collection = require('./_shouldPolyfillES6Collection'); +const toIterator = require('./toIterator'); module.exports = (function(global) { // Since our implementation is spec-compliant for the most part we can safely diff --git a/Libraries/vendor/core/merge.js b/Libraries/vendor/core/merge.js index 7dee5a09679230..a294d4af6d9d66 100644 --- a/Libraries/vendor/core/merge.js +++ b/Libraries/vendor/core/merge.js @@ -7,7 +7,7 @@ "use strict"; -const mergeInto = require('mergeInto'); +const mergeInto = require('./mergeInto'); /** * Shallow merges two structures into a return value, without mutating either. diff --git a/Libraries/vendor/core/mergeInto.js b/Libraries/vendor/core/mergeInto.js index 024289f67533f7..877c827f70d4ef 100644 --- a/Libraries/vendor/core/mergeInto.js +++ b/Libraries/vendor/core/mergeInto.js @@ -7,7 +7,7 @@ "use strict"; -var mergeHelpers = require('mergeHelpers'); +var mergeHelpers = require('./mergeHelpers'); var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg; diff --git a/Libraries/vendor/document/selection/DocumentSelectionState.js b/Libraries/vendor/document/selection/DocumentSelectionState.js index c57483dc8e31e8..577f192f50824f 100644 --- a/Libraries/vendor/document/selection/DocumentSelectionState.js +++ b/Libraries/vendor/document/selection/DocumentSelectionState.js @@ -10,7 +10,7 @@ 'use strict'; -const mixInEventEmitter = require('mixInEventEmitter'); +const mixInEventEmitter = require('../../emitter/mixInEventEmitter'); /** * DocumentSelectionState is responsible for maintaining selection information diff --git a/Libraries/vendor/emitter/EmitterSubscription.js b/Libraries/vendor/emitter/EmitterSubscription.js index c3793684164bf4..cc3138305b3490 100644 --- a/Libraries/vendor/emitter/EmitterSubscription.js +++ b/Libraries/vendor/emitter/EmitterSubscription.js @@ -10,10 +10,10 @@ 'use strict'; -const EventSubscription = require('EventSubscription'); +const EventSubscription = require('./EventSubscription'); -import type EventEmitter from 'EventEmitter'; -import type EventSubscriptionVendor from 'EventSubscriptionVendor'; +import type EventEmitter from './EventEmitter'; +import type EventSubscriptionVendor from './EventSubscriptionVendor'; /** * EmitterSubscription represents a subscription with listener and context data. diff --git a/Libraries/vendor/emitter/EventEmitter.js b/Libraries/vendor/emitter/EventEmitter.js index bd9a7cc83da11a..f3c18c91058d8e 100644 --- a/Libraries/vendor/emitter/EventEmitter.js +++ b/Libraries/vendor/emitter/EventEmitter.js @@ -11,8 +11,8 @@ 'use strict'; -const EmitterSubscription = require('EmitterSubscription'); -const EventSubscriptionVendor = require('EventSubscriptionVendor'); +const EmitterSubscription = require('./EmitterSubscription'); +const EventSubscriptionVendor = require('./EventSubscriptionVendor'); const invariant = require('invariant'); diff --git a/Libraries/vendor/emitter/EventEmitterWithHolding.js b/Libraries/vendor/emitter/EventEmitterWithHolding.js index 34e6d3d90d8aa9..945506e3c0f182 100644 --- a/Libraries/vendor/emitter/EventEmitterWithHolding.js +++ b/Libraries/vendor/emitter/EventEmitterWithHolding.js @@ -10,9 +10,9 @@ 'use strict'; -import type EmitterSubscription from 'EmitterSubscription'; -import type EventEmitter from 'EventEmitter'; -import type EventHolder from 'EventHolder'; +import type EmitterSubscription from './EmitterSubscription'; +import type EventEmitter from './EventEmitter'; +import type EventHolder from './EventHolder'; /** * @class EventEmitterWithHolding diff --git a/Libraries/vendor/emitter/EventSubscription.js b/Libraries/vendor/emitter/EventSubscription.js index b226fec6b83de8..8f767e060c405b 100644 --- a/Libraries/vendor/emitter/EventSubscription.js +++ b/Libraries/vendor/emitter/EventSubscription.js @@ -10,7 +10,7 @@ 'use strict'; -import type EventSubscriptionVendor from 'EventSubscriptionVendor'; +import type EventSubscriptionVendor from './EventSubscriptionVendor'; /** * EventSubscription represents a subscription to a particular event. It can diff --git a/Libraries/vendor/emitter/EventSubscriptionVendor.js b/Libraries/vendor/emitter/EventSubscriptionVendor.js index c82d15aca5a1e9..db44c6f3ec7adb 100644 --- a/Libraries/vendor/emitter/EventSubscriptionVendor.js +++ b/Libraries/vendor/emitter/EventSubscriptionVendor.js @@ -12,7 +12,7 @@ const invariant = require('invariant'); -import type EventSubscription from 'EventSubscription'; +import type EventSubscription from './EventSubscription'; /** * EventSubscriptionVendor stores a set of EventSubscriptions that are diff --git a/Libraries/vendor/emitter/mixInEventEmitter.js b/Libraries/vendor/emitter/mixInEventEmitter.js index d7edfe1d3cc0f5..32c2c3e7fc3a45 100644 --- a/Libraries/vendor/emitter/mixInEventEmitter.js +++ b/Libraries/vendor/emitter/mixInEventEmitter.js @@ -10,14 +10,14 @@ 'use strict'; -const EventEmitter = require('EventEmitter'); -const EventEmitterWithHolding = require('EventEmitterWithHolding'); -const EventHolder = require('EventHolder'); +const EventEmitter = require('./EventEmitter'); +const EventEmitterWithHolding = require('./EventEmitterWithHolding'); +const EventHolder = require('./EventHolder'); const invariant = require('invariant'); const keyOf = require('fbjs/lib/keyOf'); -import type EmitterSubscription from 'EmitterSubscription'; +import type EmitterSubscription from './EmitterSubscription'; const TYPES_KEY = keyOf({__types: true}); @@ -120,7 +120,7 @@ const EventEmitterMixin = { if (!this.__eventEmitter) { let emitter = new EventEmitter(); if (__DEV__) { - const EventValidator = require('EventValidator'); + const EventValidator = require('./EventValidator'); emitter = EventValidator.addValidation(emitter, this.__types); }