{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/barback/issues/39","labels_url":"https://api.github.com/repos/dart-lang/barback/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/barback/issues/39/comments","events_url":"https://api.github.com/repos/dart-lang/barback/issues/39/events","html_url":"https://github.com/dart-lang/barback/issues/39","id":85647636,"number":39,"title":"Allow transformers to generate/modify code in packages as a result of whole-code evaluation","user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/barback/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/dart-lang/barback/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-05T22:30:03Z","updated_at":"2015-06-05T22:30:06Z","closed_at":null,"body":"<a href=\"https://github.com/blois\"><img src=\"https://avatars.githubusercontent.com/u/2152569?v=3\" align=\"left\" width=\"96\" height=\"96\"hspace=\"10\"></img></a> **Issue by [blois](https://github.com/blois)**\n_Originally opened as dart-lang/sdk#17306_\n\n----\n\nRight now transformers can only modify code in packages when that package is being transformed, but there are a number of scenarios where the transformation on the package needs to be done with the results of some whole-program analysis.\n\nThe specific scenario I'm running into is generating code for Angular in a lazy-loading environment. In a non-lazy environment the generated caches are all injected into the application entry point, but in the lazy-loaded scenario the code needs to be injected into the root of the lazy library.\n\nThe issue is that the calculation of what needs to be cached needs to take the entire app into account.\n\nOne approach discussed is the 'global transformers' which execute after all package transformers and can modify every package contents.\n\nMarking as critical as it is required for Angular's transformers once lazy-loading is supported."},"comment":{"url":"https://api.github.com/repos/dart-lang/barback/issues/comments/109464865","html_url":"https://github.com/dart-lang/barback/issues/39#issuecomment-109464865","issue_url":"https://api.github.com/repos/dart-lang/barback/issues/39","id":109464865,"user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T22:30:05Z","updated_at":"2015-06-05T22:30:05Z","body":"<a href=\"https://github.com/justinfagnani\"><img src=\"https://avatars.githubusercontent.com/u/522948?v=3\" align=\"left\" width=\"48\" height=\"48\"hspace=\"10\"></img></a> **Comment by [justinfagnani](https://github.com/justinfagnani)**\n\n----\n\nInteresting!\n\nNot to look a gift horse in the mouth, but I think that we often need the other direction - that it when a library declares a transformer it needs to transform the entrypoints as well. This is true for libraries that need to register or initialize like custom elements, js-interop, polymer expressions, etc."}}