Skip to content

Commit

Permalink
update react-native and project dependencies
Browse files Browse the repository at this point in the history
Fix all prop-type and react-create-class errors
Fix breaking changes in dependencies
update rn-nodeify
Resolve XCode project merge conflicts
Add firebase to Pods
  • Loading branch information
yenda committed Dec 8, 2017
1 parent 2bd7652 commit 25ec360
Show file tree
Hide file tree
Showing 46 changed files with 2,108 additions and 1,640 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}
13 changes: 9 additions & 4 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
.*/Libraries/react-native/ReactNative.js
.*/node_modules/jest-runtime/build/__tests__/.*

; Ignore polyfills
.*/Libraries/polyfills/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
node_modules/react-native/flow/
flow/

[options]
Expand All @@ -46,13 +49,15 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

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

unsafe.enable_getters_and_setters=true

[version]
^0.30.0
^0.56.0
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@ ios/StatusIm.xcworkspace
#python
*.pyc
*.cache

# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
14 changes: 11 additions & 3 deletions .re-natal
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"name": "StatusIm",
"interface": "reagent",
"androidHost": "10.0.3.2",
"platforms": {
"ios": {
"host": "localhost",
"modules": []
},
"android": {
"host": "10.0.2.2",
"modules": []
}
},
"modules": [
"react-native-contacts",
"react-native-invertible-scroll-view",
Expand Down Expand Up @@ -49,9 +58,8 @@
"imageDirs": [
"resources/images"
],
"iosHost": "localhost",
"envRoots": {
"dev": "env/dev",
"prod": "env/prod"
}
}
}
27 changes: 25 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand All @@ -57,11 +64,18 @@ import com.android.build.OutputFile
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"]
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
nodeExecutableAndArgs: ["node", "--max-old-space-size=4096"]
nodeExecutableAndArgs: ["node", "--max-old-space-size=4096"],
entryFile: "index.android.js"
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down Expand Up @@ -116,6 +130,15 @@ android {
abiFilters "armeabi-v7a", "x86"
}
}
/**
* Fix for: (https://github.com/ReactiveX/RxJava/issues/4445)
* Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
* > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException:
* Duplicate files copied in APK META-INF/rxjava.properties
*/
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
Expand Down
4 changes: 4 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import android.os.Bundle;

import com.facebook.react.ReactActivity;
import com.cboy.rn.splashscreen.SplashScreen;
import org.devio.rn.splashscreen.SplashScreen;
import com.testfairy.TestFairy;

import java.util.Properties;
Expand Down
17 changes: 14 additions & 3 deletions android/app/src/main/java/im/status/ethereum/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.BV.LinearGradient.LinearGradientPackage;
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.centaurwarchief.smslistener.SmsListenerPackage;
import com.facebook.react.ReactApplication;
import com.horcrux.svg.SvgPackage;
Expand All @@ -14,9 +14,10 @@
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import com.github.yamill.orientation.OrientationPackage;
import com.i18n.reactnativei18n.ReactNativeI18n;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.instabug.reactlibrary.RNInstabugReactnativePackage;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import com.oblador.vectoricons.VectorIconsPackage;
Expand Down Expand Up @@ -68,7 +69,7 @@ protected List<ReactPackage> getPackages() {
new RealmReactPackage(),
new VectorIconsPackage(),
new ReactNativeContacts(),
new ReactNativeI18n(),
new RNI18nPackage(),
new RandomBytesPackage(),
new LinearGradientPackage(),
new RCTCameraPackage(),
Expand All @@ -88,11 +89,21 @@ protected List<ReactPackage> getPackages() {

return packages;
}

@Override
protected String getJSMainModuleName() {
return "index.android";
}
};

@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ allprojects {
maven { url "http://139.162.11.12:8081/artifactory/libs-release-local" }
maven { url "https://jitpack.io" }
}
}
}
8 changes: 8 additions & 0 deletions android/keystores/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
keystore(
name = "debug",
properties = "debug.keystore.properties",
store = "debug.keystore",
visibility = [
"PUBLIC",
],
)
4 changes: 4 additions & 0 deletions android/keystores/debug.keystore.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
key.store=debug.keystore
key.alias=androiddebugkey
key.store.password=android
key.alias.password=android
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ include ':react-native-webview-bridge'
project(':react-native-webview-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-bridge/android')

include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "StatusIm",
"displayName": "StatusIm"
}
9 changes: 7 additions & 2 deletions env/dev/env/android/main.cljs
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
(ns ^:figwheel-no-load env.android.main
(:require [reagent.core :as r]
[re-frisk-remote.core :as rr]
[re-frame.core :as re-frame]
[status-im.android.core :as core]
[figwheel.client :as figwheel :include-macros true]
[re-frisk-remote.core :as rr]
[env.config :as conf]
[status-im.utils.handlers :as utils.handlers]))

(enable-console-print!)

(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?")

(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app-root])
(def root-el (r/as-element [reloader]))

(figwheel/watch-and-reload
:websocket-url "ws://10.0.3.2:3449/figwheel-ws"
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc))

Expand Down
6 changes: 6 additions & 0 deletions env/dev/env/config.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns env.config)

(def figwheel-urls {
:ios "ws://localhost:3449/figwheel-ws"
:android "ws://10.0.2.2:3449/figwheel-ws"
})
29 changes: 19 additions & 10 deletions env/dev/env/ios/main.cljs
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
(ns ^:figwheel-no-load env.ios.main
(:require [reagent.core :as r]
[re-frisk-remote.core :as rr]
[re-frame.core :as re-frame]
[status-im.ios.core :as core]
[status-im.utils.handlers :as utils.handlers]
[figwheel.client :as figwheel :include-macros true]
[cljs.pprint]))
[figwheel.client :as figwheel]
[re-frisk-remote.core :as rr]
[env.config :as conf]))

(enable-console-print!)

(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?")

(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app-root])

;; Do not delete, root-el is used by the figwheel-bridge.js
(def root-el (r/as-element [reloader]))

(figwheel/watch-and-reload
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc))
(defn callback []
(re-frame/clear-subscription-cache!)
(swap! cnt inc)
(status-im.native-module.core/init-jail)
(re-frame/dispatch [:load-commands!]))

(utils.handlers/add-pre-event-callback rr/pre-event-callback)
(figwheel/watch-and-reload
:websocket-url "ws://10.0.1.15:3449/figwheel-ws"
:heads-up-display false
:jsload-callback callback)

(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init})
(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
Loading

0 comments on commit 25ec360

Please sign in to comment.