lighthouse 9.1.0-dev.20211210 → 9.1.0-dev.20211214
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/dist/report/bundle.esm.js +3 -3
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- package/flow-report/assets/styles.css +1 -1
- package/lighthouse-core/audits/apple-touch-icon.js +2 -2
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +0 -3
- package/lighthouse-core/audits/no-unload-listeners.js +1 -1
- package/lighthouse-core/computed/critical-request-chains.js +2 -2
- package/lighthouse-core/computed/page-dependency-graph.js +25 -15
- package/lighthouse-core/computed/unused-css.js +3 -3
- package/lighthouse-core/config/default-config.js +1 -1
- package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +1 -1
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +19 -8
- package/lighthouse-core/fraggle-rock/user-flow.js +9 -5
- package/lighthouse-core/gather/driver/wait-for-condition.js +1 -1
- package/lighthouse-core/gather/gatherers/accessibility.js +1 -1
- package/lighthouse-core/gather/gatherers/anchor-elements.js +1 -1
- package/lighthouse-core/gather/gatherers/cache-contents.js +1 -1
- package/lighthouse-core/gather/gatherers/console-messages.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +1 -1
- package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +2 -2
- package/lighthouse-core/gather/gatherers/form-elements.js +3 -3
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +1 -1
- package/lighthouse-core/gather/gatherers/global-listeners.js +1 -1
- package/lighthouse-core/gather/gatherers/iframe-elements.js +1 -1
- package/lighthouse-core/gather/gatherers/inspector-issues.js +1 -1
- package/lighthouse-core/gather/gatherers/js-usage.js +1 -1
- package/lighthouse-core/gather/gatherers/main-document-content.js +1 -1
- package/lighthouse-core/gather/gatherers/meta-elements.js +1 -1
- package/lighthouse-core/gather/gatherers/script-elements.js +1 -1
- package/lighthouse-core/gather/gatherers/seo/embedded-content.js +1 -1
- package/lighthouse-core/gather/gatherers/seo/font-size.js +1 -1
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +1 -1
- package/lighthouse-core/gather/gatherers/service-worker.js +1 -1
- package/lighthouse-core/gather/gatherers/source-maps.js +1 -1
- package/lighthouse-core/gather/gatherers/trace-elements.js +1 -1
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +1 -1
- package/lighthouse-core/lib/dependency-graph/base-node.js +8 -0
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +3 -2
- package/package.json +9 -8
- package/report/assets/styles.css +15 -12
- package/report/assets/templates.html +1 -1
- package/report/renderer/components.js +2 -2
- package/report/renderer/report-renderer.js +1 -1
- package/report/test-assets/faux-psi-template.html +85 -26
- package/report/test-assets/faux-psi.js +44 -8
- package/shared/localization/locales/en-US.json +1 -1
- package/shared/localization/locales/en-XL.json +1 -1
- package/types/config.d.ts +1 -0
|
@@ -178,8 +178,6 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
178
178
|
['Array.isArray', 'es6.array.is-array'],
|
|
179
179
|
['Array.prototype.map', 'es6.array.map'],
|
|
180
180
|
['Array.of', 'es6.array.of'],
|
|
181
|
-
['Array.prototype.reduce', 'es6.array.reduce'],
|
|
182
|
-
['Array.prototype.reduceRight', 'es6.array.reduce-right'],
|
|
183
181
|
['Array.prototype.some', 'es6.array.some'],
|
|
184
182
|
['Date.now', 'es6.date.now'],
|
|
185
183
|
['Date.prototype.toISOString', 'es6.date.to-iso-string'],
|
|
@@ -188,7 +186,6 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
188
186
|
['Function.prototype.name', 'es6.function.name'],
|
|
189
187
|
['Number.isInteger', 'es6.number.is-integer'],
|
|
190
188
|
['Number.isSafeInteger', 'es6.number.is-safe-integer'],
|
|
191
|
-
['Number.parseInt', 'es6.number.parse-int'],
|
|
192
189
|
['Object.defineProperties', 'es6.object.define-properties'],
|
|
193
190
|
['Object.defineProperty', 'es6.object.define-property'],
|
|
194
191
|
['Object.freeze', 'es6.object.freeze'],
|
|
@@ -15,7 +15,7 @@ const UIStrings = {
|
|
|
15
15
|
/** Descriptive title of a Lighthouse audit that checks if a web page has 'unload' event listeners and finds that it is using them. */
|
|
16
16
|
failureTitle: 'Registers an `unload` listener',
|
|
17
17
|
/** Description of a Lighthouse audit that tells the user why pages should not use the 'unload' event. This is displayed after a user expands the section to see more. 'Learn More' becomes link text to additional documentation. */
|
|
18
|
-
description: 'The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache.
|
|
18
|
+
description: 'The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache. Use `pagehide` or `visibilitychange` events instead. [Learn more](https://web.dev/bfcache/#never-use-the-unload-event)',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
|
@@ -41,8 +41,8 @@ class CriticalRequestChains {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Iframes are considered High Priority but they are not render blocking
|
|
44
|
-
const isIframe = request.resourceType === NetworkRequest.TYPES.Document
|
|
45
|
-
|
|
44
|
+
const isIframe = request.resourceType === NetworkRequest.TYPES.Document &&
|
|
45
|
+
request.frameId !== mainResource.frameId;
|
|
46
46
|
// XHRs are fetched at High priority, but we exclude them, as they are unlikely to be critical
|
|
47
47
|
// Images are also non-critical.
|
|
48
48
|
// Treat any missed images, primarily favicons, as non-critical resources
|
|
@@ -147,6 +147,9 @@ class PageDependencyGraph {
|
|
|
147
147
|
const directInitiatorRequest = node.record.initiatorRequest || rootNode.record;
|
|
148
148
|
const directInitiatorNode =
|
|
149
149
|
networkNodeOutput.idToNodeMap.get(directInitiatorRequest.requestId) || rootNode;
|
|
150
|
+
const canDependOnInitiator =
|
|
151
|
+
!directInitiatorNode.isDependentOn(node) &&
|
|
152
|
+
node.canDependOn(directInitiatorNode);
|
|
150
153
|
const initiators = PageDependencyGraph.getNetworkInitiators(node.record);
|
|
151
154
|
if (initiators.length) {
|
|
152
155
|
initiators.forEach(initiator => {
|
|
@@ -156,16 +159,18 @@ class PageDependencyGraph {
|
|
|
156
159
|
parentCandidates[0].startTime <= node.startTime &&
|
|
157
160
|
!parentCandidates[0].isDependentOn(node)) {
|
|
158
161
|
node.addDependency(parentCandidates[0]);
|
|
159
|
-
} else if (
|
|
162
|
+
} else if (canDependOnInitiator) {
|
|
160
163
|
directInitiatorNode.addDependent(node);
|
|
161
164
|
}
|
|
162
165
|
});
|
|
163
|
-
} else if (
|
|
166
|
+
} else if (canDependOnInitiator) {
|
|
164
167
|
directInitiatorNode.addDependent(node);
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
// Make sure the nodes are attached to the graph if the initiator information was invalid.
|
|
168
|
-
if (node !== rootNode && node.getDependencies().length === 0
|
|
171
|
+
if (node !== rootNode && node.getDependencies().length === 0 && node.canDependOn(rootNode)) {
|
|
172
|
+
node.addDependency(rootNode);
|
|
173
|
+
}
|
|
169
174
|
|
|
170
175
|
if (!node.record.redirects) return;
|
|
171
176
|
|
|
@@ -321,7 +326,8 @@ class PageDependencyGraph {
|
|
|
321
326
|
}
|
|
322
327
|
}
|
|
323
328
|
|
|
324
|
-
|
|
329
|
+
// Nodes starting before the root node cannot depend on it.
|
|
330
|
+
if (node.getNumberOfDependencies() === 0 && node.canDependOn(rootNode)) {
|
|
325
331
|
node.addDependency(rootNode);
|
|
326
332
|
}
|
|
327
333
|
}
|
|
@@ -388,23 +394,27 @@ class PageDependencyGraph {
|
|
|
388
394
|
const networkNodeOutput = PageDependencyGraph.getNetworkNodeOutput(networkRecords);
|
|
389
395
|
const cpuNodes = PageDependencyGraph.getCPUNodes(processedTrace);
|
|
390
396
|
|
|
391
|
-
// The root request is the earliest network request, using position in networkRecords array to break ties.
|
|
392
|
-
const rootRequest = networkRecords.reduce((min, r) => (r.startTime < min.startTime ? r : min));
|
|
393
|
-
const rootNode = networkNodeOutput.idToNodeMap.get(rootRequest.requestId);
|
|
394
397
|
// The main document request is the earliest network request *of type document*.
|
|
395
398
|
// This will be different from the root request when there are server redirects.
|
|
396
399
|
const mainDocumentRequest = NetworkAnalyzer.findMainDocument(networkRecords);
|
|
397
400
|
const mainDocumentNode = networkNodeOutput.idToNodeMap.get(mainDocumentRequest.requestId);
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
throw new Error(`${rootNode ? 'mainDocument' : 'root'}Node not found.`);
|
|
401
|
+
if (!mainDocumentNode) {
|
|
402
|
+
// mainDocumentNode should always be found.
|
|
403
|
+
throw new Error('mainDocumentNode not found.');
|
|
402
404
|
}
|
|
403
405
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
// The root request is the earliest request in the main document redirect chain.
|
|
407
|
+
// Will be undefined if there were no redirects.
|
|
408
|
+
const rootRequest = mainDocumentNode.record.redirects && mainDocumentNode.record.redirects[0];
|
|
409
|
+
|
|
410
|
+
let rootNode;
|
|
411
|
+
if (rootRequest) {
|
|
412
|
+
// rootNode should always be found.
|
|
413
|
+
rootNode = rootRequest && networkNodeOutput.idToNodeMap.get(rootRequest.requestId);
|
|
414
|
+
if (!rootNode) throw new Error('rootNode not found');
|
|
415
|
+
} else {
|
|
416
|
+
// Use main document as root if there were no redirects.
|
|
417
|
+
rootNode = mainDocumentNode;
|
|
408
418
|
}
|
|
409
419
|
|
|
410
420
|
PageDependencyGraph.linkNetworkNodes(rootNode, networkNodeOutput);
|
|
@@ -98,9 +98,9 @@ class UnusedCSS {
|
|
|
98
98
|
const firstRuleStart = preview.indexOf('{');
|
|
99
99
|
const firstRuleEnd = preview.indexOf('}');
|
|
100
100
|
|
|
101
|
-
if (firstRuleStart === -1 || firstRuleEnd === -1
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
if (firstRuleStart === -1 || firstRuleEnd === -1 ||
|
|
102
|
+
firstRuleStart > firstRuleEnd ||
|
|
103
|
+
firstRuleStart > PREVIEW_LENGTH) {
|
|
104
104
|
// We couldn't determine the first rule-set or it's not within the preview
|
|
105
105
|
preview = preview.slice(0, PREVIEW_LENGTH) + '...';
|
|
106
106
|
} else if (firstRuleEnd < PREVIEW_LENGTH) {
|
|
@@ -463,6 +463,7 @@ const defaultConfig = {
|
|
|
463
463
|
{id: 'non-composited-animations', weight: 0},
|
|
464
464
|
{id: 'unsized-images', weight: 0},
|
|
465
465
|
{id: 'viewport', weight: 0},
|
|
466
|
+
{id: 'no-unload-listeners', weight: 0},
|
|
466
467
|
|
|
467
468
|
// Budget audits.
|
|
468
469
|
{id: 'performance-budget', weight: 0, group: 'budgets'},
|
|
@@ -566,7 +567,6 @@ const defaultConfig = {
|
|
|
566
567
|
{id: 'doctype', weight: 1, group: 'best-practices-browser-compat'},
|
|
567
568
|
{id: 'charset', weight: 1, group: 'best-practices-browser-compat'},
|
|
568
569
|
// General Group
|
|
569
|
-
{id: 'no-unload-listeners', weight: 1, group: 'best-practices-general'},
|
|
570
570
|
{id: 'js-libraries', weight: 0, group: 'best-practices-general'},
|
|
571
571
|
{id: 'deprecations', weight: 1, group: 'best-practices-general'},
|
|
572
572
|
{id: 'errors-in-console', weight: 1, group: 'best-practices-general'},
|
|
@@ -27,6 +27,8 @@ const Trace = require('../../gather/gatherers/trace.js');
|
|
|
27
27
|
const DevtoolsLog = require('../../gather/gatherers/devtools-log.js');
|
|
28
28
|
const NetworkRecords = require('../../computed/network-records.js');
|
|
29
29
|
|
|
30
|
+
/** @typedef {{skipAboutBlank?: boolean}} InternalOptions */
|
|
31
|
+
|
|
30
32
|
/**
|
|
31
33
|
* @typedef NavigationContext
|
|
32
34
|
* @property {Driver} driver
|
|
@@ -35,17 +37,20 @@ const NetworkRecords = require('../../computed/network-records.js');
|
|
|
35
37
|
* @property {string} requestedUrl
|
|
36
38
|
* @property {LH.FRBaseArtifacts} baseArtifacts
|
|
37
39
|
* @property {Map<string, LH.ArbitraryEqualityMap>} computedCache
|
|
40
|
+
* @property {InternalOptions} [options]
|
|
38
41
|
*/
|
|
39
42
|
|
|
40
43
|
/** @typedef {Omit<Parameters<typeof collectPhaseArtifacts>[0], 'phase'>} PhaseState */
|
|
41
44
|
|
|
42
45
|
/**
|
|
43
|
-
* @param {{driver: Driver, config: LH.Config.FRConfig, requestedUrl: string}} args
|
|
46
|
+
* @param {{driver: Driver, config: LH.Config.FRConfig, requestedUrl: string, options?: InternalOptions}} args
|
|
44
47
|
* @return {Promise<{baseArtifacts: LH.FRBaseArtifacts}>}
|
|
45
48
|
*/
|
|
46
|
-
async function _setup({driver, config, requestedUrl}) {
|
|
49
|
+
async function _setup({driver, config, requestedUrl, options}) {
|
|
47
50
|
await driver.connect();
|
|
48
|
-
|
|
51
|
+
if (!options?.skipAboutBlank) {
|
|
52
|
+
await gotoURL(driver, defaultNavigationConfig.blankPage, {waitUntil: ['navigated']});
|
|
53
|
+
}
|
|
49
54
|
|
|
50
55
|
const baseArtifacts = await getBaseArtifacts(config, driver, {gatherMode: 'navigation'});
|
|
51
56
|
baseArtifacts.URL.requestedUrl = requestedUrl;
|
|
@@ -59,8 +64,10 @@ async function _setup({driver, config, requestedUrl}) {
|
|
|
59
64
|
* @param {NavigationContext} navigationContext
|
|
60
65
|
* @return {Promise<{warnings: Array<LH.IcuMessage>}>}
|
|
61
66
|
*/
|
|
62
|
-
async function _setupNavigation({requestedUrl, driver, navigation, config}) {
|
|
63
|
-
|
|
67
|
+
async function _setupNavigation({requestedUrl, driver, navigation, config, options}) {
|
|
68
|
+
if (!options?.skipAboutBlank) {
|
|
69
|
+
await gotoURL(driver, navigation.blankPage, {...navigation, waitUntil: ['navigated']});
|
|
70
|
+
}
|
|
64
71
|
const {warnings} = await prepare.prepareTargetForIndividualNavigation(
|
|
65
72
|
driver.defaultSession,
|
|
66
73
|
config.settings,
|
|
@@ -216,10 +223,10 @@ async function _navigation(navigationContext) {
|
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
/**
|
|
219
|
-
* @param {{driver: Driver, config: LH.Config.FRConfig, requestedUrl: string; baseArtifacts: LH.FRBaseArtifacts, computedCache: NavigationContext['computedCache']}} args
|
|
226
|
+
* @param {{driver: Driver, config: LH.Config.FRConfig, requestedUrl: string; baseArtifacts: LH.FRBaseArtifacts, computedCache: NavigationContext['computedCache'], options?: InternalOptions}} args
|
|
220
227
|
* @return {Promise<{artifacts: Partial<LH.FRArtifacts & LH.FRBaseArtifacts>}>}
|
|
221
228
|
*/
|
|
222
|
-
async function _navigations({driver, config, requestedUrl, baseArtifacts, computedCache}) {
|
|
229
|
+
async function _navigations({driver, config, requestedUrl, baseArtifacts, computedCache, options}) {
|
|
223
230
|
if (!config.navigations) throw new Error('No navigations configured');
|
|
224
231
|
|
|
225
232
|
/** @type {Partial<LH.FRArtifacts & LH.FRBaseArtifacts>} */
|
|
@@ -235,6 +242,7 @@ async function _navigations({driver, config, requestedUrl, baseArtifacts, comput
|
|
|
235
242
|
config,
|
|
236
243
|
baseArtifacts,
|
|
237
244
|
computedCache,
|
|
245
|
+
options,
|
|
238
246
|
};
|
|
239
247
|
|
|
240
248
|
let shouldHaltNavigations = false;
|
|
@@ -274,11 +282,14 @@ async function navigation(options) {
|
|
|
274
282
|
const {url: requestedUrl, page, configContext = {}} = options;
|
|
275
283
|
const {config} = initializeConfig(options.config, {...configContext, gatherMode: 'navigation'});
|
|
276
284
|
const computedCache = new Map();
|
|
285
|
+
const internalOptions = {
|
|
286
|
+
skipAboutBlank: configContext.skipAboutBlank,
|
|
287
|
+
};
|
|
277
288
|
|
|
278
289
|
return Runner.run(
|
|
279
290
|
async () => {
|
|
280
291
|
const driver = new Driver(page);
|
|
281
|
-
const context = {driver, config, requestedUrl};
|
|
292
|
+
const context = {driver, config, requestedUrl, options: internalOptions};
|
|
282
293
|
const {baseArtifacts} = await _setup(context);
|
|
283
294
|
const {artifacts} = await _navigations({...context, baseArtifacts, computedCache});
|
|
284
295
|
await _cleanup(context);
|
|
@@ -59,20 +59,24 @@ class UserFlow {
|
|
|
59
59
|
*/
|
|
60
60
|
_getNextNavigationOptions(url, stepOptions) {
|
|
61
61
|
const options = {url, ...this.options, ...stepOptions};
|
|
62
|
+
const configContext = {...options.configContext};
|
|
63
|
+
const settingsOverrides = {...configContext.settingsOverrides};
|
|
64
|
+
|
|
65
|
+
if (configContext.skipAboutBlank === undefined) {
|
|
66
|
+
configContext.skipAboutBlank = true;
|
|
67
|
+
}
|
|
62
68
|
|
|
63
69
|
// On repeat navigations, we want to disable storage reset by default (i.e. it's not a cold load).
|
|
64
70
|
const isSubsequentNavigation = this.steps.some(step => step.lhr.gatherMode === 'navigation');
|
|
65
71
|
if (isSubsequentNavigation) {
|
|
66
|
-
const configContext = {...options.configContext};
|
|
67
|
-
const settingsOverrides = {...configContext.settingsOverrides};
|
|
68
72
|
if (settingsOverrides.disableStorageReset === undefined) {
|
|
69
73
|
settingsOverrides.disableStorageReset = true;
|
|
70
74
|
}
|
|
71
|
-
|
|
72
|
-
configContext.settingsOverrides = settingsOverrides;
|
|
73
|
-
options.configContext = configContext;
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
configContext.settingsOverrides = settingsOverrides;
|
|
78
|
+
options.configContext = configContext;
|
|
79
|
+
|
|
76
80
|
return options;
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -22,7 +22,7 @@ const NetworkRecords = require('../../../computed/network-records.js');
|
|
|
22
22
|
const DevtoolsLog = require('../devtools-log.js');
|
|
23
23
|
const FRGatherer = require('../../../fraggle-rock/gather/base-gatherer.js');
|
|
24
24
|
|
|
25
|
-
/* global document, window,
|
|
25
|
+
/* global document, window, HTMLLinkElement, SVGScriptElement */
|
|
26
26
|
|
|
27
27
|
/** @typedef {{href: string, media: string, msSinceHTMLEnd: number, matches: boolean}} MediaChange */
|
|
28
28
|
/** @typedef {{tagName: 'LINK', url: string, href: string, rel: string, media: string, disabled: boolean, mediaChanges: Array<MediaChange>}} LinkTag */
|
|
@@ -119,7 +119,7 @@ class TagsBlockingFirstPaint extends FRGatherer {
|
|
|
119
119
|
meta = {
|
|
120
120
|
supportedModes: ['navigation'],
|
|
121
121
|
dependencies: {DevtoolsLog: DevtoolsLog.symbol},
|
|
122
|
-
}
|
|
122
|
+
};
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
@@ -49,8 +49,8 @@ function collectFormElements() {
|
|
|
49
49
|
forms.set(parentFormElement, newFormObj);
|
|
50
50
|
}
|
|
51
51
|
const formObj = forms.get(parentFormElement) || formlessObj;
|
|
52
|
-
if (child instanceof HTMLInputElement || child instanceof HTMLTextAreaElement
|
|
53
|
-
|
|
52
|
+
if (child instanceof HTMLInputElement || child instanceof HTMLTextAreaElement ||
|
|
53
|
+
child instanceof HTMLSelectElement) {
|
|
54
54
|
formObj.inputs.push({
|
|
55
55
|
id: child.id,
|
|
56
56
|
name: child.name,
|
|
@@ -89,7 +89,7 @@ class FormElements extends FRGatherer {
|
|
|
89
89
|
/** @type {LH.Gatherer.GathererMeta} */
|
|
90
90
|
meta = {
|
|
91
91
|
supportedModes: ['snapshot', 'navigation'],
|
|
92
|
-
}
|
|
92
|
+
};
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* @param {LH.Gatherer.FRTransitionalContext} passContext
|
|
@@ -345,6 +345,14 @@ class BaseNode {
|
|
|
345
345
|
|
|
346
346
|
return false;
|
|
347
347
|
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @param {Node} node
|
|
351
|
+
* @return {boolean}
|
|
352
|
+
*/
|
|
353
|
+
canDependOn(node) {
|
|
354
|
+
return node.startTime <= this.startTime;
|
|
355
|
+
}
|
|
348
356
|
}
|
|
349
357
|
|
|
350
358
|
BaseNode.TYPES = /** @type {{NETWORK: 'network', CPU: 'cpu'}} */({
|
|
@@ -198,8 +198,9 @@ class NetworkAnalyzer {
|
|
|
198
198
|
if (!Number.isFinite(timing.receiveHeadersEnd) || timing.receiveHeadersEnd < 0) return;
|
|
199
199
|
if (!record.resourceType) return;
|
|
200
200
|
|
|
201
|
-
const serverResponseTimePercentage =
|
|
202
|
-
||
|
|
201
|
+
const serverResponseTimePercentage =
|
|
202
|
+
SERVER_RESPONSE_PERCENTAGE_OF_TTFB[record.resourceType] ||
|
|
203
|
+
DEFAULT_SERVER_RESPONSE_PERCENTAGE;
|
|
203
204
|
const estimatedServerResponseTime = timing.receiveHeadersEnd * serverResponseTimePercentage;
|
|
204
205
|
|
|
205
206
|
// When connection was reused...
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
|
-
"version": "9.1.0-dev.
|
|
3
|
+
"version": "9.1.0-dev.20211214",
|
|
4
4
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
5
5
|
"main": "./lighthouse-core/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@types/chrome": "^0.0.154",
|
|
112
112
|
"@types/configstore": "^4.0.0",
|
|
113
113
|
"@types/cpy": "^5.1.0",
|
|
114
|
-
"@types/eslint": "^
|
|
114
|
+
"@types/eslint": "^8.2.1",
|
|
115
115
|
"@types/estree": "^0.0.50",
|
|
116
116
|
"@types/gh-pages": "^2.0.0",
|
|
117
117
|
"@types/google.analytics": "0.0.39",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"@types/ws": "^7.0.0",
|
|
133
133
|
"@types/yargs": "^16.0.0",
|
|
134
134
|
"@types/yargs-parser": "^15.0.0",
|
|
135
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
136
|
-
"@typescript-eslint/parser": "^
|
|
135
|
+
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
|
136
|
+
"@typescript-eslint/parser": "^5.6.0",
|
|
137
137
|
"acorn": "^8.5.0",
|
|
138
138
|
"angular": "^1.7.4",
|
|
139
139
|
"archiver": "^3.0.0",
|
|
@@ -146,10 +146,11 @@
|
|
|
146
146
|
"csv-validator": "^0.0.3",
|
|
147
147
|
"devtools-protocol": "0.0.939404",
|
|
148
148
|
"es-main": "^1.0.2",
|
|
149
|
-
"eslint": "^
|
|
150
|
-
"eslint-config-google": "^0.
|
|
151
|
-
"eslint-
|
|
152
|
-
"eslint-plugin-
|
|
149
|
+
"eslint": "^8.4.1",
|
|
150
|
+
"eslint-config-google": "^0.14.0",
|
|
151
|
+
"eslint-formatter-codeframe": "^7.32.1",
|
|
152
|
+
"eslint-plugin-import": "^2.25.3",
|
|
153
|
+
"eslint-plugin-local-rules": "1.1.0",
|
|
153
154
|
"event-target-shim": "^6.0.2",
|
|
154
155
|
"firebase": "^9.0.2",
|
|
155
156
|
"gh-pages": "^2.0.1",
|