Skip to content

Commit bcaf152

Browse files
authored
chore: bump react-native to 0.64 (#720)
1 parent b2fd630 commit bcaf152

File tree

13 files changed

+1707
-2868
lines changed

13 files changed

+1707
-2868
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default config for macOS: &macos_defaults
2424
<<: *defaults
2525
resource_class: 'medium'
2626
macos:
27-
xcode: '12.1.0'
27+
xcode: '12.5.1'
2828

2929

3030
config for macOS (android): &macos_defaults_android
@@ -49,11 +49,11 @@ default config for android apk builds: &android_defaults
4949
# ==============================
5050

5151
cache keys:
52-
brew ios: &key_brew_ios cache-brew-ios-v4-{{ arch }}
52+
brew ios: &key_brew_ios cache-brew-ios-v5-{{ arch }}
5353
brew android: &key_brew_android cache-brew-android-v4-{{ arch }}
5454
yarn: &key_yarn cache-yarn-{{ checksum "package.json" }}-{{ arch }}
5555
gradle: &key_gradle cache-gradle-v2-{{ checksum "example/android/gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "package.json" }}-{{ arch }}
56-
pods: &key_pods cache-pods-v1-{{ checksum "example/ios/Podfile" }}-{{ checksum "package.json" }}-{{ arch }}
56+
pods: &key_pods cache-pods-v0.64-{{ checksum "example/ios/Podfile" }}-{{ checksum "package.json" }}-{{ arch }}
5757

5858
cache:
5959
# brew

.flowconfig

+1-10
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
; Ignore polyfills
1212
node_modules/react-native/Libraries/polyfills/.*
1313

14-
; These should not be required directly
15-
; require from fbjs/lib instead: require('fbjs/lib/warning')
16-
node_modules/warning/.*
17-
1814
; Flow doesn't support platforms
1915
.*/Libraries/Utilities/LoadingView.js
2016

@@ -52,10 +48,6 @@ suppress_type=$FlowFixMe
5248
suppress_type=$FlowFixMeProps
5349
suppress_type=$FlowFixMeState
5450

55-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
56-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
57-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
58-
5951
[lints]
6052
sketchy-null-number=warn
6153
sketchy-null-mixed=warn
@@ -66,7 +58,6 @@ deprecated-type=warn
6658
unsafe-getters-setters=warn
6759
unnecessary-invariant=warn
6860
signature-verification-failure=warn
69-
deprecated-utility=error
7061

7162
[strict]
7263
deprecated-type
@@ -78,4 +69,4 @@ untyped-import
7869
untyped-type-import
7970

8071
[version]
81-
^0.122.0
72+
^0.137.0

android/src/test/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersTest.kt

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.reactnativecommunity.asyncstorage.next
22

3+
import com.facebook.react.bridge.JavaOnlyArray
4+
import com.facebook.react.bridge.ReadableArray
35
import com.google.common.truth.Truth.assertThat
46
import org.junit.Assert.assertThrows
57
import org.junit.Test
@@ -11,7 +13,7 @@ class ArgumentHelpersTest {
1113

1214
@Test
1315
fun transformsArgumentsToEntryList() {
14-
val args = createNativeCallArguments(
16+
val args = JavaOnlyArray.of(
1517
arrayListOf("key1", "value1"),
1618
arrayListOf("key2", "value2"),
1719
arrayListOf("key3", "value3")
@@ -28,14 +30,14 @@ class ArgumentHelpersTest {
2830
@Test
2931
fun transfersArgumentsToKeyList() {
3032
val keyList = listOf("key1", "key2", "key3")
31-
val args = createNativeCallArguments("key1", "key2", "key3")
33+
val args = keyList.toReadableArray()
3234
assertThat(args.toKeyList()).isEqualTo(keyList)
3335
}
3436

3537
@Test
3638
fun throwsIfArgumentsNotValidFormat() {
3739
val invalid = arrayListOf("invalid")
38-
val args = createNativeCallArguments(invalid)
40+
val args = JavaOnlyArray.of(invalid)
3941
val error = assertThrows(AsyncStorageError::class.java) {
4042
args.toEntryList()
4143
}
@@ -47,14 +49,14 @@ class ArgumentHelpersTest {
4749

4850
@Test
4951
fun throwsIfArgumentKeyIsNullOrNotString() {
50-
val argsInvalidNull = createNativeCallArguments(arrayListOf(null, "invalid"))
52+
val argsInvalidNull = JavaOnlyArray.of(arrayListOf(null, "invalid"))
5153
val errorArgsInvalidNull = assertThrows(AsyncStorageError::class.java) {
5254
argsInvalidNull.toEntryList()
5355
}
5456
assertThat(errorArgsInvalidNull is AsyncStorageError).isTrue()
5557
assertThat(errorArgsInvalidNull).hasMessageThat().isEqualTo("Key cannot be null.")
5658

57-
val notStringArgs = createNativeCallArguments(arrayListOf(123, "invalid"))
59+
val notStringArgs = JavaOnlyArray.of(arrayListOf(123, "invalid"))
5860
val errorNotString = assertThrows(AsyncStorageError::class.java) {
5961
notStringArgs.toEntryList()
6062
}
@@ -65,7 +67,7 @@ class ArgumentHelpersTest {
6567

6668
@Test
6769
fun throwsIfArgumentValueNotString() {
68-
val invalidArgs = createNativeCallArguments(arrayListOf("my_key", 666))
70+
val invalidArgs = JavaOnlyArray.of(arrayListOf("my_key", 666))
6971
val error = assertThrows(AsyncStorageError::class.java) {
7072
invalidArgs.toEntryList()
7173
}
@@ -75,5 +77,17 @@ class ArgumentHelpersTest {
7577
}
7678
}
7779

78-
79-
80+
fun List<Any?>.toReadableArray(): ReadableArray {
81+
val arr = JavaOnlyArray()
82+
forEach {
83+
when (it) {
84+
null -> arr.pushNull()
85+
is Boolean -> arr.pushBoolean(it)
86+
is Double -> arr.pushDouble(it)
87+
is Int -> arr.pushInt(it)
88+
is String -> arr.pushString(it)
89+
else -> throw NotImplementedError()
90+
}
91+
}
92+
return arr
93+
}

android/src/test/java/com/reactnativecommunity/asyncstorage/next/StorageTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ class AsyncStorageAccessTest {
138138
}
139139
""".trimMargin()
140140
).toString()
141-
}
141+
}

android/src/test/java/com/reactnativecommunity/asyncstorage/next/TestUtils.kt

-84
This file was deleted.

app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"expo": {
33
"entryPoint": "./example/index"
44
}
5-
}
5+
}
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-6.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

metro.config.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33
* integration tests during local development or on CI services.
44
*/
55

6-
const blacklist = require('metro-config/src/defaults/blacklist');
6+
const exclusionList = require("metro-config/src/defaults/exclusionList");
7+
const path = require("path");
78

89
module.exports = {
910
projectRoot: `${__dirname}/example`,
1011
watchFolders: [__dirname],
1112
resolver: {
12-
blacklistRE: blacklist([/node_modules\/react-native-macos\/.*/])
13+
blockList: exclusionList([
14+
// This stops "react-native run-windows" from causing the metro server to crash if its already running
15+
new RegExp(
16+
`${path
17+
.resolve(__dirname, 'example', 'windows')
18+
.replace(/[/\\]/g, '/')}.*`,
19+
),
20+
21+
// Workaround for `EBUSY: resource busy or locked, open '~\msbuild.ProjectImports.zip'`
22+
// when building with `yarn windows --release`
23+
/.*\.ProjectImports\.zip/,
24+
])
1325
},
1426
};

metro.config.macos.js

-21
This file was deleted.

metro.config.windows.js

-56
This file was deleted.

0 commit comments

Comments
 (0)