chrome-devtools-frontend 1.0.1555174 → 1.0.1556696

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.
Files changed (156) hide show
  1. package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
  2. package/front_end/core/root/Runtime.ts +0 -4
  3. package/front_end/core/sdk/DOMModel.ts +101 -7
  4. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +2 -0
  5. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +75 -7
  6. package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
  7. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  8. package/front_end/generated/protocol.ts +0 -1
  9. package/front_end/models/ai_assistance/AiConversation.ts +71 -10
  10. package/front_end/models/ai_assistance/ArtifactsManager.ts +67 -0
  11. package/front_end/models/ai_assistance/ConversationHandler.ts +3 -2
  12. package/front_end/models/ai_assistance/agents/AiAgent.ts +17 -27
  13. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +152 -4
  14. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
  15. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  16. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
  17. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +0 -2
  18. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
  19. package/front_end/{ui/components → models}/annotations/AnnotationRepository.ts +4 -4
  20. package/front_end/models/annotations/README.md +7 -0
  21. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
  22. package/front_end/models/greendev/Prototypes.ts +56 -0
  23. package/front_end/models/greendev/README.md +5 -0
  24. package/front_end/models/greendev/greendev.ts +5 -0
  25. package/front_end/models/stack_trace/StackTrace.ts +13 -2
  26. package/front_end/models/stack_trace/StackTraceImpl.ts +81 -6
  27. package/front_end/models/stack_trace/StackTraceModel.ts +35 -3
  28. package/front_end/models/trace/extras/TraceTree.ts +4 -2
  29. package/front_end/models/trace/insights/LCPDiscovery.ts +0 -2
  30. package/front_end/models/trace/types/TraceEvents.ts +0 -1
  31. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +116 -70
  32. package/front_end/panels/ai_assistance/aiAssistancePanel.css +16 -0
  33. package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +159 -0
  34. package/front_end/panels/ai_assistance/components/ChatView.ts +3 -2
  35. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +7 -8
  36. package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +15 -8
  37. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +9 -9
  38. package/front_end/panels/ai_assistance/components/artifactsViewer.css +15 -0
  39. package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +5 -6
  40. package/front_end/panels/application/AppManifestView.ts +263 -205
  41. package/front_end/panels/application/ApplicationPanelSidebar.ts +24 -57
  42. package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -0
  43. package/front_end/panels/application/ServiceWorkersView.ts +2 -0
  44. package/front_end/panels/application/StorageView.ts +1 -0
  45. package/front_end/panels/application/appManifestView.css +48 -0
  46. package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
  47. package/front_end/panels/application/preloading/PreloadingView.ts +12 -6
  48. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +230 -237
  49. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +96 -79
  50. package/front_end/panels/application/preloading/components/preloadingGrid.css +26 -29
  51. package/front_end/panels/application/preloading/preloadingView.css +6 -0
  52. package/front_end/panels/common/Annotation.ts +1 -1
  53. package/front_end/panels/common/AnnotationManager.ts +1 -1
  54. package/front_end/panels/common/ExtensionView.ts +1 -0
  55. package/front_end/panels/console/ConsoleContextSelector.ts +74 -9
  56. package/front_end/panels/console/consoleContextSelector.css +31 -29
  57. package/front_end/panels/coverage/coverageListView.css +59 -57
  58. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  59. package/front_end/panels/elements/ElementsTreeElement.ts +39 -1
  60. package/front_end/panels/elements/ElementsTreeOutline.ts +23 -21
  61. package/front_end/panels/elements/TopLayerContainer.ts +26 -91
  62. package/front_end/panels/explain/components/ConsoleInsight.ts +3 -3
  63. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +4 -8
  64. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +148 -97
  65. package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
  66. package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +37 -35
  67. package/front_end/panels/network/NetworkItemView.ts +1 -1
  68. package/front_end/panels/network/NetworkLogView.ts +1 -1
  69. package/front_end/panels/network/NetworkPanel.ts +1 -1
  70. package/front_end/panels/recorder/RecorderController.ts +0 -1
  71. package/front_end/panels/security/SecurityPanelSidebar.ts +5 -0
  72. package/front_end/panels/settings/SettingsScreen.ts +133 -1
  73. package/front_end/panels/settings/settings-meta.ts +24 -0
  74. package/front_end/panels/settings/settingsScreen.css +4 -0
  75. package/front_end/panels/sources/UISourceCodeFrame.ts +3 -17
  76. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -8
  77. package/front_end/panels/timeline/components/TimelineSummary.ts +75 -54
  78. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +18 -26
  79. package/front_end/panels/timeline/components/insights/Cache.ts +12 -8
  80. package/front_end/panels/timeline/components/insights/DOMSize.ts +25 -21
  81. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +7 -7
  82. package/front_end/panels/timeline/components/insights/FontDisplay.ts +7 -5
  83. package/front_end/panels/timeline/components/insights/ForcedReflow.ts +11 -9
  84. package/front_end/panels/timeline/components/insights/INPBreakdown.ts +7 -6
  85. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +7 -5
  86. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +20 -18
  87. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +12 -12
  88. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +7 -7
  89. package/front_end/panels/timeline/components/insights/ModernHTTP.ts +7 -5
  90. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +15 -13
  91. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
  92. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +15 -14
  93. package/front_end/panels/timeline/components/insights/Table.ts +152 -130
  94. package/front_end/panels/timeline/components/insights/ThirdParties.ts +11 -9
  95. package/front_end/panels/timeline/components/timelineSummary.css +58 -57
  96. package/front_end/panels/timeline/thirdPartyTreeView.css +109 -0
  97. package/front_end/panels/timeline/timelineDetailsView.css +2 -4
  98. package/front_end/panels/timeline/timelinePanel.css +0 -110
  99. package/front_end/third_party/acorn/estree-legacy.d.ts +2 -0
  100. package/front_end/third_party/chromium/README.chromium +1 -1
  101. package/front_end/third_party/puppeteer/README.chromium +2 -2
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +21 -7
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +15 -6
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +21 -7
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  133. package/front_end/third_party/puppeteer/package/package.json +2 -2
  134. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +1 -2
  135. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +2 -4
  136. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +2 -4
  137. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -4
  138. package/front_end/third_party/puppeteer/package/src/bidi/core/Connection.ts +3 -2
  139. package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +29 -10
  140. package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +3 -3
  141. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  142. package/front_end/ui/components/report_view/ReportView.docs.ts +37 -0
  143. package/front_end/ui/components/report_view/ReportView.ts +1 -4
  144. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  145. package/front_end/ui/legacy/Floaty.ts +5 -9
  146. package/front_end/ui/legacy/InspectorView.ts +2 -1
  147. package/front_end/ui/legacy/ReportView.ts +5 -4
  148. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  149. package/front_end/ui/legacy/ViewManager.ts +2 -32
  150. package/front_end/ui/legacy/Widget.ts +7 -0
  151. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -1
  152. package/front_end/ui/legacy/reportView.css +0 -24
  153. package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
  154. package/package.json +1 -1
  155. /package/front_end/{ui/components → models}/annotations/AnnotationType.ts +0 -0
  156. /package/front_end/{ui/components → models}/annotations/annotations.ts +0 -0
@@ -2,19 +2,20 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import './Table.js';
6
-
7
5
  import * as i18n from '../../../../core/i18n/i18n.js';
8
6
  import * as Platform from '../../../../core/platform/platform.js';
9
7
  import type {INPBreakdownInsightModel} from '../../../../models/trace/insights/INPBreakdown.js';
10
8
  import * as Trace from '../../../../models/trace/trace.js';
9
+ import * as UI from '../../../../ui/legacy/legacy.js';
11
10
  import * as Lit from '../../../../ui/lit/lit.js';
12
11
 
13
12
  import {BaseInsightComponent} from './BaseInsightComponent.js';
13
+ import {Table} from './Table.js';
14
14
 
15
15
  const {UIStrings, i18nString, createOverlaysForSubpart} = Trace.Insights.Models.INPBreakdown;
16
16
 
17
17
  const {html} = Lit;
18
+ const {widgetConfig} = UI.Widget;
18
19
 
19
20
  export class INPBreakdown extends BaseInsightComponent<INPBreakdownInsightModel> {
20
21
  override internalName = 'inp';
@@ -35,8 +36,8 @@ export class INPBreakdown extends BaseInsightComponent<INPBreakdownInsightModel>
35
36
  // clang-format off
36
37
  return html`
37
38
  <div class="insight-section">
38
- ${html`<devtools-performance-table
39
- .data=${{
39
+ ${html`<devtools-widget .widgetConfig=${widgetConfig(Table, {
40
+ data: {
40
41
  insight: this,
41
42
  headers: [i18nString(UIStrings.subpart), i18nString(UIStrings.duration)],
42
43
  rows: [
@@ -53,8 +54,8 @@ export class INPBreakdown extends BaseInsightComponent<INPBreakdownInsightModel>
53
54
  overlays: createOverlaysForSubpart(event, 2),
54
55
  },
55
56
  ],
56
- }}>
57
- </devtools-performance-table>`}
57
+ }})}>
58
+ </devtools-widget>`}
58
59
  </div>`;
59
60
  // clang-format on
60
61
  }
@@ -6,15 +6,17 @@ import '../../../../ui/kit/kit.js';
6
6
 
7
7
  import type {ImageDeliveryInsightModel} from '../../../../models/trace/insights/ImageDelivery.js';
8
8
  import * as Trace from '../../../../models/trace/trace.js';
9
+ import * as UI from '../../../../ui/legacy/legacy.js';
9
10
  import * as Lit from '../../../../ui/lit/lit.js';
10
11
 
11
12
  import {BaseInsightComponent} from './BaseInsightComponent.js';
12
13
  import {imageRef} from './ImageRef.js';
13
- import {createLimitedRows, renderOthersLabel, type TableDataRow} from './Table.js';
14
+ import {createLimitedRows, renderOthersLabel, Table, type TableDataRow} from './Table.js';
14
15
 
15
16
  const {UIStrings, i18nString, createOverlayForRequest} = Trace.Insights.Models.ImageDelivery;
16
17
 
17
18
  const {html} = Lit;
19
+ const {widgetConfig} = UI.Widget;
18
20
 
19
21
  export class ImageDelivery extends BaseInsightComponent<ImageDeliveryInsightModel> {
20
22
  override internalName = 'image-delivery';
@@ -56,13 +58,13 @@ export class ImageDelivery extends BaseInsightComponent<ImageDeliveryInsightMode
56
58
  // clang-format off
57
59
  return html`
58
60
  <div class="insight-section">
59
- <devtools-performance-table
60
- .data=${{
61
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
62
+ data: {
61
63
  insight: this,
62
64
  headers: [i18nString(UIStrings.optimizeFile)],
63
65
  rows,
64
- }}>
65
- </devtools-performance-table>
66
+ }})}>
67
+ </devtools-widget>
66
68
  </div>
67
69
  `;
68
70
  // clang-format on
@@ -61,30 +61,32 @@ export class InsightRenderer {
61
61
  renderInsightToWidgetElement(
62
62
  parsedTrace: Trace.TraceModel.ParsedTrace, insightSet: Trace.Insights.Types.InsightSet,
63
63
  model: Trace.Insights.Types.InsightModel, insightName: string,
64
- options: Partial<BaseInsightComponent<Trace.Insights.Types.InsightModel>>): InsightWidgetElement {
64
+ options: Partial<Pick<
65
+ BaseInsightComponent<Trace.Insights.Types.InsightModel>,
66
+ 'selected'|'agentFocus'|'fieldMetrics'|'isAIAssistanceContext'>>): InsightWidgetElement {
65
67
  let widgetElement = this.#insightWidgetCache.get(model);
66
68
  if (!widgetElement) {
67
69
  widgetElement = document.createElement('devtools-widget') as InsightWidgetElement;
68
-
69
- const componentClass = INSIGHT_NAME_TO_COMPONENT[insightName as keyof typeof INSIGHT_NAME_TO_COMPONENT];
70
- const widget = new componentClass(widgetElement) as BaseInsightComponent<Trace.Insights.Types.InsightModel>;
71
- widget.selected = false;
72
- widget.parsedTrace = parsedTrace;
73
- widget.model = model;
74
- widget.bounds = insightSet.bounds;
75
- widget.insightSetKey = insightSet.id;
76
- Object.assign(widget, options);
77
- widgetElement.widgetConfig = widgetConfig(() => {
78
- return widget;
79
- });
80
-
70
+ widgetElement.classList.add('insight-component-widget');
81
71
  this.#insightWidgetCache.set(model, widgetElement);
82
72
  }
83
73
 
84
- const widget = widgetElement.getWidget();
85
- if (widget) {
86
- Object.assign(widget, options);
87
- }
74
+ const componentClass = INSIGHT_NAME_TO_COMPONENT[insightName as keyof typeof INSIGHT_NAME_TO_COMPONENT];
75
+ widgetElement.widgetConfig = widgetConfig(componentClass, {
76
+ selected: options.selected ?? false,
77
+ parsedTrace,
78
+ // The `model` passed in as a parameter is the base type, but since
79
+ // `componentClass` is the union of every derived insight component, the
80
+ // `model` for the widget config is the union of every model. That can't be
81
+ // satisfied, so disable typescript.
82
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
+ model: model as any,
84
+ bounds: insightSet.bounds,
85
+ insightSetKey: insightSet.id,
86
+ agentFocus: options.agentFocus ?? null,
87
+ fieldMetrics: options.fieldMetrics ?? null,
88
+ isAIAssistanceContext: options.isAIAssistanceContext ?? false,
89
+ });
88
90
 
89
91
  return widgetElement;
90
92
  }
@@ -2,20 +2,20 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import './Table.js';
6
-
7
5
  import * as i18n from '../../../../core/i18n/i18n.js';
8
6
  import type {LCPBreakdownInsightModel} from '../../../../models/trace/insights/LCPBreakdown.js';
9
7
  import * as Trace from '../../../../models/trace/trace.js';
8
+ import * as UI from '../../../../ui/legacy/legacy.js';
10
9
  import * as Lit from '../../../../ui/lit/lit.js';
11
10
  import type * as Overlays from '../../overlays/overlays.js';
12
11
 
13
12
  import {BaseInsightComponent} from './BaseInsightComponent.js';
14
- import type {TableData} from './Table.js';
13
+ import {Table, type TableDataRow} from './Table.js';
15
14
 
16
15
  const {UIStrings, i18nString} = Trace.Insights.Models.LCPBreakdown;
17
16
 
18
17
  const {html} = Lit;
18
+ const {widgetConfig} = UI.Widget;
19
19
 
20
20
  export class LCPBreakdown extends BaseInsightComponent<LCPBreakdownInsightModel> {
21
21
  override internalName = 'lcp-by-phase';
@@ -69,13 +69,13 @@ export class LCPBreakdown extends BaseInsightComponent<LCPBreakdownInsightModel>
69
69
  // clang-format off
70
70
  return html`
71
71
  <div class="insight-section">
72
- <devtools-performance-table
73
- .data=${{
72
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
73
+ data: {
74
74
  insight: this,
75
75
  headers: [i18nString(UIStrings.subpart), i18nString(UIStrings.fieldDuration)],
76
76
  rows,
77
- } as TableData}>
78
- </devtools-performance-table>
77
+ }})}>
78
+ </devtools-widget>
79
79
  </div>
80
80
  `;
81
81
  // clang-format on
@@ -101,7 +101,7 @@ export class LCPBreakdown extends BaseInsightComponent<LCPBreakdownInsightModel>
101
101
  return html`<div class="insight-section">${i18nString(UIStrings.noLcp)}</div>`;
102
102
  }
103
103
 
104
- const rows = Object.values(subparts).map((subpart: Trace.Insights.Models.LCPBreakdown.Subpart) => {
104
+ const rows: TableDataRow[] = Object.values(subparts).map((subpart: Trace.Insights.Models.LCPBreakdown.Subpart) => {
105
105
  const section = this.#overlay?.sections.find(section => subpart.label === section.label);
106
106
  const timing = Trace.Helpers.Timing.microToMilli(subpart.range);
107
107
  return {
@@ -116,13 +116,13 @@ export class LCPBreakdown extends BaseInsightComponent<LCPBreakdownInsightModel>
116
116
  // clang-format off
117
117
  const sections: Lit.LitTemplate[] = [html`
118
118
  <div class="insight-section">
119
- <devtools-performance-table
120
- .data=${{
119
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
120
+ data: {
121
121
  insight: this,
122
122
  headers: [i18nString(UIStrings.subpart), i18nString(UIStrings.duration)],
123
123
  rows,
124
- } as TableData}>
125
- </devtools-performance-table>
124
+ }})}>
125
+ </devtools-widget>
126
126
  </div>`
127
127
  ];
128
128
  // clang-format on
@@ -2,8 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import './Table.js';
6
-
7
5
  import * as Common from '../../../../core/common/common.js';
8
6
  import * as i18n from '../../../../core/i18n/i18n.js';
9
7
  import * as SDK from '../../../../core/sdk/sdk.js';
@@ -11,15 +9,17 @@ import * as Bindings from '../../../../models/bindings/bindings.js';
11
9
  import type {
12
10
  LegacyJavaScriptInsightModel, PatternMatchResult} from '../../../../models/trace/insights/LegacyJavaScript.js';
13
11
  import * as Trace from '../../../../models/trace/trace.js';
12
+ import * as UI from '../../../../ui/legacy/legacy.js';
14
13
  import * as Lit from '../../../../ui/lit/lit.js';
15
14
 
16
15
  import {BaseInsightComponent} from './BaseInsightComponent.js';
17
16
  import {scriptRef} from './ScriptRef.js';
18
- import type {TableData, TableDataRow} from './Table.js';
17
+ import {Table, type TableDataRow} from './Table.js';
19
18
 
20
19
  const {UIStrings, i18nString} = Trace.Insights.Models.LegacyJavaScript;
21
20
 
22
21
  const {html} = Lit;
22
+ const {widgetConfig} = UI.Widget;
23
23
 
24
24
  export class LegacyJavaScript extends BaseInsightComponent<LegacyJavaScriptInsightModel> {
25
25
  override internalName = 'legacy-javascript';
@@ -85,13 +85,13 @@ export class LegacyJavaScript extends BaseInsightComponent<LegacyJavaScriptInsig
85
85
  // clang-format off
86
86
  return html`
87
87
  <div class="insight-section">
88
- <devtools-performance-table
89
- .data=${{
88
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
89
+ data: {
90
90
  insight: this,
91
91
  headers: [i18nString(UIStrings.columnScript), i18nString(UIStrings.columnWastedBytes)],
92
92
  rows,
93
- } as TableData}>
94
- </devtools-performance-table>
93
+ }})}>
94
+ </devtools-widget>
95
95
  </div>
96
96
  `;
97
97
  // clang-format on
@@ -6,15 +6,17 @@ import './Table.js';
6
6
 
7
7
  import type {ModernHTTPInsightModel} from '../../../../models/trace/insights/ModernHTTP.js';
8
8
  import * as Trace from '../../../../models/trace/trace.js';
9
+ import * as UI from '../../../../ui/legacy/legacy.js';
9
10
  import * as Lit from '../../../../ui/lit/lit.js';
10
11
 
11
12
  import {BaseInsightComponent} from './BaseInsightComponent.js';
12
13
  import {eventRef} from './EventRef.js';
13
- import {createLimitedRows, renderOthersLabel, type TableData, type TableDataRow} from './Table.js';
14
+ import {createLimitedRows, renderOthersLabel, Table, type TableDataRow} from './Table.js';
14
15
 
15
16
  const {UIStrings, i18nString, createOverlayForRequest} = Trace.Insights.Models.ModernHTTP;
16
17
 
17
18
  const {html} = Lit;
19
+ const {widgetConfig} = UI.Widget;
18
20
 
19
21
  export class ModernHTTP extends BaseInsightComponent<ModernHTTPInsightModel> {
20
22
  override internalName = 'modern-http';
@@ -56,13 +58,13 @@ export class ModernHTTP extends BaseInsightComponent<ModernHTTPInsightModel> {
56
58
  // clang-format off
57
59
  return html`
58
60
  <div class="insight-section">
59
- <devtools-performance-table
60
- .data=${{
61
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
62
+ data: {
61
63
  insight: this,
62
64
  headers: [i18nString(UIStrings.request), i18nString(UIStrings.protocol)],
63
65
  rows,
64
- } as TableData}>
65
- </devtools-performance-table>
66
+ }})}>
67
+ </devtools-widget>
66
68
  </div>`;
67
69
  // clang-format on
68
70
  }
@@ -10,6 +10,7 @@ import type {
10
10
  CriticalRequestNode, NetworkDependencyTreeInsightModel} from
11
11
  '../../../../models/trace/insights/NetworkDependencyTree.js';
12
12
  import * as Trace from '../../../../models/trace/trace.js';
13
+ import * as UI from '../../../../ui/legacy/legacy.js';
13
14
  import * as Lit from '../../../../ui/lit/lit.js';
14
15
 
15
16
  import {BaseInsightComponent} from './BaseInsightComponent.js';
@@ -17,11 +18,12 @@ import {eventRef} from './EventRef.js';
17
18
  import {md} from './Helpers.js';
18
19
  import networkDependencyTreeInsightStyles from './networkDependencyTreeInsight.css.js';
19
20
  import {nodeLink} from './NodeLink.js';
20
- import {renderOthersLabel, type TableData, type TableDataRow} from './Table.js';
21
+ import {renderOthersLabel, Table, type TableDataRow} from './Table.js';
21
22
 
22
23
  const {UIStrings, i18nString} = Trace.Insights.Models.NetworkDependencyTree;
23
24
 
24
25
  const {html} = Lit;
26
+ const {widgetConfig} = UI.Widget;
25
27
 
26
28
  export const MAX_CHAINS_TO_SHOW = 5;
27
29
 
@@ -115,13 +117,13 @@ export class NetworkDependencyTree extends BaseInsightComponent<NetworkDependenc
115
117
 
116
118
  // clang-format off
117
119
  return html`
118
- <devtools-performance-table
119
- .data=${{
120
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
121
+ data: {
120
122
  insight: this,
121
123
  headers: [i18nString(UIStrings.columnRequest), i18nString(UIStrings.columnTime)],
122
124
  rows,
123
- } as TableData}>
124
- </devtools-performance-table>
125
+ }})}>
126
+ </devtools-widget>
125
127
  `;
126
128
  // clang-format on
127
129
  }
@@ -240,13 +242,13 @@ export class NetworkDependencyTree extends BaseInsightComponent<NetworkDependenc
240
242
  <div class="insight-section">
241
243
  ${preconnectOriginsTableTitle}
242
244
  ${this.#renderTooManyPreconnectsWarning()}
243
- <devtools-performance-table
244
- .data=${{
245
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
246
+ data: {
245
247
  insight: this,
246
248
  headers: [i18nString(UIStrings.columnOrigin), i18nString(UIStrings.columnSource)],
247
249
  rows,
248
- } as TableData}>
249
- </devtools-performance-table>
250
+ }})}>
251
+ </devtools-widget>
250
252
  </div>
251
253
  `;
252
254
  // clang-format on
@@ -283,13 +285,13 @@ export class NetworkDependencyTree extends BaseInsightComponent<NetworkDependenc
283
285
  return html`
284
286
  <div class="insight-section">
285
287
  ${estSavingTableTitle}
286
- <devtools-performance-table
287
- .data=${{
288
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
289
+ data: {
288
290
  insight: this,
289
291
  headers: [i18nString(UIStrings.columnOrigin), i18nString(UIStrings.columnWastedMs)],
290
292
  rows,
291
- } as TableData}>
292
- </devtools-performance-table>
293
+ }})}>
294
+ </devtools-widget>
293
295
  </div>
294
296
  `;
295
297
  // clang-format on
@@ -58,13 +58,13 @@ export class RenderBlocking extends BaseInsightComponent<RenderBlockingInsightMo
58
58
  // clang-format off
59
59
  return html`
60
60
  <div class="insight-section">
61
- <devtools-performance-table
61
+ <devtools-widget
62
62
  .data=${{
63
63
  insight: this,
64
64
  headers: [i18nString(UIStrings.renderBlockingRequest), i18nString(UIStrings.duration)],
65
65
  rows,
66
66
  }}>
67
- </devtools-performance-table>
67
+ </devtools-widget>
68
68
  </div>
69
69
  `;
70
70
  // clang-format on
@@ -2,7 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import './Table.js';
6
5
  import '../../../../ui/components/linkifier/linkifier.js';
7
6
 
8
7
  import * as i18n from '../../../../core/i18n/i18n.js';
@@ -12,14 +11,16 @@ import type * as Protocol from '../../../../generated/protocol.js';
12
11
  import type {SlowCSSSelectorInsightModel} from '../../../../models/trace/insights/SlowCSSSelector.js';
13
12
  import * as Trace from '../../../../models/trace/trace.js';
14
13
  import type * as Linkifier from '../../../../ui/components/linkifier/linkifier.js';
14
+ import * as UI from '../../../../ui/legacy/legacy.js';
15
15
  import * as Lit from '../../../../ui/lit/lit.js';
16
16
 
17
17
  import {BaseInsightComponent} from './BaseInsightComponent.js';
18
- import type {TableData} from './Table.js';
18
+ import {Table} from './Table.js';
19
19
 
20
20
  const {UIStrings, i18nString} = Trace.Insights.Models.SlowCSSSelector;
21
21
 
22
22
  const {html} = Lit;
23
+ const {widgetConfig} = UI.Widget;
23
24
 
24
25
  export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsightModel> {
25
26
  override internalName = 'slow-css-selector';
@@ -106,8 +107,8 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
106
107
  // clang-format off
107
108
  const sections = [html`
108
109
  <div class="insight-section">
109
- <devtools-performance-table
110
- .data=${{
110
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
111
+ data: {
111
112
  insight: this,
112
113
  headers: [i18nString(UIStrings.total), ''],
113
114
  rows: [
@@ -115,8 +116,8 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
115
116
  {values: [i18nString(UIStrings.matchCount), this.model.totalMatchCount]},
116
117
  {values: [i18nString(UIStrings.elapsed), i18n.TimeUtilities.millisToString(this.model.totalElapsedMs)]},
117
118
  ],
118
- } as TableData}>
119
- </devtools-performance-table>
119
+ }})}>
120
+ </devtools-widget>
120
121
  </div>
121
122
  `];
122
123
  // clang-format on
@@ -126,14 +127,14 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
126
127
  // clang-format off
127
128
  sections.push(html`
128
129
  <div class="insight-section">
129
- <devtools-performance-table
130
- .data=${{
130
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
131
+ data: {
131
132
  insight: this,
132
133
  headers: [`${i18nString(UIStrings.topSelectorElapsedTime)}: ${time(Trace.Types.Timing.Micro(selector['elapsed (us)']))}`],
133
134
  rows: [{
134
135
  values: [html`${selector.selector} ${Lit.Directives.until(this.getSelectorLinks(cssModel, selector))}`]}]
135
- }} as TableData>
136
- </devtools-performance-table>
136
+ }})}>
137
+ </devtools-widget>
137
138
  </div>
138
139
  `);
139
140
  // clang-format on
@@ -144,15 +145,15 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
144
145
  // clang-format off
145
146
  sections.push(html`
146
147
  <div class="insight-section">
147
- <devtools-performance-table
148
- .data=${{
148
+ <devtools-widget .widgetConfig=${widgetConfig(Table, {
149
+ data: {
149
150
  insight: this,
150
151
  headers: [`${i18nString(UIStrings.topSelectorMatchAttempt)}: ${selector['match_attempts']}`],
151
152
  rows: [{
152
153
  values: [html`${selector.selector} ${Lit.Directives.until(this.getSelectorLinks(cssModel, selector))}` as unknown as string],
153
154
  }]
154
- }} as TableData}>
155
- </devtools-performance-table>
155
+ }})}>
156
+ </devtools-widget>
156
157
  </div>
157
158
  `);
158
159
  // clang-format on