{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/1750","labels_url":"https://api.github.com/repos/angular/angular/issues/1750/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/1750/comments","events_url":"https://api.github.com/repos/angular/angular/issues/1750/events","html_url":"https://github.com/angular/angular/issues/1750","id":74136749,"number":1750,"title":"Allow short-circuiting `createTypeMap` in DirectiveProcessor","user":{"login":"kegluneq","id":613610,"avatar_url":"https://avatars.githubusercontent.com/u/613610?v=3","gravatar_id":"","url":"https://api.github.com/users/kegluneq","html_url":"https://github.com/kegluneq","followers_url":"https://api.github.com/users/kegluneq/followers","following_url":"https://api.github.com/users/kegluneq/following{/other_user}","gists_url":"https://api.github.com/users/kegluneq/gists{/gist_id}","starred_url":"https://api.github.com/users/kegluneq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kegluneq/subscriptions","organizations_url":"https://api.github.com/users/kegluneq/orgs","repos_url":"https://api.github.com/users/kegluneq/repos","events_url":"https://api.github.com/users/kegluneq/events{/privacy}","received_events_url":"https://api.github.com/users/kegluneq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/%23dart/transformer","name":"#dart/transformer","color":"bfdadc"},{"url":"https://api.github.com/repos/angular/angular/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"jakemac53","id":984921,"avatar_url":"https://avatars.githubusercontent.com/u/984921?v=3","gravatar_id":"","url":"https://api.github.com/users/jakemac53","html_url":"https://github.com/jakemac53","followers_url":"https://api.github.com/users/jakemac53/followers","following_url":"https://api.github.com/users/jakemac53/following{/other_user}","gists_url":"https://api.github.com/users/jakemac53/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemac53/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemac53/subscriptions","organizations_url":"https://api.github.com/users/jakemac53/orgs","repos_url":"https://api.github.com/users/jakemac53/repos","events_url":"https://api.github.com/users/jakemac53/events{/privacy}","received_events_url":"https://api.github.com/users/jakemac53/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-05-07T21:37:46Z","updated_at":"2015-05-08T14:48:55Z","closed_at":null,"body":"`createTypeMap` walks the import graph looking for classes that extend or implement `Injectable`, which we expect to be slow for large applications. It currently does this in `DirectiveProcessor` for every processed file.\r\n\r\n@jakemac53 and I have discussed some potential optimizations for this:\r\n- Create the map once as the first phase of the transform, then serialize it out and read in during `DirectiveProcessor`.\r\n- Allow the user to completely avoid constructing the map by specifing the classes that extend or implement `Injectable`. We can provide this list for the user after running `createTypeMap` once\r\n- Instead of building a comprehensive map prior to beginning the transform, lazily search for specific annotation classes as we encounter them"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/100259092","html_url":"https://github.com/angular/angular/issues/1750#issuecomment-100259092","issue_url":"https://api.github.com/repos/angular/angular/issues/1750","id":100259092,"user":{"login":"jakemac53","id":984921,"avatar_url":"https://avatars.githubusercontent.com/u/984921?v=3","gravatar_id":"","url":"https://api.github.com/users/jakemac53","html_url":"https://github.com/jakemac53","followers_url":"https://api.github.com/users/jakemac53/followers","following_url":"https://api.github.com/users/jakemac53/following{/other_user}","gists_url":"https://api.github.com/users/jakemac53/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemac53/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemac53/subscriptions","organizations_url":"https://api.github.com/users/jakemac53/orgs","repos_url":"https://api.github.com/users/jakemac53/repos","events_url":"https://api.github.com/users/jakemac53/events{/privacy}","received_events_url":"https://api.github.com/users/jakemac53/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T14:48:55Z","updated_at":"2015-05-08T14:48:55Z","body":"Another thing we could do is provide a linter phase, which runs locally in each file and for now just checks if you declare any classes with the blacklisted names and gives a warning? This wouldn't be able to catch package dependencies that declare classes with the blacklisted names though (if they don't have the angular transformer in their pubspec)."}}