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

feat(top-app-bar): typescript #548

Merged
merged 110 commits into from
Dec 21, 2018
Merged

Conversation

moog16
Copy link

@moog16 moog16 commented Dec 19, 2018

related #48

@codecov-io
Copy link

codecov-io commented Dec 19, 2018

Codecov Report

Merging #548 into feat/two-typescript will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feat/two-typescript     #548      +/-   ##
=======================================================
+ Coverage                 96.6%   96.64%   +0.03%     
=======================================================
  Files                       60       60              
  Lines                     2208     2233      +25     
  Branches                   145      162      +17     
=======================================================
+ Hits                      2133     2158      +25     
  Misses                      44       44              
  Partials                    31       31
Impacted Files Coverage Δ
packages/top-app-bar/FixedAdjust.tsx 100% <100%> (ø)
packages/top-app-bar/index.tsx 100% <100%> (ø)

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 5249de5...c629d15. Read the comment docs.

className?: string;
dense?: boolean;
prominent?: boolean;
short?: boolean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;

export default class TopAppBar extends React.Component {
foundation_ = null;
export interface TopAppBarProps {
actionItems?: React.ReactElement<any>[];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually any is not allowed when using --noImplicitAny, which google3 uses. Is there any reason the generic type cannot be specified ahead of time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --noImplicitAny will allow you to imply any types, but defining it as any is ok. However it is the lazy way out. I think in this case, it'll be an or or

> {
topAppBarElement: React.RefObject<HTMLElement> = React.createRef();
foundation_?: MDCFixedTopAppBarFoundation | MDCTopAppBarFoundation | MDCShortTopAppBarFoundation;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this union useful for a 3p developer? If so, consider making a type for MDCTopAppBarFoundation which is the union of these 3

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya that makes sense

@@ -12,7 +21,7 @@ class TopAppBarProminentToShortCollapsedScreenshotTest extends React.Component {
window.addEventListener('resize', this.updateTopAppBarVariant);
}

shouldComponentUpdate(_, nextState) {
shouldComponentUpdate(_: {}, nextState: TopAppBarProminentToShortCollapsedScreenshotTestState) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider @OverRide annotations (for readability)

} from '../../../packages/top-app-bar';

const MainTopAppBarContent: React.FunctionComponent<TopAppbarFixedAdjustProps> = (props) => {
return (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: dont need parens

Copy link

@clocksmith clocksmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit

@moog16 moog16 changed the base branch from fix/coverage-typescript to feat/two-typescript December 20, 2018 00:47
@moog16 moog16 mentioned this pull request Dec 20, 2018
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@moog16 moog16 merged commit 52badab into feat/two-typescript Dec 21, 2018
@moog16 moog16 deleted the feat/typescript-topappbar branch December 21, 2018 00:24
moog16 pushed a commit that referenced this pull request Dec 27, 2018
moog16 pushed a commit that referenced this pull request Dec 28, 2018
moog16 pushed a commit that referenced this pull request Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants