Skip to content

feat: add example Rock app#338

Open
Juozas-Petkelis wants to merge 9 commits into
callstack:mainfrom
Juozas-Petkelis:feat/rock-example
Open

feat: add example Rock app#338
Juozas-Petkelis wants to merge 9 commits into
callstack:mainfrom
Juozas-Petkelis:feat/rock-example

Conversation

@Juozas-Petkelis
Copy link
Copy Markdown

Summary

Add a demo app & CLI support for Rock
This PR:

  • Creates new example app for Rock

    • created app from Rock cli yarn create rock in package RockApp
    • Added new flavor for Android consumer app
          create("rock") {
              dimension = "app"
          }
    • Created new schema Brownfield Apple App Rock for iOS consumer app
    • Extracted example app UI to brownfield-example-shared package for RNApp and RockApp example apps
    • Minor adjustments to Home screen
      • Wrapped container in a ScrollView to fix the native message list being cut off

      • Refactored "Send message to Native" button to the <Button /> component to look and behave the same as other buttons

      • Home screen before and after
        Before After
  • Adjust actions and CI to support Rock

    • Add rock to GH action
    • Add scripts to build Rock from CI
    • Create embed-rock-runtime-frameworks.sh and adjust prepareXCFrameworks.js scripts for Rock. Rock brownfield:package:ios emit different on-disk shape than Vanilla RN, there's no Brownie.xcframework or BrownfieldNavigation.xcframework. Addjusted prepareXCFrameworks.js to change rock build output to the layout the AppleApp Xcode project expects.

Test plan

  • iOS

    • Run yarn in the root of the repository to install all dependencies
    • in apps/RockApp/ios run pod install
    • in apps/RockApp run yarn brownfield:package:ios
    • in apps/AppleApp run yarn build:example:ios-consumer:rock
    • run ios consumer app with Brownfield Apple App Rock schema
  • Android

    • Run yarn in the root of the repository to install all dependencies
    • in apps/RockApp run yarn brownfield:package:android and yarn brownfield:publish:android
    • run android consumer app with RockDebug or RockRelease build variant
Rock example App
iOS Android

Comment on lines +3 to +14
# Run Script Build Phase invoked by the "Brownfield Apple App" target after
# the standard "Embed Frameworks" phase.
#
# When the host RN project is RockApp, the dynamic BrownfieldLib.dylib
# produced by `rock package:ios` has @rpath load commands for
# React.framework and ReactNativeDependencies.framework. They must be
# embedded in the .app bundle or the app crashes on launch with
# "Library not loaded: @rpath/React.framework/React".
#
# `prepareXCFrameworks.js --appName RockApp` drops these xcframeworks into
# `package/`. For Vanilla / Expo flavors they are absent (React core is
# statically linked into BrownfieldLib), so this script is a no-op then.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should already be happening

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove - already addressed in merged #323

@artus9033 artus9033 requested a review from hurali97 May 19, 2026 10:55
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.

2 participants