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 55
feat(useStyles): add caching when no inline overrides are applied #2309
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
mnajdova
requested review from
dvdzkwsk,
dzearing,
ecraig12345,
JasonGore,
jdhuntington,
kenotron,
layershifter,
levithomason and
miroslavstastny
as code owners
February 3, 2020 15:45
mnajdova
changed the title
feat(useStyles): add caching for no inline overrides
feat(useStyles): add caching when no inline overrides are applied
Feb 3, 2020
mnajdova
changed the title
feat(useStyles): add caching when no inline overrides are applied
[WIP] feat(useStyles): add caching when no inline overrides are applied
Feb 3, 2020
Perf comparison
Potential regressions comparing to master
Perf tests with no regressions
Generated by 🚫 dangerJS |
-typings improvements
mnajdova
changed the title
[WIP] feat(useStyles): add caching when no inline overrides are applied
feat(useStyles): add caching when no inline overrides are applied
Feb 4, 2020
layershifter
reviewed
Feb 4, 2020
-added more tests
layershifter
reviewed
Feb 7, 2020
…tions into one -updated tests
-updated tests
layershifter
approved these changes
Feb 10, 2020
# Conflicts: # packages/react/src/components/Provider/Provider.tsx # packages/react/src/utils/mergeProviderContexts.ts
-removed obsolete const
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 is adding styles caching when the
useStyles
hook is used and no inline overrides are applied on the component (styles, design and variables props are not used). The caching is containing the following:We can enable the caching only when the
useStyles
is used at this moment, because by using it, we are sure that all props sent to the styles function are primitive values, which can be easily cached.BREAKING CHANGE
The caching for both styles and variables is enabled by default. If you need to opt out of this, you can use the new
performance
prop on theProvider
:Note that the variables cache was enabled before this PR, so it is not considered as a breaking change. However you can disabled that one if needed: