Skip to content

Commit bc3bd7f

Browse files
authored
chore: hide unsupported Detached elements memory profiling option (#178)
1 parent 1f9eb65 commit bc3bd7f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

front_end/panels/profiler/HeapProfilerPanel.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import * as Host from '../../core/host/host.js';
66
import * as i18n from '../../core/i18n/i18n.js';
7+
import * as Root from '../../core/root/root.js';
78
import type * as SDK from '../../core/sdk/sdk.js';
89
import * as UI from '../../ui/legacy/legacy.js';
910

@@ -24,8 +25,17 @@ let heapProfilerPanelInstance: HeapProfilerPanel;
2425
export class HeapProfilerPanel extends ProfilesPanel implements UI.ContextMenu.Provider<SDK.RemoteObject.RemoteObject>,
2526
UI.ActionRegistration.ActionDelegate {
2627
constructor() {
28+
const isReactNative = Root.Runtime.experiments.isEnabled(
29+
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
30+
);
2731
const registry = instance;
28-
const profileTypes = [
32+
// [RN] Allocation sampling and Detached elements memory profiling options are not supported.
33+
// We are hiding these options from the UI.
34+
const profileTypes = isReactNative ? [
35+
registry.heapSnapshotProfileType,
36+
registry.trackingHeapSnapshotProfileType,
37+
registry.samplingHeapProfileType,
38+
] : [
2939
registry.heapSnapshotProfileType,
3040
registry.trackingHeapSnapshotProfileType,
3141
registry.samplingHeapProfileType,

0 commit comments

Comments
 (0)