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

BREAKING CHANGE: Update deps #777

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

BREAKING CHANGE: Update deps #777

wants to merge 2 commits into from

Conversation

joshuaellis
Copy link
Member

@joshuaellis joshuaellis commented Jan 18, 2022

What:

  • BREAKING CHANGE: min supported version of node is 12.22
  • Updates the deps we have in the package
  • Updates the workflow for testing against node versions

Why:

How:

Checklist:

  • Documentation updated
  • Tests
  • Ready to be merged
  • Added myself to contributors table

BREAKING CHANGE: min supported version of node is 12.22
@joshuaellis
Copy link
Member Author

I don't expect this to pass on first go, but wanted to get the ball rolling @mpeyper

Also on the subject of #729, my POV is move them to devDeps and not include them as peer deps, this is what other libraries typically do from my experience. Happy to be told otherwise though.

@netlify
Copy link

netlify bot commented Jan 18, 2022

❌ Deploy Preview for react-hooks-testing-library failed.

🔨 Explore the source changes: 416d475

🔍 Inspect the deploy log: https://app.netlify.com/sites/react-hooks-testing-library/deploys/61efcdc260b71200088417d4

@joshuaellis
Copy link
Member Author

This is a strange error to have...

@mpeyper
Copy link
Member

mpeyper commented Jan 25, 2022

The rules not being found?

I believe docz (or one of the related packages) is bringing in an incorrect version of eslint which is why we had the version from kcd-scripts in our package.json to begin with.

@joshuaellis
Copy link
Member Author

I believe docz (or one of the related packages) is bringing in an incorrect version of eslint which is why we had the version from kcd-scripts in our package.json to begin with.

I think you're right. Let me add it to the PR and we'll go from there, as it's (annoyingly) not throwing said error in my env.

@mpeyper
Copy link
Member

mpeyper commented Jan 25, 2022

Also on the subject of #729, my POV is move them to devDeps and not include them as peer deps, this is what other libraries typically do from my experience. Happy to be told otherwise though.

I've just done a quick whip around of a few big react libraries written in TS that I'm aware of and it does appear to be the case that most just list the types as devDependencies and nothing else. I'm not sure if that's because their API does not expose anything from these types (although I think it's unlikely none of them expose a ReactNode or ReactElement somewhere) or if they just accept that there will be a type error when it's not installed.

The only one I could find doing it the way I'm proposing it should be done is material-ui. I'm still of the opinion that this is the the better way to handle it as it will give a peer dependency warning if the wrong version is installed, but not complain if the type dependencies are not required (e.g. non-TS users).

I've checked out generated type definitions and only @types/react would need to be a peerDependecy (and optional in peerDependenciesMeta). react-dom and react-test-renderer could just move to devDependencies as they are not referenced at all in the output.

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.

What's the reason @types are being added as dependencies as opposed to peerDependencies?
2 participants