Skip to content
Permalink
Browse files

Upgrade to React Native 0.60

  • Loading branch information...
axemclion committed Jul 8, 2019
1 parent 95b74c9 commit 1105b27e3c905ef9063224ae8a79e85b189fa6ad
@@ -97,6 +97,12 @@ post-install:
fi
@sed -i'' -e 's|transform: \[{scaleY: -1}\],|...Platform.select({android: {transform: \[{perspective: 1}, {scaleY: -1}\]}, ios: {transform: \[{scaleY: -1}\]}}),|g' node_modules/react-native/Libraries/Lists/VirtualizedList.js

@# Need to fix bottom sheet since this is the version that can be jetified. Looks like something else is pulling in 1.3.1.
@find "node_modules/react-native-bottom-sheet/android" -name "build.gradle" -exec sed -i '' s/com\.cocosw:bottomsheet:1\.\+\@aar/com\.cocosw:bottomsheet:1\.\3\.0\@aar/g {} +

@# Run Jetifier, so that compat libraries in all dependencies are converted to AndroidX
node_modules/.bin/jetify

start: | pre-run ## Starts the React Native packager server
$(call start_packager)

@@ -105,6 +105,15 @@ def enableSeparateBuildPerCPUArchitecture = false
*/
def enableProguardInReleaseBuilds = false

/**
* Use international variant JavaScriptCore
* International variant includes ICU i18n library and necessary data allowing to use
* e.g. Date.toLocaleString and String.localeCompare that give correct results
* when using with locales other than en-US.
* Note that this variant is about 6MiB larger per architecture than default.
*/
def useIntlJsc = false

android {
compileSdkVersion rootProject.ext.compileSdkVersion

@@ -214,7 +223,7 @@ dependencies {
implementation "org.webkit:android-jsc-intl:r241213"

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:percent:28.0.0'
implementation "com.google.firebase:firebase-messaging:17.3.0"
@@ -259,3 +268,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
}

apply plugin: 'com.google.gms.google-services'
// apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@@ -1,7 +1,9 @@
package com.mattermost.rnbeta;

import android.os.Bundle;
import android.support.annotation.Nullable;

import androidx.annotation.Nullable;

import com.reactnativenavigation.controllers.SplashActivity;

public class MainActivity extends SplashActivity {
@@ -1,61 +1,58 @@
package com.mattermost.rnbeta;

import com.mattermost.share.SharePackage;
import com.mattermost.share.RealPathUtil;

import android.app.Activity;
import android.support.annotation.NonNull;
import android.content.Context;
import android.os.Bundle;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import android.util.Log;

import com.reactnativedocumentpicker.ReactNativeDocumentPicker;
import com.oblador.keychain.KeychainPackage;
import com.reactlibrary.RNReactNativeDocViewerPackage;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.BV.LinearGradient.LinearGradientPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.ReactMarkerConstants;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.soloader.SoLoader;
import com.gantix.JailMonkey.JailMonkeyPackage;
import com.gnet.bottomsheet.RNBottomSheetPackage;
import com.horcrux.svg.SvgPackage;
import com.imagepicker.ImagePickerPackage;
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;
import io.sentry.RNSentryPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.gantix.JailMonkey.JailMonkeyPackage;
import io.tradle.react.LocalAuthPackage;
import com.mattermost.share.RealPathUtil;
import com.mattermost.share.SharePackage;
import com.oblador.keychain.KeychainPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.philipphecht.RNDocViewerPackage;
import com.psykar.cookiemanager.CookieManagerPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;

import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;

import com.imagepicker.ImagePickerPackage;
import com.gnet.bottomsheet.RNBottomSheetPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.psykar.cookiemanager.CookieManagerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.reactnativedocumentpicker.ReactNativeDocumentPicker;
import com.reactnativenavigation.NavigationApplication;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import com.wix.reactnativenotifications.core.notificationdrawer.IPushNotificationsDrawer;
import com.wix.reactnativenotifications.core.notificationdrawer.INotificationsDrawerApplication;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import com.wix.reactnativenotifications.core.notificationdrawer.INotificationsDrawerApplication;
import com.wix.reactnativenotifications.core.notificationdrawer.IPushNotificationsDrawer;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.ReactMarkerConstants;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import android.support.annotation.Nullable;
import java.io.File;
import java.util.Arrays;
import java.util.List;

import android.util.Log;
import io.sentry.RNSentryPackage;
import io.tradle.react.LocalAuthPackage;

public class MainApplication extends NavigationApplication implements INotificationsApplication, INotificationsDrawerApplication {
public NotificationsLifecycleFacade notificationsLifecycleFacade;
@@ -96,7 +93,7 @@ public boolean isDebug() {
new ReactNativeExceptionHandlerPackage(),
new ReactNativeYouTube(),
new ReactVideoPackage(),
new RNReactNativeDocViewerPackage(),
new RNDocViewerPackage(),
new ReactNativeDocumentPicker(),
new SharePackage(this),
new KeychainPackage(),
@@ -8,10 +8,16 @@
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import androidx.annotation.Nullable;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.WritableMap;
import com.mattermost.react_native_interface.ResolvePromise;
import com.wix.reactnativenotifications.core.NotificationIntentAdapter;

import java.io.IOException;

import okhttp3.Call;
@@ -21,12 +27,6 @@
import okhttp3.RequestBody;
import okhttp3.Response;

import com.mattermost.react_native_interface.ResolvePromise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.WritableMap;

import com.wix.reactnativenotifications.core.NotificationIntentAdapter;

public class NotificationReplyBroadcastReceiver extends BroadcastReceiver {
private Context mContext;
private Bundle bundle;
@@ -1,25 +1,22 @@
package com.mattermost.rnbeta;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.Log;
import java.lang.System;

import okhttp3.Call;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

import org.json.JSONObject;
import org.json.JSONException;
import androidx.annotation.Nullable;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.WritableMap;

import com.mattermost.react_native_interface.ResolvePromise;

import org.json.JSONException;
import org.json.JSONObject;

import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;

public class ReceiptDelivery {
static final String CURRENT_SERVER_URL = "@currentServerUrl";

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
<androidx.percentlayout.widget.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -16,4 +16,4 @@
android:adjustViewBounds="true"
android:src="@drawable/splash" />

</android.support.percent.PercentRelativeLayout>
</androidx.percentlayout.widget.PercentRelativeLayout>
@@ -13,7 +13,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath("com.android.tools.build:gradle:3.4.1")
classpath 'com.google.gms:google-services:4.2.0'

// NOTE: Do not place your application dependencies here; they belong
@@ -41,7 +41,7 @@ allprojects {
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Local Maven repo containing AARs with JSC library built for Android
@@ -20,3 +20,7 @@ org.gradle.jvmargs=-Xmx2048M

#android.enableAapt2=false
#android.useDeprecatedNdk=true

android.useAndroidX=true
android.enableJetifier=true

@@ -1,13 +1,15 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {networkStatusChangedAction} from 'redux-offline';
//import {networkStatusChangedAction} from 'redux-offline';

import {DeviceTypes} from 'app/constants';

export function connection(isOnline) {
return async (dispatch) => {
dispatch(networkStatusChangedAction(isOnline));
// FIX ME - networkStatusChangedAction is no longer exported in Redux offline.
// So this needs to be replaced with a newer API
//dispatch(networkStatusChangedAction(isOnline));
dispatch({
type: DeviceTypes.CONNECTION_CHANGED,
data: isOnline,
@@ -20,7 +20,7 @@ import {getSiteUrl, setSiteUrl} from 'app/utils/image_cache_manager';
import {createSentryMiddleware} from 'app/utils/sentry/middleware';

import mattermostBucket from 'app/mattermost_bucket';

import detectNetwork from 'app/utils/detectNetwork.js';
import {messageRetention} from './middleware';
import {createThunkMiddleware} from './thunk';
import {transformSet} from './utils';
@@ -133,6 +133,7 @@ export default function configureAppStore(initialState) {
);

const offlineOptions = {
detectNetwork, // Need to add this, since starting RN 0.60, NetInfo is not a part of RN core
effect: (effect, action) => {
if (typeof effect !== 'function') {
throw new Error('Offline Action: effect must be a function.');

0 comments on commit 1105b27

Please sign in to comment.
You can’t perform that action at this time.