This repository was archived by the owner on Mar 4, 2020. It is now read-only.
perf(renderComponent): drop FelaTheme and use React.Context directly#1163
Merged
layershifter merged 3 commits intomasterfrom Apr 9, 2019
Merged
perf(renderComponent): drop FelaTheme and use React.Context directly#1163layershifter merged 3 commits intomasterfrom
layershifter merged 3 commits intomasterfrom
Conversation
layershifter
commented
Apr 4, 2019
Codecov Report
@@ Coverage Diff @@
## master #1163 +/- ##
==========================================
+ Coverage 82.46% 82.47% +0.01%
==========================================
Files 740 740
Lines 8753 8754 +1
Branches 1171 1170 -1
==========================================
+ Hits 7218 7220 +2
Misses 1519 1519
+ Partials 16 15 -1
Continue to review full report at Codecov.
|
kuzhelov
reviewed
Apr 9, 2019
kuzhelov
approved these changes
Apr 9, 2019
Contributor
kuzhelov
left a comment
There was a problem hiding this comment.
please, just update the CHANGELOG before merging 👍
64aeee9 to
9721629
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements findings from #1106.
Goal
We want to get rid of
FelaThemeas it produces two components in the tree and slow downs rendering.How
We have two use cases for
renderComponent():UIComponentandcreateComponent().createComponent()allows to use only functions, so we can useuseContext()hook.UIComponentis a class component, we can't use hooks inside them, but there isClass.contextTypethat can be adopted for this case.Measures
See for more details #1106. Raw measures
ContextUseandContextClassFieldare proposed approaches.From real life
I used #1006 to compare.
Savings are 70-100ms.