-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Factor out common code for markup in React plugins #4171
Conversation
Needs prettier! |
config: Config, | ||
indentation: string, | ||
): string => { | ||
const tag = config.colors.tag; |
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.
colorTag
maybe?
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.
I replaced it with tagColor
but am happy to change to colorTag
if that is clearer
getChildren(item, children); | ||
}); | ||
} else if (arg != null && arg !== false) { | ||
children.push(arg); |
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.
I like the simplification of this callback 👍
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.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #4171 +/- ##
=========================================
- Coverage 60.55% 60.4% -0.15%
=========================================
Files 196 197 +1
Lines 6776 6751 -25
Branches 6 6
=========================================
- Hits 4103 4078 -25
Misses 2670 2670
Partials 3 3
Continue to review full report at Codecov.
|
This race was too close to call, which is as you might expect:
|
Super sweet cleanup. |
* Factor out common code for markup in React plugins * Add mistakenly deleted export * Put getType after getChildren to improve diff * Make the 2 new tests parallel * Fix pretty lint error * Replace tag with tagColor
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Enforce consistency, reduce code. Like the TV advert: looks pretty, less filling :)
We will probably be able to factor out common code in HTMLElement too.
Analogy to react-redux as you review this diff:
Test plan
Added 2 tests to prevent regression related to test object for subset match, especially because of the incorrect Flow error.