-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
perf(docs): optimize performance #1981
Conversation
865f7be
to
f27afc7
Compare
Codecov Report
@@ Coverage Diff @@
## master #1981 +/- ##
======================================
Coverage 99.8% 99.8%
======================================
Files 148 148
Lines 2589 2589
======================================
Hits 2584 2584
Misses 5 5 Continue to review full report at Codecov.
|
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.
@levithomason I've finished this PR, it will be interesting to hear your opinion
f27afc7
to
7fc77df
Compare
Oh man, this has been on my list for so long ❤️ ! The update all deps PR has made some conflicts here, could you take a look? |
@levithomason I'll solve them tomorrow, 22PM there 😴 |
…React into perf/doc-props # Conflicts: # docs/app/Components/ComponentDoc/ComponentDoc.js # docs/app/Components/ComponentDoc/ComponentExample/ComponentExample.js # docs/app/Components/ComponentDoc/ComponentProps/ComponentProps.js # package.json
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.
@levithomason I've resolved conficts and merged with master
👍
Released in |
This PR is first round of docs performance optimizations. I've profiled our docs page and found that there are two components that aren't optimized:
ComponentExample
andComponentProps
.ComponentProps
Renders many elements, has a non-optimized render of enum values. I've refactored it to several small components that have controlled render cycle. I've also refactored usage of double curly braces:
ComponentExample
My profile showed that the next bottleneck is control items at each example. All of them use
Popup
which usesPortal
, page that has 30 examples produces 120Portal
s, which rendered immediately. It's not fast.I saw that in fact, it's not necessary because controls should be visible only when example is hovered. I've factored CSS animation with a
Transition
component, so controls will mount only when they will be needed. Each control was optimized, too.