Closed kitten closed 2 months ago
Latest commit: 8cbd957baa731d13cd46b7193487bdce3eee315d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Context
Originally (I reckon during the introduction of
@urql/core
), we decided to only include@urql/core
as a dependency, since it never is a direct dependency. This allowed it to install automatically and deduplicate as long as all ranges match.This wasn't ever a problem assuming deduplication was working (which it sometimes isn't in Yarn Legacy). However,
@urql/core
is only actively instantiated once in any given app. This means that for all exchanges it's only used to share types.Problems with this is though,
@urql/core
's types contain instances that TypeScript will always consider as incompatible if they're duplicated. This means that this approach stopped working for TypeScript.Summary
While we could provide shared global namespace types in
@urql/core
, which is my alternative proposal to solve this, we can also mark all dependencies on@urql/core
as peer dependencies now.Generally, peer dependencies install automatically with all package managers these days. But to keep backwards compatibility we can also keep
@urql/core
independencies
at the same time. This should simply prompt package managers to always deduplicate it.This PR also removes the
>=
range on it (although it's perfectly safe, this allows us to revamp some APIs in the next major of@urql/core
), and updates thegraphql
peer dependencySet of changes
@urql/core
dependencies to also be accompanied by a peer dependency@urql/core
ranges to^5.0.0
graphql
ranges to^15.0.0 || ^16.0.0 || ^17.0.0
(dropping0.x
ranges for peers)