Skip to content

Commit e64985b

Browse files
authored
chore: update react-native to 0.59.x (#77)
1 parent a10dd2f commit e64985b

30 files changed

+1440
-730
lines changed

.eslintrc

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
2-
"extends": "callstack-io",
2+
"extends": "@callstack",
33
"rules": {
4-
"import/no-named-as-default": 0
4+
"import/no-named-as-default": 0,
5+
"react-native/no-raw-text": {
6+
"skip": ["Subheading"]
7+
},
8+
"jest/no-disabled-tests": 0,
9+
"react-native/no-color-literals": 0
510
}
6-
}
11+
}

.flowconfig

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
; Flow definitions from Paper not compatible with RN 0.58.x and flow 0.86.0
3030
.*/node_modules/react-native-paper/.*
3131
.*/node_modules/realm/node_modules/license-checker/
32+
; Figure out how to make it pass
33+
.*/node_modules/react-native-vector-icons/.*
3234

3335
[include]
3436

3537
[libs]
3638
node_modules/react-native/Libraries/react-native/react-native-interface.js
3739
node_modules/react-native/flow/
38-
node_modules/react-native/flow-github/
3940
node_modules/react-navigation/flow/react-navigation.js
4041
flow-typed/.*
4142

@@ -84,4 +85,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
8485
unnecessary-optional-chain=error
8586

8687
[version]
87-
^0.86.0
88+
^0.92.0

android/app/build.gradle

+8-2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ def enableProguardInReleaseBuilds = true
9696
android {
9797
compileSdkVersion rootProject.ext.compileSdkVersion
9898

99+
compileOptions {
100+
sourceCompatibility JavaVersion.VERSION_1_8
101+
targetCompatibility JavaVersion.VERSION_1_8
102+
}
103+
99104
defaultConfig {
100105
applicationId rootProject.ext.applicationId
101106
minSdkVersion rootProject.ext.minSdkVersion
@@ -108,7 +113,7 @@ android {
108113
reset()
109114
enable enableSeparateBuildPerCPUArchitecture
110115
universalApk false // If true, also generate a universal APK
111-
include "armeabi-v7a", "x86"
116+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
112117
}
113118
}
114119
buildTypes {
@@ -126,7 +131,7 @@ android {
126131
variant.outputs.each { output ->
127132
// For each separate APK per architecture, set a unique version code as described here:
128133
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129-
def versionCodes = ["armeabi-v7a":1, "x86":2]
134+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
130135
def abi = output.getFilter(OutputFile.ABI)
131136
if (abi != null) { // null for the universal-debug, universal-release variants
132137
output.versionCodeOverride =
@@ -137,6 +142,7 @@ android {
137142
}
138143

139144
dependencies {
145+
implementation project(':@react-native-community_async-storage')
140146
implementation fileTree(dir: "libs", include: ["*.jar"])
141147
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142148
implementation "com.facebook.react:react-native:+" // From node_modules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
8+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="false">localhost</domain>
5+
<domain includeSubdomains="false">10.0.2.2</domain>
6+
<domain includeSubdomains="false">10.0.3.2</domain>
7+
</domain-config>
8+
</network-security-config>

android/app/src/main/AndroidManifest.xml

-14
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,8 @@
22
xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
65
<uses-permission android:name="android.permission.INTERNET"/>
76

8-
<!-- Remove unnecessary permissions that RN is adding, see the issue here:
9-
https://github.com/facebook/react-native/issues/5886 -->
10-
<uses-permission
11-
android:name="android.permission.READ_PHONE_STATE"
12-
tools:node="remove"/>
13-
<uses-permission
14-
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
15-
tools:node="remove"/>
16-
<uses-permission
17-
android:name="android.permission.READ_EXTERNAL_STORAGE"
18-
tools:node="remove"/>
19-
20-
217
<application
228
android:name=".MainApplication"
239
android:allowBackup="false"

android/app/src/main/java/com/fnp/dziku/MainApplication.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Application;
44

55
import com.facebook.react.ReactApplication;
6+
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
67
import com.reactcommunity.rnlocalize.RNLocalizePackage;
78
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
89
import com.bugsnag.BugsnagReactNative;
@@ -29,6 +30,7 @@ public boolean getUseDeveloperSupport() {
2930
protected List<ReactPackage> getPackages() {
3031
return Arrays.<ReactPackage>asList(
3132
new MainReactPackage(),
33+
new AsyncStoragePackage(),
3234
new RNGestureHandlerPackage(),
3335
BugsnagReactNative.getPackage(),
3436
new RealmReactPackage(),

android/app/src/release/AndroidManifest.xml

-9
This file was deleted.

android/build.gradle

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ buildscript {
55
applicationId = "com.fnp.dziku"
66
versionCode = 10
77
versionName = "0.1.0"
8+
buildToolsVersion = "28.0.3"
89
minSdkVersion = 16
910
compileSdkVersion = 28
10-
targetSdkVersion = 27
11+
targetSdkVersion = 28
1112
supportLibVersion = "28.0.0"
1213
}
1314
repositories {
1415
google()
1516
jcenter()
1617
}
1718
dependencies {
18-
classpath 'com.android.tools.build:gradle:3.3.1'
19+
classpath 'com.android.tools.build:gradle:3.3.2'
1920

2021
// NOTE: Do not place your application dependencies here; they belong
2122
// in the individual module build.gradle files
@@ -33,9 +34,3 @@ allprojects {
3334
}
3435
}
3536
}
36-
37-
38-
task wrapper(type: Wrapper) {
39-
gradleVersion = '4.4'
40-
distributionUrl = distributionUrl.replace("bin", "all")
41-
}

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

android/settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
rootProject.name = 'Dziku'
2+
include ':@react-native-community_async-storage'
3+
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
24
include ':react-native-gesture-handler'
35
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
46
include ':bugsnag-react-native'

config/setupTests.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ jest.mock('react-navigation-backhandler', () => ({
2323
jest.mock('react-native-localize', () => ({
2424
findBestAvailableLanguage: () => 'en',
2525
}));
26+
jest.mock('@react-native-community/async-storage', () => ({
27+
setItem: jest.fn(),
28+
}));

0 commit comments

Comments
 (0)