Skip to content

Commit

Permalink
Rely only on scriptURL when loading images
Browse files Browse the repository at this point in the history
Reviewed By: @foghina

Differential Revision: D2527119

fb-gh-sync-id: e2a9618f729a2ec03b1959fa13fae46620cc379e
  • Loading branch information
frantic authored and facebook-github-bot-9 committed Oct 12, 2015
1 parent 5e33dbc commit 62d0586
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions Libraries/Image/__tests__/resolveAssetSource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function expectResolvesAsset(input, expectedSource) {
describe('resolveAssetSource', () => {
beforeEach(() => {
jest.resetModuleRegistry();
__DEV__ = true;
});

it('returns same source for simple static and network images', () => {
Expand Down Expand Up @@ -109,11 +108,10 @@ describe('resolveAssetSource', () => {

});

describe('bundle was loaded from file (PROD) on iOS', () => {
describe('bundle was loaded from file on iOS', () => {
beforeEach(() => {
NativeModules.SourceCode.scriptURL =
'file:///Path/To/Simulator/main.bundle';
__DEV__ = false;
Platform.OS = 'ios';
});

Expand All @@ -138,11 +136,10 @@ describe('resolveAssetSource', () => {
});
});

describe('bundle was loaded from file (PROD) on Android', () => {
describe('bundle was loaded from file on Android', () => {
beforeEach(() => {
NativeModules.SourceCode.scriptURL =
'file:///Path/To/Simulator/main.bundle';
__DEV__ = false;
Platform.OS = 'android';
});

Expand Down
4 changes: 0 additions & 4 deletions Libraries/Image/resolveAssetSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ var SourceCode = require('NativeModules').SourceCode;
var _serverURL;

function getDevServerURL() {
if (!__DEV__) {
// In prod we want assets to be loaded from the archive
return null;
}
if (_serverURL === undefined) {
var scriptURL = SourceCode.scriptURL;
var match = scriptURL && scriptURL.match(/^https?:\/\/.*?\//);
Expand Down

0 comments on commit 62d0586

Please sign in to comment.