{"action":"opened","number":1155,"pull_request":{"url":"https://api.github.com/repos/facebook/relay/pulls/1155","id":70804060,"html_url":"https://github.com/facebook/relay/pull/1155","diff_url":"https://github.com/facebook/relay/pull/1155.diff","patch_url":"https://github.com/facebook/relay/pull/1155.patch","issue_url":"https://api.github.com/repos/facebook/relay/issues/1155","number":1155,"state":"open","locked":false,"title":"Improve type definition for Higher Order Component","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"body":"WIP: I'll probably have to make more changes to make this work correctly. Creating the PR so I can get early feedback.\r\n\r\nThe community at large has not been able to property define types for higher-order components for a long time\r\n\r\nPropTypes on React Components are extremely important. They are perhaps, one of the most important types in a React App.\r\nHigher Order Components are extremely common in React Apps.\r\nTherefore, the fact that Higher Order Components eat the type definition of React Components is unacceptable.\r\n\r\nAfter days of research and trial and error, I've found the type definitions that work.\r\n\r\nThis PR, adds the 'correct' (* see footnote) type definitions for the HOC, so that when the time comes to publish the\r\nflow type definition file(s) to NPM, Relay.CreateContainer does not eat type definitions.\r\n\r\n* technically speaking, Relay.CreateContainer takes all the props that match fragment names and hydrates the values using ids.\r\nSo the types aren't completely correct, but it's close enough. Perhaps the return value should be something like:\r\n`React$Component<DefaultProps, Props & {[key: $Keys<FragmentObj>]:{__DATA_ID__: string}}, State>`","created_at":"2016-05-20T05:42:20Z","updated_at":"2016-05-20T05:42:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/relay/pulls/1155/commits","review_comments_url":"https://api.github.com/repos/facebook/relay/pulls/1155/comments","review_comment_url":"https://api.github.com/repos/facebook/relay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/relay/issues/1155/comments","statuses_url":"https://api.github.com/repos/facebook/relay/statuses/b834c14ebb726caad882888a4a99493532003268","head":{"label":"nmn:patch-1","ref":"patch-1","sha":"b834c14ebb726caad882888a4a99493532003268","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"repo":{"id":59267430,"name":"relay","full_name":"nmn/relay","owner":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmn/relay","description":"Relay is a JavaScript framework for building data-driven React applications.","fork":true,"url":"https://api.github.com/repos/nmn/relay","forks_url":"https://api.github.com/repos/nmn/relay/forks","keys_url":"https://api.github.com/repos/nmn/relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmn/relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmn/relay/teams","hooks_url":"https://api.github.com/repos/nmn/relay/hooks","issue_events_url":"https://api.github.com/repos/nmn/relay/issues/events{/number}","events_url":"https://api.github.com/repos/nmn/relay/events","assignees_url":"https://api.github.com/repos/nmn/relay/assignees{/user}","branches_url":"https://api.github.com/repos/nmn/relay/branches{/branch}","tags_url":"https://api.github.com/repos/nmn/relay/tags","blobs_url":"https://api.github.com/repos/nmn/relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmn/relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmn/relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmn/relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmn/relay/statuses/{sha}","languages_url":"https://api.github.com/repos/nmn/relay/languages","stargazers_url":"https://api.github.com/repos/nmn/relay/stargazers","contributors_url":"https://api.github.com/repos/nmn/relay/contributors","subscribers_url":"https://api.github.com/repos/nmn/relay/subscribers","subscription_url":"https://api.github.com/repos/nmn/relay/subscription","commits_url":"https://api.github.com/repos/nmn/relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmn/relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmn/relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmn/relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmn/relay/contents/{+path}","compare_url":"https://api.github.com/repos/nmn/relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmn/relay/merges","archive_url":"https://api.github.com/repos/nmn/relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmn/relay/downloads","issues_url":"https://api.github.com/repos/nmn/relay/issues{/number}","pulls_url":"https://api.github.com/repos/nmn/relay/pulls{/number}","milestones_url":"https://api.github.com/repos/nmn/relay/milestones{/number}","notifications_url":"https://api.github.com/repos/nmn/relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmn/relay/labels{/name}","releases_url":"https://api.github.com/repos/nmn/relay/releases{/id}","deployments_url":"https://api.github.com/repos/nmn/relay/deployments","created_at":"2016-05-20T05:29:19Z","updated_at":"2016-05-20T05:29:21Z","pushed_at":"2016-05-20T05:42:14Z","git_url":"git://github.com/nmn/relay.git","ssh_url":"git@github.com:nmn/relay.git","clone_url":"https://github.com/nmn/relay.git","svn_url":"https://github.com/nmn/relay","homepage":"https://facebook.github.io/relay/","size":13365,"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":"facebook:master","ref":"master","sha":"8149900aecdb4a053f4eac42b8ff00fb0fadf80a","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":40508605,"name":"relay","full_name":"facebook/relay","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/relay","description":"Relay is a JavaScript framework for building data-driven React applications.","fork":false,"url":"https://api.github.com/repos/facebook/relay","forks_url":"https://api.github.com/repos/facebook/relay/forks","keys_url":"https://api.github.com/repos/facebook/relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/relay/teams","hooks_url":"https://api.github.com/repos/facebook/relay/hooks","issue_events_url":"https://api.github.com/repos/facebook/relay/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/relay/events","assignees_url":"https://api.github.com/repos/facebook/relay/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/relay/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/relay/tags","blobs_url":"https://api.github.com/repos/facebook/relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/relay/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/relay/languages","stargazers_url":"https://api.github.com/repos/facebook/relay/stargazers","contributors_url":"https://api.github.com/repos/facebook/relay/contributors","subscribers_url":"https://api.github.com/repos/facebook/relay/subscribers","subscription_url":"https://api.github.com/repos/facebook/relay/subscription","commits_url":"https://api.github.com/repos/facebook/relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/relay/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/relay/merges","archive_url":"https://api.github.com/repos/facebook/relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/relay/downloads","issues_url":"https://api.github.com/repos/facebook/relay/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/relay/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/relay/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/relay/labels{/name}","releases_url":"https://api.github.com/repos/facebook/relay/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/relay/deployments","created_at":"2015-08-10T22:09:16Z","updated_at":"2016-05-20T05:23:06Z","pushed_at":"2016-05-19T23:30:27Z","git_url":"git://github.com/facebook/relay.git","ssh_url":"git@github.com:facebook/relay.git","clone_url":"https://github.com/facebook/relay.git","svn_url":"https://github.com/facebook/relay","homepage":"https://facebook.github.io/relay/","size":13365,"stargazers_count":6368,"watchers_count":6368,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":494,"mirror_url":null,"open_issues_count":116,"forks":494,"open_issues":116,"watchers":6368,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/relay/pulls/1155"},"html":{"href":"https://github.com/facebook/relay/pull/1155"},"issue":{"href":"https://api.github.com/repos/facebook/relay/issues/1155"},"comments":{"href":"https://api.github.com/repos/facebook/relay/issues/1155/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/relay/pulls/1155/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/relay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/relay/pulls/1155/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/relay/statuses/b834c14ebb726caad882888a4a99493532003268"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"nmn"}}