Skip to content

Commit

Permalink
chore: remove modular headers hack (#11550)
Browse files Browse the repository at this point in the history
* podfile changes and recommended firebase setup

* pod install

* update broken BooleanAnimations imports

* update broken Analytics imports

* update broken CocoaLumberjack import

* add build flag to workaround folly build issue

* remove erroneous static braze lib that only causes pain

* update hacks
  • Loading branch information
brainbicycle authored Feb 13, 2025
1 parent 643db92 commit fdf062e
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 156 deletions.
25 changes: 11 additions & 14 deletions HACKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,6 @@ and when this issue is closed https://github.com/DylanVann/react-native-fast-ima

https://artsynet.sentry.io/issues/4479226101/events/d98fd95bd4c74271a184596c901fac26/ started having some sentry crashes for this reason in iOS 17 and this patch fixes the issue (taken from the main branch of the fast-image repo but not released yet).

## Modular headers for firebase deps in Podfile

#### When we can remove this

When we stop using flipper or this issue is resolved: https://github.com/invertase/react-native-firebase/issues/6425

#### Explanation/Context

The latest versions of react-native-firebase require using static frameworks, and unfortunately this breaks flipper.
https://rnfirebase.io/#altering-cocoapods-to-use-frameworks
The author of react-native-firebase basically said that people should just remove flipper since it is no longer going to be supported by
react native in the future but a bit tough to pull off that bandaid so soon. If flipper does end up supporting this config: 1. remove the entries in the podfile
that have `:modular_headers => true` and add the static frameworks line from the docs above.

## Custom lane google_play_track_rollout_percentages in fastlane dir + associated monkey patches in Fastfile

#### When we can remove this:
Expand Down Expand Up @@ -307,3 +293,14 @@ https://github.com/numandev1/react-native-keys/issues/86#issuecomment-2546610160
#### Explanation/Context:

Android was unable to build correctly on react-native 76 without excluding `libreactnative.so`

## Folly build flags

#### When we can remove this

Possibly if we update folly / react native and removing the flag does not cause build failures.

#### Explanation/Context

When we switched to use static frameworks building Folly broke in this way: https://github.com/facebook/folly/issues/2297
The flag suggested in the comments was added as a workaround.
24 changes: 16 additions & 8 deletions ios/Artsy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
1AE9F26B2902DA87002A561B /* Tests-Store.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1AE9F2632902DA87002A561B /* Tests-Store.xcconfig */; };
7448C2EC42E1DD4A032A6C70 /* Pods_ArtsyTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C1B6860831AE690075CFD4C /* Pods_ArtsyTests.framework */; };
8E4207792A055D2D006888BD /* ARAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8E4207782A055D2D006888BD /* ARAppDelegate.mm */; };
C0AD8A5C831EECD4FC46E80E /* libPods-Artsy.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C35034239854793E0E5C1F6A /* libPods-Artsy.a */; };
C7013F6223A0728501AF731A /* Pods_Artsy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 321EEBB700CC9B7FE0B1D445 /* Pods_Artsy.framework */; };
CB0D52052AF56984000E6C08 /* LiveAuctionTestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0D52042AF56984000E6C08 /* LiveAuctionTestUtils.swift */; };
CB18282829CE1DD1006A0805 /* ARAugmentedWallBasedVIRViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB18282729CE1DD1006A0805 /* ARAugmentedWallBasedVIRViewController.swift */; };
CB18282B29D35F29006A0805 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = CB18282A29D35F29006A0805 /* GoogleService-Info.plist */; };
Expand Down Expand Up @@ -227,7 +227,6 @@
CBA500F62C6553FF00DDBCC0 /* ARTDeeplinkTimeoutModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CBA500F52C6553FF00DDBCC0 /* ARTDeeplinkTimeoutModule.m */; };
CBD794D72BBB5622003B3CB5 /* StarscreamExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBD794D62BBB5622003B3CB5 /* StarscreamExtensions.swift */; };
CBD794DB2BBC40A4003B3CB5 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = CBD794DA2BBC40A4003B3CB5 /* PrivacyInfo.xcprivacy */; };
CBE0D12E2C20C8D800DFF17E /* libBrazeUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CBE0D12D2C20C8D800DFF17E /* libBrazeUI.a */; };
CBE2946229E4C19000AA77DD /* VirtualArtwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE2946129E4C19000AA77DD /* VirtualArtwork.swift */; };
CBE3266F27E275A300395A93 /* ARAppConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3245D27E275A100395A93 /* ARAppConstants.m */; };
CBE3267027E275A300395A93 /* ARDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3245E27E275A100395A93 /* ARDefaults.m */; };
Expand Down Expand Up @@ -493,7 +492,7 @@
CBE327A027E275A400395A93 /* Bidder.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3266527E275A300395A93 /* Bidder.m */; };
CBE327A127E275A400395A93 /* BidderPosition.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3266627E275A300395A93 /* BidderPosition.m */; };
CBE327A227E275A400395A93 /* SystemTime.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3266927E275A300395A93 /* SystemTime.m */; };
E15070752CCFE89B00615118 /* BuildFile in Sources */ = {isa = PBXBuildFile; };
E15070752CCFE89B00615118 /* (null) in Sources */ = {isa = PBXBuildFile; };
E15070762CCFE8A900615118 /* ARTLiveAuctionViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE3259A27E275A200395A93 /* ARTLiveAuctionViewManager.m */; };
E15070772CCFE8C400615118 /* LiveAuctionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE3259B27E275A200395A93 /* LiveAuctionView.swift */; };
E1856EA22C98923B00849C0E /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E1856EA12C98923B00849C0E /* BootSplash.storyboard */; };
Expand Down Expand Up @@ -610,12 +609,12 @@
1AE9F2612902DA87002A561B /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };
1AE9F2622902DA87002A561B /* App-Store.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "App-Store.xcconfig"; sourceTree = "<group>"; };
1AE9F2632902DA87002A561B /* Tests-Store.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tests-Store.xcconfig"; sourceTree = "<group>"; };
321EEBB700CC9B7FE0B1D445 /* Pods_Artsy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Artsy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
36B80F603A77F1EFD957AB24 /* Pods-Artsy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Artsy.debug.xcconfig"; path = "Target Support Files/Pods-Artsy/Pods-Artsy.debug.xcconfig"; sourceTree = "<group>"; };
4C1B6860831AE690075CFD4C /* Pods_ArtsyTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ArtsyTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8E4207782A055D2D006888BD /* ARAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ARAppDelegate.mm; sourceTree = "<group>"; };
A13D613770ABA09F958CEC44 /* Pods-ArtsyTests.store.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ArtsyTests.store.xcconfig"; path = "Target Support Files/Pods-ArtsyTests/Pods-ArtsyTests.store.xcconfig"; sourceTree = "<group>"; };
B6786672018842FE1C6B598E /* Pods-Artsy.store.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Artsy.store.xcconfig"; path = "Target Support Files/Pods-Artsy/Pods-Artsy.store.xcconfig"; sourceTree = "<group>"; };
C35034239854793E0E5C1F6A /* libPods-Artsy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Artsy.a"; sourceTree = BUILT_PRODUCTS_DIR; };
CB0D52042AF56984000E6C08 /* LiveAuctionTestUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveAuctionTestUtils.swift; sourceTree = "<group>"; };
CB18282729CE1DD1006A0805 /* ARAugmentedWallBasedVIRViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARAugmentedWallBasedVIRViewController.swift; sourceTree = "<group>"; };
CB18282A29D35F29006A0805 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "GoogleService-Info.plist"; path = "Artsy/GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -1366,8 +1365,7 @@
CB43299227FDFE4700B29DD6 /* iAd.framework in Frameworks */,
CB43299427FDFE5300B29DD6 /* MessageUI.framework in Frameworks */,
CB43299827FDFE6400B29DD6 /* StoreKit.framework in Frameworks */,
CBE0D12E2C20C8D800DFF17E /* libBrazeUI.a in Frameworks */,
C0AD8A5C831EECD4FC46E80E /* libPods-Artsy.a in Frameworks */,
C7013F6223A0728501AF731A /* Pods_Artsy.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1563,8 +1561,8 @@
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
CB43268327E8FA6900B29DD6 /* WidgetKit.framework */,
CB43268527E8FA6900B29DD6 /* SwiftUI.framework */,
C35034239854793E0E5C1F6A /* libPods-Artsy.a */,
4C1B6860831AE690075CFD4C /* Pods_ArtsyTests.framework */,
321EEBB700CC9B7FE0B1D445 /* Pods_Artsy.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -3766,7 +3764,7 @@
files = (
E15070772CCFE8C400615118 /* LiveAuctionView.swift in Sources */,
E15070762CCFE8A900615118 /* ARTLiveAuctionViewManager.m in Sources */,
E15070752CCFE89B00615118 /* BuildFile in Sources */,
E15070752CCFE89B00615118 /* (null) in Sources */,
1A4B97C7283CDD5A00878EAE /* ARMapContainerViewController.m in Sources */,
CBE3279227E275A400395A93 /* User.m in Sources */,
CBE3277927E275A400395A93 /* ArtsyAPI+Notifications.m in Sources */,
Expand Down Expand Up @@ -4239,6 +4237,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DRNVERSION=69",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
Expand All @@ -4247,6 +4246,7 @@
"-DFOLLY_USE_LIBCPP=1",
"-fcxx-modules",
"-fmodules",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -4317,6 +4317,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DRNVERSION=69",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
Expand All @@ -4325,6 +4326,7 @@
"-DFOLLY_USE_LIBCPP=1",
"-fcxx-modules",
"-fmodules",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -4409,6 +4411,9 @@
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
LD = "";
LDPLUSPLUS = "";
Expand Down Expand Up @@ -4493,6 +4498,9 @@
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
LD = "";
LDPLUSPLUS = "";
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/App/ARAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#import "ARAppDelegate+DeeplinkTimeout.h"
#import "ARUserManager.h"
#import "ARFonts.h"
#import <Analytics/SEGAnalytics.h>
#import <SEGAnalytics.h>
#import "ARAnalyticsConstants.h"
#import "User.h"

Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/App/ARAppNotificationsDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#import "ARAppDelegate.h"
#import "ARAppConstants.h"
#import "ARAnalyticsConstants.h"
#import <Analytics/SEGAnalytics.h>
#import <SEGAnalytics.h>
#import "UIApplicationStateEnum.h"
#import "ARNotificationView.h"
#import "ARSerifNavigationViewController.h"
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/ArtsyUIButtons/ARButtonSubclasses.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#import "UIColor+ArtsyColors.h"

#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"

#import "UIFont+ArtsyFonts.h"

Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/Extraction/ARSpinner.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "ARSpinner.h"
#import "UIView+ARSpinner.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"


@interface ARSpinner ()
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/Resources/Artsy-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#import <MARKRangeSlider/MARKRangeSlider.h>
#import <ORStackView/ORStackScrollView.h>
#import <SDWebImage/SDWebImagePrefetcher.h>
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"
#import "AREmission.h"
#import "ARNotificationView.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "ARDefaults.h"
#import "ARButtonSubclasses.h"
#import "AREmission.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"
#import <FLKAutoLayout/FLKAutoLayout.h>
#import "ARSpinner.h"
#import "UIView+ARSpinner.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#import "Artsy+UILabels.h"
#import "UIFont+ArtsyFonts.h"
#import <FLKAutoLayout/FLKAutoLayout.h>
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"
#import "AREmission.h"

#import "ARAppConstants.h"
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/View_Controllers/ARVIR/Views/ARInformationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#import <FLKAutoLayout/FLKAutoLayout.h>
#import "UIFont+ArtsyFonts.h"
#import <ORStackView/ORStackView.h>
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"

@implementation InformationalViewState
- (instancetype)init;
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/View_Controllers/Util/ARNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import "UIDevice-Hardware.h"

#import "ARButtonSubclasses.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIView+BooleanAnimations.h"
#import <FLKAutoLayout/UIView+FLKAutoLayout.h>
#import <ObjectiveSugar/ObjectiveSugar.h>
#import <MultiDelegate/AIMultiDelegate.h>
Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/View_Controllers/Util/Logging/ARLogger.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import <CocoaLumberjack/DDLogMacros.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
#import <AFNetworkActivityLogger/AFNetworkActivityLogger.h>

#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion ios/ArtsyTests/App_Tests/ARAppNotificationsDelegateTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import "ARSerifNavigationViewController.h"
#import "UIApplicationStateEnum.h"
#import "AREmission.h"
#import <Analytics/SEGAnalytics.h>
#import <SEGAnalytics.h>
#import "UserNotifications/UNNotification.h"
#import "UserNotifications/UNNotificationRequest.h"
#import "UserNotifications/UNNotificationContent.h"
Expand Down
19 changes: 3 additions & 16 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ inhibit_all_warnings! # ignore all warnings from all pods

prepare_react_native_project!


plugin 'cocoapods-patch'

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

def check_for_existing_netrc_file
mapbox_token = ENV['MAPBOX_DOWNLOAD_TOKEN']
if !mapbox_token || mapbox_token.length <= 1
Expand Down Expand Up @@ -64,6 +57,9 @@ target 'Artsy' do

config = use_native_modules!

use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true

use_react_native!(
:path => config[:reactNativePath],
:production => ENV['CIRCLE_BUILD_NUM'],
Expand Down Expand Up @@ -112,15 +108,6 @@ target 'Artsy' do
# Google & Firebase
pod 'Firebase/Auth', '10.23.0'

# Workaround for firebase flipper issues
# See https://github.com/invertase/react-native-firebase/issues/6425#issuecomment-1952403075
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
pod 'FirebaseInstallations', :modular_headers => true
pod 'GoogleDataTransport', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'nanopb', :modular_headers => true

# Swift pods 🎉
pod 'Then', '2.3.0'
pod 'Interstellar/Core', git: 'https://github.com/artsy/Interstellar.git', branch: 'observable-unsubscribe'
Expand Down
Loading

0 comments on commit fdf062e

Please sign in to comment.