From 6064fd06002ef53b4981844f4b3bc04d9af0ef28 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 26 May 2022 12:59:52 -0700 Subject: [PATCH] Presuppress xplat and upgrade to 0.178.1 Summary: This diff upgrades xplat to 0.178.1 and pre-suppresses errors from turning on constrained writes. To generate this diff I: * Modified every `env_mode=constrain_writes` to `env_mode=ssa` and made a commit (this is so our upgrade script will work) * Ran scripts/flow/upgrade.sh 0.178.1 to upgrade all the flowconfigs to 178.1 and suppress new-env errors * Modified arvr/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project arvr` * Modified xplat/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project xplat` * Unstacked from the commit in point 1 Reviewed By: SamChou19815 Differential Revision: D36676019 fbshipit-source-id: c3032f18ed838afc327f00de563e7f20713bdc26 --- .flowconfig | 2 +- .flowconfig.android | 2 +- Libraries/Animated/useAnimatedProps.js | 1 + Libraries/Lists/VirtualizedList.js | 1 + Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js | 3 +++ Libraries/Performance/PureComponentDebug.js | 1 + Libraries/StyleSheet/splitLayoutProps.js | 2 ++ package.json | 2 +- .../js/examples/AnimatedGratuitousApp/AnExTilt.js | 1 + packages/rn-tester/js/examples/XHR/XHRExampleFetch.js | 1 + repo-config/package.json | 2 +- template/_flowconfig | 2 +- yarn.lock | 8 ++++---- 13 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.flowconfig b/.flowconfig index c857eaa1da0..51f8f2f5f5d 100644 --- a/.flowconfig +++ b/.flowconfig @@ -73,4 +73,4 @@ untyped-import untyped-type-import [version] -^0.178.0 +^0.178.1 diff --git a/.flowconfig.android b/.flowconfig.android index c67ab5fb840..839ab2c1815 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -73,4 +73,4 @@ untyped-import untyped-type-import [version] -^0.178.0 +^0.178.1 diff --git a/Libraries/Animated/useAnimatedProps.js b/Libraries/Animated/useAnimatedProps.js index 8629fd4ebdf..9ab24a99ce1 100644 --- a/Libraries/Animated/useAnimatedProps.js +++ b/Libraries/Animated/useAnimatedProps.js @@ -82,6 +82,7 @@ export default function useAnimatedProps( scheduleUpdate(); } else if (!node.__isNative) { // $FlowIgnore[not-a-function] - Assume it's still a function. + // $FlowFixMe[incompatible-use] instance.setNativeProps(node.__getAnimatedValue()); } else { throw new Error( diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 551faf57610..0dcad862920 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1269,6 +1269,7 @@ class VirtualizedList extends React.PureComponent { refreshControl={ props.refreshControl == null ? ( 0) { return matches[0]; } + // $FlowFixMe[incompatible-use] return codeFrame.fileName; } function getLocation() { + // $FlowFixMe[incompatible-use] const location = codeFrame.location; if (location != null) { return ` (${location.row}:${ diff --git a/Libraries/Performance/PureComponentDebug.js b/Libraries/Performance/PureComponentDebug.js index ec172ca6e4a..91ca67c1669 100644 --- a/Libraries/Performance/PureComponentDebug.js +++ b/Libraries/Performance/PureComponentDebug.js @@ -61,6 +61,7 @@ class PureComponentDebug< } } for (const key in this.state) { + // $FlowFixMe[incompatible-use] if (this.state[key] !== (nextState || {})[key]) { ret = true; console.warn('PureComponentDebug: different state values', tag, key); diff --git a/Libraries/StyleSheet/splitLayoutProps.js b/Libraries/StyleSheet/splitLayoutProps.js index 570e83f029c..8575d263873 100644 --- a/Libraries/StyleSheet/splitLayoutProps.js +++ b/Libraries/StyleSheet/splitLayoutProps.js @@ -50,10 +50,12 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): { case 'top': case 'transform': // $FlowFixMe[cannot-write] + // $FlowFixMe[incompatible-use] outer[prop] = props[prop]; break; default: // $FlowFixMe[cannot-write] + // $FlowFixMe[incompatible-use] inner[prop] = props[prop]; break; } diff --git a/package.json b/package.json index 1fccce9d86a..56875a9be7e 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "ws": "^6.1.4" }, "devDependencies": { - "flow-bin": "^0.178.0", + "flow-bin": "^0.178.1", "react": "18.0.0", "react-test-renderer": "^18.0.0" }, diff --git a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExTilt.js b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExTilt.js index 37d53d1df93..3f9552ca88d 100644 --- a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExTilt.js +++ b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExTilt.js @@ -21,6 +21,7 @@ class AnExTilt extends React.Component { opacity: new Animated.Value(1), burns: new Animated.Value(1.15), }; + // $FlowFixMe[prop-missing] this.state.tiltPanResponder = PanResponder.create({ onStartShouldSetPanResponder: () => true, onPanResponderGrant: () => { diff --git a/packages/rn-tester/js/examples/XHR/XHRExampleFetch.js b/packages/rn-tester/js/examples/XHR/XHRExampleFetch.js index 5fb0408c612..30590a3b3c8 100644 --- a/packages/rn-tester/js/examples/XHR/XHRExampleFetch.js +++ b/packages/rn-tester/js/examples/XHR/XHRExampleFetch.js @@ -48,6 +48,7 @@ class XHRExampleFetch extends React.Component { const keys = Object.keys(this.responseHeaders.map); for (let i = 0; i < keys.length; i++) { const key = keys[i]; + // $FlowFixMe[incompatible-use] const value = this.responseHeaders.get(key); responseHeaders.push( diff --git a/repo-config/package.json b/repo-config/package.json index 26e77de1442..e705d8157d2 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -34,7 +34,7 @@ "eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-native": "^3.11.0", "eslint-plugin-relay": "^1.8.2", - "flow-bin": "^0.178.0", + "flow-bin": "^0.178.1", "inquirer": "^7.1.0", "jest": "^26.6.3", "jest-junit": "^10.0.0", diff --git a/template/_flowconfig b/template/_flowconfig index 9b02c911cf9..b361f33094c 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -63,4 +63,4 @@ untyped-import untyped-type-import [version] -^0.178.0 +^0.178.1 diff --git a/yarn.lock b/yarn.lock index 16a0a9de1ef..145f642ff9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3226,10 +3226,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.178.0: - version "0.178.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.178.0.tgz#893f32bbb2bea09a5cf53446d99d4c791b2220b2" - integrity sha512-D1S8c/oaiHAeKaxNxdJJ6SxjxwetNRgPWc9PI1wCSNfB3o0gAJKE5ic2B84c2QmRcs6dMYw6b9GDelYpWsArfg== +flow-bin@^0.178.1: + version "0.178.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.178.1.tgz#c0ce2f50080d00b29018c6f044b1d2edac9a9e2d" + integrity sha512-B6vFVkAoilnRTAwhGiVCPb777cVjIW9VwbLJTTg2vRbXjLgYIZJMmU0mit7ZSsvoOucT5WBwrrC8M0wkRoeSZA== flow-parser@0.*: version "0.163.0"