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

Updated matchMedia methods #8835

Merged
merged 4 commits into from
Aug 16, 2019
Merged

Updated matchMedia methods #8835

merged 4 commits into from
Aug 16, 2019

Conversation

Maxim-Mazurok
Copy link
Contributor

addListener and removeListener are deprecated in a favor of addEventListener and removeEventListener.

From MediaQueryList/addListener

This (addListener) is basically an alias for EventTarget.addEventListener(), for backwards compatibility purposes.

They are supported by all major browsers: EventTarget/addEventListener

BTW, TSLint is producing the following error when trying to use addListener:

ERROR: /app/Component.tsx:xx:xx - addListener is deprecated.

`addListener` and `removeListener` are deprecated in favor of `addEventListener` and `removeEventListener`
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@SimenB
Copy link
Member

SimenB commented Aug 16, 2019

Thanks! Could you sign the CLA and update the versioned docs as well?

image

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@Maxim-Mazurok
Copy link
Contributor Author

@SimenB done :)

By the way, since MediaQueryList extends EventTarget, there's also removeEventListener method missing. Should I add it in this same PR?

@SimenB
Copy link
Member

SimenB commented Aug 16, 2019

@SimenB done :)

Just missing https://github.com/facebook/jest/blob/master/website/versioned_docs/version-22.x/ManualMocks.md and we're good to go 🙂

By the way, since MediaQueryList extends EventTarget, there's also removeEventListener method missing. Should I add it in this same PR?

Sure, sounds good!

@Maxim-Mazurok
Copy link
Contributor Author

Just missing https://github.com/facebook/jest/blob/master/website/versioned_docs/version-22.x/ManualMocks.md and we're good to go

Actually, this file doesn't have "Mocking methods which are not implemented in JSDOM" section, so there's nothing to fix there.

Sure, sounds good!

Done, in both files :)

@SimenB SimenB merged commit e76c7da into jestjs:master Aug 16, 2019
@SimenB
Copy link
Member

SimenB commented Aug 16, 2019

Thanks!

@Maxim-Mazurok Maxim-Mazurok deleted the patch-1 branch August 16, 2019 12:15
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants