From 1f65bf9545cd84bbf1be7a7a91cb0b4f8b4b47ba Mon Sep 17 00:00:00 2001 From: "SamChou19815 (Meta Employee)" Date: Mon, 9 Sep 2024 19:53:43 -0700 Subject: [PATCH] Upgrade Flow to 0.245.2 (#30919) Summary: ## Summary This PR bumps Flow all the way to the latest 0.245.2. Most of the suppressions comes from Flow v0.239.0's change to include undefined in the return of `Array.pop`. I also enabled `react.custom_jsx_typing=true` and added custom jsx typing to match the old behavior that `React.createElement` is effectively any typed. This is necessary since various builtin components like `React.Fragment` is actually symbol in the React repo instead of `React.AbstractComponent<...>`. It can be made more accurate by customizing the `React$CustomJSXFactory` type, but I will leave it to the React team to decide. ## How did you test this change? `yarn flow` for all the renderers DiffTrain build for commit https://github.com/facebook/react/commit/e210d08180a63f42079b91acaa7f6af15eef6d32. Reviewed By: yungsters Differential Revision: D62384646 Pulled By: SamChou19815 fbshipit-source-id: 727794f2d4091f37d771854b8e8a52f070309213 --- .../Libraries/Renderer/shims/ReactNativeTypes.js | 6 +++--- .../__tests__/__snapshots__/public-api-test.js.snap | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js index cc70a909932..dce31567710 100644 --- a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js @@ -7,7 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<89361333bb6b688486e35849a9c669a6>> + * @generated SignedSource<<3eb929731c259569c7af3b6479e486fe>> */ import type { @@ -234,8 +234,8 @@ export type ReactNativeType = { ): ?ElementRef, unmountComponentAtNode(containerTag: number): void, unmountComponentAtNodeAndRemoveContainer(containerTag: number): void, - unstable_batchedUpdates: (fn: (T) => void, bookkeeping: T) => void, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType, + +unstable_batchedUpdates: (fn: (T) => void, bookkeeping: T) => void, + +__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType, ... }; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 4cdcedd1b6b..176f0810cb4 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -7829,8 +7829,8 @@ export type ReactNativeType = { ): ?ElementRef, unmountComponentAtNode(containerTag: number): void, unmountComponentAtNodeAndRemoveContainer(containerTag: number): void, - unstable_batchedUpdates: (fn: (T) => void, bookkeeping: T) => void, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType, + +unstable_batchedUpdates: (fn: (T) => void, bookkeeping: T) => void, + +__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType, ... }; declare export opaque type Node;