Skip to content

Commit bc0f5a1

Browse files
committed
feat: enable new architecture and Fabric support in Android and iOS SDKs
1 parent 9859dc4 commit bc0f5a1

6 files changed

Lines changed: 130 additions & 39 deletions

File tree

android/build.gradle

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,6 @@ dependencies {
115115
implementation "com.facebook.react:react-native:+"
116116
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
117117
api "com.iterable:iterableapi:3.5.2"
118-
// api project(":iterableapi") // links to local android SDK repo rather than by release
119-
120-
if (isNewArchitectureEnabled()) {
121-
implementation project(":ReactAndroid")
122-
implementation project(":ReactCommon")
123-
implementation project(":ReactCommon:jsi")
124-
implementation project(":ReactCommon:reactnativejni")
125-
implementation project(":ReactCommon:reactnativejni:jsi")
126-
implementation project(":ReactCommon:reactnativejni:jsc")
127-
implementation project(":ReactCommon:reactnativejni:hermes")
128-
implementation project(":ReactCommon:reactnativejni:fabricjni")
129-
}
118+
// api project(":iterableapi") // links to local android SDK repo rather than by release
130119
}
131120

android/gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ RNIterable_compileSdkVersion=31
55
RNIterable_ndkversion=21.4.7075529
66
android.useAndroidX=true
77
android.enableJetifier=true
8-
9-
# New Architecture flags
10-
newArchEnabled=false
11-
fabricEnabled=false

example/android/gradle.properties

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@ android.useAndroidX=true
2727
# ./gradlew <task> -PreactNativeArchitectures=x86_64
2828
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
2929

30-
# Use this property to enable support to the new architecture.
31-
# This will allow you to use TurboModules and the Fabric render in
32-
# your application. You should enable this flag either if you want
33-
# to write custom TurboModules/Fabric components OR use libraries that
34-
# are providing them.
35-
newArchEnabled=false
30+
3631

3732
# Use this property to enable or disable the Hermes JS engine.
3833
# If set to false, you will be using JSC instead.
3934
hermesEnabled=true
4035

4136
# Needed for react-native-webview
4237
# See: https://github.com/react-native-webview/react-native-webview/blob/HEAD/docs/Getting-Started.md
43-
android.enableJetifier=true
38+
android.enableJetifier=true
39+
40+
########################################################
41+
# New Architecture flags
42+
########################################################
43+
# Use this property to enable support to the new architecture.
44+
# This will allow you to use TurboModules and the Fabric render in
45+
# your application. You should enable this flag either if you want
46+
# to write custom TurboModules/Fabric components OR use libraries that
47+
# are providing them.
48+
newArchEnabled=true
49+
fabricEnabled=true

example/ios/Podfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ require Pod::Executable.execute_command('node', ['-p',
88
platform :ios, min_ios_version_supported
99
prepare_react_native_project!
1010

11+
# Enable new architecture
12+
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
13+
1114
linkage = ENV['USE_FRAMEWORKS']
1215
if linkage != nil
1316
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
@@ -20,7 +23,11 @@ target 'ReactNativeSdkExample' do
2023
use_react_native!(
2124
:path => config[:reactNativePath],
2225
# An absolute path to your application root.
23-
:app_path => "#{Pod::Config.instance.installation_root}/.."
26+
:app_path => "#{Pod::Config.instance.installation_root}/..",
27+
# Enable new architecture
28+
:fabric_enabled => true,
29+
# Enable Hermes
30+
:hermes_enabled => true
2431
)
2532

2633
target 'ReactNativeSdkExampleTests' do

example/ios/Podfile.lock

Lines changed: 102 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine/Pre-built (= 0.75.3)
99
- hermes-engine/Pre-built (0.75.3)
1010
- Iterable-iOS-SDK (6.5.4)
11-
- Iterable-React-Native-SDK (2.0.0-alpha):
11+
- Iterable-React-Native-SDK (2.0.0-beta.1):
1212
- DoubleConversion
1313
- glog
1414
- hermes-engine
@@ -1261,7 +1261,71 @@ PODS:
12611261
- ReactCommon/turbomodule/core
12621262
- Yoga
12631263
- react-native-safe-area-context (4.11.1):
1264+
- DoubleConversion
1265+
- glog
1266+
- hermes-engine
1267+
- RCT-Folly (= 2024.01.01.00)
1268+
- RCTRequired
1269+
- RCTTypeSafety
1270+
- React-Core
1271+
- React-debug
1272+
- React-Fabric
1273+
- React-featureflags
1274+
- React-graphics
1275+
- React-ImageManager
1276+
- react-native-safe-area-context/common (= 4.11.1)
1277+
- react-native-safe-area-context/fabric (= 4.11.1)
1278+
- React-NativeModulesApple
1279+
- React-RCTFabric
1280+
- React-rendererdebug
1281+
- React-utils
1282+
- ReactCodegen
1283+
- ReactCommon/turbomodule/bridging
1284+
- ReactCommon/turbomodule/core
1285+
- Yoga
1286+
- react-native-safe-area-context/common (4.11.1):
1287+
- DoubleConversion
1288+
- glog
1289+
- hermes-engine
1290+
- RCT-Folly (= 2024.01.01.00)
1291+
- RCTRequired
1292+
- RCTTypeSafety
1293+
- React-Core
1294+
- React-debug
1295+
- React-Fabric
1296+
- React-featureflags
1297+
- React-graphics
1298+
- React-ImageManager
1299+
- React-NativeModulesApple
1300+
- React-RCTFabric
1301+
- React-rendererdebug
1302+
- React-utils
1303+
- ReactCodegen
1304+
- ReactCommon/turbomodule/bridging
1305+
- ReactCommon/turbomodule/core
1306+
- Yoga
1307+
- react-native-safe-area-context/fabric (4.11.1):
1308+
- DoubleConversion
1309+
- glog
1310+
- hermes-engine
1311+
- RCT-Folly (= 2024.01.01.00)
1312+
- RCTRequired
1313+
- RCTTypeSafety
12641314
- React-Core
1315+
- React-debug
1316+
- React-Fabric
1317+
- React-featureflags
1318+
- React-graphics
1319+
- React-ImageManager
1320+
- react-native-safe-area-context/common
1321+
- React-NativeModulesApple
1322+
- React-RCTFabric
1323+
- React-rendererdebug
1324+
- React-utils
1325+
- ReactCodegen
1326+
- ReactCommon/turbomodule/bridging
1327+
- ReactCommon/turbomodule/core
1328+
- Yoga
12651329
- react-native-webview (13.12.3):
12661330
- DoubleConversion
12671331
- glog
@@ -1565,6 +1629,29 @@ PODS:
15651629
- ReactCommon/turbomodule/core
15661630
- Yoga
15671631
- RNScreens (3.34.0):
1632+
- DoubleConversion
1633+
- glog
1634+
- hermes-engine
1635+
- RCT-Folly (= 2024.01.01.00)
1636+
- RCTRequired
1637+
- RCTTypeSafety
1638+
- React-Core
1639+
- React-debug
1640+
- React-Fabric
1641+
- React-featureflags
1642+
- React-graphics
1643+
- React-ImageManager
1644+
- React-NativeModulesApple
1645+
- React-RCTFabric
1646+
- React-RCTImage
1647+
- React-rendererdebug
1648+
- React-utils
1649+
- ReactCodegen
1650+
- ReactCommon/turbomodule/bridging
1651+
- ReactCommon/turbomodule/core
1652+
- RNScreens/common (= 3.34.0)
1653+
- Yoga
1654+
- RNScreens/common (3.34.0):
15681655
- DoubleConversion
15691656
- glog
15701657
- hermes-engine
@@ -1834,7 +1921,7 @@ SPEC CHECKSUMS:
18341921
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
18351922
hermes-engine: 8d2103d6c0176779aea4e25df6bb1410f9946680
18361923
Iterable-iOS-SDK: 710bf6dada7dae9c03a09db7f0bc6c9d9a671f40
1837-
Iterable-React-Native-SDK: 704ac7fdc74f9a60621537f7724fe352f9d558c6
1924+
Iterable-React-Native-SDK: f7d3f5792998368806a78c92143f20418ce2ddeb
18381925
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
18391926
RCTDeprecation: 4191f6e64b72d9743f6fe1a8a16e89e868f5e9e7
18401927
RCTRequired: 9bb589570f2bb3abc6518761e3fd1ad9b7f7f06c
@@ -1845,16 +1932,16 @@ SPEC CHECKSUMS:
18451932
React-CoreModules: 2d68c251bc4080028f2835fa47504e8f20669a21
18461933
React-cxxreact: 5f233f8ac7ea4772e49462e0ab2b0a15a4f80ab7
18471934
React-debug: fd0ed8ecd5f8a23c7daf5ceaca8aa722a4d083fd
1848-
React-defaultsnativemodule: 10f0f8bc38d8dc7d2273572cd85ed0b71298ecdd
1849-
React-domnativemodule: bfef3dda59e7030b498d0d78628f4adf414ab8e4
1935+
React-defaultsnativemodule: 1f9a0cae1ef7e05a6ea2bbec2e5eff6eb70da16a
1936+
React-domnativemodule: 38d632c6963ab2d08f5ce67808e070439bd1461c
18501937
React-Fabric: 3d0f5e2735d2f77a897ee684edeff7bb0e061919
18511938
React-FabricComponents: 68032a85a3c25c9c8d6ce676d8af9a85e2370f24
18521939
React-FabricImage: f8ac2df576703097b5b2f8d972b162cdca855aa3
18531940
React-featureflags: cf78861db9318ae29982fa8953c92d31b276c9ac
1854-
React-featureflagsnativemodule: d04eb5c3f0ac33fe70b060d97e8649bfd69c5f1e
1941+
React-featureflagsnativemodule: 99ffda7fc2cc0f9578b05b84d8b4a2e9dcb39b8b
18551942
React-graphics: 7572851bca7242416b648c45d6af87d93d29281e
18561943
React-hermes: 95c27801c60615345ee6256eafa6d597ce983b8b
1857-
React-idlecallbacksnativemodule: f5f0b760ec2739b30e315e1afee3dd3a5a93c3b6
1944+
React-idlecallbacksnativemodule: e4fd9ee09b8481dd22f1e173984e5ee2730712ce
18581945
React-ImageManager: aedf54d34d4475c66f4c3da6b8359b95bee904e4
18591946
React-jserrorhandler: 0c8949672a00f2a502c767350e591e3ec3d82fb3
18601947
React-jsi: d77bb442a4b0849063f2bd22d3c1fa71918713b7
@@ -1863,18 +1950,18 @@ SPEC CHECKSUMS:
18631950
React-jsitracing: 3935b092f85bb1e53b8cf8a00f572413648af46b
18641951
React-logger: 4072f39df335ca443932e0ccece41fbeb5ca8404
18651952
React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4
1866-
React-microtasksnativemodule: 4943ad8f99be8ccf5a63329fa7d269816609df9e
1867-
react-native-safe-area-context: 5141f11858b033636f1788b14f32eaba92cee810
1868-
react-native-webview: 926d2665cf3196e39c4449a72d136d0a53b9df8a
1953+
React-microtasksnativemodule: 0b6b90da7f203e3015e1252ec3cba49c8ddd85ad
1954+
react-native-safe-area-context: 2279fe040bc93af8624f7d034806180fdbe5fa02
1955+
react-native-webview: 8039cbb0aa6ad2fd7918e23aebb5586f127d3e91
18691956
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
18701957
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
18711958
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
18721959
React-performancetimeline: d15a723422ed500f47cb271f3175abbeb217f5ba
18731960
React-RCTActionSheet: cb2b38a53d03ec22f1159c89667b86c2c490d92d
18741961
React-RCTAnimation: 6836c87c7364f471e9077fda80b7349bc674be33
1875-
React-RCTAppDelegate: 2f11edfa7302451c792591f9a7838ca86cdcec34
1962+
React-RCTAppDelegate: 603240f6a7d7eefeeffe4e29dd0be70dc35208cf
18761963
React-RCTBlob: 516dbbd38397f5013394fdd1cc65408cc82e37a1
1877-
React-RCTFabric: b281a52c2b9726b0c64880e1535f2100013d5f7c
1964+
React-RCTFabric: 7298604d497db4fe445cd704bd1097636643ee89
18781965
React-RCTImage: 1b2c2c1716db859ffff2d7a06a30b0ec5c677fc5
18791966
React-RCTLinking: 59c07577767e705b0ab95d11e5ad74c61bf2a022
18801967
React-RCTNetwork: f9a827e7d6bc428e0d99cd1fbe0427854354b8c1
@@ -1892,12 +1979,12 @@ SPEC CHECKSUMS:
18921979
React-utils: f2afa6acd905ca2ce7bb8ffb4a22f7f8a12534e8
18931980
ReactCodegen: ff95a93d5ab5d9b2551571886271478eaa168565
18941981
ReactCommon: 289214026502e6a93484f4a46bcc0efa4f3f2864
1895-
RNGestureHandler: 1b7c5ed637e02f6898d08bffb701d378be5e091d
1896-
RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06
1897-
RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136
1982+
RNGestureHandler: 364e6862a112045bb5c5d35601f0bdb0304af979
1983+
RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2
1984+
RNVectorIcons: 07792a9538e8577c1263fcad187712e90d65d8fb
18981985
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
18991986
Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63
19001987

1901-
PODFILE CHECKSUM: aab4a30773612c4ffb73be13f5b169b8b156f374
1988+
PODFILE CHECKSUM: 4c6a6a09af0b3466691c09d9d9af2515b974ddc9
19021989

19031990
COCOAPODS: 1.16.2

example/react-native.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ module.exports = {
1010
dependencies: {
1111
[pkg.name]: {
1212
root: path.join(__dirname, '..'),
13+
platforms: {
14+
// Codegen script incorrectly fails without this
15+
// So we explicitly specify the platforms with empty object
16+
ios: {},
17+
android: {},
18+
},
1319
},
1420
},
1521
};

0 commit comments

Comments
 (0)