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

fix: Debounce the resize observer to help with window resizing #18853

Closed
wants to merge 12 commits into from

Conversation

benjackwhite
Copy link
Contributor

Problem

We currently fire a lot of re-rendering on resizing which can make things feel really sluggish. Most of the time we don't need this to be "real time" so we can have a slight delay

Changes

  • Implements a debounce in the observer by default

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

@benjackwhite benjackwhite requested a review from a team November 23, 2023 13:28
Copy link
Contributor

github-actions bot commented Nov 23, 2023

Size Change: +147 B (0%)

Total Size: 1.83 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.83 MB +147 B (0%)

compressed-size-action

@Twixes
Copy link
Member

Twixes commented Nov 23, 2023

This feel better than I thought it would!

@benjackwhite
Copy link
Contributor Author

This feel better than I thought it would!

Yeah, the slight delay in some things correctly rendering is made up for immediately by things actually reacting to the viewport changes 😅

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@Twixes
Copy link
Member

Twixes commented Dec 7, 2023

Looks like funnel bars don't want to stop resizing in Storybook after this @benjackwhite 🤔

@benjackwhite
Copy link
Contributor Author

Yeah its why this is going stale because I can't figure it out...

@Twixes Twixes removed the stale label Dec 7, 2023
@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

@Twixes Twixes deleted the fix/debounc-resizes branch June 13, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants