-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Use <LoadingFrame> component to reduce content layout shift (CLS) #463
Comments
#573 includes some changes which result in a huge improvement to CLS - project and group pages now have CLS values reduced by just over 90% by using |
To close this item specifically I think we need to audit all our pages for CLS. The homepage does quite well; Lighthouse gives me 0.029, but Find Projects gives 0.26 and Find Groups gives 0.319 -- not great for either of those. So,
|
An example of how to use LoadingFrame for a page where the whole page content needs to wait for API return: https://github.com/DemocracyLab/CivicTechExchange/blob/506de6a6c74b04de7dbe1925ffe89d427171907a/common/components/controllers/AboutProjectController.jsx#L91C6-L95 not all pages can return error codes, but for ones that do follow this pattern. Show either a load or error message if API request data hasn't been returned yet, render the page when it has. And for an individual component which has to wait: I think almost all uses will be the first example (page content level) rather than component, but both are viable. Any further SEO or CLS fixes can go in another branch. Let's just reuse our existing components for now. |
Google is flagging us for a low CLS score
https://web.dev/cls/
https://trello.com/c/IykqFcaE
The text was updated successfully, but these errors were encountered: