Skip to content

Commit f9375be

Browse files
authored
Merge pull request Expensify#81691 from callstack-internal/timing-module-deprecate
chore: deprecate timing.ts
2 parents 51fc673 + 7d5bf9b commit f9375be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+31
-762
lines changed

__mocks__/react-native.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// eslint-disable-next-line no-restricted-imports
22
import * as ReactNative from 'react-native';
3-
import type StartupTimer from '@libs/StartupTimer/types';
43

54
jest.doMock('react-native', () => {
65
let url = 'https://new.expensify.com/';
@@ -28,7 +27,6 @@ jest.doMock('react-native', () => {
2827
logoSizeRatio: number;
2928
navigationBarHeight: number;
3029
};
31-
StartupTimer: StartupTimer;
3230
};
3331
Linking: typeof ReactNative.Linking & {
3432
setInitialURL: (newUrl: string) => void;
@@ -47,7 +45,6 @@ jest.doMock('react-native', () => {
4745
logoSizeRatio: 1,
4846
navigationBarHeight: 0,
4947
},
50-
StartupTimer: {stop: jest.fn()},
5148
},
5249
Linking: {
5350
...ReactNative.Linking,

android/app/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apply plugin: "com.android.application"
22
apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
4-
apply plugin: "com.google.firebase.firebase-perf"
54
apply plugin: "fullstory"
65
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
76

@@ -245,7 +244,6 @@ dependencies {
245244

246245
// Firebase libraries (using the Firebase BoM for consistency - see https://firebase.google.com/docs/android/learn-more#bom)
247246
implementation platform("com.google.firebase:firebase-bom:29.0.3")
248-
implementation "com.google.firebase:firebase-perf"
249247
implementation "com.google.firebase:firebase-crashlytics"
250248

251249
// GIF support

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,5 @@
44

55
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
66
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS"/>
7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning">
8-
<meta-data
9-
android:name="firebase_performance_logcat_enabled"
10-
android:value="true"
11-
/>
12-
</application>
7+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
138
</manifest>

android/app/src/main/java/com/expensify/chat/ExpensifyAppPackage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public List<NativeModule> createNativeModules(
2121
ReactApplicationContext reactContext) {
2222
List<NativeModule> modules = new ArrayList<>();
2323

24-
modules.add(new StartupTimer(reactContext));
2524
modules.add(new ShareActionHandlerModule(reactContext));
2625
modules.add(new AppStateTrackerModule(reactContext));
2726

android/app/src/main/java/com/expensify/chat/MainApplication.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ class MainApplication : MultiDexApplication(), ReactApplication {
7474
val sharedI18nUtilInstance = I18nUtil.instance
7575
sharedI18nUtilInstance.allowRTL(applicationContext, false)
7676

77-
// Start the "js_load" custom performance tracing metric. This timer is stopped by a native
78-
// module in the JS so we can measure total time starting in the native layer and ending in
79-
// the JS layer.
80-
StartupTimer.start()
81-
8277
// Increase SQLite DB write size
8378
try {
8479
val field = CursorWindow::class.java.getDeclaredField("sCursorWindowSize")

android/app/src/main/java/com/expensify/chat/StartupTimer.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

android/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ buildscript {
3030
classpath("com.facebook.react:react-native-gradle-plugin")
3131
classpath("com.google.gms:google-services:4.3.4")
3232
classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1")
33-
classpath("com.google.firebase:perf-plugin:1.4.1")
3433
// Fullstory integration
3534
classpath ("com.fullstory:gradle-plugin-local:1.64.2")
3635

ios/AppDelegate.swift

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ import ReactAppDependencyProvider
1212
import ExpoModulesCore
1313
import Firebase
1414
import Expo
15-
15+
1616
@main
1717
class AppDelegate: ExpoAppDelegate, UNUserNotificationCenterDelegate {
1818
var window: UIWindow?
1919
var reactNativeDelegate: ExpoReactNativeFactoryDelegate?
2020
var reactNativeFactory: RCTReactNativeFactory?
21-
21+
2222
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
2323
let delegate = ReactNativeDelegate()
2424
let factory = RCTReactNativeFactory(delegate: delegate)
2525
delegate.dependencyProvider = RCTAppDependencyProvider()
26-
26+
2727
reactNativeDelegate = delegate
2828
reactNativeFactory = factory
2929
bindReactNativeFactory(factory)
30-
30+
3131
window = UIWindow(frame: UIScreen.main.bounds)
3232
factory.startReactNative(
3333
withModuleName: "NewExpensify",
@@ -36,49 +36,44 @@ class AppDelegate: ExpoAppDelegate, UNUserNotificationCenterDelegate {
3636
)
3737
// Configure firebase
3838
FirebaseApp.configure()
39-
39+
4040
// Force the app to LTR mode.
4141
RCTI18nUtil.sharedInstance().allowRTL(false)
4242
RCTI18nUtil.sharedInstance().forceRTL(false)
43-
43+
4444
_ = super.application(application, didFinishLaunchingWithOptions: launchOptions)
45-
45+
4646
if let rootView = self.window?.rootViewController?.view as? RCTRootView {
4747
RCTBootSplash.initWithStoryboard("BootSplash", rootView: rootView) // <- initialization using the storyboard file name
4848
}
49-
49+
5050
// Define UNUserNotificationCenter
5151
let center = UNUserNotificationCenter.current()
5252
center.delegate = self
53-
54-
// Start the "js_load" custom performance tracing metric. This timer is
55-
// stopped by a native module in the JS so we can measure total time starting
56-
// in the native layer and ending in the JS layer.
57-
RCTStartupTimer.start()
58-
53+
5954
if !UserDefaults.standard.bool(forKey: "isFirstRunComplete") {
6055
UIApplication.shared.applicationIconBadgeNumber = 0
6156
UserDefaults.standard.set(true, forKey: "isFirstRunComplete")
6257
}
6358

6459
RNBackgroundTaskManager.setup()
65-
60+
6661
return true
6762
}
68-
69-
63+
64+
7065
override func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
7166
return RCTLinkingManager.application(application, open: url, options: options)
7267
}
73-
68+
7469
override func application(_ application: UIApplication,
7570
continue userActivity: NSUserActivity,
7671
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
7772
return RCTLinkingManager.application(application,
7873
continue: userActivity,
7974
restorationHandler: restorationHandler)
8075
}
81-
76+
8277
// This methods is needed to support the hardware keyboard shortcuts
8378
func keyCommands() -> [Any]? {
8479
return HardwareShortcuts.sharedInstance().keyCommands()
@@ -93,13 +88,13 @@ class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
9388
override func sourceURL(for bridge: RCTBridge) -> URL? {
9489
return self.bundleURL()
9590
}
96-
91+
9792
override func bundleURL() -> URL? {
9893
#if DEBUG
9994
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
10095
#else
10196
return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
10297
#endif
10398
}
104-
99+
105100
}

ios/NewExpensify-Bridging-Header.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
#import "RCTBootSplash.h"
9-
#import "RCTStartupTimer.h"
109
#import <HardwareShortcuts.h>
1110
#import <BackgroundTasks/BackgroundTasks.h>
1211
#import <RNBackgroundTaskManager.h>

ios/NewExpensify.xcodeproj/project.pbxproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
47347EFF2DA5664A00633001 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47347EFE2DA5664A00633001 /* AppDelegate.swift */; };
2828
524F95D57E75496EBD14B0AA /* ExpensifyMono-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = A96F65C6624044318D21DAB1 /* ExpensifyMono-BoldItalic.otf */; };
2929
59164B2F48344A53975791A9 /* CustomEmojiNativeFont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B42BBCC5FB8E4E40B1A9202C /* CustomEmojiNativeFont.ttf */; };
30-
7041848526A8E47D00E09F4D /* RCTStartupTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7041848426A8E47D00E09F4D /* RCTStartupTimer.m */; };
3130
70CF6E82262E297300711ADC /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 70CF6E81262E297300711ADC /* BootSplash.storyboard */; };
3231
7F9DD8DA2B2A445B005E3AFA /* ExpError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F9DD8D92B2A445B005E3AFA /* ExpError.swift */; };
3332
7FB680AE2CC94EDA006693CF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7FB680AD2CC94EDA006693CF /* GoogleService-Info.plist */; };
@@ -118,8 +117,6 @@
118117
67D096CE2C3CB125AAC20F11 /* Pods-NotificationServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-NotificationServiceExtension/Pods-NotificationServiceExtension.debug.xcconfig"; sourceTree = "<group>"; };
119118
6E887A8466FD8FE3B8A0F396 /* Pods_NewExpensify.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NewExpensify.framework; sourceTree = BUILT_PRODUCTS_DIR; };
120119
6FFAB4E4A2A56FFA9B6357B3 /* Pods-NewExpensify.debugdevelopment.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NewExpensify.debugdevelopment.xcconfig"; path = "Target Support Files/Pods-NewExpensify/Pods-NewExpensify.debugdevelopment.xcconfig"; sourceTree = "<group>"; };
121-
7041848326A8E40900E09F4D /* RCTStartupTimer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTStartupTimer.h; path = NewExpensify/RCTStartupTimer.h; sourceTree = "<group>"; };
122-
7041848426A8E47D00E09F4D /* RCTStartupTimer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTStartupTimer.m; path = NewExpensify/RCTStartupTimer.m; sourceTree = "<group>"; };
123120
70CF6E81262E297300711ADC /* BootSplash.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = BootSplash.storyboard; path = NewExpensify/BootSplash.storyboard; sourceTree = "<group>"; };
124121
7F3784A22C75103800063508 /* NewExpensifyDebugDevelopment.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = NewExpensifyDebugDevelopment.entitlements; path = NewExpensify/NewExpensifyDebugDevelopment.entitlements; sourceTree = "<group>"; };
125122
7F3784A32C75129D00063508 /* NewExpensifyDebugAdHoc.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = NewExpensifyDebugAdHoc.entitlements; path = NewExpensify/NewExpensifyDebugAdHoc.entitlements; sourceTree = "<group>"; };
@@ -279,8 +276,6 @@
279276
F0C450E92705020500FD2970 /* colors.json */,
280277
DD7904292792E76D004484B4 /* RCTBootSplash.h */,
281278
DD79042A2792E76D004484B4 /* RCTBootSplash.mm */,
282-
7041848326A8E40900E09F4D /* RCTStartupTimer.h */,
283-
7041848426A8E47D00E09F4D /* RCTStartupTimer.m */,
284279
18D050DF262400AF000D658B /* BridgingFile.swift */,
285280
13B07FAE1A68108700A75B9A /* NewExpensify */,
286281
832341AE1AAA6A7D00B99B32 /* Libraries */,
@@ -705,13 +700,11 @@
705700
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
706701
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
707702
"${PODS_CONFIGURATION_BUILD_DIR}/EXTaskManager/ExpoTaskManager_privacy.bundle",
708-
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting/FirebaseABTesting_Privacy.bundle",
709703
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore_Privacy.bundle",
710704
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreExtension/FirebaseCoreExtension_Privacy.bundle",
711705
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreInternal/FirebaseCoreInternal_Privacy.bundle",
712706
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics/FirebaseCrashlytics_Privacy.bundle",
713707
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations_Privacy.bundle",
714-
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig_Privacy.bundle",
715708
"${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth/GTMAppAuth_Privacy.bundle",
716709
"${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher_Core_Privacy.bundle",
717710
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
@@ -740,13 +733,11 @@
740733
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
741734
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
742735
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoTaskManager_privacy.bundle",
743-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseABTesting_Privacy.bundle",
744736
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCore_Privacy.bundle",
745737
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreExtension_Privacy.bundle",
746738
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreInternal_Privacy.bundle",
747739
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCrashlytics_Privacy.bundle",
748740
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseInstallations_Privacy.bundle",
749-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseRemoteConfig_Privacy.bundle",
750741
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMAppAuth_Privacy.bundle",
751742
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMSessionFetcher_Core_Privacy.bundle",
752743
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle",
@@ -787,6 +778,7 @@
787778
);
788779
runOnlyForDeploymentPostprocessing = 0;
789780
shellPath = /bin/sh;
781+
shellScript = "";
790782
showEnvVarsInLog = 0;
791783
};
792784
/* End PBXShellScriptBuildPhase section */
@@ -802,7 +794,6 @@
802794
47347EFF2DA5664A00633001 /* AppDelegate.swift in Sources */,
803795
0F5E5350263B73FD004CA14F /* EnvironmentChecker.m in Sources */,
804796
374FB8D728A133FE000D84EF /* OriginImageRequestHandler.mm in Sources */,
805-
7041848526A8E47D00E09F4D /* RCTStartupTimer.m in Sources */,
806797
DD79042B2792E76D004484B4 /* RCTBootSplash.mm in Sources */,
807798
DDCB2E57F334C143AC462B43 /* ExpoModulesProvider.swift in Sources */,
808799
);

0 commit comments

Comments
 (0)