From 80d816a8eef6dc6d55233bb437b06494f6500688 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 3 Nov 2023 04:38:20 -0700 Subject: [PATCH] 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 --- .../Libraries/Interaction/FrameRateLogger.js | 26 ++++++------------- .../Interaction/NativeFrameRateLogger.js | 5 +--- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/packages/react-native/Libraries/Interaction/FrameRateLogger.js b/packages/react-native/Libraries/Interaction/FrameRateLogger.js index 7f6d35d72f4bf9..e9d54dbf402a90 100644 --- a/packages/react-native/Libraries/Interaction/FrameRateLogger.js +++ b/packages/react-native/Libraries/Interaction/FrameRateLogger.js @@ -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(); }, }; diff --git a/packages/react-native/Libraries/Interaction/NativeFrameRateLogger.js b/packages/react-native/Libraries/Interaction/NativeFrameRateLogger.js index 69bf692d672ab3..929582e74e7047 100644 --- a/packages/react-native/Libraries/Interaction/NativeFrameRateLogger.js +++ b/packages/react-native/Libraries/Interaction/NativeFrameRateLogger.js @@ -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;