Skip to content

Commit 62d0586

Browse files
franticfacebook-github-bot-9
authored andcommitted
Rely only on scriptURL when loading images
Reviewed By: @foghina Differential Revision: D2527119 fb-gh-sync-id: e2a9618f729a2ec03b1959fa13fae46620cc379e
1 parent 5e33dbc commit 62d0586

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Libraries/Image/__tests__/resolveAssetSource-test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function expectResolvesAsset(input, expectedSource) {
2525
describe('resolveAssetSource', () => {
2626
beforeEach(() => {
2727
jest.resetModuleRegistry();
28-
__DEV__ = true;
2928
});
3029

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

110109
});
111110

112-
describe('bundle was loaded from file (PROD) on iOS', () => {
111+
describe('bundle was loaded from file on iOS', () => {
113112
beforeEach(() => {
114113
NativeModules.SourceCode.scriptURL =
115114
'file:///Path/To/Simulator/main.bundle';
116-
__DEV__ = false;
117115
Platform.OS = 'ios';
118116
});
119117

@@ -138,11 +136,10 @@ describe('resolveAssetSource', () => {
138136
});
139137
});
140138

141-
describe('bundle was loaded from file (PROD) on Android', () => {
139+
describe('bundle was loaded from file on Android', () => {
142140
beforeEach(() => {
143141
NativeModules.SourceCode.scriptURL =
144142
'file:///Path/To/Simulator/main.bundle';
145-
__DEV__ = false;
146143
Platform.OS = 'android';
147144
});
148145

Libraries/Image/resolveAssetSource.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ var SourceCode = require('NativeModules').SourceCode;
2020
var _serverURL;
2121

2222
function getDevServerURL() {
23-
if (!__DEV__) {
24-
// In prod we want assets to be loaded from the archive
25-
return null;
26-
}
2723
if (_serverURL === undefined) {
2824
var scriptURL = SourceCode.scriptURL;
2925
var match = scriptURL && scriptURL.match(/^https?:\/\/.*?\//);

0 commit comments

Comments
 (0)