Skip to content

Relocate manual .d.ts definitions under types_DEPRECATED/#57513

Open
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D110602194
Open

Relocate manual .d.ts definitions under types_DEPRECATED/#57513
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D110602194

Conversation

@huntie

@huntie huntie commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary:
See RFC0894: Removing deep imports from react-native

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: D110602194

Summary:
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: D110602194
@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 Jul 10, 2026
@meta-codesync

meta-codesync Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

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. meta-exported p: Facebook Partner: Facebook Partner

1 participant