Skip to content

Conversation

@cortinico
Copy link
Member

Hey all,
I'm sharing this RFC I wrote with the support of @renchap & @kelset to solve the problem of our NPM package size. We would love to hear the community's opinion on this change before we take any step in any direction.

We don't believe this change will affect users of React Native but will most likely affect advanced users such as library developers, SDK authors, developers of out-of-tree platforms that rely on our artifacts.

For a better reading experience you can find the file view here.

@cortinico cortinico requested a review from kelset September 9, 2022 13:52
@cortinico cortinico added the 💡 Proposal This label identifies a proposal label Sep 9, 2022
cortinico added a commit to cortinico/react-native that referenced this pull request Sep 28, 2022
Summary:
I'm not going to merge this as it is, this is mostly for discussions with the community for the sake of
RFC facebook#508 react-native-community/discussions-and-proposals#508

Here I'm setting up a :ReactAndroid:external-artifacts Gradle module which is responsible of
uploading arbitrary artifacts to Maven (Central or any other repo).

In this specific example I'm uploading the Hermes iOS tarball which is 500+ Mb.
In this module I've configured the auth with Sonatype for publishing and the GPG signing of the artifacts.

Changelog:
[Internal] [Changed] - Store the iOS Hermes tarball on Maven

Differential Revision: D39886167

fbshipit-source-id: 66edae7f83df35525dc8cccd68bb5bb3a5e02a12
@cortinico
Copy link
Member Author

Update

Hey all,
I'd like to share that we have two working prototypes as part of this RFC:

I've updated the RFC with the considerations from those 2 prototype.

At this stage we're leaning towards the Maven approach. We're still allowing some days to collect feedbacks before making a final decision which will most likely land on 0.71.0.

@cortinico cortinico requested a review from kelset December 8, 2022 11:53
@cortinico
Copy link
Member Author

This can now be merged (cc @kelset and others for approvals)

@billnbell
Copy link

billnbell commented Feb 5, 2023

react-native-quick-sqlite is broken due to this.

@mazhuang123
Copy link

This method makes it impossible to integrate RN in the existing projects of Android, and can only use the old version of React-Native, which is really bad

@cortinico
Copy link
Member Author

This method makes it impossible to integrate RN in the existing projects of Android, and can only use the old version of React-Native, which is really bad

That's not correct. Actually, this method makes 'easier' to integrate with existing Android apps as we're now shipping artifacts to Maven Central, where a lot of other popular Android libraries are living. @mazhuang123 Can you elaborate on what is your problem?

@cortinico
Copy link
Member Author

I hope to get your help

This is not the right repo to ask for support to your specific question.
Please open an issue against https://github.com/facebook/react-native/issues

jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Aug 31, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Sep 4, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit to status-im/status-mobile that referenced this pull request Sep 4, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
alwx pushed a commit to status-im/status-mobile that referenced this pull request Sep 6, 2023
Before what we did was essentially guess what files might exist for any
given package. This approach mostly works, but not entirely.
This is especially problematic when dealing with weird edge case
packages like `react-native`, which you can read about here:

react-native-community/discussions-and-proposals#508
https://github.com/react-native-community/discussions-and-proposals/blob/4a06fc64/proposals/0508-out-of-npm-artifacts.md#the-react-native-android-archive

In order to avoid as much the guessing aspect of fetching Gradle
dependencies we are using both HTML listsings of files and
`artifact-metadata.json` files that exist for more recent packages.

This way we can avoid having to add special edge cases that have been
found out when working on React Native 72 upgrade in:
#17062

Signed-off-by: Jakub Sokołowski <[email protected]>
@therealpurplemana
Copy link

Is there a way to see the discussion links referenced above like: https://github.com/react-native-community/discussions-and-proposals/blob/nc/out-of-npm-rfc/proposals/0000-out-of-npm-artifacts.md#prototype. I’m trying to make some boilerplate for a JSI plugin and having some issues with the Android procedure.

@kelset
Copy link
Member

kelset commented Feb 5, 2024

@therealpurplemana I think this is the link you are talking about? facebook/react-native#34812

you can check them out via: https://github.com/react-native-community/discussions-and-proposals/pull/508/files

@therealpurplemana
Copy link

Thank you

idan2025 added a commit to idan2025/tor-chat-app that referenced this pull request Nov 3, 2025
Root cause: The build was failing because it was looking for React Native artifacts
in node_modules/react-native/android, but React Native 0.71+ no longer ships Android
artifacts in the npm package. They are now distributed via Maven Central.

Error: "Could not find any matches for com.facebook.react:react-native:+"

Solution: Removed the maven repository pointing to node_modules/react-native/android
React Native artifacts are automatically resolved from mavenCentral() which is
already configured.

Reference: react-native-community/discussions-and-proposals#508

Changes:
- Removed maven { url } block for react-native/android
- Removed maven { url } block for jsc-android/dist (also on Maven Central)
- Kept google(), mavenCentral(), Guardian Project, and jitpack repos

This is the correct configuration for React Native 0.71+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Proposal This label identifies a proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants