Skip to content

Commit

Permalink
upgrade react-native to 0.60
Browse files Browse the repository at this point in the history
* update yarn.lock after rebase

* merge project.pbxproj with version from develop branch

* misc changes:
 - replace deprecated react-native-sentry by @sentry/react-native
 - remove LibRCTGeolocation
 - fix iOS linking of react-native-netinfo
 - update references to cardano rust libs

* bump react-redux to 7.2

* move to cocoapods

* throw on null keystore data and small updates

* do not call Sentry.crash() on unexpected errors
  • Loading branch information
v-almonacid committed Jul 6, 2020
1 parent ccd51df commit badeff4
Show file tree
Hide file tree
Showing 43 changed files with 3,377 additions and 4,189 deletions.
51 changes: 39 additions & 12 deletions .flowconfig
Expand Up @@ -11,17 +11,23 @@
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
node_modules/react-native/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*
node_modules/react-native/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*
; 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/HMRLoadingView.js

; Ignore findup (storybook dependency)
.*/node_modules/findup/test/.*

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

; Ignore @ledgerhq/react-native-hw-transport-ble
.*/node_modules/@ledgerhq/react-native-hw-transport-ble/src/BleTransport.js
.*/node_modules/@ledgerhq/react-native-hw-transport-ble/lib/BleTransport.js.flow
Expand All @@ -36,17 +42,17 @@ node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
flow/declarations/

[lints]
sketchy-null=warn
sketchy-number=warn

[options]
include_warnings=true
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
Expand All @@ -62,6 +68,7 @@ module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*


munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
Expand All @@ -77,12 +84,32 @@ suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
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

server.max_workers=1

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
nonstrict-import=warn
deprecated-type=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error
unnecessary-optional-chain=warn

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.92.0
^0.98.0
62 changes: 32 additions & 30 deletions android/app/build.gradle
Expand Up @@ -18,6 +18,9 @@ import com.android.build.OutputFile
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
Expand Down Expand Up @@ -83,7 +86,7 @@ project.ext.envConfigFiles = [
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"

/**
* Set this to true to create two separate APKs instead of one:
Expand All @@ -103,6 +106,15 @@ def enableProguardInReleaseBuilds = false
def Properties properties = new Properties()
properties.load(project.rootProject.file("gradle.properties.local").newDataInputStream())

/**
* Use international variant JavaScriptCore
* International variant includes ICU i18n library and necessary data allowing to use
* e.g. Date.toLocaleString and String.localeCompare that give correct results
* when using with locales other than en-US.
* Note that this variant is about 6MiB larger per architecture than default.
*/
def useIntlJsc = false

android {
compileSdkVersion rootProject.ext.compileSdkVersion

Expand All @@ -123,8 +135,15 @@ android {
// detox setup
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
missingDimensionStrategy 'react-native-camera', 'general'
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
Expand All @@ -143,6 +162,9 @@ android {
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
Expand Down Expand Up @@ -183,47 +205,26 @@ android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a":3, "x86_64":4]
// https://developer.android.com/studio/build/configure-apk-splits.html
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
}
}
}
// jsc-android
packagingOptions {
pickFirst '**/libjsc.so'
pickFirst '**/libc++_shared.so'
}
}

dependencies {
implementation "org.webkit:android-jsc:r241213"
implementation project(':react-native-ble-plx')
implementation project(':react-native-chain-libs')
implementation project(':react-native-device-info')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-cardano')
implementation project(':react-native-sentry')
implementation project(':react-native-local-resource')
implementation project(':react-native-config')
implementation project(':react-native-splash-screen')
implementation project(':react-native-camera')
implementation project(':react-native-randombytes')
implementation project(':react-native-fs')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-svg')
implementation project(':react-native-webview')
// implementation project(':@ledgerhq_react-native-hid')
implementation project(':@v-almonacid_react-native-hid')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation "com.facebook.react:react-native:+" // From node_modules

implementation project(':react-native-background-timer')
implementation "com.google.android.gms:play-services-base:15.0.1"
// JSC from node_modules
if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'
} else {
implementation 'org.webkit:android-jsc:+'
}

// detox setup
androidTestImplementation('com.wix:detox:+') {
Expand Down Expand Up @@ -266,3 +267,4 @@ tasks.whenTaskAdded { task ->
}

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
10 changes: 1 addition & 9 deletions android/app/proguard-rules.pro
Expand Up @@ -9,12 +9,4 @@

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}


-keep class com.emurgo.BuildConfig { *; }
-keep class com.emurgo.BuildConfig { *; }
4 changes: 0 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Expand Up @@ -42,9 +42,5 @@
android:exported="true">
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false"
/>
</application>
</manifest>
49 changes: 10 additions & 39 deletions android/app/src/main/java/com/emurgo/MainApplication.java
Expand Up @@ -2,27 +2,11 @@

import android.app.Application;

import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.polidea.reactnativeble.BlePackage;
import io.emurgo.chainlibs.ChainLibsPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import io.sentry.RNSentryPackage;
import com.igorbelyayev.rnlocalresource.RNLocalResourcePackage;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import io.crossroad.rncardano.CardanoPackage;
import org.reactnative.camera.RNCameraPackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.rnfs.RNFSPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.horcrux.svg.SvgPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.ledgerwallet.hid.ReactHIDPackage;

import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
Expand All @@ -38,27 +22,14 @@ public boolean getUseDeveloperSupport() {

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new BlePackage(),
new ChainLibsPackage(),
new RNDeviceInfo(),
new AsyncStoragePackage(),
new RNSentryPackage(),
new RNLocalResourcePackage(),
new ReactNativeConfigPackage(),
new SplashScreenReactPackage(),
new CardanoPackage(),
new RNCameraPackage(),
new RandomBytesPackage(),
new RNFSPackage(),
new LinearGradientPackage(),
new SvgPackage(),
new KeyStorePackage(),
new BackgroundTimerPackage(),
new RNCWebViewPackage(),
new ReactHIDPackage()
);

@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new ChainLibsPackage());
// packages.add(new CardanoPackage());
packages.add(new KeyStorePackage());
return packages;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/styles.xml
Expand Up @@ -3,6 +3,7 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
</style>

</resources>
14 changes: 7 additions & 7 deletions android/build.gradle
Expand Up @@ -33,19 +33,19 @@ allprojects {
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// All of Detox' artifacts are provided via the npm module
url "$rootDir/../node_modules/detox/Detox-android"
url("$rootDir/../node_modules/detox/Detox-android")
}
// react-native-ble-plx setup
// https://github.com/Polidea/react-native-ble-plx (@2.0.0)
maven { url 'https://jitpack.io' }
// jsc-android setup
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
}
}

Expand Down
8 changes: 0 additions & 8 deletions android/keystores/BUCK

This file was deleted.

4 changes: 0 additions & 4 deletions android/keystores/debug.keystore.properties

This file was deleted.

37 changes: 1 addition & 36 deletions android/settings.gradle
@@ -1,40 +1,5 @@
rootProject.name = 'emurgo'
include ':react-native-ble-plx'
project(':react-native-ble-plx').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ble-plx/android')
include ':react-native-chain-libs'
project(':react-native-chain-libs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-chain-libs/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-sentry'
project(':react-native-sentry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentry/android')
include ':react-native-local-resource'
project(':react-native-local-resource').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-local-resource/android')
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-cardano'
project(':react-native-cardano').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cardano/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-background-timer'
project(':react-native-background-timer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-timer/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
// include ':@ledgerhq_react-native-hid'
// project(':@ledgerhq_react-native-hid').projectDir = new File(rootProject.projectDir, '../node_modules/@ledgerhq/react-native-hid/android')
include ':@v-almonacid_react-native-hid'
project(':@v-almonacid_react-native-hid').projectDir = new File(rootProject.projectDir, '../node_modules/@v-almonacid/react-native-hid/android')

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

include ':app'

0 comments on commit badeff4

Please sign in to comment.