Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit c96fafc

Browse files
IjzerenHeinSalakar
authored andcommitted
Upgrade to react-native-firebase v5.0.0 and react-native 0.57.1 (#61)
* Upgrade to RN57.1 * Upgraded to latest Firebase dependencies * Upgraded to react-native-firebase 5.0.0 * Removed package-lock.json (for those ppl that use yarn) * Excluded lock files * Fixed android build * Updated index.js to default version * Minor updates to sync the project as close to a fresh RN generated project as possible * Disabled Invites pod on iOS because of misconfiguration exception * Bump Crashlytics pods * XCode 10 auto-added several AppIcon assets * Auto updates of XCode 10 + removed Invites files * Disabled new XCode 10 build system due to incompatibility issues which have not yet been resolved in RN57 * Added script to build Android APKs * Revert back to RN 0.57.1, as 0.57.2 contains a regression causing the bundler to now work out of the box facebook/react-native#21490 * [android] update firebase sdk versions * [android] update to gradle v4.6 * replace old logo * misc js changes
1 parent c4840c0 commit c96fafc

File tree

38 files changed

+659
-10243
lines changed

38 files changed

+659
-10243
lines changed

.babelrc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
{
2-
"presets": [
3-
"babel-preset-react-native-stage-0/decorator-support"
4-
],
5-
"env": {
6-
"development": {
7-
"plugins": [
8-
"transform-react-jsx-source"
9-
]
10-
}
11-
}
12-
}
2+
"presets": ["module:metro-react-native-babel-preset"]
3+
}

.flowconfig

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@ node_modules/react-native/flow-github/
2929
[options]
3030
emoji=true
3131

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

3450
munge_underscores=true
3551

@@ -51,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5167
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5268

5369
[version]
54-
^0.67.0
70+
^0.78.0

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ buck-out/
6161
/ios/Pods/
6262
# google-services.json
6363
# GoogleService-Info.plist
64+
65+
# RNFirebaseStarter
66+
yarn.lock
67+
package-lock.json

App.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@ import firebase from 'react-native-firebase';
66
export default class App extends React.Component {
77
constructor() {
88
super();
9-
this.state = {
10-
// firebase things?
11-
};
9+
this.state = {};
1210
}
1311

14-
componentDidMount() {
15-
// firebase things?
12+
async componentDidMount() {
13+
// TODO: You: Do firebase things
14+
// const { user } = await firebase.auth().signInAnonymously();
15+
// console.warn('User -> ', user.toJSON());
16+
17+
// await firebase.analytics().logEvent('foo', { bar: '123'});
1618
}
1719

1820
render() {
1921
return (
2022
<ScrollView>
2123
<View style={styles.container}>
22-
<Image source={require('./assets/RNFirebase.png')} style={[styles.logo]}/>
24+
<Image source={require('./assets/ReactNativeFirebase.png')} style={[styles.logo]}/>
2325
<Text style={styles.welcome}>
2426
Welcome to {'\n'} React Native Firebase
2527
</Text>
@@ -71,8 +73,9 @@ const styles = StyleSheet.create({
7173
logo: {
7274
height: 120,
7375
marginBottom: 16,
74-
marginTop: 32,
75-
width: 120,
76+
marginTop: 64,
77+
padding: 10,
78+
width: 135,
7679
},
7780
welcome: {
7881
fontSize: 20,

android/app/build.gradle

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ android {
105105
dexOptions {
106106
javaMaxHeapSize "4g"
107107
}
108-
compileSdkVersion 27
108+
compileSdkVersion rootProject.ext.compileSdkVersion
109+
buildToolsVersion rootProject.ext.buildToolsVersion
109110

110111
defaultConfig {
111112
applicationId "com.invertase.rnfirebasestarter"
112-
minSdkVersion 18
113-
targetSdkVersion 27
113+
minSdkVersion rootProject.ext.minSdkVersion
114+
targetSdkVersion rootProject.ext.targetSdkVersion
114115
versionCode 1
115116
versionName "1.0"
116117
ndk {
@@ -157,33 +158,33 @@ dependencies {
157158
transitive = false
158159
}
159160

160-
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
161+
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
161162
transitive = true
162163
}
163164

164165
// RNFirebase required dependencies
165-
implementation "com.google.firebase:firebase-core:16.0.1"
166-
implementation "com.google.android.gms:play-services-base:15.0.1"
166+
implementation "com.google.firebase:firebase-core:16.0.4"
167+
implementation "com.google.android.gms:play-services-base:16.0.1"
167168

168169
// RNFirebase optional dependencies
169170
implementation "com.google.firebase:firebase-ads:15.0.1"
170-
implementation "com.google.firebase:firebase-auth:16.0.2"
171-
implementation "com.google.firebase:firebase-config:16.0.0"
172-
implementation "com.google.firebase:firebase-crash:16.0.1"
173-
implementation "com.google.firebase:firebase-database:16.0.1"
174-
implementation "com.google.firebase:firebase-firestore:17.0.2"
175-
implementation "com.google.firebase:firebase-functions:16.0.1"
176-
implementation "com.google.firebase:firebase-invites:16.0.1"
177-
implementation "com.google.firebase:firebase-storage:16.0.1"
178-
implementation "com.google.firebase:firebase-messaging:17.1.0"
179-
implementation "com.google.firebase:firebase-perf:16.0.0"
180-
171+
implementation "com.google.firebase:firebase-analytics:16.0.4"
172+
implementation "com.google.firebase:firebase-auth:16.0.4"
173+
implementation "com.google.firebase:firebase-config:16.0.1"
174+
implementation "com.google.firebase:firebase-database:16.0.3"
175+
implementation "com.google.firebase:firebase-firestore:17.1.1"
176+
implementation "com.google.firebase:firebase-functions:16.1.1"
177+
implementation "com.google.firebase:firebase-invites:16.0.4"
178+
implementation "com.google.firebase:firebase-storage:16.0.3"
179+
implementation "com.google.firebase:firebase-messaging:17.3.3"
180+
implementation "com.google.firebase:firebase-perf:16.1.2"
181+
182+
//noinspection GradleDynamicVersion
181183
implementation "com.facebook.react:react-native:+"
182-
implementation "com.android.support:appcompat-v7:27.1.1"
183-
implementation 'com.android.support:support-annotations:27.1.1'
184+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
185+
implementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
184186

185187
implementation fileTree(dir: "libs", include: ["*.jar"])
186-
implementation "com.facebook.react:react-native:+" // From node_modules
187188
}
188189

189190
// Run this once to be able to run the application with BUCK

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/java/com/invertase/rnfirebasestarter/MainApplication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
1616
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
1717
import io.invertase.firebase.config.RNFirebaseRemoteConfigPackage;
18-
import io.invertase.firebase.crash.RNFirebaseCrashPackage;
1918
import io.invertase.firebase.database.RNFirebaseDatabasePackage;
2019
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage;
2120
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
@@ -50,7 +49,6 @@ protected List<ReactPackage> getPackages() {
5049
new RNFirebaseAnalyticsPackage(),
5150
new RNFirebaseAuthPackage(),
5251
new RNFirebaseRemoteConfigPackage(),
53-
new RNFirebaseCrashPackage(),
5452
new RNFirebaseCrashlyticsPackage(),
5553
new RNFirebaseDatabasePackage(),
5654
new RNFirebaseFirestorePackage(),
-362 Bytes
Loading
4.91 KB
Loading
-110 Bytes
Loading

0 commit comments

Comments
 (0)