Remove unused reportStackTraces option from FrameRateLogger

Summary:
This is not supported by any native implementation.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D50641812

fbshipit-source-id: e90a1998d2239b6f96c0c4db7b112f7e75cfc6dc
This commit is contained in:
Pieter De Baets
2023-11-03 04:38:20 -07:00
committed by Facebook GitHub Bot
parent b19386976c
commit 80d816a8ee
2 changed files with 9 additions and 22 deletions
@@ -30,28 +30,18 @@ const invariant = require('invariant');
*/
const FrameRateLogger = {
/**
* Enable `debug` to see local logs of what's going on. `reportStackTraces` will grab stack traces
* during UI thread stalls and upload them if the native module supports it.
* Enable `debug` to see local logs of what's going on.
*/
setGlobalOptions: function (options: {
debug?: boolean,
reportStackTraces?: boolean,
...
}) {
setGlobalOptions: function (options: {debug?: boolean, ...}) {
if (options.debug !== undefined) {
invariant(
NativeFrameRateLogger,
'Trying to debug FrameRateLogger without the native module!',
);
}
if (NativeFrameRateLogger) {
// Needs to clone the object first to avoid modifying the argument.
const optionsClone = {
debug: !!options.debug,
reportStackTraces: !!options.reportStackTraces,
};
NativeFrameRateLogger.setGlobalOptions(optionsClone);
}
NativeFrameRateLogger?.setGlobalOptions({
debug: !!options.debug,
});
},
/**
@@ -59,7 +49,7 @@ const FrameRateLogger = {
* in `AppRegistry`, but navigation is also a common place to hook in.
*/
setContext: function (context: string) {
NativeFrameRateLogger && NativeFrameRateLogger.setContext(context);
NativeFrameRateLogger?.setContext(context);
},
/**
@@ -67,7 +57,7 @@ const FrameRateLogger = {
* automatically.
*/
beginScroll() {
NativeFrameRateLogger && NativeFrameRateLogger.beginScroll();
NativeFrameRateLogger?.beginScroll();
},
/**
@@ -75,7 +65,7 @@ const FrameRateLogger = {
* automatically.
*/
endScroll() {
NativeFrameRateLogger && NativeFrameRateLogger.endScroll();
NativeFrameRateLogger?.endScroll();
},
};
@@ -13,10 +13,7 @@ import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export interface Spec extends TurboModule {
+setGlobalOptions: (options: {|
+debug?: ?boolean,
+reportStackTraces?: ?boolean,
|}) => void;
+setGlobalOptions: (options: {|+debug?: ?boolean|}) => void;
+setContext: (context: string) => void;
+beginScroll: () => void;
+endScroll: () => void;