Skip to content

Move testing-library/dom dependency into peerDependencies #449

Description

@lacolaco

ATL depends on TL/dom directly, but TL/user-event depends on that via peerDependencies.

https://github.com/testing-library/angular-testing-library/blob/main/projects/testing-library/package.json#L38

https://github.com/testing-library/user-event/blob/main/package.json#L73

In my project, after upgrading ATL to v16, that difference occurred version conflict errors at test. I solved that by adding TL/dom v10 to my own package.json to make TL/user-event to use v10.

I think my situation did not happen if the both libraries depend on TL/dom by the same peerDependencies way.
How do you think? Could we change this dependency? @timdeschryver

Activity

  1. timdeschryver commented on May 13, 2024

    @timdeschryver
    Member

    Yea, this is similar to testing-library/react-testing-library#1305
    Tbh, I liked that users could just install ATL and use it.
    But, I think we reached a point where we need to have it as a peerDependency.

    I was planning to do that when Angular 18 is released as this would result in a breaking change.

    In order to do this we:

    • have to move DTL to a peerDependency
    • update docs
    • install DTL on ng-add
    • provide a migration to install DTL
  2. timdeschryver commented on May 13, 2024

    @timdeschryver
    Member

    Do you think this should be done earlier? @lacolaco

  3. lacolaco commented on May 14, 2024

    @lacolaco
    ContributorAuthor

    Do you think this should be done earlier? @lacolaco

    @timdeschryver No, I don't. It seems reasonable to make this change to coincide with the release for v18.

  4. timdeschryver commented on May 25, 2024

    @timdeschryver
    Member

    This will probably land later, as the upgrade to Angular 18 isn't breaking.
    If you want to help with this feel free to drop a message and I'll create the beta branch.

  5. timdeschryver commented on Jun 21, 2024

    @timdeschryver
    Member

    For the ones that are interested, there's a WIP available in 17.0.0-beta.3, which has DTL as a peer dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions