From a9c313e0a9ff9d1c5f90c207bd911e19915af4c6 Mon Sep 17 00:00:00 2001 From: Christopher Holder <40126819+ChristopherPHolder@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:50:43 +0300 Subject: [PATCH 1/6] deps(lodash): migrate lodash to lodash-es (#16211) --- cli/test/smokehouse/frontends/lib.js | 2 +- .../smokehouse/frontends/smokehouse-bin.js | 2 +- cli/test/smokehouse/report-assert.js | 2 +- core/config/config-helpers.js | 6 +++--- core/gather/base-artifacts.js | 4 ++-- core/lib/arbitrary-equality-map.js | 4 ++-- core/runner.js | 8 ++++---- core/scripts/i18n/collect-strings.js | 4 ++-- package.json | 4 ++-- shared/localization/swap-locale.js | 8 ++++---- yarn.lock | 20 +++++++++++++++---- 11 files changed, 38 insertions(+), 26 deletions(-) diff --git a/cli/test/smokehouse/frontends/lib.js b/cli/test/smokehouse/frontends/lib.js index 08683373a39a..7283662bd2c3 100644 --- a/cli/test/smokehouse/frontends/lib.js +++ b/cli/test/smokehouse/frontends/lib.js @@ -12,7 +12,7 @@ /* eslint-disable no-console */ -import cloneDeep from 'lodash/cloneDeep.js'; +import {cloneDeep} from 'lodash-es'; import smokeTests from '../core-tests.js'; import {runSmokehouse, getShardedDefinitions} from '../smokehouse.js'; diff --git a/cli/test/smokehouse/frontends/smokehouse-bin.js b/cli/test/smokehouse/frontends/smokehouse-bin.js index 2ae51e1bf6aa..acb20ac51d26 100644 --- a/cli/test/smokehouse/frontends/smokehouse-bin.js +++ b/cli/test/smokehouse/frontends/smokehouse-bin.js @@ -16,7 +16,7 @@ import path from 'path'; import fs from 'fs'; import url from 'url'; -import cloneDeep from 'lodash/cloneDeep.js'; +import {cloneDeep} from 'lodash-es'; import yargs from 'yargs'; import * as yargsHelpers from 'yargs/helpers'; import log from 'lighthouse-logger'; diff --git a/cli/test/smokehouse/report-assert.js b/cli/test/smokehouse/report-assert.js index e21707be5dfe..2cc4e767af75 100644 --- a/cli/test/smokehouse/report-assert.js +++ b/cli/test/smokehouse/report-assert.js @@ -9,7 +9,7 @@ * against the results actually collected from Lighthouse. */ -import cloneDeep from 'lodash/cloneDeep.js'; +import {cloneDeep} from 'lodash-es'; import log from 'lighthouse-logger'; import {LocalConsole} from './lib/local-console.js'; diff --git a/core/config/config-helpers.js b/core/config/config-helpers.js index 00b672386593..53f9a5778828 100644 --- a/core/config/config-helpers.js +++ b/core/config/config-helpers.js @@ -8,7 +8,7 @@ import path from 'path'; import {createRequire} from 'module'; import url from 'url'; -import isDeepEqual from 'lodash/isEqual.js'; +import {isEqual} from 'lodash-es'; import * as constants from './constants.js'; import ConfigPlugin from './config-plugin.js'; @@ -69,7 +69,7 @@ const mergeOptionsOfItems = function(items) { * - `null` is treated similarly to `undefined` for whether a value should be overridden. * - `overwriteArrays` controls array extension behavior: * - true: Arrays are overwritten without any merging or concatenation. - * - false: Arrays are concatenated and de-duped by isDeepEqual. + * - false: Arrays are concatenated and de-duped by isEqual. * - Objects are recursively merged. * - If the `settings` key is encountered while traversing an object, its arrays are *always* * overridden, not concatenated. (`overwriteArrays` is flipped to `true`) @@ -90,7 +90,7 @@ function _mergeConfigFragment(base, extension, overwriteArrays = false) { if (!Array.isArray(base)) throw new TypeError(`Expected array but got ${typeof base}`); const merged = base.slice(); extension.forEach(item => { - if (!merged.some(candidate => isDeepEqual(candidate, item))) merged.push(item); + if (!merged.some(candidate => isEqual(candidate, item))) merged.push(item); }); return merged; diff --git a/core/gather/base-artifacts.js b/core/gather/base-artifacts.js index 5bb2a639cda4..b4e33a368174 100644 --- a/core/gather/base-artifacts.js +++ b/core/gather/base-artifacts.js @@ -5,7 +5,7 @@ */ import log from 'lighthouse-logger'; -import isDeepEqual from 'lodash/isEqual.js'; +import {isEqual} from 'lodash-es'; import { getBrowserVersion, getBenchmarkIndex, getEnvironmentWarnings, @@ -52,7 +52,7 @@ function deduplicateWarnings(warnings) { const unique = []; for (const warning of warnings) { - if (unique.some(existing => isDeepEqual(warning, existing))) continue; + if (unique.some(existing => isEqual(warning, existing))) continue; unique.push(warning); } diff --git a/core/lib/arbitrary-equality-map.js b/core/lib/arbitrary-equality-map.js index 85648d3e6fb2..4981cfd235b0 100644 --- a/core/lib/arbitrary-equality-map.js +++ b/core/lib/arbitrary-equality-map.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import isDeepEqual from 'lodash/isEqual.js'; +import {isEqual} from 'lodash-es'; /** * @fileoverview This class is designed to allow maps with arbitrary equality functions. @@ -73,7 +73,7 @@ class ArbitraryEqualityMap { * @return {boolean} */ static deepEquals(objA, objB) { - return isDeepEqual(objA, objB); + return isEqual(objA, objB); } } diff --git a/core/runner.js b/core/runner.js index ad4ccaeab9e7..96e762bd40cf 100644 --- a/core/runner.js +++ b/core/runner.js @@ -9,7 +9,7 @@ import path from 'path'; import log from 'lighthouse-logger'; -import isDeepEqual from 'lodash/isEqual.js'; +import {isEqual} from 'lodash-es'; import {ReportScoring} from './scoring.js'; import {Audit} from './audits/audit.js'; @@ -308,7 +308,7 @@ class Runner { ...Object.keys(normalizedAuditSettings), ]); for (const k of keys) { - if (!isDeepEqual(normalizedGatherSettings[k], normalizedAuditSettings[k])) { + if (!isEqual(normalizedGatherSettings[k], normalizedAuditSettings[k])) { throw new Error( `Cannot change settings between gathering and auditing… Difference found at: \`${k}\` @@ -318,8 +318,8 @@ vs } } - // Call `isDeepEqual` on the entire thing, just in case something was missed. - if (!isDeepEqual(normalizedGatherSettings, normalizedAuditSettings)) { + // Call `isEqual` on the entire thing, just in case something was missed. + if (!isEqual(normalizedGatherSettings, normalizedAuditSettings)) { throw new Error('Cannot change settings between gathering and auditing'); } } diff --git a/core/scripts/i18n/collect-strings.js b/core/scripts/i18n/collect-strings.js index 3ef95a4240c5..215fe1001694 100644 --- a/core/scripts/i18n/collect-strings.js +++ b/core/scripts/i18n/collect-strings.js @@ -16,7 +16,7 @@ import {expect} from 'expect'; import tsc from 'typescript'; import MessageParser from '@formatjs/icu-messageformat-parser'; import esMain from 'es-main'; -import isDeepEqual from 'lodash/isEqual.js'; +import {isEqual} from 'lodash-es'; import {Util} from '../../../shared/util.js'; import {collectAndBakeCtcStrings} from './bake-ctc-to-lhl.js'; @@ -660,7 +660,7 @@ function doPlaceholdersMatch(strings) { // Technically placeholder `content` is not required to match by TC, but since // `example` must match and any auto-generated `example` is copied from `content`, // it would be confusing to let it differ when `example` is explicit. - return strings.every(val => isDeepEqual(val.ctc.placeholders, strings[0].ctc.placeholders)); + return strings.every(val => isEqual(val.ctc.placeholders, strings[0].ctc.placeholders)); } /** diff --git a/package.json b/package.json index dcb2a194b7df..38226d65bd46 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@types/google.analytics": "0.0.39", "@types/jpeg-js": "^0.3.7", "@types/jsdom": "^16.2.13", - "@types/lodash": "^4.14.178", + "@types/lodash-es": "^4.17.12", "@types/mocha": "^9.0.0", "@types/node": "*", "@types/pako": "^1.0.1", @@ -195,7 +195,7 @@ "js-library-detector": "^6.7.0", "lighthouse-logger": "^2.0.1", "lighthouse-stack-packs": "1.12.1", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "lookup-closest-locale": "6.2.0", "metaviewport-parser": "0.3.0", "open": "^8.4.0", diff --git a/shared/localization/swap-locale.js b/shared/localization/swap-locale.js index 8e5d40436317..f80e93359366 100644 --- a/shared/localization/swap-locale.js +++ b/shared/localization/swap-locale.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import _set from 'lodash/set.js'; -import _get from 'lodash/get.js'; +import {set} from 'lodash-es'; +import {get} from 'lodash-es'; import * as format from './format.js'; @@ -72,7 +72,7 @@ function swapLocale(lhr, requestedLocale) { // If the path isn't valid or the value isn't a string, there's no point in trying to replace it. /** @type {unknown} */ - const originalString = _get(lhr, path); + const originalString = get(lhr, path); if (typeof originalString !== 'string') { continue; } @@ -96,7 +96,7 @@ function swapLocale(lhr, requestedLocale) { } // Write string back into the LHR. - _set(lhr, path, relocalizedString); + set(lhr, path, relocalizedString); } } diff --git a/yarn.lock b/yarn.lock index e059d5a6a3c6..6ac4968758af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1458,10 +1458,17 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.178": - version "4.14.178" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" - integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== +"@types/lodash-es@^4.17.12": + version "4.17.12" + resolved "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz#65f6d1e5f80539aa7cfbfc962de5def0cf4f341b" + integrity sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.17.10" + resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.10.tgz#64f3edf656af2fe59e7278b73d3e62404144a6e6" + integrity sha512-YpS0zzoduEhuOWjAotS6A5AVCva7X4lVlYLF0FYHAY9sdraBfnatttHItlWeZdGhuEkf+OzMNg2ZYAx8t+52uQ== "@types/long@^4.0.1": version "4.0.1" @@ -5099,6 +5106,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash-es@^4.17.21: + version "4.17.21" + resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" + integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== + lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" From 4477badd5f492a1703c03028e44380ce9981fcab Mon Sep 17 00:00:00 2001 From: Adam Raine <6752989+adamraine@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:59:33 -0700 Subject: [PATCH 2/6] deps: upgrade puppeteer to 23.5.2 (#16220) --- package.json | 4 ++-- yarn.lock | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 38226d65bd46..4f8e6f58832e 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "pako": "^2.0.3", "preact": "^10.7.2", "pretty-json-stringify": "^0.0.2", - "puppeteer": "^23.3.0", + "puppeteer": "^23.5.2", "resolve": "^1.22.1", "rollup": "^2.52.7", "rollup-plugin-polyfill-node": "^0.12.0", @@ -200,7 +200,7 @@ "metaviewport-parser": "0.3.0", "open": "^8.4.0", "parse-cache-control": "1.0.1", - "puppeteer-core": "^23.3.0", + "puppeteer-core": "^23.5.2", "robots-parser": "^3.0.1", "semver": "^5.3.0", "speedline-core": "^1.4.3", diff --git a/yarn.lock b/yarn.lock index 6ac4968758af..5b4701c3cfa1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2365,10 +2365,10 @@ chrome-launcher@^1.1.2: is-wsl "^2.2.0" lighthouse-logger "^2.0.1" -chromium-bidi@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.6.5.tgz#31be98f9ee5c93fa99d240c680518c9293d8c6bb" - integrity sha512-RuLrmzYrxSb0s9SgpB+QN5jJucPduZQ/9SIe76MDxYJuecPW5mxMdacJ1f4EtgiV+R0p3sCkznTMvH0MPGFqjA== +chromium-bidi@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.8.0.tgz#ffd79dad7db1fcc874f1c55fcf46ded05a884269" + integrity sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug== dependencies: mitt "3.0.1" urlpattern-polyfill "10.0.0" @@ -2878,6 +2878,13 @@ debug@^4.3.6: dependencies: ms "2.1.2" +debug@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -2954,7 +2961,7 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -devtools-protocol@0.0.1312386, devtools-protocol@0.0.1330662: +devtools-protocol@0.0.1312386, devtools-protocol@0.0.1342118: version "0.0.1312386" resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz#5ab824d6f1669ec6c6eb0fba047e73601d969052" integrity sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA== @@ -5426,7 +5433,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1: +ms@2.1.3, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -6056,28 +6063,28 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer-core@23.3.0, puppeteer-core@^23.3.0: - version "23.3.0" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-23.3.0.tgz#e9e7367367e230ab3ed0b6b674170b09ba0a96e3" - integrity sha512-sB2SsVMFs4gKad5OCdv6w5vocvtEUrRl0zQqSyRPbo/cj1Ktbarmhxy02Zyb9R9HrssBcJDZbkrvBnbaesPyYg== +puppeteer-core@23.5.2, puppeteer-core@^23.5.2: + version "23.5.2" + resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-23.5.2.tgz#91f19f4154775a8f97709c887e506c784e6fa965" + integrity sha512-UwPAX29EID8lJmxeL7JT3Gz35D1BHn5o9ZXpBLoR24W7gtUg1dLx7OUPsUTR5Tlxf+1Yeqw9W3qP4uqWThqXgg== dependencies: "@puppeteer/browsers" "2.4.0" - chromium-bidi "0.6.5" - debug "^4.3.6" - devtools-protocol "0.0.1330662" + chromium-bidi "0.8.0" + debug "^4.3.7" + devtools-protocol "0.0.1342118" typed-query-selector "^2.12.0" ws "^8.18.0" -puppeteer@^23.3.0: - version "23.3.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-23.3.0.tgz#f2a3b28c05c17504adf1a903247e01f93e27d6b5" - integrity sha512-e2jY8cdWSUGsrLxqGm3hIbJq/UIk1uOY8XY7SM51leXkH7shrIyE91lK90Q9byX6tte+cyL3HKqlWBEd6TjWTA== +puppeteer@^23.5.2: + version "23.5.2" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-23.5.2.tgz#2e4cb80d07aa5b385dae7a23140e4503f948d586" + integrity sha512-7OOGEIoCjGP9lQ6QHvRSBTO3VRDPvu+YGl6rLCKOfYNMp1Lqc1U+s3lS1JdyR+jee1pZ55sxf+TEKsmqOopO1A== dependencies: "@puppeteer/browsers" "2.4.0" - chromium-bidi "0.6.5" + chromium-bidi "0.8.0" cosmiconfig "^9.0.0" - devtools-protocol "0.0.1330662" - puppeteer-core "23.3.0" + devtools-protocol "0.0.1342118" + puppeteer-core "23.5.2" typed-query-selector "^2.12.0" q@^1.5.1: From 6ff3ef09dd29f67fcf6063367a52ff1e7565b6cf Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 16 Oct 2024 11:36:38 +1300 Subject: [PATCH 3/6] deps(sentry): upgrade to v7 (#16215) --- package.json | 2 +- yarn.lock | 157 +++++++++++++++++++++------------------------------ 2 files changed, 65 insertions(+), 94 deletions(-) diff --git a/package.json b/package.json index 4f8e6f58832e..c4b6c6336fbb 100644 --- a/package.json +++ b/package.json @@ -182,7 +182,7 @@ }, "dependencies": { "@paulirish/trace_engine": "0.0.32", - "@sentry/node": "^6.17.4", + "@sentry/node": "^7.0.0", "axe-core": "^4.10.0", "chrome-launcher": "^1.1.2", "configstore": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index 5b4701c3cfa1..d36893f55304 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1170,73 +1170,55 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@sentry/core@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.17.4.tgz#ac23c2a9896b27fe4c532c2013c58c01f39adcdb" - integrity sha512-7QFgw+I9YK/X1Gie0c7phwT5pHMow66UCXHzDzHR2aK/0X3Lhn8OWlcGjIt5zmiBK/LHwNfQBNMskbktbYHgdA== - dependencies: - "@sentry/hub" "6.17.4" - "@sentry/minimal" "6.17.4" - "@sentry/types" "6.17.4" - "@sentry/utils" "6.17.4" - tslib "^1.9.3" - -"@sentry/hub@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.17.4.tgz#af4f5f745340d676be023dc3038690b557111f4d" - integrity sha512-6+EvPcrPCwUmayeieIpm1ZrRNWriqMHWZFyw+MzunFLgG8IH8G45cJU1zNnTY9Jwwg4sFIS9xrHy3AOkctnIGw== - dependencies: - "@sentry/types" "6.17.4" - "@sentry/utils" "6.17.4" - tslib "^1.9.3" - -"@sentry/minimal@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.17.4.tgz#6a35dbdb22a1c532d1eb7b4c0d9223618cb67ccd" - integrity sha512-p1A8UTtRt7bhV4ygu7yDNCannFr9E9dmqgeZWC7HrrTfygcnhNRFvTXTj92wEb0bFKuZr67wPSKnoXlkqkGxsw== - dependencies: - "@sentry/hub" "6.17.4" - "@sentry/types" "6.17.4" - tslib "^1.9.3" - -"@sentry/node@^6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.17.4.tgz#1207530e9d84c049ffffe070bc2bb8eba47bf21b" - integrity sha512-LpC07HsobBiFrNLe16ubgHGw95+7+3fEBhSn58r48j68c4Qak3fDmpR1Uy0rhyX1Nr/WFdlE/4npkgJw+1lN/w== - dependencies: - "@sentry/core" "6.17.4" - "@sentry/hub" "6.17.4" - "@sentry/tracing" "6.17.4" - "@sentry/types" "6.17.4" - "@sentry/utils" "6.17.4" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/tracing@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.17.4.tgz#17c2ab50d9e4cdf727b9b25e7f91ae3a9ea19437" - integrity sha512-UV6wWH/fqndts0k0cptsNtzD0h8KXqHInJSCGqlWDlygFRO16jwMKv0wfXgqsgc3cBGDlsl8C4l6COSwz9ROdg== - dependencies: - "@sentry/hub" "6.17.4" - "@sentry/minimal" "6.17.4" - "@sentry/types" "6.17.4" - "@sentry/utils" "6.17.4" - tslib "^1.9.3" - -"@sentry/types@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.17.4.tgz#36b78d7c4a6de19b2bbc631bb34893bcad30c0ba" - integrity sha512-RUyiXCKf61k2GIMP7FQX0naoSew4zLxe+UrtbjwVcWU4AFPZfH7tLNtTpVE85zAKbxsaiq3OD2FPtTZarHcwxQ== - -"@sentry/utils@6.17.4": - version "6.17.4" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.17.4.tgz#4f109629d2e7f16c5595b4367445ef47bfe96b61" - integrity sha512-+ENzZbrlVL1JJ+FoK2EOS27nbA/yToeaJPFlyVOnbthUxVyN3TTi9Uzn9F05fIE/2BTkOEk89wPtgcHafgrD6A== - dependencies: - "@sentry/types" "6.17.4" - tslib "^1.9.3" +"@sentry-internal/tracing@7.119.1": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.119.1.tgz#500d50d451bfd0ce6b185e9f112208229739ab03" + integrity sha512-cI0YraPd6qBwvUA3wQdPGTy8PzAoK0NZiaTN1LM3IczdPegehWOaEG5GVTnpGnTsmBAzn1xnBXNBhgiU4dgcrQ== + dependencies: + "@sentry/core" "7.119.1" + "@sentry/types" "7.119.1" + "@sentry/utils" "7.119.1" + +"@sentry/core@7.119.1": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.119.1.tgz#63e949cad167a0ee5e52986c93b96ff1d6a05b57" + integrity sha512-YUNnH7O7paVd+UmpArWCPH4Phlb5LwrkWVqzFWqL3xPyCcTSof2RL8UmvpkTjgYJjJ+NDfq5mPFkqv3aOEn5Sw== + dependencies: + "@sentry/types" "7.119.1" + "@sentry/utils" "7.119.1" + +"@sentry/integrations@7.119.1": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.119.1.tgz#9fc17aa9fcb942fbd2fc12eecd77a0f316897960" + integrity sha512-CGmLEPnaBqbUleVqrmGYjRjf5/OwjUXo57I9t0KKWViq81mWnYhaUhRZWFNoCNQHns+3+GPCOMvl0zlawt+evw== + dependencies: + "@sentry/core" "7.119.1" + "@sentry/types" "7.119.1" + "@sentry/utils" "7.119.1" + localforage "^1.8.1" + +"@sentry/node@^7.0.0": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.119.1.tgz#01fbd8985b71443ca39c642bc062b868e4b3bee4" + integrity sha512-rpnoQCMxWh/ccjOe+qsmvXAdlTxQHXEWdaltSxnwj7QY+kOGKGP18WTQFLq/gdOBRw9aa6PEQGwhnLfhBXXaYg== + dependencies: + "@sentry-internal/tracing" "7.119.1" + "@sentry/core" "7.119.1" + "@sentry/integrations" "7.119.1" + "@sentry/types" "7.119.1" + "@sentry/utils" "7.119.1" + +"@sentry/types@7.119.1": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.119.1.tgz#f9c3c12e217c9078a6d556c92590e42a39b750dd" + integrity sha512-4G2mcZNnYzK3pa2PuTq+M2GcwBRY/yy1rF+HfZU+LAPZr98nzq2X3+mJHNJoobeHRkvVh7YZMPi4ogXiIS5VNQ== + +"@sentry/utils@7.119.1": + version "7.119.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.119.1.tgz#08b28fa8170987a60e149e2102e83395a95e9a89" + integrity sha512-ju/Cvyeu/vkfC5/XBV30UNet5kLEicZmXSyuLwZu95hEbL+foPdxN+re7pCI/eNqfe3B2vz7lvz5afLVOlQ2Hg== + dependencies: + "@sentry/types" "7.119.1" "@sinclair/typebox@^0.23.3": version "0.23.5" @@ -1736,13 +1718,6 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - agent-base@^7.0.2, agent-base@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" @@ -2681,11 +2656,6 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -cookie@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" - integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== - copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -4250,14 +4220,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - https-proxy-agent@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b" @@ -5051,6 +5013,13 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + lie@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" @@ -5091,6 +5060,13 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" +localforage@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5208,11 +5184,6 @@ lru-cache@^7.14.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - lz-string@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" @@ -7116,7 +7087,7 @@ tsconfig-paths@^3.11.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== From 0da3e1d85d1920e3e75e423e6f905ddf4bd8fd53 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 15 Oct 2024 16:49:30 -0700 Subject: [PATCH 4/6] core(network-monitor): treat EventSource as non-critical (#16225) --- core/gather/driver/network-monitor.js | 13 ++++++++----- core/test/gather/driver/network-monitor-test.js | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/core/gather/driver/network-monitor.js b/core/gather/driver/network-monitor.js index 814c357a3703..4788037ab94c 100644 --- a/core/gather/driver/network-monitor.js +++ b/core/gather/driver/network-monitor.js @@ -129,7 +129,7 @@ class NetworkMonitor extends NetworkMonitorEventEmitter { * Returns whether the network is completely idle (i.e. there are 0 inflight network requests). */ isIdle() { - return this._isActiveIdlePeriod(0); + return this._isIdlePeriod(0); } /** @@ -144,10 +144,13 @@ class NetworkMonitor extends NetworkMonitorEventEmitter { const rootFrameRequest = requests.find(r => r.resourceType === 'Document'); const rootFrameId = rootFrameRequest?.frameId; - return this._isActiveIdlePeriod( + return this._isIdlePeriod( 0, + // Return true if it should be a candidate for critical. request => request.frameId === rootFrameId && + // WebSocket and Server-sent Events are typically long-lived and shouldn't be considered critical. + request.resourceType !== 'WebSocket' && request.resourceType !== 'EventSource' && (request.priority === 'VeryHigh' || request.priority === 'High') ); } @@ -156,7 +159,7 @@ class NetworkMonitor extends NetworkMonitorEventEmitter { * Returns whether the network is semi-idle (i.e. there are 2 or fewer inflight network requests). */ is2Idle() { - return this._isActiveIdlePeriod(2); + return this._isIdlePeriod(2); } /** @@ -166,7 +169,7 @@ class NetworkMonitor extends NetworkMonitorEventEmitter { * @param {(request: NetworkRequest) => boolean} [requestFilter] * @return {boolean} */ - _isActiveIdlePeriod(allowedRequests, requestFilter) { + _isIdlePeriod(allowedRequests, requestFilter) { if (!this._networkRecorder) return false; const requests = this._networkRecorder.getRawRecords(); let inflightRequests = 0; @@ -174,7 +177,7 @@ class NetworkMonitor extends NetworkMonitorEventEmitter { for (let i = 0; i < requests.length; i++) { const request = requests[i]; if (request.finished) continue; - if (requestFilter && !requestFilter(request)) continue; + if (requestFilter?.(request) === false) continue; if (NetworkRequest.isNonNetworkRequest(request)) continue; inflightRequests++; } diff --git a/core/test/gather/driver/network-monitor-test.js b/core/test/gather/driver/network-monitor-test.js index 73f6dabcdb6c..77751eecb93b 100644 --- a/core/test/gather/driver/network-monitor-test.js +++ b/core/test/gather/driver/network-monitor-test.js @@ -359,6 +359,22 @@ describe('NetworkMonitor', () => { expect(monitor.is2Idle()).toBe(false); expect(monitor.isCriticalIdle()).toBe(true); }); + + it('should treat longlived stuff as noncritical', () => { + const messages = networkRecordsToDevtoolsLog([ + // WebSockets usually dont have a priority on them. SSE usually is a 'High' + {url: 'http://example.com/ws', priority: undefined, requestId: `314.1`, resourceType: 'WebSocket'}, + {url: 'http://example.com/sse', priority: 'High', requestId: `314.2`, resourceType: 'EventSource'}, + ], {skipVerification: true}).filter(event => event.method === 'Network.requestWillBeSent'); + + for (const message of messages) { + rootDispatch(message); + } + + expect(monitor.isCriticalIdle()).toBe(true); + expect(monitor.isIdle()).toBe(false); + expect(monitor.is2Idle()).toBe(true); + }); }); describe('#findNetworkQuietPeriods', () => { From 9b847f1ecf5b8b764794824a5dfc50569c28ff6d Mon Sep 17 00:00:00 2001 From: Adam Raine <6752989+adamraine@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:21:11 -0700 Subject: [PATCH 5/6] clients(lr): set CPU throttling based on benchmark (#16226) --- core/config/lr-mobile-config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/config/lr-mobile-config.js b/core/config/lr-mobile-config.js index 2ded18786908..973ab77a08e4 100644 --- a/core/config/lr-mobile-config.js +++ b/core/config/lr-mobile-config.js @@ -10,6 +10,11 @@ const config = { settings: { maxWaitForFcp: 15 * 1000, maxWaitForLoad: 35 * 1000, + throttling: { + // Determined using PSI CPU benchmark median and + // https://lighthouse-cpu-throttling-calculator.vercel.app/ + cpuSlowdownMultiplier: 1.5, + }, skipAudits: [ // Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539 'uses-http2', From 4276b07fdb3d349971a648b7d69e6c52035bf2bd Mon Sep 17 00:00:00 2001 From: Adam Raine <6752989+adamraine@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:54:43 -0800 Subject: [PATCH 6/6] tests(smoke): fix devtools test runner & a11y errors (#16236) --- cli/test/smokehouse/test-definitions/a11y.js | 8 ++++---- core/scripts/pptr-run-devtools.js | 16 +++++++++++++--- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cli/test/smokehouse/test-definitions/a11y.js b/cli/test/smokehouse/test-definitions/a11y.js index 68d2fb22aeab..7a0035c3cdd1 100644 --- a/cli/test/smokehouse/test-definitions/a11y.js +++ b/cli/test/smokehouse/test-definitions/a11y.js @@ -419,7 +419,7 @@ const expectations = { 'type': 'node', 'selector': 'body > section > button#button-name', 'snippet': '