Skip to content

Bump React Native Codegen to 0.0.16#33749

Closed
cipolleschi wants to merge 5 commits into
facebook:mainfrom
cipolleschi:export-D36096803
Closed

Bump React Native Codegen to 0.0.16#33749
cipolleschi wants to merge 5 commits into
facebook:mainfrom
cipolleschi:export-D36096803

Conversation

@cipolleschi
Copy link
Copy Markdown
Contributor

Summary:
Yet another bump of the Codegen to ship new features for RN 0.69

Changelog:
[Internal] [Changed] - Bump React Native Codegen to 0.0.16

Reviewed By: cipolleschi

Differential Revision: D36096803

Riccardo Cipolleschi and others added 5 commits May 3, 2022 05:41
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.

Differential Revision: D35820848

fbshipit-source-id: 9c3c8dec6e052342b6ae111ec292abd170c69b9c
Summary:
This Diff splits the `generate-artifacts.js` script into:
* `generate-artifacts-executor.js`: which contains the logic to generate the code for iOS.
* `generate-artifacts.js`: which contains the argument parsing logic and invokes the executor.

Finally, it introduces some tests.

## Changelog
[iOS][Changed] - Refactor part of the codegen scripts and add tests.

Differential Revision: D35846674

fbshipit-source-id: b33c6170d6363932bb944074fda063ca3cbe997f
Summary:
This Diff splits the `generate-specs-cli.js` script into:
* `generate-specs-cli-executor.js`: which contains the logic to generate the code for iOS.
* `generate-specs-cli.js`: which contains the argument parsing logic and invokes the executor.

Finally it introduces some tests.

## Changelog
[iOS][Changed] - Refactor part of the codegen scripts and add tests.

Differential Revision: https://www.internalfb.com/diff/D35892576?entry_point=27

fbshipit-source-id: 8d5c012e15bfc396ada0303e71894a42246ad203
facebook#33729)

Summary:
Pull Request resolved: facebook#33729

This PR addresses [this comment](https://www.internalfb.com/diff/D35820848?dst_version_fbid=496290878846487&transaction_fbid=355967423221044).

It makes the CodeGen to the `outputDir` as base directory for the codegen.

Finally, it updates the unit tests accordingly.

## Changelog
[iOS][Changed] - use `outputDir` as base directory for the codegen and remove the possibility to customize the intermediate path. The generated code requires specific paths in the `#include` directive.

Differential Revision: D35935282

fbshipit-source-id: f9e0d29d987fdb4f88b37d540bf6e195798c95db
Summary:
Yet another bump of the Codegen to ship new features for RN 0.69

Changelog:
[Internal] [Changed] - Bump React Native Codegen to 0.0.16

Reviewed By: cipolleschi

Differential Revision: D36096803

fbshipit-source-id: 57ae9d463a39b92876477dc8c295685c3108b1a6
@cipolleschi cipolleschi requested a review from hramos as a code owner May 3, 2022 12:44
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels May 3, 2022
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D36096803

@pull-bot
Copy link
Copy Markdown

pull-bot commented May 3, 2022

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS against 07c2c23

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,775,893 +0
android hermes armeabi-v7a 7,181,339 +0
android hermes x86 8,084,900 +0
android hermes x86_64 8,065,067 +0
android jsc arm64-v8a 9,650,077 +0
android jsc armeabi-v7a 8,424,169 +0
android jsc x86 9,599,556 +0
android jsc x86_64 10,197,138 +0

Base commit: a0a45dc
Branch: main

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a0a45dc
Branch: main

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cortinico in b9bb30b.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants