-
Notifications
You must be signed in to change notification settings - Fork 29
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
refactor(lib-content): reduce home and about page load times #6255
refactor(lib-content): reduce home and about page load times #6255
Conversation
bdcfcc1
to
ebd61ab
Compare
bce80b9
to
a83b45f
Compare
Use `YouTubeEmbed`, from `@next/third-parties/google`, for video embeds on the home page. This should reduce the JS download size by ~2.5MB per video.
a83b45f
to
19c0f47
Compare
- use `lite-youtube-embed`. - lazy load offscreen images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this!
fit='cover' | ||
src={imageSrc} | ||
alt={title} | ||
loading='lazy' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not listed in Grommet's docs but does get passed on to the html element (loading) 👍
allowfullscreen | ||
width='100%' | ||
videoid='F-B8gXJyMHc' | ||
title='A Brief Introduction to the Zooniverse' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page has a translations dictionary. I'll add this string to it.
allowFullScreen | ||
width='100%' | ||
videoid='F-B8gXJyMHc' | ||
title='A Brief Introduction to the Zooniverse' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'll put this in the translations dictionary.
['CaTNIoJy4Dg', 'Around the Zoo – Planet Hunters TESS'], | ||
['8lZiZoBcMjE', 'Around the Zoo – Wildcam Gorongosa'], | ||
['B6diEbpEblQ', 'Around the Zoo – Backyard Worlds'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not going to include these in the translations dictionary because it's a uniquely named series with Zooniverse project titles.
Use
YouTubeEmbed
, from@next/third-parties/google
, for video embeds on the home and about pages. This should reduce the JS download size by ~2.5MB per video.Lazy-load offscreen images, for faster page performance.
Please request review from
@zooniverse/frontend
team or an individual member of that team.Package
Linked Issue and/or Talk Post
How to Review
The YouTube videos should still appear on the home page, but the overall page weight should be much smaller. I've given each video an accessible title too.
Lighthouse scores, in Chrome, should be a lot better here (although a local server on your laptop will always serve pages faster than a Node server running in the cloud.) Lighthouse should report a total network payload of ~5MB here, compared to ~15MB for https://fe-root.preview.zooniverse.org.
Here's the Lighthouse performance report for this branch running on an M3 MacBook Pro:
Here's the Lighthouse report for https://fe-root.preview.zooniverse.org on the same MacBook:
Incidentally, SEO scores are low because 8 links have the generic 'Read more' as the link text.
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats
Refactoring