{"action":"created","comment":{"url":"https://api.github.com/repos/pimterry/server-components/pulls/comments/87886952","pull_request_review_id":8480095,"id":87886952,"diff_hunk":"@@ -154,3 +145,40 @@ function getDocument(rootNode) {\n         return rootNode;\n     }\n }\n+\n+function upgradeElement (element, definition, callConstructor) {\n+    const prototype = definition.constructor.prototype;\n+    Object.setPrototypeOf(element, prototype);\n+    if (callConstructor) {\n+        CustomElementRegistry.instance()._setNewInstance(element);\n+        new (definition.constructor)();\n+        element[_upgradedProp] = true;\n+        console.assert(CustomElementRegistry.instance()._newInstance === null);\n+    }\n+\n+    const observedAttributes = definition.observedAttributes;\n+    const attributeChangedCallback = definition.attributeChangedCallback;\n+    if (attributeChangedCallback && observedAttributes.length > 0) {\n+\n+        // Trigger attributeChangedCallback for existing attributes.\n+        // https://html.spec.whatwg.org/multipage/scripting.html#upgrades\n+        for (let i = 0; i < observedAttributes.length; i++) {\n+            const name = observedAttributes[i];\n+            if (element.hasAttribute(name)) {\n+                const value = element.getAttribute(name);\n+                attributeChangedCallback.call(element, name, null, value, null);\n+            }\n+        }\n+    }\n+  }\n+\n+//\n+// Helpers\n+//\n+function map (arrayLike, fn) {","path":"src/index.js","position":140,"original_position":146,"commit_id":"71829e623f18d8e7b993d4e7b61ad22e6804bc6c","original_commit_id":"568ee368938a481bbcce351389b3f7e9c3f60163","user":{"login":"mindeavor","id":17013,"avatar_url":"https://avatars.githubusercontent.com/u/17013?v=3","gravatar_id":"","url":"https://api.github.com/users/mindeavor","html_url":"https://github.com/mindeavor","followers_url":"https://api.github.com/users/mindeavor/followers","following_url":"https://api.github.com/users/mindeavor/following{/other_user}","gists_url":"https://api.github.com/users/mindeavor/gists{/gist_id}","starred_url":"https://api.github.com/users/mindeavor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindeavor/subscriptions","organizations_url":"https://api.github.com/users/mindeavor/orgs","repos_url":"https://api.github.com/users/mindeavor/repos","events_url":"https://api.github.com/users/mindeavor/events{/privacy}","received_events_url":"https://api.github.com/users/mindeavor/received_events","type":"User","site_admin":false},"body":"Alright, updated.","created_at":"2016-11-14T20:35:54Z","updated_at":"2016-11-14T20:35:54Z","html_url":"https://github.com/pimterry/server-components/pull/30#discussion_r87886952","pull_request_url":"https://api.github.com/repos/pimterry/server-components/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/comments/87886952"},"html":{"href":"https://github.com/pimterry/server-components/pull/30#discussion_r87886952"},"pull_request":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/pimterry/server-components/pulls/30","id":93197843,"html_url":"https://github.com/pimterry/server-components/pull/30","diff_url":"https://github.com/pimterry/server-components/pull/30.diff","patch_url":"https://github.com/pimterry/server-components/pull/30.patch","issue_url":"https://api.github.com/repos/pimterry/server-components/issues/30","number":30,"state":"open","locked":false,"title":"Convert to custom elements spec v1","user":{"login":"mindeavor","id":17013,"avatar_url":"https://avatars.githubusercontent.com/u/17013?v=3","gravatar_id":"","url":"https://api.github.com/users/mindeavor","html_url":"https://github.com/mindeavor","followers_url":"https://api.github.com/users/mindeavor/followers","following_url":"https://api.github.com/users/mindeavor/following{/other_user}","gists_url":"https://api.github.com/users/mindeavor/gists{/gist_id}","starred_url":"https://api.github.com/users/mindeavor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindeavor/subscriptions","organizations_url":"https://api.github.com/users/mindeavor/orgs","repos_url":"https://api.github.com/users/mindeavor/repos","events_url":"https://api.github.com/users/mindeavor/events{/privacy}","received_events_url":"https://api.github.com/users/mindeavor/received_events","type":"User","site_admin":false},"body":"Closes #27\r\n\r\nThe implementation is almost a copy-paste of [polymer's polyfill](https://github.com/webcomponents/custom-elements/blob/master/src/custom-elements.js). The main differences is that I removed some unnecessary reactions and hooked in Domino.\r\n\r\nIf approved, a squash merge would probably be most appropriate.","created_at":"2016-11-10T17:44:09Z","updated_at":"2016-11-14T20:35:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"051395ef71251301b334c37e69477a35caed4bc1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pimterry/server-components/pulls/30/commits","review_comments_url":"https://api.github.com/repos/pimterry/server-components/pulls/30/comments","review_comment_url":"https://api.github.com/repos/pimterry/server-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pimterry/server-components/issues/30/comments","statuses_url":"https://api.github.com/repos/pimterry/server-components/statuses/71829e623f18d8e7b993d4e7b61ad22e6804bc6c","head":{"label":"Concatapult:elems-v1","ref":"elems-v1","sha":"71829e623f18d8e7b993d4e7b61ad22e6804bc6c","user":{"login":"Concatapult","id":15256176,"avatar_url":"https://avatars.githubusercontent.com/u/15256176?v=3","gravatar_id":"","url":"https://api.github.com/users/Concatapult","html_url":"https://github.com/Concatapult","followers_url":"https://api.github.com/users/Concatapult/followers","following_url":"https://api.github.com/users/Concatapult/following{/other_user}","gists_url":"https://api.github.com/users/Concatapult/gists{/gist_id}","starred_url":"https://api.github.com/users/Concatapult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Concatapult/subscriptions","organizations_url":"https://api.github.com/users/Concatapult/orgs","repos_url":"https://api.github.com/users/Concatapult/repos","events_url":"https://api.github.com/users/Concatapult/events{/privacy}","received_events_url":"https://api.github.com/users/Concatapult/received_events","type":"Organization","site_admin":false},"repo":{"id":72907760,"name":"server-components","full_name":"Concatapult/server-components","owner":{"login":"Concatapult","id":15256176,"avatar_url":"https://avatars.githubusercontent.com/u/15256176?v=3","gravatar_id":"","url":"https://api.github.com/users/Concatapult","html_url":"https://github.com/Concatapult","followers_url":"https://api.github.com/users/Concatapult/followers","following_url":"https://api.github.com/users/Concatapult/following{/other_user}","gists_url":"https://api.github.com/users/Concatapult/gists{/gist_id}","starred_url":"https://api.github.com/users/Concatapult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Concatapult/subscriptions","organizations_url":"https://api.github.com/users/Concatapult/orgs","repos_url":"https://api.github.com/users/Concatapult/repos","events_url":"https://api.github.com/users/Concatapult/events{/privacy}","received_events_url":"https://api.github.com/users/Concatapult/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Concatapult/server-components","description":":wrench: A simple, lightweight tool for composable HTML rendering in Node.js, based on web components.","fork":true,"url":"https://api.github.com/repos/Concatapult/server-components","forks_url":"https://api.github.com/repos/Concatapult/server-components/forks","keys_url":"https://api.github.com/repos/Concatapult/server-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Concatapult/server-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Concatapult/server-components/teams","hooks_url":"https://api.github.com/repos/Concatapult/server-components/hooks","issue_events_url":"https://api.github.com/repos/Concatapult/server-components/issues/events{/number}","events_url":"https://api.github.com/repos/Concatapult/server-components/events","assignees_url":"https://api.github.com/repos/Concatapult/server-components/assignees{/user}","branches_url":"https://api.github.com/repos/Concatapult/server-components/branches{/branch}","tags_url":"https://api.github.com/repos/Concatapult/server-components/tags","blobs_url":"https://api.github.com/repos/Concatapult/server-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Concatapult/server-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Concatapult/server-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Concatapult/server-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Concatapult/server-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Concatapult/server-components/languages","stargazers_url":"https://api.github.com/repos/Concatapult/server-components/stargazers","contributors_url":"https://api.github.com/repos/Concatapult/server-components/contributors","subscribers_url":"https://api.github.com/repos/Concatapult/server-components/subscribers","subscription_url":"https://api.github.com/repos/Concatapult/server-components/subscription","commits_url":"https://api.github.com/repos/Concatapult/server-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Concatapult/server-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Concatapult/server-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Concatapult/server-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Concatapult/server-components/contents/{+path}","compare_url":"https://api.github.com/repos/Concatapult/server-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Concatapult/server-components/merges","archive_url":"https://api.github.com/repos/Concatapult/server-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Concatapult/server-components/downloads","issues_url":"https://api.github.com/repos/Concatapult/server-components/issues{/number}","pulls_url":"https://api.github.com/repos/Concatapult/server-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Concatapult/server-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Concatapult/server-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Concatapult/server-components/labels{/name}","releases_url":"https://api.github.com/repos/Concatapult/server-components/releases{/id}","deployments_url":"https://api.github.com/repos/Concatapult/server-components/deployments","created_at":"2016-11-05T05:46:13Z","updated_at":"2016-11-05T05:46:14Z","pushed_at":"2016-11-14T20:23:43Z","git_url":"git://github.com/Concatapult/server-components.git","ssh_url":"git@github.com:Concatapult/server-components.git","clone_url":"https://github.com/Concatapult/server-components.git","svn_url":"https://github.com/Concatapult/server-components","homepage":"https://pimterry.github.io/server-components","size":120,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"pimterry:master","ref":"master","sha":"c97a9f883db61490f35a1a9fc68316e3fa322e89","user":{"login":"pimterry","id":1526883,"avatar_url":"https://avatars.githubusercontent.com/u/1526883?v=3","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"repo":{"id":54486211,"name":"server-components","full_name":"pimterry/server-components","owner":{"login":"pimterry","id":1526883,"avatar_url":"https://avatars.githubusercontent.com/u/1526883?v=3","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pimterry/server-components","description":":wrench: A simple, lightweight tool for composable HTML rendering in Node.js, based on web components.","fork":false,"url":"https://api.github.com/repos/pimterry/server-components","forks_url":"https://api.github.com/repos/pimterry/server-components/forks","keys_url":"https://api.github.com/repos/pimterry/server-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pimterry/server-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pimterry/server-components/teams","hooks_url":"https://api.github.com/repos/pimterry/server-components/hooks","issue_events_url":"https://api.github.com/repos/pimterry/server-components/issues/events{/number}","events_url":"https://api.github.com/repos/pimterry/server-components/events","assignees_url":"https://api.github.com/repos/pimterry/server-components/assignees{/user}","branches_url":"https://api.github.com/repos/pimterry/server-components/branches{/branch}","tags_url":"https://api.github.com/repos/pimterry/server-components/tags","blobs_url":"https://api.github.com/repos/pimterry/server-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pimterry/server-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pimterry/server-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/pimterry/server-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pimterry/server-components/statuses/{sha}","languages_url":"https://api.github.com/repos/pimterry/server-components/languages","stargazers_url":"https://api.github.com/repos/pimterry/server-components/stargazers","contributors_url":"https://api.github.com/repos/pimterry/server-components/contributors","subscribers_url":"https://api.github.com/repos/pimterry/server-components/subscribers","subscription_url":"https://api.github.com/repos/pimterry/server-components/subscription","commits_url":"https://api.github.com/repos/pimterry/server-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/pimterry/server-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/pimterry/server-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/pimterry/server-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/pimterry/server-components/contents/{+path}","compare_url":"https://api.github.com/repos/pimterry/server-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pimterry/server-components/merges","archive_url":"https://api.github.com/repos/pimterry/server-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pimterry/server-components/downloads","issues_url":"https://api.github.com/repos/pimterry/server-components/issues{/number}","pulls_url":"https://api.github.com/repos/pimterry/server-components/pulls{/number}","milestones_url":"https://api.github.com/repos/pimterry/server-components/milestones{/number}","notifications_url":"https://api.github.com/repos/pimterry/server-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pimterry/server-components/labels{/name}","releases_url":"https://api.github.com/repos/pimterry/server-components/releases{/id}","deployments_url":"https://api.github.com/repos/pimterry/server-components/deployments","created_at":"2016-03-22T15:24:08Z","updated_at":"2016-11-12T19:57:01Z","pushed_at":"2016-11-14T20:23:44Z","git_url":"git://github.com/pimterry/server-components.git","ssh_url":"git@github.com:pimterry/server-components.git","clone_url":"https://github.com/pimterry/server-components.git","svn_url":"https://github.com/pimterry/server-components","homepage":"https://pimterry.github.io/server-components","size":84,"stargazers_count":131,"watchers_count":131,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/30"},"html":{"href":"https://github.com/pimterry/server-components/pull/30"},"issue":{"href":"https://api.github.com/repos/pimterry/server-components/issues/30"},"comments":{"href":"https://api.github.com/repos/pimterry/server-components/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pimterry/server-components/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/pimterry/server-components/statuses/71829e623f18d8e7b993d4e7b61ad22e6804bc6c"}}}}
{"actor":{"display_login":"mindeavor"}}