[ICU-650] Upgrade React Native to 0.52.2 (#1421)

* Upgrade to React Native 0.52.2

* Bump app version to 1.7.0

* Update fastlane

* Upgrade mattermost redux

* feedback review
This commit is contained in:
enahum 2018-02-07 18:24:01 -03:00 committed by GitHub
parent 509fe37f1f
commit d0f96c0887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 520 additions and 503 deletions

View file

@ -75,13 +75,11 @@ post-install:
@sed -i'' -e 's|"./lib/locales": false|"./lib/locales": "./lib/locales"|g' node_modules/intl-relativeformat/package.json
@sed -i'' -e 's|"./locale-data/complete.js": false|"./locale-data/complete.js": "./locale-data/complete.js"|g' node_modules/intl/package.json
@sed -i'' -e 's|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_FULL_USER);|g' node_modules/react-native-navigation/android/app/src/main/java/com/reactnativenavigation/params/Orientation.java
@sed -i'' -e "s|var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);|var AndroidTextInput = requireNativeComponent('CustomTextInput', null);|g" node_modules/react-native/Libraries/Components/TextInput/TextInput.js
@sed -i'' -e "s|super.onBackPressed();|this.moveTaskToBack(true);|g" node_modules/react-native-navigation/android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java
@if [ $(shell grep "const Platform" node_modules/react-native/Libraries/Lists/VirtualizedList.js | grep -civ grep) -eq 0 ]; then \
sed $ -i'' -e "s|const ReactNative = require('ReactNative');|const ReactNative = require('ReactNative');`echo $\\\\\\r;`const Platform = require('Platform');|g" node_modules/react-native/Libraries/Lists/VirtualizedList.js; \
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
@cd ./node_modules/react-native-svg/ios && rm -rf PerformanceBezier QuartzBookPack && yarn run postinstall
@cd ./node_modules/mattermost-redux && yarn run build
start: | pre-run ## Starts the React Native packager server

View file

@ -107,7 +107,7 @@ android {
minSdkVersion 21
targetSdkVersion 23
versionCode 85
versionName "1.6.0"
versionName "1.7.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"

View file

@ -1,30 +0,0 @@
package com.mattermost.components;
import android.content.Context;
import android.text.InputType;
import com.facebook.react.views.textinput.ReactEditText;
public class CustomTextInput extends ReactEditText {
private boolean autoScroll = false;
public CustomTextInput(Context context) {
super(context);
}
private boolean isMultiline() {
return (getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE) != 0;
}
@Override
public boolean isLayoutRequested() {
if (isMultiline() && !autoScroll) {
return true;
}
return false;
}
public void setAutoScroll(boolean autoScroll) {
this.autoScroll = autoScroll;
}
}

View file

@ -1,35 +0,0 @@
package com.mattermost.components;
import android.text.InputType;
import android.util.TypedValue;
import com.facebook.react.views.textinput.ReactTextInputManager;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewDefaults;
import com.facebook.react.uimanager.annotations.ReactProp;
public class CustomTextInputManager extends ReactTextInputManager {
@Override
public String getName() {
return "CustomTextInput";
}
@Override
public CustomTextInput createViewInstance(ThemedReactContext context) {
CustomTextInput editText = new CustomTextInput(context);
int inputType = editText.getInputType();
editText.setInputType(inputType & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
editText.setReturnKeyType("done");
editText.setTextSize(
TypedValue.COMPLEX_UNIT_PX,
(int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)));
return editText;
}
@ReactProp(name = "autoScroll", defaultBoolean = false)
public void setAutoScroll(CustomTextInput view, boolean autoScroll) {
view.setAutoScroll(autoScroll);
}
}

View file

@ -10,8 +10,6 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.bridge.JavaScriptModule;
import com.mattermost.components.CustomTextInputManager;
public class MattermostPackage implements ReactPackage {
private final MainApplication mApplication;
@ -29,8 +27,6 @@ public class MattermostPackage implements ReactPackage {
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.<ViewManager>asList(
new CustomTextInputManager()
);
return Arrays.<ViewManager>asList();
}
}

View file

@ -11,12 +11,12 @@ export function handleUpdateUserNotifyProps(notifyProps) {
const config = state.entities.general.config;
const {currentUserId} = state.entities.users;
const {interval, user_id, ...otherProps} = notifyProps;
const {interval, user_id: userId, ...otherProps} = notifyProps;
const email = notifyProps.email;
if (config.EnableEmailBatching === 'true' && email !== 'false') {
const emailInterval = [{
user_id,
user_id: userId,
category: Preferences.CATEGORY_NOTIFICATIONS,
name: Preferences.EMAIL_INTERVAL,
value: interval

View file

@ -12,7 +12,7 @@ import {
} from 'react-native';
import OpenFile from 'react-native-doc-viewer';
import RNFetchBlob from 'react-native-fetch-blob';
import {AnimatedCircularProgress} from 'react-native-circular-progress';
import {CircularProgress} from 'react-native-circular-progress';
import {intlShape} from 'react-intl';
import {changeOpacity} from 'app/utils/theme';
@ -252,7 +252,7 @@ export default class FileAttachmentDocument extends PureComponent {
let fileAttachmentComponent;
if (downloading) {
fileAttachmentComponent = (
<AnimatedCircularProgress
<CircularProgress
size={wrapperHeight}
fill={progress}
width={4}
@ -262,7 +262,7 @@ export default class FileAttachmentDocument extends PureComponent {
style={style.circularProgress}
>
{this.renderProgress}
</AnimatedCircularProgress>
</CircularProgress>
);
} else {
fileAttachmentComponent = (

View file

@ -169,14 +169,6 @@ export default class PostTextbox extends PureComponent {
return false;
};
handleBlur = () => {
if (this.refs.input && Platform.OS === 'android') {
this.refs.input.setNativeProps({
autoScroll: false
});
}
};
handleContentSizeChange = (event) => {
let contentHeight = event.nativeEvent.contentSize.height;
if (contentHeight < INITIAL_HEIGHT) {
@ -196,14 +188,6 @@ export default class PostTextbox extends PureComponent {
}
};
handleFocus = () => {
if (this.refs.input && Platform.OS === 'android') {
this.refs.input.setNativeProps({
autoScroll: true
});
}
};
handlePostDraftSelectionChanged = (event) => {
const cursorPosition = event.nativeEvent.selection.end;
if (this.props.rootId) {
@ -494,8 +478,6 @@ export default class PostTextbox extends PureComponent {
style={[style.input, {height: textInputHeight}]}
onContentSizeChange={this.handleContentSizeChange}
keyboardType={this.state.keyboardType}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
onEndEditing={this.handleEndEditing}
disableFullscreenUI={true}
/>

View file

@ -4,7 +4,6 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {intlShape} from 'react-intl';
import {
Dimensions,
Platform,
View
} from 'react-native';
@ -23,6 +22,8 @@ export default class EditPost extends PureComponent {
editPost: PropTypes.func.isRequired
}),
closeButton: PropTypes.object,
deviceHeight: PropTypes.number,
deviceWidth: PropTypes.number,
editPostRequest: PropTypes.object.isRequired,
navigator: PropTypes.object,
post: PropTypes.object.isRequired,
@ -142,9 +143,8 @@ export default class EditPost extends PureComponent {
};
render() {
const {theme} = this.props;
const {deviceHeight, deviceWidth, theme} = this.props;
const {editing, message, error} = this.state;
const {height, width} = Dimensions.get('window');
const style = getStyleSheet(theme);
@ -160,7 +160,7 @@ export default class EditPost extends PureComponent {
let displayError;
if (error) {
displayError = (
<View style={[style.errorContainer, {width}]}>
<View style={[style.errorContainer, {width: deviceWidth}]}>
<View style={style.errorWrapper}>
<ErrorText error={error}/>
</View>
@ -168,12 +168,14 @@ export default class EditPost extends PureComponent {
);
}
const height = Platform.OS === 'android' ? (deviceHeight / 2) - 40 : (deviceHeight / 2);
return (
<View style={style.container}>
<StatusBar/>
<View style={style.scrollView}>
{displayError}
<View style={[style.inputContainer, {height: Platform.OS === 'android' ? (height / 2) - 20 : (height / 2)}]}>
<View style={[style.inputContainer, {height}]}>
<TextInputWithLocalizedPlaceholder
ref={this.messageRef}
value={message}
@ -181,7 +183,8 @@ export default class EditPost extends PureComponent {
onChangeText={this.onPostChangeText}
multiline={true}
numberOfLines={10}
style={[style.input, {height: height / 2}]}
style={[style.input, {height}]}
autoFocus={true}
autoCapitalize='none'
autoCorrect={false}
placeholder={{id: 'edit_post.editPost', defaultMessage: 'Edit the post...'}}

View file

@ -4,9 +4,10 @@
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {editPost} from 'mattermost-redux/actions/posts';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {editPost} from 'mattermost-redux/actions/posts';
import {getDimensions} from 'app/selectors/device';
import EditPost from './edit_post';
@ -14,6 +15,7 @@ function mapStateToProps(state, ownProps) {
const {editPost: editPostRequest} = state.requests.posts;
return {
...getDimensions(state),
editPostRequest,
post: ownProps.post,
theme: getTheme(state)

View file

@ -5,7 +5,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {Alert, Animated, CameraRoll, InteractionManager, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import RNFetchBlob from 'react-native-fetch-blob';
import {AnimatedCircularProgress} from 'react-native-circular-progress';
import {CircularProgress} from 'react-native-circular-progress';
import Icon from 'react-native-vector-icons/Ionicons';
import {intlShape} from 'react-intl';
@ -380,7 +380,7 @@ export default class Downloader extends PureComponent {
<View style={[styles.container, {height: containerHeight}]}>
<AnimatedView style={[styles.downloader, {top: this.state.downloaderTop}]}>
<View style={styles.progressCircleContent}>
<AnimatedCircularProgress
<CircularProgress
size={120}
fill={progress}
width={4}
@ -390,7 +390,7 @@ export default class Downloader extends PureComponent {
style={styles.progressCircle}
>
{component}
</AnimatedCircularProgress>
</CircularProgress>
</View>
</AnimatedView>
</View>

View file

@ -173,10 +173,10 @@ class NotificationSettings extends PureComponent {
saveNotificationProps = (notifyProps) => {
const {currentUser} = this.props;
const {user_id} = notifyProps;
const {user_id: userId} = notifyProps;
const previousProps = {
...getNotificationProps(currentUser),
user_id
user_id: userId
};
if (notifyProps.interval) {

View file

@ -100,24 +100,24 @@ export default class NotificationSettingsMobileBase extends PureComponent {
channel,
comments,
desktop,
desktop_duration,
desktop_duration: desktopDuration,
email,
first_name,
mention_keys,
first_name: firstName,
mention_keys: mentionKeys,
push,
push_status
push_status: pushStatus
} = this.state;
this.props.onBack({
channel,
comments,
desktop,
desktop_duration,
desktop_duration: desktopDuration,
email,
first_name,
mention_keys,
first_name: firstName,
mention_keys: mentionKeys,
push,
push_status,
push_status: pushStatus,
user_id: this.props.currentUser.id
});
};

View file

@ -4,12 +4,13 @@ GEM
CFPropertyList (2.3.6)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
aws-partitions (1.45.0)
aws-sdk-core (3.11.0)
atomos (0.1.2)
aws-partitions (1.59.0)
aws-sdk-core (3.15.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-kms (1.3.0)
aws-sdk-kms (1.4.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.8.0)
@ -29,7 +30,7 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
excon (0.60.0)
faraday (0.13.1)
faraday (0.14.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
@ -37,8 +38,8 @@ GEM
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.1)
fastlane (2.72.0)
CFPropertyList (>= 2.3, < 3.0.0)
fastlane (2.80.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
@ -62,11 +63,11 @@ GEM
public_suffix (~> 2.0.0)
rubyzip (>= 1.1.0, < 2.0.0)
security (= 0.1.3)
slack-notifier (>= 1.3, < 2.0.0)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.7.0, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.5.2, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0)
@ -75,7 +76,7 @@ GEM
fastlane-plugin-android_change_string_app_name (0.1.1)
nokogiri
fastlane-plugin-find_replace_string (0.1.0)
gh_inspector (1.0.3)
gh_inspector (1.1.1)
google-api-client (0.13.6)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5)
@ -108,11 +109,11 @@ GEM
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
mini_portile2 (2.3.0)
multi_json (1.12.2)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3)
nokogiri (1.8.1)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
os (0.9.6)
plist (3.4.0)
@ -130,22 +131,23 @@ GEM
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
slack-notifier (1.5.1)
slack-notifier (2.3.2)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.5.0)
tty-screen (0.6.4)
tty-spinner (0.7.0)
tty-spinner (0.8.0)
tty-cursor (>= 0.5.0)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unf_ext (0.0.7.5)
unicode-display_width (1.3.0)
word_wrap (1.0.0)
xcodeproj (1.5.4)
xcodeproj (1.5.6)
CFPropertyList (~> 2.3.3)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.6.0</string>
<string>1.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View file

@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.6.0</string>
<string>1.7.0</string>
<key>CFBundleVersion</key>
<string>84</string>
<key>NSAppTransportSecurity</key>

View file

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<string>1.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View file

@ -14,62 +14,61 @@
"deep-equal": "1.0.1",
"fuse.js": "^3.2.0",
"intl": "1.2.5",
"jail-monkey": "0.1.0",
"jail-monkey": "0.2.0",
"mattermost-redux": "mattermost/mattermost-redux",
"prop-types": "15.6.0",
"react": "16.0.0",
"react": "16.2.0",
"react-intl": "2.4.0",
"react-native": "0.51.0",
"react-native": "0.52.2",
"react-native-animatable": "1.2.4",
"react-native-bottom-sheet": "1.0.2",
"react-native-button": "2.1.0",
"react-native-button": "2.2.0",
"react-native-circular-progress": "0.1.0",
"react-native-cookies": "3.2.0",
"react-native-device-info": "0.13.0",
"react-native-doc-viewer": "2.6.8",
"react-native-device-info": "0.14.0",
"react-native-doc-viewer": "2.7.3",
"react-native-drawer": "2.5.0",
"react-native-exception-handler": "2.4.3",
"react-native-fast-image": "2.0.1",
"react-native-exception-handler": "2.7.1",
"react-native-fast-image": "2.2.4",
"react-native-fetch-blob": "0.10.8",
"react-native-image-picker": "0.26.7",
"react-native-keyboard-aware-scroll-view": "0.4.1",
"react-native-keyboard-aware-scroll-view": "0.4.3",
"react-native-linear-gradient": "2.4.0",
"react-native-local-auth": "enahum/react-native-local-auth.git",
"react-native-navigation": "v1.1.313",
"react-native-navigation": "1.1.369",
"react-native-notifications": "enahum/react-native-notifications.git",
"react-native-orientation": "enahum/react-native-orientation.git",
"react-native-orientation": "3.1.3",
"react-native-passcode-status": "1.1.0",
"react-native-permissions": "1.0.6",
"react-native-safe-area": "0.2.1",
"react-native-section-list-get-item-layout": "2.1.0",
"react-native-permissions": "1.1.1",
"react-native-safe-area": "0.2.3",
"react-native-section-list-get-item-layout": "2.2.1",
"react-native-sentry": "0.15.1",
"react-native-slider": "0.11.0",
"react-native-status-bar-size": "0.3.3",
"react-native-svg": "6.0.1-rc.0",
"react-native-svg": "6.1.3",
"react-native-tooltip": "enahum/react-native-tooltip",
"react-native-vector-icons": "4.4.2",
"react-native-vector-icons": "4.5.0",
"react-native-video": "2.0.0",
"react-native-youtube": "1.0.1",
"react-navigation": "1.0.0-beta.23",
"react-native-youtube": "1.1.0",
"react-navigation": "1.0.0",
"react-redux": "5.0.6",
"redux": "3.7.2",
"redux-batched-actions": "0.2.0",
"redux-batched-actions": "0.2.1",
"redux-persist": "4.10.2",
"redux-persist-transform-filter": "0.0.16",
"redux-thunk": "2.2.0",
"reselect": "3.0.1",
"semver": "5.4.1",
"semver": "5.5.0",
"shallow-equals": "1.0.0",
"socketcluster": "9.1.4",
"tinycolor2": "1.4.1",
"url-parse": "1.2.0",
"youtube-video-id": "0.0.2"
},
"devDependencies": {
"babel-cli": "6.26.0",
"babel-eslint": "8.0.3",
"babel-eslint": "8.2.1",
"babel-plugin-module-resolver": "3.0.0",
"babel-plugin-transform-remove-console": "6.8.5",
"babel-plugin-transform-remove-console": "6.9.0",
"babel-preset-env": "1.6.1",
"babel-preset-es2015": "6.24.1",
"babel-preset-latest": "6.24.1",
@ -81,18 +80,18 @@
"chai-enzyme": "0.8.0",
"chai-fetch-mock": "1.0.1",
"deep-freeze": "0.0.1",
"enzyme": "3.2.0",
"eslint": "4.12.1",
"enzyme": "3.3.0",
"eslint": "4.17.0",
"eslint-plugin-mocha": "4.11.0",
"eslint-plugin-react": "7.5.1",
"fetch-mock": "5.13.1",
"jsdom": "11.5.1",
"eslint-plugin-react": "7.6.1",
"fetch-mock": "6.0.0",
"jsdom": "11.6.2",
"jsdom-global": "3.0.2",
"mocha": "4.0.1",
"mocha": "5.0.0",
"mocha-react-native": "0.6.0",
"mock-async-storage": "2.0.2",
"mockery": "2.1.0",
"nyc": "11.3.0",
"nyc": "11.4.1",
"react-addons-test-utils": "15.6.2",
"react-dom": "16.2.0",
"react-native-mock": "0.3.1",
@ -100,6 +99,7 @@
"react-test-renderer": "16.2.0",
"remote-redux-devtools": "0.5.12",
"remotedev-rn-debugger": "0.8.3",
"socketcluster": "9.3.1",
"underscore": "1.8.3"
},
"scripts": {

View file

@ -1,9 +1,13 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
var path = require('path');
const path = require('path');
const blacklist = require('metro/src/blacklist');
var config = {
const config = {
getBlacklistRE() {
return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/]);
},
getProjectRoots() {
return [
path.resolve(__dirname, '.')

769
yarn.lock

File diff suppressed because it is too large Load diff