Skip to content

Add RNRepo to ci builds#4141

Merged
j-piasecki merged 8 commits into
software-mansion:mainfrom
radoslawrolka:rolkrado/apply-rnrepo
May 6, 2026
Merged

Add RNRepo to ci builds#4141
j-piasecki merged 8 commits into
software-mansion:mainfrom
radoslawrolka:rolkrado/apply-rnrepo

Conversation

@radoslawrolka
Copy link
Copy Markdown
Contributor

Description

Adds RNRepo build-tools integration to basic-example so that CI builds can consume pre-built native dependencies instead of compiling them from scratch, speeding up CI.

The integration is guarded by CI=true / ENV['CI'] environment variables, so local development is unaffected. react-native-gesture-handler itself is excluded from prebuilds via rnrepo.config.json so that CI always builds and tests the library from source.

Changes

  • apps/basic-example/android/build.gradle — resolves @rnrepo/build-tools via Node and adds its Gradle plugin JAR to the buildscript classpath.
  • apps/basic-example/android/app/build.gradle — applies org.rnrepo.tools.prebuilds-plugin when running in CI.
  • apps/basic-example/ios/Podfile — requires the RNRepo CocoaPods plugin and calls rnrepo_post_install in the post_install hook, both gated on ENV['CI'].
  • apps/basic-example/package.json — adds @rnrepo/build-tools ~0.1.3-beta.0 as a dev dependency.
  • rnrepo.config.json — root-level RNRepo config that denylists react-native-gesture-handler on both Android and iOS so the library itself is always compiled from source.

Performance

CI build time comparison (rnrepo vs baseline):

Platform Category rnrepo basic Faster
Android Without runner cache 6:41 11:01 39.3%
Android With runner cache 6:31 avg 10:25 avg 37.4%
iOS Without runner cache 2:44 3:16 16.3%
iOS With runner cache 2:47 avg 3:14 avg 13.9%

Android sees ~38% improvement across the board. iOS builds are ~15% faster even without prebuilt rncore.

Test plan

  • Verified that a local build (without CI=true) still works without any RNRepo-related side effects.
  • CI run with CI=true should pick up pre-built artifacts via the RNRepo plugin on both Android and iOS.
  • react-native-gesture-handler is excluded from prebuilds via the denylist, ensuring the library under test is always built fresh.

Copilot AI review requested due to automatic review settings May 4, 2026 08:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds RNRepo prebuilt native dependency support to the apps/basic-example CI build path so the example app can reuse prebuilt artifacts in CI while still building react-native-gesture-handler itself from source.

Changes:

  • Adds @rnrepo/build-tools to the basic example app and lockfile.
  • Wires RNRepo into Android Gradle and iOS CocoaPods setup behind CI checks.
  • Adds a root rnrepo.config.json denylist so react-native-gesture-handler is excluded from prebuild consumption.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yarn.lock Locks the new RNRepo build-tools dependency.
rnrepo.config.json Adds RNRepo denylist configuration for Android/iOS.
apps/basic-example/package.json Declares RNRepo build-tools for the example app.
apps/basic-example/ios/Podfile Loads and runs the RNRepo CocoaPods hook in CI.
apps/basic-example/android/build.gradle Resolves and adds the RNRepo Gradle plugin JAR to the buildscript classpath.
apps/basic-example/android/app/build.gradle Applies the RNRepo prebuilds plugin when CI=true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/basic-example/android/build.gradle Outdated
Comment thread apps/basic-example/package.json
Comment thread apps/basic-example/package.json
Future PRs that only update the RNRepo version or denylist will skip the Android build workflow entirely, so build-breaking changes to this integration won't be validated.
@radoslawrolka
Copy link
Copy Markdown
Contributor Author

react-native-gesture-handler uses the same version in package.json as the one published on npm (unlike some libraries that use placeholder versions like 1000.0.0 for the main branch). To prevent it from being replaced with a prebuilt version, it needs to be added to the denyList in rnrepo.config.json.

RNRepo looks for rnrepo.config.json in the directory containing node_modules/react-native/, which in this case is the repository root. If having rnrepo.config.json in the root is a problem, I can work on alternative solutions.

@radoslawrolka radoslawrolka marked this pull request as ready for review May 5, 2026 08:13
@radoslawrolka radoslawrolka requested a review from Copilot May 5, 2026 08:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/android-build.yml
Comment thread .github/workflows/ios-build.yml
Comment thread apps/basic-example/android/app/build.gradle Outdated
@radoslawrolka radoslawrolka force-pushed the rolkrado/apply-rnrepo branch from 348e37e to 5f609ab Compare May 5, 2026 08:46
Comment thread rnrepo.config.json Outdated
Comment thread apps/expo-example/package.json
Co-authored-by: Jakub Piasecki <jakubpiasecki67@gmail.com>
@j-piasecki j-piasecki merged commit 451eb50 into software-mansion:main May 6, 2026
6 checks passed
m-bert added a commit that referenced this pull request May 7, 2026
## Description

After merging #4141 our expo-example stopped working, throwing errors in
Gesture Handler module on Android.

From Claude:

>1. RNRepo was supplying a stale prebuilt binary for expo-example
>
>apps/expo-example/android/app/build.gradle applies the RNRepo plugin
unconditionally (unlike basic-example which gates it on CI=1). Because
there was no rnrepo.config.json in apps/expo-example/, the denyList at
the repo root wasn't found. RNRepo injected the prebuilt
react-native-gesture-handler@2.29.0 binary, which predates the
setReanimatedAvailable TurboModule binding and doesn't have it
registered.

## Test plan

Run expo-example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants