From d3c6c16a0312b4d2051d75aaf85bb5335a8a6fa6 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Tue, 4 Oct 2022 10:50:31 -0400 Subject: [PATCH] Flow upgrade to 0.145 Fixed a RN library definition that defined `CustomEvent` as a reference to itself. ghstack-source-id: 90da2e316f4caf3e5ff1172982f02d0a87a45ecb Pull Request resolved: https://github.com/facebook/react/pull/25409 --- package.json | 2 +- .../src/ReactNativeGetListeners.js | 3 --- scripts/flow/config/flowconfig | 2 +- scripts/flow/react-native-host-hooks.js | 13 ++++++++++++- yarn.lock | 8 ++++---- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f34cce9415e38..33ca768ab71ad 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "eslint-plugin-react-internal": "link:./scripts/eslint-rules", "fbjs-scripts": "1.2.0", "filesize": "^6.0.1", - "flow-bin": "^0.143.0", + "flow-bin": "^0.145.0", "glob": "^7.1.6", "glob-stream": "^6.1.0", "google-closure-compiler": "^20200517.0.0", diff --git a/packages/react-native-renderer/src/ReactNativeGetListeners.js b/packages/react-native-renderer/src/ReactNativeGetListeners.js index 2ab198c504383..1bd7a49acc359 100644 --- a/packages/react-native-renderer/src/ReactNativeGetListeners.js +++ b/packages/react-native-renderer/src/ReactNativeGetListeners.js @@ -122,9 +122,6 @@ export default function getListeners( detail: syntheticEvent.nativeEvent, }); eventInst.isTrusted = true; - // setSyntheticEvent is present on the React Native Event shim. - // It is used to forward method calls on Event to the underlying SyntheticEvent. - // $FlowFixMe eventInst.setSyntheticEvent(syntheticEvent); listenerObj.listener(eventInst, ...args); diff --git a/scripts/flow/config/flowconfig b/scripts/flow/config/flowconfig index 03ebe986a168a..e8e11f7233f71 100644 --- a/scripts/flow/config/flowconfig +++ b/scripts/flow/config/flowconfig @@ -50,4 +50,4 @@ munge_underscores=false %REACT_RENDERER_FLOW_OPTIONS% [version] -^0.143.0 +^0.145.0 diff --git a/scripts/flow/react-native-host-hooks.js b/scripts/flow/react-native-host-hooks.js index 86f5cabe7400c..1b87cc247cc39 100644 --- a/scripts/flow/react-native-host-hooks.js +++ b/scripts/flow/react-native-host-hooks.js @@ -143,7 +143,18 @@ declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' emit: (channel: string, event: RawEventEmitterEvent) => string, ... }; - declare export var CustomEvent: CustomEvent; + declare export class CustomEvent { + isTrusted: boolean; + + constructor( + name: string, + { + detail: any, + }, + ): void; + + setSyntheticEvent(event: any): void; + } } declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore' { diff --git a/yarn.lock b/yarn.lock index 33cc0aafa251a..6ded6d98bcb38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7911,10 +7911,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== -flow-bin@^0.143.0: - version "0.143.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.143.1.tgz#2ff825dfd85e84531b0ae780842cb1c2a9743cd2" - integrity sha512-6S6bgZ/pghBzEUELXkwFH/bsHT+GBMo8ftHDYs0SSJ+1e6NRdFfqxcYhaTvAK8zteSfQLZBIoec6G4WPPp4qQg== +flow-bin@^0.145.0: + version "0.145.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.145.0.tgz#922f7c3568caaa5eb64621ec536deb56b24d1795" + integrity sha512-+9fi9BMxRBtSWC1x0hWggWTb8Vih+AC7wyvLAX5wR1m6u2lF2HLtixXqy2GX8bWgaynSEJR5lmPxYYC4wMI8cA== fluent-syntax@0.13.0: version "0.13.0"