Add package name / bundle ID to bundle URL in development

Summary:
Adds the package name (Android) / bundle ID (iOS) as a new URL parameter named `app` in the bundle URL. This currently has no effect on Metro, which will ignore it for bundling / caching purposes.

Changelog: [General] - Add package name / bundle ID to bundle URL in development

Reviewed By: cpojer

Differential Revision: D21429764

fbshipit-source-id: 394fe50dba72219f7594ebeac9486a8264a836a6
This commit is contained in:
Moti Zilberman
2020-05-12 07:35:50 -07:00
committed by Facebook GitHub Bot
parent 63099c40e6
commit 9b5359133b
3 changed files with 9 additions and 4 deletions
@@ -421,12 +421,13 @@ public class DevServerHelper {
private String createBundleURL(String mainModuleID, BundleType type, String host) {
return String.format(
Locale.US,
"http://%s/%s.%s?platform=android&dev=%s&minify=%s",
"http://%s/%s.%s?platform=android&dev=%s&minify=%s&app=%s",
host,
mainModuleID,
type.typeID(),
getDevMode(),
getJSMinifyMode());
getJSMinifyMode(),
mPackageName);
}
private String createBundleURL(String mainModuleID, BundleType type) {