{"action":"created","comment":{"url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/comments/185928358","pull_request_review_id":117419934,"id":185928358,"diff_hunk":"@@ -0,0 +1,65 @@\n+import React from 'react';\n+import ReactDOM from 'react-dom';\n+import { AnimatedValue } from 'react-spring';\n+\n+const getValues = object => Object.keys(object).map(k => object[k]);\n+const check = value => value === 'auto';\n+const convert = (acc, [name, value]) => ({\n+  ...acc,\n+  [name]: new AnimatedValue(value),\n+});\n+const overwrite = (width, height) => (acc, [name, value]) => ({\n+  ...acc,\n+  [name]: value === 'auto' ? (name === 'height' ? height : width) : value,\n+});\n+\n+/**\n+ * Using a custom auto-size fixing calculator\n+ * while https://github.com/drcmda/react-spring/pull/76#issuecomment-386326322\n+ * is still open.\n+ */\n+export default function fixAuto(spring, props) {\n+  const { native, children, from, to } = props;\n+\n+  // Dry-route props back if nothing's using 'auto' in there\n+  if (![...getValues(from), ...getValues(to)].some(check)) return;\n+\n+  const forward = spring.getForwardProps(props);\n+  const allProps = Object.entries({ ...from, ...to });\n+\n+  // Collect to-state props\n+  const componentProps = native\n+    ? allProps.reduce(convert, forward)\n+    : { ...from, ...to, ...forward };\n+\n+  return (\n+    <div\n+      style={{ visibility: 'hidden', position: 'absolute' }}\n+      ref={ref => {\n+        if (ref) {\n+          // Once it's rendered out, fetch bounds\n+          const height = ref.clientHeight;\n+          const width = ref.clientWidth;\n+\n+          console.log(height);","path":"src/behaviors/ExpandToggle/FixAuto.js","position":44,"original_position":44,"commit_id":"e3e33c4c49e832d90fc411a9501a539bd9699c96","original_commit_id":"e3e33c4c49e832d90fc411a9501a539bd9699c96","user":{"login":"zelitzsi","id":3961037,"avatar_url":"https://avatars2.githubusercontent.com/u/3961037?v=4","gravatar_id":"","url":"https://api.github.com/users/zelitzsi","html_url":"https://github.com/zelitzsi","followers_url":"https://api.github.com/users/zelitzsi/followers","following_url":"https://api.github.com/users/zelitzsi/following{/other_user}","gists_url":"https://api.github.com/users/zelitzsi/gists{/gist_id}","starred_url":"https://api.github.com/users/zelitzsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zelitzsi/subscriptions","organizations_url":"https://api.github.com/users/zelitzsi/orgs","repos_url":"https://api.github.com/users/zelitzsi/repos","events_url":"https://api.github.com/users/zelitzsi/events{/privacy}","received_events_url":"https://api.github.com/users/zelitzsi/received_events","type":"User","site_admin":false},"body":"remove `console.log`","created_at":"2018-05-03T20:34:57Z","updated_at":"2018-05-03T20:41:52Z","html_url":"https://github.com/Bandwidth/shared-components/pull/113#discussion_r185928358","pull_request_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/comments/185928358"},"html":{"href":"https://github.com/Bandwidth/shared-components/pull/113#discussion_r185928358"},"pull_request":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113","id":185799887,"html_url":"https://github.com/Bandwidth/shared-components/pull/113","diff_url":"https://github.com/Bandwidth/shared-components/pull/113.diff","patch_url":"https://github.com/Bandwidth/shared-components/pull/113.patch","issue_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/113","number":113,"state":"open","locked":false,"title":"Move to react-spring for accordions for native performance","user":{"login":"a-type","id":2829772,"avatar_url":"https://avatars1.githubusercontent.com/u/2829772?v=4","gravatar_id":"","url":"https://api.github.com/users/a-type","html_url":"https://github.com/a-type","followers_url":"https://api.github.com/users/a-type/followers","following_url":"https://api.github.com/users/a-type/following{/other_user}","gists_url":"https://api.github.com/users/a-type/gists{/gist_id}","starred_url":"https://api.github.com/users/a-type/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-type/subscriptions","organizations_url":"https://api.github.com/users/a-type/orgs","repos_url":"https://api.github.com/users/a-type/repos","events_url":"https://api.github.com/users/a-type/events{/privacy}","received_events_url":"https://api.github.com/users/a-type/received_events","type":"User","site_admin":false},"body":"![gif](https://user-images.githubusercontent.com/2829772/39595627-0f05ec88-4ede-11e8-86f7-12c1ef9dc7b3.gif)\r\n\r\n(it's actually smoother IRL)\r\n\r\n## PR Checklist\r\n\r\nCheck these before submitting your pull request:\r\n\r\n- [x] Visual and behavioral components are separated\r\n- [x] Exported components are documented with examples\r\n- [x] Props have JSDoc comments\r\n- [x] All relevant visual sub-components can be overridden via props\r\n\r\n## Breaking Changes\r\n\r\n* No changes in usage\r\n\r\n## Changes to Existing Components\r\n\r\n* Replaced the underlying animation tech behind the ExpandToggle component to use react-spring in `native` mode. Should be more performant!\r\n","created_at":"2018-05-03T18:27:31Z","updated_at":"2018-05-03T20:41:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b651804b3e3eb268ae881b43561c900f0f7a883e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"lunxiao","id":17435809,"avatar_url":"https://avatars1.githubusercontent.com/u/17435809?v=4","gravatar_id":"","url":"https://api.github.com/users/lunxiao","html_url":"https://github.com/lunxiao","followers_url":"https://api.github.com/users/lunxiao/followers","following_url":"https://api.github.com/users/lunxiao/following{/other_user}","gists_url":"https://api.github.com/users/lunxiao/gists{/gist_id}","starred_url":"https://api.github.com/users/lunxiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunxiao/subscriptions","organizations_url":"https://api.github.com/users/lunxiao/orgs","repos_url":"https://api.github.com/users/lunxiao/repos","events_url":"https://api.github.com/users/lunxiao/events{/privacy}","received_events_url":"https://api.github.com/users/lunxiao/received_events","type":"User","site_admin":false},{"login":"tbowenbw","id":20463995,"avatar_url":"https://avatars3.githubusercontent.com/u/20463995?v=4","gravatar_id":"","url":"https://api.github.com/users/tbowenbw","html_url":"https://github.com/tbowenbw","followers_url":"https://api.github.com/users/tbowenbw/followers","following_url":"https://api.github.com/users/tbowenbw/following{/other_user}","gists_url":"https://api.github.com/users/tbowenbw/gists{/gist_id}","starred_url":"https://api.github.com/users/tbowenbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbowenbw/subscriptions","organizations_url":"https://api.github.com/users/tbowenbw/orgs","repos_url":"https://api.github.com/users/tbowenbw/repos","events_url":"https://api.github.com/users/tbowenbw/events{/privacy}","received_events_url":"https://api.github.com/users/tbowenbw/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113/commits","review_comments_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113/comments","review_comment_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/113/comments","statuses_url":"https://api.github.com/repos/Bandwidth/shared-components/statuses/e3e33c4c49e832d90fc411a9501a539bd9699c96","head":{"label":"Bandwidth:spring","ref":"spring","sha":"e3e33c4c49e832d90fc411a9501a539bd9699c96","user":{"login":"Bandwidth","id":20689391,"avatar_url":"https://avatars2.githubusercontent.com/u/20689391?v=4","gravatar_id":"","url":"https://api.github.com/users/Bandwidth","html_url":"https://github.com/Bandwidth","followers_url":"https://api.github.com/users/Bandwidth/followers","following_url":"https://api.github.com/users/Bandwidth/following{/other_user}","gists_url":"https://api.github.com/users/Bandwidth/gists{/gist_id}","starred_url":"https://api.github.com/users/Bandwidth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bandwidth/subscriptions","organizations_url":"https://api.github.com/users/Bandwidth/orgs","repos_url":"https://api.github.com/users/Bandwidth/repos","events_url":"https://api.github.com/users/Bandwidth/events{/privacy}","received_events_url":"https://api.github.com/users/Bandwidth/received_events","type":"Organization","site_admin":false},"repo":{"id":90064325,"name":"shared-components","full_name":"Bandwidth/shared-components","owner":{"login":"Bandwidth","id":20689391,"avatar_url":"https://avatars2.githubusercontent.com/u/20689391?v=4","gravatar_id":"","url":"https://api.github.com/users/Bandwidth","html_url":"https://github.com/Bandwidth","followers_url":"https://api.github.com/users/Bandwidth/followers","following_url":"https://api.github.com/users/Bandwidth/following{/other_user}","gists_url":"https://api.github.com/users/Bandwidth/gists{/gist_id}","starred_url":"https://api.github.com/users/Bandwidth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bandwidth/subscriptions","organizations_url":"https://api.github.com/users/Bandwidth/orgs","repos_url":"https://api.github.com/users/Bandwidth/repos","events_url":"https://api.github.com/users/Bandwidth/events{/privacy}","received_events_url":"https://api.github.com/users/Bandwidth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bandwidth/shared-components","description":"A shared React component library for Bandwidth UI projects","fork":false,"url":"https://api.github.com/repos/Bandwidth/shared-components","forks_url":"https://api.github.com/repos/Bandwidth/shared-components/forks","keys_url":"https://api.github.com/repos/Bandwidth/shared-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bandwidth/shared-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bandwidth/shared-components/teams","hooks_url":"https://api.github.com/repos/Bandwidth/shared-components/hooks","issue_events_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/events{/number}","events_url":"https://api.github.com/repos/Bandwidth/shared-components/events","assignees_url":"https://api.github.com/repos/Bandwidth/shared-components/assignees{/user}","branches_url":"https://api.github.com/repos/Bandwidth/shared-components/branches{/branch}","tags_url":"https://api.github.com/repos/Bandwidth/shared-components/tags","blobs_url":"https://api.github.com/repos/Bandwidth/shared-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bandwidth/shared-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bandwidth/shared-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bandwidth/shared-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bandwidth/shared-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Bandwidth/shared-components/languages","stargazers_url":"https://api.github.com/repos/Bandwidth/shared-components/stargazers","contributors_url":"https://api.github.com/repos/Bandwidth/shared-components/contributors","subscribers_url":"https://api.github.com/repos/Bandwidth/shared-components/subscribers","subscription_url":"https://api.github.com/repos/Bandwidth/shared-components/subscription","commits_url":"https://api.github.com/repos/Bandwidth/shared-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bandwidth/shared-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bandwidth/shared-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bandwidth/shared-components/contents/{+path}","compare_url":"https://api.github.com/repos/Bandwidth/shared-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bandwidth/shared-components/merges","archive_url":"https://api.github.com/repos/Bandwidth/shared-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bandwidth/shared-components/downloads","issues_url":"https://api.github.com/repos/Bandwidth/shared-components/issues{/number}","pulls_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Bandwidth/shared-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Bandwidth/shared-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bandwidth/shared-components/labels{/name}","releases_url":"https://api.github.com/repos/Bandwidth/shared-components/releases{/id}","deployments_url":"https://api.github.com/repos/Bandwidth/shared-components/deployments","created_at":"2017-05-02T18:18:47Z","updated_at":"2018-05-03T19:42:18Z","pushed_at":"2018-05-03T19:42:18Z","git_url":"git://github.com/Bandwidth/shared-components.git","ssh_url":"git@github.com:Bandwidth/shared-components.git","clone_url":"https://github.com/Bandwidth/shared-components.git","svn_url":"https://github.com/Bandwidth/shared-components","homepage":"http://dev.bandwidth.com/shared-components","size":12598,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":9,"watchers":6,"default_branch":"master"}},"base":{"label":"Bandwidth:master","ref":"master","sha":"86e0c4fcb17f1fb7ff771752d4d979d2ec2a7066","user":{"login":"Bandwidth","id":20689391,"avatar_url":"https://avatars2.githubusercontent.com/u/20689391?v=4","gravatar_id":"","url":"https://api.github.com/users/Bandwidth","html_url":"https://github.com/Bandwidth","followers_url":"https://api.github.com/users/Bandwidth/followers","following_url":"https://api.github.com/users/Bandwidth/following{/other_user}","gists_url":"https://api.github.com/users/Bandwidth/gists{/gist_id}","starred_url":"https://api.github.com/users/Bandwidth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bandwidth/subscriptions","organizations_url":"https://api.github.com/users/Bandwidth/orgs","repos_url":"https://api.github.com/users/Bandwidth/repos","events_url":"https://api.github.com/users/Bandwidth/events{/privacy}","received_events_url":"https://api.github.com/users/Bandwidth/received_events","type":"Organization","site_admin":false},"repo":{"id":90064325,"name":"shared-components","full_name":"Bandwidth/shared-components","owner":{"login":"Bandwidth","id":20689391,"avatar_url":"https://avatars2.githubusercontent.com/u/20689391?v=4","gravatar_id":"","url":"https://api.github.com/users/Bandwidth","html_url":"https://github.com/Bandwidth","followers_url":"https://api.github.com/users/Bandwidth/followers","following_url":"https://api.github.com/users/Bandwidth/following{/other_user}","gists_url":"https://api.github.com/users/Bandwidth/gists{/gist_id}","starred_url":"https://api.github.com/users/Bandwidth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bandwidth/subscriptions","organizations_url":"https://api.github.com/users/Bandwidth/orgs","repos_url":"https://api.github.com/users/Bandwidth/repos","events_url":"https://api.github.com/users/Bandwidth/events{/privacy}","received_events_url":"https://api.github.com/users/Bandwidth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bandwidth/shared-components","description":"A shared React component library for Bandwidth UI projects","fork":false,"url":"https://api.github.com/repos/Bandwidth/shared-components","forks_url":"https://api.github.com/repos/Bandwidth/shared-components/forks","keys_url":"https://api.github.com/repos/Bandwidth/shared-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bandwidth/shared-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bandwidth/shared-components/teams","hooks_url":"https://api.github.com/repos/Bandwidth/shared-components/hooks","issue_events_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/events{/number}","events_url":"https://api.github.com/repos/Bandwidth/shared-components/events","assignees_url":"https://api.github.com/repos/Bandwidth/shared-components/assignees{/user}","branches_url":"https://api.github.com/repos/Bandwidth/shared-components/branches{/branch}","tags_url":"https://api.github.com/repos/Bandwidth/shared-components/tags","blobs_url":"https://api.github.com/repos/Bandwidth/shared-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bandwidth/shared-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bandwidth/shared-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bandwidth/shared-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bandwidth/shared-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Bandwidth/shared-components/languages","stargazers_url":"https://api.github.com/repos/Bandwidth/shared-components/stargazers","contributors_url":"https://api.github.com/repos/Bandwidth/shared-components/contributors","subscribers_url":"https://api.github.com/repos/Bandwidth/shared-components/subscribers","subscription_url":"https://api.github.com/repos/Bandwidth/shared-components/subscription","commits_url":"https://api.github.com/repos/Bandwidth/shared-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bandwidth/shared-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bandwidth/shared-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bandwidth/shared-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bandwidth/shared-components/contents/{+path}","compare_url":"https://api.github.com/repos/Bandwidth/shared-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bandwidth/shared-components/merges","archive_url":"https://api.github.com/repos/Bandwidth/shared-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bandwidth/shared-components/downloads","issues_url":"https://api.github.com/repos/Bandwidth/shared-components/issues{/number}","pulls_url":"https://api.github.com/repos/Bandwidth/shared-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Bandwidth/shared-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Bandwidth/shared-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bandwidth/shared-components/labels{/name}","releases_url":"https://api.github.com/repos/Bandwidth/shared-components/releases{/id}","deployments_url":"https://api.github.com/repos/Bandwidth/shared-components/deployments","created_at":"2017-05-02T18:18:47Z","updated_at":"2018-05-03T19:42:18Z","pushed_at":"2018-05-03T19:42:18Z","git_url":"git://github.com/Bandwidth/shared-components.git","ssh_url":"git@github.com:Bandwidth/shared-components.git","clone_url":"https://github.com/Bandwidth/shared-components.git","svn_url":"https://github.com/Bandwidth/shared-components","homepage":"http://dev.bandwidth.com/shared-components","size":12598,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":9,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113"},"html":{"href":"https://github.com/Bandwidth/shared-components/pull/113"},"issue":{"href":"https://api.github.com/repos/Bandwidth/shared-components/issues/113"},"comments":{"href":"https://api.github.com/repos/Bandwidth/shared-components/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bandwidth/shared-components/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/Bandwidth/shared-components/statuses/e3e33c4c49e832d90fc411a9501a539bd9699c96"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"zelitzsi"}}