Update flow to 0.31 (#7557)

(cherry picked from commit 08614db025)
This commit is contained in:
Christopher Chedeau
2016-10-03 16:27:31 -07:00
committed by Paul O’Shannessy
parent cbc450860e
commit a71a787038
4 changed files with 23 additions and 4 deletions
+5 -3
View File
@@ -28,10 +28,12 @@ munge_underscores=false
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowExpectedError
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*\\)?)\\)? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.27.0
^0.31.0
+1 -1
View File
@@ -45,7 +45,7 @@
"eslint-plugin-react-internal": "file:eslint-rules",
"fbjs": "^0.8.4",
"fbjs-scripts": "^0.6.0",
"flow-bin": "^0.27.0",
"flow-bin": "^0.31.0",
"glob": "^6.0.1",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
@@ -123,6 +123,10 @@ function ChildReconciler(shouldClone) {
switch (newChildren.$$typeof) {
case REACT_ELEMENT_TYPE: {
/* $FlowFixMe(>=0.31.0): This is an unsafe cast. Consider adding a type
* annotation to the `newChildren` param of this
* function.
*/
const element = (newChildren : ReactElement<any>);
if (existingChild &&
element.type === existingChild.type &&
@@ -144,6 +148,8 @@ function ChildReconciler(shouldClone) {
}
case REACT_COROUTINE_TYPE: {
/* $FlowFixMe(>=0.31.0): No 'handler' property found in object type
*/
const coroutine = (newChildren : ReactCoroutine);
const child = createFiberFromCoroutine(coroutine, priority);
child.return = returnFiber;
@@ -154,6 +160,9 @@ function ChildReconciler(shouldClone) {
// A yield results in a fragment fiber whose output is the continuation.
// TODO: When there is only a single child, we can optimize this to avoid
// the fragment.
/* $FlowFixMe(>=0.31.0): No 'continuation' property found in object
* type
*/
const yieldNode = (newChildren : ReactYield);
const reifiedYield = createReifiedYield(yieldNode);
const child = createFiberFromYield(yieldNode, priority);
@@ -167,6 +176,11 @@ function ChildReconciler(shouldClone) {
var first : ?Fiber = null;
var prev : ?Fiber = null;
var existing : ?Fiber = existingChild;
/* $FlowIssue(>=0.31.0) #12747709
*
* `Array.isArray` is matched syntactically for now until predicate
* support is complete.
*/
for (var i = 0; i < newChildren.length; i++) {
var nextExisting = existing && existing.sibling;
if (prev == null) {
@@ -33,6 +33,9 @@ export type ReactCoroutine = {
children: any,
// This should be a more specific CoroutineHandler
handler: (props: any, yields: Array<ReifiedYield>) => ReactNodeList,
/* $FlowFixMe(>=0.31.0): Which is it? mixed? Or Object? Must match
* `ReactYield` type.
*/
props: mixed,
};
export type ReactYield = {