Skip to content
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

feat(v2): lazy load algolia css so its not render blocking #2125

Merged
merged 6 commits into from
Dec 15, 2019

Conversation

endiliey
Copy link
Contributor

Motivation

Maybe this is an overkill. Feel free to close if this isnt a good idea.

As we all know, we now single extract css into one css file. And CSS is actually render breaking.
I made a small optimization such that the algolia css is forced to be its own chunk (also better caching in future), and is only loaded when we hover or click the search bar (just like what we did with the JS). This reduce our initial critical CSS size by around 20% and should make the render slightly faster.

The hiccups is still infima css which is 17kb gzipped.

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Algolia should still be working on netlify

@endiliey endiliey added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Dec 15, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 15, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Dec 15, 2019

Deploy preview for docusaurus-2 ready!

Built with commit cba7199

https://deploy-preview-2125--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Dec 15, 2019

Deploy preview for docusaurus-preview ready!

Built with commit cba7199

https://deploy-preview-2125--docusaurus-preview.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perf guru 🙇

@endiliey endiliey added the status: don't merge yet This PR is completed, but we are still waiting for other things to be ready. label Dec 15, 2019
@endiliey endiliey merged commit dcf1fef into master Dec 15, 2019
@endiliey endiliey deleted the endi/algoliacss branch December 15, 2019 09:43
@endiliey endiliey removed the status: don't merge yet This PR is completed, but we are still waiting for other things to be ready. label Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants