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

Revert "Add peer dependency to User Event docs" #1329

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/ecosystem-user-event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ fixes and new features.
<TabItem value="npm">

```sh
npm install --save-dev @testing-library/user-event @testing-library/dom
npm install --save-dev @testing-library/user-event
```

</TabItem>
<TabItem value="yarn">

```sh
yarn add --dev @testing-library/user-event @testing-library/dom
yarn add --dev @testing-library/user-event
```

</TabItem>
Expand Down
9 changes: 0 additions & 9 deletions docs/user-event/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ yarn add --dev @testing-library/user-event

</TabItem>
</Tabs>

Note that `@testing-library/user-event` requires `@testing-library/dom`.

If you use one of the
[framework wrappers](../dom-testing-library/install.mdx#wrappers), it is
important that `@testing-library/dom` is resolved to the same installation
required by the framework wrapper of your choice.
Usually this means that if you use one of the framework wrappers, you should not
add `@testing-library/dom` to your project dependencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this note.
When people upgrade e.g. their version of @testing-library/react the @testing-library/dom package isn't always deduplicated. I'd rather add examples how to diagnose and fix this to further reduce retyped text when I suspect this to be the root of someeone's problem (e.g. "user-event only types the first N characters").

Copy link
Member Author

@nickserv nickserv Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you suggesting we revert this deletion and add examples of specific use cases? Could you please give some examples? Peer dependency management is in a much better state than it used to be, and I'm not sure it's worth the maintenance burden of us documenting anymore. I want to either document more use cases which I believe isn't worth the effort, or remove this as no documentation is usually better than outdated or inaccurate documentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would keep this paragraph on duplicate versions of /dom.
I'm under the impression this ranks as the second most common reason for act warnings and wrong input with UserEvent after missing await. Both isn't our fault and should not happen, but it does and we still have to deal with people running into these problems.
Therefore I'd like to have a section I can point to if I suspect this problem. The exact combinations of packages and package managers change over time and maintaining a list of them is out of scope of our docs. But if we feel that this paragraph isn't perspicuous, maybe we should add some explanation/example.