Skip to content

Commit 142348f

Browse files
committed
chore: bump react-native to 0.71
1 parent ba98315 commit 142348f

File tree

11 files changed

+2230
-2615
lines changed

11 files changed

+2230
-2615
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
yarn test:e2e:macos
118118
windows:
119119
name: Windows
120-
runs-on: windows-2019
120+
runs-on: windows-2022
121121
steps:
122122
- name: Set up MSBuild
123123
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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ allprojects {
8686
}
8787
androidExtension.testBuildType = 'release'
8888
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-
}
89+
9390
project.dependencies {
9491
androidTestImplementation('com.wix:detox:+')
9592

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/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 {

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"prepare": "bob build",
4444
"start": "react-native start",
4545
"start:android": "react-native run-android",
46-
"start:ios": "react-native run-ios --project-path example/ios",
46+
"start:ios": "react-native run-ios",
4747
"start:macos": "react-native run-macos --project-path example/macos --scheme AsyncStorageExample",
48-
"start:web": "expo start:web",
48+
"start:web": "expo start --web",
4949
"start:windows": "install-windows-test-app -p example/windows && react-native run-windows --root example --logging --no-packager --no-telemetry",
5050
"build:e2e:android": "scripts/android_e2e.sh 'build'",
5151
"build:e2e:ios": "scripts/ios_e2e.sh 'build'",
@@ -73,27 +73,26 @@
7373
"@semantic-release/changelog": "^6.0.0",
7474
"@semantic-release/git": "^10.0.0",
7575
"@types/lodash": "^4.14.184",
76-
"@types/react": "^17.0.0",
77-
"@types/react-native": "^0.68.0",
76+
"@types/react": "^18.0.0",
7877
"concurrently": "^6.4.0",
79-
"detox": "^19.4.5",
78+
"detox": "^20.7.0",
8079
"eslint": "^8.0.0",
81-
"expo": "^45.0.0",
82-
"jest": "^26.6.3",
83-
"jest-circus": "^26.6.1",
80+
"expo": "^48.0.0",
81+
"jest": "^29.2.1",
82+
"jest-circus": "^29.2.1",
8483
"lodash": "^4.17.21",
8584
"prettier": "^2.5.1",
86-
"react": "17.0.2",
87-
"react-dom": "17.0.2",
88-
"react-native": "^0.68.0",
85+
"react": "18.2.0",
86+
"react-dom": "^18.2.0",
87+
"react-native": "^0.71.0",
8988
"react-native-builder-bob": "^0.18.0",
90-
"react-native-macos": "^0.68.0",
91-
"react-native-test-app": "^2.3.10",
92-
"react-native-web": "^0.17.0",
93-
"react-native-windows": "^0.68.0",
94-
"react-test-renderer": "17.0.2",
89+
"react-native-macos": "^0.71.0",
90+
"react-native-test-app": "^2.2.1",
91+
"react-native-web": "~0.18.10",
92+
"react-native-windows": "^0.71.0",
93+
"react-test-renderer": "18.2.0",
9594
"semantic-release": "^19.0.0",
96-
"typescript": "^4.5.0"
95+
"typescript": "^4.9.4"
9796
},
9897
"packageManager": "yarn@3.4.1",
9998
"resolutions": {
@@ -115,7 +114,7 @@
115114
"binaryPath": "example/ios/build/Build/Products/Release-iphonesimulator/ReactTestApp.app",
116115
"type": "ios.simulator",
117116
"device": {
118-
"type": "iPhone 13"
117+
"type": "iPhone 14"
119118
}
120119
},
121120
"android.emu.release": {

0 commit comments

Comments
 (0)