Skip to content

Commit d697c08

Browse files
authored
fix: fix compatibility with latest expo versions (#76)
* Revert "feat(native): add expo compatibility for android (#56)" This reverts commit 647489a. * apply change in expo plugin * add expo example
1 parent e62aa3a commit d697c08

File tree

21 files changed

+22066
-54
lines changed

21 files changed

+22066
-54
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"eslint": "^7.32.0",
2222
"jest": "^26.6.3",
2323
"metro-react-native-babel-preset": "0.72.3",
24-
"react-native-flipper-performance-plugin": "^0.3.1",
24+
"react-native-flipper-performance-plugin": "0.4.0-rc.0",
2525
"react-test-renderer": "18.1.0"
2626
},
2727
"jest": {

example/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5429,10 +5429,10 @@ react-native-codegen@^0.70.5:
54295429
jscodeshift "^0.13.1"
54305430
nullthrows "^1.1.1"
54315431

5432-
react-native-flipper-performance-plugin@^0.3.1:
5433-
version "0.3.1"
5434-
resolved "https://registry.yarnpkg.com/react-native-flipper-performance-plugin/-/react-native-flipper-performance-plugin-0.3.1.tgz#969aea65eb6e6504ee29caab7bf546c75322f817"
5435-
integrity sha512-NDf5VCTqYPUUihvmW5A/scJbjHWZpAxC9FE1kfgFCPsHENjH9EVJxk+7XlLN608dEtHOtZdcWY0HZZT8XLjr6Q==
5432+
react-native-flipper-performance-plugin@0.4.0-rc.0:
5433+
version "0.4.0-rc.0"
5434+
resolved "https://registry.yarnpkg.com/react-native-flipper-performance-plugin/-/react-native-flipper-performance-plugin-0.4.0-rc.0.tgz#0039c0357c98bc88f82ab11145247bbe11609de5"
5435+
integrity sha512-TfXZroMcYbmSQgSVUAwFewDE4G3jbcLK4NdqzP3h1dgF4eaC6Kddj5fRdtlxMYL/ufnKowaANHT/U59dbMNa2w==
54365436

54375437
react-native-gradle-plugin@^0.70.3:
54385438
version "0.70.3"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3+
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4+
}

expo-example/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules/
2+
.expo/
3+
dist/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
13+
# macOS
14+
.DS_Store
15+
android
16+
ios

expo-example/App.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { SafeAreaView, Text, TouchableOpacity, View } from "react-native";
2+
3+
import {
4+
killJSThread,
5+
killUIThread,
6+
} from "react-native-flipper-performance-plugin";
7+
8+
const Button = ({ title, onPress, style, testID }) => (
9+
<TouchableOpacity
10+
style={[
11+
{
12+
padding: 10,
13+
borderRadius: 10,
14+
justifyContent: "center",
15+
alignItems: "center",
16+
},
17+
style,
18+
]}
19+
testID={testID}
20+
onPress={onPress}
21+
>
22+
<Text style={{ fontSize: 40, color: "white" }}>{title}</Text>
23+
</TouchableOpacity>
24+
);
25+
26+
const App = () => {
27+
return (
28+
<SafeAreaView style={{ flex: 1 }}>
29+
<View
30+
style={{
31+
padding: 20,
32+
height: "50%",
33+
justifyContent: "center",
34+
alignItems: "center",
35+
backgroundColor: "#eee",
36+
}}
37+
>
38+
<Button
39+
title={"KILL JS ☠️"}
40+
testID="com.example/kill_js"
41+
onPress={() => killJSThread(40)}
42+
style={{ marginBottom: 40, backgroundColor: "#1565c0" }}
43+
/>
44+
<Button
45+
title={"KILL UI ☠️"}
46+
testID="com.example/kill_ui"
47+
onPress={() => killUIThread(40)}
48+
style={{ backgroundColor: "#7b1fa2" }}
49+
/>
50+
</View>
51+
</SafeAreaView>
52+
);
53+
};
54+
55+
export default App;

expo-example/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Expo example
2+
3+
```
4+
npm install
5+
npx expo prebuild --clean
6+
npx expo run:android
7+
npx expo run:ios
8+
```

expo-example/app.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"expo": {
3+
"name": "expo-example",
4+
"slug": "expo-example",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"splash": {
10+
"image": "./assets/splash.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#ffffff"
13+
},
14+
"updates": {
15+
"fallbackToCacheTimeout": 0
16+
},
17+
"assetBundlePatterns": [
18+
"**/*"
19+
],
20+
"ios": {
21+
"supportsTablet": true,
22+
"bundleIdentifier": "com.almouro.expoexample"
23+
},
24+
"android": {
25+
"adaptiveIcon": {
26+
"foregroundImage": "./assets/adaptive-icon.png",
27+
"backgroundColor": "#FFFFFF"
28+
},
29+
"package": "com.almouro.expoexample"
30+
},
31+
"web": {
32+
"favicon": "./assets/favicon.png"
33+
},
34+
"extra": {
35+
"eas": {
36+
"projectId": "03cf08d6-d843-40ca-9033-343a7fd51364"
37+
}
38+
},
39+
"plugins": [
40+
[
41+
"expo-community-flipper"
42+
],
43+
[
44+
"react-native-flipper-performance-plugin"
45+
]
46+
]
47+
}
48+
}
17.1 KB
Loading

expo-example/assets/favicon.png

1.43 KB
Loading

expo-example/assets/icon.png

21.9 KB
Loading

0 commit comments

Comments
 (0)