lighthouse 9.5.0-dev.20220907 → 9.5.0-dev.20220907-2
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.
- package/core/audits/bootup-time.js +2 -2
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +7 -6
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.js +2 -2
- package/core/audits/byte-efficiency/offscreen-images.js +2 -2
- package/core/audits/byte-efficiency/render-blocking-resources.js +5 -5
- package/core/audits/byte-efficiency/total-byte-weight.js +1 -1
- package/core/audits/byte-efficiency/unminified-css.js +1 -1
- package/core/audits/byte-efficiency/unused-css-rules.js +1 -1
- package/core/audits/byte-efficiency/unused-javascript.js +4 -4
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -1
- package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
- package/core/audits/critical-request-chains.js +1 -1
- package/core/audits/csp-xss.js +1 -1
- package/core/audits/deprecations.js +2 -2
- package/core/audits/diagnostics.js +7 -7
- package/core/audits/dobetterweb/charset.js +1 -1
- package/core/audits/dobetterweb/uses-http2.js +6 -6
- package/core/audits/errors-in-console.js +2 -2
- package/core/audits/final-screenshot.js +2 -2
- package/core/audits/font-display.js +1 -1
- package/core/audits/installable-manifest.js +1 -1
- package/core/audits/is-on-https.js +1 -1
- package/core/audits/long-tasks.js +4 -4
- package/core/audits/main-thread-tasks.js +1 -1
- package/core/audits/mainthread-work-breakdown.js +1 -1
- package/core/audits/maskable-icon.js +1 -1
- package/core/audits/metrics/cumulative-layout-shift.js +1 -1
- package/core/audits/metrics/experimental-interaction-to-next-paint.js +1 -1
- package/core/audits/metrics/first-contentful-paint-3g.js +1 -1
- package/core/audits/metrics/first-contentful-paint.js +1 -1
- package/core/audits/metrics/first-meaningful-paint.js +1 -1
- package/core/audits/metrics/interactive.js +1 -1
- package/core/audits/metrics/largest-contentful-paint.js +1 -1
- package/core/audits/metrics/max-potential-fid.js +1 -1
- package/core/audits/metrics/speed-index.js +1 -1
- package/core/audits/metrics/total-blocking-time.js +1 -1
- package/core/audits/metrics.js +2 -2
- package/core/audits/network-requests.js +2 -2
- package/core/audits/network-rtt.js +3 -3
- package/core/audits/network-server-latency.js +3 -3
- package/core/audits/no-unload-listeners.js +2 -2
- package/core/audits/performance-budget.js +2 -2
- package/core/audits/predictive-perf.js +8 -8
- package/core/audits/preload-fonts.js +1 -1
- package/core/audits/preload-lcp-image.js +4 -4
- package/core/audits/redirects.js +4 -4
- package/core/audits/resource-summary.js +1 -1
- package/core/audits/screenshot-thumbnails.js +1 -1
- package/core/audits/script-treemap-data.js +5 -5
- package/core/audits/seo/canonical.js +1 -1
- package/core/audits/seo/font-size.js +2 -2
- package/core/audits/seo/http-status-code.js +1 -1
- package/core/audits/seo/is-crawlable.js +1 -1
- package/core/audits/seo/tap-targets.js +2 -2
- package/core/audits/server-response-time.js +1 -1
- package/core/audits/splash-screen.js +1 -1
- package/core/audits/themed-omnibox.js +1 -1
- package/core/audits/third-party-facades.js +3 -3
- package/core/audits/third-party-summary.js +2 -2
- package/core/audits/timing-budget.js +2 -2
- package/core/audits/user-timings.js +1 -1
- package/core/audits/uses-rel-preconnect.js +9 -8
- package/core/audits/uses-rel-preload.js +4 -4
- package/core/audits/viewport.js +2 -2
- package/core/audits/violation-audit.js +2 -2
- package/core/audits/work-during-interaction.js +4 -4
- package/core/computed/critical-request-chains.js +5 -3
- package/core/computed/image-records.js +3 -1
- package/core/computed/js-bundles.js +2 -1
- package/core/computed/load-simulator.js +3 -5
- package/core/computed/main-resource.js +3 -2
- package/core/computed/main-thread-tasks.js +3 -2
- package/core/computed/manifest-values.js +3 -1
- package/core/computed/metrics/cumulative-layout-shift.js +3 -2
- package/core/computed/metrics/first-contentful-paint-all-frames.js +3 -2
- package/core/computed/metrics/first-contentful-paint.js +4 -3
- package/core/computed/metrics/first-meaningful-paint.js +4 -3
- package/core/computed/metrics/interactive.js +4 -3
- package/core/computed/metrics/lantern-first-contentful-paint.js +3 -2
- package/core/computed/metrics/lantern-first-meaningful-paint.js +4 -3
- package/core/computed/metrics/lantern-interactive.js +4 -3
- package/core/computed/metrics/lantern-largest-contentful-paint.js +4 -3
- package/core/computed/metrics/lantern-max-potential-fid.js +5 -4
- package/core/computed/metrics/lantern-metric.js +6 -6
- package/core/computed/metrics/lantern-speed-index.js +5 -4
- package/core/computed/metrics/lantern-total-blocking-time.js +5 -4
- package/core/computed/metrics/largest-contentful-paint-all-frames.js +3 -2
- package/core/computed/metrics/largest-contentful-paint.js +4 -3
- package/core/computed/metrics/max-potential-fid.js +4 -3
- package/core/computed/metrics/metric.js +3 -3
- package/core/computed/metrics/navigation-metric.js +4 -3
- package/core/computed/metrics/responsiveness.js +3 -2
- package/core/computed/metrics/speed-index.js +5 -4
- package/core/computed/metrics/timing-summary.js +15 -14
- package/core/computed/metrics/total-blocking-time.js +5 -4
- package/core/computed/module-duplication.js +5 -3
- package/core/computed/network-analysis.js +3 -2
- package/core/computed/network-records.js +2 -1
- package/core/computed/page-dependency-graph.js +13 -11
- package/core/computed/processed-navigation.js +2 -1
- package/core/computed/processed-trace.js +2 -1
- package/core/computed/resource-summary.js +4 -2
- package/core/computed/screenshots.js +2 -1
- package/core/computed/speedline.js +3 -2
- package/core/computed/unused-css.js +3 -2
- package/core/computed/unused-javascript-summary.js +2 -1
- package/core/computed/user-timings.js +3 -2
- package/core/computed/viewport-meta.js +2 -1
- package/core/fraggle-rock/gather/navigation-runner.js +1 -1
- package/core/gather/gather-runner.js +1 -1
- package/core/gather/gatherers/dobetterweb/optimized-images.js +1 -1
- package/core/gather/gatherers/dobetterweb/response-compression.js +1 -1
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +1 -1
- package/core/gather/gatherers/inspector-issues.js +1 -1
- package/core/gather/gatherers/link-elements.js +1 -1
- package/core/gather/gatherers/main-document-content.js +1 -1
- package/core/gather/gatherers/script-elements.js +1 -1
- package/core/gather/gatherers/trace-elements.js +4 -4
- package/core/index.js +1 -1
- package/core/lib/asset-saver.js +4 -4
- package/dist/report/flow.js +11 -11
- package/lol.report.json +5856 -0
- package/package.json +1 -1
- package/shared/localization/locales/en-US.ctc.json +8059 -0
- package/shared/localization/locales/en-XL.ctc.json +8036 -0
- package/changelog.md +0 -5902
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import LanternInteractive from '../computed/metrics/lantern-interactive.js';
|
|
12
|
-
import LanternSpeedIndex from '../computed/metrics/lantern-speed-index.js';
|
|
13
|
-
import
|
|
9
|
+
import {LanternFirstContentfulPaint} from '../computed/metrics/lantern-first-contentful-paint.js';
|
|
10
|
+
import {LanternFirstMeaningfulPaint} from '../computed/metrics/lantern-first-meaningful-paint.js';
|
|
11
|
+
import {LanternInteractive} from '../computed/metrics/lantern-interactive.js';
|
|
12
|
+
import {LanternSpeedIndex} from '../computed/metrics/lantern-speed-index.js';
|
|
13
|
+
import {LanternLargestContentfulPaint} from '../computed/metrics/lantern-largest-contentful-paint.js';
|
|
14
14
|
|
|
15
15
|
// Parameters (in ms) for log-normal CDF scoring. To see the curve:
|
|
16
16
|
// https://www.desmos.com/calculator/bksgkihhj8
|
|
@@ -50,11 +50,11 @@ class PredictivePerf extends Audit {
|
|
|
50
50
|
// @ts-expect-error - TODO(bckenny): allow optional `throttling` settings
|
|
51
51
|
const settings = {}; // Use default settings.
|
|
52
52
|
const computationData = {trace, devtoolsLog, gatherContext, settings, URL};
|
|
53
|
-
const fcp = await
|
|
54
|
-
const fmp = await
|
|
53
|
+
const fcp = await LanternFirstContentfulPaint.request(computationData, context);
|
|
54
|
+
const fmp = await LanternFirstMeaningfulPaint.request(computationData, context);
|
|
55
55
|
const tti = await LanternInteractive.request(computationData, context);
|
|
56
56
|
const si = await LanternSpeedIndex.request(computationData, context);
|
|
57
|
-
const lcp = await
|
|
57
|
+
const lcp = await LanternLargestContentfulPaint.request(computationData, context);
|
|
58
58
|
|
|
59
59
|
const values = {
|
|
60
60
|
roughEstimateOfFCP: fcp.timing,
|
|
@@ -13,7 +13,7 @@ import {Audit} from './audit.js';
|
|
|
13
13
|
import * as i18n from './../lib/i18n/i18n.js';
|
|
14
14
|
import FontDisplay from './../audits/font-display.js';
|
|
15
15
|
const PASSING_FONT_DISPLAY_REGEX = /^(optional)$/;
|
|
16
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
16
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
17
17
|
|
|
18
18
|
const UIStrings = {
|
|
19
19
|
/** Title of a Lighthouse audit that provides detail on whether fonts that used `font-display: optional` were preloaded. This descriptive title is shown to users when all fonts that used `font-display: optional` were preloaded. */
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
9
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
10
|
-
import MainResource from '../computed/main-resource.js';
|
|
11
|
-
import
|
|
12
|
-
import LoadSimulator from '../computed/load-simulator.js';
|
|
10
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
11
|
+
import {LanternLargestContentfulPaint} from '../computed/metrics/lantern-largest-contentful-paint.js';
|
|
12
|
+
import {LoadSimulator} from '../computed/load-simulator.js';
|
|
13
13
|
import {ByteEfficiencyAudit} from './byte-efficiency/byte-efficiency-audit.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
@@ -225,7 +225,7 @@ class PreloadLCPImageAudit extends Audit {
|
|
|
225
225
|
|
|
226
226
|
const [mainResource, lanternLCP, simulator] = await Promise.all([
|
|
227
227
|
MainResource.request({devtoolsLog, URL}, context),
|
|
228
|
-
|
|
228
|
+
LanternLargestContentfulPaint.request(metricData, context),
|
|
229
229
|
LoadSimulator.request({devtoolsLog, settings: context.settings}, context),
|
|
230
230
|
]);
|
|
231
231
|
|
package/core/audits/redirects.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import {ByteEfficiencyAudit} from './byte-efficiency/byte-efficiency-audit.js';
|
|
9
9
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
10
|
-
import ProcessedTrace from '../computed/processed-trace.js';
|
|
11
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
12
|
-
import MainResource from '../computed/main-resource.js';
|
|
13
|
-
import LanternInteractive from '../computed/metrics/lantern-interactive.js';
|
|
10
|
+
import {ProcessedTrace} from '../computed/processed-trace.js';
|
|
11
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
12
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
13
|
+
import {LanternInteractive} from '../computed/metrics/lantern-interactive.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/** Imperative title of a Lighthouse audit that tells the user to eliminate the redirects taken through multiple URLs to load the page. This is shown in a list of audits that Lighthouse generates. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
|
-
import ComputedResourceSummary from '../computed/resource-summary.js';
|
|
8
|
+
import {ResourceSummary as ComputedResourceSummary} from '../computed/resource-summary.js';
|
|
9
9
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
@@ -8,7 +8,7 @@ import jpeg from 'jpeg-js';
|
|
|
8
8
|
|
|
9
9
|
import {Audit} from './audit.js';
|
|
10
10
|
import {LighthouseError} from '../lib/lh-error.js';
|
|
11
|
-
import Speedline from '../computed/speedline.js';
|
|
11
|
+
import {Speedline} from '../computed/speedline.js';
|
|
12
12
|
|
|
13
13
|
const NUMBER_OF_THUMBNAILS = 10;
|
|
14
14
|
const THUMBNAIL_WIDTH = 120;
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {Audit} from './audit.js';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import ModuleDuplication from '../computed/module-duplication.js';
|
|
18
|
+
import {JSBundles} from '../computed/js-bundles.js';
|
|
19
|
+
import {UnusedJavascriptSummary} from '../computed/unused-javascript-summary.js';
|
|
20
|
+
import {ModuleDuplication} from '../computed/module-duplication.js';
|
|
21
21
|
import {isInline} from '../lib/script-helpers.js';
|
|
22
22
|
|
|
23
23
|
class ScriptTreemapDataAudit extends Audit {
|
|
@@ -167,7 +167,7 @@ class ScriptTreemapDataAudit extends Audit {
|
|
|
167
167
|
const nodes = [];
|
|
168
168
|
/** @type {Map<string, LH.Treemap.Node>} */
|
|
169
169
|
const htmlNodesByFrameId = new Map();
|
|
170
|
-
const bundles = await
|
|
170
|
+
const bundles = await JSBundles.request(artifacts, context);
|
|
171
171
|
const duplicationByPath = await ModuleDuplication.request(artifacts, context);
|
|
172
172
|
|
|
173
173
|
for (const script of artifacts.Scripts) {
|
|
@@ -178,7 +178,7 @@ class ScriptTreemapDataAudit extends Audit {
|
|
|
178
178
|
const scriptCoverage = /** @type {LH.Artifacts['JsUsage'][string] | undefined} */
|
|
179
179
|
(artifacts.JsUsage[script.scriptId]);
|
|
180
180
|
const unusedJavascriptSummary = scriptCoverage ?
|
|
181
|
-
await
|
|
181
|
+
await UnusedJavascriptSummary.request(
|
|
182
182
|
{scriptId: script.scriptId, scriptCoverage, bundle}, context) :
|
|
183
183
|
undefined;
|
|
184
184
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from '../audit.js';
|
|
8
8
|
import UrlUtils from '../../lib/url-utils.js';
|
|
9
|
-
import MainResource from '../../computed/main-resource.js';
|
|
9
|
+
import {MainResource} from '../../computed/main-resource.js';
|
|
10
10
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
11
|
|
|
12
12
|
const UIStrings = {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
10
10
|
import {Audit} from '../audit.js';
|
|
11
|
-
import
|
|
11
|
+
import {ViewportMeta} from '../../computed/viewport-meta.js';
|
|
12
12
|
|
|
13
13
|
const MINIMAL_PERCENTAGE_OF_LEGIBLE_TEXT = 60;
|
|
14
14
|
|
|
@@ -256,7 +256,7 @@ class FontSize extends Audit {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
const viewportMeta = await
|
|
259
|
+
const viewportMeta = await ViewportMeta.request(artifacts.MetaElements, context);
|
|
260
260
|
if (!viewportMeta.isMobileOptimized) {
|
|
261
261
|
return {
|
|
262
262
|
score: 0,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from '../audit.js';
|
|
8
8
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
9
|
-
import MainResource from '../../computed/main-resource.js';
|
|
9
|
+
import {MainResource} from '../../computed/main-resource.js';
|
|
10
10
|
|
|
11
11
|
const HTTP_UNSUCCESSFUL_CODE_LOW = 400;
|
|
12
12
|
const HTTP_UNSUCCESSFUL_CODE_HIGH = 599;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import robotsParser from 'robots-parser';
|
|
8
8
|
|
|
9
9
|
import {Audit} from '../audit.js';
|
|
10
|
-
import MainResource from '../../computed/main-resource.js';
|
|
10
|
+
import {MainResource} from '../../computed/main-resource.js';
|
|
11
11
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
12
12
|
|
|
13
13
|
const BLOCKLIST = new Set([
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {Audit} from '../audit.js';
|
|
13
|
-
import
|
|
13
|
+
import {ViewportMeta} from '../../computed/viewport-meta.js';
|
|
14
14
|
import {
|
|
15
15
|
rectsTouchOrOverlap,
|
|
16
16
|
getRectOverlapArea,
|
|
@@ -268,7 +268,7 @@ class TapTargets extends Audit {
|
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
const viewportMeta = await
|
|
271
|
+
const viewportMeta = await ViewportMeta.request(artifacts.MetaElements, context);
|
|
272
272
|
if (!viewportMeta.isMobileOptimized) {
|
|
273
273
|
return {
|
|
274
274
|
score: 0,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
|
-
import MainResource from '../computed/main-resource.js';
|
|
9
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/** Title of a diagnostic audit that provides detail on how long it took from starting a request to when the server started responding. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import cssParsers from 'cssstyle/lib/parsers.js';
|
|
8
8
|
|
|
9
9
|
import MultiCheckAudit from './multi-check-audit.js';
|
|
10
|
-
import ManifestValues from '../computed/manifest-values.js';
|
|
10
|
+
import {ManifestValues} from '../computed/manifest-values.js';
|
|
11
11
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
import {Audit} from './audit.js';
|
|
23
23
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
24
24
|
import thirdPartyWeb from '../lib/third-party-web.js';
|
|
25
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
26
|
-
import MainResource from '../computed/main-resource.js';
|
|
27
|
-
import MainThreadTasks from '../computed/main-thread-tasks.js';
|
|
25
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
26
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
27
|
+
import {MainThreadTasks} from '../computed/main-thread-tasks.js';
|
|
28
28
|
import ThirdPartySummary from './third-party-summary.js';
|
|
29
29
|
|
|
30
30
|
const UIStrings = {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
9
|
import thirdPartyWeb from '../lib/third-party-web.js';
|
|
10
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
11
|
-
import MainThreadTasks from '../computed/main-thread-tasks.js';
|
|
10
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
11
|
+
import {MainThreadTasks} from '../computed/main-thread-tasks.js';
|
|
12
12
|
import {getJavaScriptURLs, getAttributableURLForTask} from '../lib/tracehouse/task-summary.js';
|
|
13
13
|
|
|
14
14
|
const UIStrings = {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
|
-
import TimingSummary from '../computed/metrics/timing-summary.js';
|
|
9
|
-
import MainResource from '../computed/main-resource.js';
|
|
8
|
+
import {TimingSummary} from '../computed/metrics/timing-summary.js';
|
|
9
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
10
10
|
import {Budget} from '../config/budget.js';
|
|
11
11
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
|
-
import ComputedUserTimings from '../computed/user-timings.js';
|
|
9
|
+
import {UserTimings as ComputedUserTimings} from '../computed/user-timings.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/** Descriptive title of a diagnostic audit that provides details on any timestamps generated by the page. User Timing refers to the 'User Timing API', which enables a website to record specific times as 'marks', or spans of time as 'measures'. */
|
|
@@ -8,13 +8,13 @@ import {Audit} from './audit.js';
|
|
|
8
8
|
import {ByteEfficiencyAudit} from './byte-efficiency/byte-efficiency-audit.js';
|
|
9
9
|
import UrlUtils from '../lib/url-utils.js';
|
|
10
10
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
11
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
12
|
-
import MainResource from '../computed/main-resource.js';
|
|
13
|
-
import LoadSimulator from '../computed/load-simulator.js';
|
|
14
|
-
import ProcessedTrace from '../computed/processed-trace.js';
|
|
15
|
-
import ProcessedNavigation from '../computed/processed-navigation.js';
|
|
16
|
-
import PageDependencyGraph from '../computed/page-dependency-graph.js';
|
|
17
|
-
import
|
|
11
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
12
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
13
|
+
import {LoadSimulator} from '../computed/load-simulator.js';
|
|
14
|
+
import {ProcessedTrace} from '../computed/processed-trace.js';
|
|
15
|
+
import {ProcessedNavigation} from '../computed/processed-navigation.js';
|
|
16
|
+
import {PageDependencyGraph} from '../computed/page-dependency-graph.js';
|
|
17
|
+
import {LanternLargestContentfulPaint} from '../computed/metrics/lantern-largest-contentful-paint.js';
|
|
18
18
|
|
|
19
19
|
// Preconnect establishes a "clean" socket. Chrome's socket manager will keep an unused socket
|
|
20
20
|
// around for 10s. Meaning, the time delta between processing preconnect a request should be <10s,
|
|
@@ -125,7 +125,8 @@ class UsesRelPreconnectAudit extends Audit {
|
|
|
125
125
|
]);
|
|
126
126
|
|
|
127
127
|
const {rtt, additionalRttByOrigin} = loadSimulator.getOptions();
|
|
128
|
-
const lcpGraph =
|
|
128
|
+
const lcpGraph =
|
|
129
|
+
await LanternLargestContentfulPaint.getPessimisticGraph(pageGraph, processedNavigation);
|
|
129
130
|
/** @type {Set<string>} */
|
|
130
131
|
const lcpGraphURLs = new Set();
|
|
131
132
|
lcpGraph.traverse(node => {
|
|
@@ -8,11 +8,11 @@ import UrlUtils from '../lib/url-utils.js';
|
|
|
8
8
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
9
9
|
import {Audit} from './audit.js';
|
|
10
10
|
import {ByteEfficiencyAudit} from './byte-efficiency/byte-efficiency-audit.js';
|
|
11
|
-
import CriticalRequestChains from '../computed/critical-request-chains.js';
|
|
11
|
+
import {CriticalRequestChains} from '../computed/critical-request-chains.js';
|
|
12
12
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
13
|
-
import MainResource from '../computed/main-resource.js';
|
|
14
|
-
import PageDependencyGraph from '../computed/page-dependency-graph.js';
|
|
15
|
-
import LoadSimulator from '../computed/load-simulator.js';
|
|
13
|
+
import {MainResource} from '../computed/main-resource.js';
|
|
14
|
+
import {PageDependencyGraph} from '../computed/page-dependency-graph.js';
|
|
15
|
+
import {LoadSimulator} from '../computed/load-simulator.js';
|
|
16
16
|
|
|
17
17
|
const UIStrings = {
|
|
18
18
|
/** Imperative title of a Lighthouse audit that tells the user to use <link rel=preload> to initiate important network requests earlier during page load. This is displayed in a list of audit titles that Lighthouse generates. */
|
package/core/audits/viewport.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
|
-
import
|
|
8
|
+
import {ViewportMeta} from '../computed/viewport-meta.js';
|
|
9
9
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
@@ -44,7 +44,7 @@ class Viewport extends Audit {
|
|
|
44
44
|
* @return {Promise<LH.Audit.Product>}
|
|
45
45
|
*/
|
|
46
46
|
static async audit(artifacts, context) {
|
|
47
|
-
const viewportMeta = await
|
|
47
|
+
const viewportMeta = await ViewportMeta.request(artifacts.MetaElements, context);
|
|
48
48
|
|
|
49
49
|
if (!viewportMeta.hasViewportTag) {
|
|
50
50
|
return {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
|
-
import
|
|
8
|
+
import {JSBundles} from '../computed/js-bundles.js';
|
|
9
9
|
|
|
10
10
|
class ViolationAudit extends Audit {
|
|
11
11
|
/**
|
|
@@ -15,7 +15,7 @@ class ViolationAudit extends Audit {
|
|
|
15
15
|
* @return {Promise<Array<{source: LH.Audit.Details.SourceLocationValue}>>}
|
|
16
16
|
*/
|
|
17
17
|
static async getViolationResults(artifacts, context, pattern) {
|
|
18
|
-
const bundles = await
|
|
18
|
+
const bundles = await JSBundles.request(artifacts, context);
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @template T
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
|
-
import
|
|
9
|
-
import ProcessedTrace from '../computed/processed-trace.js';
|
|
8
|
+
import {Responsiveness} from '../computed/metrics/responsiveness.js';
|
|
9
|
+
import {ProcessedTrace} from '../computed/processed-trace.js';
|
|
10
10
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
11
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
11
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
12
12
|
import {MainThreadTasks} from '../lib/tracehouse/main-thread-tasks.js';
|
|
13
13
|
import {taskGroups} from '../lib/tracehouse/task-groups.js';
|
|
14
14
|
import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
|
|
@@ -229,7 +229,7 @@ class WorkDuringInteraction extends Audit {
|
|
|
229
229
|
|
|
230
230
|
const trace = artifacts.traces[WorkDuringInteraction.DEFAULT_PASS];
|
|
231
231
|
const metricData = {trace, settings};
|
|
232
|
-
const interactionEvent = await
|
|
232
|
+
const interactionEvent = await Responsiveness.request(metricData, context);
|
|
233
233
|
// If no interaction, diagnostic audit is n/a.
|
|
234
234
|
if (interactionEvent === null) {
|
|
235
235
|
return {score: null, notApplicable: true};
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
9
|
-
import MainResource from './main-resource.js';
|
|
10
|
-
import PageDependencyGraph from './page-dependency-graph.js';
|
|
9
|
+
import {MainResource} from './main-resource.js';
|
|
10
|
+
import {PageDependencyGraph} from './page-dependency-graph.js';
|
|
11
11
|
|
|
12
12
|
class CriticalRequestChains {
|
|
13
13
|
/**
|
|
@@ -138,4 +138,6 @@ class CriticalRequestChains {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
const CriticalRequestChainsComputed =
|
|
142
|
+
makeComputedArtifact(CriticalRequestChains, ['URL', 'devtoolsLog', 'trace']);
|
|
143
|
+
export {CriticalRequestChainsComputed as CriticalRequestChains};
|
|
@@ -58,5 +58,7 @@ class ImageRecords {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
const ImageRecordsComputed =
|
|
62
|
+
makeComputedArtifact(ImageRecords, ['ImageElements', 'networkRecords']);
|
|
63
|
+
export {ImageRecordsComputed as ImageRecords};
|
|
62
64
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import * as constants from '../config/constants.js';
|
|
9
9
|
import {Simulator} from '../lib/dependency-graph/simulator/simulator.js';
|
|
10
|
-
import NetworkAnalysis from './network-analysis.js';
|
|
10
|
+
import {NetworkAnalysis} from './network-analysis.js';
|
|
11
11
|
|
|
12
12
|
class LoadSimulator {
|
|
13
13
|
/**
|
|
@@ -88,7 +88,5 @@ class LoadSimulator {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// export {LoadSimulator as LoadSimulatorComputed};
|
|
94
|
-
export default makeComputedArtifact(LoadSimulator, ['devtoolsLog', 'settings']);
|
|
91
|
+
const LoadSimulatorComputed = makeComputedArtifact(LoadSimulator, ['devtoolsLog', 'settings']);
|
|
92
|
+
export {LoadSimulatorComputed as LoadSimulator};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import {NetworkAnalyzer} from '../lib/dependency-graph/simulator/network-analyzer.js';
|
|
9
|
-
import NetworkRecords from './network-records.js';
|
|
9
|
+
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @fileoverview This artifact identifies the main resource on the page. Current solution assumes
|
|
@@ -31,4 +31,5 @@ class MainResource {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const MainResourceComputed = makeComputedArtifact(MainResource, ['URL', 'devtoolsLog']);
|
|
35
|
+
export {MainResourceComputed as MainResource};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import {MainThreadTasks as MainThreadTasks_} from '../lib/tracehouse/main-thread-tasks.js';
|
|
9
|
-
import ProcessedTrace from './processed-trace.js';
|
|
9
|
+
import {ProcessedTrace} from './processed-trace.js';
|
|
10
10
|
|
|
11
11
|
class MainThreadTasks {
|
|
12
12
|
/**
|
|
@@ -21,4 +21,5 @@ class MainThreadTasks {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const MainThreadTasksComputed = makeComputedArtifact(MainThreadTasks, null);
|
|
25
|
+
export {MainThreadTasksComputed as MainThreadTasks};
|
|
@@ -131,4 +131,6 @@ class ManifestValues {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
const ManifestValuesComputed =
|
|
135
|
+
makeComputedArtifact(ManifestValues, ['InstallabilityErrors', 'WebAppManifest']);
|
|
136
|
+
export {ManifestValuesComputed as ManifestValues};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import ProcessedTrace from '../processed-trace.js';
|
|
8
|
+
import {ProcessedTrace} from '../processed-trace.js';
|
|
9
9
|
|
|
10
10
|
/** @typedef {{ts: number, isMainFrame: boolean, weightedScore: number}} LayoutShiftEvent */
|
|
11
11
|
|
|
@@ -121,4 +121,5 @@ class CumulativeLayoutShift {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
const CumulativeLayoutShiftComputed = makeComputedArtifact(CumulativeLayoutShift, null);
|
|
125
|
+
export {CumulativeLayoutShiftComputed as CumulativeLayoutShift};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import NavigationMetric from './navigation-metric.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
9
|
|
|
10
10
|
class FirstContentfulPaintAllFrames extends NavigationMetric {
|
|
11
11
|
/**
|
|
@@ -30,7 +30,8 @@ class FirstContentfulPaintAllFrames extends NavigationMetric {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const FirstContentfulPaintAllFramesComputed = makeComputedArtifact(
|
|
34
34
|
FirstContentfulPaintAllFrames,
|
|
35
35
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
36
36
|
);
|
|
37
|
+
export {FirstContentfulPaintAllFramesComputed as FirstContentfulPaintAllFrames};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import NavigationMetric from './navigation-metric.js';
|
|
9
|
-
import LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
10
10
|
|
|
11
11
|
class FirstContentfulPaint extends NavigationMetric {
|
|
12
12
|
/**
|
|
@@ -33,7 +33,8 @@ class FirstContentfulPaint extends NavigationMetric {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const FirstContentfulPaintComputed = makeComputedArtifact(
|
|
37
37
|
FirstContentfulPaint,
|
|
38
38
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
39
39
|
);
|
|
40
|
+
export {FirstContentfulPaintComputed as FirstContentfulPaint};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import NavigationMetric from './navigation-metric.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
9
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
10
|
-
import LanternFirstMeaningfulPaint from './lantern-first-meaningful-paint.js';
|
|
10
|
+
import {LanternFirstMeaningfulPaint} from './lantern-first-meaningful-paint.js';
|
|
11
11
|
|
|
12
12
|
class FirstMeaningfulPaint extends NavigationMetric {
|
|
13
13
|
/**
|
|
@@ -37,7 +37,8 @@ class FirstMeaningfulPaint extends NavigationMetric {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
const FirstMeaningfulPaintComputed = makeComputedArtifact(
|
|
41
41
|
FirstMeaningfulPaint,
|
|
42
42
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
43
43
|
);
|
|
44
|
+
export {FirstMeaningfulPaintComputed as FirstMeaningfulPaint};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import NavigationMetric from './navigation-metric.js';
|
|
9
|
-
import LanternInteractive from './lantern-interactive.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
|
+
import {LanternInteractive} from './lantern-interactive.js';
|
|
10
10
|
import {NetworkMonitor} from '../../gather/driver/network-monitor.js';
|
|
11
11
|
import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
|
|
12
12
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
@@ -179,10 +179,11 @@ class Interactive extends NavigationMetric {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
const InteractiveComputed = makeComputedArtifact(
|
|
183
183
|
Interactive,
|
|
184
184
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
185
185
|
);
|
|
186
|
+
export {InteractiveComputed as Interactive};
|
|
186
187
|
|
|
187
188
|
/**
|
|
188
189
|
* @typedef TimePeriod
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import LanternMetric from './lantern-metric.js';
|
|
8
|
+
import {LanternMetric} from './lantern-metric.js';
|
|
9
9
|
import {BaseNode} from '../../lib/dependency-graph/base-node.js';
|
|
10
10
|
|
|
11
11
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
@@ -197,7 +197,8 @@ class LanternFirstContentfulPaint extends LanternMetric {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
const LanternFirstContentfulPaintComputed = makeComputedArtifact(
|
|
201
201
|
LanternFirstContentfulPaint,
|
|
202
202
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
203
203
|
);
|
|
204
|
+
export {LanternFirstContentfulPaintComputed as LanternFirstContentfulPaint};
|