mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Warn whenever CxxNativeModules are used
Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b7fd68e611
commit
f536f82e12
@@ -139,6 +139,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
|
||||
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge");
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "initializeCxxBridge");
|
||||
|
||||
if (ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse) {
|
||||
warnOnLegacyNativeModuleSystemUse();
|
||||
}
|
||||
|
||||
initializeBridge(
|
||||
new BridgeCallback(this),
|
||||
jsExecutor,
|
||||
@@ -206,6 +211,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
private native void jniExtendNativeModules(
|
||||
Collection<JavaModuleWrapper> javaModules, Collection<ModuleHolder> cxxModules);
|
||||
|
||||
private native void warnOnLegacyNativeModuleSystemUse();
|
||||
|
||||
private native void initializeBridge(
|
||||
ReactCallback callback,
|
||||
JavaScriptExecutor jsExecutor,
|
||||
|
||||
Reference in New Issue
Block a user