Skip to content

Commit 489b98b

Browse files
Yujie Liufacebook-github-bot
Yujie Liu
authored andcommittedDec 21, 2017
remove embeddedBundleURL
Reviewed By: fromcelticpark Differential Revision: D6502049 fbshipit-source-id: 31a611cea4c017877c3ce2f7e9a3503723af4c2d
1 parent ba31d29 commit 489b98b

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed
 

‎Libraries/Image/AssetSourceResolver.js

-17
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,15 @@ class AssetSourceResolver {
5252
serverUrl: ?string;
5353
// where the jsbundle is being run from
5454
jsbundleUrl: ?string;
55-
// where the embedded bundle in the app is stored
56-
embeddedBundleUrl: ?string;
5755
// the asset to resolve
5856
asset: PackagerAsset;
5957

6058
constructor(serverUrl: ?string,
6159
jsbundleUrl: ?string,
62-
embeddedBundleUrl: ?string,
6360
asset: PackagerAsset
6461
) {
6562
this.serverUrl = serverUrl;
6663
this.jsbundleUrl = jsbundleUrl;
67-
this.embeddedBundleUrl = embeddedBundleUrl;
6864
this.asset = asset;
6965
}
7066

@@ -76,10 +72,6 @@ class AssetSourceResolver {
7672
return !!(this.jsbundleUrl && this.jsbundleUrl.startsWith('file://'));
7773
}
7874

79-
canLoadFromEmbeddedBundledLocation(): boolean {
80-
return !!this.embeddedBundleUrl;
81-
}
82-
8375
defaultAsset(): ResolvedAssetSource {
8476
if (this.isLoadedFromServer()) {
8577
return this.assetServerURL();
@@ -123,15 +115,6 @@ class AssetSourceResolver {
123115
return this.fromSource(path + getScaledAssetPath(this.asset));
124116
}
125117

126-
/**
127-
* Resolves to the asset that was bundled with the app, with a scaled asset filename
128-
* E.g. 'file:///sdcard/bundle/assets/AwesomeModule/icon@2x.png'
129-
*/
130-
scaledAssetURLInEmbeddedBundleUrl(): ResolvedAssetSource {
131-
const path = this.embeddedBundleUrl || 'file://';
132-
return this.fromSource(path + getScaledAssetPath(this.asset));
133-
}
134-
135118
/**
136119
* The default location of assets bundled with the app, located by
137120
* resource identifier

‎Libraries/Image/resolveAssetSource.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const NativeModules = require('NativeModules');
1919

2020
import type { ResolvedAssetSource } from 'AssetSourceResolver';
2121

22-
let _customSourceTransformer, _serverURL, _scriptURL, _embeddedBundleURL;
22+
let _customSourceTransformer, _serverURL, _scriptURL;
2323

2424
function getDevServerURL(): ?string {
2525
if (_serverURL === undefined) {
@@ -60,12 +60,6 @@ function getScriptURL(): ?string {
6060
return _scriptURL;
6161
}
6262

63-
function getEmbeddedBundledURL(): ?string {
64-
const scriptURL = NativeModules.SourceCode.embeddedBundleURL;
65-
_embeddedBundleURL = _coerceLocalScriptURL(scriptURL);
66-
return _embeddedBundleURL;
67-
}
68-
6963
function setCustomSourceTransformer(
7064
transformer: (resolver: AssetSourceResolver) => ResolvedAssetSource,
7165
): void {
@@ -89,7 +83,6 @@ function resolveAssetSource(source: any): ?ResolvedAssetSource {
8983
const resolver = new AssetSourceResolver(
9084
getDevServerURL(),
9185
getScriptURL(),
92-
getEmbeddedBundledURL(),
9386
asset,
9487
);
9588
if (_customSourceTransformer) {

0 commit comments

Comments
 (0)
Please sign in to comment.