mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove miscellaneous exports of NativeModule Flow types in Codegen Schema
Summary: CodegenSchema exports `NativeModuleMethodParamSchema` and `NativeModuleObjectTypeAnnotationPropertySchema`, which are partials of NativeModule type annotations. This creates unnecessary coupling between the type annotations of CodegenSchema and the files that depend on it. **Actual Problem:** Suppose that we want to rename one of these partials. Then, all imports in all files would have to be updated, even when the actual shape of the composed type annotation wasn't changed. This diff removes these partials, which reduces the surface area of the exports of CodegenSchema.js Changelog: [Internal] Reviewed By: yungsters Differential Revision: D24719396 fbshipit-source-id: c822aaa252f156c524f4ef4917ebb61b1a39ff9e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
04f235e7fb
commit
c6b8c75b6b
@@ -13,7 +13,8 @@
|
||||
import type {
|
||||
SchemaType,
|
||||
NativeModulePropertySchema,
|
||||
NativeModuleMethodParamSchema,
|
||||
Nullable,
|
||||
NamedShape,
|
||||
NativeModuleFunctionTypeAnnotation,
|
||||
NativeModuleParamTypeAnnotation,
|
||||
} from '../../CodegenSchema';
|
||||
@@ -99,8 +100,10 @@ ${modules}
|
||||
`;
|
||||
};
|
||||
|
||||
type Param = NamedShape<Nullable<NativeModuleParamTypeAnnotation>>;
|
||||
|
||||
function serializeArg(
|
||||
arg: NativeModuleMethodParamSchema,
|
||||
arg: Param,
|
||||
index: number,
|
||||
resolveAlias: AliasResolver,
|
||||
): string {
|
||||
|
||||
Reference in New Issue
Block a user