This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
perf(renderComponent): drop FelaTheme and use React.Context directly #1163
Merged
Conversation
This file contains 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
layershifter
requested review from
dvdzkwsk,
kuzhelov,
levithomason,
miroslavstastny and
mnajdova
as code owners
April 4, 2019 09:35
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
@@ -1,5 +1,8 @@ | |||
import * as React from 'react' | |||
import * as _ from 'lodash' | |||
// @ts-ignore We have this export in package, but it is not present in typings |
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.
👍
kuzhelov
approved these changes
Apr 9, 2019
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.
please, just update the CHANGELOG before merging 👍
layershifter
force-pushed
the
perf/context-update
branch
from
April 9, 2019 14:05
64aeee9
to
9721629
Compare
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
FelaTheme
as it produces two components in the tree and slow downs rendering.How
We have two use cases for
renderComponent()
:UIComponent
andcreateComponent()
.createComponent()
allows to use only functions, so we can useuseContext()
hook.UIComponent
is a class component, we can't use hooks inside them, but there isClass.contextType
that can be adopted for this case.Measures
See for more details #1106. Raw measures
ContextUse
andContextClassField
are proposed approaches.From real life
I used #1006 to compare.
Savings are 70-100ms.