Skip to content

feat: support RN prebuilts for Apple#323

Open
artus9033 wants to merge 28 commits into
mainfrom
feat/support-apple-prebuilts
Open

feat: support RN prebuilts for Apple#323
artus9033 wants to merge 28 commits into
mainfrom
feat/support-apple-prebuilts

Conversation

@artus9033
Copy link
Copy Markdown
Collaborator

@artus9033 artus9033 commented May 12, 2026

Summary

Adds first-class support for React Native Apple prebuilt binaries in Brownfield iOS packaging, with a CLI override.

image

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
    • New flag --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.
    • When --scheme is set, strips the main library artifact {scheme}.xcframework (e.g. BrownfieldLib) to an interface-only XCFramework, consistent with existing stripping for ReactBrownfield, Brownie, and BrownfieldNavigation—reduces duplicate symbol risk when the host app already links the real library.
  • CocoaPods (ReactBrownfield, Brownie, BrownfieldNavigation): enforce BUILD_LIBRARY_FOR_DISTRIBUTION and SWIFT_EMIT_MODULE_INTERFACE so Release builds emit .swiftinterface and xcodebuild -create-xcframework can merge slices.
  • Fixes brownfield app framework dylib install names for Expo-generated targets (@rpath via the config plugin) and tightens Apple demo framework embedding/signing for the prebuilt flow, which occurred in ExpoApp55 on XCode 26.

Docs & examples

  • iOS getting started and CLI docs updated for prebuilts and the new flag.
  • Apple demo: Xcode project + prepareXCFrameworks adjusted for optional React.xcframework / ReactNativeDependencies.xcframework when 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.
  • CONTRIBUTING: notes on working with demo apps, which were missing .
  • ExpoApp54 / ExpoApp55 / RNApp: dependency and config alignment with the new flow.
  • apps/README.md: replaced the old “two configurations (expo / vanilla)” wording with the three targets, schemes, build configurations, and yarn scripts.
  • CONTRIBUTING.md: documented the AppleApp changes.

Tests & tooling

  • Vitest coverage for parseUsePrebuiltRnCoreArgument and Commander behavior for --use-prebuilt-rn-core (bare flag, explicit true/false, absent flag).

Test plan

CI green + manual tests.

@artus9033 artus9033 requested review from hurali97 and thymikee May 12, 2026 10:39
@artus9033 artus9033 self-assigned this May 12, 2026
@artus9033 artus9033 added the enhancement New feature or request label May 12, 2026
@artus9033 artus9033 changed the title feat: support RN prebuilts for Apple, revamp of CONTRIBUTING feat: support RN prebuilts for Apple May 13, 2026
@artus9033 artus9033 marked this pull request as ready for review May 14, 2026 21:08
Copilot AI review requested due to automatic review settings May 14, 2026 21:08
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

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 sets DYLIB_INSTALL_NAME_BASE/LD_DYLIB_INSTALL_NAME to @rpath.
  • iOS module rewritten in Swift; Apple demo Xcode project + prepareXCFrameworks updated to handle optional React.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.

Comment thread packages/cli/src/brownfield/commands/packageIos.ts
Comment thread packages/cli/src/brownfield/utils/usePrebuiltRnCore.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants