Skip to content

Commit 4f0b002

Browse files
committed
Disable Performance panel, enable legacy JS Profiler
1 parent 8604721 commit 4f0b002

File tree

5 files changed

+18
-26
lines changed

5 files changed

+18
-26
lines changed

front_end/entrypoints/main/MainImpl.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,6 @@ export class MainImpl {
313313
'timelineAsConsoleProfileResultPanel', 'View console.profile() results in the Performance panel for Node.js',
314314
true);
315315

316-
// JS Profiler
317-
Root.Runtime.experiments.register(
318-
'jsProfilerTemporarilyEnable', 'Enable JavaScript Profiler temporarily', /* unstable= */ false,
319-
'https://developer.chrome.com/blog/js-profiler-deprecation/',
320-
'https://bugs.chromium.org/p/chromium/issues/detail?id=1354548');
321-
322316
// Debugging
323317
Root.Runtime.experiments.register(
324318
'wasmDWARFDebugging', 'WebAssembly Debugging: Enable DWARF support', undefined,

front_end/entrypoints/rn_inspector/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ devtools_entrypoint("entrypoint") {
1818
"../../panels/elements:meta",
1919
"../../panels/emulation:meta",
2020
"../../panels/issues:meta",
21+
"../../panels/js_profiler:meta",
2122
"../../panels/layer_viewer:meta",
2223
"../../panels/layers:meta",
2324
"../../panels/lighthouse:meta",
@@ -29,7 +30,6 @@ devtools_entrypoint("entrypoint") {
2930
"../../panels/rn_welcome:meta",
3031
"../../panels/security:meta",
3132
"../../panels/sensors:meta",
32-
"../../panels/timeline:meta",
3333
"../../panels/web_audio:meta",
3434
"../../panels/webauthn:meta",
3535
"../main:bundle",

front_end/entrypoints/rn_inspector/rn_inspector.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,30 @@ import '../../panels/developer_resources/developer_resources-meta.js';
1010
import '../inspector_main/inspector_main-meta.js';
1111
import '../../panels/issues/issues-meta.js';
1212
import '../../panels/mobile_throttling/mobile_throttling-meta.js';
13-
import '../../panels/timeline/timeline-meta.js';
13+
import '../../panels/js_profiler/js_profiler-meta.js';
1414
import '../../panels/rn_welcome/rn_welcome-meta.js';
1515

1616
import * as Root from '../../core/root/root.js';
1717
import * as Main from '../main/main.js';
1818

19+
// Legacy JavaScript Profiler - we support this until Hermes can support the
20+
// modern Performance panel.
21+
Root.Runtime.experiments.register(
22+
Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
23+
'Enable JavaScript Profiler (legacy)',
24+
/* unstable */ false,
25+
);
26+
1927
Root.Runtime.experiments.register(
2028
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
2129
'Show React Native-specific UI',
2230
/* unstable */ false,
2331
);
2432

25-
Root.Runtime.experiments.enableExperimentsByDefault(
26-
[Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI],
27-
);
33+
Root.Runtime.experiments.enableExperimentsByDefault([
34+
Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
35+
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
36+
]);
2837

2938
// @ts-ignore Exposed for legacy layout tests
3039
self.runtime = Root.Runtime.Runtime.instance({forceNew: true});

front_end/panels/js_profiler/js_profiler-meta.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,14 @@ UI.ViewManager.registerViewExtension({
8888
title: i18nLazyString(UIStrings.profiler),
8989
commandPrompt: i18nLazyString(UIStrings.showProfiler),
9090
order: 65,
91-
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
91+
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
9292
experiment: Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
9393
async loadView() {
9494
const Profiler = await loadProfilerModule();
9595
return Profiler.ProfilesPanel.JSProfilerPanel.instance();
9696
},
9797
});
9898

99-
UI.ViewManager.registerViewExtension({
100-
location: UI.ViewManager.ViewLocationValues.PANEL,
101-
id: 'timeline',
102-
title: i18nLazyString(UIStrings.performance),
103-
commandPrompt: i18nLazyString(UIStrings.showPerformance),
104-
order: 66,
105-
hasToolbar: false,
106-
isPreviewFeature: true,
107-
async loadView() {
108-
const Timeline = await loadTimelineModule();
109-
return Timeline.TimelinePanel.TimelinePanel.instance({forceNew: null, isNode: true});
110-
},
111-
});
112-
11399
UI.ActionRegistration.registerActionExtension({
114100
actionId: 'profiler.js-toggle-recording',
115101
category: UI.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,

front_end/panels/profiler/ProfilesPanel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ export class JSProfilerPanel extends ProfilesPanel implements UI.ActionRegistrat
704704
const registry = instance;
705705
super('js_profiler', [registry.cpuProfileType], 'profiler.js-toggle-recording');
706706
this.splitWidget().mainWidget()?.setMinimumSize(350, 0);
707+
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) {
708+
return;
709+
}
707710
if (Root.Runtime.experiments.isEnabled('jsProfilerTemporarilyEnable')) {
708711
this.#showDeprecationInfobar();
709712
} else {

0 commit comments

Comments
 (0)