feat(scripts): Support multiple bundles in react-native-xcode.sh
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.
cc @cipolleschi thoughts?
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.
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@cipolleschi merged this pull request in facebook/react-native@f8287e25e11d56beb66ace414ca5f8a6a32405a9.
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?