Skip to content

Align public type for Touchable#57419

Closed
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D110483989
Closed

Align public type for Touchable#57419
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D110483989

Conversation

@huntie

@huntie huntie commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary:
Problem

Under the Strict TypeScript API, Touchable was a value-only TypeScript export referencing TouchableImpl, which leaked additional {Mixin, renderDebugView} members.

Fix

Export a declaration-merged Touchable type at root, specifying a public interface for this module that excludes these members.

Impact

  • API snapshot cleanup: Hides internal TouchableImpl and TouchableMixinImpl details.
  • Functional: Removes Touchable.renderDebugView() from the public API. This is non-breaking as this type was not previously modelled under the manual TS types.
  • Functional: Fixes equivalence of Touchable when referenced as a type under Uniwind — which was a breaking change vs the manual TS types (extra props were leaked).

https://github.com/uni-stack/uniwind/blob/6b498f2ada673d2b92915c79a703286078b953c2/packages/uniwind/types.d.ts#L40

Notes

  • As part of this change, other Libraries//*Impl APIs were audited to check for similar internal API leaks. This is the only obvious instance.
  • Also simplify outdated doc comment (Touchable subtypes are intended for primary use and have separate docs pages).

Changelog:
[General][Fixed] - Strict TypeScript API: Export a public Touchable type object, reducing its API to match the previous manual types

Differential Revision: D110483989

Summary:
**Problem**

Under the Strict TypeScript API, `Touchable` was a value-only TypeScript export referencing `TouchableImpl`, which leaked additional `{Mixin, renderDebugView}` members.

**Fix**

Export a declaration-merged `Touchable` type at root, specifying a public interface for this module that excludes these members.

**Impact**

- API snapshot cleanup: Hides internal `TouchableImpl` and `TouchableMixinImpl` details.
- **Functional**: Removes `Touchable.renderDebugView()` from the public API. This is **non-breaking** as this type was not previously modelled under the manual TS types.
- **Functional**: Fixes equivalence of `Touchable` when referenced as a type under Uniwind — which was a breaking change vs the manual TS types (extra props were leaked).

https://github.com/uni-stack/uniwind/blob/6b498f2ada673d2b92915c79a703286078b953c2/packages/uniwind/types.d.ts#L40

**Notes**

- As part of this change, other `Libraries/`/`*Impl` APIs were audited to check for similar internal API leaks. This is the only obvious instance.
- Also simplify outdated doc comment (`Touchable` subtypes are intended for primary use and have separate docs pages).

Changelog:
[General][Fixed] - **Strict TypeScript API**: Export a public `Touchable` type object, reducing its API to match the previous manual types

Differential Revision: D110483989
@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 2, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jul 2, 2026
@meta-codesync

meta-codesync Bot commented Jul 2, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@huntie huntie closed this Jul 2, 2026
@huntie huntie deleted the export-D110483989 branch July 2, 2026 16:26
huntie added a commit to huntie/react-native that referenced this pull request Jul 7, 2026
Summary:

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / react#57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985
huntie added a commit to huntie/react-native that referenced this pull request Jul 7, 2026
Summary:

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / react#57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985
meta-codesync Bot pushed a commit that referenced this pull request Jul 7, 2026
Summary:
Pull Request resolved: #57420

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / #57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985

fbshipit-source-id: 394e3996bb45482723a4b7b18c1cf63f49cb49c5
huntie added a commit to huntie/react-native that referenced this pull request Jul 8, 2026
Summary:

NOTE: Resubmission of D110488985.


**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / react#57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549
huntie added a commit to huntie/react-native that referenced this pull request Jul 8, 2026
Summary:

NOTE: Resubmission of D110488985.


**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / react#57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549
meta-codesync Bot pushed a commit that referenced this pull request Jul 8, 2026
Summary:
Pull Request resolved: #57476

NOTE: Resubmission of D110488985.

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which is undocumented.

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24

https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986

Replaces D110483989 / #57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, which is a suitable replacement.

Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.

- uni-stack/uniwind#592.

Changelog:
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549

fbshipit-source-id: bf29ae826d34fb04889b9f56de0f11904fce3f53
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