Skip to content

Commit

Permalink
[trace engine] Add Lighthouse's Lantern library
Browse files Browse the repository at this point in the history
This is the culmination of isolating Lighthouse's Lantern library
(GoogleChrome/lighthouse#15841). The code in
this CL took Lantern as it now exists in Lighthouse, converted to
TypeScript, integrated its unit tests (Jest -> Karma conversion), and
resolved the majority of CDT's JavaScript linter errors.

There is no behavior change to CDT with this CL, besides TraceModel
exporting the Lantern module.

A handful of eslint checks have been disabled for this folder.

Bug: 335099340
Change-Id: Ib2bf64fc17d334859caca5c42bea1e276465d64c
  • Loading branch information
Connor Clark committed Jun 18, 2024
1 parent 6ee24a6 commit ce63a70
Show file tree
Hide file tree
Showing 51 changed files with 8,012 additions and 1 deletion.
25 changes: 25 additions & 0 deletions config/gni/devtools_grd_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ grd_files_release_sources = [
"front_end/models/trace/handlers/handlers.js",
"front_end/models/trace/helpers/helpers.js",
"front_end/models/trace/insights/insights.js",
"front_end/models/trace/lantern/lantern.js",
"front_end/models/trace/root-causes/root-causes.js",
"front_end/models/trace/trace.js",
"front_end/models/trace/types/types.js",
Expand Down Expand Up @@ -975,6 +976,7 @@ grd_files_debug_sources = [
"front_end/models/timeline_model/TimelineProfileTree.js",
"front_end/models/timeline_model/TracingLayerTree.js",
"front_end/models/trace/EntriesFilter.js",
"front_end/models/trace/LanternComputationData.js",
"front_end/models/trace/ModelImpl.js",
"front_end/models/trace/Processor.js",
"front_end/models/trace/TracingManager.js",
Expand Down Expand Up @@ -1024,6 +1026,29 @@ grd_files_debug_sources = [
"front_end/models/trace/insights/RenderBlocking.js",
"front_end/models/trace/insights/Viewport.js",
"front_end/models/trace/insights/types.js",
"front_end/models/trace/lantern/BaseNode.js",
"front_end/models/trace/lantern/CpuNode.js",
"front_end/models/trace/lantern/LanternError.js",
"front_end/models/trace/lantern/Metric.js",
"front_end/models/trace/lantern/NetworkNode.js",
"front_end/models/trace/lantern/PageDependencyGraph.js",
"front_end/models/trace/lantern/TBTUtils.js",
"front_end/models/trace/lantern/metrics/FirstContentfulPaint.js",
"front_end/models/trace/lantern/metrics/Interactive.js",
"front_end/models/trace/lantern/metrics/LargestContentfulPaint.js",
"front_end/models/trace/lantern/metrics/MaxPotentialFID.js",
"front_end/models/trace/lantern/metrics/SpeedIndex.js",
"front_end/models/trace/lantern/metrics/TotalBlockingTime.js",
"front_end/models/trace/lantern/metrics/metrics.js",
"front_end/models/trace/lantern/simulation/ConnectionPool.js",
"front_end/models/trace/lantern/simulation/Constants.js",
"front_end/models/trace/lantern/simulation/DNSCache.js",
"front_end/models/trace/lantern/simulation/NetworkAnalyzer.js",
"front_end/models/trace/lantern/simulation/SimulationTimingMap.js",
"front_end/models/trace/lantern/simulation/Simulator.js",
"front_end/models/trace/lantern/simulation/TcpConnection.js",
"front_end/models/trace/lantern/simulation/simulation.js",
"front_end/models/trace/lantern/types/lantern.js",
"front_end/models/trace/root-causes/LayoutShift.js",
"front_end/models/trace/root-causes/RootCauses.js",
"front_end/models/trace/types/Configuration.js",
Expand Down
1 change: 1 addition & 0 deletions front_end/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ group("unittests") {
"models/trace/handlers:unittests",
"models/trace/helpers:unittests",
"models/trace/insights:unittests",
"models/trace/lantern:unittests",
"models/trace/root-causes:unittests",
"models/trace/types:unittests",
"models/workspace:unittests",
Expand Down
3 changes: 2 additions & 1 deletion front_end/models/trace/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import("../visibility.gni")
devtools_module("trace") {
sources = [
"EntriesFilter.ts",
"LanternComputationData.ts",
"ModelImpl.ts",
"Processor.ts",
"TracingManager.ts",
Expand All @@ -23,6 +24,7 @@ devtools_module("trace") {
"handlers:bundle",
"helpers:bundle",
"insights:bundle",
"lantern:bundle",
"root-causes:bundle",
"types:bundle",
]
Expand All @@ -47,7 +49,6 @@ devtools_entrypoint("bundle") {
"../../services/trace_bounds/*",
"../../services/tracing/*",
"../../testing/*",
"../../testing/*",
"../../ui/components/docs/*",
"../../ui/legacy/components/utils/*",
"../timeline_model/*",
Expand Down
Loading

0 comments on commit ce63a70

Please sign in to comment.