Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNGP - Monorepo: Make sure libraries are honoring codegenDir provided by app #36128

Closed
wants to merge 2 commits into from

Conversation

cortinico
Copy link
Contributor

Summary:
This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a codegenDir in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in readPackageJsonFile function restricting
the access to those functions only to .root which is the only field they're accessing.

Fixes #35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

@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 Feb 10, 2023
@facebook-github-bot
Copy link
Contributor

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

@react-native-bot react-native-bot added Bug Platform: Android Android applications. labels Feb 10, 2023
cortinico and others added 2 commits February 10, 2023 08:45
Summary:
In our build logic we're mixing `plugins{}` and `buildscript{}`
which have unprectable side-effect on the build classpath.

I'm moving over everything to use `plugins{}`. This is possible now
that we don't use build from source for New Architecture anymore.

Changelog:
[Internal] [Changed] - Do not use a mixture of plugins{} and buildscript{}

Differential Revision: D43186768

fbshipit-source-id: 4ab88a4f0045f21acea896f4d30858b4fa1b16ee
… by app (facebook#36128)

Summary:
Pull Request resolved: facebook#36128

This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.

Fixes facebook#35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

fbshipit-source-id: 0fce65782271f027c5be600f40d4fa9737f14248
@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,479,774 +8
android hermes armeabi-v7a 7,800,642 +18
android hermes x86 8,955,452 -10
android hermes x86_64 8,813,256 -35
android jsc arm64-v8a 6,697,078 -2,419,888
android jsc armeabi-v7a 7,488,759 -824,279
android jsc x86 9,221,480 +53,111
android jsc x86_64 6,922,248 -2,504,955

Base commit: 96df8c0
Branch: main

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 10, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0487108.

cortinico added a commit that referenced this pull request Mar 6, 2023
… by app (#36128)

Summary:
Pull Request resolved: #36128

This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.

Fixes #35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

fbshipit-source-id: 5c5ca39397306120b6b6622cb728633bd331e021
kelset pushed a commit that referenced this pull request Mar 6, 2023
… by app (#36128)

Summary:
Pull Request resolved: #36128

This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.

Fixes #35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

fbshipit-source-id: 5c5ca39397306120b6b6622cb728633bd331e021
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
… by app (facebook#36128)

Summary:
Pull Request resolved: facebook#36128

This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.

Fixes facebook#35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

fbshipit-source-id: 5c5ca39397306120b6b6622cb728633bd331e021
@cipolleschi cipolleschi mentioned this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 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 Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codegenDir property in library is ignoring the value set in the app project.
4 participants