mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d9f2cbe455
Summary: Part of Codegen Issue https://github.com/facebook/react-native/issues/34872 > [Codegen 88] Move the Visitor.js file from parsers/flow/Visitor.js to parser-promitives.js. Copy the TSInterfaceDeclaration(node: $FlowFixMe) function and add it to the Visitor.js just copied. Remove the parsers/typescript/Visitor.js. Make sure we use the same Visitor in both parsers. (We will end up with a Visitor that is the union of the two, being able to handle both Flow and TS. In this specific case, this trade-off make sense as it allows us to remove one file, several duplicated lines for a small price.) ## 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 Visitor function to parsers primitives and remove both parsers visitor files Pull Request resolved: https://github.com/facebook/react-native/pull/36459 Test Plan: ``` yarn jest yarn flow yarn lint yarn format-check ``` Reviewed By: cortinico Differential Revision: D44021825 Pulled By: cipolleschi fbshipit-source-id: ea465404830402c44081143ee0539107dc75776c
@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.