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

report: rework the DOM of audits #5045

Merged
merged 3 commits into from
Apr 27, 2018
Merged

report: rework the DOM of audits #5045

merged 3 commits into from
Apr 27, 2018

Conversation

paulirish
Copy link
Member

Everything has been within a .lh-score component which makes very little sense.

Things are simplified now, with things using proper names.

Before and after of the DOM of an audit:
image

Also yay, no more <!-- fill me --> :)


Also driveby upgrade for some nodeTiming types

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!

.lh-score__value {
flex: none;
float: right;
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we take bets on how quickly this converts back to flexbox/grid? 😆

<span class="lh-score__title"><!-- fill me --></span>
<!-- Lighthouse audit -->
<template id="tmpl-lh-audit">
<div class="lh-audit">
Copy link
Collaborator

Choose a reason for hiding this comment

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

awesome, I always thought score was weird 👍

@@ -94,7 +94,7 @@ class ConsistentlyInteractive extends MetricArtifact {
}

/**
* @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTimings
Copy link
Member

Choose a reason for hiding this comment

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

any chance you can rebase? :)

Copy link
Member

Choose a reason for hiding this comment

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

oh, jk, this is additional updates?

Copy link
Member Author

Choose a reason for hiding this comment

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

ya additional.

*/
renderAudit(audit) {
const element = this.dom.createElement('div', 'lh-audit');
element.appendChild(this._renderAuditScore(audit));
Copy link
Member

Choose a reason for hiding this comment

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

lol

@@ -106,7 +106,7 @@ describe('Lighthouse chrome extension', function() {

const selectors = {
audits: '.lh-audit,.lh-perf-metric,.lh-perf-hint',
titles: '.lh-score__title, .lh-perf-hint__title, .lh-perf-metric__title',
Copy link
Member

Choose a reason for hiding this comment

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

I believe you'll have to update viewer test too?

Copy link
Member

Choose a reason for hiding this comment

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

I believe you'll have to update viewer test too?

yeah, needs an update. Doesn't fail the test because these selectors are only used to give a good error string when there's a test failure :)

Copy link
Member Author

Choose a reason for hiding this comment

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

yup good catch

@@ -20,7 +20,9 @@

<div id="lh-log"></div>

<script>%%LIGHTHOUSE_JAVASCRIPT%%</script>
<script>%%LIGHTHOUSE_JAVASCRIPT%%
//# sourceURL=report-renderer-js.js
Copy link
Member

Choose a reason for hiding this comment

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

does this work with anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

it enables a few things in devtools. like code coverage some other features that are wonky with inline <script> tags.
you can also just ctrl-p into the JS rather than jump to some line in the big huge HTML.

@brendankenny
Copy link
Member

just the viewer test thing

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM!

@paulirish paulirish merged commit 440155c into master Apr 27, 2018
@paulirish paulirish deleted the mynextpr branch April 27, 2018 19:38
kdzwinel pushed a commit to kdzwinel/lighthouse that referenced this pull request Aug 16, 2018
* driveby: update nodeTimings types
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

4 participants