Permalink
Browse files

Only include ServerHost constant in debug builds

Summary: I recently changed the implementation of `getServerHost` to be more expensive. I am excluding it from constants in non-debug builds, since loading that module lies on a critical path.

Reviewed By: axe-fb

Differential Revision: D12982150

fbshipit-source-id: eaaa50418726dbb2da2d517d0810f39b0dc7fac2
  • Loading branch information...
stepanhruda authored and facebook-github-bot committed Nov 10, 2018
1 parent be282b5 commit 2bf0d54f155c28244fa60230871b3eed60a20c6d
@@ -14,6 +14,7 @@

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.module.annotations.ReactModule;

import java.util.HashMap;
@@ -69,7 +70,9 @@ public String getName() {
constants.put("Serial", Build.SERIAL);
constants.put("Fingerprint", Build.FINGERPRINT);
constants.put("Model", Build.MODEL);
constants.put("ServerHost", AndroidInfoHelpers.getServerHost());
if (ReactBuildConfig.DEBUG) {
constants.put("ServerHost", AndroidInfoHelpers.getServerHost());
}
constants.put("isTesting", "true".equals(System.getProperty(IS_TESTING)));
constants.put("reactNativeVersion", ReactNativeVersion.VERSION);
constants.put("uiMode", uiMode());

0 comments on commit 2bf0d54

Please sign in to comment.