Use any where Flow Object/Function meant any (#59093)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/59093

X-link: https://github.com/react/metro/pull/2068

With `experimental.function_and_object_type_is_no_longer_any`, Flow resolves `Object` and `Function` to the builtin class types instead of `any`. These Metro annotations relied on the old meaning, so they become `any`, which keeps the current behavior:

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D125303050

fbshipit-source-id: 205770089107ddf26b258b0efdb8480ce1c2bcc9
This commit is contained in:
Sam Zhou authored and meta-codesync[bot] committed 2026-10-14 15:58:54 -07:00
1 parent 7f5df1da2d
commit 1e70d04ceb
2 files changed
+8 -8

No files matched your search

+7 -7
View File
@@ -3570,7 +3570,7 @@ declare module "@babel/types" {
declare export function isExportSpecifier(node: ?Object, opts?: ?Object): node is ExportSpecifier;
declare export function isForOfStatement(node: ?Object, opts?: ?Object): node is ForOfStatement;
declare export function isImportDeclaration(node: ?Object, opts?: ?Object): node is ImportDeclaration;
declare export function isImportDefaultSpecifier(node: ?Object, opts?: ?Object): node is ImportDefaultSpecifier;
declare export function isImportDefaultSpecifier(node: ?Object, opts?: ?any): node is ImportDefaultSpecifier;
declare export function isImportNamespaceSpecifier(node: ?Object, opts?: ?Object): node is ImportNamespaceSpecifier;
declare export function isImportSpecifier(node: ?Object, opts?: ?Object): node is ImportSpecifier;
declare export function isImportExpression(node: ?Object, opts?: ?Object): node is ImportExpression;
@@ -3589,9 +3589,9 @@ declare module "@babel/types" {
declare export function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): node is ExportNamespaceSpecifier;
declare export function isOptionalMemberExpression(node: ?Object, opts?: ?Object): node is OptionalMemberExpression;
declare export function isOptionalCallExpression(node: ?Object, opts?: ?Object): node is OptionalCallExpression;
declare export function isClassProperty(node: ?Object, opts?: ?Object): node is ClassProperty;
declare export function isClassProperty(node: ?any, opts?: ?Object): node is ClassProperty;
declare export function isClassAccessorProperty(node: ?Object, opts?: ?Object): node is ClassAccessorProperty;
declare export function isClassPrivateProperty(node: ?Object, opts?: ?Object): node is ClassPrivateProperty;
declare export function isClassPrivateProperty(node: ?any, opts?: ?Object): node is ClassPrivateProperty;
declare export function isClassPrivateMethod(node: ?Object, opts?: ?Object): node is ClassPrivateMethod;
declare export function isPrivateName(node: ?Object, opts?: ?Object): node is PrivateName;
declare export function isStaticBlock(node: ?Object, opts?: ?Object): node is StaticBlock;
@@ -3699,9 +3699,9 @@ declare module "@babel/types" {
declare export function isTSQualifiedName(node: ?Object, opts?: ?Object): node is TSQualifiedName;
declare export function isTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): node is TSCallSignatureDeclaration;
declare export function isTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): node is TSConstructSignatureDeclaration;
declare export function isTSPropertySignature(node: ?Object, opts?: ?Object): node is TSPropertySignature;
declare export function isTSPropertySignature(node: ?any, opts?: ?Object): node is TSPropertySignature;
declare export function isTSMethodSignature(node: ?Object, opts?: ?Object): node is TSMethodSignature;
declare export function isTSIndexSignature(node: ?Object, opts?: ?Object): node is TSIndexSignature;
declare export function isTSIndexSignature(node: ?any, opts?: ?Object): node is TSIndexSignature;
declare export function isTSAnyKeyword(node: ?Object, opts?: ?Object): node is TSAnyKeyword;
declare export function isTSBooleanKeyword(node: ?Object, opts?: ?Object): node is TSBooleanKeyword;
declare export function isTSBigIntKeyword(node: ?Object, opts?: ?Object): node is TSBigIntKeyword;
@@ -3747,7 +3747,7 @@ declare module "@babel/types" {
declare export function isTSTypeAssertion(node: ?Object, opts?: ?Object): node is TSTypeAssertion;
declare export function isTSEnumBody(node: ?Object, opts?: ?Object): node is TSEnumBody;
declare export function isTSEnumDeclaration(node: ?Object, opts?: ?Object): node is TSEnumDeclaration;
declare export function isTSEnumMember(node: ?Object, opts?: ?Object): node is TSEnumMember;
declare export function isTSEnumMember(node: ?any, opts?: ?Object): node is TSEnumMember;
declare export function isTSModuleDeclaration(node: ?Object, opts?: ?Object): node is TSModuleDeclaration;
declare export function isTSModuleBlock(node: ?Object, opts?: ?Object): node is TSModuleBlock;
declare export function isTSImportType(node: ?Object, opts?: ?Object): node is TSImportType;
@@ -3775,7 +3775,7 @@ declare module "@babel/types" {
declare export function isExpressionWrapper(node: ?Object, opts?: ?Object): node is (ExpressionStatement | ParenthesizedExpression | TypeCastExpression);
declare export function isFor(node: ?Object, opts?: ?Object): node is (ForInStatement | ForStatement | ForOfStatement);
declare export function isForXStatement(node: ?Object, opts?: ?Object): node is (ForInStatement | ForOfStatement);
declare export function isFunction(node: ?Object, opts?: ?Object): node is (FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod);
declare export function isFunction(node: ?any, opts?: ?Object): node is (FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod);
declare export function isFunctionParent(node: ?Object, opts?: ?Object): node is (FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock);
declare export function isPureish(node: ?Object, opts?: ?Object): node is (FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral);
declare export function isDeclaration(node: ?Object, opts?: ?Object): node is (FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration);
+1 -1
View File
@@ -466,7 +466,7 @@ declare module '@babel/core' {
constructor(descriptor: UnloadedDescriptor): ConfigItem;
}
declare export type EntryTarget = string | {...} | Function;
declare export type EntryTarget = string | {...} | any;
declare export type EntryOptions = {...} | false | void;
declare export type PluginEntry =
| EntryTarget