chrome-devtools-frontend 1.0.1626437 → 1.0.1626840

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 (38) hide show
  1. package/front_end/core/host/UserMetrics.ts +11 -6
  2. package/front_end/core/root/ExperimentNames.ts +1 -1
  3. package/front_end/core/sdk/HeapProfilerModel.ts +1 -11
  4. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -1
  5. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -1
  6. package/front_end/entrypoints/main/MainImpl.ts +4 -29
  7. package/front_end/generated/InspectorBackendCommands.ts +3 -2
  8. package/front_end/generated/protocol-mapping.d.ts +5 -0
  9. package/front_end/generated/protocol-proxy-api.d.ts +4 -0
  10. package/front_end/generated/protocol.ts +21 -0
  11. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
  12. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +11 -5
  13. package/front_end/models/lighthouse/RunTypes.ts +1 -1
  14. package/front_end/models/workspace/UISourceCode.ts +0 -1
  15. package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -3
  16. package/front_end/panels/common/AiCodeCompletionTeaser.ts +9 -0
  17. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
  18. package/front_end/panels/lighthouse/LighthouseController.ts +18 -0
  19. package/front_end/panels/profiler/profiler-meta.ts +0 -71
  20. package/front_end/panels/profiler/profiler.ts +0 -2
  21. package/front_end/panels/sources/ProfilePlugin.ts +12 -65
  22. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -2
  23. package/front_end/third_party/chromium/README.chromium +1 -1
  24. package/front_end/third_party/lighthouse/README.chromium +2 -2
  25. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +4213 -4208
  26. package/front_end/third_party/lighthouse/locales/en-US.json +26 -8
  27. package/front_end/third_party/lighthouse/locales/en-XL.json +26 -8
  28. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  29. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -1
  30. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -1
  31. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +0 -56
  32. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -35
  33. package/front_end/ui/legacy/components/perf_ui/perf_ui.ts +0 -2
  34. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  35. package/package.json +1 -1
  36. package/front_end/panels/profiler/LiveHeapProfileView.ts +0 -405
  37. package/front_end/panels/profiler/liveHeapProfile.css +0 -22
  38. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +0 -113
@@ -20,58 +20,16 @@ const UIStrings = {
20
20
  * @description The milisecond unit
21
21
  */
22
22
  ms: 'ms',
23
- /**
24
- * @description Unit for data size in DevTools
25
- */
26
- mb: 'MB',
27
- /**
28
- * @description A unit
29
- */
30
- kb: 'kB',
31
23
  } as const;
32
24
  const str_ = i18n.i18n.registerUIStrings('panels/sources/ProfilePlugin.ts', UIStrings);
33
25
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
34
26
 
35
- class MemoryMarker extends CodeMirror.GutterMarker {
36
- constructor(readonly value: number) {
37
- super();
38
- }
39
-
40
- override eq(other: MemoryMarker): boolean {
41
- return this.value === other.value;
42
- }
43
-
44
- override toDOM(): HTMLElement {
45
- const element = document.createElement('div');
46
- element.className = 'cm-profileMarker';
47
- let value = this.value;
48
- const intensity = Platform.NumberUtilities.clamp(Math.log10(1 + 2e-3 * value) / 5, 0.02, 1);
49
- element.style.backgroundColor = `hsla(217, 100%, 70%, ${intensity.toFixed(3)})`;
50
- value /= 1e3;
51
- let units;
52
- let fractionDigits;
53
- if (value >= 1e3) {
54
- units = i18nString(UIStrings.mb);
55
- value /= 1e3;
56
- fractionDigits = value >= 20 ? 0 : 1;
57
- } else {
58
- units = i18nString(UIStrings.kb);
59
- fractionDigits = 0;
60
- }
61
- element.textContent = value.toFixed(fractionDigits);
62
- const unitElement = element.appendChild(document.createElement('span'));
63
- unitElement.className = 'cm-units';
64
- unitElement.textContent = units;
65
- return element;
66
- }
67
- }
68
-
69
27
  class PerformanceMarker extends CodeMirror.GutterMarker {
70
28
  constructor(readonly value: number) {
71
29
  super();
72
30
  }
73
31
 
74
- override eq(other: MemoryMarker): boolean {
32
+ override eq(other: PerformanceMarker): boolean {
75
33
  return this.value === other.value;
76
34
  }
77
35
 
@@ -89,10 +47,8 @@ class PerformanceMarker extends CodeMirror.GutterMarker {
89
47
  }
90
48
  }
91
49
 
92
- function markersFromProfileData(
93
- map: Workspace.UISourceCode.LineColumnProfileMap, state: CodeMirror.EditorState,
94
- type: Workspace.UISourceCode.DecoratorType): CodeMirror.RangeSet<CodeMirror.GutterMarker> {
95
- const markerType = type === Workspace.UISourceCode.DecoratorType.PERFORMANCE ? PerformanceMarker : MemoryMarker;
50
+ function markersFromProfileData(map: Workspace.UISourceCode.LineColumnProfileMap, state: CodeMirror.EditorState):
51
+ CodeMirror.RangeSet<CodeMirror.GutterMarker> {
96
52
  const markers: Array<CodeMirror.Range<CodeMirror.GutterMarker>> = [];
97
53
  const aggregatedByLine = new Map<number, number>();
98
54
  for (const [line, value] of map) {
@@ -104,13 +60,12 @@ function markersFromProfileData(
104
60
  }
105
61
  for (const [line, value] of aggregatedByLine) {
106
62
  const {from} = state.doc.line(line);
107
- markers.push(new markerType(value).range(from));
63
+ markers.push(new PerformanceMarker(value).range(from));
108
64
  }
109
65
  return CodeMirror.RangeSet.of(markers, true);
110
66
  }
111
67
 
112
- const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType): typeof Plugin =>
113
- class ProfilePlugin extends Plugin {
68
+ export class PerformanceProfilePlugin extends Plugin {
114
69
  updateEffect = CodeMirror.StateEffect.define<Workspace.UISourceCode.LineColumnProfileMap>();
115
70
  field: CodeMirror.StateField<CodeMirror.RangeSet<CodeMirror.GutterMarker>>;
116
71
  gutter: CodeMirror.Extension;
@@ -126,14 +81,14 @@ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType):
126
81
  },
127
82
  update: (markers, tr) => {
128
83
  return tr.effects.reduce((markers, effect) => {
129
- return effect.is(this.updateEffect) ? markersFromProfileData(effect.value, tr.state, type) : markers;
84
+ return effect.is(this.updateEffect) ? markersFromProfileData(effect.value, tr.state) : markers;
130
85
  }, markers.map(tr.changes));
131
86
  },
132
87
  });
133
88
 
134
89
  this.gutter = CodeMirror.gutter({
135
90
  markers: view => view.state.field(this.field),
136
- class: `cm-${type}Gutter`,
91
+ class: `cm-${Workspace.UISourceCode.DecoratorType.PERFORMANCE}Gutter`,
137
92
  });
138
93
 
139
94
  this.#transformer = transformer;
@@ -144,7 +99,8 @@ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType):
144
99
  }
145
100
 
146
101
  private getLineMap(): Workspace.UISourceCode.LineColumnProfileMap|undefined {
147
- const uiSourceCodeProfileMap = this.uiSourceCode.getDecorationData(type);
102
+ const uiSourceCodeProfileMap =
103
+ this.uiSourceCode.getDecorationData(Workspace.UISourceCode.DecoratorType.PERFORMANCE);
148
104
  if (!uiSourceCodeProfileMap) {
149
105
  return undefined;
150
106
  }
@@ -158,7 +114,7 @@ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType):
158
114
  override editorExtension(): CodeMirror.Extension {
159
115
  const map = this.getLineMap();
160
116
  return this.compartment.of(
161
- !map ? [] : [this.field.init(state => markersFromProfileData(map, state, type)), this.gutter, theme]);
117
+ !map ? [] : [this.field.init(state => markersFromProfileData(map, state)), this.gutter, theme]);
162
118
  }
163
119
 
164
120
  override decorationChanged(type: Workspace.UISourceCode.DecoratorType, editor: TextEditor.TextEditor.TextEditor):
@@ -172,13 +128,13 @@ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType):
172
128
  } else if (!installed) {
173
129
  editor.dispatch({
174
130
  effects: this.compartment.reconfigure(
175
- [this.field.init(state => markersFromProfileData(map, state, type)), this.gutter, theme]),
131
+ [this.field.init(state => markersFromProfileData(map, state)), this.gutter, theme]),
176
132
  });
177
133
  } else {
178
134
  editor.dispatch({effects: this.updateEffect.of(map)});
179
135
  }
180
136
  }
181
- };
137
+ }
182
138
 
183
139
  const theme = CodeMirror.EditorView.baseTheme({
184
140
  '.cm-line::selection': {
@@ -190,11 +146,6 @@ const theme = CodeMirror.EditorView.baseTheme({
190
146
  backgroundColor: 'var(--sys-color-cdt-base-container)',
191
147
  marginLeft: '3px',
192
148
  },
193
- '.cm-memoryGutter': {
194
- width: '48px',
195
- backgroundColor: 'var(--sys-color-cdt-base-container)',
196
- marginLeft: '3px',
197
- },
198
149
  '.cm-profileMarker': {
199
150
  textAlign: 'right',
200
151
  paddingRight: '3px',
@@ -205,7 +156,3 @@ const theme = CodeMirror.EditorView.baseTheme({
205
156
  marginLeft: '3px',
206
157
  },
207
158
  });
208
-
209
- export const MemoryProfilePlugin = makeLineLevelProfilePlugin(Workspace.UISourceCode.DecoratorType.MEMORY);
210
-
211
- export const PerformanceProfilePlugin = makeLineLevelProfilePlugin(Workspace.UISourceCode.DecoratorType.PERFORMANCE);
@@ -25,7 +25,7 @@ import {CoveragePlugin} from './CoveragePlugin.js';
25
25
  import {CSSPlugin} from './CSSPlugin.js';
26
26
  import {DebuggerPlugin} from './DebuggerPlugin.js';
27
27
  import type {Plugin} from './Plugin.js';
28
- import {MemoryProfilePlugin, PerformanceProfilePlugin} from './ProfilePlugin.js';
28
+ import {PerformanceProfilePlugin} from './ProfilePlugin.js';
29
29
  import {ResourceOriginPlugin} from './ResourceOriginPlugin.js';
30
30
  import {SnippetsPlugin} from './SnippetsPlugin.js';
31
31
  import {SourcesPanel} from './SourcesPanel.js';
@@ -321,7 +321,6 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
321
321
  SnippetsPlugin,
322
322
  ResourceOriginPlugin,
323
323
  CoveragePlugin,
324
- MemoryProfilePlugin,
325
324
  PerformanceProfilePlugin,
326
325
  AiWarningInfobarPlugin,
327
326
  ];
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: 6bd698412997c22fb10551e3080f738503d6869b
4
+ Revision: b174d33a5d4e7e955be6e2f2c6f01bbd5d835ce3
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -1,7 +1,7 @@
1
1
  Name: Lighthouse
2
2
  Short Name: lighthouse
3
- Version: 13.2.0
4
- Revision: a160d341f363acf2d99314214a6e0de7d0fead1f
3
+ Version: 13.3.0
4
+ Revision: 7d8dcf5004950cad3faa20664e4a7cf2817bd653
5
5
  Update Mechanism: Manual
6
6
  URL: https://github.com/GoogleChrome/lighthouse
7
7
  License: Apache-2.0