Skip to content

Add LegacyFunction to preserve callback compatibility - #59096

Closed
SamChou19815 wants to merge 1 commit into
mainfrom
export-D125351850
Closed

SamChou19815 wants to merge 1 commit into
mainfrom
export-D125351850

Conversation

@SamChou19815

Copy link
Copy Markdown
Member

Summary:
With experimental.function_and_object_type_is_no_longer_any, Flow resolves Function to the builtin class type instead of any. Add LegacyFunction as a global compat type, following LegacyObject, and use it for the legacy callbacks in Alert, Animated, PushNotificationIOS, and Dimensions.

The TypeScript API pre-transform replaces LegacyFunction with Function, preserving the generated public API. Remove the unclear-type suppressions made unnecessary by the compat type.

Changelog: [Internal]

Differential Revision: D125351850

Summary:
With `experimental.function_and_object_type_is_no_longer_any`, Flow resolves `Function` to the builtin class type instead of `any`. Add `LegacyFunction` as a global compat type, following `LegacyObject`, and use it for the legacy callbacks in `Alert`, `Animated`, `PushNotificationIOS`, and `Dimensions`.

The TypeScript API pre-transform replaces `LegacyFunction` with `Function`, preserving the generated public API. Remove the `unclear-type` suppressions made unnecessary by the compat type.

Changelog: [Internal]

Differential Revision: D125351850
@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 Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot closed this in cb5ea03 Oct 15, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pull request has been merged in cb5ea03.

@SamChou19815
SamChou19815 deleted the export-D125351850 branch October 15, 2026 13:24
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. 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.

1 participant