{"action":"created","comment":{"url":"https://api.github.com/repos/paypal/glamorous/pulls/comments/110616342","pull_request_review_id":31799958,"id":110616342,"diff_hunk":"@@ -14,7 +14,7 @@ export default {\n         {dest: 'dist/glamorous.es.js', format: 'es'},\n         {dest: 'dist/glamorous.cjs.js', format: 'cjs'},\n   ],\n-  exports: 'default',\n+  exports: 'named',","path":"rollup.config.js","position":5,"original_position":5,"commit_id":"64bf7b804f36faa75dd680c014d3af4daeb3da24","original_commit_id":"c9dd466f2bafa9af4c9b11d44a80e8c380e4c123","user":{"login":"vesparny","id":82070,"avatar_url":"https://avatars0.githubusercontent.com/u/82070?v=3","gravatar_id":"","url":"https://api.github.com/users/vesparny","html_url":"https://github.com/vesparny","followers_url":"https://api.github.com/users/vesparny/followers","following_url":"https://api.github.com/users/vesparny/following{/other_user}","gists_url":"https://api.github.com/users/vesparny/gists{/gist_id}","starred_url":"https://api.github.com/users/vesparny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vesparny/subscriptions","organizations_url":"https://api.github.com/users/vesparny/orgs","repos_url":"https://api.github.com/users/vesparny/repos","events_url":"https://api.github.com/users/vesparny/events{/privacy}","received_events_url":"https://api.github.com/users/vesparny/received_events","type":"User","site_admin":false},"body":"Using `named` in rollup config we can have something like:\r\n\r\n```js\r\nimport glamorous, {ThemeProvider} from 'glamorous'\r\n// like react itself\r\nimport React, {Component} from 'react'\r\n\r\n```\r\n\r\nif you want to have a single default export we will have something like\r\n\r\n```js\r\n\r\n// in the lib \r\nObject.assign(\r\n  glamorous,\r\n  {ThemeProvider},\r\n)\r\n\r\n// consuming the lib\r\nimport glamorous from 'glamorous'\r\nconst {ThemeProvider} = glamorous\r\n```\r\n\r\nIn the end it does not change that much.\r\n@kentcdodds your choice :)","created_at":"2017-04-10T09:58:12Z","updated_at":"2017-04-10T09:58:12Z","html_url":"https://github.com/paypal/glamorous/pull/24#discussion_r110616342","pull_request_url":"https://api.github.com/repos/paypal/glamorous/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/comments/110616342"},"html":{"href":"https://github.com/paypal/glamorous/pull/24#discussion_r110616342"},"pull_request":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/paypal/glamorous/pulls/24","id":114694211,"html_url":"https://github.com/paypal/glamorous/pull/24","diff_url":"https://github.com/paypal/glamorous/pull/24.diff","patch_url":"https://github.com/paypal/glamorous/pull/24.patch","issue_url":"https://api.github.com/repos/paypal/glamorous/issues/24","number":24,"state":"open","locked":false,"title":"feat(lib): Theming support","user":{"login":"vesparny","id":82070,"avatar_url":"https://avatars0.githubusercontent.com/u/82070?v=3","gravatar_id":"","url":"https://api.github.com/users/vesparny","html_url":"https://github.com/vesparny","followers_url":"https://api.github.com/users/vesparny/followers","following_url":"https://api.github.com/users/vesparny/following{/other_user}","gists_url":"https://api.github.com/users/vesparny/gists{/gist_id}","starred_url":"https://api.github.com/users/vesparny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vesparny/subscriptions","organizations_url":"https://api.github.com/users/vesparny/orgs","repos_url":"https://api.github.com/users/vesparny/repos","events_url":"https://api.github.com/users/vesparny/events{/privacy}","received_events_url":"https://api.github.com/users/vesparny/received_events","type":"User","site_admin":false},"body":"<!-- What changes are being made? (What feature/bug is being fixed here?) -->\r\n**What**:\r\nTheming support \r\n\r\n<!-- Why are these changes necessary? -->\r\n**Why**:\r\nIt is part of the project roadmap\r\n\r\n<!-- How were these changes implemented? -->\r\n**How**:\r\nA new component has been added:\r\n`ThemeProvider`\r\nIt takes a `theme` props that will be propagated down the tree via context.\r\n\r\nContext updates will also be propagated to children that return false from `shouldComponentUpdate`.\r\nThis has been achieved using an event emitter implemented with [mitt](https://github.com/developit/mitt) and inspired by https://medium.com/@mweststrate/how-to-safely-use-react-context-b7e343eff076\r\n\r\nThemeProviders can also be nested.\r\nInner components will merge outer theme with own.\r\n\r\nI had to change `GlamorousComponent` to a class in order to access lifecycle methods.\r\n\r\n\r\n\r\n<!-- feel free to add additional comments -->\r\n**TODO**:\r\n* Adding unit tests (I have no experience with jest, but I'd love to follow your guidance)\r\n* There is one test that currently fails (see previous point)\r\n* Documentation\r\n* Anything else ?\r\n\r\n\r\nAn example: \r\n```jsx\r\nimport ReactDOM from 'react-dom'\r\nimport React, {Component} from 'react'\r\nimport glamorous, {ThemeProvider} from 'glamorous'\r\n\r\nconst Text = glamorous.div({\r\n  color: 'blue',\r\n},\r\n(props, theme) => {\r\n  return {\r\n    fontSize: theme.fontSize * 100\r\n  }\r\n})\r\n\r\nclass Root extends Component {\r\n  constructor () {\r\n    super()\r\n    this.state = {\r\n      fontSize: 1\r\n    }\r\n    this.tick = this.tick.bind(this)\r\n  }\r\n\r\n  componentDidMount () {\r\n    this.tick()\r\n  }\r\n  tick () {\r\n    setInterval(() => this.setState({fontSize: Math.random()}), 2000)\r\n  }\r\n\r\n\r\n  render () {\r\n    return (\r\n      <ThemeProvider theme={{fontSize: this.state.fontSize}}>\r\n          <Text>\r\n            <ThemeProvider theme={{anotherThemeProperty: 100}}>\r\n              <div>\r\n                <Text>My font size will change</Text>\r\n                <Pure>\r\n                  <Text>My font size will still change, even if I'm inside a pure component</Text>\r\n                </Pure>\r\n              </div>\r\n            </ThemeProvider>\r\n          </Text>\r\n      </ThemeProvider>\r\n    )\r\n  }\r\n}\r\n\r\nclass Pure extends Component {\r\n  shouldComponentUpdate() {\r\n    return false\r\n  }\r\n\r\n  render() {\r\n    return <Text>{this.props.children}</Text>\r\n  }\r\n}\r\n\r\nReactDOM.render(\r\n  <Root />,\r\n  document.getElementById('root')\r\n)\r\n```\r\n\r\n","created_at":"2017-04-06T21:00:48Z","updated_at":"2017-04-10T09:58:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cafccceb47555ae0d153a66c527e13301ef13f71","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/paypal/glamorous/pulls/24/commits","review_comments_url":"https://api.github.com/repos/paypal/glamorous/pulls/24/comments","review_comment_url":"https://api.github.com/repos/paypal/glamorous/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paypal/glamorous/issues/24/comments","statuses_url":"https://api.github.com/repos/paypal/glamorous/statuses/64bf7b804f36faa75dd680c014d3af4daeb3da24","head":{"label":"vesparny:patch-1","ref":"patch-1","sha":"64bf7b804f36faa75dd680c014d3af4daeb3da24","user":{"login":"vesparny","id":82070,"avatar_url":"https://avatars0.githubusercontent.com/u/82070?v=3","gravatar_id":"","url":"https://api.github.com/users/vesparny","html_url":"https://github.com/vesparny","followers_url":"https://api.github.com/users/vesparny/followers","following_url":"https://api.github.com/users/vesparny/following{/other_user}","gists_url":"https://api.github.com/users/vesparny/gists{/gist_id}","starred_url":"https://api.github.com/users/vesparny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vesparny/subscriptions","organizations_url":"https://api.github.com/users/vesparny/orgs","repos_url":"https://api.github.com/users/vesparny/repos","events_url":"https://api.github.com/users/vesparny/events{/privacy}","received_events_url":"https://api.github.com/users/vesparny/received_events","type":"User","site_admin":false},"repo":{"id":87462563,"name":"glamorous","full_name":"vesparny/glamorous","owner":{"login":"vesparny","id":82070,"avatar_url":"https://avatars0.githubusercontent.com/u/82070?v=3","gravatar_id":"","url":"https://api.github.com/users/vesparny","html_url":"https://github.com/vesparny","followers_url":"https://api.github.com/users/vesparny/followers","following_url":"https://api.github.com/users/vesparny/following{/other_user}","gists_url":"https://api.github.com/users/vesparny/gists{/gist_id}","starred_url":"https://api.github.com/users/vesparny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vesparny/subscriptions","organizations_url":"https://api.github.com/users/vesparny/orgs","repos_url":"https://api.github.com/users/vesparny/repos","events_url":"https://api.github.com/users/vesparny/events{/privacy}","received_events_url":"https://api.github.com/users/vesparny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vesparny/glamorous","description":"React component styling solved 💄 ","fork":true,"url":"https://api.github.com/repos/vesparny/glamorous","forks_url":"https://api.github.com/repos/vesparny/glamorous/forks","keys_url":"https://api.github.com/repos/vesparny/glamorous/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vesparny/glamorous/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vesparny/glamorous/teams","hooks_url":"https://api.github.com/repos/vesparny/glamorous/hooks","issue_events_url":"https://api.github.com/repos/vesparny/glamorous/issues/events{/number}","events_url":"https://api.github.com/repos/vesparny/glamorous/events","assignees_url":"https://api.github.com/repos/vesparny/glamorous/assignees{/user}","branches_url":"https://api.github.com/repos/vesparny/glamorous/branches{/branch}","tags_url":"https://api.github.com/repos/vesparny/glamorous/tags","blobs_url":"https://api.github.com/repos/vesparny/glamorous/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vesparny/glamorous/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vesparny/glamorous/git/refs{/sha}","trees_url":"https://api.github.com/repos/vesparny/glamorous/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vesparny/glamorous/statuses/{sha}","languages_url":"https://api.github.com/repos/vesparny/glamorous/languages","stargazers_url":"https://api.github.com/repos/vesparny/glamorous/stargazers","contributors_url":"https://api.github.com/repos/vesparny/glamorous/contributors","subscribers_url":"https://api.github.com/repos/vesparny/glamorous/subscribers","subscription_url":"https://api.github.com/repos/vesparny/glamorous/subscription","commits_url":"https://api.github.com/repos/vesparny/glamorous/commits{/sha}","git_commits_url":"https://api.github.com/repos/vesparny/glamorous/git/commits{/sha}","comments_url":"https://api.github.com/repos/vesparny/glamorous/comments{/number}","issue_comment_url":"https://api.github.com/repos/vesparny/glamorous/issues/comments{/number}","contents_url":"https://api.github.com/repos/vesparny/glamorous/contents/{+path}","compare_url":"https://api.github.com/repos/vesparny/glamorous/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vesparny/glamorous/merges","archive_url":"https://api.github.com/repos/vesparny/glamorous/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vesparny/glamorous/downloads","issues_url":"https://api.github.com/repos/vesparny/glamorous/issues{/number}","pulls_url":"https://api.github.com/repos/vesparny/glamorous/pulls{/number}","milestones_url":"https://api.github.com/repos/vesparny/glamorous/milestones{/number}","notifications_url":"https://api.github.com/repos/vesparny/glamorous/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vesparny/glamorous/labels{/name}","releases_url":"https://api.github.com/repos/vesparny/glamorous/releases{/id}","deployments_url":"https://api.github.com/repos/vesparny/glamorous/deployments","created_at":"2017-04-06T18:37:59Z","updated_at":"2017-04-06T18:38:00Z","pushed_at":"2017-04-10T09:47:40Z","git_url":"git://github.com/vesparny/glamorous.git","ssh_url":"git@github.com:vesparny/glamorous.git","clone_url":"https://github.com/vesparny/glamorous.git","svn_url":"https://github.com/vesparny/glamorous","homepage":"http://npm.im/glamorous","size":226,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"paypal:master","ref":"master","sha":"14970c1bb59d1408d3066d209dafa356b5ce3173","user":{"login":"paypal","id":476675,"avatar_url":"https://avatars2.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"repo":{"id":87123146,"name":"glamorous","full_name":"paypal/glamorous","owner":{"login":"paypal","id":476675,"avatar_url":"https://avatars2.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paypal/glamorous","description":"React component styling solved 💄 ","fork":false,"url":"https://api.github.com/repos/paypal/glamorous","forks_url":"https://api.github.com/repos/paypal/glamorous/forks","keys_url":"https://api.github.com/repos/paypal/glamorous/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paypal/glamorous/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paypal/glamorous/teams","hooks_url":"https://api.github.com/repos/paypal/glamorous/hooks","issue_events_url":"https://api.github.com/repos/paypal/glamorous/issues/events{/number}","events_url":"https://api.github.com/repos/paypal/glamorous/events","assignees_url":"https://api.github.com/repos/paypal/glamorous/assignees{/user}","branches_url":"https://api.github.com/repos/paypal/glamorous/branches{/branch}","tags_url":"https://api.github.com/repos/paypal/glamorous/tags","blobs_url":"https://api.github.com/repos/paypal/glamorous/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paypal/glamorous/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paypal/glamorous/git/refs{/sha}","trees_url":"https://api.github.com/repos/paypal/glamorous/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paypal/glamorous/statuses/{sha}","languages_url":"https://api.github.com/repos/paypal/glamorous/languages","stargazers_url":"https://api.github.com/repos/paypal/glamorous/stargazers","contributors_url":"https://api.github.com/repos/paypal/glamorous/contributors","subscribers_url":"https://api.github.com/repos/paypal/glamorous/subscribers","subscription_url":"https://api.github.com/repos/paypal/glamorous/subscription","commits_url":"https://api.github.com/repos/paypal/glamorous/commits{/sha}","git_commits_url":"https://api.github.com/repos/paypal/glamorous/git/commits{/sha}","comments_url":"https://api.github.com/repos/paypal/glamorous/comments{/number}","issue_comment_url":"https://api.github.com/repos/paypal/glamorous/issues/comments{/number}","contents_url":"https://api.github.com/repos/paypal/glamorous/contents/{+path}","compare_url":"https://api.github.com/repos/paypal/glamorous/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paypal/glamorous/merges","archive_url":"https://api.github.com/repos/paypal/glamorous/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paypal/glamorous/downloads","issues_url":"https://api.github.com/repos/paypal/glamorous/issues{/number}","pulls_url":"https://api.github.com/repos/paypal/glamorous/pulls{/number}","milestones_url":"https://api.github.com/repos/paypal/glamorous/milestones{/number}","notifications_url":"https://api.github.com/repos/paypal/glamorous/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paypal/glamorous/labels{/name}","releases_url":"https://api.github.com/repos/paypal/glamorous/releases{/id}","deployments_url":"https://api.github.com/repos/paypal/glamorous/deployments","created_at":"2017-04-03T21:35:49Z","updated_at":"2017-04-10T09:38:40Z","pushed_at":"2017-04-10T09:47:41Z","git_url":"git://github.com/paypal/glamorous.git","ssh_url":"git@github.com:paypal/glamorous.git","clone_url":"https://github.com/paypal/glamorous.git","svn_url":"https://github.com/paypal/glamorous","homepage":"http://npm.im/glamorous","size":228,"stargazers_count":942,"watchers_count":942,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":10,"forks":51,"open_issues":10,"watchers":942,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/24"},"html":{"href":"https://github.com/paypal/glamorous/pull/24"},"issue":{"href":"https://api.github.com/repos/paypal/glamorous/issues/24"},"comments":{"href":"https://api.github.com/repos/paypal/glamorous/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paypal/glamorous/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/paypal/glamorous/statuses/64bf7b804f36faa75dd680c014d3af4daeb3da24"}}}}
{"actor":{"display_login":"vesparny"}}