Skip to content

Commit bf5312d

Browse files
authored
Merge pull request #79 from callstack/feat/ios-fabric-support
feat: support new architecture & bridgeless on iOS
2 parents a3a9129 + 0e5fa03 commit bf5312d

File tree

8 files changed

+324
-109
lines changed

8 files changed

+324
-109
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ jobs:
44
analyse:
55
docker:
66
- image: cimg/node:current
7+
environment:
8+
SKIP_YARN_COREPACK_CHECK: 0
79
steps:
810
- checkout
911
- restore_cache:

ReactNativeBrownfield.podspec

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
require 'json'
22

3+
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4+
new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
5+
other_cflags = "$(inherited)" + new_arch_enabled_flag
6+
37
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
48

59
Pod::Spec.new do |spec|
@@ -14,7 +18,9 @@ Pod::Spec.new do |spec|
1418

1519
# s.source = { :git => "[email protected]/michalchudziak/react-native-brownfield.git", :tag => "v#{s.version}" }
1620
spec.source = { :path => "." }
17-
spec.source_files = "ios/**/*.{h,m}"
21+
spec.source_files = "ios/**/*.{h,m,mm}"
22+
spec.compiler_flags = new_arch_enabled_flag
23+
spec.pod_target_xcconfig = { 'OTHER_CPLUSPLUSFLAGS' => other_cflags }
1824

1925
spec.dependency 'React'
20-
end
26+
end

example/objc/Podfile.lock

Lines changed: 136 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,72 @@ PODS:
935935
- React-Mapbuffer (0.74.2):
936936
- glog
937937
- React-debug
938-
- react-native-safe-area-context (4.7.1):
938+
- react-native-safe-area-context (4.10.8):
939+
- DoubleConversion
940+
- glog
941+
- hermes-engine
942+
- RCT-Folly (= 2024.01.01.00)
943+
- RCTRequired
944+
- RCTTypeSafety
945+
- React-Codegen
946+
- React-Core
947+
- React-debug
948+
- React-Fabric
949+
- React-featureflags
950+
- React-graphics
951+
- React-ImageManager
952+
- react-native-safe-area-context/common (= 4.10.8)
953+
- react-native-safe-area-context/fabric (= 4.10.8)
954+
- React-NativeModulesApple
955+
- React-RCTFabric
956+
- React-rendererdebug
957+
- React-utils
958+
- ReactCommon/turbomodule/bridging
959+
- ReactCommon/turbomodule/core
960+
- Yoga
961+
- react-native-safe-area-context/common (4.10.8):
962+
- DoubleConversion
963+
- glog
964+
- hermes-engine
965+
- RCT-Folly (= 2024.01.01.00)
966+
- RCTRequired
967+
- RCTTypeSafety
968+
- React-Codegen
939969
- React-Core
970+
- React-debug
971+
- React-Fabric
972+
- React-featureflags
973+
- React-graphics
974+
- React-ImageManager
975+
- React-NativeModulesApple
976+
- React-RCTFabric
977+
- React-rendererdebug
978+
- React-utils
979+
- ReactCommon/turbomodule/bridging
980+
- ReactCommon/turbomodule/core
981+
- Yoga
982+
- react-native-safe-area-context/fabric (4.10.8):
983+
- DoubleConversion
984+
- glog
985+
- hermes-engine
986+
- RCT-Folly (= 2024.01.01.00)
987+
- RCTRequired
988+
- RCTTypeSafety
989+
- React-Codegen
990+
- React-Core
991+
- React-debug
992+
- React-Fabric
993+
- React-featureflags
994+
- React-graphics
995+
- React-ImageManager
996+
- react-native-safe-area-context/common
997+
- React-NativeModulesApple
998+
- React-RCTFabric
999+
- React-rendererdebug
1000+
- React-utils
1001+
- ReactCommon/turbomodule/bridging
1002+
- ReactCommon/turbomodule/core
1003+
- Yoga
9401004
- React-nativeconfig (0.74.2)
9411005
- React-NativeModulesApple (0.74.2):
9421006
- glog
@@ -1166,13 +1230,74 @@ PODS:
11661230
- React-logger (= 0.74.2)
11671231
- React-perflogger (= 0.74.2)
11681232
- React-utils (= 0.74.2)
1169-
- ReactNativeBrownfield (0.0.3):
1233+
- ReactNativeBrownfield (0.1.0):
11701234
- React
1171-
- RNGestureHandler (2.12.1):
1235+
- RNGestureHandler (2.16.2):
1236+
- DoubleConversion
1237+
- glog
1238+
- hermes-engine
1239+
- RCT-Folly (= 2024.01.01.00)
1240+
- RCTRequired
1241+
- RCTTypeSafety
1242+
- React-Codegen
11721243
- React-Core
1173-
- RNScreens (3.24.0):
1244+
- React-debug
1245+
- React-Fabric
1246+
- React-featureflags
1247+
- React-graphics
1248+
- React-ImageManager
1249+
- React-NativeModulesApple
1250+
- React-RCTFabric
1251+
- React-rendererdebug
1252+
- React-utils
1253+
- ReactCommon/turbomodule/bridging
1254+
- ReactCommon/turbomodule/core
1255+
- Yoga
1256+
- RNScreens (3.32.0):
1257+
- DoubleConversion
1258+
- glog
1259+
- hermes-engine
1260+
- RCT-Folly (= 2024.01.01.00)
1261+
- RCTRequired
1262+
- RCTTypeSafety
1263+
- React-Codegen
11741264
- React-Core
1265+
- React-debug
1266+
- React-Fabric
1267+
- React-featureflags
1268+
- React-graphics
1269+
- React-ImageManager
1270+
- React-NativeModulesApple
1271+
- React-RCTFabric
11751272
- React-RCTImage
1273+
- React-rendererdebug
1274+
- React-utils
1275+
- ReactCommon/turbomodule/bridging
1276+
- ReactCommon/turbomodule/core
1277+
- RNScreens/common (= 3.32.0)
1278+
- Yoga
1279+
- RNScreens/common (3.32.0):
1280+
- DoubleConversion
1281+
- glog
1282+
- hermes-engine
1283+
- RCT-Folly (= 2024.01.01.00)
1284+
- RCTRequired
1285+
- RCTTypeSafety
1286+
- React-Codegen
1287+
- React-Core
1288+
- React-debug
1289+
- React-Fabric
1290+
- React-featureflags
1291+
- React-graphics
1292+
- React-ImageManager
1293+
- React-NativeModulesApple
1294+
- React-RCTFabric
1295+
- React-RCTImage
1296+
- React-rendererdebug
1297+
- React-utils
1298+
- ReactCommon/turbomodule/bridging
1299+
- ReactCommon/turbomodule/core
1300+
- Yoga
11761301
- SocketRocket (0.7.0)
11771302
- Yoga (0.0.0)
11781303

@@ -1392,15 +1517,15 @@ SPEC CHECKSUMS:
13921517
React-jsitracing: 0fa7f78d8fdda794667cb2e6f19c874c1cf31d7e
13931518
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
13941519
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
1395-
react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2
1520+
react-native-safe-area-context: 1c0114777144dc0724820de71fe99c2e1e293a37
13961521
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
13971522
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
13981523
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
13991524
React-RCTActionSheet: 19f967ddaea258182b56ef11437133b056ba2adf
14001525
React-RCTAnimation: d7f4137fc44a08bba465267ea7cb1dbdb7c4ec87
1401-
React-RCTAppDelegate: 2b3f4d8009796af209a0d496e73276b743acee08
1526+
React-RCTAppDelegate: dca95e1a6194f7ae06c2b5f1d5f891c61af00ec8
14021527
React-RCTBlob: c6c3e1e0251700b7bea036b893913f22e2b9cb47
1403-
React-RCTFabric: 93a3ea55169d19294f07092013c1c9ea7a015c9b
1528+
React-RCTFabric: a7874c54aea18f64677446efc5f839ec4fa5e931
14041529
React-RCTImage: 40528ab74a4fef0f0e2ee797a074b26d120b6cc6
14051530
React-RCTLinking: 385b5beb96749aae9ae1606746e883e1c9f8a6a7
14061531
React-RCTNetwork: ffc9f05bd8fa5b3bce562199ba41235ad0af645c
@@ -1416,12 +1541,12 @@ SPEC CHECKSUMS:
14161541
React-runtimescheduler: 56b642bf605ba5afa500d35790928fc1d51565ad
14171542
React-utils: 4476b7fcbbd95cfd002f3e778616155241d86e31
14181543
ReactCommon: ecad995f26e0d1e24061f60f4e5d74782f003f12
1419-
ReactNativeBrownfield: 0bc504532635a5bd52357da90809911304b3a5cd
1420-
RNGestureHandler: c0d04458598fcb26052494ae23dda8f8f5162b13
1421-
RNScreens: b21dc57dfa2b710c30ec600786a3fc223b1b92e7
1544+
ReactNativeBrownfield: 705b27a49db571ba2a00a861ea3260373a4c2a56
1545+
RNGestureHandler: 156548e18203327173a764c6932a3f52e90cb9cd
1546+
RNScreens: d3d50aa84db4541eee00fbb1f32151030f56c510
14221547
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
14231548
Yoga: 2f71ecf38d934aecb366e686278102a51679c308
14241549

14251550
PODFILE CHECKSUM: 8a1f74a6d3fe9dd8d3fc23fe7060e9e3e422f511
14261551

1427-
COCOAPODS: 1.14.3
1552+
COCOAPODS: 1.15.2

example/swift/Podfile.lock

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ PODS:
935935
- React-Mapbuffer (0.74.2):
936936
- glog
937937
- React-debug
938-
- react-native-safe-area-context (4.7.1):
938+
- react-native-safe-area-context (4.10.8):
939939
- React-Core
940940
- React-nativeconfig (0.74.2)
941941
- React-NativeModulesApple (0.74.2):
@@ -1166,13 +1166,51 @@ PODS:
11661166
- React-logger (= 0.74.2)
11671167
- React-perflogger (= 0.74.2)
11681168
- React-utils (= 0.74.2)
1169-
- ReactNativeBrownfield (0.0.3):
1169+
- ReactNativeBrownfield (0.1.0):
11701170
- React
1171-
- RNGestureHandler (2.12.1):
1171+
- RNGestureHandler (2.16.2):
1172+
- DoubleConversion
1173+
- glog
1174+
- hermes-engine
1175+
- RCT-Folly (= 2024.01.01.00)
1176+
- RCTRequired
1177+
- RCTTypeSafety
1178+
- React-Codegen
11721179
- React-Core
1173-
- RNScreens (3.24.0):
1180+
- React-debug
1181+
- React-Fabric
1182+
- React-featureflags
1183+
- React-graphics
1184+
- React-ImageManager
1185+
- React-NativeModulesApple
1186+
- React-RCTFabric
1187+
- React-rendererdebug
1188+
- React-utils
1189+
- ReactCommon/turbomodule/bridging
1190+
- ReactCommon/turbomodule/core
1191+
- Yoga
1192+
- RNScreens (3.32.0):
1193+
- DoubleConversion
1194+
- glog
1195+
- hermes-engine
1196+
- RCT-Folly (= 2024.01.01.00)
1197+
- RCTRequired
1198+
- RCTTypeSafety
1199+
- React-Codegen
11741200
- React-Core
1201+
- React-debug
1202+
- React-Fabric
1203+
- React-featureflags
1204+
- React-graphics
1205+
- React-ImageManager
1206+
- React-NativeModulesApple
1207+
- React-RCTFabric
11751208
- React-RCTImage
1209+
- React-rendererdebug
1210+
- React-utils
1211+
- ReactCommon/turbomodule/bridging
1212+
- ReactCommon/turbomodule/core
1213+
- Yoga
11761214
- SocketRocket (0.7.0)
11771215
- Yoga (0.0.0)
11781216

@@ -1392,7 +1430,7 @@ SPEC CHECKSUMS:
13921430
React-jsitracing: 0fa7f78d8fdda794667cb2e6f19c874c1cf31d7e
13931431
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
13941432
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
1395-
react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2
1433+
react-native-safe-area-context: b7daa1a8df36095a032dff095a1ea8963cb48371
13961434
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
13971435
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
13981436
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
@@ -1416,12 +1454,12 @@ SPEC CHECKSUMS:
14161454
React-runtimescheduler: 56b642bf605ba5afa500d35790928fc1d51565ad
14171455
React-utils: 4476b7fcbbd95cfd002f3e778616155241d86e31
14181456
ReactCommon: ecad995f26e0d1e24061f60f4e5d74782f003f12
1419-
ReactNativeBrownfield: 0bc504532635a5bd52357da90809911304b3a5cd
1420-
RNGestureHandler: c0d04458598fcb26052494ae23dda8f8f5162b13
1421-
RNScreens: b21dc57dfa2b710c30ec600786a3fc223b1b92e7
1457+
ReactNativeBrownfield: 1dc8cd8bae9924dc9f3e2db084cc046ebf3b0949
1458+
RNGestureHandler: 2282cfbcf86c360d29f44ace393203afd5c6cff7
1459+
RNScreens: 5aeecbb09aa7285379b6e9f3c8a3c859bb16401c
14221460
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
14231461
Yoga: 2f71ecf38d934aecb366e686278102a51679c308
14241462

14251463
PODFILE CHECKSUM: ec44a86984cf570b289c1e2cc5cf00ee894f4904
14261464

1427-
COCOAPODS: 1.14.3
1465+
COCOAPODS: 1.15.2

ios/ReactNativeBrownfield.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import <Foundation/Foundation.h>
22
#import <React/RCTBridge.h>
33
#import <React/RCTBridgeDelegate.h>
4+
#import <React-RCTAppDelegate/RCTRootViewFactory.h>
45

56
NS_ASSUME_NONNULL_BEGIN
67

@@ -11,14 +12,26 @@ NS_ASSUME_NONNULL_BEGIN
1112
@property (nonatomic, copy) NSString *entryFile;
1213
@property (nonatomic, copy, nullable) NSString *fallbackResource;
1314
@property (nonatomic, copy) NSString *bundlePath;
14-
@property (nonatomic) RCTBridge *bridge;
15+
@property (nonatomic) RCTRootViewFactory* rootViewFactory;
16+
17+
/// This property controls whether the App will use the Fabric renderer of the New Architecture or not.
18+
@property (nonatomic, assign) BOOL fabricEnabled;
19+
20+
/// This property controls whether React Native's new initialization layer is enabled.
21+
@property (nonatomic, assign) BOOL bridgelessEnabled;
22+
23+
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off
24+
@property (nonatomic, assign) BOOL turboModuleEnabled;
1525

1626
+(ReactNativeBrownfield*)shared;
1727

1828
-(void)startReactNative;
1929
-(void)startReactNative:(void(^)(void))onBundleLoaded;
2030
-(void)startReactNative:(void(^)(void))onBundleLoaded launchOptions:(NSDictionary *)launchOptions;
2131

32+
/// Return the bundle URL for the main bundle.
33+
- (NSURL *__nullable)bundleURL;
34+
2235
@end
2336

2437
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)