Skip to content

Commit 5b797a9

Browse files
committed
chore: upgrade dependencies and fix flow errors
1 parent 75c6726 commit 5b797a9

21 files changed

+950
-692
lines changed

.flowconfig

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
.*/example/node_modules/xdl
3030
.*/example/node_modules/reqwest
3131
.*/example/\.buckd/
32-
.*/example/node_modules/react-navigation/.*/__tests__/.*
32+
.*/example/node_modules/react-native-tab-view
33+
.*/example/node_modules/react-navigation
3334
.*/example/node_modules/react-native-fbads
3435

3536
; Ignore duplicate modules under docs/
@@ -56,19 +57,20 @@ experimental.strict_type_args=true
5657
munge_underscores=true
5758

5859
module.name_mapper='^expo$' -> 'emptyObject'
60+
module.name_mapper='^react-navigation$' -> 'emptyObject'
5961

6062
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
6163

6264
suppress_type=$FlowIssue
6365
suppress_type=$FlowFixMe
6466
suppress_type=$FixMe
6567

66-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
67-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
6870
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6971
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
7072

7173
unsafe.enable_getters_and_setters=true
7274

7375
[version]
74-
^0.45.0
76+
^0.49.1

example/app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "React Native Paper Example",
44
"description": "Example for React Native Paper",
55
"slug": "react-native-paper-example",
6-
"sdkVersion": "18.0.0",
6+
"sdkVersion": "20.0.0",
77
"version": "1.0.0",
88
"orientation": "default",
99
"primaryColor": "#cccccc",

example/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ const styles = StyleSheet.create({
6161

6262
Expo.registerRootComponent(() =>
6363
<PaperProvider>
64-
<App />
64+
<App onNavigationStateChange={null} />
6565
</PaperProvider>
6666
);

example/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
},
1212
"main": "main.js",
1313
"dependencies": {
14-
"@expo/vector-icons": "^5.0.0",
14+
"@expo/vector-icons": "^5.1.0",
1515
"color": "^0.11.4",
1616
"escape-string-regexp": "^1.0.5",
17-
"expo": "~18.0.6",
17+
"expo": "~20.0.1",
1818
"prop-types": "^15.5.10",
1919
"react": "16.0.0-alpha.12",
20-
"react-native": "~0.45.1",
21-
"react-native-drawer": "^2.3.0",
20+
"react-native": "~0.47.1",
21+
"react-native-drawer": "^2.4.0",
2222
"react-navigation": "^1.0.0-beta.11"
2323
},
2424
"devDependencies": {
2525
"babel-plugin-module-resolver": "^2.7.1",
26-
"babel-preset-expo": "^1.0.1",
27-
"react-native-scripts": "0.0.50"
26+
"babel-preset-expo": "^3.0.0",
27+
"react-native-scripts": "1.1.0"
2828
}
2929
}

example/rn-cli.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const path = require('path');
44
const escape = require('escape-string-regexp');
5-
const blacklist = require('react-native/packager/blacklist');
5+
const blacklist = require('metro-bundler/src/blacklist');
66

77
module.exports = {
88
getProjectRoots() {

example/yarn.lock

+341-396
Large diffs are not rendered by default.

package.json

+16-17
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,31 @@
2222
"react-native-vector-icons": "*"
2323
},
2424
"devDependencies": {
25-
"babel-cli": "^6.24.1",
25+
"babel-cli": "^6.26.0",
2626
"babel-eslint": "^7.2.3",
27-
"babel-preset-flow": "^6.23.0",
28-
"eslint": "^4.1.1",
27+
"eslint": "^4.5.0",
2928
"eslint-config-prettier": "^2.3.0",
30-
"eslint-plugin-babel": "^4.1.1",
31-
"eslint-plugin-flowtype": "^2.34.1",
32-
"eslint-plugin-import": "^2.6.1",
33-
"eslint-plugin-prettier": "^2.1.2",
34-
"eslint-plugin-react": "^7.1.0",
35-
"eslint-plugin-react-native": "^2.3.2",
36-
"flow-bin": "~0.45.0",
37-
"husky": "^0.14.2",
38-
"prettier": "^1.5.2",
29+
"eslint-plugin-babel": "^4.1.2",
30+
"eslint-plugin-flowtype": "^2.35.0",
31+
"eslint-plugin-import": "^2.7.0",
32+
"eslint-plugin-prettier": "^2.2.0",
33+
"eslint-plugin-react": "^7.2.1",
34+
"eslint-plugin-react-native": "^3.0.1",
35+
"flow-bin": "~0.49.1",
36+
"husky": "^0.14.3",
37+
"prettier": "^1.5.3",
3938
"react": "16.0.0-alpha.12",
40-
"react-native": "~0.45.1",
41-
"react-native-vector-icons": "~4.2.0"
39+
"react-native": "^0.47.1",
40+
"react-native-vector-icons": "~4.3.0"
4241
},
4342
"dependencies": {
4443
"color": "^0.11.4",
4544
"prop-types": "^15.5.10",
46-
"react-native-drawer": "^2.3.0"
45+
"react-native-drawer": "^2.4.0"
4746
},
4847
"scripts": {
49-
"commitmsg": "babel-node ./scripts/validateCommitMessage.js $GIT_PARAMS --presets flow",
50-
"precommit": "npm run lint && npm run flow",
48+
"commitmsg": "node ./scripts/validate-commit-message.js $GIT_PARAMS",
49+
"precommit": "yarn run lint && yarn run flow",
5150
"flow": "flow",
5251
"lint": "eslint .",
5352
"test": "echo \"Error: no test specified\" && exit 1"

scripts/validateCommitMessage.js renamed to scripts/validate-commit-message.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const TYPES = {
1818
breaking: true,
1919
};
2020

21-
function printError() {
22-
console.error('INVALID COMMIT MSG: ' + util.format.apply(null, arguments));
21+
function printError(...args) {
22+
console.error('INVALID COMMIT MSG: ' + util.format.apply(null, args));
2323
}
2424

25-
function validateMessage(message /*: string */) {
25+
function validateMessage(message) {
2626
if (message.length > MAX_LENGTH) {
2727
printError('is longer than %d characters !', MAX_LENGTH);
2828
return false;
@@ -44,7 +44,7 @@ function validateMessage(message /*: string */) {
4444
return true;
4545
}
4646

47-
function firstLineFromBuffer(buffer /*: Buffer */) {
47+
function firstLineFromBuffer(buffer) {
4848
return buffer.toString().split('\n').shift();
4949
}
5050

src/components/Button.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
import color from 'color';
44
import React, { PureComponent } from 'react';
55
import PropTypes from 'prop-types';
6-
import { ActivityIndicator, Animated, View, StyleSheet } from 'react-native';
6+
import {
7+
ActivityIndicator,
8+
Animated,
9+
View,
10+
StyleSheet,
11+
ViewPropTypes,
12+
} from 'react-native';
713
import Icon from './Icon';
814
import Paper from './Paper';
915
import Text from './Typography/Text';
@@ -90,7 +96,7 @@ class Button extends PureComponent<void, Props, State> {
9096
* Function to execute on press
9197
*/
9298
onPress: PropTypes.func,
93-
style: View.propTypes.style,
99+
style: ViewPropTypes.style,
94100
theme: PropTypes.object.isRequired,
95101
};
96102

src/components/Card/Card.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
View,
88
TouchableWithoutFeedback,
99
StyleSheet,
10+
ViewPropTypes,
1011
} from 'react-native';
1112
import Paper from '../Paper';
1213
import CardContent from './CardContent';
@@ -43,7 +44,7 @@ class Card extends Component<DefaultProps, Props, State> {
4344
elevation: PropTypes.number,
4445
children: PropTypes.node.isRequired,
4546
onPress: PropTypes.func,
46-
style: View.propTypes.style,
47+
style: ViewPropTypes.style,
4748
theme: PropTypes.object.isRequired,
4849
};
4950

src/components/Card/CardActions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { Children } from 'react';
44
import PropTypes from 'prop-types';
5-
import { StyleSheet, View } from 'react-native';
5+
import { StyleSheet, View, ViewPropTypes } from 'react-native';
66

77
type Props = {
88
children?: any,
@@ -23,7 +23,7 @@ const CardActions = (props: Props) => {
2323

2424
CardActions.propTypes = {
2525
children: PropTypes.node.isRequired,
26-
style: View.propTypes.style,
26+
style: ViewPropTypes.style,
2727
};
2828

2929
const styles = StyleSheet.create({

src/components/Card/CardContent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from 'react';
44
import PropTypes from 'prop-types';
5-
import { StyleSheet, View } from 'react-native';
5+
import { StyleSheet, View, ViewPropTypes } from 'react-native';
66

77
type Props = {
88
index?: number,
@@ -53,7 +53,7 @@ CardContent.propTypes = {
5353
index: PropTypes.number,
5454
total: PropTypes.number,
5555
siblings: PropTypes.arrayOf(PropTypes.string),
56-
style: View.propTypes.style,
56+
style: ViewPropTypes.style,
5757
};
5858

5959
const styles = StyleSheet.create({

src/components/Divider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from 'react';
44
import PropTypes from 'prop-types';
5-
import { StyleSheet, View } from 'react-native';
5+
import { StyleSheet, View, ViewPropTypes } from 'react-native';
66

77
type Props = {
88
inset?: boolean,
@@ -24,7 +24,7 @@ Divider.propTypes = {
2424
* Whether divider has a left inset
2525
*/
2626
inset: PropTypes.bool,
27-
style: View.propTypes.style,
27+
style: ViewPropTypes.style,
2828
};
2929

3030
const styles = StyleSheet.create({

src/components/GridView.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { PureComponent } from 'react';
44
import PropTypes from 'prop-types';
5-
import { Dimensions, ListView, StyleSheet, View } from 'react-native';
5+
import { Dimensions, ListView, StyleSheet, ViewPropTypes } from 'react-native';
66
import { grey200 } from '../styles/colors';
77

88
type Layout = {
@@ -42,7 +42,7 @@ export default class GridView extends PureComponent<
4242
renderSectionHeader: PropTypes.func,
4343
renderRow: PropTypes.func.isRequired,
4444
onLayout: PropTypes.func,
45-
contentContainerStyle: View.propTypes.style,
45+
contentContainerStyle: ViewPropTypes.style,
4646
};
4747

4848
static defaultProps = {

src/components/Paper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { PureComponent } from 'react';
44
import PropTypes from 'prop-types';
5-
import { StyleSheet, View } from 'react-native';
5+
import { StyleSheet, View, ViewPropTypes } from 'react-native';
66
import * as Colors from '../styles/colors';
77
import shadow from '../styles/shadow';
88

@@ -22,7 +22,7 @@ export default class Paper extends PureComponent<void, Props, void> {
2222
*/
2323
elevation: PropTypes.number.isRequired,
2424
children: PropTypes.node,
25-
style: View.propTypes.style,
25+
style: ViewPropTypes.style,
2626
};
2727

2828
render() {

src/components/Portal/PortalHost.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { PureComponent } from 'react';
44
import PropTypes from 'prop-types';
5-
import { View, StyleSheet } from 'react-native';
5+
import { View, StyleSheet, ViewPropTypes } from 'react-native';
66
import type { PortalProps } from './Portal';
77

88
type Props = {
@@ -25,7 +25,7 @@ export const manager = 'react-native-paper$portal-manager';
2525
export default class Portals extends PureComponent<void, Props, State> {
2626
static propTypes = {
2727
children: PropTypes.node.isRequired,
28-
style: View.propTypes.style,
28+
style: ViewPropTypes.style,
2929
};
3030

3131
static childContextTypes = {

src/components/Toolbar/Toolbar.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { Children, Component } from 'react';
44
import PropTypes from 'prop-types';
5-
import { Platform, StyleSheet, View } from 'react-native';
5+
import { Platform, StyleSheet, ViewPropTypes } from 'react-native';
66

77
import withTheme from '../../core/withTheme';
88
import Paper from '../Paper';
@@ -34,7 +34,7 @@ class Toolbar extends Component<DefaultProps, Props, void> {
3434
* Toolbar content
3535
*/
3636
children: PropTypes.node.isRequired,
37-
style: View.propTypes.style,
37+
style: ViewPropTypes.style,
3838
/**
3939
* Space added it Toolbar to adapt to the StatusBar
4040
*/

src/components/Toolbar/ToolbarAction.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { Component } from 'react';
44
import PropTypes from 'prop-types';
5-
import { Platform, StyleSheet, View } from 'react-native';
5+
import { Platform, StyleSheet, ViewPropTypes } from 'react-native';
66
import color from 'color';
77

88
import { black, white } from '../../styles/colors';
@@ -32,7 +32,7 @@ export default class ToolbarAction extends Component<void, Props, void> {
3232
* Function to execute on press
3333
*/
3434
onPress: PropTypes.func,
35-
style: View.propTypes.style,
35+
style: ViewPropTypes.style,
3636
};
3737

3838
render() {

src/components/Toolbar/ToolbarContent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { Component } from 'react';
44
import PropTypes from 'prop-types';
5-
import { View, Platform, StyleSheet } from 'react-native';
5+
import { View, Platform, StyleSheet, ViewPropTypes } from 'react-native';
66
import color from 'color';
77

88
import Text from '../Typography/Text';
@@ -40,7 +40,7 @@ class ToolbarContent extends Component<void, Props, void> {
4040
* Style for the title
4141
*/
4242
titleStyle: Text.propTypes.style,
43-
style: View.propTypes.style,
43+
style: ViewPropTypes.style,
4444
/**
4545
* Style for the subtitle
4646
*/

src/components/TouchableRipple.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TouchableHighlight,
88
Platform,
99
View,
10+
ViewPropTypes,
1011
} from 'react-native';
1112
import color from 'color';
1213

@@ -39,7 +40,7 @@ export default class TouchableItem extends PureComponent<
3940
rippleColor: PropTypes.string,
4041
underlayColor: PropTypes.string,
4142
children: PropTypes.element.isRequired,
42-
style: View.propTypes.style,
43+
style: ViewPropTypes.style,
4344
};
4445

4546
static defaultProps = {

0 commit comments

Comments
 (0)