{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/28465405","id":28465405,"diff_hunk":"@@ -49,6 +54,53 @@ void allTests() {\n     var output = await processTemplates(reader, new AssetId('a', inputPath));\n     _formatThenExpectEquals(output, expected);\n   });\n+\n+  describe('DirectiveMetadataReader', () {\n+    Future<DirectiveMetadata> readSingleMetadata(inputPath) async {\n+      var ngDeps = await parser.parse(new AssetId('a', inputPath));\n+      var metadata = readDirectiveMetadata(ngDeps.registeredTypes.first);\n+      expect(metadata.length).toEqual(1);\n+      return metadata.first;\n+    }\n+\n+    it('should parse selectors', () async {\n+      var metadata = await readSingleMetadata(\n+          'template_compiler/directive_metadata_files/selector.ng_deps.dart');","path":"modules/angular2/test/transform/template_compiler/all_tests.dart","position":36,"original_position":38,"commit_id":"43638f9e5df6a3cf0f2f4fffa56c44466283fa60","original_commit_id":"cc6728c33831072cd43510de7d26816526261aae","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},"body":"Okay, after thinking about it for a bit I think I'm coming around to your\nin-memory map strategy.\n\nRather than creating an asset per-directive, we can continue generating\ninformation at per-library granularity - in fact, we can just recursively\ncrawl out from a file to its .ng_deps.dart imports & build up the map.\nMaking sure we don't visit the same .ng_deps.dart file twice while ensuring\nour map stays up to date may be a bit dodgy, but I think we can make it\nwork.\n\nOn Mon, Apr 13, 2015 at 6:27 PM Yegor <notifications@github.com> wrote:\n\n> In modules/angular2/test/transform/template_compiler/all_tests.dart\n> <https://github.com/angular/angular/pull/1349#discussion_r28294792>:\n>\n> > @@ -49,6 +54,53 @@ void allTests() {\n> >      var output = await processTemplates(reader, new AssetId('a', inputPath));\n> >      _formatThenExpectEquals(output, expected);\n> >    });\n> > +\n> > +  describe('DirectiveMetadataReader', () {\n> > +    Future<DirectiveMetadata> readSingleMetadata(inputPath) async {\n> > +      var ngDeps = await parser.parse(new AssetId('a', inputPath));\n> > +      var metadata = readDirectiveMetadata(ngDeps.registeredTypes.first);\n> > +      expect(metadata.length).toEqual(1);\n> > +      return metadata.first;\n> > +    }\n> > +\n> > +    it('should parse selectors', () async {\n> > +      var metadata = await readSingleMetadata(\n> > +          'template_compiler/directive_metadata_files/selector.ng_deps.dart');\n>\n> Not sure if we can do anything about it right now, but it is contrary to\n> the goal of preprocessing directive metadata to put the metadata in the\n> generated code itself, and especially *reading* it from the generated\n> code. If we want to precompile directives, then presumably we won't need to\n> keep the metadata around any more and therefore the transformer would have\n> to read it from elsewhere. Should we do it now? Should we plan a transition\n> for the future?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/angular/angular/pull/1349/files#r28294792>.\n>\n","created_at":"2015-04-15T21:34:54Z","updated_at":"2015-04-15T21:34:54Z","html_url":"https://github.com/angular/angular/pull/1349#discussion_r28465405","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/1349","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/28465405"},"html":{"href":"https://github.com/angular/angular/pull/1349#discussion_r28465405"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/1349"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/1349","id":33217120,"html_url":"https://github.com/angular/angular/pull/1349","diff_url":"https://github.com/angular/angular/pull/1349.diff","patch_url":"https://github.com/angular/angular/pull/1349.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/1349","number":1349,"state":"open","locked":false,"title":"feat(dart/transform): Add the DirectiveMetadataReader","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},"body":"Add a class that parses and reads Directive metadata to prepare for\r\nrunning the Render compiler in the Dart transformer.","created_at":"2015-04-14T00:37:16Z","updated_at":"2015-04-15T21:34:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"865fdce7cb82eff937a61e9452304d45f24a0a3b","assignee":{"login":"yjbanov","id":211513,"avatar_url":"https://avatars.githubusercontent.com/u/211513?v=3","gravatar_id":"","url":"https://api.github.com/users/yjbanov","html_url":"https://github.com/yjbanov","followers_url":"https://api.github.com/users/yjbanov/followers","following_url":"https://api.github.com/users/yjbanov/following{/other_user}","gists_url":"https://api.github.com/users/yjbanov/gists{/gist_id}","starred_url":"https://api.github.com/users/yjbanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjbanov/subscriptions","organizations_url":"https://api.github.com/users/yjbanov/orgs","repos_url":"https://api.github.com/users/yjbanov/repos","events_url":"https://api.github.com/users/yjbanov/events{/privacy}","received_events_url":"https://api.github.com/users/yjbanov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular/pulls/1349/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/1349/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/1349/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/43638f9e5df6a3cf0f2f4fffa56c44466283fa60","head":{"label":"kegluneq:directive_metadata","ref":"directive_metadata","sha":"43638f9e5df6a3cf0f2f4fffa56c44466283fa60","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},"repo":{"id":30424284,"name":"angular","full_name":"kegluneq/angular","owner":{"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},"private":false,"html_url":"https://github.com/kegluneq/angular","description":"","fork":true,"url":"https://api.github.com/repos/kegluneq/angular","forks_url":"https://api.github.com/repos/kegluneq/angular/forks","keys_url":"https://api.github.com/repos/kegluneq/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kegluneq/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kegluneq/angular/teams","hooks_url":"https://api.github.com/repos/kegluneq/angular/hooks","issue_events_url":"https://api.github.com/repos/kegluneq/angular/issues/events{/number}","events_url":"https://api.github.com/repos/kegluneq/angular/events","assignees_url":"https://api.github.com/repos/kegluneq/angular/assignees{/user}","branches_url":"https://api.github.com/repos/kegluneq/angular/branches{/branch}","tags_url":"https://api.github.com/repos/kegluneq/angular/tags","blobs_url":"https://api.github.com/repos/kegluneq/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kegluneq/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kegluneq/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/kegluneq/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kegluneq/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/kegluneq/angular/languages","stargazers_url":"https://api.github.com/repos/kegluneq/angular/stargazers","contributors_url":"https://api.github.com/repos/kegluneq/angular/contributors","subscribers_url":"https://api.github.com/repos/kegluneq/angular/subscribers","subscription_url":"https://api.github.com/repos/kegluneq/angular/subscription","commits_url":"https://api.github.com/repos/kegluneq/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/kegluneq/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/kegluneq/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/kegluneq/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/kegluneq/angular/contents/{+path}","compare_url":"https://api.github.com/repos/kegluneq/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kegluneq/angular/merges","archive_url":"https://api.github.com/repos/kegluneq/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kegluneq/angular/downloads","issues_url":"https://api.github.com/repos/kegluneq/angular/issues{/number}","pulls_url":"https://api.github.com/repos/kegluneq/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/kegluneq/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/kegluneq/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kegluneq/angular/labels{/name}","releases_url":"https://api.github.com/repos/kegluneq/angular/releases{/id}","created_at":"2015-02-06T17:30:07Z","updated_at":"2015-04-15T19:39:50Z","pushed_at":"2015-04-15T19:40:27Z","git_url":"git://github.com/kegluneq/angular.git","ssh_url":"git@github.com:kegluneq/angular.git","clone_url":"https://github.com/kegluneq/angular.git","svn_url":"https://github.com/kegluneq/angular","homepage":null,"size":4459,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"fef1dee7aa9a8df94537bca3397ce3de02f72d84","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular","description":"","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","created_at":"2014-09-18T16:12:01Z","updated_at":"2015-04-15T21:31:37Z","pushed_at":"2015-04-15T21:01:12Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":null,"size":17805,"stargazers_count":2511,"watchers_count":2511,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":616,"mirror_url":null,"open_issues_count":238,"forks":616,"open_issues":238,"watchers":2511,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/1349"},"html":{"href":"https://github.com/angular/angular/pull/1349"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/1349"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/1349/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/1349/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/1349/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/43638f9e5df6a3cf0f2f4fffa56c44466283fa60"}}}}