Skip to content

Commit

Permalink
core: remove pubads plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Feb 28, 2024
1 parent 9d9a5b3 commit 7a300d3
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 102 deletions.
11 changes: 1 addition & 10 deletions build/build-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {createRequire} from 'module';
import esMain from 'es-main';
import esbuild from 'esbuild';
// @ts-expect-error: plugin has no types.
import PubAdsPlugin from 'lighthouse-plugin-publisher-ads';
// @ts-expect-error: plugin has no types.
import SoftNavPlugin from 'lighthouse-plugin-soft-navigation';

import * as plugins from './esbuild-plugins.js';
Expand All @@ -37,10 +35,7 @@ const require = createRequire(import.meta.url);
const GIT_READABLE_REF =
execSync(process.env.CI ? 'git rev-parse HEAD' : 'git describe').toString().trim();

// HACK: manually include the lighthouse-plugin-publisher-ads audits.
/** @type {Array<string>} */
// @ts-expect-error
const pubAdsAudits = PubAdsPlugin.audits.map(a => a.path);
// HACK: manually include plugin audits.
/** @type {Array<string>} */
// @ts-expect-error
const softNavAudits = SoftNavPlugin.audits.map(a => a.path);
Expand Down Expand Up @@ -93,10 +88,6 @@ async function buildBundle(entryPath, distPath, opts = {minify: true}) {

// Include plugins.
if (isDevtools(entryPath) || isLightrider(entryPath)) {
dynamicModulePaths.push('lighthouse-plugin-publisher-ads');
pubAdsAudits.forEach(pubAdAudit => {
dynamicModulePaths.push(pubAdAudit);
});
dynamicModulePaths.push('lighthouse-plugin-soft-navigation');
softNavAudits.forEach(softNavAudit => {
dynamicModulePaths.push(softNavAudit);
Expand Down
2 changes: 0 additions & 2 deletions cli/test/smokehouse/core-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import perfFonts from './test-definitions/perf-fonts.js';
import perfFrameMetrics from './test-definitions/perf-frame-metrics.js';
import perfPreload from './test-definitions/perf-preload.js';
import perfTraceElements from './test-definitions/perf-trace-elements.js';
import pubads from './test-definitions/pubads.js';
import pwaAirhorner from './test-definitions/pwa-airhorner.js';
import pwaCaltrain from './test-definitions/pwa-caltrain.js';
import pwaChromestatus from './test-definitions/pwa-chromestatus.js';
Expand Down Expand Up @@ -109,7 +108,6 @@ const smokeTests = [
perfFrameMetrics,
perfPreload,
perfTraceElements,
pubads,
pwaAirhorner,
pwaCaltrain,
pwaChromestatus,
Expand Down
54 changes: 0 additions & 54 deletions cli/test/smokehouse/test-definitions/pubads.js

This file was deleted.

3 changes: 0 additions & 3 deletions clients/devtools/devtools-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ globalThis.Buffer = Buffer;
/**
* Returns a config, which runs only certain categories.
* Varies the config to use based on device.
* If `lighthouse-plugin-publisher-ads` is in the list of
* `categoryIDs` the plugin will also be run.
* Counterpart to the CDT code that sets flags.
* @see https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/panels/lighthouse/LighthouseController.ts;l=280
* @param {Array<string>} categoryIDs
Expand All @@ -49,7 +47,6 @@ function createConfig(categoryIDs, device) {

return {
extends: 'lighthouse:default',
plugins: ['lighthouse-plugin-publisher-ads'],
settings,
};
}
Expand Down
2 changes: 1 addition & 1 deletion core/config/config-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function requireAudit(auditPath, coreAuditList, configDir) {
let requirePath = `../audits/${auditPath}`;
if (!coreAudit) {
if (isBundledEnvironment()) {
// This is for pubads bundling.
// This is for plugin bundling.

Check warning on line 290 in core/config/config-helpers.js

View check run for this annotation

Codecov / codecov/patch

core/config/config-helpers.js#L290

Added line #L290 was not covered by tests
requirePath = auditPath;
} else {
// Otherwise, attempt to find it elsewhere. This throws if not found.
Expand Down
3 changes: 0 additions & 3 deletions core/scripts/release/package-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ cd /tmp/lighthouse-local-test

npm init -y
npm install "$LH_ROOT/lighthouse-$VERSION.tgz"
# --force to ignore potentially off peer dependency on Lighthouse itself. This just ignores whatever
# Lighthouse version pubads declares, and defers to the version installed above.
npm install lighthouse-plugin-publisher-ads@next --force
npm explore lighthouse -- npm run fast -- http://example.com --chrome-flags=--headless=new

# Packaged smokehouse/lighthouse using root's static-server and test fixtures.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
"jest-mock": "^27.3.0",
"jest-snapshot": "^28.1.0",
"jsdom": "^12.2.0",
"lighthouse-plugin-publisher-ads": "1.5.7-beta",
"lighthouse-plugin-soft-navigation": "^1.0.1",
"magic-string": "^0.25.7",
"mime-types": "^2.1.30",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('Navigation', function() {
'best-practices',
'seo',
'pwa',
'lighthouse-plugin-publisher-ads',
]);

let numNavigations = 0;
Expand Down
27 changes: 0 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1287,11 +1287,6 @@
resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c"
integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==

"@tusbar/cache-control@^0.3.1":
version "0.3.2"
resolved "https://registry.yarnpkg.com/@tusbar/cache-control/-/cache-control-0.3.2.tgz#6b59cd0ba8fe376fc472012cecde556f667ae4a1"
integrity sha512-69QNun7QkjTAXwvO4J/dvBW19M5q/mcqAnMawPseAEv7DNEAr7flhlW3I9Cp3N4MO0RY/StZYXBq+xkik6Z+VA==

"@types/archiver@^2.1.2":
version "2.1.2"
resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-2.1.2.tgz#e84960d4872570d7c826589cd57f2c076bf198c5"
Expand Down Expand Up @@ -4364,11 +4359,6 @@ internal-slot@^1.0.3:
has "^1.0.3"
side-channel "^1.0.4"

intl-messageformat-parser@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.8.1.tgz#0eb14c5618333be4c95c409457b66c8c33ddcc01"
integrity sha512-IMSCKVf0USrM/959vj3xac7s8f87sc+80Y/ipBzdKy4ifBv5Gsj2tZ41EAaURVg01QU71fYr77uA8Meh6kELbg==

intl-messageformat@^10.5.3:
version "10.5.3"
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-10.5.3.tgz#db0779d4a1988faa2977d76574489b7a25f0d5d0"
Expand All @@ -4379,13 +4369,6 @@ intl-messageformat@^10.5.3:
"@formatjs/icu-messageformat-parser" "2.6.2"
tslib "^2.4.0"

intl-messageformat@^4.1.2:
version "4.4.0"
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-4.4.0.tgz#aa196a4d04b573f4090bc417f982d81de4f74fad"
integrity sha512-z+Bj2rS3LZSYU4+sNitdHrwnBhr0wO80ZJSW8EzKDBowwUe3Q/UsvgCGjrwa+HPzoGCLEb9HAjfJgo4j2Sac8w==
dependencies:
intl-messageformat-parser "^1.8.1"

ip@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48"
Expand Down Expand Up @@ -5065,16 +5048,6 @@ lighthouse-logger@^2.0.1:
debug "^2.6.9"
marky "^1.2.2"

[email protected]:
version "1.5.7-beta"
resolved "https://registry.yarnpkg.com/lighthouse-plugin-publisher-ads/-/lighthouse-plugin-publisher-ads-1.5.7-beta.tgz#ac35b0d8f9ee01c774d45a18fee109cded6395ec"
integrity sha512-Wh9A0RNEPtJowJ34LflMX/g8IDtJh4/ie757UIrsBLc1swWCrKvl2bVzuXRuzmr9ErTkNlqtm8wbdXEoD6bDCw==
dependencies:
"@tusbar/cache-control" "^0.3.1"
esprima "^4.0.1"
intl-messageformat "^4.1.2"
yargs "^16.1.1"

lighthouse-plugin-soft-navigation@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/lighthouse-plugin-soft-navigation/-/lighthouse-plugin-soft-navigation-1.0.1.tgz#82fb2008991458d753a819dd3e1f076d55eb2bfb"
Expand Down

0 comments on commit 7a300d3

Please sign in to comment.