Skip to content

Comments

feat: unify expo and bare RN in ReactNativeBrownfield#234

Merged
hurali97 merged 114 commits intomainfrom
feat/ios-unify-expo-bare-rn
Feb 20, 2026
Merged

feat: unify expo and bare RN in ReactNativeBrownfield#234
hurali97 merged 114 commits intomainfrom
feat/ios-unify-expo-bare-rn

Conversation

@hurali97
Copy link
Member

@hurali97 hurali97 commented Feb 19, 2026

Summary

This PR unifies the Expo and Bare React Native implementation in react-native-brownfield package. Without this, the Expo implementation lives on the consumer's Expo Brownfield Framework, in the shape of ReactNativeHostManager and they also need to handle the View presentation depending on whether they are using SwiftUI or UIKit.

With this PR, the consumer does not need to worry about any of it and they can right away use the same react-native-brownfield APIs to help with that. Though, there are 2 extra APIs only for Expo, they will not be available/work for Bare React Native:

  • ReactNativeBrownfield.shared.application(application, didFinishLaunchingWithOptions: launchOptions)

    • Propagates the applicationDidFinishLaunchingwithOptions to Expo
  • ReactNativeBrownfield.shared.ensureExpoModulesProvider()

    • Ensures ExpoModulesProvider is instantiated, we can not abstract this inside the react-native-brownfield as this class is auto-generated on the consumer's Expo Brownfield framework side

As part of using the Expo Brownfield Framework, the consumer needs to add these methods explicitly, as they would for presenting RN UI and initializing React Native instance.

Test plan

CI Passes - 🟢

artus9033 and others added 30 commits January 16, 2026 13:21
…id deps to be properly resolved by Gradle when consumed
Base automatically changed from feat/expo-config-plugin to main February 19, 2026 12:21
@hurali97 hurali97 marked this pull request as ready for review February 20, 2026 07:16
Copilot AI review requested due to automatic review settings February 20, 2026 07:16
Copy link
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 unifies the Expo and Bare React Native implementations in the react-native-brownfield iOS package. Previously, Expo users had to manually manage ReactNativeHostManager in their Expo Brownfield Framework and handle view presentation differently based on their UI framework choice. With this change, consumers can use the same react-native-brownfield APIs for both Expo and Bare React Native implementations, with the framework internally handling the differences through conditional compilation.

Changes:

  • Extracted common React Native hosting logic into separate runtime classes (ExpoHostRuntime and ReactNativeHostRuntime) based on the platform
  • Unified the public API in ReactNativeBrownfield class using conditional compilation to delegate to the appropriate runtime
  • Refactored bundle path resolution logic into a reusable BrownfieldBundlePathResolver utility
  • Moved notification extension definitions to a separate file
  • Removed the need for consumers to manually manage ReactNativeHostManager for Expo

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ReactNativeBrownfield.swift Refactored main class to use conditional compilation and delegate to platform-specific runtimes
ExpoHostRuntime.swift New internal runtime for Expo-specific React Native hosting logic
ReactNativeHostRuntime.swift New internal runtime for Bare React Native hosting logic
BrownfieldBundlePathResolver.swift New utility for parsing bundle paths, fixing previous bug where dots in filenames were not preserved
Notification+Brownfield.swift Extracted notification extensions to separate file for better organization
FrameworkInterface.swift Added ensureExpoModulesProvider extension method for Expo framework consumers
PodfileTargetBlock.rb Added environment variable to enable Expo host mode during pod installation
withIosFrameworkFiles.ts Removed ReactNativeHostManager.swift template as it's now handled internally
ReactBrownfield.podspec Added conditional Expo dependency when REACT_NATIVE_BROWNFIELD_USE_EXPO_HOST is set
Podfile.lock Updated ReactBrownfield version and checksum

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

@hurali97 hurali97 merged commit cbcc18d into main Feb 20, 2026
8 of 9 checks passed
@hurali97 hurali97 deleted the feat/ios-unify-expo-bare-rn branch February 20, 2026 09:15
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