-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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): only create one css file to avoid code-split css loading problem #2007
Conversation
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.
How big is our CSS now? :)
Deploy preview for docusaurus-2 ready! Built with commit 0601bf9 |
Deploy preview for docusaurus-preview ready! Built with commit 0601bf9 |
Deploy preview for docusaurus-2 ready! Built with commit be98ffa |
Deploy preview for docusaurus-preview ready! Built with commit be98ffa |
It's 17kb after gzip based on the preview. This is fine considering previously it was 16.3kb split across 2 files. I inspected the files and saw that the extra CSS is react-toggle, algolia search and some page-specific CSS modules. One downside is that we won't have good caching for CSS since they are all in one file now - one small change anywhere will cause the filename hash to change. LGTM. |
As a side note it decreases web dev lighthouse performance by 10 I wonder if we can somehow reduce the size
So going to https://v2.docusaurus.io/ is 10 + 6kb Then going to https://v2.docusaurus.io/docs/introduction is probably another 6kb. This PR is definitely better though long-term wise. Just wishing we can tree shake that css hehehe |
What about something like critical CSS or a similar technique? |
Happy to accept PR on that :) |
Motivation
Close #2006
See issue for reasoning
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
caveat: