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

fix: declare @types/react as optional peer dependency #5515

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

adidahiya
Copy link
Contributor

Changes proposed in this pull request:

Add @types/react as an optional peer dependency in package.json for each package that depends on those types in its generated .d.ts files.

This is in line with the approach taken by other modern OSS React UI library packages like @mui/material and react-bootstrap.

Reviewers should focus on:

If this actually fixes the problem we've been having in PNPM installs, where sometimes @types/react is not available to @blueprintjs/core to compile with tsc with skipLibCheck: false.

@adidahiya
Copy link
Contributor Author

I'm going to push this for now, at least to signal to users that we have a minimum version of @types/react required to compile with Blueprint, but we'll need to keeping thinking about more solutions to the pnpm install problem.

@adidahiya adidahiya merged commit 97ef906 into develop Aug 25, 2022
@lavrton
Copy link

lavrton commented Aug 26, 2022

Can you increase version range?
Material UI: "@types/react": "^17.0.0 || ^18.0.0",
React bootstrap: "@types/react": ">=16.14.8",.

Currently, I have this error when I install the last blueprint in react@18 project.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @blueprintjs/core@4.9.2
npm ERR! Found: @types/react@18.0.17
npm ERR! node_modules/@types/react
npm ERR!   dev @types/react@"^18.0.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @types/react@"^16.14.2" from @blueprintjs/core@4.9.2
npm ERR! node_modules/@blueprintjs/core
npm ERR!   @blueprintjs/core@"^4.9.2" from the root project
npm ERR!   @blueprintjs/core@"^4.9.2" from @blueprintjs/popover2@1.6.2
npm ERR!   node_modules/@blueprintjs/popover2
npm ERR!     @blueprintjs/popover2@"^1.6.2" from the root project
npm ERR!     1 more (@blueprintjs/select)
npm ERR!   1 more (@blueprintjs/select)
npm ERR!
npm ERR! Conflicting peer dependency: @types/react@16.14.30
npm ERR! node_modules/@types/react
npm ERR!   peerOptional @types/react@"^16.14.2" from @blueprintjs/core@4.9.2
npm ERR!   node_modules/@blueprintjs/core
npm ERR!     @blueprintjs/core@"^4.9.2" from the root project
npm ERR!     @blueprintjs/core@"^4.9.2" from @blueprintjs/popover2@1.6.2
npm ERR!     node_modules/@blueprintjs/popover2
npm ERR!       @blueprintjs/popover2@"^1.6.2" from the root project
npm ERR!       1 more (@blueprintjs/select)
npm ERR!     1 more (@blueprintjs/select)

@adidahiya adidahiya deleted the ad/fix-types-react-dependency branch August 26, 2022 16:39
@adidahiya
Copy link
Contributor Author

Sure thing @lavrton, will do ASAP

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