Skip to content

Commit 35aa264

Browse files
authored
Merge pull request #43 from motiz88/rn-performance-panel-experiment
Allow enabling the Performance panel in Fusebox
2 parents 86e52e3 + d1814eb commit 35aa264

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

front_end/core/root/Runtime.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ export enum RNExperimentName {
291291
REACT_NATIVE_SPECIFIC_UI = 'reactNativeSpecificUI',
292292
ENABLE_REACT_DEVTOOLS_PANEL = 'enableReactDevToolsPanel',
293293
JS_HEAP_PROFILER_ENABLE = 'jsHeapProfilerEnable',
294+
ENABLE_PERFORMANCE_PANEL = 'enablePerformancePanel',
294295
}
295296

296297
// TODO(crbug.com/1167717): Make this a const enum again
@@ -326,6 +327,7 @@ export enum ExperimentName {
326327
JS_HEAP_PROFILER_ENABLE = RNExperimentName.JS_HEAP_PROFILER_ENABLE,
327328
REACT_NATIVE_SPECIFIC_UI = RNExperimentName.REACT_NATIVE_SPECIFIC_UI,
328329
ENABLE_REACT_DEVTOOLS_PANEL = RNExperimentName.ENABLE_REACT_DEVTOOLS_PANEL,
330+
ENABLE_PERFORMANCE_PANEL = RNExperimentName.ENABLE_PERFORMANCE_PANEL,
329331
}
330332

331333
// TODO(crbug.com/1167717): Make this a const enum again

front_end/entrypoints/main/rn_experiments.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,11 @@ RNExperiments.register({
235235
enabledByDefault: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint,
236236
configurable: false,
237237
});
238+
239+
RNExperiments.register({
240+
name: RNExperimentName.ENABLE_PERFORMANCE_PANEL,
241+
title: 'Enable Performance panel',
242+
unstable: true,
243+
enabledByDefault: ({ isReactNativeEntryPoint }) => !isReactNativeEntryPoint,
244+
configurable: ({ isReactNativeEntryPoint }) => isReactNativeEntryPoint,
245+
});

front_end/entrypoints/rn_fusebox/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ devtools_entrypoint("entrypoint") {
3232
"../../panels/rn_welcome:meta",
3333
"../../panels/security:meta",
3434
"../../panels/sensors:meta",
35+
"../../panels/timeline:meta",
3536
"../../panels/web_audio:meta",
3637
"../../panels/webauthn:meta",
3738
"../main:bundle",

front_end/entrypoints/rn_fusebox/rn_fusebox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import '../inspector_main/inspector_main-meta.js';
1515
import '../../panels/issues/issues-meta.js';
1616
import '../../panels/mobile_throttling/mobile_throttling-meta.js';
1717
import '../../panels/network/network-meta.js';
18-
import '../../panels/js_profiler/js_profiler-meta.js';
1918
import '../../panels/react_devtools/react_devtools-meta.js';
2019
import '../../panels/rn_welcome/rn_welcome-meta.js';
20+
import '../../panels/timeline/timeline-meta.js';
2121

2222
import * as i18n from '../../core/i18n/i18n.js';
2323
import * as Host from '../../core/host/host.js';

front_end/panels/react_devtools/react_devtools-meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ UI.ViewManager.registerViewExtension({
3838
title: i18nLazyString(UIStrings.title),
3939
commandPrompt: i18nLazyString(UIStrings.command),
4040
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
41+
order: 1000,
4142
async loadView() {
4243
const Module = await loadModule();
4344

front_end/panels/timeline/timeline-meta.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ UI.ViewManager.registerViewExtension({
125125
title: i18nLazyString(UIStrings.performance),
126126
commandPrompt: i18nLazyString(UIStrings.showPerformance),
127127
order: 50,
128+
experiment: Root.Runtime.ExperimentName.ENABLE_PERFORMANCE_PANEL,
128129
async loadView() {
129130
const Timeline = await loadTimelineModule();
130131
return Timeline.TimelinePanel.TimelinePanel.instance();
@@ -136,7 +137,7 @@ UI.ViewManager.registerViewExtension({
136137
id: 'js_profiler',
137138
title: i18nLazyString(UIStrings.javascriptProfiler),
138139
commandPrompt: i18nLazyString(UIStrings.showJavascriptProfiler),
139-
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
140+
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
140141
order: 65,
141142
experiment: Root.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,
142143
async loadView() {

0 commit comments

Comments
 (0)