Skip to content

Commit 7634541

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Colocate deprecated native component specs with their components
Summary: Moves the native component specs out of the legacy `specs_DEPRECATED/components` directory and into a `specs/` folder colocated with the component they belong to, under `src/private/components/<component-name>/specs/`. The directory name for each component is its public name, lowercased and without spaces (e.g. `DrawerLayoutAndroid` -> `drawerlayoutandroid`, `RefreshControl` -> `refreshcontrol`). This continues the effort described in the `specs_DEPRECATED` README of gradually moving specs out of that directory until it can be removed. Specs shared by the same public component are grouped together (e.g. `AndroidSwitchNativeComponent` and `SwitchNativeComponent` under `switch/specs`, `AndroidSwipeRefreshLayoutNativeComponent` and `PullToRefreshViewNativeComponent` under `refreshcontrol/specs`). Relative imports inside each moved spec were updated for the new depth, and every consumer (the re-export shims under `Libraries` plus the colocated `scrollview` and `safeareaview` consumers) now points at the new location. Public import paths are unchanged because the `Libraries` re-export shims are preserved. Codegen still discovers the specs since it scans the whole `src` directory. Changelog: [Internal] Differential Revision: D110472967
1 parent 6b45e57 commit 7634541

29 files changed

Lines changed: 94 additions & 94 deletions

File tree

packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent';
11+
export * from '../../../src/private/components/activityindicator/specs/ActivityIndicatorViewNativeComponent';
12+
export {default} from '../../../src/private/components/activityindicator/specs/ActivityIndicatorViewNativeComponent';

packages/react-native/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent';
11+
export * from '../../../src/private/components/drawerlayoutandroid/specs/AndroidDrawerLayoutNativeComponent';
12+
export {default} from '../../../src/private/components/drawerlayoutandroid/specs/AndroidDrawerLayoutNativeComponent';

packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent';
11+
export * from '../../../src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent';
12+
export {default} from '../../../src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent';

packages/react-native/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent';
11+
export * from '../../../src/private/components/refreshcontrol/specs/AndroidSwipeRefreshLayoutNativeComponent';
12+
export {default} from '../../../src/private/components/refreshcontrol/specs/AndroidSwipeRefreshLayoutNativeComponent';

packages/react-native/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent';
12-
import PullToRefreshViewNativeComponent from '../../../src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent';
11+
export * from '../../../src/private/components/refreshcontrol/specs/PullToRefreshViewNativeComponent';
12+
import PullToRefreshViewNativeComponent from '../../../src/private/components/refreshcontrol/specs/PullToRefreshViewNativeComponent';
1313

1414
export default PullToRefreshViewNativeComponent;

packages/react-native/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent';
11+
export * from '../../../src/private/components/safeareaview/specs/RCTSafeAreaViewNativeComponent';
12+
export {default} from '../../../src/private/components/safeareaview/specs/RCTSafeAreaViewNativeComponent';

packages/react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent';
11+
export * from '../../../src/private/components/scrollview/specs/AndroidHorizontalScrollContentViewNativeComponent';
12+
export {default} from '../../../src/private/components/scrollview/specs/AndroidHorizontalScrollContentViewNativeComponent';

packages/react-native/Libraries/Components/Switch/AndroidSwitchNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent';
11+
export * from '../../../src/private/components/switch/specs/AndroidSwitchNativeComponent';
12+
export {default} from '../../../src/private/components/switch/specs/AndroidSwitchNativeComponent';

packages/react-native/Libraries/Components/Switch/SwitchNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/SwitchNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/SwitchNativeComponent';
11+
export * from '../../../src/private/components/switch/specs/SwitchNativeComponent';
12+
export {default} from '../../../src/private/components/switch/specs/SwitchNativeComponent';

packages/react-native/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
* @format
99
*/
1010

11-
export * from '../../../src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent';
12-
export {default} from '../../../src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent';
11+
export * from '../../../src/private/components/inputaccessoryview/specs/RCTInputAccessoryViewNativeComponent';
12+
export {default} from '../../../src/private/components/inputaccessoryview/specs/RCTInputAccessoryViewNativeComponent';

0 commit comments

Comments
 (0)