Commit 8420ecc
Remove JavaMethodWrapper and decouple JavaModuleWrapper from legacy invocation
Summary:
JavaMethodWrapper is a legacy architecture class that wraps ReactMethod-annotated
Java methods via reflection for the bridge-based NativeModule invocation path.
When ReactNativeFeatureFlags.useTurboModuleInterop is enabled (the new architecture),
this class is completely bypassed — the TurboModule interop layer uses
JavaInteropTurboModule (C++) with direct JNI invocation via
JavaTurboModule::invokeJavaMethod(), which converts JSI values to JNI arguments
directly in C++ without any Java-side reflection.
This diff:
- Deletes JavaMethodWrapper.kt (only instantiated from JavaModuleWrapper.findMethods())
- Deletes BaseJavaModuleTest.kt (test that exercised JavaMethodWrapper)
- Removes the NativeMethod interface from JavaModuleWrapper (only implemented by JavaMethodWrapper)
- Rewrites JavaModuleWrapper.findMethods() to compute method type inline without JavaMethodWrapper
- Changes JavaModuleWrapper.invoke() to throw UnsupportedOperationException
- Sets md.signature to empty string for sync methods to prevent C++ null deref
The JavaModuleWrapper class shell is kept because it is still referenced from C++ JNI
(JavaModuleWrapper.cpp) and NativeModuleRegistry. Full removal is planned as follow-up.
Reviewed By: cortinico, javache
Differential Revision: D973871211 parent ac598af commit 8420ecc
3 files changed
Lines changed: 15 additions & 568 deletions
File tree
- packages/react-native/ReactAndroid/src
- main/java/com/facebook/react/bridge
- test/java/com/facebook/react/bridge
0 commit comments