Skip to content

Commit 2b525c8

Browse files
authored
chore: bump react-native to 0.71 (#958)
This commit also removes Detox. Detox keeps breaking with every update and they're really hard to figure out every time. Tests are disabled until we can implement an alternative.
1 parent f804102 commit 2b525c8

File tree

16 files changed

+2171
-2998
lines changed

16 files changed

+2171
-2998
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
run: |
8484
yarn build:e2e:ios
8585
- name: Test
86+
if: false
8687
run: |
8788
yarn test:e2e:ios
8889
macos:
@@ -112,12 +113,16 @@ jobs:
112113
run: |
113114
pod install
114115
working-directory: example/macos
115-
- name: Build and test
116+
- name: Build
117+
run: |
118+
yarn build:e2e:macos
119+
- name: Test
120+
if: false
116121
run: |
117122
yarn test:e2e:macos
118123
windows:
119124
name: Windows
120-
runs-on: windows-2019
125+
runs-on: windows-2022
121126
steps:
122127
- name: Set up MSBuild
123128
uses: microsoft/setup-msbuild@v1.3

.yarnrc.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@ logFilters:
88
level: discard
99
nodeLinker: node-modules
1010
npmRegistryServer: "https://registry.npmjs.org"
11+
packageExtensions:
12+
"@expo/cli@*":
13+
peerDependencies:
14+
"expo-modules-autolinking": "*"
15+
"babel-preset-expo@*":
16+
peerDependencies:
17+
"@babel/core": "^7.0.0-0"
18+
"expo@*":
19+
peerDependencies:
20+
"@babel/core": "^7.0.0-0"
21+
"expo-asset@*":
22+
peerDependencies:
23+
"expo": "*"
1124
yarnPath: .yarn/releases/yarn-3.4.1.cjs

example/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function App(): JSX.Element {
3131
const [iteration, setIteration] = useState(0);
3232
const [currentTest, setCurrentTest] = useState(SCREENS.Functional);
3333

34-
const dismissKeyboard = useCallback(Keyboard.dismiss, []);
34+
const dismissKeyboard = useCallback(() => Keyboard.dismiss(), []);
3535
const simulateRestart = useCallback(
3636
() => setIteration(iteration + 1),
3737
[iteration]

example/android/build.gradle

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ buildscript {
3131

3232
// Mainly for Detox testing for using Next Storage
3333
// when building next, force using next storage
34-
if(gradle.startParameter.getTaskNames().contains("assembleNext")) {
34+
if (gradle.startParameter.getTaskNames().contains("assembleNext")) {
3535
rootProject.setProperty("AsyncStorage_useNextStorage", "true")
3636
}
3737
Boolean nextStorageFlag = rootProject.hasProperty("AsyncStorage_useNextStorage") ? rootProject.properties["AsyncStorage_useNextStorage"] == "true" : false
@@ -50,13 +50,6 @@ buildscript {
5050
}
5151

5252
allprojects {
53-
repositories {
54-
maven {
55-
url("$rootDir/../../node_modules/detox/Detox-android")
56-
}
57-
mavenCentral()
58-
google()
59-
}
6053
afterEvaluate { project ->
6154
def androidExtension = project.extensions.findByName('android')
6255

@@ -86,13 +79,8 @@ allprojects {
8679
}
8780
androidExtension.testBuildType = 'release'
8881
androidExtension.sourceSets.androidTest.java.srcDirs += "$rootDir/app/src/androidTest/java"
89-
if(System.getenv("CIRCLECI") == "true") {
90-
// explicitly apply NDK version available in CI image
91-
androidExtension.ndkVersion = "20.1.5948944"
92-
}
93-
project.dependencies {
94-
androidTestImplementation('com.wix:detox:+')
9582

83+
project.dependencies {
9684
def hermesDir = file('../../node_modules/hermes-engine/android').absolutePath
9785
nextImplementation files("$hermesDir/hermes-release.aar")
9886
}
935 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

example/android/gradlew

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ set -- \
205205
org.gradle.wrapper.GradleWrapperMain \
206206
"$@"
207207

208+
# Stop when "xargs" is not available.
209+
if ! command -v xargs >/dev/null 2>&1
210+
then
211+
die "xargs is not available"
212+
fi
213+
208214
# Use "xargs" to parse quoted args.
209215
#
210216
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

example/android/gradlew.bat

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
43+
if %ERRORLEVEL% equ 0 goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7575

7676
:end
7777
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
78+
if %ERRORLEVEL% equ 0 goto mainEnd
7979

8080
:fail
8181
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8282
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
83+
set EXIT_CODE=%ERRORLEVEL%
84+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
85+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86+
exit /b %EXIT_CODE%
8587

8688
:mainEnd
8789
if "%OS%"=="Windows_NT" endlocal

example/e2e/config.json

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

example/e2e/environment.js

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

example/e2e/jest.setup.js

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

example/examples/Functional.tsx

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ async function execute(steps: TestStep[]): Promise<void> {
8080
function Functional(): JSX.Element {
8181
const [results, setResults] = useState<[string, TestResult?][]>([]);
8282
useEffect(() => {
83-
const results: [string, TestResult?][] = [];
83+
const testResults: [string, TestResult?][] = [];
8484
Promise.resolve()
8585
.then(async () => {
8686
for (const [name, test] of Object.entries(tests)) {
8787
try {
8888
await execute(test);
89-
results.push([name, undefined]);
89+
testResults.push([name, undefined]);
9090
} catch (e: any) {
91-
results.push([name, e]);
91+
testResults.push([name, e]);
9292
}
9393
}
9494
})
@@ -100,15 +100,15 @@ function Functional(): JSX.Element {
100100
const name = currentName + ' with delegate';
101101

102102
if (!AsyncStorageTestSupport?.test_setDelegate) {
103-
results.push([name, SKIP_TEST]);
103+
testResults.push([name, SKIP_TEST]);
104104
continue;
105105
}
106106

107107
const isNativeDelegateSet = await new Promise((resolve) => {
108108
AsyncStorageTestSupport.test_setDelegate(resolve);
109109
});
110110
if (!isNativeDelegateSet) {
111-
results.push([
111+
testResults.push([
112112
name,
113113
{
114114
step: 0,
@@ -121,27 +121,31 @@ function Functional(): JSX.Element {
121121

122122
try {
123123
await execute(test);
124-
results.push([name, undefined]);
124+
testResults.push([name, undefined]);
125125
} catch (e: any) {
126-
results.push([name, e]);
126+
testResults.push([name, e]);
127127
await new Promise((resolve) => {
128128
AsyncStorageTestSupport.test_unsetDelegate(resolve);
129129
});
130130
}
131131
}
132132
})
133-
.then(() => setResults(results));
133+
.then(() => setResults(testResults));
134134
}, []);
135135
return (
136-
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
136+
<ScrollView contentContainerStyle={styles.container}>
137137
<View>
138138
{results.map(([name, result]) => {
139139
const testID = 'test:' + name;
140140
if (!result) {
141141
return (
142142
<View key={name} style={styles.passed}>
143143
<Text style={styles.testLabel}>{name}</Text>
144-
<Text accessibilityLabel="Pass" testID={testID}>
144+
<Text
145+
accessibilityLabel="Pass"
146+
testID={testID}
147+
style={styles.testResult}
148+
>
145149
Pass
146150
</Text>
147151
</View>
@@ -152,7 +156,11 @@ function Functional(): JSX.Element {
152156
return (
153157
<View key={name} style={styles.skipped}>
154158
<Text style={styles.testLabel}>{name}</Text>
155-
<Text accessibilityLabel="Skip" testID={testID}>
159+
<Text
160+
accessibilityLabel="Skip"
161+
testID={testID}
162+
style={styles.testResult}
163+
>
156164
Skip
157165
</Text>
158166
</View>
@@ -163,9 +171,15 @@ function Functional(): JSX.Element {
163171
<View key={name} style={styles.failed}>
164172
<Text style={styles.testLabel}>{name}</Text>
165173
<View accessibilityLabel="Fail" testID={testID}>
166-
<Text>{`Step: ${result.step + 1}`}</Text>
167-
<Text>{`Expected: ${stringify(result.expected)}`}</Text>
168-
<Text>{`Actual: ${result.actual}`}</Text>
174+
<Text style={styles.testResult}>{`Step: ${
175+
result.step + 1
176+
}`}</Text>
177+
<Text style={styles.testResult}>{`Expected: ${stringify(
178+
result.expected
179+
)}`}</Text>
180+
<Text
181+
style={styles.testResult}
182+
>{`Actual: ${result.actual}`}</Text>
169183
</View>
170184
</View>
171185
);
@@ -176,6 +190,9 @@ function Functional(): JSX.Element {
176190
}
177191

178192
const styles = StyleSheet.create({
193+
container: {
194+
flexGrow: 1,
195+
},
179196
failed: {
180197
backgroundColor: '#e53935',
181198
flex: 1,
@@ -193,8 +210,12 @@ const styles = StyleSheet.create({
193210
padding: 4,
194211
},
195212
testLabel: {
213+
color: '#000000',
196214
flex: 1,
197215
},
216+
testResult: {
217+
color: '#000000',
218+
},
198219
});
199220

200221
export default {

0 commit comments

Comments
 (0)