Boost Lighthouse Performance (Partially Fixes Issue #433) #509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lighthouse Performance & Accessibility Improvements
Summary
This PR improves Lighthouse scores across Performance, Accessibility, Best Practices, and SEO by optimizing images, adding semantic HTML, improving accessibility attributes, and enabling production source maps.
Fixes #433
Changes Made
SEO Improvements
Performance Improvements
optimizeImageutility inlib/api/image-optimization.ts/api/ens-data/image/[name]endpointBest Practices Improvements
Enabled production source maps - Added
productionBrowserSourceMaps: truetonext.config.jsto resolve Lighthouse Best Practices warning for large first-party JavaScript. Improves debugging and error tracking without impacting end users.Added main landmark - Wrapped page content in semantic
<main>element to resolve Lighthouse Best Practices warning. Improves accessibility for screen readers and assistive technologies by providing clear page structure navigation.Accessibility Improvements
Added alt tags to all images - Ensured all
Box as="img"elements have descriptive alt text across:components/Profile/index.tsxcomponents/AccountCell/index.tsxcomponents/DelegatingWidget/Header.tsxcomponents/IdentityAvatar/index.tsxFixed links without discernible names - Added
aria-labelattributes to links:components/Logo/index.tsxlayouts/main.tsxcomponents/Profile/index.tsxrel="noopener noreferrer"for security on external linksFixed touch target areas - Increased minimum size to 44×44px and added proper spacing for:
aria-hidden="true"to decorative arrow iconsFixed aria-role mismatches - Added appropriate
roleattributes:role="button"for interactive badges and action buttonsrole="group"for chart titles with tooltipsrole="group"for "Initialized"/"Locked" status indicatorsTesting
Lighthouse Score Reproduction:
Future Performance Improvements
To further boost the Performance section of Lighthouse, consider:
Eliminate forced reflows from
useWindowSizehookuseWindowSizefromreact-usewith CSS media queries orwindow.matchMediaAPIcomponents/BottomDrawer/index.tsxcomponents/DelegatingWidget/Input.tsxlayouts/account.tsxpages/treasury/[proposal].tsxpages/voting/[poll].tsxuseWindowSizehook usesResizeObserverandgetBoundingClientRect()synchronously, causing forced reflows during initial renderHost fonts internally with Next.js Font Optimization
<link>tags inpages/_document.tsxwithnext/font(Inter and Roboto Mono)Files Changed
pages/_app.tsx- Added meta descriptionnext.config.js- Enabled production source mapslib/api/image-optimization.ts- New utility for image optimizationpages/api/ens-data/image/[name].tsx- Integrated Sharp optimizationlayouts/main.tsx- Added main landmark, aria-labels, removed useWindowSizecomponents/Logo/index.tsx- Added aria-labelcomponents/Profile/index.tsx- Added alt tags and aria-labelscomponents/AccountCell/index.tsx- Added alt tagscomponents/DelegatingWidget/Header.tsx- Added alt tagscomponents/IdentityAvatar/index.tsx- Added alt tags and width/height attributespages/index.tsx- Fixed touch targets and spacingpages/orchestrators.tsx- Fixed touch targetscomponents/RoundStatus/index.tsx- Fixed aria-role mismatchescomponents/OrchestratorList/index.tsx- Fixed aria-role mismatchescomponents/ExplorerChart/index.tsx- Fixed aria-role mismatchesLighthouse scores locally before improvements
Lighthouse scores locally after improvements