Skip to content

[Chore] Fix our peer dependency warnings #418

@arcanis

Description

@arcanis

We have various peer dependency warnings displayed when running yarn install inside our own repository. It would be great if we could fix the upstream packages to stop it from happening, as it's a matter of time before it causes more serious issues:

image

Given a warning:

X doesn't provide Y requested by Z

The best fix is generally to either:

  • Upgrade the faulty package in our codebase to get rid of the warning. Some of those may have already been fixed.

    • For example, upgrading Gatsby might fix the 2.0.0-printer-fix.2 error.
  • Mark Y as an optional peer dependency in Z, if Z doesn't need Y to work. If Z's maintainers are concerned about potential warnings being shown to their users, tell them that optional peer dependencies are supported by Yarn, npm 6.1+, and pnpm. It's a feature they should use.

  • Add Y as a peer dependency of X. This will move the warning up by one level, but by doing this it's possible that the peer dependency will be met in a satisfying way. For example, if react-bar as a peer depencency on react and is a dependency of react-foo, then you can add react to the peer dependencies of react-foo. Then it'll be up to whoever depends on react-foo to depends on react as well.

    • For example, I strongly suspect it's the case of jest-jasmine2 which should have a peer dependency on jest-haste-map.
  • Add Y as regular dependency of X if it's just a matter of a peer dependency having been omitted by mistake.

    • For example, html-react-parser should probably have regular dependencies on both object-assign and fbjs to satisfy the requirements of react-dom-core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions