Update flow to 0.31 (#7557)
Christopher Chedeau committed
Aug 25, 2016 at 09:43 UTC
08614db025b59d55701d0c6e02e8b3948a036f9f
4 files changed
+23
-4
.flowconfig
+5
-3
@@ -28,10 +28,12 @@ munge_underscores=false
28
suppress_type=$FlowIssue
29
suppress_type=$FlowFixMe
30
suppress_type=$FixMe
31
+suppress_type=$FlowExpectedError
32
32
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*\\)?)\\)
33
-suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*\\)?)\\)? #[0-9]+
33
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
34
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
35
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
36
+suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
37
38
[version]
37
-^0.27.0
39
+^0.31.0
package.json
+1
-1
@@ -45,7 +45,7 @@
45
"eslint-plugin-react-internal": "file:eslint-rules",
46
"fbjs": "^0.8.4",
47
"fbjs-scripts": "^0.6.0",
48
- "flow-bin": "^0.27.0",
48
+ "flow-bin": "^0.31.0",
49
"glob": "^6.0.1",
50
"grunt": "^0.4.5",
51
"grunt-cli": "^0.1.13",
src/renderers/shared/fiber/ReactChildFiber.js
+14
@@ -123,6 +123,10 @@ function ChildReconciler(shouldClone) {
123
124
switch (newChildren.$$typeof) {
125
case REACT_ELEMENT_TYPE: {
126
+ /* $FlowFixMe(>=0.31.0): This is an unsafe cast. Consider adding a type
127
+ * annotation to the `newChildren` param of this
128
+ * function.
129
+ */
130
const element = (newChildren : ReactElement<any>);
131
if (existingChild &&
132
element.type === existingChild.type &&
@@ -144,6 +148,8 @@ function ChildReconciler(shouldClone) {
148
}
149
150
case REACT_COROUTINE_TYPE: {
151
+ /* $FlowFixMe(>=0.31.0): No 'handler' property found in object type
152
+ */
153
const coroutine = (newChildren : ReactCoroutine);
154
const child = createFiberFromCoroutine(coroutine, priority);
155
child.return = returnFiber;
@@ -154,6 +160,9 @@ function ChildReconciler(shouldClone) {
160
// A yield results in a fragment fiber whose output is the continuation.
161
// TODO: When there is only a single child, we can optimize this to avoid
162
// the fragment.
163
+ /* $FlowFixMe(>=0.31.0): No 'continuation' property found in object
164
+ * type
165
+ */
166
const yieldNode = (newChildren : ReactYield);
167
const reifiedYield = createReifiedYield(yieldNode);
168
const child = createFiberFromYield(yieldNode, priority);
@@ -167,6 +176,11 @@ function ChildReconciler(shouldClone) {
176
var first : ?Fiber = null;
177
var prev : ?Fiber = null;
178
var existing : ?Fiber = existingChild;
179
+ /* $FlowIssue(>=0.31.0) #12747709
180
+ *
181
+ * `Array.isArray` is matched syntactically for now until predicate
182
+ * support is complete.
183
+ */
184
for (var i = 0; i < newChildren.length; i++) {
185
var nextExisting = existing && existing.sibling;
186
if (prev == null) {
src/renderers/shared/fiber/isomorphic/ReactCoroutine.js
+3
@@ -33,6 +33,9 @@ export type ReactCoroutine = {
33
children: any,
34
// This should be a more specific CoroutineHandler
35
handler: (props: any, yields: Array<ReifiedYield>) => ReactNodeList,
36
+ /* $FlowFixMe(>=0.31.0): Which is it? mixed? Or Object? Must match
37
+ * `ReactYield` type.
38
+ */
39
props: mixed,
40
};
41
export type ReactYield = {