Skip to content
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

Drop @types/react peer dependency from ^18.2.25 to ^18.0 #2211

Conversation

simonepizzamiglio
Copy link

Overview

According to the DefinitelyTyped project FAQ here, @types dependencies should align with the MAJOR.MINOR of the source project, while the PATCH version is managed independently.

Because the version is listed as 20.8.9999, the npm version of the @types/node package will also be 20.8.x. Note that the version in package.json should only contain major.minor version (e.g. 10.12) followed by .9999. This is because only the major and minor release numbers are aligned between library packages and type declaration packages.

This alignment helps prevent dependency duplication in the node_modules folder, particularly for projects using pinned or tilde versions.

Below is an example of a project with the @types/react dependency version lower than the one required by the current react-redux project peer dependency.
This is the output of running yarn install:

Screenshot 2024-11-26 at 16 16 25

Here is is the output of running yarn explain peer-requirements <hash>:

Screenshot 2024-11-26 at 16 32 07

This output advises the user to update their dependencies to match those required by react-redux in order to avoid duplication.

This PR

  • drops @types/react peer dependency from ^18.2.25 to ^18.0

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@timdorr
Copy link
Member

timdorr commented Nov 26, 2024

Are we dependent on anything from 18.1 or 18.2?

@markerikson
Copy link
Contributor

I'm not sure. I feel like there was something in 18.2-ish that mattered when we made that change, but I don't remember the specifics.

@timdorr
Copy link
Member

timdorr commented Nov 26, 2024

#2092 I think?

@markerikson
Copy link
Contributor

Ah, yes, that sounds right.

Given that I think we should close this. Thanks anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants