MCPcopy Create free account
hub / github.com/bamlab/react-native-flipper-performance-monitor

github.com/bamlab/react-native-flipper-performance-monitor @flipper-desktop-v0.5.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release flipper-desktop-v0.5.1 ↗ · + Follow
144 symbols 274 edges 49 files 11 documented · 8% updated 2y agoreact-native-flipper-performance-plugin-v0.4.0 · 2023-03-13★ 6029 open issues

Browse by type

Functions 118 Types & classes 26
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Native Performance Monitor Flipper plugin

Build Status

rn-perf-monitor

Usage

Here's a detailed article to go further

  1. Disable JS Dev Mode in the settings (shake your device to open the development menu, then click settings)
  2. Click Start Measuring
  3. Do stuff in your app
  4. Check the score!

This is how the score is calculated below, quite naively, but open to suggestions: plugin-score

Note that:

  • the score depends on the device used. We advice using a lower-end device to accentuate performance issues.
  • the score depends on what you do on your app while measuring. If you do nothing, your score should (hopefully) be 100!

Install

Flipper

Search for rn-perf-monitor in the list of plugins.

Install Android/iOS plugin

Install the plugin

yarn add --dev react-native-flipper-performance-plugin

Then go to iOS/Android section below to continue the install

iOS

  • Run cd ios && pod install

  • In ./ios/yourapp/AppDelegate.m (where yourapp depends on your app), add 2 lines:

#ifdef FB_SONARKIT_ENABLED
...
// Add this line
#import <FlipperPerformancePlugin.h>

static void InitializeFlipper(UIApplication *application) {
  ...

  // Add this line
  [client addPlugin:[FlipperPerformancePlugin new]];

  [client start];
}
#endif

Android

In ./android/app/src/debug/java/com/yourapp/ReactNativeFlipper.java (where com/yourapp depends on your app), add:

import tech.bam.rnperformance.flipper.RNPerfMonitorPlugin;

...

client.addPlugin(new RNPerfMonitorPlugin(reactInstanceManager));

Migrating from flipper-plugin-rn-performance-android

You might have previously installed flipper-plugin-rn-performance-android. This is now deprecated, as react-native-flipper-performance-plugin has autolinking and cross-platform support.

You also need to run these steps:

Uninstall the package:

yarn remove flipper-plugin-rn-performance-android

Then remove those lines in ./android/settings.gradle:

include ':flipper-plugin-rn-performance-android'
project(':flipper-plugin-rn-performance-android').projectDir = new File(rootProject.projectDir, '../node_modules/flipper-plugin-rn-performance-android')

and in ./android/app/build.gradle:

debugImplementation project(':flipper-plugin-rn-performance-android')

Contributing to flipper Desktop

  1. Clone the repository.
  2. Add path to your local react-native-performance folder in ~/.flipper/config.json as shown on the flipper docs
  3. Run yarn watch inside flipper-desktop
  4. Connect your debug app with the flipper android plugin installed.
  5. You should now see your plugin appear in Flipper.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 76
Function 42
Class 17
Interface 9

Languages

TypeScript65%
Java35%
C++1%

Modules by API surface

flipper-desktop/src/GfxInfo.tsx18 symbols
e2e/utils/AppiumDriver.ts18 symbols
e2e/utils/GestureHandler.ts12 symbols
flipper-native/android/src/debug/java/tech/bam/rnperformance/flipper/RNPerfMonitorPlugin.java11 symbols
flipper-native/android/src/debug/java/tech/bam/rnperformance/flipper/FPSMonitor.java9 symbols
e2e/utils/measureStartupTime.ts9 symbols
example/android/app/src/main/java/com/example/MainApplication.java7 symbols
flipper-desktop/src/index.tsx6 symbols
react-native-startup-trace/android/src/main/java/tech/bam/rnperformance/startuptrace/StartupTraceModule.java5 symbols
flipper-native/android/src/main/java/tech/bam/rnperformance/flipper/FlipperPerformancePluginModule.java5 symbols
flipper-desktop/src/Report.tsx5 symbols
example/android/app/src/debug/java/com/example/ReactNativeFlipper.java5 symbols

For agents

$ claude mcp add react-native-flipper-performance-monitor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page