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: remove some trivial uses of WebInspector #6090

Merged
merged 1 commit into from
Sep 22, 2018
Merged

Conversation

brendankenny
Copy link
Member

inspired by @patrickhulce's comment in #5946 (comment), took a look at some of our current uses of WebInspector and found some that could be trivially removed.

@@ -6,13 +6,10 @@
'use strict';

/** @typedef {LH.Artifacts.FontSize['analyzedFailingNodesData'][0]} FailingNodeData */
/** @typedef {{Type: {Regular: 'Regular', Inline: 'Inline', Attributes: 'Attributes'}}} WebInspectorCSSStyle */
Copy link
Member Author

Choose a reason for hiding this comment

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

The values that are compared against these are typed to only be one of these values, so really no point in bringing it in just for these three constants.

@@ -47,10 +46,6 @@ class NetworkRecorder extends EventEmitter {
return super.once(event, listener);
}

get EventTypes() {
Copy link
Member Author

Choose a reason for hiding this comment

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

was only introduced for easier testing in #582 and that usage was removed in #2133, so this isn't doing anything :)

Injected: 'injected',
UserAgent: 'user-agent',
Inspector: 'inspector',
Regular: 'regular',
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 shouldn't have been all caps (see e.g. https://github.com/ChromeDevTools/devtools-frontend/blob/51d3d758c57dc51d1864b3003de1fdda82963623/front_end/sdk/CSSRule.js#L70). We only touch the code that checks if a style was injected or came from the user-agent, but unsure if that was affecting the output of our font-size code...

@brendankenny
Copy link
Member Author

bundle size form 512.65KB back down to 510.01KB :)

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.

this is nice cleanup. and it also makes me uncomfortable. 😰

@brendankenny
Copy link
Member Author

that's not a review :P

@patrickhulce
Copy link
Collaborator

❤️ this

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.

None yet

3 participants