Skip to content

Commit

Permalink
Disable Performance panel, enable legacy JS Profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie committed Oct 10, 2023
1 parent 8604721 commit 4f0b002
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
6 changes: 0 additions & 6 deletions front_end/entrypoints/main/MainImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,6 @@ export class MainImpl {
'timelineAsConsoleProfileResultPanel', 'View console.profile() results in the Performance panel for Node.js',
true);

// JS Profiler
Root.Runtime.experiments.register(
'jsProfilerTemporarilyEnable', 'Enable JavaScript Profiler temporarily', /* unstable= */ false,
'https://developer.chrome.com/blog/js-profiler-deprecation/',
'https://bugs.chromium.org/p/chromium/issues/detail?id=1354548');

// Debugging
Root.Runtime.experiments.register(
'wasmDWARFDebugging', 'WebAssembly Debugging: Enable DWARF support', undefined,
Expand Down
2 changes: 1 addition & 1 deletion front_end/entrypoints/rn_inspector/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ devtools_entrypoint("entrypoint") {
"../../panels/elements:meta",
"../../panels/emulation:meta",
"../../panels/issues:meta",
"../../panels/js_profiler:meta",
"../../panels/layer_viewer:meta",
"../../panels/layers:meta",
"../../panels/lighthouse:meta",
Expand All @@ -29,7 +30,6 @@ devtools_entrypoint("entrypoint") {
"../../panels/rn_welcome:meta",
"../../panels/security:meta",
"../../panels/sensors:meta",
"../../panels/timeline:meta",
"../../panels/web_audio:meta",
"../../panels/webauthn:meta",
"../main:bundle",
Expand Down
17 changes: 13 additions & 4 deletions front_end/entrypoints/rn_inspector/rn_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@ import '../../panels/developer_resources/developer_resources-meta.js';
import '../inspector_main/inspector_main-meta.js';
import '../../panels/issues/issues-meta.js';
import '../../panels/mobile_throttling/mobile_throttling-meta.js';
import '../../panels/timeline/timeline-meta.js';
import '../../panels/js_profiler/js_profiler-meta.js';
import '../../panels/rn_welcome/rn_welcome-meta.js';

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

// Legacy JavaScript Profiler - we support this until Hermes can support the
// modern Performance panel.
Root.Runtime.experiments.register(
Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
'Enable JavaScript Profiler (legacy)',
/* unstable */ false,
);

Root.Runtime.experiments.register(
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
'Show React Native-specific UI',
/* unstable */ false,
);

Root.Runtime.experiments.enableExperimentsByDefault(
[Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI],
);
Root.Runtime.experiments.enableExperimentsByDefault([
Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
]);

// @ts-ignore Exposed for legacy layout tests
self.runtime = Root.Runtime.Runtime.instance({forceNew: true});
Expand Down
16 changes: 1 addition & 15 deletions front_end/panels/js_profiler/js_profiler-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,14 @@ UI.ViewManager.registerViewExtension({
title: i18nLazyString(UIStrings.profiler),
commandPrompt: i18nLazyString(UIStrings.showProfiler),
order: 65,
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
experiment: Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
async loadView() {
const Profiler = await loadProfilerModule();
return Profiler.ProfilesPanel.JSProfilerPanel.instance();
},
});

UI.ViewManager.registerViewExtension({
location: UI.ViewManager.ViewLocationValues.PANEL,
id: 'timeline',
title: i18nLazyString(UIStrings.performance),
commandPrompt: i18nLazyString(UIStrings.showPerformance),
order: 66,
hasToolbar: false,
isPreviewFeature: true,
async loadView() {
const Timeline = await loadTimelineModule();
return Timeline.TimelinePanel.TimelinePanel.instance({forceNew: null, isNode: true});
},
});

UI.ActionRegistration.registerActionExtension({
actionId: 'profiler.js-toggle-recording',
category: UI.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,
Expand Down
3 changes: 3 additions & 0 deletions front_end/panels/profiler/ProfilesPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ export class JSProfilerPanel extends ProfilesPanel implements UI.ActionRegistrat
const registry = instance;
super('js_profiler', [registry.cpuProfileType], 'profiler.js-toggle-recording');
this.splitWidget().mainWidget()?.setMinimumSize(350, 0);
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) {
return;
}
if (Root.Runtime.experiments.isEnabled('jsProfilerTemporarilyEnable')) {
this.#showDeprecationInfobar();
} else {
Expand Down

0 comments on commit 4f0b002

Please sign in to comment.