lighthouse 9.5.0-dev.20220906 → 9.5.0-dev.20220908
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/cli/cli-flags.js +17 -0
- package/cli/run.js +2 -2
- package/cli/test/smokehouse/core-tests.js +2 -3
- package/cli/test/smokehouse/report-assert.js +0 -4
- package/cli/test/smokehouse/smokehouse.js +6 -0
- 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/modern-image-formats.js +5 -5
- package/core/audits/byte-efficiency/offscreen-images.js +4 -4
- 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 +3 -3
- package/core/audits/byte-efficiency/uses-optimized-images.js +5 -5
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +2 -2
- package/core/audits/byte-efficiency/uses-responsive-images.js +3 -3
- package/core/audits/byte-efficiency/uses-text-compression.js +2 -2
- 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 +8 -8
- package/core/audits/errors-in-console.js +2 -2
- package/core/audits/final-screenshot.js +2 -2
- package/core/audits/font-display.js +7 -6
- package/core/audits/image-aspect-ratio.js +3 -3
- package/core/audits/image-size-responsive.js +3 -3
- package/core/audits/installable-manifest.js +1 -1
- package/core/audits/is-on-https.js +3 -3
- 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 +4 -4
- 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 +3 -3
- 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 -2
- package/core/audits/seo/link-text.js +2 -2
- package/core/audits/seo/plugins.js +0 -1
- package/core/audits/seo/robots-txt.js +0 -1
- package/core/audits/seo/tap-targets.js +2 -2
- package/core/audits/server-response-time.js +1 -1
- package/core/audits/service-worker.js +0 -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/unsized-images.js +4 -4
- package/core/audits/user-timings.js +1 -1
- package/core/audits/uses-rel-preconnect.js +12 -10
- package/core/audits/uses-rel-preload.js +6 -6
- 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 +5 -3
- 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 -3
- 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 +3 -3
- package/core/gather/driver/navigation.js +3 -3
- package/core/gather/driver/network-monitor.js +2 -2
- package/core/gather/gather-runner.js +3 -3
- package/core/gather/gatherers/dobetterweb/optimized-images.js +3 -3
- package/core/gather/gatherers/dobetterweb/response-compression.js +3 -3
- 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 -2
- package/core/gather/gatherers/main-document-content.js +1 -1
- package/core/gather/gatherers/script-elements.js +1 -1
- package/core/gather/gatherers/source-maps.js +0 -1
- package/core/gather/gatherers/trace-elements.js +4 -4
- package/core/index.js +3 -3
- package/core/lib/asset-saver.js +4 -4
- package/core/lib/dependency-graph/simulator/network-analyzer.js +2 -2
- package/core/lib/icons.js +0 -2
- package/core/lib/manifest-parser.js +0 -2
- package/core/lib/network-request.js +7 -7
- package/core/lib/{url-shim.js → url-utils.js} +4 -12
- package/package.json +2 -3
- package/report/test/renderer/performance-category-renderer-test.js +0 -1
- package/report/test/renderer/report-renderer-test.js +0 -1
- package/tsconfig.json +1 -1
- package/core/fraggle-rock/replay/stringify-extension.js +0 -104
|
@@ -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
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {Audit} from './audit.js';
|
|
13
13
|
import * as i18n from './../lib/i18n/i18n.js';
|
|
14
|
-
import
|
|
14
|
+
import UrlUtils from '../lib/url-utils.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
17
17
|
/** Title of a Lighthouse audit that provides detail on whether all images have explicit width and height. This descriptive title is shown to users when every image has explicit width and height */
|
|
@@ -105,9 +105,9 @@ class UnsizedImages extends Audit {
|
|
|
105
105
|
* @return {boolean}
|
|
106
106
|
*/
|
|
107
107
|
static isNonNetworkSvg(image) {
|
|
108
|
-
const isSvg =
|
|
108
|
+
const isSvg = UrlUtils.guessMimeType(image.src) === 'image/svg+xml';
|
|
109
109
|
const urlScheme = image.src.slice(0, image.src.indexOf(':'));
|
|
110
|
-
const isNonNetwork =
|
|
110
|
+
const isNonNetwork = UrlUtils.isNonNetworkProtocol(urlScheme);
|
|
111
111
|
return isSvg && isNonNetwork;
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -139,7 +139,7 @@ class UnsizedImages extends Audit {
|
|
|
139
139
|
if (isNotDisplayed) continue;
|
|
140
140
|
|
|
141
141
|
unsizedImages.push({
|
|
142
|
-
url:
|
|
142
|
+
url: UrlUtils.elideDataURI(image.src),
|
|
143
143
|
node: Audit.makeNodeItem(image.node),
|
|
144
144
|
});
|
|
145
145
|
}
|
|
@@ -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'. */
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import {ByteEfficiencyAudit} from './byte-efficiency/byte-efficiency-audit.js';
|
|
9
|
-
import
|
|
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 => {
|
|
@@ -162,7 +163,8 @@ class UsesRelPreconnectAudit extends Audit {
|
|
|
162
163
|
});
|
|
163
164
|
|
|
164
165
|
const preconnectLinks = artifacts.LinkElements.filter(el => el.rel === 'preconnect');
|
|
165
|
-
const preconnectOrigins =
|
|
166
|
+
const preconnectOrigins =
|
|
167
|
+
new Set(preconnectLinks.map(link => UrlUtils.getOrigin(link.href || '')));
|
|
166
168
|
|
|
167
169
|
/** @type {Array<{url: string, wastedMs: number}>}*/
|
|
168
170
|
let results = [];
|
|
@@ -4,15 +4,15 @@
|
|
|
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
|
-
import
|
|
7
|
+
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. */
|
|
@@ -128,7 +128,7 @@ class UsesRelPreloadAudit extends Audit {
|
|
|
128
128
|
// It's not a request for the main frame, it wouldn't get reused even if you did preload it.
|
|
129
129
|
if (request.frameId !== mainResource.frameId) return false;
|
|
130
130
|
// We survived everything else, just check that it's a first party request.
|
|
131
|
-
return
|
|
131
|
+
return UrlUtils.rootDomainsMatch(request.url, mainResource.url);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/**
|
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};
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
import
|
|
7
|
+
import UrlUtils from '../lib/url-utils.js';
|
|
8
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
9
|
|
|
10
10
|
class ImageRecords {
|
|
@@ -43,7 +43,7 @@ class ImageRecords {
|
|
|
43
43
|
// Don't change the guessed mime type if no mime type was found.
|
|
44
44
|
imageRecords.push({
|
|
45
45
|
...element,
|
|
46
|
-
mimeType: mimeType ? mimeType :
|
|
46
|
+
mimeType: mimeType ? mimeType : UrlUtils.guessMimeType(element.src),
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -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};
|
|
@@ -5,9 +5,9 @@
|
|
|
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 {LighthouseError} from '../../lib/lh-error.js';
|
|
10
|
-
import LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
10
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
12
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
13
13
|
|
|
@@ -76,7 +76,8 @@ class LanternFirstMeaningfulPaint extends LanternMetric {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
const LanternFirstMeaningfulPaintComputed = makeComputedArtifact(
|
|
80
80
|
LanternFirstMeaningfulPaint,
|
|
81
81
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
82
82
|
);
|
|
83
|
+
export {LanternFirstMeaningfulPaintComputed as LanternFirstMeaningfulPaint};
|
|
@@ -5,10 +5,10 @@
|
|
|
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
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
11
|
-
import LanternFirstMeaningfulPaint from './lantern-first-meaningful-paint.js';
|
|
11
|
+
import {LanternFirstMeaningfulPaint} from './lantern-first-meaningful-paint.js';
|
|
12
12
|
|
|
13
13
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
14
14
|
|
|
@@ -106,7 +106,8 @@ class LanternInteractive extends LanternMetric {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
const LanternInteractiveComputed = makeComputedArtifact(
|
|
110
110
|
LanternInteractive,
|
|
111
111
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
112
112
|
);
|
|
113
|
+
export {LanternInteractiveComputed as LanternInteractive};
|
|
@@ -5,9 +5,9 @@
|
|
|
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 {LighthouseError} from '../../lib/lh-error.js';
|
|
10
|
-
import LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
10
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
12
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
13
13
|
|
|
@@ -104,7 +104,8 @@ class LanternLargestContentfulPaint extends LanternMetric {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
const LanternLargestContentfulPaintComputed = makeComputedArtifact(
|
|
108
108
|
LanternLargestContentfulPaint,
|
|
109
109
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
110
110
|
);
|
|
111
|
+
export {LanternLargestContentfulPaintComputed as LanternLargestContentfulPaint};
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import
|
|
8
|
+
import {LanternMetric} from './lantern-metric.js';
|
|
9
9
|
import {BaseNode} from '../../lib/dependency-graph/base-node.js';
|
|
10
|
-
import LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
10
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
12
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
13
13
|
|
|
14
|
-
class LanternMaxPotentialFID extends
|
|
14
|
+
class LanternMaxPotentialFID extends LanternMetric {
|
|
15
15
|
/**
|
|
16
16
|
* @return {LH.Gatherer.Simulation.MetricCoefficients}
|
|
17
17
|
*/
|
|
@@ -86,7 +86,8 @@ class LanternMaxPotentialFID extends LanternMetricArtifact {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
const LanternMaxPotentialFIDComputed = makeComputedArtifact(
|
|
90
90
|
LanternMaxPotentialFID,
|
|
91
91
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
92
92
|
);
|
|
93
|
+
export {LanternMaxPotentialFIDComputed as LanternMaxPotentialFID};
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
import {BaseNode} from '../../lib/dependency-graph/base-node.js';
|
|
8
8
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
9
|
-
import ProcessedTrace from '../processed-trace.js';
|
|
10
|
-
import ProcessedNavigation from '../processed-navigation.js';
|
|
11
|
-
import PageDependencyGraph from '../page-dependency-graph.js';
|
|
12
|
-
import LoadSimulator from '../load-simulator.js';
|
|
9
|
+
import {ProcessedTrace} from '../processed-trace.js';
|
|
10
|
+
import {ProcessedNavigation} from '../processed-navigation.js';
|
|
11
|
+
import {PageDependencyGraph} from '../page-dependency-graph.js';
|
|
12
|
+
import {LoadSimulator} from '../load-simulator.js';
|
|
13
13
|
|
|
14
14
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
15
15
|
/** @typedef {import('../../lib/dependency-graph/network-node').NetworkNode} NetworkNode */
|
|
@@ -24,7 +24,7 @@ import LoadSimulator from '../load-simulator.js';
|
|
|
24
24
|
* @property {{speedIndex: number}=} speedline
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class LanternMetric {
|
|
28
28
|
/**
|
|
29
29
|
* @param {Node} dependencyGraph
|
|
30
30
|
* @param {function(NetworkNode):boolean=} condition
|
|
@@ -161,4 +161,4 @@ class LanternMetricArtifact {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
export
|
|
164
|
+
export {LanternMetric};
|
|
@@ -5,10 +5,10 @@
|
|
|
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
|
-
import Speedline from '../speedline.js';
|
|
11
|
-
import LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
10
|
+
import {Speedline} from '../speedline.js';
|
|
11
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
12
12
|
import {throttling as defaultThrottling} from '../../config/constants.js';
|
|
13
13
|
|
|
14
14
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
@@ -143,7 +143,8 @@ class LanternSpeedIndex extends LanternMetric {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
const LanternSpeedIndexComputed = makeComputedArtifact(
|
|
147
147
|
LanternSpeedIndex,
|
|
148
148
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
149
149
|
);
|
|
150
|
+
export {LanternSpeedIndexComputed as LanternSpeedIndex};
|