Skip to content

Conversation

sheerun
Copy link
Contributor

@sheerun sheerun commented Oct 9, 2018

Now that jest-dom supports node environment I could add support for it to this package as well.

Fixes #100

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Thanks! This looks fine, but I would prefer that mutationobserver-shim is changed rather than putting all of this code on us to maintain separately.

"typings"
],
"dependencies": {
"mutationobserver-shim": "^0.3.2",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this file now vendored rather than a regular dep? If it needs a change, I'd prefer that dep be updated first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it mutates window directly instead of exporting MutationObserver. It needs to be this way or you need to fork this project and use what I created in this repository (i.e. prevent assigning MutationObserver to window + check if typeof window !== 'undefined' before using window

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This dep is not maintained and not updated for 2 years

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you really don't want to put it in this repository I suggest forking it and publishing under @kentcdodds/mutationobserver-shim send PR there and use your version for now. I think vendor is OK personally

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. How about this, you publish a fork yourself and we can use that 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

The mutation observer polyfill is the only thing that breaks when you import dtl in a non-DOM environment. It would be great to make it not break to allow modules to consume/extend queries without going through dist/.

@sheerun
Copy link
Contributor Author

sheerun commented Oct 9, 2018

@kentcdodds Pushed change that points to my work instead of vendor

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks!

@kentcdodds kentcdodds merged commit 1b12385 into testing-library:master Oct 9, 2018
@kentcdodds
Copy link
Member

Would you like to add yourself to the contributors table?

@sheerun
Copy link
Contributor Author

sheerun commented Oct 9, 2018

it's ok, next time

@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.8.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kentcdodds
Copy link
Member

Sorry, this busted some stuff and I don't have time to investigate what's going on, so I'm going to revert this commit.

kentcdodds pushed a commit that referenced this pull request Oct 9, 2018
kentcdodds pushed a commit that referenced this pull request Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants