Commit 5327b47
Relocate manual .d.ts definitions under types_DEPRECATED/ (#57513)
Summary:
Pull Request resolved: #57513
See [**RFC0894: Removing deep imports from react-native**](react-native-community/discussions-and-proposals#894)
**Changes**
Rename the hand-written `types/` directory to `types_DEPRECATED/` and consolidate the co-located `.d.ts` declarations beneath it.
- This is a pure relocation with **no change** to the public type surface. The package `"exports"` map is updated so that every `types` condition resolves to the new location (`.` → `./types_DEPRECATED/index.d.ts`, `./Libraries/*` → `./types_DEPRECATED/Libraries/*.d.ts`) — consumers resolve the exact same types and runtime modules through the same import specifiers.
- Relative imports between the moved declarations, and the references from the moved `types/` files into `Libraries/`, were rewritten so the type graph continues to resolve.
**Downsides**
Risk of structural code drift if/when source modules in `Libraries/` move around.
**Counterpoint**: The aim here is to feature-lock the legacy JS API and remove deep `Libraries/` imports by projects.
Changelog: [Internal]
Differential Revision: D1106021941 parent 22cfb5c commit 5327b47
99 files changed
Lines changed: 229 additions & 212 deletions
File tree
- packages/react-native
- __typetests__
- src/types
- types_DEPRECATED
- Libraries
- ActionSheetIOS
- Alert
- Animated
- AppState
- BatchedBridge
- Components
- AccessibilityInfo
- ActivityIndicator
- Clipboard
- DrawerAndroid
- Keyboard
- LayoutConformance
- Pressable
- ProgressBarAndroid
- RefreshControl
- SafeAreaView
- ScrollView
- StatusBar
- Switch
- TextInput
- ToastAndroid
- Touchable
- View
- Core
- EventEmitter
- Image
- Interaction
- LayoutAnimation
- Linking
- Lists
- LogBox
- Modal
- NativeComponent
- Performance
- PermissionsAndroid
- PushNotificationIOS
- ReactNative
- Settings
- StyleSheet
- Text
- TurboModule
- Types
- Utilities
- Vibration
- vendor
- core
- emitter
- modules
- private
- public
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
This file was deleted.
0 commit comments