Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update to latest devtools-frontend #120

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 18 additions & 54 deletions src/thirdparty/devtools-frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ class Aggregate {
}
}
class AggregateForDiff {
name;
indexes;
ids;
selfSizes;
constructor() {
this.name = '';
this.indexes = [];
this.ids = [];
this.selfSizes = [];
Expand Down Expand Up @@ -1170,55 +1172,6 @@ function serializeUIString(string, values = {}) {
return JSON.stringify(serializedMessage);
}

// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const UIStrings$2 = {
/**
*@description μs is the short form of micro-seconds and the placeholder is a number
* The shortest form or abbreviation of micro-seconds should be used, as there is
* limited room in this UI.
*@example {2} PH1
*/
fmms: '{PH1} μs',
/**
*@description ms is the short form of milli-seconds and the placeholder is a decimal number
* The shortest form or abbreviation of milli-seconds should be used, as there is
* limited room in this UI.
*@example {2.14} PH1
*/
fms: '{PH1} ms',
/**
*@description s is short for seconds and the placeholder is a decimal number
* The shortest form or abbreviation of seconds should be used, as there is
* limited room in this UI.
*@example {2.14} PH1
*/
fs: '{PH1} s',
/**
*@description min is short for minutes and the placeholder is a decimal number
*@example {2.2} PH1
*/
fmin: '{PH1} min',
/**
*@description hrs is short for hours and the placeholder is a decimal number
*@example {2.2} PH1
*/
fhrs: '{PH1} hrs',
/**
*@description days formatting and the placeholder is a decimal number
*@example {2.2} PH1
*/
fdays: '{PH1} days',
/**
*@description describes a number of milliseconds (the unit should not abbreviated)
*@example {2.14} PH1
*/
fmsExpanded: '{PH1} milliseconds',
};
const str_$2 = registerUIStrings('core/i18n/time-utilities.ts', UIStrings$2);
getLocalizedString.bind(undefined, str_$2);

class HeapSnapshotEdge {
snapshot;
edges;
Expand Down Expand Up @@ -2210,7 +2163,7 @@ class HeapSnapshot {
// for class keys.
aggregates = Object.create(null);
for (const [classKey, aggregate] of aggregatesMap.entries()) {
const newKey = typeof classKey === 'number' ? (',' + this.strings[classKey]) : classKey;
const newKey = this.classKeyFromClassKeyInternal(classKey);
aggregates[newKey] = aggregate;
}
if (key) {
Expand Down Expand Up @@ -2260,7 +2213,7 @@ class HeapSnapshot {
ids[i] = node.id();
selfSizes[i] = node.selfSize();
}
result[classKey] = { indexes, ids, selfSizes };
result[classKey] = { name: node.className(), indexes, ids, selfSizes };
}
this.#aggregatesForDiffInternal = { interfaceDefinitions, aggregates: result };
return result;
Expand Down Expand Up @@ -3232,7 +3185,7 @@ class HeapSnapshot {
let j = 0;
const l = baseIds.length;
const m = indexes.length;
const diff = new Diff(aggregate.name);
const diff = new Diff(aggregate ? aggregate.name : baseAggregate.name);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it may be designed exactly to mitigate #119.

Related: ChromeDevTools/devtools-frontend@204e831

const nodeB = this.createNode(indexes[j]);
while (i < l && j < m) {
const nodeAId = baseIds[i];
Expand Down Expand Up @@ -3281,10 +3234,16 @@ class HeapSnapshot {
}
return null;
}
nodeClassName(snapshotObjectId) {
// Converts an internal class key, suitable for categorizing within this
// snapshot, to a public class key, which can be used in comparisons
// between multiple snapshots.
classKeyFromClassKeyInternal(key) {
return typeof key === 'number' ? (',' + this.strings[key]) : key;
}
nodeClassKey(snapshotObjectId) {
const node = this.nodeForSnapshotObjectId(snapshotObjectId);
if (node) {
return node.className();
return this.classKeyFromClassKeyInternal(node.classKeyInternal());
}
return null;
}
Expand Down Expand Up @@ -4517,6 +4476,10 @@ const UIStrings$1 = {
* @description The UI destination when revealing loaded resources through the Developer Resources Panel
*/
developerResourcesPanel: 'Developer Resources panel',
/**
* @description The UI destination when revealing loaded resources through the Animations panel
*/
animationsPanel: 'Animations panel',
};
const str_$1 = registerUIStrings('core/common/Revealer.ts', UIStrings$1);
const i18nLazyString = getLazilyComputedLocalizedString.bind(undefined, str_$1);
Expand All @@ -4531,6 +4494,7 @@ const i18nLazyString = getLazilyComputedLocalizedString.bind(undefined, str_$1);
APPLICATION_PANEL: i18nLazyString(UIStrings$1.applicationPanel),
SOURCES_PANEL: i18nLazyString(UIStrings$1.sourcesPanel),
MEMORY_INSPECTOR_PANEL: i18nLazyString(UIStrings$1.memoryInspectorPanel),
ANIMATIONS_PANEL: i18nLazyString(UIStrings$1.animationsPanel),
});

// Copyright 2014 The Chromium Authors. All rights reserved.
Expand Down
Loading