mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This Diff introduces some changes in the CodeGen to properly generate the types in the right folder. ## Issue The codegen on iOS defines the output folder once, before creating the generated code. When the code we have to generate is just a TurboModule (TM) or a Fabric Component (FC), this mechanism works properly. However, if a library has to generate both TM and FC, actually using the library type `all`, all the code is generated using the TurboModules' output folder. (**Note:** Android only works in this way) This generates invalid code because all the FC's `#import` directives assumes that the code is generated in the FC output path which, in this case, is not. ## Solution The adopted solution moves the responsibility to decide where the files has to be generated to the CodeGen step instead of in the preparatory phases. The two paths are precomputed in the `generate-artifacts.js` script (the entry point for the CodeGen) and they are passed to all the scripts that requires them. Once they reach the `RNCodegen.js` file, the generators creates the files and save them in the proper paths. ## Changelog [iOS][Changed] - CodeGen now supports the `"all"` library type. Reviewed By: cortinico, dmitryrykun Differential Revision: D35820848 fbshipit-source-id: ce7f5393936e2ae17f8b2c970f6a011d27f641f2