Skip to content

Commit 3ca3cb7

Browse files
committed
Remove JavaMethodWrapper and decouple JavaModuleWrapper from legacy invocation (facebook#56201)
Summary: Pull Request resolved: facebook#56201 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: D97387121
1 parent fbc072e commit 3ca3cb7

3 files changed

Lines changed: 15 additions & 568 deletions

File tree

0 commit comments

Comments
 (0)