Skip to content

Publish top-level Flow types for react-native #51908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

aswinandro
Copy link
Contributor

@aswinandro aswinandro commented Jun 9, 2025

FIXED Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.

Summary:

Changelog:

[General][Added] Publish top-level Flow types for react-native

Test Plan:

Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 9, 2025
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@robhogan robhogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aswinandro :)

(Quite rare to see a Flow user outside Meta these days tbh!)

@robhogan robhogan changed the title fixes-#40314 - as Only Package.json change Publish top-level Flow types for react-native Jun 9, 2025
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 12, 2025
@facebook-github-bot
Copy link
Contributor

@robhogan merged this pull request in 50667ec.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @aswinandro in 50667ec

When will my fix make it into a release? | How to file a pick request?

react-native-bot pushed a commit that referenced this pull request Jun 16, 2025
Summary:
FIXED Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.

## Changelog:

[General][Added] Publish top-level Flow types for `react-native`

Pull Request resolved: #51908

Reviewed By: huntie, necolas

Differential Revision: D76292301

Pulled By: robhogan

fbshipit-source-id: e56360d3f35af30ef160470181349aac1812e7c1
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @aswinandro in ea6abb6

When will my fix make it into a release? | How to file a pick request?

@@ -81,6 +81,7 @@
"gradle.properties",
"gradle/libs.versions.toml",
"index.js",
"index.flow.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be index.js.flow

Copy link
Contributor

@robhogan robhogan Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@buschco You're absolutely right, thanks for spotting this. Do you want to open a PR and tag me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done #52179

react-native-bot pushed a commit that referenced this pull request Jun 23, 2025
Summary:
FIXED Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.

## Changelog:

[General][Added] Publish top-level Flow types for `react-native`

Pull Request resolved: #51908

Reviewed By: huntie, necolas

Differential Revision: D76292301

Pulled By: robhogan

fbshipit-source-id: e56360d3f35af30ef160470181349aac1812e7c1
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @aswinandro in 2cb1f8e

When will my fix make it into a release? | How to file a pick request?

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants