rnrepo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RNRepo

RNRepo

Software Mansion's infrastructure for pre-building and distributing React Native library artifacts, reducing native build times by up to 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
    packages.rnrepo.org
    . Falls back to source if a prebuild is unavailable.
  • Expo CNG: Use
    @rnrepo/expo-config-plugin
    — it configures both Android and iOS automatically.
  • Standard RN: Install
    @rnrepo/build-tools
    and edit
    android/build.gradle
    ,
    android/app/build.gradle
    , and
    ios/Podfile
    manually.
  • Opt out per library: Add a
    rnrepo.config.json
    with a
    denyList
    at the project root. Required for libraries with native patches (Objective-C/Java/Kotlin). JS-only patches do NOT require opting out.
  • Opt out entirely: Set
    DISABLE_RNREPO=1
    environment variable before the build command.
  • Beta版本,仅支持新架构。适用于React Native 0.77、0.78、0.79的最新补丁版本,以及所有0.80.0及以上版本。
  • 工作原理:Gradle插件(Android端)和CocoaPods插件(iOS端)会拦截构建过程,将库替换为来自
    packages.rnrepo.org
    的预构建工件。如果预构建工件不可用,则会回退到源码构建。
  • Expo CNG:使用
    @rnrepo/expo-config-plugin
    ——它会自动配置Android和iOS端。
  • 标准React Native项目:安装
    @rnrepo/build-tools
    并手动编辑
    android/build.gradle
    android/app/build.gradle
    ios/Podfile
    文件。
  • 按库选择退出:在项目根目录添加带有
    denyList
    rnrepo.config.json
    文件。此操作适用于带有原生补丁(Objective-C/Java/Kotlin)的库。仅JS补丁无需选择退出。
  • 完全退出:在执行构建命令前设置环境变量
    DISABLE_RNREPO=1

References

参考文档

FileWhen to read
references/installation.md
Setting up RNRepo for the first time — Expo CNG, standard React Native, Android Gradle, iOS CocoaPods
references/configuration.md
Opting out specific libraries (denyList), disabling the plugin, Fingerprint config, GPG verification
references/troubleshooting.md
Build failures, C++ debug/release mismatch, duplicate
.so
files, Xcode version issues, empty repository list, verifying the plugin works
文件阅读场景
references/installation.md
首次设置RNRepo时——适用于Expo CNG、标准React Native、Android Gradle、iOS CocoaPods
references/configuration.md
选择退出特定库(denyList)、禁用插件、指纹配置、GPG验证
references/troubleshooting.md
构建失败、C++调试/发布版本不匹配、重复
.so
文件、Xcode版本问题、仓库列表为空、验证插件是否正常工作