rnrepo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRNRepo
RNRepo
Software Mansion's infrastructure for pre-building and distributing React Native library artifacts, reducing native build times by up to 2× with zero infrastructure changes.
Read the relevant reference for the topic at hand. All references are in .
references/RNRepo是Software Mansion旗下用于预构建和分发React Native库工件的基础设施,无需更改任何基础设施即可将原生构建时间缩短多达2倍。
请阅读与当前主题相关的参考文档,所有参考文档均位于目录下。
references/Key facts
关键要点
- Beta, New Architecture only. Works with React Native latest patches of 0.77, 0.78, 0.79 and all versions above 0.80.0.
- How it works: A Gradle plugin (Android) and CocoaPods plugin (iOS) intercept the build and substitute libraries with prebuilt artifacts from . Falls back to source if a prebuild is unavailable.
packages.rnrepo.org - Expo CNG: Use — it configures both Android and iOS automatically.
@rnrepo/expo-config-plugin - Standard RN: Install and edit
@rnrepo/build-tools,android/build.gradle, andandroid/app/build.gradlemanually.ios/Podfile - Opt out per library: Add a with a
rnrepo.config.jsonat the project root. Required for libraries with native patches (Objective-C/Java/Kotlin). JS-only patches do NOT require opting out.denyList - Opt out entirely: Set environment variable before the build command.
DISABLE_RNREPO=1
- Beta版本,仅支持新架构。适用于React Native 0.77、0.78、0.79的最新补丁版本,以及所有0.80.0及以上版本。
- 工作原理:Gradle插件(Android端)和CocoaPods插件(iOS端)会拦截构建过程,将库替换为来自的预构建工件。如果预构建工件不可用,则会回退到源码构建。
packages.rnrepo.org - Expo CNG:使用——它会自动配置Android和iOS端。
@rnrepo/expo-config-plugin - 标准React Native项目:安装并手动编辑
@rnrepo/build-tools、android/build.gradle和android/app/build.gradle文件。ios/Podfile - 按库选择退出:在项目根目录添加带有的
denyList文件。此操作适用于带有原生补丁(Objective-C/Java/Kotlin)的库。仅JS补丁无需选择退出。rnrepo.config.json - 完全退出:在执行构建命令前设置环境变量。
DISABLE_RNREPO=1
References
参考文档
| File | When to read |
|---|---|
| Setting up RNRepo for the first time — Expo CNG, standard React Native, Android Gradle, iOS CocoaPods |
| Opting out specific libraries (denyList), disabling the plugin, Fingerprint config, GPG verification |
| Build failures, C++ debug/release mismatch, duplicate |
| 文件 | 阅读场景 |
|---|---|
| 首次设置RNRepo时——适用于Expo CNG、标准React Native、Android Gradle、iOS CocoaPods |
| 选择退出特定库(denyList)、禁用插件、指纹配置、GPG验证 |
| 构建失败、C++调试/发布版本不匹配、重复 |