Skip to content

Commit ad88309

Browse files
RSNarafacebook-github-bot
authored andcommitted
Compile out the legacy runtime
Summary: Compile out the legacy c++ core from android. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D72991984 fbshipit-source-id: 56bb6ca1c4797adb9235e982121712b11e85e109
1 parent fd29d68 commit ad88309

12 files changed

Lines changed: 46 additions & 0 deletions

packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include "JniJSModulesUnbundle.h"
3737
#include "NativeArray.h"
3838

39+
#ifndef RCT_FIT_RM_OLD_RUNTIME
40+
3941
using namespace facebook::jni;
4042

4143
namespace facebook::react {
@@ -419,3 +421,5 @@ void CatalystInstanceImpl::unregisterFromInspector() {
419421
}
420422

421423
} // namespace facebook::react
424+
425+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "ModuleRegistryBuilder.h"
2222
#include "ReactInstanceManagerInspectorTarget.h"
2323

24+
#ifndef RCT_FIT_RM_OLD_RUNTIME
25+
2426
namespace facebook::react {
2527

2628
class Instance;
@@ -125,3 +127,5 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
125127
};
126128

127129
} // namespace facebook::react
130+
131+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "CatalystInstanceImpl.h"
2424
#include "ReadableNativeArray.h"
2525

26+
#ifndef RCT_FIT_RM_OLD_RUNTIME
27+
2628
using facebook::xplat::module::CxxModule;
2729

2830
namespace facebook::react {
@@ -152,3 +154,5 @@ jni::local_ref<JReflectMethod::javaobject> JMethodDescriptor::getMethod()
152154
}
153155

154156
} // namespace facebook::react
157+
158+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include "MethodInvoker.h"
1515

16+
#ifndef RCT_FIT_RM_OLD_RUNTIME
17+
1618
namespace facebook::react {
1719

1820
class Instance;
@@ -85,3 +87,5 @@ class JavaNativeModule : public NativeModule {
8587
};
8688

8789
} // namespace facebook::react
90+
91+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/JavaScriptExecutorHolder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <cxxreact/JSExecutor.h>
1111
#include <fbjni/fbjni.h>
1212

13+
#ifndef RCT_FIT_RM_OLD_RUNTIME
14+
1315
namespace facebook::react {
1416

1517
class JavaScriptExecutorHolder
@@ -31,3 +33,5 @@ class JavaScriptExecutorHolder
3133
};
3234

3335
} // namespace facebook::react
36+
37+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <sstream>
1818
#include <utility>
1919

20+
#ifndef RCT_FIT_RM_OLD_RUNTIME
21+
2022
using magic_number_t = uint32_t;
2123
const magic_number_t MAGIC_FILE_HEADER = 0xFB0BD1E5;
2224
const char* MAGIC_FILE_NAME = "UNBUNDLE";
@@ -94,3 +96,5 @@ JSModulesUnbundle::Module JniJSModulesUnbundle::getModule(
9496
}
9597

9698
} // namespace facebook::react
99+
100+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <android/asset_manager.h>
1313
#include <cxxreact/JSModulesUnbundle.h>
1414

15+
#ifndef RCT_FIT_RM_OLD_RUNTIME
16+
1517
namespace facebook::react {
1618

1719
class JniJSModulesUnbundle : public JSModulesUnbundle {
@@ -41,3 +43,5 @@ class JniJSModulesUnbundle : public JSModulesUnbundle {
4143
};
4244

4345
} // namespace facebook::react
46+
47+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/MethodInvoker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "WritableNativeArray.h"
2121
#include "WritableNativeMap.h"
2222

23+
#ifndef RCT_FIT_RM_OLD_RUNTIME
24+
2325
using namespace facebook::jni;
2426

2527
namespace facebook::react {
@@ -309,3 +311,5 @@ MethodCallResult MethodInvoker::invoke(
309311
}
310312

311313
} // namespace facebook::react
314+
315+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/MethodInvoker.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <fbjni/fbjni.h>
1414
#include <folly/dynamic.h>
1515

16+
#ifndef RCT_FIT_RM_OLD_RUNTIME
17+
1618
namespace facebook::react {
1719

1820
class Instance;
@@ -62,3 +64,5 @@ class MethodInvoker {
6264
};
6365

6466
} // namespace facebook::react
67+
68+
#endif

packages/react-native/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include <cxxreact/CxxNativeModule.h>
1515

16+
#ifndef RCT_FIT_RM_OLD_RUNTIME
17+
1618
namespace facebook::react {
1719

1820
std::string ModuleHolder::getName() const {
@@ -68,3 +70,5 @@ std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
6870
}
6971

7072
} // namespace facebook::react
73+
74+
#endif

0 commit comments

Comments
 (0)