Closed lariciamota closed 5 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
faststore-site | ✅ Ready (Inspect) | Visit Preview | Apr 25, 2024 7:36pm |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
What's the purpose of this pull request?
Add priority to the 1st product's image on a PLP. It was motivated by a store that was having the performance score penalized on lighthouse because its LCP was the first product on the PLP. We haven't had found this issue before because our starter has a hero image on PLP (that already has the priority set).
How it works?
On the
ProductGrid
component we send theloading
prop aseager
through theProductCard
component when it's the first product, then on the Image component the priority will be added.How to test it?
yarn dev
and go to http://localhost:3000/technologyhigh
:Comparison
I've compared the LH scores from starter and newstore to check if this change had impacted. To be fair, I updated those stores to the latest version of faststore core (
3.0.42
) to get the "before" value and updated to this PR version of faststore core (codesandbox) to get the "after" value. Both stores increased 2 points of Performance:References
next/image
priority
prop