Skip to content

Commit 142b617

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Hide src/ directory from TypeScript (#57277)
Summary: Pull Request resolved: #57277 **Motivation** Incremental progress towards restricting React Native's internal JavaScript source code. - `src/private/` was added relatively recently, with very little OSS code depending on it — we can action earlier. - Helps to reduce the increasingly complicated state of our root `"exports"` map. **Changes** Resolve to `null` for the `"types"` package exports condition — this hides from TypeScript suggestions/auto-import. - **Breaking**: TypeScript's language server will no longer be able to see these modules, and projects will need a `// $TSIgnore` on these imports. - The ability to access these modules is unchanged: they remain present in the bundle and accessible by Metro. Changelog: [General][Breaking] - Deep imports to `'react-native/src/private/...'` have been restricted, and are no longer visible to TypeScript. These subpaths still exist, but do not have type coverage. Reviewed By: rubennorte Differential Revision: D109018821 fbshipit-source-id: bcf6abb1cce481021edee2305a875123694a8134
1 parent cd0d93a commit 142b617

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"./scripts/*": "./scripts/*",
5151
"./src/*": {
52-
"react-native-strict-api": null,
52+
"types": null,
5353
"default": "./src/*.js"
5454
},
5555
"./types/*.d.ts": {

0 commit comments

Comments
 (0)