mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e2bf843d86
Summary: The `RCTBridge` contains numerous definitions of notification names, which we can observe in order to get insights into the React Native performance. The Android implementation is a little different, such that you can listen for any of the [following](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java) marker constants, simply by including the following code: ```java ReactMarker.addListener(new ReactMarker.MarkerListener() { Override public void logMarker(ReactMarkerConstants name, Nullable String tag, int instanceKey) { Log.d("ReactNativeEvent", "name: "+ name.name() + " tag: " + tag); } }); ``` This will allow you to perform the necessary processing, calculations as required. --- This PR enables observing for the module setup event (`RCTDidSetupModuleNotification`) by including the respective module's name & setup time in milliseconds. [iOS] [Added] - Gain insights on the module setup times by observing `RCTDidSetupModuleNotification`. The `userInfo` dictionary will contain the module name and setup time in milliseconds. These values can be extracted via `RCTDidSetupModuleNotificationModuleNameKey ` and `RCTDidSetupModuleNotificationSetupTimeKey`. Pull Request resolved: https://github.com/facebook/react-native/pull/23859 Differential Revision: D14579066 Pulled By: PeteTheHeat fbshipit-source-id: 52645127c3fc6aa5bd73e3bd471fccd79cb05c14