[go: nahoru, domu]

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: add device type and version to scorecalc link #10763

Merged
merged 20 commits into from
May 13, 2020
Merged

Conversation

connorjclark
Copy link
Collaborator
@connorjclark connorjclark commented May 13, 2020

follow up to #10754

@paulirish up to you if you wanna merge this into your branch vs as a follow up commit. seems simple enough for the former.

@connorjclark connorjclark requested a review from a team as a code owner May 13, 2020 00:19
@connorjclark connorjclark requested review from paulirish and removed request for a team May 13, 2020 00:19
@connorjclark connorjclark changed the title device type and version report: add device type and version to scorecalc link May 13, 2020
@@ -193,8 +193,8 @@ class ReportRenderer {
Util.i18n = i18n;

const detailsRenderer = new DetailsRenderer(this._dom);
detailsRenderer.setLighthouseReport(report);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the perf category renderer and a separate pr #10716 both need some data from the LHR to render, so let's put the report on the details renderer

done via setLighthouseReport so that the property will be optional and existing usages won't break (i.e. progressive enhancement)

Copy link
Member

Choose a reason for hiding this comment

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

add a comment explaining why we're (somewhat) violating our layering.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tbh I don't think that's a useful comment.

Copy link
Member

Choose a reason for hiding this comment

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

it's useful for the same reason that led you to write this review comment. :p

here's what i was thinking

// The scorecalc link (_getScoringCalculatorHref()) and the elementScreenshotRenderer both need data in the LHR outside of what's provided
// With the report stored like this, the property is optional and existing usages won't break.
// TODO: Fix layering in the grand refactor of the ReportRenderer

Copy link
Member

Choose a reason for hiding this comment

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

// TODO: Fix layering in the grand refactor of the ReportRenderer

@paulirish Please

  1. Create an issue
  2. Assign someone
  3. Assign it a priority

Grand refactors are an engineering smell, but incremental refactors tend to only happen if you do them when you actually need them. Otherwise they need to actually be scheduled.

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.

yeah...

to patrick, brendan: obviously installing the report as prop down here doesnt feel good. but, i dont see a good way to avoid that isn't a huge refactor. :/

@@ -193,8 +193,8 @@ class ReportRenderer {
Util.i18n = i18n;

const detailsRenderer = new DetailsRenderer(this._dom);
detailsRenderer.setLighthouseReport(report);
Copy link
Member

Choose a reason for hiding this comment

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

add a comment explaining why we're (somewhat) violating our layering.

…erer.js

Co-authored-by: Paul Irish <paulirish@google.com>
@@ -193,8 +193,8 @@ class ReportRenderer {
Util.i18n = i18n;

const detailsRenderer = new DetailsRenderer(this._dom);
detailsRenderer.setLighthouseReport(report);
Copy link
Member

Choose a reason for hiding this comment

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

it's useful for the same reason that led you to write this review comment. :p

here's what i was thinking

// The scorecalc link (_getScoringCalculatorHref()) and the elementScreenshotRenderer both need data in the LHR outside of what's provided
// With the report stored like this, the property is optional and existing usages won't break.
// TODO: Fix layering in the grand refactor of the ReportRenderer

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.

Brendan recommends Util.reportJson. (or... Util.reportResult) That seems great and also better.

@brendankenny
Copy link
Member

Brendan recommends Util.reportJson. (or... Util.reportResult) That seems great and also better.

No, I really didn't. I'm saying if you're going to make it a hacked on global, make it like the other hacked on global i18n so at least they're together.

@paulirish
Copy link
Member

Brendan recommends Util.reportJson. (or... Util.reportResult) That seems great and also better.

No, I really didn't. I'm saying if you're going to make it a hacked on global, make it like the other hacked on global i18n so at least they're together.

sounds good!

@connorjclark connorjclark changed the base branch from calclink to master May 13, 2020 02:29
Comment on lines 492 to 493
* through, we have this global. This property is optional so that existing rendering clients
* won't break.
Copy link
Member

Choose a reason for hiding this comment

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

What existing rendering clients would this not break that won't be broken by the required Util.i18n right below this, also releasing in 6.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm thinking anything that uses Category Renderer directly. psi? idk, prob others.

Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking anything that uses Category Renderer directly. psi? idk, prob others.

Which can roll a new performance-category-renderer and then throw on the first reference to Util.i18n.strings. It's not clear why this clarification is needed when there isn't anyone upgrading with no work.

@patrickhulce
Copy link
Collaborator
patrickhulce commented May 13, 2020

meta comment

is this really fly-by-night level urgent to introduce a new global we can't undo until the next major? :)

IMO, reports generated during the window between 6.0.0 and 6.0.1 or whatever could live with the score calc eventually being possibly stale if they clicked the link in a year 😉

EDIT: I guess device is pretty important though now that we're fixing the longstanding bug for lrdesktopconfig. Carryon.

@connorjclark
Copy link
Collaborator Author
connorjclark commented May 13, 2020

EDIT: I guess device is pretty important though now that we're fixing the longstanding bug for lrdesktopconfig. Carryon.

Beat me to it! It would be silly if this was just for the URL longevity via version. But if we want this calculator in 6.0 for devtools, we need the device part, or users will be confused when scores don't match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants