GitHub PullRequestReviewCommentEvent at 2014-11-13 11:03:49
Repository: gaia
Actor: azasypkin
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20283871","id":20283871,"diff_hunk":"@@ -124,6 +141,23 @@\n         // Otherwise, return the string of rendered markup\n         data[property];\n     });\n+\n+    var template = null;\n+\n+    return {\n+      toString: function t_toString() {\n+        return html;\n+      },\n+\n+      toDocumentFragment: function t_toDocumentFragment() {\n+        if (!template) {\n+          template = document.createElement('template');\n+          template.innerHTML = html;\n+        }\n+\n+        return template.content.cloneNode(true);\n+      }\n+    };","path":"shared/js/template.js","position":53,"original_position":53,"commit_id":"cf3079b7a789001ca380796e948f2843f9285ae1","original_commit_id":"cf3079b7a789001ca380796e948f2843f9285ae1","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"body":"> For all the apps using interpolate(), you've just made that function do an extra object creation and take slightly longer to execute.\r\n\r\nAgree, will fix that, thanks!\r\n\r\n> You don't actually have a use case for calling prepare() once and then calling toDocumentFragment() multiple times on it do you?\r\n\r\nYeah, it's definitely not frequent use case, but we still have one in the Message app as Julien noted above, is one use case enough to convince you? :)\r\n\r\n> And if necessarying the calling app could do the cloneNode() as necessary.\r\n\r\n```template.content``` belongs to a different document and it should be imported/activated before it can be inserted into the \"main\" document(as per [1]). So ```cloneNode/importNode``` is required and I'd rather call it inside template librabry to make consumer code happier.\r\n\r\nWhat do you think, @davidflanagan ?\r\n\r\n[1] https://html.spec.whatwg.org/multipage/scripting.html#the-template-element","created_at":"2014-11-13T11:03:49Z","updated_at":"2014-11-13T11:03:49Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/24259#discussion_r20283871","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20283871"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/24259#discussion_r20283871"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259","id":21561110,"html_url":"https://github.com/mozilla-b2g/gaia/pull/24259","diff_url":"https://github.com/mozilla-b2g/gaia/pull/24259.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/24259.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/24259","number":24259,"state":"open","locked":false,"title":"Bug 1014686 - [Messages][Refactoring] Improve \"html template string\" to \"dom node\\fragment\" conversion. Added Template.prepare method","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-22T06:33:58Z","updated_at":"2014-11-13T11:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bbe3b8fbccd8ee6a506592eb59452cc780824dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/24259/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/cf3079b7a789001ca380796e948f2843f9285ae1","head":{"label":"azasypkin:bug-1014686-template-refactoring","ref":"bug-1014686-template-refactoring","sha":"cf3079b7a789001ca380796e948f2843f9285ae1","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"repo":{"id":17702910,"name":"gaia","full_name":"azasypkin/gaia","owner":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azasypkin/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/azasypkin/gaia","forks_url":"https://api.github.com/repos/azasypkin/gaia/forks","keys_url":"https://api.github.com/repos/azasypkin/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azasypkin/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azasypkin/gaia/teams","hooks_url":"https://api.github.com/repos/azasypkin/gaia/hooks","issue_events_url":"https://api.github.com/repos/azasypkin/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/azasypkin/gaia/events","assignees_url":"https://api.github.com/repos/azasypkin/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/azasypkin/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/azasypkin/gaia/tags","blobs_url":"https://api.github.com/repos/azasypkin/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azasypkin/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azasypkin/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/azasypkin/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azasypkin/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/azasypkin/gaia/languages","stargazers_url":"https://api.github.com/repos/azasypkin/gaia/stargazers","contributors_url":"https://api.github.com/repos/azasypkin/gaia/contributors","subscribers_url":"https://api.github.com/repos/azasypkin/gaia/subscribers","subscription_url":"https://api.github.com/repos/azasypkin/gaia/subscription","commits_url":"https://api.github.com/repos/azasypkin/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/azasypkin/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/azasypkin/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/azasypkin/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/azasypkin/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/azasypkin/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azasypkin/gaia/merges","archive_url":"https://api.github.com/repos/azasypkin/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azasypkin/gaia/downloads","issues_url":"https://api.github.com/repos/azasypkin/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/azasypkin/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/azasypkin/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/azasypkin/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azasypkin/gaia/labels{/name}","releases_url":"https://api.github.com/repos/azasypkin/gaia/releases{/id}","created_at":"2014-03-13T08:22:23Z","updated_at":"2014-06-28T10:03:34Z","pushed_at":"2014-11-13T09:19:06Z","git_url":"git://github.com/azasypkin/gaia.git","ssh_url":"git@github.com:azasypkin/gaia.git","clone_url":"https://github.com/azasypkin/gaia.git","svn_url":"https://github.com/azasypkin/gaia","homepage":"https://wiki.mozilla.org/B2G","size":868048,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"33938ee659ea99e6221832e32c8e60122aa34330","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2014-11-13T10:30:50Z","pushed_at":"2014-11-13T09:23:21Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1547771,"stargazers_count":1790,"watchers_count":1790,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2042,"mirror_url":null,"open_issues_count":658,"forks":2042,"open_issues":658,"watchers":1790,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/24259"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/24259"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/24259/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/24259/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/cf3079b7a789001ca380796e948f2843f9285ae1"}}}}