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
|
@@ -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 LanternFirstContentfulPaint from './lantern-first-contentful-paint.js';
|
|
11
|
-
import LanternInteractive from './lantern-interactive.js';
|
|
10
|
+
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
|
+
import {LanternInteractive} from './lantern-interactive.js';
|
|
12
12
|
import {BLOCKING_TIME_THRESHOLD, calculateSumOfBlockingTime} from './tbt-utils.js';
|
|
13
13
|
|
|
14
14
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
@@ -119,7 +119,8 @@ class LanternTotalBlockingTime extends LanternMetric {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
const LanternTotalBlockingTimeComputed = makeComputedArtifact(
|
|
123
123
|
LanternTotalBlockingTime,
|
|
124
124
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
125
125
|
);
|
|
126
|
+
export {LanternTotalBlockingTimeComputed as LanternTotalBlockingTime};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
12
|
-
import NavigationMetric from './navigation-metric.js';
|
|
12
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
13
13
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
14
14
|
|
|
15
15
|
class LargestContentfulPaintAllFrames extends NavigationMetric {
|
|
@@ -38,7 +38,8 @@ class LargestContentfulPaintAllFrames extends NavigationMetric {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const LargestContentfulPaintAllFramesComputed = makeComputedArtifact(
|
|
42
42
|
LargestContentfulPaintAllFrames,
|
|
43
43
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
44
44
|
);
|
|
45
|
+
export {LargestContentfulPaintAllFramesComputed as LargestContentfulPaintAllFrames};
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
16
|
-
import NavigationMetric from './navigation-metric.js';
|
|
16
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
17
17
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
18
|
-
import LanternLargestContentfulPaint from './lantern-largest-contentful-paint.js';
|
|
18
|
+
import {LanternLargestContentfulPaint} from './lantern-largest-contentful-paint.js';
|
|
19
19
|
|
|
20
20
|
class LargestContentfulPaint extends NavigationMetric {
|
|
21
21
|
/**
|
|
@@ -45,7 +45,8 @@ class LargestContentfulPaint extends NavigationMetric {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const LargestContentfulPaintComputed = makeComputedArtifact(
|
|
49
49
|
LargestContentfulPaint,
|
|
50
50
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
51
51
|
);
|
|
52
|
+
export {LargestContentfulPaintComputed as LargestContentfulPaint};
|
|
@@ -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 LanternMaxPotentialFID from './lantern-max-potential-fid.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
|
+
import {LanternMaxPotentialFID} from './lantern-max-potential-fid.js';
|
|
10
10
|
import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
|
|
11
11
|
|
|
12
12
|
class MaxPotentialFID extends NavigationMetric {
|
|
@@ -38,7 +38,8 @@ class MaxPotentialFID extends NavigationMetric {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const MaxPotentialFIDComputed = makeComputedArtifact(
|
|
42
42
|
MaxPotentialFID,
|
|
43
43
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
44
44
|
);
|
|
45
|
+
export {MaxPotentialFIDComputed as MaxPotentialFID};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
|
|
8
|
-
import ProcessedTrace from '../processed-trace.js';
|
|
9
|
-
import ProcessedNavigation from '../processed-navigation.js';
|
|
10
|
-
import NetworkRecords from '../network-records.js';
|
|
8
|
+
import {ProcessedTrace} from '../processed-trace.js';
|
|
9
|
+
import {ProcessedNavigation} from '../processed-navigation.js';
|
|
10
|
+
import {NetworkRecords} from '../network-records.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @fileOverview Encapsulates logic for choosing the correct metric computation method based on the
|
|
@@ -4,11 +4,12 @@
|
|
|
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 Metric from './metric.js';
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* @fileOverview Enforces that a metric can only be computed on navigations.
|
|
11
9
|
*/
|
|
10
|
+
|
|
11
|
+
import Metric from './metric.js';
|
|
12
|
+
|
|
12
13
|
class NavigationMetric extends Metric {
|
|
13
14
|
/**
|
|
14
15
|
* @param {LH.Artifacts.NavigationMetricComputationData} data
|
|
@@ -42,4 +43,4 @@ class NavigationMetric extends Metric {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export
|
|
46
|
+
export {NavigationMetric};
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* @typedef {{name: 'FallbackTiming', duration: number}} FallbackTimingEvent
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
import ProcessedTrace from '../processed-trace.js';
|
|
33
|
+
import {ProcessedTrace} from '../processed-trace.js';
|
|
34
34
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
35
35
|
|
|
36
36
|
const KEYBOARD_EVENTS = new Set(['keydown', 'keypress', 'keyup']);
|
|
@@ -150,7 +150,8 @@ class Responsiveness {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
const ResponsivenessComputed = makeComputedArtifact(Responsiveness, [
|
|
154
154
|
'trace',
|
|
155
155
|
'settings',
|
|
156
156
|
]);
|
|
157
|
+
export {ResponsivenessComputed as Responsiveness};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import NavigationMetric from './navigation-metric.js';
|
|
9
|
-
import LanternSpeedIndex from './lantern-speed-index.js';
|
|
10
|
-
import Speedline from '../speedline.js';
|
|
8
|
+
import {NavigationMetric} from './navigation-metric.js';
|
|
9
|
+
import {LanternSpeedIndex} from './lantern-speed-index.js';
|
|
10
|
+
import {Speedline} from '../speedline.js';
|
|
11
11
|
|
|
12
12
|
class SpeedIndex extends NavigationMetric {
|
|
13
13
|
/**
|
|
@@ -33,7 +33,8 @@ class SpeedIndex extends NavigationMetric {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const SpeedIndexComputed = makeComputedArtifact(
|
|
37
37
|
SpeedIndex,
|
|
38
38
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
39
39
|
);
|
|
40
|
+
export {SpeedIndexComputed as SpeedIndex};
|
|
@@ -4,19 +4,19 @@
|
|
|
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 ProcessedTrace from '../processed-trace.js';
|
|
8
|
-
import ProcessedNavigation from '../processed-navigation.js';
|
|
9
|
-
import Speedline from '../speedline.js';
|
|
10
|
-
import FirstContentfulPaint from './first-contentful-paint.js';
|
|
11
|
-
import FirstContentfulPaintAllFrames from './first-contentful-paint-all-frames.js';
|
|
12
|
-
import FirstMeaningfulPaint from './first-meaningful-paint.js';
|
|
13
|
-
import LargestContentfulPaint from './largest-contentful-paint.js';
|
|
14
|
-
import LargestContentfulPaintAllFrames from './largest-contentful-paint-all-frames.js';
|
|
15
|
-
import Interactive from './interactive.js';
|
|
16
|
-
import CumulativeLayoutShift from './cumulative-layout-shift.js';
|
|
17
|
-
import SpeedIndex from './speed-index.js';
|
|
18
|
-
import MaxPotentialFID from './max-potential-fid.js';
|
|
19
|
-
import TotalBlockingTime from './total-blocking-time.js';
|
|
7
|
+
import {ProcessedTrace} from '../processed-trace.js';
|
|
8
|
+
import {ProcessedNavigation} from '../processed-navigation.js';
|
|
9
|
+
import {Speedline} from '../speedline.js';
|
|
10
|
+
import {FirstContentfulPaint} from './first-contentful-paint.js';
|
|
11
|
+
import {FirstContentfulPaintAllFrames} from './first-contentful-paint-all-frames.js';
|
|
12
|
+
import {FirstMeaningfulPaint} from './first-meaningful-paint.js';
|
|
13
|
+
import {LargestContentfulPaint} from './largest-contentful-paint.js';
|
|
14
|
+
import {LargestContentfulPaintAllFrames} from './largest-contentful-paint-all-frames.js';
|
|
15
|
+
import {Interactive} from './interactive.js';
|
|
16
|
+
import {CumulativeLayoutShift} from './cumulative-layout-shift.js';
|
|
17
|
+
import {SpeedIndex} from './speed-index.js';
|
|
18
|
+
import {MaxPotentialFID} from './max-potential-fid.js';
|
|
19
|
+
import {TotalBlockingTime} from './total-blocking-time.js';
|
|
20
20
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
21
21
|
|
|
22
22
|
class TimingSummary {
|
|
@@ -150,7 +150,8 @@ class TimingSummary {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
const TimingSummaryComputed = makeComputedArtifact(
|
|
154
154
|
TimingSummary,
|
|
155
155
|
['devtoolsLog', 'gatherContext', 'settings', 'trace', 'URL']
|
|
156
156
|
);
|
|
157
|
+
export {TimingSummaryComputed as TimingSummary};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import ComputedMetric from './metric.js';
|
|
9
9
|
import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
|
|
10
|
-
import LanternTotalBlockingTime from './lantern-total-blocking-time.js';
|
|
11
|
-
import
|
|
10
|
+
import {LanternTotalBlockingTime} from './lantern-total-blocking-time.js';
|
|
11
|
+
import {Interactive} from './interactive.js';
|
|
12
12
|
import {calculateSumOfBlockingTime} from './tbt-utils.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -46,7 +46,7 @@ class TotalBlockingTime extends ComputedMetric {
|
|
|
46
46
|
if (data.processedNavigation) {
|
|
47
47
|
const {firstContentfulPaint} = data.processedNavigation.timings;
|
|
48
48
|
const metricData = ComputedMetric.getMetricComputationInput(data);
|
|
49
|
-
const interactiveTimeMs = (await
|
|
49
|
+
const interactiveTimeMs = (await Interactive.request(metricData, context)).timing;
|
|
50
50
|
|
|
51
51
|
return {
|
|
52
52
|
timing: calculateSumOfBlockingTime(
|
|
@@ -67,7 +67,8 @@ class TotalBlockingTime extends ComputedMetric {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
const TotalBlockingTimeComputed = makeComputedArtifact(
|
|
71
71
|
TotalBlockingTime,
|
|
72
72
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
73
73
|
);
|
|
74
|
+
export {TotalBlockingTimeComputed as TotalBlockingTime};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import
|
|
8
|
+
import {JSBundles} from './js-bundles.js';
|
|
9
9
|
|
|
10
10
|
const RELATIVE_SIZE_THRESHOLD = 0.1;
|
|
11
11
|
const ABSOLUTE_SIZE_THRESHOLD_BYTES = 1024 * 0.5;
|
|
@@ -77,7 +77,7 @@ class ModuleDuplication {
|
|
|
77
77
|
* @param {LH.Artifacts.ComputedContext} context
|
|
78
78
|
*/
|
|
79
79
|
static async compute_(artifacts, context) {
|
|
80
|
-
const bundles = await
|
|
80
|
+
const bundles = await JSBundles.request(artifacts, context);
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* @typedef SourceData
|
|
@@ -133,4 +133,6 @@ class ModuleDuplication {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
const ModuleDuplicationComputed =
|
|
137
|
+
makeComputedArtifact(ModuleDuplication, ['Scripts', 'SourceMaps']);
|
|
138
|
+
export {ModuleDuplicationComputed as ModuleDuplication};
|
|
@@ -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
|
class NetworkAnalysis {
|
|
12
12
|
/**
|
|
@@ -60,4 +60,5 @@ class NetworkAnalysis {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
const NetworkAnalysisComputed = makeComputedArtifact(NetworkAnalysis, null);
|
|
64
|
+
export {NetworkAnalysisComputed as NetworkAnalysis};
|
|
@@ -9,13 +9,21 @@ import {NetworkNode} from '../lib/dependency-graph/network-node.js';
|
|
|
9
9
|
import {CPUNode} from '../lib/dependency-graph/cpu-node.js';
|
|
10
10
|
import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
|
|
11
11
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
12
|
-
import ProcessedTrace from './processed-trace.js';
|
|
13
|
-
import NetworkRecords from './network-records.js';
|
|
12
|
+
import {ProcessedTrace} from './processed-trace.js';
|
|
13
|
+
import {NetworkRecords} from './network-records.js';
|
|
14
14
|
import {NetworkAnalyzer} from '../lib/dependency-graph/simulator/network-analyzer.js';
|
|
15
15
|
|
|
16
16
|
/** @typedef {import('../lib/dependency-graph/base-node.js').Node} Node */
|
|
17
17
|
/** @typedef {Omit<LH.Artifacts['URL'], 'initialUrl'|'finalUrl'>} URLArtifact */
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} NetworkNodeOutput
|
|
21
|
+
* @property {Array<NetworkNode>} nodes
|
|
22
|
+
* @property {Map<string, NetworkNode>} idToNodeMap
|
|
23
|
+
* @property {Map<string, Array<NetworkNode>>} urlToNodeMap
|
|
24
|
+
* @property {Map<string, NetworkNode|null>} frameIdToNodeMap
|
|
25
|
+
*/
|
|
26
|
+
|
|
19
27
|
// Shorter tasks have negligible impact on simulation results.
|
|
20
28
|
const SIGNIFICANT_DUR_THRESHOLD_MS = 10;
|
|
21
29
|
|
|
@@ -503,12 +511,6 @@ class PageDependencyGraph {
|
|
|
503
511
|
}
|
|
504
512
|
}
|
|
505
513
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
* @typedef {Object} NetworkNodeOutput
|
|
510
|
-
* @property {Array<NetworkNode>} nodes
|
|
511
|
-
* @property {Map<string, NetworkNode>} idToNodeMap
|
|
512
|
-
* @property {Map<string, Array<NetworkNode>>} urlToNodeMap
|
|
513
|
-
* @property {Map<string, NetworkNode|null>} frameIdToNodeMap
|
|
514
|
-
*/
|
|
514
|
+
const PageDependencyGraphComputed =
|
|
515
|
+
makeComputedArtifact(PageDependencyGraph, ['devtoolsLog', 'trace', 'URL']);
|
|
516
|
+
export {PageDependencyGraphComputed as PageDependencyGraph};
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import NetworkRecords from './network-records.js';
|
|
9
|
-
import URL from '../lib/url-shim.js';
|
|
8
|
+
import {NetworkRecords} from './network-records.js';
|
|
10
9
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
11
10
|
import {Budget} from '../config/budget.js';
|
|
12
11
|
import {Util} from '../util.cjs';
|
|
@@ -110,4 +109,6 @@ class ResourceSummary {
|
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
const ResourceSummaryComputed =
|
|
113
|
+
makeComputedArtifact(ResourceSummary, ['URL', 'devtoolsLog', 'budgets']);
|
|
114
|
+
export {ResourceSummaryComputed as ResourceSummary};
|
|
@@ -8,7 +8,7 @@ import speedline from 'speedline-core';
|
|
|
8
8
|
|
|
9
9
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
10
10
|
import {LighthouseError} from '../lib/lh-error.js';
|
|
11
|
-
import ProcessedTrace from './processed-trace.js';
|
|
11
|
+
import {ProcessedTrace} from './processed-trace.js';
|
|
12
12
|
|
|
13
13
|
class Speedline {
|
|
14
14
|
/**
|
|
@@ -51,4 +51,5 @@ class Speedline {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
const SpeedlineComputed = makeComputedArtifact(Speedline, null);
|
|
55
|
+
export {SpeedlineComputed as Speedline};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import {ByteEfficiencyAudit} from '../audits/byte-efficiency/byte-efficiency-audit.js';
|
|
9
|
-
import NetworkRecords from './network-records.js';
|
|
9
|
+
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
|
|
11
11
|
const PREVIEW_LENGTH = 100;
|
|
12
12
|
|
|
@@ -149,4 +149,5 @@ class UnusedCSS {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
const UnusedCSSComputed = makeComputedArtifact(UnusedCSS, ['CSSUsage', 'devtoolsLog']);
|
|
153
|
+
export {UnusedCSSComputed as UnusedCSS};
|
|
@@ -148,7 +148,8 @@ class UnusedJavascriptSummary {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
const UnusedJavascriptSummaryComputed = makeComputedArtifact(
|
|
152
152
|
UnusedJavascriptSummary,
|
|
153
153
|
['bundle', 'scriptCoverage', 'scriptId']
|
|
154
154
|
);
|
|
155
|
+
export {UnusedJavascriptSummaryComputed as UnusedJavascriptSummary};
|
|
@@ -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 {{name: string, isMark: true, args: LH.TraceEvent['args'], startTime: number}} MarkEvent */
|
|
11
11
|
/** @typedef {{name: string, isMark: false, args: LH.TraceEvent['args'], startTime: number, endTime: number, duration: number}} MeasureEvent */
|
|
@@ -79,4 +79,5 @@ class UserTimings {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
const UserTimingsComputed = makeComputedArtifact(UserTimings, null);
|
|
83
|
+
export {UserTimingsComputed as UserTimings};
|
|
@@ -45,7 +45,8 @@ class ViewportMeta {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const ViewportMetaComputed = makeComputedArtifact(ViewportMeta, null);
|
|
49
|
+
export {ViewportMetaComputed as ViewportMeta};
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* @typedef {object} ViewportMetaResult
|
|
@@ -19,11 +19,11 @@ import {initializeConfig} from '../config/config.js';
|
|
|
19
19
|
import {getBaseArtifacts, finalizeArtifacts} from './base-artifacts.js';
|
|
20
20
|
import * as format from '../../../shared/localization/format.js';
|
|
21
21
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
22
|
-
import
|
|
22
|
+
import UrlUtils from '../../lib/url-utils.js';
|
|
23
23
|
import {getPageLoadError} from '../../lib/navigation-error.js';
|
|
24
24
|
import Trace from '../../gather/gatherers/trace.js';
|
|
25
25
|
import DevtoolsLog from '../../gather/gatherers/devtools-log.js';
|
|
26
|
-
import NetworkRecords from '../../computed/network-records.js';
|
|
26
|
+
import {NetworkRecords} from '../../computed/network-records.js';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @typedef NavigationContext
|
|
@@ -319,7 +319,7 @@ async function navigationGather(requestor, options) {
|
|
|
319
319
|
const artifacts = await Runner.gather(
|
|
320
320
|
async () => {
|
|
321
321
|
let {page} = options;
|
|
322
|
-
const normalizedRequestor = isCallback ? requestor :
|
|
322
|
+
const normalizedRequestor = isCallback ? requestor : UrlUtils.normalizeUrl(requestor);
|
|
323
323
|
|
|
324
324
|
// For navigation mode, we shouldn't connect to a browser in audit mode,
|
|
325
325
|
// therefore we connect to the browser in the gatherFn callback.
|
|
@@ -10,7 +10,7 @@ import {NetworkMonitor} from './network-monitor.js';
|
|
|
10
10
|
import {waitForFullyLoaded, waitForFrameNavigated, waitForUserToContinue} from './wait-for-condition.js'; // eslint-disable-line max-len
|
|
11
11
|
import * as constants from '../../config/constants.js';
|
|
12
12
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
13
|
-
import
|
|
13
|
+
import UrlUtils from '../../lib/url-utils.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/**
|
|
@@ -130,7 +130,7 @@ async function gotoURL(driver, requestor, options) {
|
|
|
130
130
|
|
|
131
131
|
let requestedUrl = navigationUrls.requestedUrl;
|
|
132
132
|
if (typeof requestor === 'string') {
|
|
133
|
-
if (requestedUrl && !
|
|
133
|
+
if (requestedUrl && !UrlUtils.equalWithExcludedFragments(requestor, requestedUrl)) {
|
|
134
134
|
log.error(
|
|
135
135
|
'Navigation',
|
|
136
136
|
`Provided URL (${requestor}) did not match initial navigation URL (${requestedUrl})`
|
|
@@ -169,7 +169,7 @@ function getNavigationWarnings(navigation) {
|
|
|
169
169
|
|
|
170
170
|
if (navigation.timedOut) warnings.push(str_(UIStrings.warningTimeout));
|
|
171
171
|
|
|
172
|
-
if (!
|
|
172
|
+
if (!UrlUtils.equalWithExcludedFragments(requestedUrl, mainDocumentUrl)) {
|
|
173
173
|
warnings.push(str_(UIStrings.warningRedirected, {
|
|
174
174
|
requested: requestedUrl,
|
|
175
175
|
final: mainDocumentUrl,
|
|
@@ -15,7 +15,7 @@ import log from 'lighthouse-logger';
|
|
|
15
15
|
|
|
16
16
|
import {NetworkRecorder} from '../../lib/network-recorder.js';
|
|
17
17
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
18
|
-
import
|
|
18
|
+
import UrlUtils from '../../lib/url-utils.js';
|
|
19
19
|
|
|
20
20
|
/** @typedef {import('../../lib/network-recorder.js').NetworkRecorderEventMap} NetworkRecorderEventMap */
|
|
21
21
|
/** @typedef {'network-2-idle'|'network-critical-idle'|'networkidle'|'networkbusy'|'network-critical-busy'|'network-2-busy'} NetworkMonitorEvent_ */
|
|
@@ -214,7 +214,7 @@ class NetworkMonitor extends NetworkMonitorEventEmitter {
|
|
|
214
214
|
/** @type {Array<{time: number, isStart: boolean}>} */
|
|
215
215
|
let timeBoundaries = [];
|
|
216
216
|
requests.forEach(request => {
|
|
217
|
-
if (
|
|
217
|
+
if (UrlUtils.isNonNetworkProtocol(request.protocol)) return;
|
|
218
218
|
if (request.protocol === 'ws' || request.protocol === 'wss') return;
|
|
219
219
|
|
|
220
220
|
// convert the network timestamp to ms
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import log from 'lighthouse-logger';
|
|
8
8
|
|
|
9
|
-
import NetworkRecords from '../computed/network-records.js';
|
|
9
|
+
import {NetworkRecords} from '../computed/network-records.js';
|
|
10
10
|
import {getPageLoadError} from '../lib/navigation-error.js';
|
|
11
11
|
import * as emulation from '../lib/emulation.js';
|
|
12
12
|
import * as constants from '../config/constants.js';
|
|
@@ -21,7 +21,7 @@ import InstallabilityErrors from './gatherers/installability-errors.js';
|
|
|
21
21
|
import NetworkUserAgent from './gatherers/network-user-agent.js';
|
|
22
22
|
import Stacks from './gatherers/stacks.js';
|
|
23
23
|
import {finalizeArtifacts} from '../fraggle-rock/gather/base-artifacts.js';
|
|
24
|
-
import
|
|
24
|
+
import UrlUtils from '../lib/url-utils.js';
|
|
25
25
|
|
|
26
26
|
/** @typedef {import('../gather/driver.js').Driver} Driver */
|
|
27
27
|
/** @typedef {import('../lib/arbitrary-equality-map.js').ArbitraryEqualityMap} ArbitraryEqualityMap */
|
|
@@ -494,7 +494,7 @@ class GatherRunner {
|
|
|
494
494
|
|
|
495
495
|
// Hack for running benchmarkIndex extra times.
|
|
496
496
|
// Add a `bidx=20` query param, eg: https://www.example.com/?bidx=50
|
|
497
|
-
const parsedUrl =
|
|
497
|
+
const parsedUrl = UrlUtils.isValid(options.requestedUrl) && new URL(options.requestedUrl);
|
|
498
498
|
if (options.settings.channel === 'lr' && parsedUrl && parsedUrl.searchParams.has('bidx')) {
|
|
499
499
|
const bidxRunCount = parsedUrl.searchParams.get('bidx') || 0;
|
|
500
500
|
// Add the first bidx into the new set
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
import log from 'lighthouse-logger';
|
|
14
14
|
|
|
15
15
|
import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
|
|
16
|
-
import
|
|
16
|
+
import UrlUtils from '../../../lib/url-utils.js';
|
|
17
17
|
import {NetworkRequest} from '../../../lib/network-request.js';
|
|
18
18
|
import {Sentry} from '../../../lib/sentry.js';
|
|
19
|
-
import NetworkRecords from '../../../computed/network-records.js';
|
|
19
|
+
import {NetworkRecords} from '../../../computed/network-records.js';
|
|
20
20
|
import DevtoolsLog from '../devtools-log.js';
|
|
21
21
|
|
|
22
22
|
// Image encoding can be slow and we don't want to spend forever on it.
|
|
@@ -139,7 +139,7 @@ class OptimizedImages extends FRGatherer {
|
|
|
139
139
|
// want to tank the entire run due to a single image.
|
|
140
140
|
Sentry.captureException(err, {
|
|
141
141
|
tags: {gatherer: 'OptimizedImages'},
|
|
142
|
-
extra: {imageUrl:
|
|
142
|
+
extra: {imageUrl: UrlUtils.elideDataURI(record.url)},
|
|
143
143
|
level: 'warning',
|
|
144
144
|
});
|
|
145
145
|
|
|
@@ -14,12 +14,12 @@ import {Buffer} from 'buffer';
|
|
|
14
14
|
import {gzip} from 'zlib';
|
|
15
15
|
|
|
16
16
|
import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
|
|
17
|
-
import
|
|
17
|
+
import UrlUtils from '../../../lib/url-utils.js';
|
|
18
18
|
import {Sentry} from '../../../lib/sentry.js';
|
|
19
19
|
import {NetworkRequest} from '../../../lib/network-request.js';
|
|
20
20
|
import DevtoolsLog from '../devtools-log.js';
|
|
21
21
|
import {fetchResponseBodyFromCache} from '../../driver/network.js';
|
|
22
|
-
import NetworkRecords from '../../../computed/network-records.js';
|
|
22
|
+
import {NetworkRecords} from '../../../computed/network-records.js';
|
|
23
23
|
|
|
24
24
|
const CHROME_EXTENSION_PROTOCOL = 'chrome-extension:';
|
|
25
25
|
const compressionHeaders = [
|
|
@@ -122,7 +122,7 @@ class ResponseCompression extends FRGatherer {
|
|
|
122
122
|
}).catch(err => {
|
|
123
123
|
Sentry.captureException(err, {
|
|
124
124
|
tags: {gatherer: 'ResponseCompression'},
|
|
125
|
-
extra: {url:
|
|
125
|
+
extra: {url: UrlUtils.elideDataURI(record.url)},
|
|
126
126
|
level: 'warning',
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import NetworkRecords from '../../../computed/network-records.js';
|
|
20
|
+
import {NetworkRecords} from '../../../computed/network-records.js';
|
|
21
21
|
import DevtoolsLog from '../devtools-log.js';
|
|
22
22
|
import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
|
|
23
23
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
|
|
13
|
-
import NetworkRecords from '../../computed/network-records.js';
|
|
13
|
+
import {NetworkRecords} from '../../computed/network-records.js';
|
|
14
14
|
import DevtoolsLog from './devtools-log.js';
|
|
15
15
|
|
|
16
16
|
class InspectorIssues extends FRGatherer {
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
import LinkHeader from 'http-link-header';
|
|
8
8
|
|
|
9
9
|
import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
|
|
10
|
-
import URL from '../../lib/url-shim.js';
|
|
11
10
|
import {pageFunctions} from '../../lib/page-functions.js';
|
|
12
11
|
import DevtoolsLog from './devtools-log.js';
|
|
13
|
-
import MainResource from '../../computed/main-resource.js';
|
|
12
|
+
import {MainResource} from '../../computed/main-resource.js';
|
|
14
13
|
|
|
15
14
|
/* globals HTMLLinkElement getNodeDetails */
|
|
16
15
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
|
|
8
8
|
import DevtoolsLog from './devtools-log.js';
|
|
9
9
|
import {fetchResponseBodyFromCache} from '../driver/network.js';
|
|
10
|
-
import MainResource from '../../computed/main-resource.js';
|
|
10
|
+
import {MainResource} from '../../computed/main-resource.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Collects the content of the main html document.
|