Skip to content

Commit 8651379

Browse files
author
akhenda
committed
refactor(build): upgrade React Native to v0.56.0
BREAKING CHANGE: upgrade from RN v0.51.0 to v0.56.0 and start using CocoaPods for iOS
1 parent 118b17a commit 8651379

File tree

22 files changed

+5556
-3573
lines changed

22 files changed

+5556
-3573
lines changed

.flowconfig

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,52 @@
1616
; Ignore polyfills
1717
.*/Libraries/polyfills/.*
1818

19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
1922
[include]
2023

2124
[libs]
2225
node_modules/react-native/Libraries/react-native/react-native-interface.js
2326
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
2428

2529
[options]
2630
emoji=true
2731

2832
module.system=haste
33+
module.system.haste.use_name_reducers=true
34+
# get basename
35+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36+
# strip .js or .js.flow suffix
37+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38+
# strip .ios suffix
39+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42+
module.system.haste.paths.blacklist=.*/__tests__/.*
43+
module.system.haste.paths.blacklist=.*/__mocks__/.*
44+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
2946

3047
munge_underscores=true
3148

3249
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'
3350

51+
module.file_ext=.js
52+
module.file_ext=.jsx
53+
module.file_ext=.json
54+
module.file_ext=.native.js
55+
3456
suppress_type=$FlowIssue
3557
suppress_type=$FlowFixMe
3658
suppress_type=$FlowFixMeProps
3759
suppress_type=$FlowFixMeState
38-
suppress_type=$FixMe
3960

40-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
41-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
61+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
62+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
4263
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4364
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4465

45-
unsafe.enable_getters_and_setters=true
46-
4766
[version]
48-
^0.57.0
67+
^0.75.0

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ buck-out/
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
5454

55+
# Bundle artifact
56+
*.jsbundle
57+
5558
# Jest Coverage Directory
5659
coverage/
5760
.env

android/app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ def enableSeparateBuildPerCPUArchitecture = false
100100
def enableProguardInReleaseBuilds = true
101101

102102
android {
103-
compileSdkVersion 27 // upgraded from 23
104-
buildToolsVersion '27.0.2' // upgraded from 26.0.2
103+
compileSdkVersion rootProject.ext.compileSdkVersion
104+
buildToolsVersion rootProject.ext.buildToolsVersion
105105

106106
defaultConfig {
107107
applicationId "com.wapi"
108-
minSdkVersion 18
109-
targetSdkVersion 26
108+
minSdkVersion rootProject.ext.minSdkVersion
109+
targetSdkVersion rootProject.ext.targetSdkVersion
110110
versionCode googleVer
111111
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
112112
multiDexEnabled true
@@ -170,7 +170,7 @@ dependencies {
170170

171171
implementation fileTree(dir: "libs", include: ["*.jar"])
172172
implementation "com.facebook.fresco:animated-gif:1.3.0"
173-
implementation "com.android.support:appcompat-v7:27.0.2" // upgraded from 23.0.1
173+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
174174
implementation "com.facebook.react:react-native:+" // From node_modules
175175

176176
androidTestImplementation(project(path: ":detox"))

android/app/proguard-rules.pro

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,3 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18-
19-
# Disabling obfuscation is useful if you collect stack traces from production crashes
20-
# (unless you are using a system that supports de-obfuscate the stack traces).
21-
-dontobfuscate
22-
23-
# React Native
24-
25-
# Keep our interfaces so they can be used by other ProGuard rules.
26-
# See http://sourceforge.net/p/proguard/bugs/466/
27-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30-
31-
# Do not strip any method/class that is annotated with @DoNotStrip
32-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33-
-keep @com.facebook.common.internal.DoNotStrip class *
34-
-keepclassmembers class * {
35-
@com.facebook.proguard.annotations.DoNotStrip *;
36-
@com.facebook.common.internal.DoNotStrip *;
37-
}
38-
39-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40-
void set*(***);
41-
*** get*();
42-
}
43-
44-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
46-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
47-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
48-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50-
51-
-dontwarn com.facebook.react.**
52-
53-
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54-
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55-
-dontwarn android.text.StaticLayout
56-
57-
# okhttp
58-
59-
-keepattributes Signature
60-
-keepattributes *Annotation*
61-
-keep class okhttp3.** { *; }
62-
-keep interface okhttp3.** { *; }
63-
-dontwarn okhttp3.**
64-
65-
# okio
66-
67-
-keep class sun.misc.Unsafe { *; }
68-
-dontwarn java.nio.file.*
69-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70-
-dontwarn okio.**

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.wapi"
3-
android:versionCode="1"
4-
android:versionName="1.0">
2+
package="com.wapi">
53

64
<uses-permission android:name="android.permission.INTERNET" />
75
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -18,16 +16,12 @@
1816
android:name="android.permission.ACCESS_FINE_LOCATION"
1917
android:protectionLevel="signature"/>
2018

21-
<uses-sdk
22-
android:minSdkVersion="16"
23-
android:targetSdkVersion="22" />
24-
2519
<application
2620
android:name=".MainApplication"
2721
android:largeHeap="true"
28-
android:allowBackup="true"
2922
android:label="@string/app_name"
3023
android:icon="@mipmap/ic_launcher"
24+
android:allowBackup="false"
3125
android:theme="@style/AppTheme">
3226
<activity
3327
android:name=".SplashActivity"
9.12 KB
Loading
5.1 KB
Loading
13.6 KB
Loading
24.1 KB
Loading
-11 KB
Loading

0 commit comments

Comments
 (0)