Skip to content

chore: bump react-native to 0.64 #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ default config for macOS: &macos_defaults
<<: *defaults
resource_class: 'medium'
macos:
xcode: '12.1.0'
xcode: '12.5.1'


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

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

cache:
# brew
Expand Down
11 changes: 1 addition & 10 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

Expand Down Expand Up @@ -52,10 +48,6 @@ suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -66,7 +58,6 @@ deprecated-type=warn
unsafe-getters-setters=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
Expand All @@ -78,4 +69,4 @@ untyped-import
untyped-type-import

[version]
^0.122.0
^0.137.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.reactnativecommunity.asyncstorage.next

import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.ReadableArray
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertThrows
import org.junit.Test
Expand All @@ -11,7 +13,7 @@ class ArgumentHelpersTest {

@Test
fun transformsArgumentsToEntryList() {
val args = createNativeCallArguments(
val args = JavaOnlyArray.of(
arrayListOf("key1", "value1"),
arrayListOf("key2", "value2"),
arrayListOf("key3", "value3")
Expand All @@ -28,14 +30,14 @@ class ArgumentHelpersTest {
@Test
fun transfersArgumentsToKeyList() {
val keyList = listOf("key1", "key2", "key3")
val args = createNativeCallArguments("key1", "key2", "key3")
val args = keyList.toReadableArray()
assertThat(args.toKeyList()).isEqualTo(keyList)
}

@Test
fun throwsIfArgumentsNotValidFormat() {
val invalid = arrayListOf("invalid")
val args = createNativeCallArguments(invalid)
val args = JavaOnlyArray.of(invalid)
val error = assertThrows(AsyncStorageError::class.java) {
args.toEntryList()
}
Expand All @@ -47,14 +49,14 @@ class ArgumentHelpersTest {

@Test
fun throwsIfArgumentKeyIsNullOrNotString() {
val argsInvalidNull = createNativeCallArguments(arrayListOf(null, "invalid"))
val argsInvalidNull = JavaOnlyArray.of(arrayListOf(null, "invalid"))
val errorArgsInvalidNull = assertThrows(AsyncStorageError::class.java) {
argsInvalidNull.toEntryList()
}
assertThat(errorArgsInvalidNull is AsyncStorageError).isTrue()
assertThat(errorArgsInvalidNull).hasMessageThat().isEqualTo("Key cannot be null.")

val notStringArgs = createNativeCallArguments(arrayListOf(123, "invalid"))
val notStringArgs = JavaOnlyArray.of(arrayListOf(123, "invalid"))
val errorNotString = assertThrows(AsyncStorageError::class.java) {
notStringArgs.toEntryList()
}
Expand All @@ -65,7 +67,7 @@ class ArgumentHelpersTest {

@Test
fun throwsIfArgumentValueNotString() {
val invalidArgs = createNativeCallArguments(arrayListOf("my_key", 666))
val invalidArgs = JavaOnlyArray.of(arrayListOf("my_key", 666))
val error = assertThrows(AsyncStorageError::class.java) {
invalidArgs.toEntryList()
}
Expand All @@ -75,5 +77,17 @@ class ArgumentHelpersTest {
}
}



fun List<Any?>.toReadableArray(): ReadableArray {
val arr = JavaOnlyArray()
forEach {
when (it) {
null -> arr.pushNull()
is Boolean -> arr.pushBoolean(it)
is Double -> arr.pushDouble(it)
is Int -> arr.pushInt(it)
is String -> arr.pushString(it)
else -> throw NotImplementedError()
}
}
return arr
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ class AsyncStorageAccessTest {
}
""".trimMargin()
).toString()
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"expo": {
"entryPoint": "./example/index"
}
}
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 14 additions & 2 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
* integration tests during local development or on CI services.
*/

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

module.exports = {
projectRoot: `${__dirname}/example`,
watchFolders: [__dirname],
resolver: {
blacklistRE: blacklist([/node_modules\/react-native-macos\/.*/])
blockList: exclusionList([
// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path
.resolve(__dirname, 'example', 'windows')
.replace(/[/\\]/g, '/')}.*`,
),

// Workaround for `EBUSY: resource busy or locked, open '~\msbuild.ProjectImports.zip'`
// when building with `yarn windows --release`
/.*\.ProjectImports\.zip/,
])
},
};
21 changes: 0 additions & 21 deletions metro.config.macos.js

This file was deleted.

56 changes: 0 additions & 56 deletions metro.config.windows.js

This file was deleted.

Loading