A framework for building native applications using React
Merge TS & Flow parsers' logic for `Partial` case to `emitPartial` fn & `commonTypes` cases into `emitCommonTypes` fn (#36450)
Summary: > [Codegen 78 - Assigned to Pranav-yadav] It depends on [Codegen 75][Codegen 76][Codegen 77] Extract the logic that emits Partial values in an emitPartial function, which takes the Parsers as parameter. >[Codegen 79 - Assigned to Pranav-yadav] It depends on [Codegen 78] Extract the basic cases logics (case Stringish, case Int32, case Double, ..., case Partial. `Flow` lines and `TypeScript` lines into a function emitCommonTypes in `parsers-primitives.js`. Make sure that the default case returns `null`. Call this function in the default: case `Flow`, `TypeScript` of the `index.js` file: if the function return something, return that from the default case; otherwise if the `emitCommonTypes` returns `null`, keep the current default implementation (throw the error). ### Changes - merged TS & Flow parsers' logic for `Partial` case to `emitPatial` fn - merged TS & Flow parsers' logic for below cases: - `Stringish` - `Int32` - `Double` - `Float` - `UnsafeObject` - `Object` - `Partial` - into an `emitCommonTypes` fn into `parsers-primitives.js` - add **_tests_** for `emitPartial` and `emitCommonTypes` fn's - add `getAnnotatedElementProperties` fn to parser & impl to both TS & Flow parsers ## Changelog: [INTERNAL] [CHANGED] - Merge TS & Flow parsers' logic for `Partial` case to `emitPatial` fn & `commonTypes` cases into `emitCommonTypes` fn Pull Request resolved: https://github.com/facebook/react-native/pull/36450 Test Plan: - `yarn lint && yarn run flow && yarn jest react-native` ⇒ � Reviewed By: rshest Differential Revision: D44132308 Pulled By: cipolleschi fbshipit-source-id: f965e85ecc5d94e57ad85334ce565a55c512fde4
P
Pranav Yadav committed
2f25261b8886363855f3653be840332e2c9ff9e0
Parent: 4b6b706
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 3/20/2023, 2:32:14 PM