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

[RFC] Distributing RN Android artifacts via npm instead of JCenter #3267

Closed
mkonicek opened this issue Oct 7, 2015 · 5 comments
Closed

[RFC] Distributing RN Android artifacts via npm instead of JCenter #3267

mkonicek opened this issue Oct 7, 2015 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mkonicek
Copy link
Contributor

mkonicek commented Oct 7, 2015

I've been thinking about distributing the Android artifacts via npm instead of Maven Central, like it's done on iOS (we distribute source code there).

Having two separate systems makes things more complicated. How do people upgrade their app to a new version of React Native, for example? Currently, people have to update both:

package.json:

"dependencies": {
  "react-native": "0.11.4",
}

build.gradle: compile 'com.facebook.react:react-native:0.11.+'

Releasing would also become easier: just npm publish.

@mkonicek
Copy link
Contributor Author

mkonicek commented Oct 7, 2015

@ide I think you've proposed this too some time ago?

cc @foghina @kmagiera

@satya164
Copy link
Contributor

satya164 commented Oct 7, 2015

If a module depends on a third party library from maven or jcenter, how is it handled?

@ide
Copy link
Contributor

ide commented Oct 7, 2015

I'm in favor of using npm for distributing code and using a system like Buck or Gradle (fyi I'd be interested in trying Buck instead of Gradle) to set up the classpath and link the dependencies together. We do something similar with CocoaPods: instead of using the copy of React Native published to the CocoaPods repo, I point the CocoaPods tool at node_modules/react-native.

Would the dependencies like Fresco and JSC be included inside the react-native JAR? Or does Gradle know that react-native depends on those libraries, and then fetches them from JCenter / Maven?

@corbt
Copy link
Contributor

corbt commented Oct 7, 2015

@satya164 currently Android modules that are implemented using the strategy laid out by @chirag04 here are able to declare dependencies from maven central/jcenter and they are compiled just fine. Here's a random android RN library I found. You can see from its build.gradle that it depends on a couple of other Java libraries. This works because the module is designated as a subproject to the main Android app project, and Gradle recursively builds that project's dependencies as well.

Not totally sure though how that would work if one RN module with native Android code depends on another RN module with native Android code though, which is probably an important use case to support...

@ide mentioned switching to Buck as one possibility. As a sometimes Android developer I have no particular love for Gradle, and if this turns out to be an easier problem to solve with Buck because FB has control of its development, I don't think that would be a dealbreaker for most users. That being said, the fast-intermediate-build that seems to be Buck's biggest draw (for use outside FB) is much less interesting with RN projects because you have to rebuild so infrequently anyway. So if a Gradle plugin/config generator can do the job, that's probably better just from a familiarity point of view. This would be especially important in adding React Native to existing apps, which may already have a complex Gradle-based build process (although I don't know how much demand there will be for that in general -- I just know that I'm planning on moving a few things over in a piecemeal fashion).

@mkonicek
Copy link
Contributor Author

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/rfc-distributing-rn-android-artifacts-via-npm-instead-of-jcenter

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix. We rely on the community to provide
bugfixes as the core team is focused on performance.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants