Skip to content

Dependencies on @types/* requires just as much user attention as not having the dependency #620

Closed
@eps1lon

Description

@eps1lon

The goal of having @types/ in our dependencies is so that users don't have to manually add them.

This has four downsides:

  1. Assuming best case scenario where @types/testing-library__dom is up-to-date: @testing-library/dom gets an update. We yarn upgrade @testing-library/dom. @types/testing_library__dom is not automatically updated because of lockfiles. Same issue with yarn add @testing-library@the-new-version-release
  2. To get an update, downstream consumers either have to nuke their lockfile (bad) or manually bump them. Automatic solutions like renovate or dependabot do not update transitive dependencies but only top-level ones. This means @types/testing_libray__dom won't get automatic updates.
  3. On a major we have to do a lot of manual maintenance to get types to downstream packages: Release major, Update types, update @types/testing-library__dom in our packages.json (fix: Bump types dom-testing-library#495)
  4. We depend on @types/testing-library__dom twice: Once by depending on @testing-library/dom -> @types/testing-library__dom and by depending on @types/testing-library__react -> @types/testing-library__dom. This could result in two different versions of @types/testing-library__dom. Can be resolved by nuking lockfile or npx yarn-deduplicate.

All of these issues can be resolved manually but require a lot more knowledge than "add @types/testing-library__react to your dev-dependencies" which is already the standard in the ecosystem.

I propose we get rid of the entry and advise users to manually add it. This is a lot easier since it's what typescript users are already used to (adding @types/ to devDependencies) vs requiring to maintain their lockfile.

This is a breaking change for type consumers. Type related breaking changes are a lot less severe since every type related change is a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs discussionWhether changes are needed is still undecided and additional discussion is needed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions