Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Use passive option for scroll handlers #6113

Merged
merged 6 commits into from
Jun 2, 2021

Conversation

germain-gg
Copy link
Contributor

Hinting the browser that they do not need to wait for the event listener to process before flushing the frame as we are not preventing the scroll

https://web.dev/uses-passive-event-listeners/

Particularly impactful on the TimelinePanel that fetches the data-scroll-token on every frame

Before 🐌

Screen Shot 2021-05-28 at 15 26 59

# After 🐎

Screen Shot 2021-05-28 at 15 25 32

@germain-gg germain-gg requested a review from a team May 28, 2021 14:29
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Great find, seems like it should be a nice boost. 😄

Should Tooltip.tsx have a similar change as well?

@germain-gg germain-gg requested a review from jryans June 1, 2021 13:07
@germain-gg germain-gg force-pushed the gsouquet/improve-layout-rendering branch from 344cfff to 73ca6b2 Compare June 1, 2021 13:14
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Great, this looks good to me! 😄

@germain-gg germain-gg merged commit 9d126c5 into develop Jun 2, 2021
@germain-gg germain-gg deleted the gsouquet/improve-layout-rendering branch June 2, 2021 10:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants