{"action":"opened","number":14,"pull_request":{"url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14","id":42591942,"html_url":"https://github.com/zooniverse/panoptes-javascript-client/pull/14","diff_url":"https://github.com/zooniverse/panoptes-javascript-client/pull/14.diff","patch_url":"https://github.com/zooniverse/panoptes-javascript-client/pull/14.patch","issue_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/14","number":14,"state":"open","locked":false,"title":"Towards refactor","user":{"login":"chrissnyder","id":735191,"avatar_url":"https://avatars.githubusercontent.com/u/735191?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissnyder","html_url":"https://github.com/chrissnyder","followers_url":"https://api.github.com/users/chrissnyder/followers","following_url":"https://api.github.com/users/chrissnyder/following{/other_user}","gists_url":"https://api.github.com/users/chrissnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissnyder/subscriptions","organizations_url":"https://api.github.com/users/chrissnyder/orgs","repos_url":"https://api.github.com/users/chrissnyder/repos","events_url":"https://api.github.com/users/chrissnyder/events{/privacy}","received_events_url":"https://api.github.com/users/chrissnyder/received_events","type":"User","site_admin":false},"body":"@rogerhutchings and @edpaget would like different pairs of eyes on this to see if I'm moving in the right direction. Not ready to merge yet.\r\n\r\nNow that a number of different custom projects are using the client, here are a number of refactorings that I believe supports custom development a bit better. In no particular order:\r\n\r\n- Takes heavy inspiration from https://github.com/zooniverse-ui work on testing and switches to using mocha/chai as a test framework. Not a strict improvement, but I'd personally prefer a consistent test environment for all our JS code.\r\n- `PanoptesClient` now extends `JSONAPIClient`. So no more `client.api` to actually access the client.\r\n- Remove the `checkCurrent()` user promise and falls back to a simple evented system. `client.auth` is an instance of EventEmitter. To catch auth changes, just listen for `change` on `client.auth`\r\n- Isomorphic. Should work fine in both node and the browser.\r\n- Removed all compiled code from the repo. I'm not 100% sure of the ramifications of this.\r\n- Updated auth code to sync back up with PFE.\r\n","created_at":"2015-08-17T14:11:42Z","updated_at":"2015-08-17T14:11:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eec642ac6acea74190298035fe987fdc72e616ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14/commits","review_comments_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14/comments","review_comment_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/14/comments","statuses_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/statuses/e4213833ac38e1a9774198293ccd8b508fb47458","head":{"label":"zooniverse:refactor","ref":"refactor","sha":"e4213833ac38e1a9774198293ccd8b508fb47458","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":34182998,"name":"panoptes-javascript-client","full_name":"zooniverse/panoptes-javascript-client","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/panoptes-javascript-client","description":"A Javascript client for accessing the Panoptes API","fork":false,"url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client","forks_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/forks","keys_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/teams","hooks_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/events","assignees_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/tags","blobs_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/languages","stargazers_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/subscription","commits_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/merges","archive_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/downloads","issues_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/releases{/id}","created_at":"2015-04-18T21:14:02Z","updated_at":"2015-07-01T15:19:04Z","pushed_at":"2015-08-17T14:11:43Z","git_url":"git://github.com/zooniverse/panoptes-javascript-client.git","ssh_url":"git@github.com:zooniverse/panoptes-javascript-client.git","clone_url":"https://github.com/zooniverse/panoptes-javascript-client.git","svn_url":"https://github.com/zooniverse/panoptes-javascript-client","homepage":"","size":256,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"zooniverse:master","ref":"master","sha":"68260a777788419887362fd16f46c68a0c77e604","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":34182998,"name":"panoptes-javascript-client","full_name":"zooniverse/panoptes-javascript-client","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/panoptes-javascript-client","description":"A Javascript client for accessing the Panoptes API","fork":false,"url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client","forks_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/forks","keys_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/teams","hooks_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/events","assignees_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/tags","blobs_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/languages","stargazers_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/subscription","commits_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/merges","archive_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/downloads","issues_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/releases{/id}","created_at":"2015-04-18T21:14:02Z","updated_at":"2015-07-01T15:19:04Z","pushed_at":"2015-08-17T14:11:43Z","git_url":"git://github.com/zooniverse/panoptes-javascript-client.git","ssh_url":"git@github.com:zooniverse/panoptes-javascript-client.git","clone_url":"https://github.com/zooniverse/panoptes-javascript-client.git","svn_url":"https://github.com/zooniverse/panoptes-javascript-client","homepage":"","size":256,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14"},"html":{"href":"https://github.com/zooniverse/panoptes-javascript-client/pull/14"},"issue":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/14"},"comments":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/panoptes-javascript-client/statuses/e4213833ac38e1a9774198293ccd8b508fb47458"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":582,"deletions":2456,"changed_files":14}}