lighthouse 9.5.0-dev.20220510 → 9.5.0-dev.20220513

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,6 @@
26
26
 
27
27
  import {Util} from './util.js';
28
28
  import {CriticalRequestChainRenderer} from './crc-details-renderer.js';
29
- import {SnippetRenderer} from './snippet-renderer.js';
30
29
  import {ElementScreenshotRenderer} from './element-screenshot-renderer.js';
31
30
 
32
31
  const URL_PREFIXES = ['http://', 'https://', 'data:'];
@@ -472,15 +471,16 @@ export class DetailsRenderer {
472
471
  }
473
472
 
474
473
  /**
475
- * @param {LH.Audit.Details.List} details
474
+ * @param {LH.FormattedIcu<LH.Audit.Details.List>} details
476
475
  * @return {Element}
477
476
  */
478
477
  _renderList(details) {
479
478
  const listContainer = this._dom.createElement('div', 'lh-list');
480
479
 
481
480
  details.items.forEach(item => {
482
- const snippetEl = SnippetRenderer.render(this._dom, item, this);
483
- listContainer.appendChild(snippetEl);
481
+ const listItem = this.render(item);
482
+ if (!listItem) return;
483
+ listContainer.append(listItem);
484
484
  });
485
485
 
486
486
  return listContainer;
@@ -4,7 +4,6 @@
4
4
  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
5
  */
6
6
 
7
-
8
7
  import fs from 'fs';
9
8
 
10
9
  import jsdom from 'jsdom';
@@ -188,24 +188,24 @@ describe('DetailsRenderer', () => {
188
188
  });
189
189
 
190
190
  it('renders lists', () => {
191
- const snippet = {
192
- type: 'snippet',
193
- lines: [{lineNumber: 1, content: ''}],
194
- title: 'Some snippet',
195
- lineMessages: [],
196
- generalMessages: [],
197
- lineCount: 100,
191
+ const table = {
192
+ type: 'table',
193
+ headings: [{text: '', key: 'numeric', itemType: 'numeric'}],
194
+ items: [{numeric: 1234.567}],
198
195
  };
199
196
 
200
197
  const el = renderer.render({
201
198
  type: 'list',
202
- items: [snippet, snippet],
199
+ items: [table, table],
203
200
  });
204
201
 
205
202
  assert.equal(el.localName, 'div');
206
203
  assert.ok(el.classList.contains('lh-list'), 'has list class');
207
204
  assert.ok(el.children.length, 2, 'renders all items');
208
- assert.ok(el.children[0].textContent.includes('Some snippet'), 'renders item content');
205
+ for (const child of el.children) {
206
+ assert.ok(child.classList.contains('lh-table'));
207
+ assert.equal(child.textContent, '1,234.6');
208
+ }
209
209
  });
210
210
 
211
211
  it('does not render internal-only screenshot details', () => {
@@ -1664,6 +1664,9 @@
1664
1664
  "lighthouse-core/audits/work-during-interaction.js | displayValue": {
1665
1665
  "message": "{timeInMs, number, milliseconds} ms spent on event '{interactionType}'"
1666
1666
  },
1667
+ "lighthouse-core/audits/work-during-interaction.js | eventTarget": {
1668
+ "message": "Event target"
1669
+ },
1667
1670
  "lighthouse-core/audits/work-during-interaction.js | failureTitle": {
1668
1671
  "message": "Minimize work during key interaction"
1669
1672
  },
@@ -1673,8 +1676,8 @@
1673
1676
  "lighthouse-core/audits/work-during-interaction.js | presentationDelay": {
1674
1677
  "message": "Presentation delay"
1675
1678
  },
1676
- "lighthouse-core/audits/work-during-interaction.js | processingDelay": {
1677
- "message": "Processing delay"
1679
+ "lighthouse-core/audits/work-during-interaction.js | processingTime": {
1680
+ "message": "Processing time"
1678
1681
  },
1679
1682
  "lighthouse-core/audits/work-during-interaction.js | title": {
1680
1683
  "message": "Minimizes work during key interaction"
@@ -1664,6 +1664,9 @@
1664
1664
  "lighthouse-core/audits/work-during-interaction.js | displayValue": {
1665
1665
  "message": "{timeInMs, number, milliseconds} m̂ś ŝṕêńt̂ ón̂ év̂én̂t́ '{interactionType}'"
1666
1666
  },
1667
+ "lighthouse-core/audits/work-during-interaction.js | eventTarget": {
1668
+ "message": "Êv́êńt̂ t́âŕĝét̂"
1669
+ },
1667
1670
  "lighthouse-core/audits/work-during-interaction.js | failureTitle": {
1668
1671
  "message": "M̂ín̂ím̂íẑé ŵór̂ḱ d̂úr̂ín̂ǵ k̂éŷ ín̂t́êŕâćt̂íôń"
1669
1672
  },
@@ -1673,8 +1676,8 @@
1673
1676
  "lighthouse-core/audits/work-during-interaction.js | presentationDelay": {
1674
1677
  "message": "P̂ŕêśêńt̂át̂íôń d̂él̂áŷ"
1675
1678
  },
1676
- "lighthouse-core/audits/work-during-interaction.js | processingDelay": {
1677
- "message": "P̂ŕôćêśŝín̂ǵ d̂él̂á"
1679
+ "lighthouse-core/audits/work-during-interaction.js | processingTime": {
1680
+ "message": "P̂ŕôćêśŝín̂ǵ t̂ím̂é"
1678
1681
  },
1679
1682
  "lighthouse-core/audits/work-during-interaction.js | title": {
1680
1683
  "message": "M̂ín̂ím̂íẑéŝ ẃôŕk̂ d́ûŕîńĝ ḱêý îńt̂ér̂áĉt́îón̂"
@@ -573,7 +573,7 @@ declare module Artifacts {
573
573
  }
574
574
 
575
575
  interface TraceElement {
576
- traceEventType: 'largest-contentful-paint'|'layout-shift'|'animation';
576
+ traceEventType: 'largest-contentful-paint'|'layout-shift'|'animation'|'responsiveness';
577
577
  score?: number;
578
578
  node: NodeDetails;
579
579
  nodeId?: number;
@@ -58,7 +58,9 @@ declare module Details {
58
58
 
59
59
  interface List {
60
60
  type: 'list';
61
- items: SnippetValue[]
61
+ // NOTE: any `Details` type *should* be usable in `items`, but check
62
+ // styles/report-ui-features are good before adding.
63
+ items: Array<Table | DebugData>;
62
64
  }
63
65
 
64
66
  interface Opportunity {