mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a448c6d80f
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
@react-native/codegen
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:
yarnto install the dependencies. You just need to run this onceyarn jest react-native-codegen.