Permalink
Browse files

Rename module name to module path

Reviewed By: javache

Differential Revision: D5592950

fbshipit-source-id: 7e32043ba6d1de129a4f8dc694bb5987393b0ebc
  • Loading branch information...
Kathy Gray authored and facebook-github-bot committed Aug 10, 2017
1 parent 9b30f56 commit 5d4c6e5f23e3f7f64576cccff76822d4b7635ab1
@@ -125,7 +125,7 @@
/* accessed from any thread */
private final @Nullable JSBundleLoader mBundleLoader; /* path to JS bundle on file system */
private final @Nullable String mJSMainModuleName; /* path to JS bundle root on packager server */
private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */
private final List<ReactPackage> mPackages;
private final DevSupportManager mDevSupportManager;
private final boolean mUseDeveloperSupport;
@@ -205,7 +205,7 @@ public static ReactInstanceManagerBuilder builder() {
@Nullable Activity currentActivity,
@Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
@Nullable JSBundleLoader bundleLoader,
@Nullable String jsMainModuleName,
@Nullable String jsMainModulePath,
List<ReactPackage> packages,
boolean useDeveloperSupport,
@Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
@@ -230,13 +230,13 @@ public static ReactInstanceManagerBuilder builder() {
mCurrentActivity = currentActivity;
mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
mBundleLoader = bundleLoader;
mJSMainModuleName = jsMainModuleName;
mJSMainModulePath = jsMainModulePath;
mPackages = new ArrayList<>();
mUseDeveloperSupport = useDeveloperSupport;
mDevSupportManager = DevSupportManagerFactory.create(
applicationContext,
mDevInterface,
mJSMainModuleName,
mJSMainModulePath,
useDeveloperSupport,
redBoxHandler,
devBundleDownloadListener,
@@ -371,7 +371,7 @@ private void recreateReactContextInBackgroundInner() {
Log.d(ReactConstants.TAG, "ReactInstanceManager.recreateReactContextInBackgroundInner()");
UiThreadUtil.assertOnUiThread();
if (mUseDeveloperSupport && mJSMainModuleName != null &&
if (mUseDeveloperSupport && mJSMainModulePath != null &&
!Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JSC_CALLS)) {
final DeveloperSettings devSettings = mDevSupportManager.getDevSettings();
@@ -27,7 +27,7 @@
private @Nullable String mJSBundleAssetUrl;
private @Nullable JSBundleLoader mJSBundleLoader;
private @Nullable String mJSMainModuleName;
private @Nullable String mJSMainModulePath;
private @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener;
private @Nullable Application mApplication;
private boolean mUseDeveloperSupport;
@@ -103,8 +103,8 @@ public ReactInstanceManagerBuilder setJSBundleLoader(JSBundleLoader jsBundleLoad
* {@code "index.android"} or
* {@code "subdirectory/index.android"}
*/
public ReactInstanceManagerBuilder setJSMainModuleName(String jsMainModuleName) {
mJSMainModuleName = jsMainModuleName;
public ReactInstanceManagerBuilder setJSMainModulePath(String jsMainModulePath) {
mJSMainModulePath = jsMainModulePath;
return this;
}
@@ -236,8 +236,8 @@ public ReactInstanceManager build() {
"JS Bundle File or Asset URL has to be provided when dev support is disabled");
Assertions.assertCondition(
mJSMainModuleName != null || mJSBundleAssetUrl != null || mJSBundleLoader != null,
"Either MainModuleName or JS Bundle File needs to be provided");
mJSMainModulePath != null || mJSBundleAssetUrl != null || mJSBundleLoader != null,
"Either MainModulePath or JS Bundle File needs to be provided");
if (mUIImplementationProvider == null) {
// create default UIImplementationProvider if the provided one is null.
@@ -251,7 +251,7 @@ public ReactInstanceManager build() {
(mJSBundleLoader == null && mJSBundleAssetUrl != null) ?
JSBundleLoader.createAssetLoader(mApplication, mJSBundleAssetUrl, false /*Asynchronous*/) :
mJSBundleLoader,
mJSMainModuleName,
mJSMainModulePath,
mPackages,
mUseDeveloperSupport,
mBridgeIdleDebugListener,
@@ -65,7 +65,7 @@ public void clear() {
protected ReactInstanceManager createReactInstanceManager() {
ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
.setApplication(mApplication)
.setJSMainModuleName(getJSMainModuleName())
.setJSMainModulePath(getJSMainModuleName())
.setUseDeveloperSupport(getUseDeveloperSupport())
.setRedBoxHandler(getRedBoxHandler())
.setUIImplementationProvider(getUIImplementationProvider())
@@ -679,7 +679,7 @@ public class MyReactActivity extends Activity implements DefaultHardwareBackBtnH
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index")
.setJSMainModulePath("index")
.addPackage(new MainReactPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)

0 comments on commit 5d4c6e5

Please sign in to comment.