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

🐛 Improve CLS and fix a bug discovered #1876 #2094

Merged
merged 3 commits into from
Feb 13, 2024
Merged

Conversation

BorghildSelle
Copy link
Contributor

@BorghildSelle BorghildSelle commented Feb 2, 2024

Measures taken to improve:

  • use window.matchMedia with change event which should improve performance instead of useWindowSize

  • On initial load of the frontpage and top image, the 10:3 aspect ratio was set, then hook for setting correct sets in later but creates a layout shift. Changed to use picture tag with mobile and desktop sources to avoid the layout shift. Ref this discussion on nextjs forum

@BorghildSelle BorghildSelle requested a review from a team as a code owner February 2, 2024 12:22
Copy link
Contributor

@millianapia millianapia left a comment

Choose a reason for hiding this comment

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

Check if usewindowsize is used anymore - if it is, approved. If not, remove and then it is approved

Copy link
Contributor

@millianapia millianapia left a comment

Choose a reason for hiding this comment

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

LGTM!

@BorghildSelle BorghildSelle merged commit 7a70cff into main Feb 13, 2024
4 checks passed
@BorghildSelle BorghildSelle deleted the bose/1876 branch February 13, 2024 09:10
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.

2 participants