Skip to content

Commit 22367df

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Cleanup, remove the PRODUCTION flag (facebook#37882)
Summary: Pull Request resolved: facebook#37882 After some progressive changes, we can finally remove the PRODUCTION flag from the codebase. ## Changelog: [iOS][Removed] - Remove PRODUCTION flag from iOS build logic Reviewed By: cortinico, dmytrorykun Differential Revision: D46726208 fbshipit-source-id: f1795e1d8b4a532ff1af9eea313e21580e31aa19
1 parent 754ddc6 commit 22367df

File tree

6 files changed

+9
-18
lines changed

6 files changed

+9
-18
lines changed

.circleci/config.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,6 @@ jobs:
886886
command: |
887887
cd /tmp/$PROJECT_NAME/ios
888888
889-
if [[ << parameters.flavor >> == "Release" ]]; then
890-
export PRODUCTION=1
891-
fi
892-
893889
if [[ << parameters.architecture >> == "NewArch" ]]; then
894890
export RCT_NEW_ARCH_ENABLED=1
895891
fi

packages/react-native/ReactCommon/hermes/React-hermes.podspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
require "json"
77

8-
# Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar.
9-
108
# package.json
119
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
1210
version = package['version']

packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_installFlipperDependencies_installDependencies
2323
# Assert
2424
assert_equal($podInvocationCount, 1)
2525
assert_equal($podInvocation['React-Core/DevSupport'][:path], "../../" )
26+
assert_equal($podInvocation['React-Core/DevSupport'][:configurations], ["Debug"] )
2627
end
2728

2829
# ======================= #

packages/react-native/scripts/cocoapods/flipper.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
# This function installs the `React-Core/DevSupport` subpods
2020
# when the dependencies are installed for a non production app.
2121
#
22-
# @parameter production: a boolean that indicates whether we are in production or not.
2322
# @parameter pathToReactNative: the path to the React Native installation
24-
def install_flipper_dependencies(pathToReactNative)
25-
pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/"
23+
def install_flipper_dependencies(pathToReactNative, configurations: ["Debug"])
24+
pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/", :configurations => configurations
2625
end
2726

2827

packages/react-native/scripts/react_native_pods.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def prepare_react_native_project!
5757
# - path: path to react_native installation.
5858
# - fabric_enabled: whether fabric should be enabled or not.
5959
# - new_arch_enabled: whether the new architecture should be enabled or not.
60-
# - production: whether the dependencies must be installed to target a Debug or a Release build.
60+
# - :production [DEPRECATED] whether the dependencies must be installed to target a Debug or a Release build.
6161
# - hermes_enabled: whether Hermes should be enabled or not.
6262
# - flipper_configuration: The configuration to use for flipper.
6363
# - app_path: path to the React Native app. Required by the New Architecture.
@@ -67,7 +67,7 @@ def use_react_native! (
6767
path: "../node_modules/react-native",
6868
fabric_enabled: false,
6969
new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == '1',
70-
production: ENV['PRODUCTION'] == '1',
70+
production: false, # deprecated
7171
hermes_enabled: ENV['USE_HERMES'] && ENV['USE_HERMES'] == '0' ? false : true,
7272
flipper_configuration: FlipperConfiguration.disabled,
7373
app_path: '..',
@@ -164,12 +164,9 @@ def use_react_native! (
164164
build_codegen!(prefix, relative_installation_root)
165165
end
166166

167-
# CocoaPods `configurations` option ensures that the target is copied only for the specified configurations,
168-
# but those dependencies are still built.
169-
# Flipper doesn't currently compile for release https://github.com/facebook/react-native/issues/33764
170-
# Setting the production flag to true when build for production make sure that we don't install Flipper in the app in the first place.
171-
if flipper_configuration.flipper_enabled && !production
172-
install_flipper_dependencies(prefix)
167+
# Flipper now build in Release mode but it is not linked to the Release binary (as specified by the Configuration option)
168+
if flipper_configuration.flipper_enabled
169+
install_flipper_dependencies(prefix, :configurations => flipper_configuration.configurations)
173170
use_flipper_pods(flipper_configuration.versions, :configurations => flipper_configuration.configurations)
174171
end
175172

packages/rn-tester/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def pods(target_name, options = {}, use_flipper: !IN_CI && !USE_FRAMEWORKS)
3838
flipper_configuration: use_flipper ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,
3939
app_path: "#{Dir.pwd}",
4040
config_file_dir: "#{Dir.pwd}/node_modules",
41-
production: !ENV['PRODUCTION'].nil?,
41+
production: false, #deprecated
4242
ios_folder: '.',
4343
)
4444
pod 'ReactCommon-Samples', :path => "#{@prefix_path}/ReactCommon/react/nativemodule/samples"

0 commit comments

Comments
 (0)