Skip to content

Commit 2bf5ad7

Browse files
committed
feat: remove legacy arch support
1 parent cb088c1 commit 2bf5ad7

14 files changed

Lines changed: 100 additions & 655 deletions

File tree

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,12 @@ View the [API documentation](https://iterable-react-native-sdk.netlify.app).
6969

7070
## Architecture Support
7171

72-
Iterable's React Native SDK supports [React Native's New
72+
Iterable's React Native SDK requires [React Native's New
7373
Architecture](https://reactnative.dev/architecture/landing-page), including
74-
TurboModules and Fabric.
74+
TurboModules and Fabric. Legacy Architecture is not supported.
7575

76-
**IMPORTANT**: Iterable's React Native SDK supports React Native's Legacy Architecture, but it
77-
is no longer actively maintained. Use at your own risk.
78-
79-
Notes:
80-
81-
- Ensure your app is configured for New Architecture per the React Native docs.
82-
- The example app in this repository is configured with New Architecture enabled.
76+
Ensure your app is configured for New Architecture per the React Native docs.
77+
The example app in this repository has New Architecture enabled.
8378

8479
## Beta Versions
8580

android/build.gradle

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ buildscript {
1515
}
1616
}
1717

18-
def isNewArchitectureEnabled() {
19-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
20-
}
21-
2218
apply plugin: "com.android.library"
2319
apply plugin: "kotlin-android"
24-
25-
if (isNewArchitectureEnabled()) {
26-
apply plugin: "com.facebook.react"
27-
}
20+
apply plugin: "com.facebook.react"
2821

2922
def getExtOrDefault(name) {
3023
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNIterable_" + name]
@@ -59,7 +52,6 @@ android {
5952
defaultConfig {
6053
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
6154
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
62-
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
6355
}
6456

6557
buildFeatures {
@@ -81,16 +73,6 @@ android {
8173
targetCompatibility JavaVersion.VERSION_1_8
8274
}
8375

84-
sourceSets {
85-
main {
86-
if (isNewArchitectureEnabled()) {
87-
java.srcDirs += ['src/newarch']
88-
} else {
89-
java.srcDirs += ['src/oldarch']
90-
}
91-
}
92-
}
93-
9476
// Add this to match the Iterable SDK group ID
9577
group = "com.iterable"
9678
}

android/src/newarch/java/com/RNIterableAPIModule.java renamed to android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import com.facebook.react.bridge.ReactApplicationContext;
88
import com.facebook.react.bridge.ReadableArray;
99
import com.facebook.react.bridge.ReadableMap;
10-
import com.iterable.iterableapi.AuthFailure;
11-
import com.iterable.iterableapi.IterableLogger;
1210

1311
public class RNIterableAPIModule extends NativeRNIterableAPISpec {
1412
private final ReactApplicationContext reactContext;

android/src/main/java/com/iterable/reactnative/RNIterableAPIPackage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
3030
@Override
3131
public Map<String, ReactModuleInfo> getReactModuleInfos() {
3232
Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
33-
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
3433
moduleInfos.put(RNIterableAPIModuleImpl.NAME, new ReactModuleInfo(
3534
RNIterableAPIModuleImpl.NAME,
3635
RNIterableAPIModuleImpl.NAME,
3736
false, // canOverrideExistingModule
3837
false, // needsEagerInit
3938
false, // isCxxModule
40-
isTurboModule // isTurboModule
39+
true // isTurboModule
4140
));
4241
return moduleInfos;
4342
}

android/src/oldarch/java/com/RNIterableAPIModule.java

Lines changed: 0 additions & 273 deletions
This file was deleted.

ios/RNIterableAPI/RNIterableAPI.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
#import <Foundation/Foundation.h>
22
#import <React/RCTEventEmitter.h>
3+
#import <React/RCTUtils.h>
4+
#import <React/RCTConvert.h>
5+
#import <React/RCTTurboModuleRegistry.h>
6+
#import <RNIterableAPISpec/RNIterableAPISpec.h>
37

4-
#if RCT_NEW_ARCH_ENABLED
5-
6-
#import <React/RCTUtils.h>
7-
#import <React/RCTConvert.h>
8-
#import <React/RCTTurboModuleRegistry.h>
9-
#import <RNIterableAPISpec/RNIterableAPISpec.h>
108
@interface RNIterableAPI : RCTEventEmitter <NativeRNIterableAPISpec>
119

12-
#else
13-
#import <React/RCTBridgeModule.h>
14-
@interface RNIterableAPI : RCTEventEmitter <RCTBridgeModule>
15-
16-
#endif
17-
1810
@end

0 commit comments

Comments
 (0)