Unverified Commit a1b1af01 authored by Diego Mello's avatar Diego Mello Committed by GitHub
Browse files

Update RN to 0.59.8 (#896)

* update IOS react native to 0.59.8

* update Android react native to 0.59.8

* fix eslint errors

* Android debug working

* Android build

* Fix lint

* Making jest happy

* Update CircleCI android image

* Fix android build

* Use 32 bits

* Fix iOS build

* Update detox

* Use new Xcode build system

* Use old build system

* Update realm (64 bits support)
parent d3cb4ede
......@@ -90,7 +90,7 @@ jobs:
android-build:
<<: *defaults
docker:
- image: circleci/android:api-28-node8-alpha
- image: circleci/android:api-28-node
environment:
# GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
 
exports[`Storyshots Avatar avatar 1`] = `
<RCTScrollView>
<View>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 25,
"width": 25,
},
undefined,
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 25,
"width": 25,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"priority": "high",
"uri": "baseUrl/avatar/test?format=png&width=50&height=50",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 40,
"width": 40,
},
undefined,
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 40,
"width": 40,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"priority": "high",
"uri": "baseUrl/avatar/aa?format=png&width=50&height=50",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 30,
"width": 30,
},
undefined,
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 30,
"width": 30,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"priority": "high",
"uri": "baseUrl/avatar/bb?format=png&width=50&height=50",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
<View
style={
Array [
Object {
"borderRadius": 2,
"height": 25,
"width": 25,
},
undefined,
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 2,
"height": 25,
"width": 25,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"priority": "high",
"uri": "baseUrl/avatar/test?format=png&width=50&height=50",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
</View>
</RCTScrollView>
`;
exports[`Storyshots Message list 1`] = `
<RCTScrollView
contentContainerStyle={
......
......@@ -95,25 +95,22 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "chat.rocket.reactnative"
minSdkVersion 21
targetSdkVersion 28
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "1.14.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
vectorDrawables.useSupportLibrary = true
}
packagingOptions {
pickFirst '**/libjsc.so'
}
signingConfigs {
release {
if (project.hasProperty('KEYSTORE')) {
......@@ -129,14 +126,11 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
include "armeabi-v7a", "x86", "arm64-v8a", "x86-64"
}
}
buildTypes {
release {
// shrinkResources enableProguardInReleaseBuilds
// zipAlignEnabled enableProguardInReleaseBuilds
// useProguard enableProguardInReleaseBuilds
minifyEnabled enableProguardInReleaseBuilds
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
signingConfig signingConfigs.release
......@@ -147,7 +141,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86-64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
......@@ -180,8 +174,6 @@ repositories {
configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r241213'
eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'play-services-base') {
details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1'
......@@ -219,11 +211,10 @@ dependencies {
implementation project(':realm')
implementation project(':reactnativenotifications')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'org.webkit:android-jsc-cppruntime:+'
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation "com.android.support:appcompat-v7:${ rootProject.ext.supportLibVersion }"
implementation "com.android.support:support-v4:${ rootProject.ext.supportLibVersion }"
implementation "com.android.support:customtabs:${ rootProject.ext.supportLibVersion }"
implementation "com.android.support:design:${ rootProject.ext.supportLibVersion }"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.facebook.fresco:fresco:1.10.0'
implementation 'com.facebook.fresco:animated-gif:1.10.0'
......@@ -244,4 +235,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
\ No newline at end of file
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="chat.rocket.reactnative">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
......@@ -15,7 +15,7 @@
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme"
android:resizeableActivity="true">
>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
......@@ -25,23 +31,19 @@ allprojects {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
}
}
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
targetSdkVersion 28
}
}
}
}
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
targetSdkVersion 28
}
}
}
}
}
\ No newline at end of file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
import React from 'react';
import PropTypes from 'prop-types';
import { View, ViewPropTypes } from 'react-native';
import { View } from 'react-native';
import FastImage from 'react-native-fast-image';
const Avatar = React.memo(({
......@@ -48,7 +48,7 @@ const Avatar = React.memo(({
Avatar.propTypes = {
baseUrl: PropTypes.string.isRequired,
style: ViewPropTypes.style,
style: PropTypes.any,
text: PropTypes.string,
avatar: PropTypes.string,
size: PropTypes.number,
......
import React from 'react';
import { ViewPropTypes, Image } from 'react-native';
import { Image } from 'react-native';
import PropTypes from 'prop-types';
export default class CustomEmoji extends React.Component {
static propTypes = {
baseUrl: PropTypes.string.isRequired,
emoji: PropTypes.object.isRequired,
style: ViewPropTypes.style
style: PropTypes.any
}
shouldComponentUpdate() {
......
import React from 'react';
import PropTypes from 'prop-types';
import { View, ViewPropTypes } from 'react-native';
import { View } from 'react-native';
import { STATUS_COLORS } from '../../constants/colors';
const Status = React.memo(({ status, size, style }) => (
......@@ -20,7 +20,7 @@ const Status = React.memo(({ status, size, style }) => (
Status.propTypes = {
status: PropTypes.string,
size: PropTypes.number,
style: ViewPropTypes.style
style: PropTypes.any
};
Status.defaultProps = {
status: 'offline',
......
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { ViewPropTypes } from 'react-native';
import Status from './Status';
import database, { safeAddListener } from '../../lib/realm';
......@@ -12,7 +11,7 @@ import database, { safeAddListener } from '../../lib/realm';
export default class StatusContainer extends React.PureComponent {
static propTypes = {
id: PropTypes.string,
style: ViewPropTypes.style,
style: PropTypes.any,
size: PropTypes.number,
offline: PropTypes.bool
};
......
import React from 'react';
import {
View, StyleSheet, Text, TextInput, ViewPropTypes
View, StyleSheet, Text, TextInput
} from 'react-native';
import PropTypes from 'prop-types';
import { BorderlessButton } from 'react-native-gesture-handler';
......@@ -73,7 +73,7 @@ export default class RCTextInput extends React.PureComponent {
label: PropTypes.string,
error: PropTypes.object,
secureTextEntry: PropTypes.bool,
containerStyle: ViewPropTypes.style,
containerStyle: PropTypes.any,
inputStyle: PropTypes.object,
inputRef: PropTypes.func,
testID: PropTypes.string,
......
import React from 'react';
import PropTypes from 'prop-types';
import { ViewPropTypes } from 'react-native';
import { KeyboardUtils } from 'react-native-keyboard-input';
import Message from './Message';
......@@ -18,7 +17,7 @@ export default class MessageContainer extends React.Component {
}),
timeFormat: PropTypes.string,
customThreadTimeFormat: PropTypes.string,
style: ViewPropTypes.style,
style: PropTypes.any,
archived: PropTypes.bool,
broadcast: PropTypes.bool,
previousItem: PropTypes.object,
......
import React from 'react';
import PropTypes from 'prop-types';
import { ViewPropTypes } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import scrollPersistTaps from '../utils/scrollPersistTaps';
export default class KeyboardView extends React.PureComponent {
static propTypes = {
style: ViewPropTypes.style,
contentContainerStyle: ViewPropTypes.style,
style: PropTypes.any,
contentContainerStyle: PropTypes.any,
keyboardVerticalOffset: PropTypes.number,
scrollEnabled: PropTypes.bool,
children: PropTypes.oneOfType([
......
......@@ -46,6 +46,12 @@ export default class RoomItem extends React.Component {
avatarSize: 48
}
// Making jest happy: https://github.com/facebook/react-native/issues/22175
// eslint-disable-next-line no-useless-constructor
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
const { lastMessage, _updatedAt } = this.props;
const oldlastMessage = lastMessage;
......
import React from 'react';
import {
Text, View, StyleSheet, ViewPropTypes
} from 'react-native';
import { Text, View, StyleSheet } from 'react-native';
import PropTypes from 'prop-types';
import Avatar from '../containers/Avatar';
......@@ -70,7 +68,7 @@ UserItem.propTypes = {
onPress: PropTypes.func.isRequired,
testID: PropTypes.string.isRequired,
onLongPress: PropTypes.func,
style: ViewPropTypes.style,
style: PropTypes.any,
icon: PropTypes.string
};
......
......@@ -8,7 +8,7 @@ target 'RocketChatRN' do
# Pods for RocketChatRN
# this is very important to have!
rn_path = '../node_modules/react-native'
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'Core',
'RCTActionSheet',
......@@ -32,6 +32,10 @@ target 'RocketChatRN' do
pod 'react-native-orientation-locker', :path => '../node_modules/react-native-orientation-locker'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
end
......
PODS:
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- glog
- glog (0.3.5)
- QBImagePickerController (3.4.0)
- React (0.58.6):
- React/Core (= 0.58.6)
- React (0.59.8):
- React/Core (= 0.59.8)
- react-native-orientation-locker (1.1.5):
- React
- react-native-splash-screen (3.2.0):
- React
- react-native-webview (5.8.1):
- React
- React/Core (0.58.6):
- yoga (= 0.58.6.React)
- React/fishhook (0.58.6)
- React/RCTActionSheet (0.58.6):
- React/Core (0.59.8):
- yoga (= 0.59.8.React)
- React/fishhook (0.59.8)
- React/RCTActionSheet (0.59.8):
- React/Core
- React/RCTAnimation (0.58.6):
- React/RCTAnimation (0.59.8):
- React/Core
- React/RCTBlob (0.58.6):
- React/RCTBlob (0.59.8):
- React/Core
- React/RCTImage (0.58.6):
- React/RCTImage (0.59.8):
- React/Core
- React/RCTNetwork
- React/RCTLinkingIOS (0.58.6):
- React/RCTLinkingIOS (0.59.8):
- React/Core
- React/RCTNetwork (0.58.6):
- React/RCTNetwork (0.59.8):
- React/Core
- React/RCTSettings (0.58.6):
- React/RCTSettings (0.59.8):
- React/Core
- React/RCTText (0.58.6):
- React/RCTText (0.59.8):
- React/Core
- React/RCTVibration (0.58.6):