From f0a6ba217ea346ab7c917e942f346ddb23819627 Mon Sep 17 00:00:00 2001 From: Yannick Chiron Date: Thu, 23 Dec 2021 18:21:10 +0100 Subject: [PATCH] feat: Upgrade react-native to `0.66.4` Upgrade react-native from `0.63.4` to `0.66.4` Changes have been applied automatically using https://react-native-community.github.io/upgrade-helper/?from=0.63.4&to=0.66.4 Note: `project.pbxproj` has been replaced and following commits will reapply cozy customizations on it --- .editorconfig | 4 + .flowconfig | 16 +- .gitattributes | 4 +- .gitignore | 1 + .prettierrc.js | 1 + android/app/build.gradle | 24 +- android/app/src/debug/AndroidManifest.xml | 7 +- android/app/src/main/AndroidManifest.xml | 1 - android/app/src/main/res/values/styles.xml | 3 +- android/build.gradle | 15 +- android/gradle.properties | 2 +- android/gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 2 + android/gradlew.bat | 22 +- ios/CozyReactNative-tvOS/Info.plist | 53 - ios/CozyReactNative-tvOSTests/Info.plist | 24 - ios/CozyReactNative.xcodeproj/project.pbxproj | 629 ++---- .../xcschemes/CozyReactNative-tvOS.xcscheme | 88 - .../xcschemes/CozyReactNative.xcscheme | 2 +- ios/CozyReactNative/AppDelegate.m | 6 +- ios/CozyReactNative/Info.plist | 2 - ios/CozyReactNative/LaunchScreen.storyboard | 13 +- ios/Podfile | 24 +- metro.config.js | 2 +- package.json | 2 +- yarn.lock | 1705 +++++++++-------- 27 files changed, 1076 insertions(+), 1578 deletions(-) delete mode 100644 ios/CozyReactNative-tvOS/Info.plist delete mode 100644 ios/CozyReactNative-tvOSTests/Info.plist delete mode 100644 ios/CozyReactNative.xcodeproj/xcshareddata/xcschemes/CozyReactNative-tvOS.xcscheme diff --git a/.editorconfig b/.editorconfig index 150979a0a..6d9e79e5a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,7 @@ trim_trailing_whitespace = true insert_final_newline = true indent_style = space indent_size = 2 + +# Windows files +[*.bat] +end_of_line = crlf diff --git a/.flowconfig b/.flowconfig index b274ad1d6..4320b7070 100644 --- a/.flowconfig +++ b/.flowconfig @@ -8,10 +8,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 @@ -27,8 +23,9 @@ node_modules/react-native/flow/ [options] emoji=true -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable +exact_by_default=true + +format.bracket_spacing=false module.file_ext=.js module.file_ext=.json @@ -44,10 +41,6 @@ suppress_type=$FlowFixMe suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeState -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(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 @@ -58,7 +51,6 @@ deprecated-type=warn unsafe-getters-setters=warn unnecessary-invariant=warn signature-verification-failure=warn -deprecated-utility=error [strict] deprecated-type @@ -70,4 +62,4 @@ untyped-import untyped-type-import [version] -^0.122.0 +^0.158.0 diff --git a/.gitattributes b/.gitattributes index d42ff1835..45a3dcb2a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -*.pbxproj -text +# Windows files should use crlf line endings +# https://help.github.com/articles/dealing-with-line-endings/ +*.bat text eol=crlf diff --git a/.gitignore b/.gitignore index f173101b5..8bf3cdc98 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ build/ .gradle local.properties *.iml +*.hprof # node.js # diff --git a/.prettierrc.js b/.prettierrc.js index 6015616a2..dff8a8318 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -3,5 +3,6 @@ module.exports = { jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', + arrowParens: 'avoid', semi: false, } diff --git a/android/app/build.gradle b/android/app/build.gradle index f7b1e525c..88e7bc63a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+' */ def enableHermes = project.ext.react.get("enableHermes", false); +/** + * Architectures to build native code for in debug. + */ +def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") + android { - compileSdkVersion rootProject.ext.compileSdkVersion + ndkVersion rootProject.ext.ndkVersion - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } + compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { applicationId "com.cozyreactnative" @@ -155,6 +157,11 @@ android { buildTypes { debug { signingConfig signingConfigs.debug + if (nativeArchitectures) { + ndk { + abiFilters nativeArchitectures.split(',') + } + } } release { // Caution! In production, you need to generate your own keystore file. @@ -170,11 +177,12 @@ android { variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html + // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode + defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } @@ -189,7 +197,7 @@ dependencies { implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { - exclude group:'com.facebook.fbjni' + exclude group:'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { @@ -214,7 +222,7 @@ dependencies { // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile + from configurations.implementation into 'libs' } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index ec258b395..4748ead90 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -6,5 +6,10 @@ - + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f6ef024f0..0771b73a3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -28,7 +28,6 @@ - -