remove rarely used bridge module optimization (#39457)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39457

## Changelog
[Android][General] - hasConstants in ReactModuleInfo does nothing now

we can get rid of this. currently, the default value of hasConstants true, and the only library setting this value to false is `WebSocketModule`. this value is only read in bridge mode - it is an optimization that will not initialize the constants dictionary for native modules in bridge.

however, we have plenty of native modules that don't provide constants that have not set this flag, so this is only turned on for `WebSocketModule`, which is probably not moving anything significant.

i would recommend we get rid of this to simplify the ReactModuleInfo deprecation plan.

Reviewed By: cortinico

Differential Revision: D49210251

fbshipit-source-id: c82c997e01cd8012b2c1a5c3c36061f81799eb04
This commit is contained in:
Phillip Pan
2023-09-14 17:34:19 -07:00
committed by Facebook GitHub Bot
parent 88e19c0ce6
commit 691bd0f9fb
2 changed files with 0 additions and 8 deletions
@@ -115,10 +115,6 @@ class JavaModuleWrapper {
@DoNotStrip
public @Nullable NativeMap getConstants() {
if (!mModuleHolder.getHasConstants()) {
return null;
}
final String moduleName = getName();
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "JavaModuleWrapper.getConstants")
.arg("moduleName", moduleName)
@@ -120,10 +120,6 @@ public class ModuleHolder {
return mReactModuleInfo.canOverrideExistingModule();
}
public boolean getHasConstants() {
return mReactModuleInfo.hasConstants();
}
public boolean isTurboModule() {
return mReactModuleInfo.isTurboModule();
}