-
Notifications
You must be signed in to change notification settings - Fork 5
chore: Performance improvements by sections #368
Conversation
✔️ Deploy Preview for basestore ready! 🔨 Explore the source changes: 1ede4b8 🔍 Inspect the deploy log: https://app.netlify.com/sites/basestore/deploys/62224f8ccf5795000763a427 😎 Browse the preview: https://deploy-preview-368--basestore.netlify.app |
Preview is readyThis pull request generated a Preview👀 Preview: https://preview-368--base.preview.vtex.app |
Gatsby Cloud Build Reportbasestore 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 4m PerformanceLighthouse report
|
f7aa56a
to
8287b0a
Compare
a794445
to
28a6db5
Compare
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.
Really cool CSS feature I didn't know much about. I learned a lot reading the web.dev link and other resources (W3C)! I was initially very confused trying to differentiate contain
, content-visibility
, and contain-intrinsic-size
😵. Interesting to see CSS Containment has been here since Chrome 52, but only now seems to be getting traction. Maybe because there were some accessibility concerns that only got addressed in 85-89 and improvements in 98.
Left some minor suggestions and will re-review after reading your thoughts on them!
By the way, merging |
28a6db5
to
bc82933
Compare
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 thoughts as @filipewl! I didn't know much about it and took the chance to learn more. Thanks for the explanation! 🤩
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.
Really nice to learn more about these CSS props! thanks for bringing it up. 🎉
I left some comments just for the sake of understanding better the things
Co-authored-by: Eduardo Formiga <eduardo.formiga@gmail.com>
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.
🚀
What's the purpose of this pull request?
This PR uses the new content-visibility css property to improve layout loading of the page.
How does it work?
We organize our page layouts in
sections
. These sections are self contained strips of the page that offers a feature (carousel, shelf, hero etc).Turns out, that for such architecture, W3C has recently launched a new CSS feature to
lazy load
part of the page's content so browsers do less work. This feature is calledcontent-visibility
and better explanation is done in web.dev's siteTo improve our sections architecture, I created a new
Section
component that encapsulates this css rules with thesection
selector.Below, you can see, with 95% confidence interval, rendering times for the home page:
before: 396 +- 18
after: 328 +- 11
which is ~20% improvement in rendering times of the home page. This is a small improvement, however, given the small effort, I guess we can move forward with this PR
How to test it?
Nothing should have changed
Checklist