Skip to content

Commit 2063bc2

Browse files
authored
Merge pull request #50 from BreakOutEvent/upgrade-react-native
Upgrade react native, make optimized 64bit build
2 parents 0528139 + 0b4e3ea commit 2063bc2

30 files changed

Lines changed: 4124 additions & 3152 deletions

.flowconfig

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
; We fork some components by platform
33
.*/*[.]android.js
44

5+
; Ignore templates for 'react-native init'
6+
<PROJECT_ROOT>/template/.*
7+
8+
; Ignore the Dangerfile
9+
<PROJECT_ROOT>/bots/dangerfile.js
10+
511
; Ignore "BUCK" generated dirs
612
<PROJECT_ROOT>/\.buckd/
713

@@ -16,16 +22,50 @@
1622
; Ignore polyfills
1723
.*/Libraries/polyfills/.*
1824

25+
; These should not be required directly
26+
; require from fbjs/lib instead: require('fbjs/lib/warning')
27+
.*/node_modules/warning/.*
28+
29+
; Flow doesn't support platforms
30+
.*/Libraries/Utilities/HMRLoadingView.js
31+
32+
[untyped]
33+
.*/node_modules/@react-native-community/cli/.*/.*
34+
1935
[include]
2036

2137
[libs]
22-
node_modules/react-native/Libraries/react-native/react-native-interface.js
23-
node_modules/react-native/flow/
38+
Libraries/react-native/react-native-interface.js
39+
flow/
2440

2541
[options]
2642
emoji=true
2743

44+
esproposal.optional_chaining=enable
45+
esproposal.nullish_coalescing=enable
46+
47+
module.file_ext=.js
48+
module.file_ext=.json
49+
module.file_ext=.ios.js
50+
2851
module.system=haste
52+
module.system.haste.use_name_reducers=true
53+
# keep the following in sync with server/haste/hasteImpl.js
54+
# get basename
55+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
56+
# strip .js or .js.flow suffix
57+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
58+
# strip .ios suffix
59+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
60+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
61+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
62+
module.system.haste.paths.blacklist=.*/__tests__/.*
63+
module.system.haste.paths.blacklist=.*/__mocks__/.*
64+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/Libraries/.*
65+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/RNTester/.*
66+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/IntegrationTests/.*
67+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js
68+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Animated/src/polyfills/.*
2969

3070
munge_underscores=true
3171

@@ -35,14 +75,32 @@ suppress_type=$FlowIssue
3575
suppress_type=$FlowFixMe
3676
suppress_type=$FlowFixMeProps
3777
suppress_type=$FlowFixMeState
38-
suppress_type=$FixMe
3978

40-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
41-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
42-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
79+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
80+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
4381
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4482

45-
unsafe.enable_getters_and_setters=true
83+
[lints]
84+
sketchy-null-number=warn
85+
sketchy-null-mixed=warn
86+
sketchy-number=warn
87+
untyped-type-import=warn
88+
nonstrict-import=warn
89+
deprecated-type=warn
90+
unsafe-getters-setters=warn
91+
inexact-spread=warn
92+
unnecessary-invariant=warn
93+
signature-verification-failure=warn
94+
deprecated-utility=error
95+
96+
[strict]
97+
deprecated-type
98+
nonstrict-import
99+
sketchy-null
100+
unclear-type
101+
unsafe-getters-setters
102+
untyped-import
103+
untyped-type-import
46104

47105
[version]
48-
^0.56.0
106+
^0.98.0

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ buck-out/
4141
\.buckd/
4242
*.keystore
4343

44+
# CocoaPods
45+
/ios/Pods/
46+
4447
# fastlane
4548
#
4649
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
@@ -51,5 +54,5 @@ buck-out/
5154
*/fastlane/report.xml
5255
*/fastlane/Preview.html
5356
*/fastlane/screenshots
54-
node_modules/
55-
app/secrets/secrets.js
57+
node_modules/
58+
app/secrets/secrets.js

android/app/build.gradle

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
apply plugin: "com.android.application"
21
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
2+
apply plugin: "com.android.application"
33

44
import com.android.build.OutputFile
55

@@ -78,7 +78,6 @@ project.ext.react = [
7878
]
7979

8080
apply from: "../../node_modules/react-native/react.gradle"
81-
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
8281

8382
/**
8483
* Set this to true to create two separate APKs instead of one:
@@ -88,6 +87,7 @@ apply from: "../../node_modules/react-native-sentry/sentry.gradle"
8887
* Upload all the APKs to the Play Store and people will download
8988
* the correct one based on the CPU architecture of their device.
9089
*/
90+
def useIntlJsc = false
9191
def enableSeparateBuildPerCPUArchitecture = false
9292

9393
/**
@@ -103,8 +103,8 @@ android {
103103
applicationId "org.break_out.breakout"
104104
minSdkVersion rootProject.ext.minSdkVersion
105105
targetSdkVersion rootProject.ext.targetSdkVersion
106-
versionCode 50
107-
versionName "50"
106+
versionCode 52
107+
versionName "52"
108108
ndk {
109109
abiFilters "armeabi-v7a", "x86"
110110
}
@@ -141,7 +141,7 @@ android {
141141
variant.outputs.each { output ->
142142
// For each separate APK per architecture, set a unique version code as described here:
143143
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
144-
def versionCodes = ["armeabi-v7a":1, "x86":2]
144+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
145145
def abi = output.getFilter(OutputFile.ABI)
146146
if (abi != null) { // null for the universal-debug, universal-release variants
147147
output.versionCodeOverride =
@@ -152,18 +152,18 @@ android {
152152
}
153153

154154
dependencies {
155-
compile project(':react-native-device-info')
156-
compile project(':rn-fetch-blob')
157-
compile project(':react-native-video')
158-
compile project(':react-native-sentry')
159-
compile project(':react-native-maps')
160-
compile project(':react-native-localization')
161-
compile project(':react-native-image-picker')
162-
compile project(':react-native-onesignal')
155+
implementation project(':react-native-onesignal')
163156
implementation fileTree(dir: "libs", include: ["*.jar"])
164-
implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
165-
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
157+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
158+
implementation 'androidx.appcompat:appcompat:1.0.0'
166159
implementation "com.facebook.react:react-native:+" // From node_modules
160+
161+
// JSC from node_modules
162+
if (useIntlJsc) {
163+
implementation 'org.webkit:android-jsc-intl:+'
164+
} else {
165+
implementation 'org.webkit:android-jsc:+'
166+
}
167167
}
168168

169169
// Run this once to be able to run the application with BUCK
@@ -172,3 +172,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
172172
from configurations.compile
173173
into 'libs'
174174
}
175+
176+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/app/proguard-rules.pro

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Copyright (c) Facebook, Inc. and its affiliates.
2-
#
3-
# This source code is licensed under the MIT license found in the
4-
# LICENSE file in the root directory of this source tree.
5-
61
# Add project specific ProGuard rules here.
72
# By default, the flags in this file are appended to flags specified
83
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
@@ -14,59 +9,3 @@
149

1510
# Add any project specific keep options here:
1611

17-
# If your project uses WebView with JS, uncomment the following
18-
# and specify the fully qualified class name to the JavaScript interface
19-
# class:
20-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
21-
# public *;
22-
#}
23-
24-
# Disabling obfuscation is useful if you collect stack traces from production crashes
25-
# (unless you are using a system that supports de-obfuscate the stack traces).
26-
# -dontobfuscate
27-
28-
# React Native
29-
30-
# Keep our interfaces so they can be used by other ProGuard rules.
31-
# See http://sourceforge.net/p/proguard/bugs/466/
32-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
33-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
34-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
35-
36-
# Do not strip any method/class that is annotated with @DoNotStrip
37-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
38-
-keep @com.facebook.common.internal.DoNotStrip class *
39-
-keepclassmembers class * {
40-
@com.facebook.proguard.annotations.DoNotStrip *;
41-
@com.facebook.common.internal.DoNotStrip *;
42-
}
43-
44-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
45-
void set*(***);
46-
*** get*();
47-
}
48-
49-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
50-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
51-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
52-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
53-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
54-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
55-
56-
-dontwarn com.facebook.react.**
57-
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
58-
59-
# okhttp
60-
61-
-keepattributes Signature
62-
-keepattributes *Annotation*
63-
-keep class okhttp3.** { *; }
64-
-keep interface okhttp3.** { *; }
65-
-dontwarn okhttp3.**
66-
67-
# okio
68-
69-
-keep class sun.misc.Unsafe { *; }
70-
-dontwarn java.nio.file.*
71-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
72-
-dontwarn okio.**

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
android:icon="@mipmap/ic_launcher"
2020
android:label="@string/app_name"
2121
android:largeHeap="true"
22-
android:theme="@style/AppTheme">
22+
android:theme="@style/AppTheme"
23+
android:networkSecurityConfig="@xml/network_security_config">
2324
<activity
2425
android:name=".MainActivity"
2526
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

android/app/src/main/java/org/break_out/breakout/MainApplication.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,16 @@
22

33
import android.app.Application;
44

5-
import com.RNFetchBlob.RNFetchBlobPackage;
6-
import com.airbnb.android.react.maps.MapsPackage;
7-
import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;
8-
import com.brentvatne.react.ReactVideoPackage;
5+
import com.facebook.react.PackageList;
96
import com.facebook.react.ReactApplication;
107
import com.facebook.react.ReactNativeHost;
118
import com.facebook.react.ReactPackage;
129
import com.facebook.react.shell.MainReactPackage;
1310
import com.facebook.soloader.SoLoader;
14-
import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage;
15-
import com.imagepicker.ImagePickerPackage;
16-
import com.learnium.RNDeviceInfo.RNDeviceInfo;
1711

1812
import java.util.Arrays;
1913
import java.util.List;
2014

21-
import io.sentry.RNSentryPackage;
2215

2316
public class MainApplication extends Application implements ReactApplication {
2417

@@ -30,17 +23,11 @@ public boolean getUseDeveloperSupport() {
3023

3124
@Override
3225
protected List<ReactPackage> getPackages() {
33-
return Arrays.<ReactPackage>asList(
34-
new MainReactPackage(),
35-
new ReactNativeOneSignalPackage(),
36-
new RNDeviceInfo(),
37-
new RNFetchBlobPackage(),
38-
new ReactVideoPackage(),
39-
new RNSentryPackage(),
40-
new MapsPackage(),
41-
new ReactNativeLocalizationPackage(),
42-
new ImagePickerPackage()
43-
);
26+
@SuppressWarnings("UnnecessaryLocalVariable")
27+
List<ReactPackage> packages = new PackageList(this).getPackages();
28+
// Packages that cannot be autolinked yet can be added manually here, for example:
29+
// packages.add(new MyReactNativePackage());
30+
return packages;
4431
}
4532

4633
@Override
5.64 KB
Loading
3.38 KB
Loading
7.88 KB
Loading
12.8 KB
Loading

0 commit comments

Comments
 (0)