From 62d0586e599cc43a60f1975eb9c32feb8da45cc2 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Mon, 12 Oct 2015 11:34:27 -0700 Subject: [PATCH] Rely only on scriptURL when loading images Reviewed By: @foghina Differential Revision: D2527119 fb-gh-sync-id: e2a9618f729a2ec03b1959fa13fae46620cc379e --- Libraries/Image/__tests__/resolveAssetSource-test.js | 7 ++----- Libraries/Image/resolveAssetSource.js | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Libraries/Image/__tests__/resolveAssetSource-test.js b/Libraries/Image/__tests__/resolveAssetSource-test.js index 5d5bdc0e6..365c76230 100644 --- a/Libraries/Image/__tests__/resolveAssetSource-test.js +++ b/Libraries/Image/__tests__/resolveAssetSource-test.js @@ -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', () => { @@ -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'; }); @@ -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'; }); diff --git a/Libraries/Image/resolveAssetSource.js b/Libraries/Image/resolveAssetSource.js index 29323afa6..8768cd385 100644 --- a/Libraries/Image/resolveAssetSource.js +++ b/Libraries/Image/resolveAssetSource.js @@ -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?:\/\/.*?\//);