From 7b088b103538c2e781996f5b06861b93d95cd95e Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Wed, 20 Jul 2022 22:04:43 +0100 Subject: [PATCH 1/4] Allow `PRODUCTION=1 pod install` Mentioned in - https://github.com/reactwg/react-native-releases/discussions/21#discussioncomment-2945972 - https://github.com/facebook/react-native/pull/33882 Close: https://github.com/facebook/react-native/issues/33764 --- template/ios/Podfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/ios/Podfile b/template/ios/Podfile index 594b74dc56f576..b5dca028ccc0ca 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -4,6 +4,8 @@ require_relative '../node_modules/react-native/scripts/native_modules' platform :ios, '12.4' install! 'cocoapods', :deterministic_uuids => false +production = ENV["PRODUCTION"] == "1" + target 'HelloWorld' do config = use_native_modules! @@ -12,6 +14,7 @@ target 'HelloWorld' do use_react_native!( :path => config[:reactNativePath], + :production => production, # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. From 1fbf34e9b0c874959acdda93e814424416520ce4 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Thu, 21 Jul 2022 08:46:38 +0100 Subject: [PATCH 2/4] Revert "Allow `PRODUCTION=1 pod install`" This reverts commit 7b088b103538c2e781996f5b06861b93d95cd95e. --- template/ios/Podfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/template/ios/Podfile b/template/ios/Podfile index b5dca028ccc0ca..594b74dc56f576 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -4,8 +4,6 @@ require_relative '../node_modules/react-native/scripts/native_modules' platform :ios, '12.4' install! 'cocoapods', :deterministic_uuids => false -production = ENV["PRODUCTION"] == "1" - target 'HelloWorld' do config = use_native_modules! @@ -14,7 +12,6 @@ target 'HelloWorld' do use_react_native!( :path => config[:reactNativePath], - :production => production, # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. From 26649db15ecd90b239d5297df7f63aa22d081987 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Thu, 21 Jul 2022 08:50:21 +0100 Subject: [PATCH 3/4] Bake `PRODUCTION` env var into `react_native_pods.rb` - PR feedback: https://github.com/facebook/react-native/pull/34234#pullrequestreview-1045976030 - Previous Podfile change reverted --- scripts/react_native_pods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 80f98c0a90c315..f3d3470ddf70b4 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -37,7 +37,7 @@ def use_react_native! ( path: "../node_modules/react-native", fabric_enabled: false, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == '1', - production: false, + production: ENV['PRODUCTION'] == false, hermes_enabled: true, flipper_configuration: FlipperConfiguration.disabled, app_path: '..', From 17d17f5e35134e5fc8389da3b0c627dddc8c035c Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Thu, 21 Jul 2022 09:16:50 +0100 Subject: [PATCH 4/4] Update scripts/react_native_pods.rb Thanks figured ^ Appreciate the detailed follow-up Co-authored-by: Riccardo --- scripts/react_native_pods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index f3d3470ddf70b4..8390a3ab6d0e2a 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -37,7 +37,7 @@ def use_react_native! ( path: "../node_modules/react-native", fabric_enabled: false, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == '1', - production: ENV['PRODUCTION'] == false, + production: ENV['PRODUCTION'] == '1', hermes_enabled: true, flipper_configuration: FlipperConfiguration.disabled, app_path: '..',