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: make v5 renderer compatible with v3 and v4 LHRs #8822

Merged
merged 1 commit into from
May 3, 2019

Conversation

brendankenny
Copy link
Member

fixes #8598

In addition to the diagnostic -> debug update that needed to be done, #8299 also meant we needed to update the <5.0 filmstrip screenshots to be able to render in the report.

Tested LHRs back to 3.1, everything is 👍 .

However: turns out even the 3.1 viewer isn't compatible with 3.0 LHRs because of the i18n switch. Not sure what we want to do about that, though at least 5.0 isn't a regression on this front :)

metrics screenshot

https://googlechrome.github.io/lighthouse/viewer/?gist=86d005fa4297bdefacd01b7228ab47fa

@@ -61,9 +61,6 @@ class DetailsRenderer {
case 'screenshot':
case 'debugdata':
return null;
// Fallback for old LHRs, where no type meant don't render.
case undefined:
return null;
Copy link
Member Author

Choose a reason for hiding this comment

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

moved into util.prepareReportResult() so all the backwards compat stuff is in one place

@@ -62,24 +64,45 @@ class Util {
if (!clone.configSettings.locale) {
clone.configSettings.locale = 'en';
}
Util.setNumberDateLocale(clone.configSettings.locale);
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 are just rearranged so backward compatibility stuff, report locale setting, and smooshing aren't all interleaved

@paulirish
Copy link
Member

because of the i18n switch

i've been seeing these but wasn't sure the source issue. what switch you talkin about?

@brendankenny
Copy link
Member Author

i've been seeing these but wasn't sure the source issue. what switch you talkin about?

switching from our old displayValue string replacement to the i18n ICU message version, I believe

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

@brendankenny
Copy link
Member Author

i've been seeing these but wasn't sure the source issue. what switch you talkin about?

switching from our old displayValue string replacement to the i18n ICU message version, I believe

actually, I guess this is at least a limited issue for LHRs up until 4.0 when #6767 landed and finished off the old displayValue format (font-size and load-fast-enough-for-pwa were the stragglers).

It's just 3.1 where the perf section moved to the modern i18n system and so the above the fold content is correct from then on.

We could add the old displayValue code to util.prepareReportResult and have it convert any displayValue of the old format it finds, but I vote not worth it until (maybe) later since this won't be a new problem coming from 5.0 :)

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.

ensure 4.x LHR and 5.0 report renderer compatibility
3 participants