{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/1043","labels_url":"https://api.github.com/repos/facebook/react-native/issues/1043/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/1043/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/1043/events","html_url":"https://github.com/facebook/react-native/issues/1043","id":71422673,"number":1043,"title":"[Packager] New asset dependency system in the works ","user":{"login":"amasad","id":587518,"avatar_url":"https://avatars.githubusercontent.com/u/587518?v=3","gravatar_id":"","url":"https://api.github.com/users/amasad","html_url":"https://github.com/amasad","followers_url":"https://api.github.com/users/amasad/followers","following_url":"https://api.github.com/users/amasad/following{/other_user}","gists_url":"https://api.github.com/users/amasad/gists{/gist_id}","starred_url":"https://api.github.com/users/amasad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amasad/subscriptions","organizations_url":"https://api.github.com/users/amasad/orgs","repos_url":"https://api.github.com/users/amasad/repos","events_url":"https://api.github.com/users/amasad/events{/privacy}","received_events_url":"https://api.github.com/users/amasad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-04-27T22:43:33Z","updated_at":"2015-11-11T20:50:24Z","closed_at":"2015-09-08T07:41:43Z","body":"The way we currently handle images is far from ideal. To get it working, you have to configure the packager to look in the right directory, you have to add the image to xcode, and then you have to `require(image!image-name)` where `image-name` is a global name, and finally you'll have to learn how to manage assets for every platform you want to target with React Native.  Issues #521 and #282 are examples of how much of a hassle it can be.\r\n\r\nI opened this issue to inform you that we're working on a replacement system that would be platform independent and mostly implemented in JS and the packager. Of course, we'll keep the current system running alongside the new one and give you time before we deprecate it. Here are our goals for this:\r\n\r\n* Images can exist alongside the JS code (no need for `assetRoots`) and be required via CommonJS-like module resolution `require('./path/to/img.png')` or `require('packageName/img.png')`\r\n* Images can have multiple scale versions and are expressed via the @Nx notation currently used in iOS. So img.png could actually be img@0.5x.png  img@3x.png or what have you and we'd automatically pick the most appropriate scale for the device. \r\n* This means you can publish React Native components to npm that have asset dependency and have them still work\r\n* In development you can edit/add/delete images and cmd+r and have it work!\r\n* We're still working on details on how will this work when shipping apps but hopefully will have some more details about this soon\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/155905745","html_url":"https://github.com/facebook/react-native/issues/1043#issuecomment-155905745","issue_url":"https://api.github.com/repos/facebook/react-native/issues/1043","id":155905745,"user":{"login":"gnestor","id":512354,"avatar_url":"https://avatars.githubusercontent.com/u/512354?v=3","gravatar_id":"","url":"https://api.github.com/users/gnestor","html_url":"https://github.com/gnestor","followers_url":"https://api.github.com/users/gnestor/followers","following_url":"https://api.github.com/users/gnestor/following{/other_user}","gists_url":"https://api.github.com/users/gnestor/gists{/gist_id}","starred_url":"https://api.github.com/users/gnestor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnestor/subscriptions","organizations_url":"https://api.github.com/users/gnestor/orgs","repos_url":"https://api.github.com/users/gnestor/repos","events_url":"https://api.github.com/users/gnestor/events{/privacy}","received_events_url":"https://api.github.com/users/gnestor/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T20:50:24Z","updated_at":"2015-11-11T20:50:24Z","body":"@frantic Adding the main.jsbundle generated by the Xcode script solved the problem, images are showing up fine for offline bundles (duh!). I'm noticing that the Xcode script is being run every time I build in Xcode, whether for development or production, which adds another 10-20s to build time. However, the bundle isn't used when running the app against the dev server, correct? If so, what's the value in using this new bundle script from Xcode vs. the former method of running `react-native bundle` when an offline bundle is needed?"}}