Skip to content

Commit a0175d4

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
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. Changelog: [Internal] internal Reviewed By: cortinico, javache Differential Revision: D97387121 fbshipit-source-id: 5c6a16f5b8d92430e4afeb3603b5bc538c076f90
1 parent b3c653e commit a0175d4

3 files changed

Lines changed: 15 additions & 568 deletions

File tree

0 commit comments

Comments
 (0)