Skip to content

Commit

Permalink
Only include ServerHost constant in debug builds
Browse files Browse the repository at this point in the history
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 2bf0d54
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 2bf0d54

Please sign in to comment.