Skip to content

Add @types/react as optional peerDependency on packages that use it - #43509

Closed
acoates-ms wants to merge 3 commits into
react:mainfrom
acoates-ms:peerreacttypes
Closed

Add @types/react as optional peerDependency on packages that use it#43509
acoates-ms wants to merge 3 commits into
react:mainfrom
acoates-ms:peerreacttypes

Conversation

@acoates-ms

Copy link
Copy Markdown
Contributor

Now that RN is providing TS type information, many of those .d.ts files depend on types from react. In modern packagemanagers (Ex: pnpm) @types/react will not be available to RN since it does not declare it as a dependency.

I also noticed that the types for react-native-popup-menu-android appear to be pointing to the wrong location.

Summary:

Add @types/react as a peerDependency on the packages that have .d.ts files that import from React.
Add @types/react to peerDependencyMeta with optional:true to prevent users not using TS from requiring @types/react.

Changelog:

[GENERAL] [ADDED] Added @types/react as an optional peerDependency

@facebook-github-botfacebook-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. p: Microsoft Partner: Microsoft Partner labels Mar 15, 2024
@github-actions

github-actionsBot commented Mar 15, 2024

Copy link
Copy Markdown
Warnings
⚠️🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.
⚠️📋 Missing Test Plan - Can you add a Test Plan? To do so, add a "## Test Plan" section to your PR description. A Test Plan lets us know how these changes were tested.

Generated by 🚫 dangerJS against 315fc10

@facebook-github-botfacebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 15, 2024
@analysis-bot

analysis-bot commented Mar 15, 2024

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a18,110,053-13
androidhermesarmeabi-v7an/a--
androidhermesx86n/a--
androidhermesx86_64n/a--
androidjscarm64-v8a21,475,090+23
androidjscarmeabi-v7an/a--
androidjscx86n/a--
androidjscx86_64n/a--

Base commit: 1021448
Branch: main

Comment threadpackages/react-native-popup-menu-android/package.json Outdated
Comment on lines +10 to +11
export type {default} from './js/PopupMenuAndroid';
export type {PopupMenuAndroidInstance} from './js/PopupMenuAndroid';

@NickGerlemanNickGerlemanMar 22, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! FYI @RSNara

@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@NickGerleman merged this pull request in dbf8e3f.

@facebook-github-botfacebook-github-bot added the Merged This PR has been merged. label Mar 25, 2024
@acoates-ms
acoates-ms deleted the peerreacttypes branch March 27, 2024 16:20
huntie pushed a commit that referenced this pull request Apr 2, 2024
…43509)
Summary:
Now that RN is providing TS type information, many of those .d.ts files depend on types from react. In modern packagemanagers (Ex: pnpm) types/react will not be available to RN since it does not declare it as a dependency.
I also noticed that the types for react-native-popup-menu-android appear to be pointing to the wrong location.
Add types/react as a peerDependency on the packages that have .d.ts files that import from React.
Add types/react to peerDependencyMeta with optional:true to prevent users not using TS from requiring types/react.
[GENERAL] [ADDED] Added types/react as an optional peerDependency
Pull Request resolved: #43509
Reviewed By: cortinico
Differential Revision: D55225940
Pulled By: NickGerleman
fbshipit-source-id: 4cbab071928cb925baec45f55461559acc9a54e6
This was referenced Jun 28, 2024
@cipolleschicipolleschi mentioned this pull request Jul 22, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.p: MicrosoftPartner: MicrosoftPartnerShared with MetaApplied 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.

4 participants

@acoates-ms@analysis-bot@facebook-github-bot@NickGerleman