expo-shopify-performance
Version:
Config plugin to setup @shopify/react-native-performance on prebuild
27 lines (26 loc) • 1.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ANDROID = exports.IOS = void 0;
/**
* Constants for the Shopify Performance Expo plugin
*/
exports.IOS = {
/** Import statement for iOS implementation */
IMPORT_STATEMENT: '#import <ReactNativePerformance/ReactNativePerformance.h>',
/** Method call to initialize performance tracking on iOS */
INIT_METHOD_CALL: '[ReactNativePerformance onAppStarted];',
/** Regex to match AppDelegate.h import */
IMPORT_REGEX: /#import "AppDelegate.h"/,
/** Regex to match didFinishLaunchingWithOptions method */
LAUNCH_METHOD_REGEX: /application didFinishLaunchingWithOptions/,
};
exports.ANDROID = {
/** Import statement for Android implementation */
IMPORT_STATEMENT: 'import com.shopify.reactnativeperformance.ReactNativePerformance;',
/** Method call to initialize performance tracking on Android */
INIT_METHOD_CALL: 'ReactNativePerformance.onAppStarted();',
/** Regex to match package declaration */
PACKAGE_REGEX: /^package .*;$/m,
/** Regex to match onCreate method */
ON_CREATE_REGEX: /override fun onCreate/,
};