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

Update: Use array of non-critical resource types #2191

Merged
merged 4 commits into from
May 9, 2017

Conversation

stramel
Copy link
Contributor

@stramel stramel commented May 9, 2017

@paulirish Follow up PR for #2085

Figured I would add it since I suggested and had time now

@@ -34,12 +34,13 @@ class CriticalRequestChains extends ComputedArtifact {
*/
isCritical(request) {
// XHRs are fetched at High priority, but we exclude them, as they are unlikely to be critical
Copy link
Member

Choose a reason for hiding this comment

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

the comments relate to the nonCriticalResourceTypes so they shoudl probably be right on top of it.

WebInspector.resourceTypes.Image._category,
WebInspector.resourceTypes.XHR._category
];
if (nonCriticalResourceTypes.includes(resourceTypeCategory)) {
Copy link
Member

Choose a reason for hiding this comment

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

the request._resourceType && conflicts with this.

one solution: you can do an early return false if _resourceType is falsy.

Copy link
Member

Choose a reason for hiding this comment

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

ah nevermind. at worst it'll be [string,string].includes(undefined) which will just fail, but not throw.

no change necessary for this.

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

thx man! lgtm

@paulirish paulirish merged commit bd7f862 into GoogleChrome:master May 9, 2017
@paulirish
Copy link
Member

appreciate the assist on that one!

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