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

Performance: lazy load menus #13141

Merged
merged 10 commits into from
Jun 21, 2024
Merged

Performance: lazy load menus #13141

merged 10 commits into from
Jun 21, 2024

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented Jun 11, 2024

This PR loads the mobile menu async using lazy and Suspense for better UX and TTI metrics. The idea is to display these interactive elements only when they are ready to be used, which mostly affects the users with a slow connection.

Details:

  • Refactor the desktop menu code: moved it to its own separate component for readability purposes
  • Lazy load mobile menu component
  • Wrapped the mobile menu (lazy loaded) + the search (sync) with Suspense to display both at the same time

@github-actions github-actions bot added the config ⚙️ Changes to configuration files label Jun 11, 2024
Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit e1abde2
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/667181b1c6c1ff0008d28f56
😎 Deploy Preview https://deploy-preview-13141--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 41 (🟢 up 3 from production)
Accessibility: 92 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Jun 11, 2024

Page Performance Accessibility Best practices SEO PWA
/en/ 🟠 50 🟢 94 🟢 93 🟢 93 🔴 38
/en/wallets/find-wallet/ 🔴 48 🟠 88 🟢 93 🟢 93 🔴 38
/en/staking/ 🔴 47 🟢 91 🟢 93 🟢 93 🔴 38
/en/whitepaper/ 🔴 48 🟢 95 🟢 93 🟢 93 🔴 38
/en/nft/ 🔴 46 🟢 95 🟢 93 🟢 93 🔴 38
/en/developers/docs/intro-to-ethereum/ 🟠 55 🟢 94 🟢 93 🟢 93 🔴 38
/en/developers/tutorials/creating-a-wagmi-ui-for-your-contract/ 🔴 45 🟠 89 🟢 93 🟢 93 🔴 38

Lighthouse scores are calculated based on the latest audit results

@pettinarip pettinarip marked this pull request as ready for review June 17, 2024 15:06
netlify.toml Outdated Show resolved Hide resolved
Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Looks good @pettinarip! Just one bug at the screen breakpoint I left a suggestion for, then can pull in

I like the use of lazy and Suspect. Found this web.dev article a handy refresher on this for anyone curious.

Remind me, did we settle on not showing any type of loading fallback here?

src/components/Nav/index.tsx Outdated Show resolved Hide resolved
src/components/Nav/index.tsx Show resolved Hide resolved
src/components/Nav/index.tsx Outdated Show resolved Hide resolved
@wackerow wackerow merged commit 5b35b39 into dev Jun 21, 2024
10 of 11 checks passed
@wackerow wackerow deleted the performance/lazy-mobile-menu branch June 21, 2024 22:21
This was referenced Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config ⚙️ Changes to configuration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants