Skip to content

Commit

Permalink
Remove unused reportStackTraces option from FrameRateLogger
Browse files Browse the repository at this point in the history
Summary:
This is not supported by any native implementation.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D50641812

fbshipit-source-id: e90a1998d2239b6f96c0c4db7b112f7e75cfc6dc
  • Loading branch information
javache authored and facebook-github-bot committed Nov 3, 2023
1 parent b193869 commit 80d816a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
26 changes: 8 additions & 18 deletions packages/react-native/Libraries/Interaction/FrameRateLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,42 @@ 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,
});
},

/**
* Must call `setContext` before any events can be properly tracked, which is done automatically
* in `AppRegistry`, but navigation is also a common place to hook in.
*/
setContext: function (context: string) {
NativeFrameRateLogger && NativeFrameRateLogger.setContext(context);
NativeFrameRateLogger?.setContext(context);
},

/**
* Called in `ScrollResponder` so any component that uses that module will handle this
* automatically.
*/
beginScroll() {
NativeFrameRateLogger && NativeFrameRateLogger.beginScroll();
NativeFrameRateLogger?.beginScroll();
},

/**
* Called in `ScrollResponder` so any component that uses that module will handle this
* automatically.
*/
endScroll() {
NativeFrameRateLogger && NativeFrameRateLogger.endScroll();
NativeFrameRateLogger?.endScroll();
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 80d816a

Please sign in to comment.