diff --git a/CHANGELOG.md b/CHANGELOG.md index 72dc131398..d52400cd67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## x.x.x - x.x.x + +**Fixes** + +- [#2129](https://github.com/stripe/stripe-react-native/pull/2129) Fix iOS build on new arch 0.81 with static linkage + ## 0.53.0 - 2025-09-15 **Features** diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index e432e5f583..715aa385d1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1691,7 +1691,7 @@ PODS: - StripePayments (= 24.23.0) - StripePaymentsUI (= 24.23.0) - StripeUICore (= 24.23.0) - - stripe-react-native (0.51.0): + - stripe-react-native (0.53.0): - DoubleConversion - glog - hermes-engine @@ -1712,14 +1712,14 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Stripe (~> 24.23.0) - - stripe-react-native/NewArch (= 0.51.0) + - stripe-react-native/NewArch (= 0.53.0) - StripeApplePay (~> 24.23.0) - StripeFinancialConnections (~> 24.23.0) - StripePayments (~> 24.23.0) - StripePaymentSheet (~> 24.23.0) - StripePaymentsUI (~> 24.23.0) - Yoga - - stripe-react-native/NewArch (0.51.0): + - stripe-react-native/NewArch (0.53.0): - DoubleConversion - glog - hermes-engine @@ -1746,7 +1746,7 @@ PODS: - StripePaymentSheet (~> 24.23.0) - StripePaymentsUI (~> 24.23.0) - Yoga - - stripe-react-native/Tests (0.51.0): + - stripe-react-native/Tests (0.53.0): - DoubleConversion - glog - hermes-engine @@ -2110,7 +2110,7 @@ SPEC CHECKSUMS: RNScreens: 0d4cb9afe052607ad0aa71f645a88bb7c7f2e64c SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Stripe: 2306d32be47f9632942f3385e9c2bad31d6ddcab - stripe-react-native: d95f5aa4e5a2d4a0edc8b3ea06e3a55d33ad31eb + stripe-react-native: 5250f17648f652dd5c570e76bd8b7bca579a238d StripeApplePay: edf515972406df57bd860d5f00416a552be6a450 StripeCore: ff6173a175acc7c4c25acc7cfabbade717dbc4de StripeFinancialConnections: 34a90401657135130fe5bfd93db5ac27c001ec65 @@ -2118,7 +2118,7 @@ SPEC CHECKSUMS: StripePaymentSheet: 1c04531a7eff2c721736fc7d433ee342a59fae0e StripePaymentsUI: 1cd35149b88de69c3364b4d1d4bb28c653c7d626 StripeUICore: 539e667170d9c5c86c02a9c63f320d132c7c1b73 - Yoga: 9b7fb56e7b08cde60e2153344fa6afbd88e5d99f + Yoga: afd04ff05ebe0121a00c468a8a3c8080221cb14c PODFILE CHECKSUM: a2ed964678852d4cc306ff4add3e4fa90be77ea6 diff --git a/ios/NewArch/AddToWalletButtonComponentView.mm b/ios/NewArch/AddToWalletButtonComponentView.mm index 6631142151..661ee83dde 100644 --- a/ios/NewArch/AddToWalletButtonComponentView.mm +++ b/ios/NewArch/AddToWalletButtonComponentView.mm @@ -8,7 +8,6 @@ #import #import -#import "RCTFollyConvert.h" #import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" diff --git a/ios/NewArch/AddressSheetViewComponentView.mm b/ios/NewArch/AddressSheetViewComponentView.mm index 4e436854bf..92cc4d6928 100644 --- a/ios/NewArch/AddressSheetViewComponentView.mm +++ b/ios/NewArch/AddressSheetViewComponentView.mm @@ -8,7 +8,6 @@ #import #import -#import "RCTFollyConvert.h" #import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" diff --git a/ios/NewArch/ApplePayButtonComponentView.mm b/ios/NewArch/ApplePayButtonComponentView.mm index 0f7b5957ff..169d1e21ff 100644 --- a/ios/NewArch/ApplePayButtonComponentView.mm +++ b/ios/NewArch/ApplePayButtonComponentView.mm @@ -8,7 +8,7 @@ #import #import -#import "RCTFollyConvert.h" +#import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" using namespace facebook::react; diff --git a/ios/NewArch/AuBECSDebitFormComponentView.mm b/ios/NewArch/AuBECSDebitFormComponentView.mm index 0225f53d48..4a8b2208c1 100644 --- a/ios/NewArch/AuBECSDebitFormComponentView.mm +++ b/ios/NewArch/AuBECSDebitFormComponentView.mm @@ -8,7 +8,6 @@ #import #import -#import "RCTFollyConvert.h" #import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" diff --git a/ios/NewArch/CardFieldComponentView.mm b/ios/NewArch/CardFieldComponentView.mm index 0d5e3c5db5..dc2ff089a1 100644 --- a/ios/NewArch/CardFieldComponentView.mm +++ b/ios/NewArch/CardFieldComponentView.mm @@ -7,7 +7,6 @@ #import #import -#import "RCTFollyConvert.h" #import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" diff --git a/ios/NewArch/CardFormComponentView.mm b/ios/NewArch/CardFormComponentView.mm index e648159a6e..7431c5b18a 100644 --- a/ios/NewArch/CardFormComponentView.mm +++ b/ios/NewArch/CardFormComponentView.mm @@ -7,7 +7,6 @@ #import #import -#import "RCTFollyConvert.h" #import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" @@ -68,7 +67,7 @@ - (void)updateProps:(const facebook::react::Props::Shared &)props _view.preferredNetworks = convertIntVectorToNSArray(newViewProps.preferredNetworks); [super updateProps:props oldProps:oldProps]; - + [_view didSetProps]; } diff --git a/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm b/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm index 19cc0005aa..312894be12 100644 --- a/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +++ b/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm @@ -8,7 +8,7 @@ #import #import -#import "RCTFollyConvert.h" +#import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" using namespace facebook::react; @@ -71,8 +71,6 @@ - (void)prepareForRecycle [self prepareView]; } - - @end Class EmbeddedPaymentElementViewCls(void) diff --git a/ios/NewArch/StripeContainerComponentView.mm b/ios/NewArch/StripeContainerComponentView.mm index ad737fa968..fede5f8713 100644 --- a/ios/NewArch/StripeContainerComponentView.mm +++ b/ios/NewArch/StripeContainerComponentView.mm @@ -8,7 +8,7 @@ #import #import -#import "RCTFollyConvert.h" +#import "StripeNewArchConversions.h" #import "StripeSwiftInterop.h" using namespace facebook::react; diff --git a/ios/NewArch/StripeNewArchConversions.h b/ios/NewArch/StripeNewArchConversions.h index 4102b9e242..3b9cbea64a 100644 --- a/ios/NewArch/StripeNewArchConversions.h +++ b/ios/NewArch/StripeNewArchConversions.h @@ -3,6 +3,20 @@ #include #include +// This file was moved in RN 0.81. This includes it differently depending on linkage +// and falls back to the old file for older RN versions. +#if __has_include() + // static libs / header maps (no use_frameworks!) + #import +#elif __has_include("FollyConvert.h") + /// `use_frameworks! :linkage => :static` users will need to import FollyConvert this way + #import "FollyConvert.h" +#elif __has_include("RCTFollyConvert.h") + #import "RCTFollyConvert.h" +#else + #error "FollyConvert.h not found. Ensure React-utils & RCT-Folly pods are installed." +#endif + NS_ASSUME_NONNULL_BEGIN namespace stripe::react { diff --git a/ios/NewArch/StripeNewArchConversions.mm b/ios/NewArch/StripeNewArchConversions.mm index 6d612f9241..8f965461b4 100644 --- a/ios/NewArch/StripeNewArchConversions.mm +++ b/ios/NewArch/StripeNewArchConversions.mm @@ -1,10 +1,12 @@ +#import "StripeNewArchConversions.h" + #import #import -#import "RCTFollyConvert.h" namespace stripe::react { -NSArray * convertStringVectorToNSArray(const std::vector &values) { +NSArray *convertStringVectorToNSArray(const std::vector &values) +{ NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:values.size()]; for (const auto &value : values) { [result addObject:RCTNSStringFromString(value)]; @@ -12,7 +14,8 @@ return result; } -NSArray * convertIntVectorToNSArray(const std::vector &values) { +NSArray *convertIntVectorToNSArray(const std::vector &values) +{ NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:values.size()]; for (int value : values) { [result addObject:@(value)]; @@ -20,7 +23,7 @@ return result; } -NSDictionary * _Nullable convertFollyDynamicToNSDictionaryOrNil(const folly::dynamic &dyn) +NSDictionary *_Nullable convertFollyDynamicToNSDictionaryOrNil(const folly::dynamic &dyn) { switch (dyn.type()) { case folly::dynamic::OBJECT: { @@ -39,9 +42,9 @@ } } -NSDictionary * convertFollyDynamicToNSDictionary(const folly::dynamic &dyn) +NSDictionary *convertFollyDynamicToNSDictionary(const folly::dynamic &dyn) { return convertFollyDynamicToNSDictionaryOrNil(dyn) ?: [NSDictionary new]; } -} +} // namespace stripe::react