mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
7b345bca55
Summary: This PR reduces code duplication by extracting all the errors in the module/errors into a single parsers/errors.js file. All the errors must drop the corresponding Flow or Typescript token in the name and take an extra language parameter in the constructor. Also, rename the hasteModuleName parameter to nativeModuleName. Part of https://github.com/facebook/react-native/issues/34872 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Extract all the parsers errors in the module/errors into a single parsers/errors.js file Pull Request resolved: https://github.com/facebook/react-native/pull/34896 Test Plan: run ```yarn jest react-native-codegen``` and check all test case passes. <img width="793" alt="image" src="https://user-images.githubusercontent.com/34857453/194545577-cf2d980b-b6b7-4f93-b13e-2e45d92dceab.png"> Reviewed By: rshest Differential Revision: D40176486 Pulled By: rshest fbshipit-source-id: b33ae49b2bcceeffd307370ee5e3b24a9e1bb340
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.