lighthouse 9.5.0-dev.20220723 → 9.5.0-dev.20220726

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.
@@ -116,8 +116,8 @@ All pruning checks:
116
116
  - `_maxChromiumVersion`
117
117
  - `_legacyOnly`
118
118
  - `_fraggleRockOnly`
119
- - `_skipInBundled`
120
119
  - `_runner` (set to same value provided to CLI --runner flag, ex: `'devtools'`)
120
+ - `_excludeRunner` (set to same value provided to CLI --runner flag, ex: `'devtools'`)
121
121
 
122
122
  ## Pipeline
123
123
 
@@ -217,11 +217,10 @@ function makeComparison(name, actualResult, expectedResult) {
217
217
  * @param {LocalConsole} localConsole
218
218
  * @param {LH.Result} lhr
219
219
  * @param {Smokehouse.ExpectedRunnerResult} expected
220
- * @param {{runner?: string, isBundled?: boolean, useLegacyNavigation?: boolean}=} reportOptions
220
+ * @param {{runner?: string, useLegacyNavigation?: boolean}=} reportOptions
221
221
  */
222
222
  function pruneExpectations(localConsole, lhr, expected, reportOptions) {
223
223
  const isLegacyNavigation = reportOptions?.useLegacyNavigation;
224
- const isBundled = reportOptions?.isBundled;
225
224
 
226
225
  /**
227
226
  * Lazily compute the Chrome version because some reports are explicitly asserting error conditions.
@@ -289,15 +288,15 @@ function pruneExpectations(localConsole, lhr, expected, reportOptions) {
289
288
  `Actual channel: ${lhr.configSettings.channel}`,
290
289
  ].join(' '));
291
290
  remove(key);
292
- } else if (value._skipInBundled && !isBundled) {
291
+ } else if (value._runner && reportOptions?.runner !== value._runner) {
293
292
  localConsole.log([
294
- `[${key}] marked as skip in bundled and runner is bundled, pruning expectation:`,
293
+ `[${key}] is only for runner ${value._runner}, pruning expectation:`,
295
294
  JSON.stringify(value, null, 2),
296
295
  ].join(' '));
297
296
  remove(key);
298
- } else if (value._runner && reportOptions?.runner !== value._runner) {
297
+ } else if (value._excludeRunner && reportOptions?.runner === value._excludeRunner) {
299
298
  localConsole.log([
300
- `[${key}] is only for runner ${value._runner}, pruning expectation:`,
299
+ `[${key}] is excluded for runner ${value._excludeRunner}, pruning expectation:`,
301
300
  JSON.stringify(value, null, 2),
302
301
  ].join(' '));
303
302
  remove(key);
@@ -312,6 +311,7 @@ function pruneExpectations(localConsole, lhr, expected, reportOptions) {
312
311
  delete obj._minChromiumVersion;
313
312
  delete obj._maxChromiumVersion;
314
313
  delete obj._runner;
314
+ delete obj._excludeRunner;
315
315
  }
316
316
 
317
317
  const cloned = cloneDeep(expected);
@@ -459,7 +459,7 @@ function reportAssertion(localConsole, assertion) {
459
459
  * summary. Returns count of passed and failed tests.
460
460
  * @param {{lhr: LH.Result, artifacts: LH.Artifacts, networkRequests?: string[]}} actual
461
461
  * @param {Smokehouse.ExpectedRunnerResult} expected
462
- * @param {{runner?: string, isDebug?: boolean, isBundled?: boolean, useLegacyNavigation?: boolean}=} reportOptions
462
+ * @param {{runner?: string, isDebug?: boolean, useLegacyNavigation?: boolean}=} reportOptions
463
463
  * @return {{passed: number, failed: number, log: string}}
464
464
  */
465
465
  function getAssertionReport(actual, expected, reportOptions = {}) {
@@ -7,7 +7,6 @@
7
7
 
8
8
  import {makeComputedArtifact} from '../computed-artifact.js';
9
9
  import ProcessedTrace from '../processed-trace.js';
10
- import {LighthouseError} from '../../lib/lh-error.js';
11
10
 
12
11
  /** @typedef {{ts: number, isMainFrame: boolean, weightedScore: number}} LayoutShiftEvent */
13
12
 
@@ -37,13 +36,10 @@ class CumulativeLayoutShift {
37
36
  continue;
38
37
  }
39
38
 
40
- // For all-frames CLS calculation, we rely on `weighted_score_delta`, which
41
- // was added in Chrome 90: https://crbug.com/1173139
39
+ // For all-frames CLS calculation, we rely on `weighted_score_delta`
40
+ // All layout shift events should have this since M90: https://crbug.com/1173139
42
41
  if (event.args.data.weighted_score_delta === undefined) {
43
- throw new LighthouseError(
44
- LighthouseError.errors.UNSUPPORTED_OLD_CHROME,
45
- {featureName: 'Cumulative Layout Shift'}
46
- );
42
+ throw new Error('CLS missing weighted_score_delta');
47
43
  }
48
44
 
49
45
  if (event.args.data.had_recent_input) {
@@ -100,10 +100,10 @@ const UIStrings = {
100
100
  pwaCategoryTitle: 'PWA',
101
101
  /** Description of the Progressive Web Application (PWA) category. This is displayed at the top of a list of audits focused on topics related to whether or not a site is a progressive web app, e.g. responds offline, uses a service worker, is on https, etc. No character length limits. 'Learn More' becomes link text to additional documentation. */
102
102
  pwaCategoryDescription: 'These checks validate the aspects of a Progressive Web App. ' +
103
- '[Learn more](https://developers.google.com/web/progressive-web-apps/checklist).',
103
+ '[Learn more](https://web.dev/pwa-checklist/).',
104
104
  /** Description of the Progressive Web Application (PWA) manual checks category, containing a list of additional validators must be run by hand in order to check all PWA best practices. This is displayed at the top of a list of manually run audits focused on topics related to whether or not a site is a progressive web app, e.g. responds offline, uses a service worker, is on https, etc.. No character length limits. */
105
105
  pwaCategoryManualDescription: 'These checks are required by the baseline ' +
106
- '[PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist) but are ' +
106
+ '[PWA Checklist](https://web.dev/pwa-checklist/) but are ' +
107
107
  'not automatically checked by Lighthouse. They do not affect your score but it\'s important that you verify them manually.',
108
108
  /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */
109
109
  bestPracticesCategoryTitle: 'Best Practices',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "9.5.0-dev.20220723",
4
+ "version": "9.5.0-dev.20220726",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./lighthouse-core/index.js",
7
7
  "bin": {
@@ -159,7 +159,7 @@
159
159
  "jsdom": "^12.2.0",
160
160
  "jsonld": "^5.2.0",
161
161
  "jsonlint-mod": "^1.7.6",
162
- "lighthouse-plugin-publisher-ads": "^1.5.4",
162
+ "lighthouse-plugin-publisher-ads": "^1.5.6",
163
163
  "magic-string": "^0.25.7",
164
164
  "mime-types": "^2.1.30",
165
165
  "mocha": "^10.0.0",
@@ -1791,10 +1791,10 @@
1791
1791
  "message": "Performance"
1792
1792
  },
1793
1793
  "lighthouse-core/config/default-config.js | pwaCategoryDescription": {
1794
- "message": "These checks validate the aspects of a Progressive Web App. [Learn more](https://developers.google.com/web/progressive-web-apps/checklist)."
1794
+ "message": "These checks validate the aspects of a Progressive Web App. [Learn more](https://web.dev/pwa-checklist/)."
1795
1795
  },
1796
1796
  "lighthouse-core/config/default-config.js | pwaCategoryManualDescription": {
1797
- "message": "These checks are required by the baseline [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist) but are not automatically checked by Lighthouse. They do not affect your score but it's important that you verify them manually."
1797
+ "message": "These checks are required by the baseline [PWA Checklist](https://web.dev/pwa-checklist/) but are not automatically checked by Lighthouse. They do not affect your score but it's important that you verify them manually."
1798
1798
  },
1799
1799
  "lighthouse-core/config/default-config.js | pwaCategoryTitle": {
1800
1800
  "message": "PWA"
@@ -1791,10 +1791,10 @@
1791
1791
  "message": "P̂ér̂f́ôŕm̂án̂ćê"
1792
1792
  },
1793
1793
  "lighthouse-core/config/default-config.js | pwaCategoryDescription": {
1794
- "message": "T̂h́êśê ćĥéĉḱŝ v́âĺîd́ât́ê t́ĥé âśp̂éĉt́ŝ óf̂ á P̂ŕôǵr̂éŝśîv́ê Ẃêb́ Âṕp̂. [Ĺêár̂ń m̂ór̂é](https://developers.google.com/web/progressive-web-apps/checklist)."
1794
+ "message": "T̂h́êśê ćĥéĉḱŝ v́âĺîd́ât́ê t́ĥé âśp̂éĉt́ŝ óf̂ á P̂ŕôǵr̂éŝśîv́ê Ẃêb́ Âṕp̂. [Ĺêár̂ń m̂ór̂é](https://web.dev/pwa-checklist/)."
1795
1795
  },
1796
1796
  "lighthouse-core/config/default-config.js | pwaCategoryManualDescription": {
1797
- "message": "T̂h́êśê ćĥéĉḱŝ ár̂é r̂éq̂úîŕêd́ b̂ý t̂h́ê b́âśêĺîńê [ṔŴÁ Ĉh́êćk̂ĺîśt̂](https://developers.google.com/web/progressive-web-apps/checklist) b́ût́ âŕê ńôt́ âút̂óm̂át̂íĉál̂ĺŷ ćĥéĉḱêd́ b̂ý L̂íĝh́t̂h́ôúŝé. T̂h́êý d̂ó n̂ót̂ áf̂f́êćt̂ ýôúr̂ śĉór̂é b̂út̂ ít̂'ś îḿp̂ór̂t́âńt̂ t́ĥát̂ ýôú v̂ér̂íf̂ý t̂h́êḿ m̂án̂úâĺl̂ý."
1797
+ "message": "T̂h́êśê ćĥéĉḱŝ ár̂é r̂éq̂úîŕêd́ b̂ý t̂h́ê b́âśêĺîńê [ṔŴÁ Ĉh́êćk̂ĺîśt̂](https://web.dev/pwa-checklist/) b́ût́ âŕê ńôt́ âút̂óm̂át̂íĉál̂ĺŷ ćĥéĉḱêd́ b̂ý L̂íĝh́t̂h́ôúŝé. T̂h́êý d̂ó n̂ót̂ áf̂f́êćt̂ ýôúr̂ śĉór̂é b̂út̂ ít̂'ś îḿp̂ór̂t́âńt̂ t́ĥát̂ ýôú v̂ér̂íf̂ý t̂h́êḿ m̂án̂úâĺl̂ý."
1798
1798
  },
1799
1799
  "lighthouse-core/config/default-config.js | pwaCategoryTitle": {
1800
1800
  "message": "P̂ẂÂ"
@@ -15,7 +15,7 @@ declare global {
15
15
  requestedUrl: string;
16
16
  finalUrl: string | RegExp;
17
17
  userAgent?: string | RegExp;
18
- runWarnings?: Array<string|RegExp> | {length: string | number};
18
+ runWarnings?: any;
19
19
  runtimeError?: {
20
20
  code?: any;
21
21
  message?: any;
@@ -28,7 +28,7 @@ declare global {
28
28
  export type ExpectedRunnerResult = {
29
29
  lhr: ExpectedLHR,
30
30
  artifacts?: Partial<Record<keyof Artifacts|'_maxChromiumVersion'|'_minChromiumVersion', any>>
31
- networkRequests?: {length: number, _legacyOnly?: boolean, _fraggleRockOnly?: boolean};
31
+ networkRequests?: any;
32
32
  }
33
33
 
34
34
  export interface TestDfn {
@@ -1,31 +0,0 @@
1
- /**
2
- * @license Copyright 2019 The Lighthouse Authors. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
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
- */
6
- 'use strict';
7
-
8
- /** @fileoverview This file is no longer used internally, but remains here for backcompat with plugins. */
9
-
10
- import log from 'lighthouse-logger';
11
-
12
- import {makeComputedArtifact} from './computed-artifact.js';
13
- import ProcessedTrace from './processed-trace.js';
14
- import ProcessedNavigation from './processed-navigation.js';
15
-
16
- class TraceOfTab {
17
- /**
18
- * @param {LH.Trace} trace
19
- * @param {LH.Artifacts.ComputedContext} context
20
- * @return {Promise<any>}
21
- */
22
- static async compute_(trace, context) {
23
- const processedTrace = await ProcessedTrace.request(trace, context);
24
- const processedNavigation = await ProcessedNavigation.request(processedTrace, context);
25
- return {...processedTrace, ...processedNavigation};
26
- }
27
- }
28
-
29
- log.warn(`trace-of-tab`, `trace-of-tab is deprecated, use processed-trace / processed-navigation instead`); // eslint-disable-line max-len
30
- export default makeComputedArtifact(TraceOfTab, null);
31
-