report: move renderer code to report/#12690
Conversation
|
|
||
| const TEMPLATE_FILE = fs.readFileSync(__dirname + | ||
| '/../../../../report/html/templates.html', 'utf8'); | ||
| const reportAssets = require('../../report-assets.js'); |
There was a problem hiding this comment.
minor tweak I did in these test files was dropping fs for report-assets.js
| if (collisions > 0) { | ||
| console.log(`MEANING COLLISION: ${collisions} string(s) have the same content.`); | ||
| assert.equal(collisions, 30, `The number of duplicate strings have changed, update this assertion if that is expected, or reword strings. Collisions: ${collisionStrings.join('\n')}`); | ||
| assert.equal(collisions, 28, `The number of duplicate strings have changed, update this assertion if that is expected, or reword strings. Collisions: ${collisionStrings.join('\n')}`); |
There was a problem hiding this comment.
idk why this changed
There was a problem hiding this comment.
that's somewhat concerning... :/
can we do a diff?
this is what I see on master
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'$MARKDOWN_SNIPPET_0$ elements have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements do not have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements do not have $MARKDOWN_SNIPPET_1$ text',
'Document has a valid $MARKDOWN_SNIPPET_0$',
'Document has a valid $MARKDOWN_SNIPPET_0$',
'Potential Savings',
'Potential Savings',
'Failing Elements',
'Failing Elements',
'URL',
'URL',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.',
'Consider using a $LINK_START_0$plugin$LINK_END_0$ or service that will automatically convert your uploaded images to the optimal formats.',
'Consider using a $LINK_START_0$plugin$LINK_END_0$ or service that will automatically convert your uploaded images to the optimal formats.',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.'
There was a problem hiding this comment.
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'$MARKDOWN_SNIPPET_0$ elements have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements do not have $MARKDOWN_SNIPPET_1$ text',
'Document has a valid $MARKDOWN_SNIPPET_0$',
'Potential Savings',
'Failing Elements',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.',
'Consider using a $LINK_START_0$plugin$LINK_END_0$ or service that will automatically convert your uploaded images to the optimal formats.',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.'
There was a problem hiding this comment.
hm, that's 10 more missing than there should be, I had to add collisionStrings.push where the first collisions++ is
There was a problem hiding this comment.
collectAllStringsInDir does have some local data per directory, and renderer strings moved to a new folder, so that must be why. no problem here i guess ... except maybe in the "collision detection" code.
There was a problem hiding this comment.
I didn't follow up after https://github.com/GoogleChrome/lighthouse/pull/12441/files#r630521367 :(
| @@ -1,30 +1,26 @@ | |||
| # Lighthouse HTML Report Renderer | |||
There was a problem hiding this comment.
mostly just updated links here.
patrickhulce
left a comment
There was a problem hiding this comment.
thanks for splitting this up, I like the new directory structure 👍
| if (collisions > 0) { | ||
| console.log(`MEANING COLLISION: ${collisions} string(s) have the same content.`); | ||
| assert.equal(collisions, 30, `The number of duplicate strings have changed, update this assertion if that is expected, or reword strings. Collisions: ${collisionStrings.join('\n')}`); | ||
| assert.equal(collisions, 28, `The number of duplicate strings have changed, update this assertion if that is expected, or reword strings. Collisions: ${collisionStrings.join('\n')}`); |
There was a problem hiding this comment.
that's somewhat concerning... :/
can we do a diff?
this is what I see on master
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'ARIA $MARKDOWN_SNIPPET_0$ elements have accessible names',
'ARIA $MARKDOWN_SNIPPET_0$ elements do not have accessible names.',
"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. $LINK_START_0$Learn more$LINK_END_0$.",
'$MARKDOWN_SNIPPET_0$ elements have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements do not have $MARKDOWN_SNIPPET_1$ text',
'$MARKDOWN_SNIPPET_0$ elements do not have $MARKDOWN_SNIPPET_1$ text',
'Document has a valid $MARKDOWN_SNIPPET_0$',
'Document has a valid $MARKDOWN_SNIPPET_0$',
'Potential Savings',
'Potential Savings',
'Failing Elements',
'Failing Elements',
'URL',
'URL',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.',
'Consider using a $LINK_START_0$plugin$LINK_END_0$ or service that will automatically convert your uploaded images to the optimal formats.',
'Consider using a $LINK_START_0$plugin$LINK_END_0$ or service that will automatically convert your uploaded images to the optimal formats.',
'Consider uploading your GIF to a service which will make it available to embed as an HTML5 video.'
|
can we do a strings import w/o actually committing? I think so. there's a test that is failing b/c of missing renderer strings in en-XA |
brendankenny
left a comment
There was a problem hiding this comment.
are we seriously going to do another lighthouse-*/ directory? :P
report/!
|
Haha I agree, but was gonna suggest renaming all of those in another PR and did lighthouse-report just to match. Would lighthouse-core to core be breaking? Could also just make it report now. Wdyt |
|
ha, I wasn't sure if anyone else would agree :) It probably makes sense to start with just |
|
imported strings too |
|
@paulirish can you turn off CDT tests for a bit? at least until the renderer changes land sometime next week. this PR renames |
|
@patrickhulce so we agree the string collision is not a real problem, and we will hash it out eventually (but no reason to block this PR). anything else? |


ref #12623, setup for #12689
Moving the renderer code from
lighthouse-core/reporttoreport/, and simplifying the directory structure. Better separation (core vs report), and provides room for us to continue to grow the report renderer (upcoming refactor + FR changes + maybe LHCI diff view?).Renamed
report-template.htmltostandalone-template.html, as I always confused it withtemplates.html. Also matches thestandalonereport terminology in the upcoming report renderer refactor.Need to follow with a strings import.This PR includes a strings import.