Skip to content

Commit 606448c

Browse files
authored
Add prototype for Maven solution and further considerations
1 parent ec85a28 commit 606448c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

proposals/0000-out-of-npm-artifacts.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,20 @@ This will partially mitigate the issue as the `android-prebuilts` package will s
266266
### Dedicated Maven Repository
267267

268268
Ideally we could look into publishing the `/android` folder into a remote Maven Repository (most likely Maven Central).
269+
We could re-use a Maven Repository to store artifacts which are not Android-specific (e.g. the Hermes iOS Tarball).
270+
271+
#### Prototype
272+
273+
A prototype of how the storing of the Hermes iOS Tarball on Maven would look like is available on: [react-native#34812](https://github.com/facebook/react-native/pull/34812).
274+
275+
This has been tested against RN Tester iOS on `main` and the tarball download is working correctly.
269276

270277
#### Pro
271278

272-
* Uses a packaging system which is familiar for Android developers and re-uses the already existing caching/perf improvement that are shipping with the platform pipeline.
279+
* For Android: Uses a packaging system which is familiar for Android developers and re-uses the already existing caching/perf improvement that are shipping with the platform pipeline.
273280
* A practical benefit of this is that users will have only a local copy of react-native or hermes-engine inside their `~/.gradle` folder instead of having multiple copies, one for every RN project.
281+
* For iOS: We would have stable URLs which can be easily composed with the release version (e.g. https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.0.1/react-native-artifacts-0.0.1-hermes-ios.tar.gz)
282+
* We will end up using a single solution for both platforms, resulting in reduced maintainance costs.
274283
* Users will download the artifact they need at build time only when needed
275284
* E.g. iOS-only users will benefit of faster `yarn install` and smaller `node_modules` folder.
276285
* Users which are not using Hermes will benefit similarly as well
@@ -282,7 +291,7 @@ Ideally we could look into publishing the `/android` folder into a remote Maven
282291

283292
#### Cons
284293

285-
* This solution addressed only the Android/JVM side of the problem.
294+
* ~This solution addressed only the Android/JVM side of the problem~ See the prototype paragraph for a solution that works on both platforms.
286295
* We will have to publish to remote Maven Repositories as part of our RN release process (i.e. a new step inside the CircleCI config, means yet another thing that can be broken) + we’ll have to maintain GPG keys for publishing.
287296
* We’ll have to make sure NPM packages and Maven pubblications are syncronized with a version number.
288297

@@ -334,11 +343,8 @@ We could extend on Github Releases as we’re doing today for the Hermes iOS tar
334343

335344
## Preferred solution
336345

337-
We're currently investigating the feasibility of the OCI Images solution.
346+
We've investigated prototype for both the OCI and the Maven solution.
338347

339-
At the time of writing we're leaning towards opting for either:
340-
- Using only the OCI image approach to store all the artifacts
341-
- Store platform specific artifacts with the platform specific solution (Android on Maven Central, iOS on CocoaPods, etc.)
342-
- The hybrid solution.
348+
At this stage the preferred solution is Maven, due to the list of PROs. This solution will make consuming artifacts easier for users and will reduce the maintainance costs on core contributors and release managers.
343349

344350
As this change is going to affect contributors, library authors, and developers of tools on top of React Native, we're sharing this RFC publicly to collect consensus and feedback.

0 commit comments

Comments
 (0)