@paulirish/trace_engine 0.0.52 → 0.0.54
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/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +13 -0
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
- package/analyze-inspector-issues.mjs +60 -0
- package/core/common/common.d.ts +1 -0
- package/core/common/common.js +1 -0
- package/core/host/host.d.ts +1 -0
- package/core/host/host.js +1 -0
- package/core/platform/DOMUtilities.d.ts +8 -0
- package/core/platform/DOMUtilities.js +14 -0
- package/core/platform/DOMUtilities.js.map +1 -1
- package/core/platform/ServerTiming.d.ts +31 -0
- package/core/platform/ServerTiming.js +212 -0
- package/core/platform/ServerTiming.js.map +1 -0
- package/core/platform/StringUtilities.d.ts +1 -5
- package/core/platform/StringUtilities.js.map +1 -1
- package/core/platform/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/core/platform/platform-tsconfig.json +2 -2
- package/core/root/root.d.ts +1 -0
- package/core/root/root.js +1 -0
- package/core/sdk/sdk.d.ts +1 -0
- package/core/sdk/sdk.js +1 -0
- package/generated/protocol.d.ts +202 -20
- package/locales/af.json +11 -5
- package/locales/am.json +7 -1
- package/locales/ar.json +7 -1
- package/locales/as.json +7 -1
- package/locales/az.json +7 -1
- package/locales/be.json +7 -1
- package/locales/bg.json +7 -1
- package/locales/bn.json +7 -1
- package/locales/bs.json +7 -1
- package/locales/ca.json +7 -1
- package/locales/cs.json +7 -1
- package/locales/cy.json +7 -1
- package/locales/da.json +7 -1
- package/locales/de.json +7 -1
- package/locales/el.json +7 -1
- package/locales/en-GB.json +7 -1
- package/locales/en-US.json +49 -7
- package/locales/en-XL.json +49 -7
- package/locales/es-419.json +7 -1
- package/locales/es.json +7 -1
- package/locales/et.json +7 -1
- package/locales/eu.json +7 -1
- package/locales/fa.json +7 -1
- package/locales/fi.json +7 -1
- package/locales/fil.json +7 -1
- package/locales/fr-CA.json +7 -1
- package/locales/fr.json +7 -1
- package/locales/gl.json +7 -1
- package/locales/gu.json +7 -1
- package/locales/he.json +7 -1
- package/locales/hi.json +7 -1
- package/locales/hr.json +7 -1
- package/locales/hu.json +7 -1
- package/locales/hy.json +7 -1
- package/locales/id.json +7 -1
- package/locales/is.json +7 -1
- package/locales/it.json +7 -1
- package/locales/ja.json +7 -1
- package/locales/ka.json +7 -1
- package/locales/kk.json +7 -1
- package/locales/km.json +7 -1
- package/locales/kn.json +7 -1
- package/locales/ko.json +7 -1
- package/locales/ky.json +7 -1
- package/locales/lo.json +7 -1
- package/locales/lt.json +7 -1
- package/locales/lv.json +7 -1
- package/locales/mk.json +7 -1
- package/locales/ml.json +7 -1
- package/locales/mn.json +7 -1
- package/locales/mr.json +7 -1
- package/locales/ms.json +7 -1
- package/locales/my.json +7 -1
- package/locales/ne.json +7 -1
- package/locales/nl.json +7 -1
- package/locales/no.json +7 -1
- package/locales/or.json +7 -1
- package/locales/pa.json +7 -1
- package/locales/pl.json +7 -1
- package/locales/pt-PT.json +7 -1
- package/locales/pt.json +7 -1
- package/locales/ro.json +7 -1
- package/locales/ru.json +7 -1
- package/locales/si.json +7 -1
- package/locales/sk.json +7 -1
- package/locales/sl.json +7 -1
- package/locales/sq.json +7 -1
- package/locales/sr-Latn.json +7 -1
- package/locales/sr.json +7 -1
- package/locales/sv.json +7 -1
- package/locales/sw.json +7 -1
- package/locales/ta.json +7 -1
- package/locales/te.json +7 -1
- package/locales/th.json +7 -1
- package/locales/tr.json +7 -1
- package/locales/uk.json +7 -1
- package/locales/ur.json +7 -1
- package/locales/uz.json +7 -1
- package/locales/vi.json +7 -1
- package/locales/zh-HK.json +7 -1
- package/locales/zh-TW.json +7 -1
- package/locales/zh.json +7 -1
- package/locales/zu.json +7 -1
- package/models/cpu_profile/cpu_profile-tsconfig.json +2 -2
- package/models/cpu_profile/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +1 -0
- package/models/issues_manager/CheckFormsIssuesTrigger.js +1 -0
- package/models/issues_manager/ContrastCheckTrigger.d.ts +1 -0
- package/models/issues_manager/ContrastCheckTrigger.js +1 -0
- package/models/issues_manager/DeprecationIssue.d.ts +1 -0
- package/models/issues_manager/DeprecationIssue.js +1 -0
- package/models/issues_manager/IssueResolver.d.ts +1 -0
- package/models/issues_manager/IssueResolver.js +1 -0
- package/models/issues_manager/RelatedIssue.d.ts +1 -0
- package/models/issues_manager/RelatedIssue.js +1 -0
- package/models/issues_manager/SourceFrameIssuesManager.d.ts +1 -0
- package/models/issues_manager/SourceFrameIssuesManager.js +1 -0
- package/models/trace/LanternComputationData.js +5 -5
- package/models/trace/LanternComputationData.js.map +1 -1
- package/models/trace/ModelImpl.js +1 -1
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.d.ts +1 -3
- package/models/trace/Processor.js +1 -1
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/TracingManager.js.map +1 -1
- package/models/trace/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/extras/Metadata.js +2 -2
- package/models/trace/extras/Metadata.js.map +1 -1
- package/models/trace/extras/StackTraceForEvent.js +24 -16
- package/models/trace/extras/StackTraceForEvent.js.map +1 -1
- package/models/trace/extras/ThirdParties.js +1 -1
- package/models/trace/extras/ThirdParties.js.map +1 -1
- package/models/trace/extras/TimelineJSProfile.d.ts +13 -0
- package/models/trace/extras/TimelineJSProfile.js +55 -0
- package/models/trace/extras/TimelineJSProfile.js.map +1 -0
- package/models/trace/extras/TraceFilter.js +2 -2
- package/models/trace/extras/TraceFilter.js.map +1 -1
- package/models/trace/extras/URLForEntry.d.ts +12 -0
- package/models/trace/extras/URLForEntry.js +43 -0
- package/models/trace/extras/URLForEntry.js.map +1 -0
- package/models/trace/extras/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/extras/extras-tsconfig.json +2 -2
- package/models/trace/extras/extras.d.ts +4 -1
- package/models/trace/extras/extras.js +4 -1
- package/models/trace/handlers/AuctionWorkletsHandler.js +5 -5
- package/models/trace/handlers/AuctionWorkletsHandler.js.map +1 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.js +4 -4
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
- package/models/trace/handlers/FlowsHandler.js +3 -3
- package/models/trace/handlers/FlowsHandler.js.map +1 -1
- package/models/trace/handlers/FramesHandler.js +7 -7
- package/models/trace/handlers/FramesHandler.js.map +1 -1
- package/models/trace/handlers/LargestImagePaintHandler.js +2 -2
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.d.ts +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.js +18 -10
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
- package/models/trace/handlers/MetaHandler.js +7 -7
- package/models/trace/handlers/MetaHandler.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +1 -0
- package/models/trace/handlers/NetworkRequestsHandler.js +40 -26
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/PageLoadMetricsHandler.d.ts +2 -2
- package/models/trace/handlers/PageLoadMetricsHandler.js +54 -25
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.js +1 -1
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/handlers/ScreenshotsHandler.js +0 -1
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -1
- package/models/trace/handlers/ScriptsHandler.d.ts +5 -1
- package/models/trace/handlers/ScriptsHandler.js +51 -20
- package/models/trace/handlers/ScriptsHandler.js.map +1 -1
- package/models/trace/handlers/ServerTimingsHandler.d.ts +9 -0
- package/models/trace/handlers/ServerTimingsHandler.js +106 -0
- package/models/trace/handlers/ServerTimingsHandler.js.map +1 -0
- package/models/trace/handlers/Threads.d.ts +1 -1
- package/models/trace/handlers/Threads.js +17 -7
- package/models/trace/handlers/Threads.js.map +1 -1
- package/models/trace/handlers/UserInteractionsHandler.js +4 -3
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
- package/models/trace/handlers/WarningsHandler.js +16 -4
- package/models/trace/handlers/WarningsHandler.js.map +1 -1
- package/models/trace/handlers/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/handlers/handlers-tsconfig.json +2 -2
- package/models/trace/handlers/helpers.js +3 -0
- package/models/trace/handlers/helpers.js.map +1 -1
- package/models/trace/handlers/types.d.ts +2 -6
- package/models/trace/handlers/types.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.d.ts +1 -1
- package/models/trace/helpers/SamplesIntegrator.js +19 -12
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/Trace.js +111 -111
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/helpers/helpers-tsconfig.json +2 -2
- package/models/trace/insights/CLSCulprits.d.ts +1 -1
- package/models/trace/insights/CLSCulprits.js +43 -22
- package/models/trace/insights/CLSCulprits.js.map +1 -1
- package/models/trace/insights/Cache.js +7 -6
- package/models/trace/insights/Cache.js.map +1 -1
- package/models/trace/insights/Common.js +7 -3
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/CumulativeLayoutShift.d.ts +57 -0
- package/models/trace/insights/CumulativeLayoutShift.js +335 -0
- package/models/trace/insights/CumulativeLayoutShift.js.map +1 -0
- package/models/trace/insights/DOMSize.js +3 -3
- package/models/trace/insights/DOMSize.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +7 -3
- package/models/trace/insights/DocumentLatency.js +26 -10
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/DuplicatedJavaScript.js +2 -2
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
- package/models/trace/insights/FontDisplay.js +2 -2
- package/models/trace/insights/FontDisplay.js.map +1 -1
- package/models/trace/insights/ForcedReflow.js +2 -2
- package/models/trace/insights/ForcedReflow.js.map +1 -1
- package/models/trace/insights/ImageDelivery.js +2 -2
- package/models/trace/insights/ImageDelivery.js.map +1 -1
- package/models/trace/insights/InsightRunners.d.ts +9 -0
- package/models/trace/insights/InsightRunners.js +13 -0
- package/models/trace/insights/InsightRunners.js.map +1 -0
- package/models/trace/insights/InteractionToNextPaint.js +3 -3
- package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
- package/models/trace/insights/LCPDiscovery.js +3 -3
- package/models/trace/insights/LCPDiscovery.js.map +1 -1
- package/models/trace/insights/LCPPhases.d.ts +1 -1
- package/models/trace/insights/LCPPhases.js +4 -4
- package/models/trace/insights/LCPPhases.js.map +1 -1
- package/models/trace/insights/LargestContentfulPaint.d.ts +38 -0
- package/models/trace/insights/LargestContentfulPaint.js +113 -0
- package/models/trace/insights/LargestContentfulPaint.js.map +1 -0
- package/models/trace/insights/LegacyJavaScript.d.ts +1 -1
- package/models/trace/insights/LegacyJavaScript.js +3 -3
- package/models/trace/insights/LegacyJavaScript.js.map +1 -1
- package/models/trace/insights/ModernHTTP.js +2 -2
- package/models/trace/insights/ModernHTTP.js.map +1 -1
- package/models/trace/insights/NetworkDependencyTree.d.ts +151 -3
- package/models/trace/insights/NetworkDependencyTree.js +650 -12
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
- package/models/trace/insights/RenderBlocking.js +4 -4
- package/models/trace/insights/RenderBlocking.js.map +1 -1
- package/models/trace/insights/SlowCSSSelector.js +2 -2
- package/models/trace/insights/SlowCSSSelector.js.map +1 -1
- package/models/trace/insights/ThirdParties.d.ts +1 -1
- package/models/trace/insights/ThirdParties.js +3 -3
- package/models/trace/insights/ThirdParties.js.map +1 -1
- package/models/trace/insights/ThirdPartyWeb.d.ts +13 -0
- package/models/trace/insights/ThirdPartyWeb.js +42 -0
- package/models/trace/insights/ThirdPartyWeb.js.map +1 -0
- package/models/trace/insights/Viewport.js +2 -2
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/insights/insights-tsconfig.json +2 -2
- package/models/trace/insights/types.d.ts +3 -1
- package/models/trace/insights/types.js +19 -0
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/core/core-tsconfig.json +2 -2
- package/models/trace/lantern/core/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/graph/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/graph/graph-tsconfig.json +2 -2
- package/models/trace/lantern/lantern-tsconfig.json +2 -2
- package/models/trace/lantern/metrics/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/metrics/metrics-tsconfig.json +2 -2
- package/models/trace/lantern/simulation/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/simulation/simulation-tsconfig.json +2 -2
- package/models/trace/lantern/types/Lantern.d.ts +4 -7
- package/models/trace/lantern/types/Lantern.js +1 -0
- package/models/trace/lantern/types/Lantern.js.map +1 -1
- package/models/trace/lantern/types/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/lantern/types/types-tsconfig.json +2 -2
- package/models/trace/root-causes/LayoutShift.d.ts +125 -0
- package/models/trace/root-causes/LayoutShift.js +519 -0
- package/models/trace/root-causes/LayoutShift.js.map +1 -0
- package/models/trace/root-causes/RootCauses.d.ts +15 -0
- package/models/trace/root-causes/RootCauses.js +12 -0
- package/models/trace/root-causes/RootCauses.js.map +1 -0
- package/models/trace/root-causes/bundle-tsconfig.json +1 -0
- package/models/trace/root-causes/devtools_entrypoint-bundle-typescript-tsconfig.json +42 -0
- package/models/trace/root-causes/root-causes-tsconfig.json +55 -0
- package/models/trace/root-causes/root-causes.d.ts +1 -0
- package/models/trace/root-causes/root-causes.js +5 -0
- package/models/trace/root-causes/root-causes.js.map +1 -0
- package/models/trace/trace-tsconfig.json +2 -2
- package/models/trace/types/Configuration.d.ts +2 -0
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/Extensions.d.ts +1 -3
- package/models/trace/types/Extensions.js.map +1 -1
- package/models/trace/types/File.d.ts +5 -4
- package/models/trace/types/File.js +28 -4
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +55 -28
- package/models/trace/types/TraceEvents.js +377 -103
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/devtools_entrypoint-bundle-typescript-tsconfig.json +2 -2
- package/models/trace/types/types-tsconfig.json +2 -2
- package/package.json +1 -1
- package/test/test-trace-engine.mjs +77 -0
- package/third_party/marked/marked.d.ts +1 -0
- package/third_party/marked/marked.js +1 -0
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../front_end/models/trace/insights",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -19,6 +19,7 @@ export interface InsightSetContextWithNavigation {
|
|
|
19
19
|
lantern?: LanternContext;
|
|
20
20
|
}
|
|
21
21
|
export interface LanternContext {
|
|
22
|
+
requests: Array<Lantern.Types.NetworkRequest<Types.Events.SyntheticNetworkRequest>>;
|
|
22
23
|
graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;
|
|
23
24
|
simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;
|
|
24
25
|
metrics: Record<string, Lantern.Metrics.MetricResult>;
|
|
@@ -57,6 +58,7 @@ export type InsightModel<UIStrings extends Record<string, string> = Record<strin
|
|
|
57
58
|
description: {i18nId: string, values: Record<string, string|number>, formattedDefault: string};
|
|
58
59
|
category: InsightCategory;
|
|
59
60
|
state: 'pass' | 'fail' | 'informative';
|
|
61
|
+
/** Used by RelatedInsightChips.ts */
|
|
60
62
|
relatedEvents?: RelatedEventsMap | Types.Events.Event[];
|
|
61
63
|
warnings?: InsightWarning[];
|
|
62
64
|
metricSavings?: MetricSavings;
|
|
@@ -104,7 +106,7 @@ export type InsightModels = {
|
|
|
104
106
|
* navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.
|
|
105
107
|
*/
|
|
106
108
|
export type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;
|
|
107
|
-
export declare
|
|
109
|
+
export declare enum InsightKeys {
|
|
108
110
|
LCP_PHASES = "LCPPhases",
|
|
109
111
|
INTERACTION_TO_NEXT_PAINT = "InteractionToNextPaint",
|
|
110
112
|
CLS_CULPRITS = "CLSCulprits",
|
|
@@ -16,4 +16,23 @@ export var InsightCategory;
|
|
|
16
16
|
InsightCategory["LCP"] = "LCP";
|
|
17
17
|
InsightCategory["CLS"] = "CLS";
|
|
18
18
|
})(InsightCategory || (InsightCategory = {}));
|
|
19
|
+
export var InsightKeys;
|
|
20
|
+
(function (InsightKeys) {
|
|
21
|
+
InsightKeys["LCP_PHASES"] = "LCPPhases";
|
|
22
|
+
InsightKeys["INTERACTION_TO_NEXT_PAINT"] = "InteractionToNextPaint";
|
|
23
|
+
InsightKeys["CLS_CULPRITS"] = "CLSCulprits";
|
|
24
|
+
InsightKeys["THIRD_PARTIES"] = "ThirdParties";
|
|
25
|
+
InsightKeys["DOCUMENT_LATENCY"] = "DocumentLatency";
|
|
26
|
+
InsightKeys["DOM_SIZE"] = "DOMSize";
|
|
27
|
+
InsightKeys["DUPLICATE_JAVASCRIPT"] = "DuplicatedJavaScript";
|
|
28
|
+
InsightKeys["FONT_DISPLAY"] = "FontDisplay";
|
|
29
|
+
InsightKeys["FORCED_REFLOW"] = "ForcedReflow";
|
|
30
|
+
InsightKeys["IMAGE_DELIVERY"] = "ImageDelivery";
|
|
31
|
+
InsightKeys["LCP_DISCOVERY"] = "LCPDiscovery";
|
|
32
|
+
InsightKeys["LEGACY_JAVASCRIPT"] = "LegacyJavaScript";
|
|
33
|
+
InsightKeys["NETWORK_DEPENDENCY_TREE"] = "NetworkDependencyTree";
|
|
34
|
+
InsightKeys["RENDER_BLOCKING"] = "RenderBlocking";
|
|
35
|
+
InsightKeys["SLOW_CSS_SELECTOR"] = "SlowCSSSelector";
|
|
36
|
+
InsightKeys["VIEWPORT"] = "Viewport";
|
|
37
|
+
})(InsightKeys || (InsightKeys = {}));
|
|
19
38
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAoC7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAYD,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;AACb,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAuED,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACrB,uCAAwB,CAAA;IACxB,mEAAoD,CAAA;IACpD,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,mCAAoB,CAAA;IACpB,4DAA6C,CAAA;IAC7C,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,+CAAgC,CAAA;IAChC,6CAA8B,CAAA;IAC9B,qDAAsC,CAAA;IACtC,gEAAiD,CAAA;IACjD,iDAAkC,CAAA;IAClC,oDAAqC,CAAA;IACrC,oCAAqB,CAAA;AACvB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../core/common/common.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as Models from './Models.js';\n\n/**\n * Context for the portion of the trace an insight should look at.\n */\nexport type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;\n\nexport interface InsightSetContextWithoutNavigation {\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation?: never;\n}\n\nexport interface InsightSetContextWithNavigation {\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation: Types.Events.NavigationStart;\n navigationId: string;\n lantern?: LanternContext;\n}\n\nexport interface LanternContext {\n requests: Array<Lantern.Types.NetworkRequest<Types.Events.SyntheticNetworkRequest>>;\n graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;\n simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;\n metrics: Record<string, Lantern.Metrics.MetricResult>;\n}\n\nexport type InsightModelsType = typeof Models;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport interface MetricSavings {\n /* eslint-disable @typescript-eslint/naming-convention */\n FCP?: Types.Timing.Milli;\n LCP?: Types.Timing.Milli;\n TBT?: Types.Timing.Milli;\n CLS?: number;\n INP?: Types.Timing.Milli;\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport enum InsightCategory {\n ALL = 'All',\n INP = 'INP',\n LCP = 'LCP',\n CLS = 'CLS',\n}\n\nexport type RelatedEventsMap = Map<Types.Events.Event, string[]>;\n\nexport type Checklist<Keys extends string> = Record<Keys, {label: Common.UIString.LocalizedString, value: boolean}>;\n\nexport type InsightModel<UIStrings extends Record<string, string> = Record<string, string>,\n ExtraDetail extends Record<string, unknown> = Record<string, unknown>> =\n ExtraDetail&{\n /** Used internally to identify the type of a model, not shown visibly to users **/\n insightKey: keyof InsightModelsType,\n /** Not used within DevTools - this is for external consumers (like Lighthouse). */\n strings: UIStrings,\n title: Common.UIString.LocalizedString,\n description: Common.UIString.LocalizedString,\n category: InsightCategory,\n state: 'pass' | 'fail' | 'informative',\n /** Used by RelatedInsightChips.ts */\n relatedEvents?: RelatedEventsMap | Types.Events.Event[],\n warnings?: InsightWarning[],\n metricSavings?: MetricSavings,\n /**\n * An estimate for the number of bytes that this insight deems to have been wasted.\n * Bytes are in terms of transfer size: for each component of savings related to an\n * individual request, the insight will estimate its impact on transfer size by using\n * the compression ratio of the resource.\n *\n * This field is only displayed for informational purposes.\n */\n wastedBytes?: number,\n frameId?: string,\n /**\n * If this insight is attached to a navigation, this stores its ID.\n */\n navigationId?: string,\n };\n\nexport type PartialInsightModel<T> =\n Omit<T, 'strings'|'title'|'description'|'category'|'state'|'insightKey'|'navigationId'|'frameId'>;\n\n/**\n * Contains insights for a specific navigation. If a trace began after a navigation already started,\n * this could instead represent the duration from the beginning of the trace up to the first recorded\n * navigation (or the end of the trace).\n */\nexport interface InsightSet {\n /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */\n id: Types.Events.NavigationId;\n /** The URL to show in the accordion list. */\n url: URL;\n frameId: string;\n bounds: Types.Timing.TraceWindowMicro;\n model: InsightModels;\n navigation?: Types.Events.NavigationStart;\n}\n\n/**\n * Contains insights for a specific insight set.\n */\nexport type InsightModels = {\n [I in keyof InsightModelsType]: ReturnType<InsightModelsType[I]['generateInsight']>;\n};\n\n/**\n * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:\n *\n * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no\n * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.\n */\nexport type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;\n\nexport enum InsightKeys {\n LCP_PHASES = 'LCPPhases',\n INTERACTION_TO_NEXT_PAINT = 'InteractionToNextPaint',\n CLS_CULPRITS = 'CLSCulprits',\n THIRD_PARTIES = 'ThirdParties',\n DOCUMENT_LATENCY = 'DocumentLatency',\n DOM_SIZE = 'DOMSize',\n DUPLICATE_JAVASCRIPT = 'DuplicatedJavaScript',\n FONT_DISPLAY = 'FontDisplay',\n FORCED_REFLOW = 'ForcedReflow',\n IMAGE_DELIVERY = 'ImageDelivery',\n LCP_DISCOVERY = 'LCPDiscovery',\n LEGACY_JAVASCRIPT = 'LegacyJavaScript',\n NETWORK_DEPENDENCY_TREE = 'NetworkDependencyTree',\n RENDER_BLOCKING = 'RenderBlocking',\n SLOW_CSS_SELECTOR = 'SlowCSSSelector',\n VIEWPORT = 'Viewport',\n}\n"]}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/core",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/core",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../front_end/models/trace/lantern",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/graph",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/graph",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../front_end/models/trace/lantern",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/metrics",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/metrics",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/simulation",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/simulation",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -18,6 +18,7 @@ export declare const NetworkRequestTypes: {
|
|
|
18
18
|
readonly Preflight: "Preflight";
|
|
19
19
|
readonly CSPViolationReport: "CSPViolationReport";
|
|
20
20
|
readonly Prefetch: "Prefetch";
|
|
21
|
+
readonly FedCM: "FedCM";
|
|
21
22
|
};
|
|
22
23
|
export interface TraceEvent {
|
|
23
24
|
name: string;
|
|
@@ -117,7 +118,7 @@ export interface NetworkRequest<T = AnyNetworkObject> {
|
|
|
117
118
|
frameId: string | undefined;
|
|
118
119
|
fromWorker: boolean;
|
|
119
120
|
/**
|
|
120
|
-
* Optional value for how long the server took to respond to this request.
|
|
121
|
+
* Optional value for how long the server took to respond to this request, in ms.
|
|
121
122
|
* When not provided, the server response time is derived from the timing object.
|
|
122
123
|
*/
|
|
123
124
|
serverResponseTime?: number;
|
|
@@ -153,12 +154,8 @@ export declare namespace Simulation {
|
|
|
153
154
|
cpuSlowdownMultiplier?: number;
|
|
154
155
|
}
|
|
155
156
|
interface PrecomputedLanternData {
|
|
156
|
-
additionalRttByOrigin:
|
|
157
|
-
|
|
158
|
-
};
|
|
159
|
-
serverResponseTimeByOrigin: {
|
|
160
|
-
[origin: string]: number;
|
|
161
|
-
};
|
|
157
|
+
additionalRttByOrigin: Record<string, number>;
|
|
158
|
+
serverResponseTimeByOrigin: Record<string, number>;
|
|
162
159
|
}
|
|
163
160
|
interface Settings {
|
|
164
161
|
networkAnalysis: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,gBAAgB;IAChC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,kBAAkB,EAAE,oBAAoB;IACxC,QAAQ,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"Lantern.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/types/Lantern.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,gBAAgB;IAChC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,kBAAkB,EAAE,oBAAoB;IACxC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACN,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Protocol from '../../../../generated/protocol.js';\n\nexport const NetworkRequestTypes = {\n XHR: 'XHR',\n Fetch: 'Fetch',\n EventSource: 'EventSource',\n Script: 'Script',\n Stylesheet: 'Stylesheet',\n Image: 'Image',\n Media: 'Media',\n Font: 'Font',\n Document: 'Document',\n TextTrack: 'TextTrack',\n WebSocket: 'WebSocket',\n Other: 'Other',\n Manifest: 'Manifest',\n SignedExchange: 'SignedExchange',\n Ping: 'Ping',\n Preflight: 'Preflight',\n CSPViolationReport: 'CSPViolationReport',\n Prefetch: 'Prefetch',\n FedCM: 'FedCM',\n} as const;\n\nexport interface TraceEvent {\n name: string;\n args: {\n name?: string,\n data?: {\n frame?: string,\n readyState?: number,\n stackTrace?: Array<{\n url: string,\n }>,\n url?: string,\n },\n };\n pid: number;\n tid: number;\n /** Timestamp of the event in microseconds. */\n ts: number;\n dur: number;\n}\nexport interface Trace {\n traceEvents: TraceEvent[];\n}\nexport type ResourcePriority = ('VeryLow'|'Low'|'Medium'|'High'|'VeryHigh');\nexport type ResourceType = keyof typeof NetworkRequestTypes;\ntype InitiatorType = ('parser'|'script'|'preload'|'SignedExchange'|'preflight'|'other');\nexport type ResourceTiming = Protocol.Network.ResourceTiming;\nexport interface CallStack {\n callFrames: Array<{\n scriptId: string,\n url: string,\n lineNumber: number,\n columnNumber: number,\n functionName: string,\n }>;\n parent?: CallStack;\n}\n\nexport interface ParsedURL {\n /**\n * Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)\n */\n scheme: string;\n /**\n * Equivalent to a `new URL(url).hostname`\n */\n host: string;\n securityOrigin: string;\n}\n\n// When Lantern NetworkRequests are constructed, the source-of-truth of the network record is given as `rawRequest`.\n// Internally Lantern doesn't care about the type of this field, so a default type is given to simplify internal code\n// by avoiding unnecessary typescript overhead.\n// If callers want to access the underlying network record, they are expected to make use of this generic on top-level\n// interfaces like Simulator.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyNetworkObject = any;\n\nexport interface NetworkRequest<T = AnyNetworkObject> {\n requestId: string;\n connectionId: number;\n connectionReused: boolean;\n url: string;\n protocol: string;\n parsedURL: ParsedURL;\n documentURL: string;\n /** When the renderer process initially discovers a network request, in milliseconds. */\n rendererStartTime: number;\n /**\n * When the network service is about to handle a request, ie. just before going to the\n * HTTP cache or going to the network for DNS/connection setup, in milliseconds.\n */\n networkRequestTime: number;\n /**\n * When the last byte of the response headers is received, in milliseconds.\n * Equal to networkRequestTime if no data is received over the\n * network (ex: cached requests or data urls).\n */\n responseHeadersEndTime: number;\n /** When the last byte of the response body is received, in milliseconds. */\n networkEndTime: number;\n transferSize: number;\n resourceSize: number;\n fromDiskCache: boolean;\n fromMemoryCache: boolean;\n isLinkPreload: boolean;\n finished: boolean;\n failed: boolean;\n statusCode: number;\n /** The network request that redirected to this one */\n redirectSource: NetworkRequest<T>|undefined;\n /** The network request that this one redirected to */\n redirectDestination: NetworkRequest<T>|undefined;\n // TODO: can't use Protocol.Network.Initiator because of type mismatch in Lighthouse initiator.\n initiator: {\n type: InitiatorType,\n url?: string,\n stack?: CallStack,\n };\n initiatorRequest: NetworkRequest<T>|undefined;\n /** The chain of network requests that redirected to this one */\n redirects: NetworkRequest[]|undefined;\n timing: Protocol.Network.ResourceTiming|undefined;\n resourceType: ResourceType|undefined;\n mimeType: string;\n priority: ResourcePriority;\n frameId: string|undefined;\n fromWorker: boolean;\n /**\n * Optional value for how long the server took to respond to this request, in ms.\n * When not provided, the server response time is derived from the timing object.\n */\n serverResponseTime?: number;\n /**\n * Implementation-specific canonical data structure that this Lantern NetworkRequest\n * was derived from.\n * Users of Lantern create a NetworkRequest matching this interface,\n * but can store the source-of-truth for their network model in this property.\n * This is then accessible as a read-only property on NetworkNode.\n */\n rawRequest?: T;\n}\n\nexport namespace Simulation {\n export interface URL {\n /** URL of the initially requested URL */\n requestedUrl?: string;\n /** URL of the last document request */\n mainDocumentUrl?: string;\n }\n\n /** Simulation settings that control the amount of network & cpu throttling in the run. */\n export interface ThrottlingSettings {\n /** The round trip time in milliseconds. */\n rttMs?: number;\n /** The network throughput in kilobits per second. */\n throughputKbps?: number;\n // devtools settings\n /** The network request latency in milliseconds. */\n requestLatencyMs?: number;\n /** The network download throughput in kilobits per second. */\n downloadThroughputKbps?: number;\n /** The network upload throughput in kilobits per second. */\n uploadThroughputKbps?: number;\n // used by both\n /** The amount of slowdown applied to the cpu (1/<cpuSlowdownMultiplier>). */\n cpuSlowdownMultiplier?: number;\n }\n\n export interface PrecomputedLanternData {\n additionalRttByOrigin: Record<string, number>;\n serverResponseTimeByOrigin: Record<string, number>;\n }\n\n export interface Settings {\n networkAnalysis: {\n rtt: number,\n additionalRttByOrigin: Map<string, number>,\n serverResponseTimeByOrigin: Map<string, number>,\n throughput: number,\n };\n /** The method used to throttle the network. */\n throttlingMethod: 'devtools'|'simulate'|'provided';\n /** The throttling config settings. */\n throttling?: Required<ThrottlingSettings>;\n /** Precomputed lantern estimates to use instead of observed analysis. */\n precomputedLanternData?: PrecomputedLanternData|null;\n }\n\n export interface Options {\n rtt?: number;\n throughput?: number;\n observedThroughput: number;\n maximumConcurrentRequests?: number;\n cpuSlowdownMultiplier?: number;\n layoutTaskMultiplier?: number;\n additionalRttByOrigin?: Map<string, number>;\n serverResponseTimeByOrigin?: Map<string, number>;\n }\n\n export interface ProcessedNavigation {\n timestamps: {\n firstContentfulPaint: number,\n largestContentfulPaint?: number,\n };\n }\n\n export interface NodeTiming {\n startTime: number;\n endTime: number;\n duration: number;\n }\n}\n"]}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/types",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
"noImplicitOverride": true,
|
|
19
19
|
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedLocals":
|
|
21
|
-
"noUnusedParameters":
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
22
|
"outDir": ".",
|
|
23
23
|
"rootDir": "../../../../../../../../front_end/models/trace/lantern/types",
|
|
24
24
|
"skipLibCheck": true,
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type * as Protocol from '../../../generated/protocol.js';
|
|
2
|
+
import type { ParsedTrace } from '../handlers/types.js';
|
|
3
|
+
import * as Types from '../types/types.js';
|
|
4
|
+
import type { RootCauseProtocolInterface } from './RootCauses.js';
|
|
5
|
+
export type CSSDimensions = {
|
|
6
|
+
width?: string;
|
|
7
|
+
height?: string;
|
|
8
|
+
aspectRatio?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface UnsizedMedia {
|
|
11
|
+
node: Protocol.DOM.Node;
|
|
12
|
+
authoredDimensions?: CSSDimensions;
|
|
13
|
+
computedDimensions: CSSDimensions;
|
|
14
|
+
}
|
|
15
|
+
export interface InjectedIframe {
|
|
16
|
+
iframe: Protocol.DOM.Node;
|
|
17
|
+
}
|
|
18
|
+
export interface RootCauseRequest {
|
|
19
|
+
request: Types.Events.SyntheticNetworkRequest;
|
|
20
|
+
initiator?: Protocol.Network.Initiator;
|
|
21
|
+
}
|
|
22
|
+
export interface FontChange extends RootCauseRequest {
|
|
23
|
+
fontFace: Protocol.CSS.FontFace;
|
|
24
|
+
}
|
|
25
|
+
export interface RenderBlockingRequest extends RootCauseRequest {
|
|
26
|
+
}
|
|
27
|
+
export interface LayoutShiftRootCausesData {
|
|
28
|
+
unsizedMedia: UnsizedMedia[];
|
|
29
|
+
iframes: InjectedIframe[];
|
|
30
|
+
fontChanges: FontChange[];
|
|
31
|
+
renderBlockingRequests: RenderBlockingRequest[];
|
|
32
|
+
scriptStackTrace: Types.Events.CallFrame[];
|
|
33
|
+
}
|
|
34
|
+
interface Options {
|
|
35
|
+
/** Checking iframe root causes can be an expensive operation, so it is disabled by default. */
|
|
36
|
+
enableIframeRootCauses?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare class LayoutShiftRootCauses {
|
|
39
|
+
#private;
|
|
40
|
+
constructor(protocolInterface: RootCauseProtocolInterface, options?: Options);
|
|
41
|
+
/**
|
|
42
|
+
* Calculates the potential root causes for a given layout shift event. Once
|
|
43
|
+
* calculated, this data is cached.
|
|
44
|
+
* Note: because you need all layout shift data at once to calculate these
|
|
45
|
+
* correctly, this function will parse the root causes for _all_ layout shift
|
|
46
|
+
* events the first time that it's called. That then populates the cache for
|
|
47
|
+
* each shift, so any subsequent calls are just a constant lookup.
|
|
48
|
+
*/
|
|
49
|
+
rootCausesForEvent(modelData: ParsedTrace, event: Types.Events.LayoutShift): Promise<Readonly<LayoutShiftRootCausesData> | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Determines potential root causes for shifts
|
|
52
|
+
*/
|
|
53
|
+
blameShifts(layoutShifts: Types.Events.LayoutShift[], modelData: ParsedTrace): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* "LayoutInvalidations" are a set of trace events dispatched in Blink under the name
|
|
56
|
+
* "layoutInvalidationTracking", which track invalidations on the "Layout"stage of the
|
|
57
|
+
* rendering pipeline. This function utilizes this event to flag potential root causes
|
|
58
|
+
* to layout shifts.
|
|
59
|
+
*/
|
|
60
|
+
linkShiftsToLayoutInvalidations(layoutShifts: Types.Events.LayoutShift[], modelData: ParsedTrace): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* For every shift looks up the initiator of its corresponding Layout event. This initiator
|
|
63
|
+
* is assigned by the RendererHandler and contains the stack trace of the point in a script
|
|
64
|
+
* that caused a style recalculation or a relayout. This stack trace is added to the shift's
|
|
65
|
+
* potential root causes.
|
|
66
|
+
* Note that a Layout cannot always be linked to a script, in that case, we cannot add a
|
|
67
|
+
* "script causing reflow" as a potential root cause to the corresponding shift.
|
|
68
|
+
*/
|
|
69
|
+
linkShiftsToLayoutEvents(layoutShifts: Types.Events.LayoutShift[], modelData: ParsedTrace): void;
|
|
70
|
+
/**
|
|
71
|
+
* Given a LayoutInvalidation trace event, determines if it was dispatched
|
|
72
|
+
* because a media element without dimensions was resized.
|
|
73
|
+
*/
|
|
74
|
+
getUnsizedMediaRootCause(layoutInvalidation: Types.Events.LayoutInvalidationTracking, layoutInvalidationNodeId: Protocol.DOM.NodeId): Promise<UnsizedMedia | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Given a LayoutInvalidation trace event, determines if it was dispatched
|
|
77
|
+
* because a node, which is an ancestor to an iframe, was injected.
|
|
78
|
+
*/
|
|
79
|
+
getIframeRootCause(layoutInvalidation: Types.Events.LayoutInvalidationTracking, layoutInvalidationNodeId: Protocol.DOM.NodeId): Promise<InjectedIframe | null>;
|
|
80
|
+
getNodeDetails(nodeId: Protocol.DOM.NodeId): Promise<Protocol.DOM.Node | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Given a layout invalidation event and a sorted array, returns the subset of requests that arrived within a
|
|
83
|
+
* 500ms window before the layout invalidation.
|
|
84
|
+
*/
|
|
85
|
+
requestsInInvalidationWindow(layoutInvalidation: Types.Events.LayoutInvalidationTracking | Types.Events.ScheduleStyleInvalidationTracking, modelData: ParsedTrace): RootCauseRequest[];
|
|
86
|
+
/**
|
|
87
|
+
* Given a LayoutInvalidation trace event, determines if it was dispatched
|
|
88
|
+
* because fonts were changed and if so returns the information of all network
|
|
89
|
+
* request with which the fonts were possibly fetched, if any. The computed
|
|
90
|
+
* network requests are cached for the corresponding prepaint event, meaning
|
|
91
|
+
* that other LayoutInvalidation events that correspond to the same prepaint
|
|
92
|
+
* are not processed and the cached network requests for the prepaint is
|
|
93
|
+
* returned instead.
|
|
94
|
+
*/
|
|
95
|
+
getFontChangeRootCause(layoutInvalidation: Types.Events.LayoutInvalidationTracking | Types.Events.ScheduleStyleInvalidationTracking, nextPrePaint: Types.Events.PrePaint, modelData: ParsedTrace): FontChange[] | null;
|
|
96
|
+
/**
|
|
97
|
+
* Given the requests that arrived within a 500ms window before the layout invalidation, returns the font
|
|
98
|
+
* requests of them.
|
|
99
|
+
*/
|
|
100
|
+
getFontRequestsInInvalidationWindow(requestsInInvalidationWindow: RootCauseRequest[]): FontChange[];
|
|
101
|
+
/**
|
|
102
|
+
* Given a LayoutInvalidation trace event, determines if it arrived within a 500ms window before the layout
|
|
103
|
+
* invalidation and if so returns the information of all network request, if any. The computed network
|
|
104
|
+
* requests are cached for the corresponding prepaint event, meaning that other LayoutInvalidation events
|
|
105
|
+
* that correspond to the same prepaint are not processed and the cached network requests for the prepaint is
|
|
106
|
+
* returned instead.
|
|
107
|
+
*/
|
|
108
|
+
getRenderBlockRootCause(layoutInvalidation: Types.Events.LayoutInvalidationTracking | Types.Events.ScheduleStyleInvalidationTracking, nextPrePaint: Types.Events.PrePaint, modelData: ParsedTrace): RenderBlockingRequest[] | null;
|
|
109
|
+
/**
|
|
110
|
+
* Returns a function that retrieves the active value of a given
|
|
111
|
+
* CSS property within the matched styles of the param node.
|
|
112
|
+
* The first occurence within the matched styles is returned and the
|
|
113
|
+
* value is looked up in the following order, which follows CSS
|
|
114
|
+
* specificity:
|
|
115
|
+
* 1. Inline styles.
|
|
116
|
+
* 2. CSS rules matching this node, from all applicable stylesheets.
|
|
117
|
+
* 3. Attribute defined styles.
|
|
118
|
+
*/
|
|
119
|
+
nodeMatchedStylesPropertyGetter(node: Protocol.DOM.Node): Promise<((property: string) => string | null)>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the CSS dimensions set to the node from its matched styles.
|
|
122
|
+
*/
|
|
123
|
+
getNodeAuthoredDimensions(node: Protocol.DOM.Node): Promise<CSSDimensions>;
|
|
124
|
+
}
|
|
125
|
+
export {};
|