feat: support RN prebuilts for Apple#323
Conversation
… support in Expo internals in brownfield scenarios
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for React Native Apple prebuilt binaries to Brownfield iOS packaging, exposing a new --use-prebuilt-rn-core CLI flag (with version-aware defaults), enforcing BUILD_LIBRARY_FOR_DISTRIBUTION / SWIFT_EMIT_MODULE_INTERFACE on the bundled podspecs so XCFrameworks can be built with .swiftinterface files, and tightening the brownfield app framework dylib install names + Apple demo embedding/signing for the prebuilt flow. It also rewrites the React Native Brownfield iOS module from Objective-C to Swift (separated into Views, Vanilla, Expo groups) and updates demo apps, lockfiles, docs, and CONTRIBUTING accordingly.
Changes:
- New
--use-prebuilt-rn-core [bool]CLI flag with parser, validation (RN ≥ 0.81 / Expo SDK ≥ 55), tests, and docs; bumps@rock-js/*deps to^0.13.3. - Podspecs (ReactBrownfield, Brownie, BrownfieldNavigation) enforce distribution build settings; ReactBrownfield optionally depends on
React-Core-prebuilt. Expo config plugin setsDYLIB_INSTALL_NAME_BASE/LD_DYLIB_INSTALL_NAMEto@rpath. - iOS module rewritten in Swift; Apple demo Xcode project +
prepareXCFrameworksupdated to handle optionalReact.xcframework/ReactNativeDependencies.xcframework; lockfiles and example apps re-aligned.
Reviewed changes
Copilot reviewed 31 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/brownfield/commands/packageIos.ts | Adds --use-prebuilt-rn-core flag, parser, type, and wires it into packageIosAction. |
| packages/cli/src/brownfield/utils/usePrebuiltRnCore.ts | New helper asserting RN/Expo support for prebuilts. |
| packages/cli/src/brownfield/utils/project.ts | Adds getExpoSdkMajor helper. |
| packages/cli/src/brownfield/{commands,utils}/tests/*.test.ts | Vitest coverage for parser and assertion. |
| packages/cli/package.json | Bumps @rock-js/* deps to ^0.13.3. |
| packages/react-native-brownfield/ReactBrownfield.podspec | Enables distribution build settings, optional React-Core-prebuilt dep, fixes broken add_dependency line. |
| packages/{brownie,brownfield-navigation}/*.podspec | Enables BUILD_LIBRARY_FOR_DISTRIBUTION + SWIFT_EMIT_MODULE_INTERFACE. |
| packages/react-native-brownfield/src/expo-config-plugin/{logging.ts,ios/xcodeHelpers.ts} | Adds Logger.getIsDebug and @rpath install-name settings. |
| packages/react-native-brownfield/ios/** + xcodeproj | Rewrites module to Swift; restructures Xcode project. |
| apps/AppleApp/** | Updates Xcode project and prepareXCFrameworks to accept optional React/ReactNativeDependencies XCFrameworks. |
| apps/{RNApp,ExpoApp54,ExpoApp55}/** | Adjusts scripts, dependency versions, and configs for the new flow. |
| apps/RNApp/ios/Podfile.lock | Massive regeneration reflecting prebuilt-pods graph. |
| docs/**, CONTRIBUTING.md, .changeset/* | Documents the new flag + prebuilts support and demo-app workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds first-class support for React Native Apple prebuilt binaries in Brownfield iOS packaging, with a CLI override.
The prebuilts are compatible with RN 0.81+ (opt-in), from 0.83 they are the default; for Expo, prebuilts are compatible with Expo 55+ and do not work with Expo 54 (native compile errors from Expo internals).
User-facing changes
brownfield package:ios--use-prebuilt-rn-core [bool]to force prebuilts on or off for the Xcode build (CocoaPods). Omitting the flag keeps Rock’s version-aware defaults: prebuilts on by default for RN ≥ 0.84, off by default for RN 0.83 unless opted in.--schemeis set, strips the main library artifact{scheme}.xcframework(e.g.BrownfieldLib) to an interface-only XCFramework, consistent with existing stripping forReactBrownfield, Brownie, and BrownfieldNavigation—reduces duplicate symbol risk when the host app already links the real library.ReactBrownfield, Brownie, BrownfieldNavigation): enforceBUILD_LIBRARY_FOR_DISTRIBUTIONandSWIFT_EMIT_MODULE_INTERFACEso Release builds emit.swiftinterfaceandxcodebuild -create-xcframeworkcan merge slices.@rpathvia the config plugin) and tightens Apple demo framework embedding/signing for the prebuilt flow, which occurred inExpoApp55on XCode 26.Docs & examples
prepareXCFrameworksadjusted for optionalReact.xcframework/ReactNativeDependencies.xcframeworkwhen packaging with prebuilts; framework diagram asset refreshed; added 3 targets: for Expo 55 (prebuilt core), 54 (from-source) and RNApp (prebuilt core) + package.json scripts.apps/README.md: replaced the old “two configurations (expo / vanilla)” wording with the three targets, schemes, build configurations, and yarn scripts.CONTRIBUTING.md: documented theAppleAppchanges.Tests & tooling
parseUsePrebuiltRnCoreArgumentand Commander behavior for--use-prebuilt-rn-core(bare flag, explicit true/false, absent flag).Test plan
CI green + manual tests.