You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
**Context**
Strict TypeScript API readiness: High quality inline docs should reach users via TypeScript in their IDEs.
**This diff**
Prior iterations of our Flow → TS translation stack dropped doc comments for default-exported values, and/or identifiers which change shape after type transformation (e.g. Flow `component` syntax), meaning many root APIs (`View`, `ScrollView`, `Pressable`, and others) showed no documentation on hover.
This diff extends the existing `reattachDocComments` transform to handle doc comment repositioning (suitable for the TS lang server) from a greater set of source positions:
- the exported declaration
- a `.displayName` assignment
- a HOC-wrapped inner component
- a renamed wrapper's public-named component
- a `declare const` / `declare export default typeof X` stub
**Impact**
(With the source code JSDoc improvements earlier in this stack.)
| Before (legacy types) | After (Strict API) |
| -- |
| {F1991869487} | {F1991869472} |
| ⚠️ No inline docs for many symbols | ✅ New, detailed inline docs reach the TS server 🎉 |
Changelog:
[General][Fixed] - Preserve doc comments on root API symbols in the generated TypeScript types
Differential Revision: D109316361
0 commit comments