{"action":"created","comment":{"url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/comments/42736275","id":42736275,"diff_hunk":"@@ -0,0 +1,165 @@\n+import React, { Component, PropTypes } from 'react';\n+const cssMedaTypes = [\n+  'all',\n+  'aural',\n+  'braille',\n+  'handheld',\n+  'print',\n+  'projection',\n+  'screen',\n+  'tty',\n+  'TV',\n+];\n+const globalAttributes = {\n+  /* eslint-disable id-length */\n+  id: PropTypes.string,\n+  /* eslint-enable id-length */\n+  accesskey: PropTypes.string,\n+  class: PropTypes.string,\n+  contenteditable: PropTypes.boolean,\n+  contextmenu: PropTypes.string,\n+  dir: PropTypes.string,\n+  hidden: PropTypes.boolean,\n+  lang: PropTypes.string,\n+  style: PropTypes.string,\n+  tabindex: PropTypes.string,\n+  title: PropTypes.string,\n+  translate: PropTypes.string,\n+};\n+export default class Layout extends Component {\n+\n+  static get propTypes() {\n+    return {\n+      path: PropTypes.string,\n+      lang: PropTypes.oneOfType([ PropTypes.string, PropTypes.boolean ]).isRequired,\n+      title: PropTypes.string,\n+      manifest: PropTypes.string,\n+      meta: PropTypes.arrayOf(\n+        PropTypes.oneOfType([\n+          PropTypes.shape({\n+            ...globalAttributes,\n+            charSet: PropTypes.string,\n+          }),\n+          PropTypes.shape({\n+            ...globalAttributes,\n+            httpEquiv: PropTypes.string,\n+            content: PropTypes.string,\n+          }),\n+          PropTypes.shape({\n+            name: PropTypes.string,\n+            content: PropTypes.string,\n+          }),\n+        ])\n+      ),\n+      inlineStyles: PropTypes.arrayOf(\n+        PropTypes.oneOfType([\n+          PropTypes.string,\n+          PropTypes.shape({\n+            ...globalAttributes,\n+            type: PropTypes.string,\n+            media: PropTypes.oneOf(cssMedaTypes),\n+            scoped: PropTypes.boolean,\n+            disabled: PropTypes.boolean,\n+          }),\n+        ])\n+      ),\n+      styles: PropTypes.arrayOf(\n+        PropTypes.oneOfType([\n+          PropTypes.string,\n+          PropTypes.shape({\n+            ...globalAttributes,\n+            type: PropTypes.string,\n+            integrity: PropTypes.string,\n+            href: PropTypes.string,\n+            hreflang: PropTypes.string,\n+            media: PropTypes.oneOf(cssMedaTypes),\n+          }),\n+        ])\n+      ),\n+      links: PropTypes.arrayOf(\n+        PropTypes.shape({\n+          ...globalAttributes,\n+          type: PropTypes.string,\n+          integrity: PropTypes.string,\n+          href: PropTypes.string,\n+          hreflang: PropTypes.string,\n+          media: PropTypes.oneOf(cssMedaTypes),\n+          rel: PropTypes.string,\n+        })\n+      ),\n+      scripts: PropTypes.arrayOf(\n+        PropTypes.oneOfType([\n+          PropTypes.string,\n+          PropTypes.shape({\n+            ...globalAttributes,\n+            type: PropTypes.string,\n+            text: PropTypes.string,\n+            integrity: PropTypes.string,\n+            src: PropTypes.string.isRequired,\n+            defer: PropTypes.boolean,\n+            async: PropTypes.boolean,\n+          }),\n+        ])\n+      ),\n+      children: PropTypes.node,\n+      handler: PropTypes.func,\n+    };\n+  }\n+\n+  static get defaultProps() {\n+    return {\n+      lang: 'en',\n+    };\n+  }\n+\n+  renderArrayOfElements(Element, array) {\n+    return (array || []).map((children) => {\n+      let props = children;\n+      if (typeof props !== 'object') {\n+        props = { children };\n+      }\n+      return (<Element {...props}/>);\n+    });\n+  }\n+\n+  render() {\n+    const htmlProps = {};\n+    if (this.props.lang) {\n+      htmlProps.lang = this.props.lang;\n+    }\n+    if (this.props.manifest) {\n+      htmlProps.manifest = this.props.manifest;\n+    }","path":"layout.es6","position":132,"original_position":132,"commit_id":"74d9ae5ddc361a16320cf99d63a72eaf2bb8e8e9","original_commit_id":"74d9ae5ddc361a16320cf99d63a72eaf2bb8e8e9","user":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"body":"Can't we simply have an option that's htmlProps? Things to add to `<html, {...this.props.htmlProps}>`? That would be much simpler to document.","created_at":"2015-10-22T11:20:46Z","updated_at":"2015-10-22T11:20:46Z","html_url":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1#discussion_r42736275","pull_request_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/comments/42736275"},"html":{"href":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1#discussion_r42736275"},"pull_request":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1","id":48398775,"html_url":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1","diff_url":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1.diff","patch_url":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1.patch","issue_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/1","number":1,"state":"open","locked":false,"title":"Initial implementation for middleware","user":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"body":"Readme should describe how this works. Idea is to drop [component-world-if-html](https://github.com/the-economist-editorial/component-world-if-html) and [component-win-html](https://github.com/the-economist-editorial/component-win-html) and have this one generalised version instead.\r\n\r\n\\+@danielmoll","created_at":"2015-10-21T22:54:22Z","updated_at":"2015-10-22T11:20:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0209f355af72baf27acfc9a1ec202de5c9d8d127","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1/commits","review_comments_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1/comments","review_comment_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/comments{/number}","comments_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/1/comments","statuses_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/statuses/74d9ae5ddc361a16320cf99d63a72eaf2bb8e8e9","head":{"label":"keithamus:initial-implementation","ref":"initial-implementation","sha":"74d9ae5ddc361a16320cf99d63a72eaf2bb8e8e9","user":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"repo":{"id":44708997,"name":"connect-react-html-template","full_name":"keithamus/connect-react-html-template","owner":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/keithamus/connect-react-html-template","description":"Serving React HTML templates as Connect Middleware!","fork":true,"url":"https://api.github.com/repos/keithamus/connect-react-html-template","forks_url":"https://api.github.com/repos/keithamus/connect-react-html-template/forks","keys_url":"https://api.github.com/repos/keithamus/connect-react-html-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keithamus/connect-react-html-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keithamus/connect-react-html-template/teams","hooks_url":"https://api.github.com/repos/keithamus/connect-react-html-template/hooks","issue_events_url":"https://api.github.com/repos/keithamus/connect-react-html-template/issues/events{/number}","events_url":"https://api.github.com/repos/keithamus/connect-react-html-template/events","assignees_url":"https://api.github.com/repos/keithamus/connect-react-html-template/assignees{/user}","branches_url":"https://api.github.com/repos/keithamus/connect-react-html-template/branches{/branch}","tags_url":"https://api.github.com/repos/keithamus/connect-react-html-template/tags","blobs_url":"https://api.github.com/repos/keithamus/connect-react-html-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keithamus/connect-react-html-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keithamus/connect-react-html-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/keithamus/connect-react-html-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keithamus/connect-react-html-template/statuses/{sha}","languages_url":"https://api.github.com/repos/keithamus/connect-react-html-template/languages","stargazers_url":"https://api.github.com/repos/keithamus/connect-react-html-template/stargazers","contributors_url":"https://api.github.com/repos/keithamus/connect-react-html-template/contributors","subscribers_url":"https://api.github.com/repos/keithamus/connect-react-html-template/subscribers","subscription_url":"https://api.github.com/repos/keithamus/connect-react-html-template/subscription","commits_url":"https://api.github.com/repos/keithamus/connect-react-html-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/keithamus/connect-react-html-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/keithamus/connect-react-html-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/keithamus/connect-react-html-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/keithamus/connect-react-html-template/contents/{+path}","compare_url":"https://api.github.com/repos/keithamus/connect-react-html-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keithamus/connect-react-html-template/merges","archive_url":"https://api.github.com/repos/keithamus/connect-react-html-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keithamus/connect-react-html-template/downloads","issues_url":"https://api.github.com/repos/keithamus/connect-react-html-template/issues{/number}","pulls_url":"https://api.github.com/repos/keithamus/connect-react-html-template/pulls{/number}","milestones_url":"https://api.github.com/repos/keithamus/connect-react-html-template/milestones{/number}","notifications_url":"https://api.github.com/repos/keithamus/connect-react-html-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keithamus/connect-react-html-template/labels{/name}","releases_url":"https://api.github.com/repos/keithamus/connect-react-html-template/releases{/id}","created_at":"2015-10-21T22:52:20Z","updated_at":"2015-10-21T22:50:38Z","pushed_at":"2015-10-21T22:52:43Z","git_url":"git://github.com/keithamus/connect-react-html-template.git","ssh_url":"git@github.com:keithamus/connect-react-html-template.git","clone_url":"https://github.com/keithamus/connect-react-html-template.git","svn_url":"https://github.com/keithamus/connect-react-html-template","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":"the-economist-editorial:master","ref":"master","sha":"beb80c0592d6e874c579f076f5b70a027a21a6e2","user":{"login":"the-economist-editorial","id":5329285,"avatar_url":"https://avatars.githubusercontent.com/u/5329285?v=3","gravatar_id":"","url":"https://api.github.com/users/the-economist-editorial","html_url":"https://github.com/the-economist-editorial","followers_url":"https://api.github.com/users/the-economist-editorial/followers","following_url":"https://api.github.com/users/the-economist-editorial/following{/other_user}","gists_url":"https://api.github.com/users/the-economist-editorial/gists{/gist_id}","starred_url":"https://api.github.com/users/the-economist-editorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-economist-editorial/subscriptions","organizations_url":"https://api.github.com/users/the-economist-editorial/orgs","repos_url":"https://api.github.com/users/the-economist-editorial/repos","events_url":"https://api.github.com/users/the-economist-editorial/events{/privacy}","received_events_url":"https://api.github.com/users/the-economist-editorial/received_events","type":"Organization","site_admin":false},"repo":{"id":44708919,"name":"connect-react-html-template","full_name":"the-economist-editorial/connect-react-html-template","owner":{"login":"the-economist-editorial","id":5329285,"avatar_url":"https://avatars.githubusercontent.com/u/5329285?v=3","gravatar_id":"","url":"https://api.github.com/users/the-economist-editorial","html_url":"https://github.com/the-economist-editorial","followers_url":"https://api.github.com/users/the-economist-editorial/followers","following_url":"https://api.github.com/users/the-economist-editorial/following{/other_user}","gists_url":"https://api.github.com/users/the-economist-editorial/gists{/gist_id}","starred_url":"https://api.github.com/users/the-economist-editorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-economist-editorial/subscriptions","organizations_url":"https://api.github.com/users/the-economist-editorial/orgs","repos_url":"https://api.github.com/users/the-economist-editorial/repos","events_url":"https://api.github.com/users/the-economist-editorial/events{/privacy}","received_events_url":"https://api.github.com/users/the-economist-editorial/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/the-economist-editorial/connect-react-html-template","description":"Serving React HTML templates as Connect Middleware!","fork":false,"url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template","forks_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/forks","keys_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/teams","hooks_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/hooks","issue_events_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/events{/number}","events_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/events","assignees_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/assignees{/user}","branches_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/branches{/branch}","tags_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/tags","blobs_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/statuses/{sha}","languages_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/languages","stargazers_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/stargazers","contributors_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/contributors","subscribers_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/subscribers","subscription_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/subscription","commits_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/contents/{+path}","compare_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/merges","archive_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/downloads","issues_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues{/number}","pulls_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls{/number}","milestones_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/milestones{/number}","notifications_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/labels{/name}","releases_url":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/releases{/id}","created_at":"2015-10-21T22:50:38Z","updated_at":"2015-10-21T22:50:38Z","pushed_at":"2015-10-21T22:54:23Z","git_url":"git://github.com/the-economist-editorial/connect-react-html-template.git","ssh_url":"git@github.com:the-economist-editorial/connect-react-html-template.git","clone_url":"https://github.com/the-economist-editorial/connect-react-html-template.git","svn_url":"https://github.com/the-economist-editorial/connect-react-html-template","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1"},"html":{"href":"https://github.com/the-economist-editorial/connect-react-html-template/pull/1"},"issue":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/1"},"comments":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/the-economist-editorial/connect-react-html-template/statuses/74d9ae5ddc361a16320cf99d63a72eaf2bb8e8e9"}}}}