forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING kill deprecated asset support
Summary: This removes support for `require('image!…')`, which has been deprecated for a long time. It is still possible to use images that are already bundled by the native app using the `nativeImageSource` module. Check http://facebook.github.io/react-native/docs/images.html for detailed documentation. Reviewed By: matryoshcow Differential Revision: D4231208 fbshipit-source-id: 05ec4c1ca0fabdc3fbb652f8ad1acdf240a67955
- Loading branch information
1 parent
0c50a5b
commit ca58e0a
Showing
27 changed files
with
18 additions
and
724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,6 @@ describe('Bundler', function() { | |
id, | ||
dependencies, | ||
isAsset, | ||
isAsset_DEPRECATED, | ||
isJSON, | ||
isPolyfill, | ||
resolution, | ||
|
@@ -50,7 +49,6 @@ describe('Bundler', function() { | |
getName: () => Promise.resolve(id), | ||
isJSON: () => isJSON, | ||
isAsset: () => isAsset, | ||
isAsset_DEPRECATED: () => isAsset_DEPRECATED, | ||
isPolyfill: () => isPolyfill, | ||
read: () => ({ | ||
code: 'arbitrary', | ||
|
@@ -100,13 +98,6 @@ describe('Bundler', function() { | |
modules = [ | ||
createModule({id: 'foo', path: '/root/foo.js', dependencies: []}), | ||
createModule({id: 'bar', path: '/root/bar.js', dependencies: []}), | ||
createModule({ | ||
path: '/root/img/img.png', | ||
id: 'image!img', | ||
isAsset_DEPRECATED: true, | ||
dependencies: [], | ||
resolution: 2, | ||
}), | ||
createModule({ | ||
id: 'new_image.png', | ||
path: '/root/img/new_image.png', | ||
|
@@ -166,9 +157,8 @@ describe('Bundler', function() { | |
|
||
expect(ithAddedModule(0)).toEqual('/root/foo.js'); | ||
expect(ithAddedModule(1)).toEqual('/root/bar.js'); | ||
expect(ithAddedModule(2)).toEqual('/root/img/img.png'); | ||
expect(ithAddedModule(3)).toEqual('/root/img/new_image.png'); | ||
expect(ithAddedModule(4)).toEqual('/root/file.json'); | ||
expect(ithAddedModule(2)).toEqual('/root/img/new_image.png'); | ||
expect(ithAddedModule(3)).toEqual('/root/file.json'); | ||
|
||
expect(bundle.finalize.mock.calls[0]).toEqual([{ | ||
runMainModule: true, | ||
|
@@ -177,15 +167,6 @@ describe('Bundler', function() { | |
}]); | ||
|
||
expect(bundle.addAsset.mock.calls[0]).toEqual([{ | ||
__packager_asset: true, | ||
path: '/root/img/img.png', | ||
uri: 'img', | ||
width: 25, | ||
height: 50, | ||
deprecated: true, | ||
}]); | ||
|
||
expect(bundle.addAsset.mock.calls[1]).toEqual([{ | ||
__packager_asset: true, | ||
fileSystemLocation: '/root/img', | ||
httpServerLocation: '/assets/img', | ||
|
@@ -245,7 +226,7 @@ describe('Bundler', function() { | |
sourceMapUrl: 'source_map_url', | ||
assetPlugins: ['mockPlugin1', 'asyncMockPlugin2'], | ||
}).then(bundle => { | ||
expect(bundle.addAsset.mock.calls[1]).toEqual([{ | ||
expect(bundle.addAsset.mock.calls[0]).toEqual([{ | ||
__packager_asset: true, | ||
fileSystemLocation: '/root/img', | ||
httpServerLocation: '/assets/img', | ||
|
@@ -334,7 +315,6 @@ describe('Bundler', function() { | |
.then((paths) => expect(paths).toEqual([ | ||
'/root/foo.js', | ||
'/root/bar.js', | ||
'/root/img/img.png', | ||
'/root/img/new_image.png', | ||
'/root/img/[email protected]', | ||
'/root/img/[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.