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

React v17 lighthouse passive events #22252

Closed
2 tasks done
ilanbm opened this issue Aug 17, 2020 · 10 comments
Closed
2 tasks done

React v17 lighthouse passive events #22252

ilanbm opened this issue Aug 17, 2020 · 10 comments
Labels
external dependency Blocked by external dependency, we can’t do anything about it performance

Comments

@ilanbm
Copy link
Contributor

ilanbm commented Aug 17, 2020

Running Lighthouse on pages with Button component get "Does not use passive listeners to improve scrolling performance"
"Consider marking your touch and wheel event listeners as passive to improve your page's scroll performance"

https://web.dev/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=devtools

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Expected Behavior 🤔

Steps to Reproduce 🕹

Steps:

Context 🔦

Your Environment 🌎

Tech Version
Material-UI v5.?.?
React
Browser
TypeScript
etc.
@ilanbm ilanbm added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 17, 2020
@oliviertassinari oliviertassinari added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 17, 2020
@oliviertassinari
Copy link
Member

@ilanbm Please provide a minimal reproduction test case. This would help a lot 👷 .
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

@oliviertassinari
Copy link
Member

A duplicate of #13623 (comment)?

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 19, 2020

I have run a lighthouse run on https://next--material-ui.netlify.app/components/buttons/, the latest version, we comply to the rule:

Capture d’écran 2020-08-19 à 11 54 49

I'm closing, we need a reproduction.

@oliviertassinari oliviertassinari added performance and removed status: waiting for author Issue with insufficient information labels Aug 19, 2020
@oliviertassinari
Copy link
Member

A reproduction https://codesandbox.io/s/6kw4d (deployed on https://csb-6kw4d.netlify.app/) with React 17. See #22269 (comment) for a bit more context.

@oliviertassinari oliviertassinari changed the title Buttons cause 'Does not use passive listeners to improve scrolling performance' on Lighthouse React v17 lighthouse passive events Aug 19, 2020
@oliviertassinari
Copy link
Member

My understanding of the situation so far: facebook/react#6436 (comment).

@ilanbm
Copy link
Contributor Author

ilanbm commented Aug 19, 2020

I found that it only happens when using react@experimental , with react 16.13.1 it doesn't happen

@ilanbm
Copy link
Contributor Author

ilanbm commented Aug 19, 2020

Just read about React v17 event delegation, is there a way to set the root element to be passive?

@eps1lon
Copy link
Member

eps1lon commented Aug 19, 2020

Let's reduce this to a reproduction without any Material-UI components and then illustrate our use case. With those two code samples we can open an issue in the React repo. This will reduce the time it takes for a core member to respond.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 19, 2020

@eps1lon done, turned into facebook/react#19651

@oliviertassinari
Copy link
Member

Solved in facebook/react#19651

@oliviertassinari oliviertassinari added the external dependency Blocked by external dependency, we can’t do anything about it label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external dependency Blocked by external dependency, we can’t do anything about it performance
Projects
None yet
Development

No branches or pull requests

3 participants