Remove __DEV__ stubs for previously-removed legacy modules#57025
Closed
rubennorte wants to merge 1 commit into
Closed
Remove __DEV__ stubs for previously-removed legacy modules#57025rubennorte wants to merge 1 commit into
rubennorte wants to merge 1 commit into
Conversation
Summary:
The following modules were removed from `react-native` core years ago: `AsyncStorage`, `ImagePickerIOS`, `ProgressViewIOS`, `DatePickerIOS`, and `Slider`. Until now, accessing them from `react-native` triggered a `__DEV__`-only invariant that threw a helpful error directing users to the community package replacement.
Enough release cycles have passed that the friendly invariant is no longer needed. This commit removes the five `Object.defineProperty(module.exports, …)` blocks from `index.js`, along with the wrapping `if (__DEV__) { … }` shell and the now-unused `invariant` import.
After this change, accessing one of these names from `react-native` returns `undefined` (matching the behavior of any other non-exported name).
Replacement packages, for reference:
- `AsyncStorage` → `react-native-async-storage/async-storage`
- `ImagePickerIOS` → `react-native-image-picker` or `expo-image-picker`
- `ProgressViewIOS` → `react-native-community/progress-view`
- `DatePickerIOS` → `react-native-community/datetimepicker`
- `Slider` → `react-native-community/slider`
Changelog: [Internal]
Differential Revision: D106640956
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106640956. |
|
This pull request has been merged in a18f53d. |
Collaborator
|
This pull request was successfully merged by @rubennorte in a18f53d When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The following modules were removed from
react-nativecore years ago:AsyncStorage,ImagePickerIOS,ProgressViewIOS,DatePickerIOS, andSlider. Until now, accessing them fromreact-nativetriggered a__DEV__-only invariant that threw a helpful error directing users to the community package replacement.Enough release cycles have passed that the friendly invariant is no longer needed. This commit removes the five
Object.defineProperty(module.exports, …)blocks fromindex.js, along with the wrappingif (__DEV__) { … }shell and the now-unusedinvariantimport.After this change, accessing one of these names from
react-nativereturnsundefined(matching the behavior of any other non-exported name).Replacement packages, for reference:
AsyncStorage→react-native-async-storage/async-storageImagePickerIOS→react-native-image-pickerorexpo-image-pickerProgressViewIOS→react-native-community/progress-viewDatePickerIOS→react-native-community/datetimepickerSlider→react-native-community/sliderChangelog: [Internal]
Differential Revision: D106640956