Skip to content

Commit

Permalink
Add front_end/third_party/third-party-web
Browse files Browse the repository at this point in the history
This is already included via the Lighthouse bundle, but
we need this for an insight in RPP. I changed LH to make
this library be injected at runtime, and cherry-pick the
change here in this CL, so as not to add an additional
40 KB (post-compression) to Chromium.

Related LH PR: GoogleChrome/lighthouse#16166

Bug: 352244718
Change-Id: Iafbf8345bedc23038d83723233a55e4f54c4cb05
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5809617
Reviewed-by: Paul Irish <paulirish@chromium.org>
Commit-Queue: Connor Clark <cjamcl@chromium.org>
  • Loading branch information
Connor Clark authored and Devtools-frontend LUCI CQ committed Aug 27, 2024
1 parent d44f7bd commit 2a4b4f7
Show file tree
Hide file tree
Showing 43 changed files with 3,538 additions and 975 deletions.
2 changes: 2 additions & 0 deletions config/gni/devtools_grd_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ grd_files_release_sources = [
"front_end/third_party/marked/marked.js",
"front_end/third_party/puppeteer-replay/puppeteer-replay.js",
"front_end/third_party/puppeteer/puppeteer.js",
"front_end/third_party/third-party-web/third-party-web.js",
"front_end/third_party/wasmparser/wasmparser.js",
"front_end/third_party/web-vitals/web-vitals.js",
"front_end/ui/components/adorners/adorners.js",
Expand Down Expand Up @@ -2032,6 +2033,7 @@ grd_files_debug_sources = [
"front_end/third_party/puppeteer/package/lib/esm/third_party/mitt/mitt.js",
"front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js/parsel-js.js",
"front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs/rxjs.js",
"front_end/third_party/third-party-web/lib/nostats-subset.js",
"front_end/third_party/wasmparser/package/dist/esm/WasmDis.js",
"front_end/third_party/wasmparser/package/dist/esm/WasmParser.js",
"front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.js",
Expand Down
1 change: 1 addition & 0 deletions front_end/entrypoints/lighthouse_worker/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ devtools_module("lighthouse_worker") {
"../../core/sdk:bundle",
"../../services/puppeteer:bundle",
"../../third_party/lighthouse",
"../../third_party/third-party-web:bundle",
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as Root from '../../core/root/root.js';
import type * as SDK from '../../core/sdk/sdk.js';
import * as PuppeteerService from '../../services/puppeteer/puppeteer.js';
import * as ThirdPartyWeb from '../../third_party/third-party-web/third-party-web.js';

function disableLoggingForTest(): void {
console.log = (): void => undefined; // eslint-disable-line no-console
Expand Down Expand Up @@ -93,6 +94,9 @@ async function invokeLH(action: string, args: any): Promise<unknown> {
const config = args.config || self.createConfig(args.categoryIDs, flags.formFactor);
const url = args.url;

// @ts-expect-error /~https://github.com/GoogleChrome/lighthouse/issues/11628
self.thirdPartyWeb.provideThirdPartyWeb(ThirdPartyWeb.ThirdPartyWeb);

const {rootTargetId, mainSessionId} = args;
cdpConnection = new ConnectionProxy(mainSessionId);
puppeteerHandle =
Expand Down
1 change: 1 addition & 0 deletions front_end/third_party/additional_readme_paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"puppeteer/third_party/parsel",
"puppeteer/third_party/rxjs",
"puppeteer-replay",
"third-party-web",
"wasmparser",
"web-vitals"
]
2 changes: 1 addition & 1 deletion front_end/third_party/lighthouse/README.chromium
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: Lighthouse
Short Name: lighthouse
Version: 12.2.0
Revision: c79628af9bdaa537a2abd1b34da922e28b81bd98
Revision: 473779174f3cad7366be0957c384b032cc608fc0
URL: /~https://github.com/GoogleChrome/lighthouse
License: Apache License 2.0
License File: LICENSE
Expand Down
1,754 changes: 781 additions & 973 deletions front_end/third_party/lighthouse/lighthouse-dt-bundle.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
ReportGenerator: () => ReportGenerator
});

// replace-modules:/Users/asraine/lighthouse-pristine/report/generator/flow-report-assets.js
// replace-modules:/Users/cjamcl/src/lighthouse/report/generator/flow-report-assets.js
var flowReportAssets = {};

// report/generator/report-assets.js
Expand Down
27 changes: 27 additions & 0 deletions front_end/third_party/third-party-web/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("../../../scripts/build/ninja/devtools_entrypoint.gni")
import("../../../scripts/build/ninja/devtools_pre_built.gni")
import("../visibility.gni")

devtools_pre_built("third-party-web") {
sources_are_release = false

sources = [
"lib/nostats-subset.d.ts",
"lib/nostats-subset.js",
"third-party-web-tsconfig.json",
]
}

devtools_entrypoint("bundle") {
entrypoint = "third-party-web.ts"

deps = [ ":third-party-web" ]

visibility = [ "../../entrypoints/lighthouse_worker/*" ]

visibility += devtools_third_party_visibility
}
20 changes: 20 additions & 0 deletions front_end/third_party/third-party-web/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2019 Patrick Hulce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions front_end/third_party/third-party-web/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
file://config/owner/LIGHTHOUSE_OWNERS
file://config/owner/INFRA_OWNERS
12 changes: 12 additions & 0 deletions front_end/third_party/third-party-web/README.chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Name: third-party-web
Short Name: third-party-web
URL: /~https://github.com/patrickhulce/third-party-web
Version: 0.24.5
Revision: 82f19004382b7b41b2cb41d8a81cb982a6ffe622
License: MIT
License File: LICENSE
Security Critical: no
Shipped: yes

Description:
Data on third party entities and their impact on the web.
2 changes: 2 additions & 0 deletions front_end/third_party/third-party-web/lib/nostats-subset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _exports: typeof import("../package/lib/subsets/nostats.js");
export default _exports;
149 changes: 149 additions & 0 deletions front_end/third_party/third-party-web/lib/nostats-subset.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions front_end/third_party/third-party-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "third-party-web",
"description": "Package list used when building/upgrading third-party-web",
"private": true,
"dependencies": {
"esbuild": "0.23.1"
}
}
10 changes: 10 additions & 0 deletions front_end/third_party/third-party-web/package/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSpacing": false,
"tabWidth": 2,
"printWidth": 100,
"trailingComma": "es5"
}
20 changes: 20 additions & 0 deletions front_end/third_party/third-party-web/package/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2019 Patrick Hulce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 2a4b4f7

Please sign in to comment.