@samitouri / QOS-React / commits / 6faf6f5eb1

Update to flow 0.97 (#17892)

Nicolas Gallagher committed Jan 24, 2020 at 10:52 UTC 6faf6f5eb1705eef39a1d762d6ee381930f36775
9 files changed +17 -9
package.json
+1 -1
@@ -57,7 +57,7 @@
57 "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
58 "fbjs-scripts": "0.8.3",
59 "filesize": "^6.0.1",
60 - "flow-bin": "0.89",
60 + "flow-bin": "0.97",
61 "glob": "^7.1.6",
62 "glob-stream": "^6.1.0",
63 "google-closure-compiler": "20190301.0.0",
packages/react-debug-tools/src/ReactDebugHooks.js
+2 -1
@@ -117,7 +117,8 @@ function useState<S>(
117 hook !== null
118 ? hook.memoizedState
119 : typeof initialState === 'function'
120 - ? initialState()
120 + ? // $FlowFixMe: Flow doesn't like mixed types
121 + initialState()
122 : initialState;
123 hookLog.push({primitive: 'State', stackError: new Error(), value: state});
124 return [state, (action: BasicStateAction<S>) => {}];
packages/react-dom/src/server/ReactPartialRendererHooks.js
+1
@@ -247,6 +247,7 @@ function useContext<T>(
247 }
248
249 function basicStateReducer<S>(state: S, action: BasicStateAction<S>): S {
250 + // $FlowFixMe: Flow doesn't like mixed types
251 return typeof action === 'function' ? action(state) : action;
252 }
253
packages/react-reconciler/src/ReactFiberHooks.js
+2
@@ -623,6 +623,7 @@ function createFunctionComponentUpdateQueue(): FunctionComponentUpdateQueue {
623 }
624
625 function basicStateReducer<S>(state: S, action: BasicStateAction<S>): S {
626 + // $FlowFixMe: Flow doesn't like mixed types
627 return typeof action === 'function' ? action(state) : action;
628 }
629
@@ -843,6 +844,7 @@ function mountState<S>(
844 ): [S, Dispatch<BasicStateAction<S>>] {
845 const hook = mountWorkInProgressHook();
846 if (typeof initialState === 'function') {
847 + // $FlowFixMe: Flow doesn't like mixed types
848 initialState = initialState();
849 }
850 hook.memoizedState = hook.baseState = initialState;
packages/react-test-renderer/src/ReactShallowRenderer.js
+1
@@ -173,6 +173,7 @@ function createHook(): Hook {
173 }
174
175 function basicStateReducer<S>(state: S, action: BasicStateAction<S>): S {
176 + // $FlowFixMe: Flow doesn't like mixed types
177 return typeof action === 'function' ? action(state) : action;
178 }
179
packages/shared/getComponentName.js
+1 -1
@@ -51,7 +51,7 @@ function getComponentName(type: mixed): string | null {
51 }
52 }
53 if (typeof type === 'function') {
54 - return type.displayName || type.name || null;
54 + return (type: any).displayName || type.name || null;
55 }
56 if (typeof type === 'string') {
57 return type;
packages/shared/objectIs.js
+4 -1
@@ -17,4 +17,7 @@ function is(x: any, y: any) {
17 );
18 }
19
20 -export default typeof Object.is === 'function' ? Object.is : is;
20 +const objectIs: (x: any, y: any) => boolean =
21 + typeof Object.is === 'function' ? Object.is : is;
22 +
23 +export default objectIs;
scripts/flow/config/flowconfig
+1 -1
@@ -50,4 +50,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
50 suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
51
52 [version]
53 -^0.89.0
53 +^0.97.0
yarn.lock
+4 -4
@@ -5886,10 +5886,10 @@ flatted@^2.0.0:
5886 resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
5887 integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==
5888
5889 -flow-bin@0.89:
5890 - version "0.89.0"
5891 - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.89.0.tgz#6bd29c2af7e0f429797f820662f33749105c32fa"
5892 - integrity sha512-DkO4PsXYrl53V6G5+t5HbRMC5ajYUQej2LEGPUZ+j9okTb41Sn5j9vfxsCpXMEAslYnQoysHhYu4GUZsQX/DrQ==
5889 +flow-bin@0.97:
5890 + version "0.97.0"
5891 + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.97.0.tgz#036ffcfc27503367a9d906ec9d843a0aa6f6bb83"
5892 + integrity sha512-jXjD05gkatLuC4+e28frH1hZoRwr1iASP6oJr61Q64+kR4kmzaS+AdFBhYgoYS5kpoe4UzwDebWK8ETQFNh00w==
5893
5894 fluent-syntax@0.13.0:
5895 version "0.13.0"