Skip to content

Remove __DEV__ stubs for previously-removed legacy modules#57025

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D106640956
Closed

Remove __DEV__ stubs for previously-removed legacy modules#57025
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D106640956

Conversation

@rubennorte

Copy link
Copy Markdown
Contributor

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:

  • AsyncStoragereact-native-async-storage/async-storage
  • ImagePickerIOSreact-native-image-picker or expo-image-picker
  • ProgressViewIOSreact-native-community/progress-view
  • DatePickerIOSreact-native-community/datetimepicker
  • Sliderreact-native-community/slider

Changelog: [Internal]

Differential Revision: D106640956

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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 1, 2026
@meta-codesync

meta-codesync Bot commented Jun 1, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106640956.

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 1, 2026
@meta-codesync meta-codesync Bot closed this in a18f53d Jun 1, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Jun 1, 2026
@meta-codesync

meta-codesync Bot commented Jun 1, 2026

Copy link
Copy Markdown

This pull request has been merged in a18f53d.

@react-native-bot

Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants