Remove JSEventLoopWatchdog from react-native package (#51614)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51614

`JSEventLoopWatchdog` is not used in react-native package. This diff moves it to rn-tester which previously deep imported it from react-native (which we want to avoid).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75410548

fbshipit-source-id: d4996742578e3b068e7acad9479394388b1907ac
This commit is contained in:
Dawid Małecki
2025-05-27 03:10:14 -07:00
committed by Facebook GitHub Bot
parent b34e56259a
commit 9cdd0db138
3 changed files with 1 additions and 18 deletions
@@ -4722,22 +4722,6 @@ declare export default typeof InteractionManagerStub;
"
`;
exports[`public API should not change unintentionally Libraries/Interaction/JSEventLoopWatchdog.js 1`] = `
"type Handler = {
onIterate?: () => void,
onStall: (params: { lastInterval: number, busyTime: number, ... }) => ?string,
...
};
declare const JSEventLoopWatchdog: {
getStats: () => Object,
reset: () => void,
addHandler: (handler: Handler) => void,
install: ($$PARAM_0$$: { thresholdMS: number, ... }) => void,
};
declare export default typeof JSEventLoopWatchdog;
"
`;
exports[`public API should not change unintentionally Libraries/Interaction/NativeFrameRateLogger.js 1`] = `
"export * from \\"../../src/private/specs_DEPRECATED/modules/NativeFrameRateLogger\\";
declare export default typeof NativeFrameRateLogger;
+1 -2
View File
@@ -56,8 +56,7 @@ const useJsStalls = (): ({
}, []);
const onEnableJsStallsTracking = useCallback(() => {
const JSEventLoopWatchdog =
require('react-native/Libraries/Interaction/JSEventLoopWatchdog').default;
const JSEventLoopWatchdog = require('./JSEventLoopWatchdog').default;
JSEventLoopWatchdog.install({thresholdMS: 25});