Files
react-native/packages/react-native-codegen
MaeIg a448c6d80f Extract the functions to compute partial properties in the Flow and TypeScript parsers. (#36373)
Summary:
This PR aims to extract  the switch(configType) block from the buildSchema function into a separate function in a shared file between typescript and flow. It is a task of https://github.com/facebook/react-native/issues/34872:
> [Codegen 77 - assigned to MaeIg] Extract the functions to compute partial properties from the index.js file ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L180-L194) and [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L261-L278))in the Flow and TypeScript parsers.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Extract the functions to compute partial properties in the Flow and TypeScript parsers.

Pull Request resolved: https://github.com/facebook/react-native/pull/36373

Test Plan:
yarn flow:
<img width="560" alt="image" src="https://user-images.githubusercontent.com/40902940/222934040-97e88691-c1d6-44a1-b7ee-e500b4698cd2.png">

yarn lint:
<img width="509" alt="image" src="https://user-images.githubusercontent.com/40902940/222934137-05b6f1fd-a755-4323-baac-5954d36fd613.png">

yarn test
<img width="388" alt="image" src="https://user-images.githubusercontent.com/40902940/222934145-76a2bc38-7469-4c30-9301-bc21cfadded4.png">

Reviewed By: cipolleschi

Differential Revision: D43867937

Pulled By: rshest

fbshipit-source-id: f78fe399ff7d7d2cf8f44d1165418566b0a25628
2023-03-07 03:15:52 -08:00
..
2022-02-22 02:23:02 -08:00
2020-09-29 14:39:40 -07:00

@react-native/codegen

Version

Installation

yarn add --dev @react-native/codegen

Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like

Testing

To run the tests in this package, run the following commands from the react Native root folder:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest react-native-codegen.