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

perf(docs): optimize performance #1981

Merged
merged 4 commits into from
Aug 26, 2017
Merged

perf(docs): optimize performance #1981

merged 4 commits into from
Aug 26, 2017

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Aug 18, 2017

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 and ComponentProps.

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 uses Portal, page that has 30 examples produces 120 Portals, 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.

@layershifter layershifter force-pushed the perf/doc-props branch 3 times, most recently from 865f7be to f27afc7 Compare August 18, 2017 14:29
@codecov-io
Copy link

codecov-io commented Aug 18, 2017

Codecov Report

Merging #1981 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23ec465...c358d50. Read the comment docs.

Copy link
Member Author

@layershifter layershifter left a 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

@levithomason
Copy link
Member

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?

@layershifter
Copy link
Member Author

@levithomason I'll solve them tomorrow, 22PM there 😴

Alexander Fedyashov added 2 commits August 21, 2017 09:56
…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
Copy link
Member Author

@layershifter layershifter left a 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 👍

@levithomason levithomason merged commit 1980806 into master Aug 26, 2017
@levithomason levithomason deleted the perf/doc-props branch August 26, 2017 17:48
@levithomason
Copy link
Member

Released in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants