Skip to content

Commit 3afa341

Browse files
authored
Merge pull request Expensify#66230 from software-mansion-labs/war-in/bump-react-native-performance
[No QA] Bump `react-native-performance` & fix hybridApp soft exceptions
2 parents 008d496 + 81416cf commit 3afa341

6 files changed

Lines changed: 53 additions & 35 deletions

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ PODS:
21392139
- ReactCommon/turbomodule/bridging
21402140
- ReactCommon/turbomodule/core
21412141
- Yoga
2142-
- react-native-performance (5.1.0):
2142+
- react-native-performance (5.1.4):
21432143
- DoubleConversion
21442144
- glog
21452145
- hermes-engine
@@ -3816,7 +3816,7 @@ SPEC CHECKSUMS:
38163816
react-native-netinfo: 6aa96b58130ce8de834c2f6c00878b69703d9e10
38173817
react-native-pager-view: 21fa9c2dc9ba43370132b0c996eaeaefd2be4be0
38183818
react-native-pdf: 65f142fbddbb7ef4ee51c5e3bf2a03d24f507c11
3819-
react-native-performance: 025cfdaddd31efee1e334b15924a04f5497d9702
3819+
react-native-performance: 1e0b1e3a80e665fb392c658d5639d26a015efbdd
38203820
react-native-plaid-link-sdk: d82ea6d7f8065e82d9ea8cf6abf3cf4914da8b5c
38213821
react-native-release-profiler: 4dbd61f2e1ebc2b11cfa5a03511bbc88fda5a25b
38223822
react-native-safe-area-context: 00d03dc688ba86664be66f9e3f203fc7d747d899

package-lock.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"react-native-onyx": "^2.0.117",
182182
"react-native-pager-view": "6.5.3",
183183
"react-native-pdf": "6.7.3",
184-
"react-native-performance": "^5.1.0",
184+
"react-native-performance": "^5.1.4",
185185
"react-native-permissions": "^5.4.0",
186186
"react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#07d60d78d4772d47afd7a744940fc6b6d1881806",
187187
"react-native-plaid-link-sdk": "11.11.0",

patches/react-native-performance+5.1.0+001+bridgeless.patch

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `react-native-performance` patches
2+
3+
### [react-native-performance+5.1.4+001+fix-soft-crash-by-checking-for-active-react-instance.patch](react-native-performance+5.1.4+001+fix-soft-crash-by-checking-for-active-react-instance.patch)
4+
5+
- Reason:
6+
7+
```
8+
`react-native-performance` emits some events using `RCTDeviceEventEmitter` on Android. Emitter should be used only after react instance has been created.
9+
Otherwise, soft exception is thrown:
10+
11+
```
12+
raiseSoftException(callWithExistingReactInstance(callFunctionOnModule("RCTDeviceEventEmitter", "emit"))): Execute: reactInstance is null. Dropping work.
13+
```
14+
```
15+
16+
- Upstream PR/issue: https://github.com/oblador/react-native-performance/pull/117
17+
- E/App issue: https://github.com/Expensify/App/issues/66231
18+
- PR introducing patch: https://github.com/Expensify/App/pull/66230
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java b/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java
2+
index 4a187bb..66c94ee 100644
3+
--- a/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java
4+
+++ b/node_modules/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java
5+
@@ -187,7 +187,7 @@ public class PerformanceModule extends ReactContextBaseJavaModule implements Tur
6+
WritableMap map = Arguments.fromBundle(metric.getDetail());
7+
params.putMap("detail", map);
8+
}
9+
- if (getReactApplicationContext().hasActiveCatalystInstance()) {
10+
+ if (getReactApplicationContext().hasActiveReactInstance()) {
11+
getReactApplicationContext()
12+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
13+
.emit("metric", params);
14+
@@ -202,9 +202,11 @@ public class PerformanceModule extends ReactContextBaseJavaModule implements Tur
15+
WritableMap map = Arguments.fromBundle(mark.getDetail());
16+
params.putMap("detail", map);
17+
}
18+
- getReactApplicationContext()
19+
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20+
- .emit("mark", params);
21+
+ if (getReactApplicationContext().hasActiveReactInstance()) {
22+
+ getReactApplicationContext()
23+
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
24+
+ .emit("mark", params);
25+
+ }
26+
}
27+
28+
@Override

0 commit comments

Comments
 (0)