Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Upgrade to react@16 #8889

Merged
merged 1 commit into from
Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,6 @@ module.exports = {
'react/no-find-dom-node': 'off', // I don't know
'react/no-unused-prop-types': 'off', // Is still buggy
'react/sort-prop-types': 'error', // airbnb do nothing here.
'react/sort-comp': [
2,
{
order: [
'type-annotations',
'static-methods',
'lifecycle',
// '/^handle.+$/', // wishlist -- needs above first
// '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', // wishlist -- needs above first
'everything-else',
'/^render.+$/',
'render',
],
},
],
'react/default-props-match-prop-types': 'off', // Buggy
'react/jsx-curly-brace-presence': 'off', // Buggy

Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.*/node_modules/npmconf/test/fixtures/package.json
.*/node_modules/react-swipeable-views
.*/node_modules/eslint-plugin-jsx-a11y
.*/node_modules/react-number-format/src
.*/scripts
.*/docs/webpack.*
; FIXME: we should be flow checking against jss
Expand Down
7 changes: 3 additions & 4 deletions docs/src/modules/components/withRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ function withRoot(BaseComponent) {
sheetsRegistry?: Object,
url: Object,
};
class WithRoot extends React.Component<WithRootProps> {
props: WithRootProps;

class WithRoot extends React.Component<WithRootProps> {
static childContextTypes = {
url: PropTypes.object,
pages: PropTypes.array,
Expand Down Expand Up @@ -228,8 +227,8 @@ function withRoot(BaseComponent) {
};
}

constructor(props) {
super(props);
constructor(props, context) {
super(props, context);
this.redux = initRedux(this.props.reduxServerState || {});
}

Expand Down
3 changes: 2 additions & 1 deletion docs/src/pages/demos/progress/LinearBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const styles = {
};

class LinearBuffer extends React.Component {
timer: number;
state = {
completed: 0,
buffer: 10,
Expand All @@ -27,6 +26,8 @@ class LinearBuffer extends React.Component {
clearInterval(this.timer);
}

timer: number;

progress = () => {
const { completed } = this.state;
if (completed > 100) {
Expand Down
3 changes: 2 additions & 1 deletion docs/src/pages/demos/progress/LinearDeterminate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const styles = {
};

class LinearDeterminate extends React.Component {
timer: number;
state = {
completed: 0,
};
Expand All @@ -26,6 +25,8 @@ class LinearDeterminate extends React.Component {
clearInterval(this.timer);
}

timer: number;

progress = () => {
const { completed } = this.state;
if (completed > 100) {
Expand Down
5 changes: 3 additions & 2 deletions docs/src/pages/demos/tables/EnhancedTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ const styles = theme => ({
});

class EnhancedTable extends React.Component {
constructor(props) {
super(props);
constructor(props, context) {
super(props, context);

this.state = {
order: 'asc',
orderBy: 'calories',
Expand Down
54 changes: 30 additions & 24 deletions docs/src/pages/demos/text-fields/FormattedInputs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable flowtype/require-valid-file-annotation */
/* eslint-disable react/prefer-stateless-function */
/* eslint-disable react/no-multi-comp */

import React from 'react';
import MaskedInput from 'react-text-mask';
Expand All @@ -17,32 +19,36 @@ const styles = theme => ({
},
});

function TextMaskCustom(props) {
return (
<MaskedInput
{...props}
mask={['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]}
placeholderChar={'\u2000'}
showMask
/>
);
class TextMaskCustom extends React.Component {
render() {
return (
<MaskedInput
{...this.props}
mask={['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]}
placeholderChar={'\u2000'}
showMask
/>
);
}
}

function NumberFormatCustom(props) {
return (
<NumberFormat
{...props}
onChange={(event, values) => {
props.onChange({
target: {
value: values.value,
},
});
}}
thousandSeparator
prefix="$"
/>
);
class NumberFormatCustom extends React.Component {
render() {
return (
<NumberFormat
{...this.props}
onValueChange={values => {
this.props.onChange({
target: {
value: values.value,
},
});
}}
thousandSeparator
prefix="$"
/>
);
}
}

NumberFormatCustom.propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/@types/enzyme_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 29861e245326601652e701f1ec9396ca
// flow-typed version: <<STUB>>/@types/enzyme_v^2.8.8/flow_v0.55.0
// flow-typed signature: 38e26ff988b219279c86cfbe174dcca7
// flow-typed version: <<STUB>>/@types/enzyme_v^3.1.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/@types/react_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 2b6b2a1fdf337b9e3981e2badf2331af
// flow-typed version: <<STUB>>/@types/react_v^16.0.5/flow_v0.55.0
// flow-typed signature: dce9d31adc38dc081497d49f8fa14f32
// flow-typed version: <<STUB>>/@types/react_v16.0.9/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/app-module-path_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 7201bed1395129adbf3102630e4cee3d
// flow-typed version: <<STUB>>/app-module-path_v^2.2.0/flow_v0.55.0
// flow-typed signature: 5d552d08028073cf4425e4e9a7bced9a
// flow-typed version: <<STUB>>/app-module-path_v^2.2.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/argos-cli_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 5c96fcc02dcc5ee7d0d24caeba0b4343
// flow-typed version: <<STUB>>/argos-cli_v^0.0.9/flow_v0.55.0
// flow-typed signature: 61c7989a1d35bc8d7c367f2dfccbbc74
// flow-typed version: <<STUB>>/argos-cli_v^0.0.9/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/autosuggest-highlight_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 370b0d9599ac5665a44a1230c6e45b28
// flow-typed version: <<STUB>>/autosuggest-highlight_v^3.1.0/flow_v0.55.0
// flow-typed signature: 35cecb4c7d84cca19f0fbfa9778d3f7d
// flow-typed version: <<STUB>>/autosuggest-highlight_v^3.1.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-cli_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 0b1433c9c4ad723e7948a8a9d4a096b9
// flow-typed version: <<STUB>>/babel-cli_v^6.26.0/flow_v0.55.0
// flow-typed signature: 45660148c1072407a12908e4a58550b5
// flow-typed version: <<STUB>>/babel-cli_v^6.26.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-core_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: be442188d119c847416dd025f69bb123
// flow-typed version: <<STUB>>/babel-core_v^6.26.0/flow_v0.55.0
// flow-typed signature: e170ae7946934c3818270e0627bf3a9d
// flow-typed version: <<STUB>>/babel-core_v^6.26.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-eslint_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 93147d4da81fabd80d03c1c949ceba89
// flow-typed version: <<STUB>>/babel-eslint_v^8.0.0/flow_v0.55.0
// flow-typed signature: 65c9f1430648fbaf06abeea3169ff3da
// flow-typed version: <<STUB>>/babel-eslint_v^8.0.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-loader_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 4206738fa1342398741edf5f8ddeb8c9
// flow-typed version: <<STUB>>/babel-loader_v^7.1.2/flow_v0.55.0
// flow-typed signature: b26735b9fc478d58198e4d76088fa69a
// flow-typed version: <<STUB>>/babel-loader_v^7.1.2/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-flow-react-proptypes_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 544c10d682689a1b2fa1f46488a14d8d
// flow-typed version: <<STUB>>/babel-plugin-flow-react-proptypes_v5.1.1/flow_v0.55.0
// flow-typed signature: 428167ece60d3f18baaaff08ba6a39d4
// flow-typed version: <<STUB>>/babel-plugin-flow-react-proptypes_v^7.0.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-istanbul_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: c6f84fa56c03ca3db3be38634774e3a2
// flow-typed version: <<STUB>>/babel-plugin-istanbul_v^4.1.5/flow_v0.55.0
// flow-typed signature: 0d8dc35f8a477a72673435242d172674
// flow-typed version: <<STUB>>/babel-plugin-istanbul_v^4.1.5/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-preval_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 0157bd47438f31ceb8ab10278e42042f
// flow-typed version: <<STUB>>/babel-plugin-preval_v^1.5.0/flow_v0.55.0
// flow-typed signature: 425655ed77b8215e1267e175a0e0a07d
// flow-typed version: <<STUB>>/babel-plugin-preval_v^1.6.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-react-remove-properties_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 84f4805566461e1f09cc4aed3e47bd19
// flow-typed version: <<STUB>>/babel-plugin-react-remove-properties_v^0.2.5/flow_v0.55.0
// flow-typed signature: 8dd8e44cda7bf0b09a86f036c2a6094c
// flow-typed version: <<STUB>>/babel-plugin-react-remove-properties_v^0.2.5/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-transform-dev-warning_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 6d7726d486013a75e50a21dfceb7885f
// flow-typed version: <<STUB>>/babel-plugin-transform-dev-warning_v^0.1.0/flow_v0.55.0
// flow-typed signature: dd1250f6fa61901f4343efeaefad16f8
// flow-typed version: <<STUB>>/babel-plugin-transform-dev-warning_v^0.1.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: f5bc03436b1df48ac0553281d98fd24d
// flow-typed version: <<STUB>>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.55.0
// flow-typed signature: 2374cfcadfa849e9026f394d9681deb2
// flow-typed version: <<STUB>>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-transform-object-assign_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 4f5351be0a90943480f81d47de00bec5
// flow-typed version: <<STUB>>/babel-plugin-transform-object-assign_v^6.22.0/flow_v0.55.0
// flow-typed signature: 3794cb54d1c199f952b751466822f842
// flow-typed version: <<STUB>>/babel-plugin-transform-object-assign_v^6.22.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: c37ebd25a08f511db56ca913ccf98c88
// flow-typed version: <<STUB>>/babel-plugin-transform-react-constant-elements_v^6.23.0/flow_v0.55.0
// flow-typed signature: d38098aedca1323a7d0a36157f359589
// flow-typed version: <<STUB>>/babel-plugin-transform-react-constant-elements_v^6.23.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 200d5e6f9cd63e859e432d96ff7f3d47
// flow-typed version: <<STUB>>/babel-plugin-transform-react-remove-prop-types_v^0.4.8/flow_v0.55.0
// flow-typed signature: 61faa36ddceaca67442a30e4c18de1ec
// flow-typed version: <<STUB>>/babel-plugin-transform-react-remove-prop-types_v^0.4.10/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 6d3cee82ddca0e5522f92f2f6a77eb50
// flow-typed version: <<STUB>>/babel-plugin-transform-runtime_v^6.23.0/flow_v0.55.0
// flow-typed signature: 7ebc17b7c4badcab64c9919326931277
// flow-typed version: <<STUB>>/babel-plugin-transform-runtime_v^6.23.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-polyfill_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 3c3384b0284c1d461d772799ff65f778
// flow-typed version: <<STUB>>/babel-polyfill_v^6.26.0/flow_v0.55.0
// flow-typed signature: 1eab6798ddbdf14d95637c19e547522a
// flow-typed version: <<STUB>>/babel-polyfill_v^6.26.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-preset-env_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 156e4ce8839874b7912495dd67fba8d3
// flow-typed version: <<STUB>>/babel-preset-env_v^1.6.0/flow_v0.55.0
// flow-typed signature: 27bc193720770caa5395dffff4dde6e6
// flow-typed version: <<STUB>>/babel-preset-env_v^1.6.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-preset-react_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: f71383ddec556db0dab5f719c4c0bb7d
// flow-typed version: <<STUB>>/babel-preset-react_v^6.24.1/flow_v0.55.0
// flow-typed signature: b8ad2327b85cb3ec3b74e2965f60b4a4
// flow-typed version: <<STUB>>/babel-preset-react_v^6.24.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-preset-stage-1_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: e8c59f853c9b6bca01994b640e9ddea7
// flow-typed version: <<STUB>>/babel-preset-stage-1_v^6.24.1/flow_v0.55.0
// flow-typed signature: 9ec16af7ec61185efb3b736ff3a24094
// flow-typed version: <<STUB>>/babel-preset-stage-1_v^6.24.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-register_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: fea62fffe3130cc006825a4ae6f2c06a
// flow-typed version: <<STUB>>/babel-register_v^6.26.0/flow_v0.55.0
// flow-typed signature: 853e707598f8c326c8adb779370fe43e
// flow-typed version: <<STUB>>/babel-register_v^6.26.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/babel-runtime_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: f6ed6d4faf45d15b895cbce7bc4a6fe8
// flow-typed version: <<STUB>>/babel-runtime_v^6.26.0/flow_v0.55.0
// flow-typed signature: bdece8379718d6a7003b8cb49f789eae
// flow-typed version: <<STUB>>/babel-runtime_v^6.26.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
4 changes: 2 additions & 2 deletions flow-typed/npm/brcast_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: c9c2af232d0951a4bc449882d151b027
// flow-typed version: <<STUB>>/brcast_v^3.0.1/flow_v0.55.0
// flow-typed signature: fdde41bb2ad1e342e9d2384dfd20b4fe
// flow-typed version: <<STUB>>/brcast_v^3.0.1/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
9 changes: 6 additions & 3 deletions flow-typed/npm/chai_v4.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 361bd0345b0567d52419a64283294afc
// flow-typed version: 6d442f5792/chai_v4.x.x/flow_>=v0.15.0
// flow-typed signature: 04abbfe10ba62a87d54aa0723604ba3f
// flow-typed version: dd6d1b6bed/chai_v4.x.x/flow_>=v0.15.0

declare module "chai" {
declare type ExpectChain<T> = {
Expand Down Expand Up @@ -243,7 +243,10 @@ declare module "chai" {
err?: Class<E> | Error | RegExp | string,
errorMsgMatcher?: string | RegExp,
msg?: string
): void
): void,

static closeTo(actual: number, expected: number, delta: number, msg?: string): void,
static approximately(actual: number, expected: number, delta: number, msg?: string): void
}

declare var config: {
Expand Down