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

core(tsc): begin clean up of audit details types #7154

Merged
merged 3 commits into from
Feb 5, 2019
Merged

Conversation

brendankenny
Copy link
Member

wading through #6999 makes it clear that our details type situation is approaching untenable :)

This starts us off, unifying several top-level details types under LH.Audit.Details. There are no functional changes, just types, so this is just describing what we're already doing in a slightly different way (hopefully better).

This is the cleanest set of things I could find to do before starting to need code changes, so we'll build from here :)

Happy to bikeshed on names

@@ -23,7 +23,6 @@ const superLongURL =
'https://example.com/thisIsASuperLongURLThatWillTriggerFilenameTruncationWhichWeWantToTest.js';
const DETAILS = {
type: 'criticalrequestchain',
header: {type: 'text', text: 'CRC Header'},
Copy link
Member Author

Choose a reason for hiding this comment

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

only executable code change (though in a test). We haven't done anything with a header field in I don't know how long, though, so might as well delete it today :)

@@ -70,49 +70,10 @@ declare global {
/** An explanation of audit-related issues encountered on the test page. */
explanation?: string;
/** Extra information provided by some types of audits. */
details?: Audit.MetricDetails | Audit.OpportunityDetails;
details?: never;
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to start deleting lhr-lite-d.ts since its use didn't pan out, so starting by snipping off everything starting here

// export interface Table {}
// export interface SomeKindOfHiddenThing

// Contents of details below here
Copy link
Member Author

@brendankenny brendankenny Feb 5, 2019

Choose a reason for hiding this comment

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

maybe we want a different namespace here, not sure. These are things that are only inside details (e.g. table headings, table items, but expanding soon with Table and MultiCheck populated).

Copy link
Collaborator

Choose a reason for hiding this comment

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

LH.Audit.Details.Details ;)

I'd personally be in favor of naming convention over a different namespace. they categorically they definitely belong under "details". maybe we return to *Details suffix if these get out of hand?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd personally be in favor of naming convention over a different namespace. they categorically they definitely belong under "details". maybe we return to *Details suffix if these get out of hand?

yeah, I'm ok with living with this for now, just trying to think of ways to shrink the amount of thinking one has to do. Part of this was motivated by reviewing #6999 and seeing some of our existing types like DetailsRendererDetailsJSON and DetailsRendererNodeDetailsJSON and going "wat" :)

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM!

scale: number;
items: {
timing: number;
timestamp: number;
Copy link
Collaborator

Choose a reason for hiding this comment

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

wanna throw a comment on these bad boys for filmstrip? we were inconsistent when we added the full page screenshot so documenting what they represent seems like a decent idea :)

Copy link
Member Author

Choose a reason for hiding this comment

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

wanna throw a comment on these bad boys for filmstrip

done

// TODO(bckenny)
// export interface MultiCheck {}
// export interface Table {}
// export interface SomeKindOfHiddenThing
Copy link
Collaborator

Choose a reason for hiding this comment

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

these intentionally left in here?

these would be like a foreign language to me if I were ever tasked with following up maybe we could flesh out the comment a tad? :D

Copy link
Member Author

Choose a reason for hiding this comment

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

these intentionally left in here?

I shouldn't leave those there. Deleting :)

// export interface Table {}
// export interface SomeKindOfHiddenThing

// Contents of details below here
Copy link
Collaborator

Choose a reason for hiding this comment

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

LH.Audit.Details.Details ;)

I'd personally be in favor of naming convention over a different namespace. they categorically they definitely belong under "details". maybe we return to *Details suffix if these get out of hand?

@brendankenny brendankenny merged commit 69d3123 into master Feb 5, 2019
@brendankenny brendankenny deleted the beginclean branch February 5, 2019 18:44
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.

2 participants