Skip to content

Commit e70413d

Browse files
committed
[standards] Rewrite imports in RNTester to use standard paths
See #24316 for the motivation. This commit rewrites the imports in the RNTester project. Test Plan: Run RNTester and verify that it loads without any issues. Tap through each screen to ensure the JS modules load (that is, were bundled) correctly.
1 parent 0f909e3 commit e70413d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+148
-129
lines changed

RNTester/NativeModuleExample/NativeScreenshotManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
'use strict';
1212

13-
import type {TurboModule} from 'RCTExport';
14-
import * as TurboModuleRegistry from 'TurboModuleRegistry';
13+
import type {TurboModule} from '../../Libraries/TurboModule/RCTExport';
14+
import * as TurboModuleRegistry from '../../Libraries/TurboModule/TurboModuleRegistry';
1515

1616
export interface Spec extends TurboModule {
1717
+getConstants: () => {||};

RNTester/RCTTest/RCTSnapshotNativeComponent.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
'use strict';
1212

13-
import type {SyntheticEvent} from 'CoreEventTypes';
14-
import type {ViewProps} from 'ViewPropTypes';
15-
import type {NativeComponent} from 'ReactNative';
13+
import type {SyntheticEvent} from '../../Libraries/Types/CoreEventTypes';
14+
import type {ViewProps} from '../../Libraries/Components/View/ViewPropTypes';
15+
import type {NativeComponent} from '../../Libraries/Renderer/shims/ReactNative';
1616

1717
type SnapshotReadyEvent = SyntheticEvent<
1818
$ReadOnly<{
@@ -28,7 +28,7 @@ type NativeProps = $ReadOnly<{|
2828

2929
type SnapshotViewNativeType = Class<NativeComponent<NativeProps>>;
3030

31-
const requireNativeComponent = require('requireNativeComponent');
31+
const requireNativeComponent = require('../../Libraries/ReactNative/requireNativeComponent');
3232

3333
module.exports = ((requireNativeComponent(
3434
'RCTSnapshot',

RNTester/js/AnimatedGratuitousApp/AnExApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const React = require('react');
1414
const ReactNative = require('react-native');
1515
const {Animated, LayoutAnimation, PanResponder, StyleSheet, View} = ReactNative;
1616

17-
const AnExSet = require('AnExSet');
17+
const AnExSet = require('./AnExSet');
1818

1919
const CIRCLE_SIZE = 80;
2020
const CIRCLE_MARGIN = 18;

RNTester/js/AssetScaledImageExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const React = require('react');
1414
const ReactNative = require('react-native');
1515
const {Image, StyleSheet, View, ScrollView} = ReactNative;
1616

17-
import type {PhotoIdentifier} from 'CameraRoll';
17+
import type {PhotoIdentifier} from '../../Libraries/CameraRoll/CameraRoll';
1818

1919
type Props = $ReadOnly<{|
2020
asset: PhotoIdentifier,

RNTester/js/CameraRollExample.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ const CameraRollView = require('./CameraRollView');
2828

2929
const AssetScaledImageExampleView = require('./AssetScaledImageExample');
3030

31-
import type {PhotoIdentifier, GroupTypes} from 'CameraRoll';
31+
import type {
32+
PhotoIdentifier,
33+
GroupTypes,
34+
} from '../../Libraries/CameraRoll/CameraRoll';
3235

3336
type Props = $ReadOnly<{|
3437
navigator?: ?Array<

RNTester/js/CameraRollView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const {
2424
View,
2525
} = ReactNative;
2626

27-
const groupByEveryN = require('groupByEveryN');
28-
const logError = require('logError');
27+
const groupByEveryN = require('../../Libraries/Utilities/groupByEveryN');
28+
const logError = require('../../Libraries/Utilities/logError');
2929

3030
import type {
3131
PhotoIdentifier,
3232
PhotoIdentifiersPage,
3333
GetPhotosParams,
34-
} from 'CameraRoll';
34+
} from '../../Libraries/CameraRoll/CameraRoll';
3535

3636
type Props = $ReadOnly<{|
3737
/**

RNTester/js/FlatListExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
import type {Item} from './ListExampleShared';
1414

15-
const Alert = require('Alert');
15+
const Alert = require('../../Libraries/Alert/Alert');
1616
const React = require('react');
1717
const ReactNative = require('react-native');
1818
const {Animated, StyleSheet, View} = ReactNative;
1919

2020
const RNTesterPage = require('./RNTesterPage');
2121

22-
const infoLog = require('infoLog');
22+
const infoLog = require('../../Libraries/Utilities/infoLog');
2323

2424
const {
2525
FooterComponent,

RNTester/js/ImageCapInsetsExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
const React = require('react');
1414
const ReactNative = require('react-native');
1515

16-
const nativeImageSource = require('nativeImageSource');
16+
const nativeImageSource = require('../../Libraries/Image/nativeImageSource');
1717
const {Image, StyleSheet, Text, View} = ReactNative;
1818

1919
type Props = $ReadOnly<{||}>;

RNTester/js/InputAccessoryViewExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
const React = require('React');
13+
const React = require('react');
1414
const ReactNative = require('react-native');
1515
const {
1616
Alert,

RNTester/js/KeyboardAvoidingViewExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
const React = require('React');
12+
const React = require('react');
1313
const ReactNative = require('react-native');
1414
const {
1515
KeyboardAvoidingView,

0 commit comments

Comments
 (0)