Skip to content

Commit

Permalink
Allow enabling the Performance panel in Fusebox
Browse files Browse the repository at this point in the history
  • Loading branch information
motiz88 committed Apr 12, 2024
1 parent 8cfd8f8 commit d1814eb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions front_end/core/root/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export enum RNExperimentName {
REACT_NATIVE_SPECIFIC_UI = 'reactNativeSpecificUI',
ENABLE_REACT_DEVTOOLS_PANEL = 'enableReactDevToolsPanel',
JS_HEAP_PROFILER_ENABLE = 'jsHeapProfilerEnable',
ENABLE_PERFORMANCE_PANEL = 'enablePerformancePanel',
}

// TODO(crbug.com/1167717): Make this a const enum again
Expand Down Expand Up @@ -326,6 +327,7 @@ export enum ExperimentName {
JS_HEAP_PROFILER_ENABLE = RNExperimentName.JS_HEAP_PROFILER_ENABLE,
REACT_NATIVE_SPECIFIC_UI = RNExperimentName.REACT_NATIVE_SPECIFIC_UI,
ENABLE_REACT_DEVTOOLS_PANEL = RNExperimentName.ENABLE_REACT_DEVTOOLS_PANEL,
ENABLE_PERFORMANCE_PANEL = RNExperimentName.ENABLE_PERFORMANCE_PANEL,
}

// TODO(crbug.com/1167717): Make this a const enum again
Expand Down
8 changes: 8 additions & 0 deletions front_end/entrypoints/main/rn_experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,11 @@ RNExperiments.register({
enabledByDefault: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint,
configurable: false,
});

RNExperiments.register({
name: RNExperimentName.ENABLE_PERFORMANCE_PANEL,
title: 'Enable Performance panel',
unstable: true,
enabledByDefault: ({ isReactNativeEntryPoint }) => !isReactNativeEntryPoint,
configurable: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint,
});
1 change: 1 addition & 0 deletions front_end/entrypoints/rn_fusebox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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
2 changes: 1 addition & 1 deletion front_end/entrypoints/rn_fusebox/rn_fusebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import '../inspector_main/inspector_main-meta.js';
import '../../panels/issues/issues-meta.js';
import '../../panels/mobile_throttling/mobile_throttling-meta.js';
import '../../panels/network/network-meta.js';
import '../../panels/js_profiler/js_profiler-meta.js';
import '../../panels/react_devtools/react_devtools-meta.js';
import '../../panels/rn_welcome/rn_welcome-meta.js';
import '../../panels/timeline/timeline-meta.js';

import * as i18n from '../../core/i18n/i18n.js';
import * as Host from '../../core/host/host.js';
Expand Down
1 change: 1 addition & 0 deletions front_end/panels/react_devtools/react_devtools-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ UI.ViewManager.registerViewExtension({
title: i18nLazyString(UIStrings.title),
commandPrompt: i18nLazyString(UIStrings.command),
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
order: 1000,
async loadView() {
const Module = await loadModule();

Expand Down
3 changes: 2 additions & 1 deletion front_end/panels/timeline/timeline-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ UI.ViewManager.registerViewExtension({
title: i18nLazyString(UIStrings.performance),
commandPrompt: i18nLazyString(UIStrings.showPerformance),
order: 50,
experiment: Root.Runtime.ExperimentName.ENABLE_PERFORMANCE_PANEL,
async loadView() {
const Timeline = await loadTimelineModule();
return Timeline.TimelinePanel.TimelinePanel.instance();
Expand All @@ -136,7 +137,7 @@ UI.ViewManager.registerViewExtension({
id: 'js_profiler',
title: i18nLazyString(UIStrings.javascriptProfiler),
commandPrompt: i18nLazyString(UIStrings.showJavascriptProfiler),
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
order: 65,
experiment: Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
async loadView() {
Expand Down

0 comments on commit d1814eb

Please sign in to comment.