react-native icon indicating copy to clipboard operation
react-native copied to clipboard

feat(scripts): Support multiple bundles in react-native-xcode.sh

Open fivecar opened this issue 1 year ago • 1 comments

Summary:

This enables projects to have multiple bundles built during the Xcode bundling phase (e.g. for projects where you might have a PhoneScene and a CarPlayScene each with their own RootView and bundle, if you're using react-native-carplay).

Changelog:

[IOS] [ADDED] - User-configurable BUNDLE_NAME when building bundles

Test Plan:

Built my project with the following Xcode "Bundle React Native code" build step:

set -e

export SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map";
SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map"

WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"

/bin/sh -c "BUNDLE_NAME=main $WITH_ENVIRONMENT $REACT_NATIVE_XCODE"
/bin/sh -c "BUNDLE_NAME=carplay $WITH_ENVIRONMENT $REACT_NATIVE_XCODE"

Then launched the app with a modified AppDelegate.swift which loaded main.jsbundle into one RootView and carplay.bundle into another RootView.

fivecar avatar Sep 05 '24 05:09 fivecar

cc @cipolleschi thoughts?

blakef avatar Sep 06 '24 12:09 blakef

Thanks, @cipolleschi! I was the FB LON site lead for its first few years; it's gratifying to have this approved by you. 😄

It looks from the PR that the rest of the workflow needs to be done by maintainers. Please LMK if there's anything else I should be doing on this.

fivecar avatar Sep 12 '24 07:09 fivecar

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Sep 12 '24 14:09 facebook-github-bot

@cipolleschi merged this pull request in facebook/react-native@f8287e25e11d56beb66ace414ca5f8a6a32405a9.

facebook-github-bot avatar Sep 13 '24 12:09 facebook-github-bot

This pull request was successfully merged by @fivecar in f8287e25e11d56beb66ace414ca5f8a6a32405a9

When will my fix make it into a release? | How to file a pick request?

react-native-bot avatar Sep 13 '24 12:09 react-native-bot