lighthouse 9.5.0-dev.20220712 → 9.5.0-dev.20220713
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/{esm-utils.mjs → esm-utils.js} +2 -2
- package/flow-report/tsconfig.json +1 -0
- package/lighthouse-cli/bin.js +5 -9
- package/lighthouse-cli/commands/list-audits.js +2 -2
- package/lighthouse-cli/commands/list-trace-categories.js +1 -2
- package/lighthouse-cli/run.js +2 -2
- package/lighthouse-cli/test/smokehouse/core-tests.js +3 -2
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +4 -3
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +8 -4
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +1 -1
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +17 -68
- package/lighthouse-cli/test/smokehouse/smokehouse.js +10 -1
- package/lighthouse-core/audits/accessibility/accesskeys.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-command-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-body.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-input-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-children.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-parent.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-roles.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/axe-audit.js +6 -5
- package/lighthouse-core/audits/accessibility/button-name.js +6 -5
- package/lighthouse-core/audits/accessibility/bypass.js +6 -5
- package/lighthouse-core/audits/accessibility/color-contrast.js +6 -5
- package/lighthouse-core/audits/accessibility/definition-list.js +6 -5
- package/lighthouse-core/audits/accessibility/dlitem.js +6 -5
- package/lighthouse-core/audits/accessibility/document-title.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-active.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +6 -5
- package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +6 -5
- package/lighthouse-core/audits/accessibility/frame-title.js +6 -5
- package/lighthouse-core/audits/accessibility/heading-order.js +6 -5
- package/lighthouse-core/audits/accessibility/html-has-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/html-lang-valid.js +6 -5
- package/lighthouse-core/audits/accessibility/image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/input-image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/label.js +6 -5
- package/lighthouse-core/audits/accessibility/link-name.js +6 -5
- package/lighthouse-core/audits/accessibility/list.js +6 -5
- package/lighthouse-core/audits/accessibility/listitem.js +6 -5
- package/lighthouse-core/audits/accessibility/manual/custom-controls-labels.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/custom-controls-roles.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focus-traps.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focusable-controls.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/interactive-element-affordance.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/logical-tab-order.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/managed-focus.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/offscreen-content-hidden.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/use-landmarks.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/visual-order-follows-dom.js +2 -2
- package/lighthouse-core/audits/accessibility/meta-refresh.js +6 -5
- package/lighthouse-core/audits/accessibility/meta-viewport.js +6 -5
- package/lighthouse-core/audits/accessibility/object-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/tabindex.js +6 -5
- package/lighthouse-core/audits/accessibility/td-headers-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/th-has-data-cells.js +6 -5
- package/lighthouse-core/audits/accessibility/valid-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/video-caption.js +6 -5
- package/lighthouse-core/audits/apple-touch-icon.js +5 -5
- package/lighthouse-core/audits/audit.js +4 -4
- package/lighthouse-core/audits/autocomplete.js +6 -6
- package/lighthouse-core/audits/bootup-time.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +12 -12
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +9 -8
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +18 -10
- package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +11 -11
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +15 -15
- package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +10 -10
- package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +9 -10
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +7 -7
- package/lighthouse-core/audits/content-width.js +5 -5
- package/lighthouse-core/audits/critical-request-chains.js +6 -6
- package/lighthouse-core/audits/csp-xss.js +7 -10
- package/lighthouse-core/audits/deprecations.js +7 -6
- package/lighthouse-core/audits/diagnostics.js +6 -6
- package/lighthouse-core/audits/dobetterweb/charset.js +6 -9
- package/lighthouse-core/audits/dobetterweb/doctype.js +5 -5
- package/lighthouse-core/audits/dobetterweb/dom-size.js +5 -5
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/inspector-issues.js +6 -5
- package/lighthouse-core/audits/dobetterweb/js-libraries.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-document-write.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +12 -8
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +5 -5
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +15 -14
- package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +5 -5
- package/lighthouse-core/audits/errors-in-console.js +8 -7
- package/lighthouse-core/audits/final-screenshot.js +5 -5
- package/lighthouse-core/audits/font-display.js +8 -8
- package/lighthouse-core/audits/full-page-screenshot.js +2 -2
- package/lighthouse-core/audits/image-aspect-ratio.js +6 -6
- package/lighthouse-core/audits/image-size-responsive.js +6 -6
- package/lighthouse-core/audits/installable-manifest.js +6 -6
- package/lighthouse-core/audits/is-on-https.js +8 -8
- package/lighthouse-core/audits/largest-contentful-paint-element.js +5 -5
- package/lighthouse-core/audits/layout-shift-elements.js +5 -5
- package/lighthouse-core/audits/lcp-lazy-loaded.js +5 -5
- package/lighthouse-core/audits/long-tasks.js +10 -10
- package/lighthouse-core/audits/main-thread-tasks.js +3 -3
- package/lighthouse-core/audits/mainthread-work-breakdown.js +7 -7
- package/lighthouse-core/audits/manual/manual-audit.js +2 -2
- package/lighthouse-core/audits/manual/pwa-cross-browser.js +5 -5
- package/lighthouse-core/audits/manual/pwa-each-page-has-url.js +5 -5
- package/lighthouse-core/audits/manual/pwa-page-transitions.js +5 -5
- package/lighthouse-core/audits/maskable-icon.js +6 -6
- package/lighthouse-core/audits/metrics/cumulative-layout-shift.js +6 -6
- package/lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +6 -4
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/interactive.js +6 -6
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/audits/metrics/speed-index.js +6 -6
- package/lighthouse-core/audits/metrics/total-blocking-time.js +6 -6
- package/lighthouse-core/audits/metrics.js +3 -3
- package/lighthouse-core/audits/multi-check-audit.js +2 -2
- package/lighthouse-core/audits/network-requests.js +5 -5
- package/lighthouse-core/audits/network-rtt.js +7 -7
- package/lighthouse-core/audits/network-server-latency.js +7 -7
- package/lighthouse-core/audits/no-unload-listeners.js +6 -6
- package/lighthouse-core/audits/non-composited-animations.js +6 -5
- package/lighthouse-core/audits/oopif-iframe-test-audit.js +1 -1
- package/lighthouse-core/audits/performance-budget.js +8 -8
- package/lighthouse-core/audits/predictive-perf.js +9 -10
- package/lighthouse-core/audits/preload-fonts.js +8 -7
- package/lighthouse-core/audits/preload-lcp-image.js +11 -11
- package/lighthouse-core/audits/redirects.js +11 -11
- package/lighthouse-core/audits/resource-summary.js +6 -6
- package/lighthouse-core/audits/screenshot-thumbnails.js +5 -5
- package/lighthouse-core/audits/script-elements-test-audit.js +1 -1
- package/lighthouse-core/audits/script-treemap-data.js +7 -6
- package/lighthouse-core/audits/seo/canonical.js +7 -7
- package/lighthouse-core/audits/seo/crawlable-anchors.js +5 -5
- package/lighthouse-core/audits/seo/font-size.js +8 -6
- package/lighthouse-core/audits/seo/hreflang.js +7 -6
- package/lighthouse-core/audits/seo/http-status-code.js +7 -6
- package/lighthouse-core/audits/seo/is-crawlable.js +11 -9
- package/lighthouse-core/audits/seo/link-text.js +7 -6
- package/lighthouse-core/audits/seo/manual/structured-data.js +5 -5
- package/lighthouse-core/audits/seo/meta-description.js +5 -5
- package/lighthouse-core/audits/seo/plugins.js +6 -6
- package/lighthouse-core/audits/seo/robots-txt.js +7 -6
- package/lighthouse-core/audits/seo/tap-targets.js +12 -9
- package/lighthouse-core/audits/server-response-time.js +6 -6
- package/lighthouse-core/audits/service-worker.js +6 -6
- package/lighthouse-core/audits/splash-screen.js +6 -6
- package/lighthouse-core/audits/themed-omnibox.js +7 -7
- package/lighthouse-core/audits/third-party-facades.js +14 -13
- package/lighthouse-core/audits/third-party-summary.js +9 -9
- package/lighthouse-core/audits/timing-budget.js +8 -8
- package/lighthouse-core/audits/unsized-images.js +6 -6
- package/lighthouse-core/audits/user-timings.js +6 -6
- package/lighthouse-core/audits/uses-rel-preconnect.js +15 -15
- package/lighthouse-core/audits/uses-rel-preload.js +13 -13
- package/lighthouse-core/audits/valid-source-maps.js +6 -6
- package/lighthouse-core/audits/viewport.js +6 -6
- package/lighthouse-core/audits/violation-audit.js +3 -3
- package/lighthouse-core/audits/work-during-interaction.js +15 -15
- package/lighthouse-core/computed/computed-artifact.js +3 -3
- package/lighthouse-core/computed/critical-request-chains.js +5 -5
- package/lighthouse-core/computed/image-records.js +3 -3
- package/lighthouse-core/computed/js-bundles.js +4 -4
- package/lighthouse-core/computed/load-simulator.js +8 -5
- package/lighthouse-core/computed/main-resource.js +4 -4
- package/lighthouse-core/computed/main-thread-tasks.js +4 -4
- package/lighthouse-core/computed/manifest-values.js +3 -3
- package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +4 -4
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +3 -3
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +4 -4
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/interactive.js +8 -9
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-interactive.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-metric.js +10 -10
- package/lighthouse-core/computed/metrics/lantern-speed-index.js +8 -8
- package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +8 -8
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +5 -4
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +6 -5
- package/lighthouse-core/computed/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/metric.js +6 -6
- package/lighthouse-core/computed/metrics/navigation-metric.js +2 -2
- package/lighthouse-core/computed/metrics/responsiveness.js +3 -3
- package/lighthouse-core/computed/metrics/speed-index.js +5 -5
- package/lighthouse-core/computed/metrics/tbt-utils.js +1 -1
- package/lighthouse-core/computed/metrics/timing-summary.js +15 -15
- package/lighthouse-core/computed/metrics/total-blocking-time.js +7 -7
- package/lighthouse-core/computed/module-duplication.js +3 -3
- package/lighthouse-core/computed/network-analysis.js +4 -4
- package/lighthouse-core/computed/network-records.js +3 -3
- package/lighthouse-core/computed/page-dependency-graph.js +11 -11
- package/lighthouse-core/computed/processed-navigation.js +3 -3
- package/lighthouse-core/computed/processed-trace.js +3 -3
- package/lighthouse-core/computed/resource-summary.js +7 -7
- package/lighthouse-core/computed/screenshots.js +2 -2
- package/lighthouse-core/computed/speedline.js +5 -5
- package/lighthouse-core/computed/trace-of-tab.js +6 -5
- package/lighthouse-core/computed/unused-css.js +4 -4
- package/lighthouse-core/computed/unused-javascript-summary.js +2 -2
- package/lighthouse-core/computed/user-timings.js +3 -3
- package/lighthouse-core/computed/viewport-meta.js +3 -4
- package/lighthouse-core/config/budget.js +1 -1
- package/lighthouse-core/config/config-helpers.js +47 -19
- package/lighthouse-core/config/config-plugin.js +2 -2
- package/lighthouse-core/config/config.js +16 -14
- package/lighthouse-core/config/constants.js +1 -1
- package/lighthouse-core/config/default-config.js +11 -10
- package/lighthouse-core/config/desktop-config.js +2 -2
- package/lighthouse-core/config/experimental-config.js +1 -1
- package/lighthouse-core/config/full-config.js +1 -1
- package/lighthouse-core/config/lr-desktop-config.js +2 -2
- package/lighthouse-core/config/lr-mobile-config.js +1 -1
- package/lighthouse-core/config/metrics-to-audits.js +1 -1
- package/lighthouse-core/config/perf-config.js +1 -1
- package/lighthouse-core/fraggle-rock/api.js +8 -8
- package/lighthouse-core/fraggle-rock/config/config.js +27 -17
- package/lighthouse-core/fraggle-rock/config/default-config.js +5 -5
- package/lighthouse-core/fraggle-rock/config/filters.js +3 -4
- package/lighthouse-core/fraggle-rock/config/validation.js +4 -4
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +6 -8
- package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +2 -1
- package/lighthouse-core/fraggle-rock/gather/driver.js +5 -5
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +23 -27
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/session.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +7 -11
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +8 -12
- package/lighthouse-core/fraggle-rock/user-flow.js +8 -8
- package/lighthouse-core/gather/connections/connection.js +4 -4
- package/lighthouse-core/gather/connections/cri.js +6 -6
- package/lighthouse-core/gather/connections/raw.js +2 -2
- package/lighthouse-core/gather/driver/dom.js +1 -1
- package/lighthouse-core/gather/driver/environment.js +6 -6
- package/lighthouse-core/gather/driver/execution-context.js +2 -2
- package/lighthouse-core/gather/driver/navigation.js +8 -8
- package/lighthouse-core/gather/driver/network-monitor.js +7 -6
- package/lighthouse-core/gather/driver/network.js +2 -2
- package/lighthouse-core/gather/driver/prepare.js +5 -5
- package/lighthouse-core/gather/driver/service-workers.js +1 -1
- package/lighthouse-core/gather/driver/storage.js +4 -4
- package/lighthouse-core/gather/driver/target-manager.js +9 -4
- package/lighthouse-core/gather/driver/wait-for-condition.js +6 -5
- package/lighthouse-core/gather/driver.js +11 -16
- package/lighthouse-core/gather/fetcher.js +1 -1
- package/lighthouse-core/gather/gather-runner.js +22 -22
- package/lighthouse-core/gather/gatherers/accessibility.js +6 -5
- package/lighthouse-core/gather/gatherers/anchor-elements.js +6 -5
- package/lighthouse-core/gather/gatherers/cache-contents.js +2 -2
- package/lighthouse-core/gather/gatherers/console-messages.js +2 -2
- package/lighthouse-core/gather/gatherers/css-usage.js +6 -5
- package/lighthouse-core/gather/gatherers/devtools-log-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/devtools-log.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +2 -2
- package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +8 -8
- package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +4 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +10 -10
- package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +4 -4
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +7 -6
- package/lighthouse-core/gather/gatherers/gatherer.js +1 -1
- package/lighthouse-core/gather/gatherers/global-listeners.js +2 -2
- package/lighthouse-core/gather/gatherers/iframe-elements.js +4 -3
- package/lighthouse-core/gather/gatherers/image-elements.js +5 -5
- package/lighthouse-core/gather/gatherers/inputs.js +5 -4
- package/lighthouse-core/gather/gatherers/inspector-issues.js +4 -4
- package/lighthouse-core/gather/gatherers/installability-errors.js +3 -3
- package/lighthouse-core/gather/gatherers/js-usage.js +2 -2
- package/lighthouse-core/gather/gatherers/link-elements.js +7 -7
- package/lighthouse-core/gather/gatherers/main-document-content.js +5 -5
- package/lighthouse-core/gather/gatherers/meta-elements.js +3 -3
- package/lighthouse-core/gather/gatherers/network-user-agent.js +3 -3
- package/lighthouse-core/gather/gatherers/script-elements.js +6 -6
- package/lighthouse-core/gather/gatherers/scripts.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/embedded-content.js +4 -3
- package/lighthouse-core/gather/gatherers/seo/font-size.js +8 -5
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +5 -4
- package/lighthouse-core/gather/gatherers/service-worker.js +3 -3
- package/lighthouse-core/gather/gatherers/source-maps.js +3 -3
- package/lighthouse-core/gather/gatherers/stacks.js +12 -4
- package/lighthouse-core/gather/gatherers/trace-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/trace-elements.js +13 -12
- package/lighthouse-core/gather/gatherers/trace.js +4 -3
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +2 -2
- package/lighthouse-core/gather/gatherers/web-app-manifest.js +5 -5
- package/lighthouse-core/index.cjs +21 -0
- package/lighthouse-core/index.js +25 -23
- package/lighthouse-core/lib/arbitrary-equality-map.js +2 -2
- package/lighthouse-core/lib/asset-saver.js +15 -12
- package/lighthouse-core/lib/axe.js +9 -4
- package/lighthouse-core/lib/cdt/package.json +4 -0
- package/lighthouse-core/lib/csp-evaluator.js +11 -13
- package/lighthouse-core/lib/dependency-graph/base-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/cpu-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/network-node.js +3 -3
- package/lighthouse-core/lib/dependency-graph/simulator/connection-pool.js +4 -4
- package/lighthouse-core/lib/dependency-graph/simulator/dns-cache.js +1 -1
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +11 -10
- package/lighthouse-core/lib/dependency-graph/simulator/simulator-timing-map.js +5 -5
- package/lighthouse-core/lib/dependency-graph/simulator/simulator.js +12 -10
- package/lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js +1 -1
- package/lighthouse-core/lib/emulation.js +2 -2
- package/lighthouse-core/lib/i18n/README.md +1 -1
- package/lighthouse-core/lib/i18n/i18n.js +13 -13
- package/lighthouse-core/lib/icons.js +2 -2
- package/lighthouse-core/lib/lantern-trace-saver.js +1 -1
- package/lighthouse-core/lib/lh-env.js +7 -5
- package/lighthouse-core/lib/lh-error.js +4 -4
- package/lighthouse-core/lib/lh-trace-processor.js +3 -3
- package/lighthouse-core/lib/manifest-parser.js +4 -4
- package/lighthouse-core/lib/median-run.js +1 -1
- package/lighthouse-core/lib/minification-estimator.js +1 -1
- package/lighthouse-core/lib/minify-devtoolslog.js +1 -1
- package/lighthouse-core/lib/minify-trace.js +3 -3
- package/lighthouse-core/lib/navigation-error.js +6 -6
- package/lighthouse-core/lib/network-recorder.js +4 -4
- package/lighthouse-core/lib/network-request.js +2 -3
- package/lighthouse-core/lib/page-functions.js +2 -1
- package/lighthouse-core/lib/proto-preprocessor.js +7 -6
- package/lighthouse-core/lib/rect-helpers.js +1 -1
- package/lighthouse-core/lib/script-helpers.js +4 -1
- package/lighthouse-core/lib/sentry.js +4 -4
- package/lighthouse-core/lib/stack-packs.js +4 -4
- package/lighthouse-core/lib/statistics.js +1 -1
- package/lighthouse-core/lib/tappable-rects.js +2 -2
- package/lighthouse-core/lib/third-party-web.js +2 -2
- package/lighthouse-core/lib/timing-trace-saver.js +1 -1
- package/lighthouse-core/lib/tracehouse/cpu-profile-model.js +8 -8
- package/lighthouse-core/lib/tracehouse/main-thread-tasks.js +2 -2
- package/lighthouse-core/lib/tracehouse/task-groups.js +1 -1
- package/lighthouse-core/lib/tracehouse/task-summary.js +2 -2
- package/lighthouse-core/lib/tracehouse/trace-processor.js +2 -3
- package/lighthouse-core/lib/traces/pwmetrics-events.js +4 -3
- package/lighthouse-core/lib/url-shim.js +6 -4
- package/lighthouse-core/package.json +4 -0
- package/lighthouse-core/runner.js +40 -34
- package/lighthouse-core/scoring.js +2 -2
- package/lighthouse-core/{util-commonjs.js → util.cjs} +0 -0
- package/package.json +4 -2
- package/report/test/generator/report-generator-test.js +4 -3
- package/report/test/renderer/report-renderer-axe-test.js +2 -2
- package/root.js +10 -2
- package/shared/package.json +4 -0
- package/shared/test/localization/format-test.js +23 -13
- package/shared/test/localization/swap-locale-test.js +1 -0
- package/third-party/axe/valid-langs.js +1 -1
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +3 -3
- package/third-party/chromium-synchronization/installability-errors-test.js +3 -3
- package/third-party/download-content-shell/download-content-shell.js +6 -5
- package/third-party/download-content-shell/utils.js +8 -8
- package/tsconfig.json +3 -1
- package/types/artifacts.d.ts +9 -11
- package/types/audit.d.ts +2 -2
- package/types/config.d.ts +1 -1
- package/types/cssstyle/index.d.ts +1 -1
- package/types/gatherer.d.ts +7 -7
- package/types/global-lh.d.ts +2 -2
- package/types/smokehouse.d.ts +2 -0
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import {Audit} from './audit.js';
|
|
9
|
+
import {taskGroups} from '../lib/tracehouse/task-groups.js';
|
|
10
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
11
|
+
import NetworkRecords from '../computed/network-records.js';
|
|
12
|
+
import MainThreadTasks from '../computed/main-thread-tasks.js';
|
|
13
|
+
import {getExecutionTimingsByURL} from '../lib/tracehouse/task-summary.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/** Title of a diagnostic audit that provides detail on the time spent executing javascript files during the load. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
|
|
@@ -32,7 +32,7 @@ const UIStrings = {
|
|
|
32
32
|
'Try auditing the page in incognito mode or from a Chrome profile without extensions.',
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
35
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
36
36
|
|
|
37
37
|
class BootupTime extends Audit {
|
|
38
38
|
/**
|
|
@@ -148,5 +148,5 @@ class BootupTime extends Audit {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
export default BootupTime;
|
|
152
|
+
export {UIStrings};
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import {Audit} from '../audit.js';
|
|
9
|
+
import {linearInterpolation} from '../../lib/statistics.js';
|
|
10
|
+
import Interactive from '../../computed/metrics/lantern-interactive.js';
|
|
11
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
12
|
+
import NetworkRecords from '../../computed/network-records.js';
|
|
13
|
+
import LoadSimulator from '../../computed/load-simulator.js';
|
|
14
|
+
import PageDependencyGraph from '../../computed/page-dependency-graph.js';
|
|
15
15
|
|
|
16
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
16
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, {});
|
|
17
17
|
|
|
18
|
-
/** @typedef {import('../../lib/dependency-graph/simulator/simulator')} Simulator */
|
|
18
|
+
/** @typedef {import('../../lib/dependency-graph/simulator/simulator').Simulator} Simulator */
|
|
19
19
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
20
20
|
|
|
21
21
|
const WASTED_MS_FOR_AVERAGE = 300;
|
|
@@ -36,7 +36,7 @@ const WASTED_MS_FOR_SCORE_OF_ZERO = 5000;
|
|
|
36
36
|
* @overview Used as the base for all byte efficiency audits. Computes total bytes
|
|
37
37
|
* and estimated time saved. Subclass and override `audit_` to return results.
|
|
38
38
|
*/
|
|
39
|
-
class
|
|
39
|
+
class ByteEfficiencyAudit extends Audit {
|
|
40
40
|
/**
|
|
41
41
|
* Creates a score based on the wastedMs value using linear interpolation between control points.
|
|
42
42
|
*
|
|
@@ -236,7 +236,7 @@ class UnusedBytes extends Audit {
|
|
|
236
236
|
displayValue,
|
|
237
237
|
numericValue: wastedMs,
|
|
238
238
|
numericUnit: 'millisecond',
|
|
239
|
-
score:
|
|
239
|
+
score: ByteEfficiencyAudit.scoreForWastedMs(wastedMs),
|
|
240
240
|
details,
|
|
241
241
|
};
|
|
242
242
|
}
|
|
@@ -256,4 +256,4 @@ class UnusedBytes extends Audit {
|
|
|
256
256
|
/* eslint-enable no-unused-vars */
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
export {ByteEfficiencyAudit};
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
/** @typedef {LH.Audit.ByteEfficiencyItem & {source: string, subItems: {type: 'subitems', items: SubItem[]}}} Item */
|
|
10
10
|
/** @typedef {{url: string, sourceTransferBytes?: number}} SubItem */
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
13
|
+
|
|
14
|
+
import ModuleDuplication from '../../computed/module-duplication.js';
|
|
15
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
16
|
+
import {getRequestForScript} from '../../lib/script-helpers.js';
|
|
16
17
|
|
|
17
18
|
const UIStrings = {
|
|
18
19
|
/** Imperative title of a Lighthouse audit that tells the user to remove duplicate JavaScript from their code. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -24,7 +25,7 @@ const UIStrings = {
|
|
|
24
25
|
// '[Learn more](https://web.dev/duplicated-javascript/).',
|
|
25
26
|
};
|
|
26
27
|
|
|
27
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
28
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
28
29
|
|
|
29
30
|
const IGNORE_THRESHOLD_IN_BYTES = 1024;
|
|
30
31
|
|
|
@@ -123,7 +124,7 @@ class DuplicatedJavascript extends ByteEfficiencyAudit {
|
|
|
123
124
|
* @param {LH.Artifacts} artifacts
|
|
124
125
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
125
126
|
* @param {LH.Audit.Context} context
|
|
126
|
-
* @return {Promise<
|
|
127
|
+
* @return {Promise<ByteEfficiencyProduct>}
|
|
127
128
|
*/
|
|
128
129
|
static async audit_(artifacts, networkRecords, context) {
|
|
129
130
|
const ignoreThresholdInBytes =
|
|
@@ -244,5 +245,5 @@ class DuplicatedJavascript extends ByteEfficiencyAudit {
|
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
export default DuplicatedJavascript;
|
|
249
|
+
export {UIStrings};
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import {NetworkRequest} from '../../lib/network-request.js';
|
|
12
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/** Imperative title of a Lighthouse audit that tells the user to use video formats rather than animated GIFs, which are wasteful. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
'network bytes. [Learn more](https://web.dev/efficient-animated-content/)',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
24
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
25
25
|
|
|
26
26
|
// If GIFs are above this size, we'll flag them
|
|
27
27
|
// See https://github.com/GoogleChrome/lighthouse/pull/4885#discussion_r178406623 and https://github.com/GoogleChrome/lighthouse/issues/4696#issuecomment-370979920
|
|
@@ -54,7 +54,7 @@ class EfficientAnimatedContent extends ByteEfficiencyAudit {
|
|
|
54
54
|
/**
|
|
55
55
|
* @param {LH.Artifacts} artifacts
|
|
56
56
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
57
|
-
* @return {
|
|
57
|
+
* @return {import('./byte-efficiency-audit.js').ByteEfficiencyProduct}
|
|
58
58
|
*/
|
|
59
59
|
static audit_(artifacts, networkRecords) {
|
|
60
60
|
const unoptimizedContent = networkRecords.filter(
|
|
@@ -88,5 +88,5 @@ class EfficientAnimatedContent extends ByteEfficiencyAudit {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
export default EfficientAnimatedContent;
|
|
92
|
+
export {UIStrings};
|
|
@@ -18,11 +18,21 @@
|
|
|
18
18
|
/** @typedef {LH.Audit.ByteEfficiencyItem & {subItems: {type: 'subitems', items: SubItem[]}}} Item */
|
|
19
19
|
/** @typedef {{signal: string, location: LH.Audit.Details.SourceLocationValue}} SubItem */
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
import fs from 'fs';
|
|
22
|
+
|
|
23
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
24
|
+
|
|
25
|
+
import JsBundles from '../../computed/js-bundles.js';
|
|
26
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
27
|
+
import thirdPartyWeb from '../../lib/third-party-web.js';
|
|
28
|
+
import {getRequestForScript} from '../../lib/script-helpers.js';
|
|
29
|
+
import {LH_ROOT} from '../../../root.js';
|
|
30
|
+
|
|
31
|
+
const graphJson = fs.readFileSync(
|
|
32
|
+
`${LH_ROOT}/lighthouse-core/audits/byte-efficiency/polyfill-graph-data.json`, 'utf-8');
|
|
33
|
+
|
|
34
|
+
/** @type {import('../../scripts/legacy-javascript/create-polyfill-size-estimation.js').PolyfillSizeEstimator} */
|
|
35
|
+
const graph = JSON.parse(graphJson);
|
|
26
36
|
|
|
27
37
|
const UIStrings = {
|
|
28
38
|
/** Title of a Lighthouse audit that tells the user about legacy polyfills and transforms used on the page. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -33,7 +43,7 @@ const UIStrings = {
|
|
|
33
43
|
description: 'Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren\'t necessary for modern browsers. For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers. [Learn More](https://web.dev/publish-modern-javascript/)',
|
|
34
44
|
};
|
|
35
45
|
|
|
36
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
46
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
37
47
|
|
|
38
48
|
/**
|
|
39
49
|
* Takes a list of patterns (consisting of a name identifier and a RegExp expression string)
|
|
@@ -327,8 +337,6 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
327
337
|
const transformResults = matches.filter(m => m.name.startsWith('@'));
|
|
328
338
|
|
|
329
339
|
let estimatedWastedBytesFromPolyfills = 0;
|
|
330
|
-
/** @type {import('../../scripts/legacy-javascript/create-polyfill-size-estimation.js').PolyfillSizeEstimator} */
|
|
331
|
-
const graph = require('./polyfill-graph-data.json');
|
|
332
340
|
const modulesSeen = new Set();
|
|
333
341
|
for (const result of polyfillResults) {
|
|
334
342
|
const modules = graph.dependencies[result.name];
|
|
@@ -466,5 +474,5 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
466
474
|
}
|
|
467
475
|
}
|
|
468
476
|
|
|
469
|
-
|
|
470
|
-
|
|
477
|
+
export default LegacyJavascript;
|
|
478
|
+
export {UIStrings};
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
12
|
+
import URL from '../../lib/url-shim.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/** Imperative title of a Lighthouse audit that tells the user to serve images in newer and more efficient image formats in order to enhance the performance of a page. A non-modern image format was designed 20+ years ago. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
'[Learn more](https://web.dev/uses-webp-images/).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
24
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
25
25
|
|
|
26
26
|
const IGNORE_THRESHOLD_IN_BYTES = 8192;
|
|
27
27
|
|
|
@@ -89,7 +89,7 @@ class ModernImageFormats extends ByteEfficiencyAudit {
|
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* @param {LH.Artifacts} artifacts
|
|
92
|
-
* @return {
|
|
92
|
+
* @return {import('./byte-efficiency-audit.js').ByteEfficiencyProduct}
|
|
93
93
|
*/
|
|
94
94
|
static audit_(artifacts) {
|
|
95
95
|
const pageURL = artifacts.URL.finalUrl;
|
|
@@ -182,5 +182,5 @@ class ModernImageFormats extends ByteEfficiencyAudit {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
export default ModernImageFormats;
|
|
186
|
+
export {UIStrings};
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
13
|
+
import {NetworkRequest} from '../../lib/network-request.js';
|
|
14
|
+
import {Sentry} from '../../lib/sentry.js';
|
|
15
|
+
import URL from '../../lib/url-shim.js';
|
|
16
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
17
|
+
import Interactive from '../../computed/metrics/interactive.js';
|
|
18
|
+
import ProcessedTrace from '../../computed/processed-trace.js';
|
|
19
19
|
|
|
20
20
|
const UIStrings = {
|
|
21
21
|
/** Imperative title of a Lighthouse audit that tells the user to defer loading offscreen images. Offscreen images are images located outside of the visible browser viewport. As they are unseen by the user and slow down page load, they should be loaded later, closer to when the user is going to see them. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -27,7 +27,7 @@ const UIStrings = {
|
|
|
27
27
|
'[Learn more](https://web.dev/offscreen-images/).',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
30
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
31
31
|
|
|
32
32
|
// See https://github.com/GoogleChrome/lighthouse/issues/10471 for discussion about the thresholds here.
|
|
33
33
|
const ALLOWABLE_OFFSCREEN_IN_PX = 100;
|
|
@@ -174,7 +174,7 @@ class OffscreenImages extends ByteEfficiencyAudit {
|
|
|
174
174
|
* @param {LH.Artifacts} artifacts
|
|
175
175
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
176
176
|
* @param {LH.Audit.Context} context
|
|
177
|
-
* @return {Promise<
|
|
177
|
+
* @return {Promise<import('./byte-efficiency-audit.js').ByteEfficiencyProduct>}
|
|
178
178
|
*/
|
|
179
179
|
static async audit_(artifacts, networkRecords, context) {
|
|
180
180
|
const images = artifacts.ImageElements;
|
|
@@ -249,5 +249,5 @@ class OffscreenImages extends ByteEfficiencyAudit {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
export default OffscreenImages;
|
|
253
|
+
export {UIStrings};
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** @typedef {import('../../lib/dependency-graph/simulator/simulator')} Simulator */
|
|
12
|
+
import {Audit} from '../audit.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
+
import {BaseNode} from '../../lib/dependency-graph/base-node.js';
|
|
15
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
16
|
+
import UnusedCSS from '../../computed/unused-css.js';
|
|
17
|
+
import {NetworkRequest} from '../../lib/network-request.js';
|
|
18
|
+
import ProcessedTrace from '../../computed/processed-trace.js';
|
|
19
|
+
import ProcessedNavigation from '../../computed/processed-navigation.js';
|
|
20
|
+
import LoadSimulator from '../../computed/load-simulator.js';
|
|
21
|
+
import FirstContentfulPaint from '../../computed/metrics/first-contentful-paint.js';
|
|
22
|
+
|
|
23
|
+
/** @typedef {import('../../lib/dependency-graph/simulator/simulator').Simulator} Simulator */
|
|
24
24
|
/** @typedef {import('../../lib/dependency-graph/base-node.js').Node} Node */
|
|
25
25
|
/** @typedef {import('../../lib/dependency-graph/network-node.js')} NetworkNode */
|
|
26
26
|
|
|
@@ -39,7 +39,7 @@ const UIStrings = {
|
|
|
39
39
|
'JS/styles. [Learn more](https://web.dev/render-blocking-resources/).',
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
42
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Given a simulation's nodeTimings, return an object with the nodes/timing keyed by network URL
|
|
@@ -304,5 +304,5 @@ class RenderBlockingResources extends Audit {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
export default RenderBlockingResources;
|
|
308
|
+
export {UIStrings};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {Audit} from '../audit.js';
|
|
9
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
10
|
+
import {NetworkRequest} from '../../lib/network-request.js';
|
|
11
|
+
import NetworkRecords from '../../computed/network-records.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
14
|
/** Title of a diagnostic audit that provides detail on large network resources required during page load. 'Payloads' is roughly equivalent to 'resources'. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
|
|
@@ -24,7 +24,7 @@ const UIStrings = {
|
|
|
24
24
|
displayValue: 'Total size was {totalBytes, number, bytes}\xa0KiB',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
27
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
28
28
|
|
|
29
29
|
class TotalByteWeight extends Audit {
|
|
30
30
|
/**
|
|
@@ -107,5 +107,5 @@ class TotalByteWeight extends Audit {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
export default TotalByteWeight;
|
|
111
|
+
export {UIStrings};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
9
|
+
import UnusedCSS from '../../computed/unused-css.js';
|
|
10
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
|
+
import {computeCSSTokenLength as computeTokenLength} from '../../lib/minification-estimator.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
14
|
/** Imperative title of a Lighthouse audit that tells the user to minify (remove whitespace) the page's CSS code. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
'[Learn more](https://web.dev/unminified-css/).',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
21
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
22
22
|
|
|
23
23
|
const IGNORE_THRESHOLD_IN_PERCENT = 5;
|
|
24
24
|
const IGNORE_THRESHOLD_IN_BYTES = 2048;
|
|
@@ -81,7 +81,7 @@ class UnminifiedCSS extends ByteEfficiencyAudit {
|
|
|
81
81
|
/**
|
|
82
82
|
* @param {LH.Artifacts} artifacts
|
|
83
83
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
84
|
-
* @return {
|
|
84
|
+
* @return {import('./byte-efficiency-audit.js').ByteEfficiencyProduct}
|
|
85
85
|
*/
|
|
86
86
|
static audit_(artifacts, networkRecords) {
|
|
87
87
|
const items = [];
|
|
@@ -111,5 +111,5 @@ class UnminifiedCSS extends ByteEfficiencyAudit {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
export default UnminifiedCSS;
|
|
115
|
+
export {UIStrings};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
9
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
10
|
+
import {computeJSTokenLength as computeTokenLength} from '../../lib/minification-estimator.js';
|
|
11
|
+
import {getRequestForScript, isInline} from '../../lib/script-helpers.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
14
|
/** Imperative title of a Lighthouse audit that tells the user to minify the page’s JS code to reduce file size. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
'[Learn more](https://web.dev/unminified-javascript/).',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
21
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
22
22
|
|
|
23
23
|
const IGNORE_THRESHOLD_IN_PERCENT = 10;
|
|
24
24
|
const IGNORE_THRESHOLD_IN_BYTES = 2048;
|
|
@@ -73,7 +73,7 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {
|
|
|
73
73
|
/**
|
|
74
74
|
* @param {LH.Artifacts} artifacts
|
|
75
75
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
76
|
-
* @return {
|
|
76
|
+
* @return {import('./byte-efficiency-audit.js').ByteEfficiencyProduct}
|
|
77
77
|
*/
|
|
78
78
|
static audit_(artifacts, networkRecords) {
|
|
79
79
|
/** @type {Array<LH.Audit.ByteEfficiencyItem>} */
|
|
@@ -115,5 +115,5 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
export default UnminifiedJavaScript;
|
|
119
|
+
export {UIStrings};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
9
|
+
import UnusedCSS from '../../computed/unused-css.js';
|
|
10
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
11
|
|
|
12
12
|
const UIStrings = {
|
|
13
13
|
/** Imperative title of a Lighthouse audit that tells the user to reduce content from their CSS that isn’t needed immediately and instead load that content at a later time. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
'[Learn more](https://web.dev/unused-css-rules/).',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
21
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
22
22
|
|
|
23
23
|
// Allow 10KiB of unused CSS to permit `:hover` and other styles not used on a non-interactive load.
|
|
24
24
|
// @see https://github.com/GoogleChrome/lighthouse/issues/9353 for more discussion.
|
|
@@ -42,7 +42,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {
|
|
|
42
42
|
* @param {LH.Artifacts} artifacts
|
|
43
43
|
* @param {LH.Artifacts.NetworkRequest[]} _
|
|
44
44
|
* @param {LH.Audit.Context} context
|
|
45
|
-
* @return {Promise<
|
|
45
|
+
* @return {Promise<import('./byte-efficiency-audit.js').ByteEfficiencyProduct>}
|
|
46
46
|
*/
|
|
47
47
|
static async audit_(artifacts, _, context) {
|
|
48
48
|
const unusedCssItems = await UnusedCSS.request({
|
|
@@ -66,5 +66,5 @@ class UnusedCSSRules extends ByteEfficiencyAudit {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
export default UnusedCSSRules;
|
|
70
|
+
export {UIStrings};
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
9
|
+
import UnusedJavaScriptSummary from '../../computed/unused-javascript-summary.js';
|
|
10
|
+
import JsBundles from '../../computed/js-bundles.js';
|
|
11
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
12
|
+
import {getRequestForScript} from '../../lib/script-helpers.js';
|
|
13
13
|
|
|
14
14
|
const UIStrings = {
|
|
15
15
|
/** Imperative title of a Lighthouse audit that tells the user to reduce JavaScript that is never evaluated during page load. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -19,7 +19,7 @@ const UIStrings = {
|
|
|
19
19
|
'decrease bytes consumed by network activity. [Learn more](https://web.dev/unused-javascript/).',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
22
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
23
23
|
|
|
24
24
|
const UNUSED_BYTES_IGNORE_THRESHOLD = 20 * 1024;
|
|
25
25
|
const UNUSED_BYTES_IGNORE_BUNDLE_SOURCE_THRESHOLD = 512;
|
|
@@ -77,7 +77,7 @@ class UnusedJavaScript extends ByteEfficiencyAudit {
|
|
|
77
77
|
* @param {LH.Artifacts} artifacts
|
|
78
78
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
79
79
|
* @param {LH.Audit.Context} context
|
|
80
|
-
* @return {Promise<
|
|
80
|
+
* @return {Promise<import('./byte-efficiency-audit.js').ByteEfficiencyProduct>}
|
|
81
81
|
*/
|
|
82
82
|
static async audit_(artifacts, networkRecords, context) {
|
|
83
83
|
const bundles = await JsBundles.request(artifacts, context);
|
|
@@ -160,5 +160,5 @@ class UnusedJavaScript extends ByteEfficiencyAudit {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
export default UnusedJavaScript;
|
|
164
|
+
export {UIStrings};
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import parseCacheControl from 'parse-cache-control';
|
|
9
|
+
import {Audit} from '../audit.js';
|
|
10
|
+
import {NetworkRequest} from '../../lib/network-request.js';
|
|
11
|
+
import URL from '../../lib/url-shim.js';
|
|
12
|
+
import {linearInterpolation} from '../../lib/statistics.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
+
import NetworkRecords from '../../computed/network-records.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
17
17
|
/** Title of a diagnostic audit that provides detail on the cache policy applies to the page's static assets. Cache refers to browser disk cache, which keeps old versions of network resources around for future use. This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -29,7 +29,7 @@ const UIStrings = {
|
|
|
29
29
|
}`,
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
32
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
33
33
|
|
|
34
34
|
// Ignore assets that have very high likelihood of cache hit
|
|
35
35
|
const IGNORE_THRESHOLD_IN_PERCENT = 0.925;
|
|
@@ -294,5 +294,5 @@ class CacheHeaders extends Audit {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
export default CacheHeaders;
|
|
298
|
+
export {UIStrings};
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
13
|
+
import URL from '../../lib/url-shim.js';
|
|
14
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
17
17
|
/** Imperative title of a Lighthouse audit that tells the user to encode images with optimization (better compression). This is displayed in a list of audit titles that Lighthouse generates. */
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
'[Learn more](https://web.dev/uses-optimized-images/).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
24
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
25
25
|
|
|
26
26
|
const IGNORE_THRESHOLD_IN_BYTES = 4096;
|
|
27
27
|
|
|
@@ -66,7 +66,7 @@ class UsesOptimizedImages extends ByteEfficiencyAudit {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @param {LH.Artifacts} artifacts
|
|
69
|
-
* @return {
|
|
69
|
+
* @return {import('./byte-efficiency-audit.js').ByteEfficiencyProduct}
|
|
70
70
|
*/
|
|
71
71
|
static audit_(artifacts) {
|
|
72
72
|
const pageURL = artifacts.URL.finalUrl;
|
|
@@ -141,5 +141,5 @@ class UsesOptimizedImages extends ByteEfficiencyAudit {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
export default UsesOptimizedImages;
|
|
145
|
+
export {UIStrings};
|