{"action":"created","comment":{"url":"https://api.github.com/repos/nymag/clay-kiln/pulls/comments/58922514","id":58922514,"diff_hunk":"@@ -298,6 +298,22 @@ function save(uri, data) {\n }\n \n /**\n+ * save, expecting html to be returned from the server\n+ * @param {string} uri\n+ * @param {object} data\n+ * @returns {Promise}\n+ */\n+function saveForHTML(uri, data) {\n+  assertUri(uri);\n+\n+  return send(addJsonHeader({\n+    method: 'PUT',\n+    url: uri + extHtml + '?edit=true',","path":"services/edit/db.js","position":null,"original_position":14,"commit_id":"b805582a2037532ffc68addede4451862435ddc4","original_commit_id":"1c05c8464cdc118e6f1d40fb53f8dcf85bb06e58","user":{"login":"yoshokatana","id":447522,"avatar_url":"https://avatars.githubusercontent.com/u/447522?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshokatana","html_url":"https://github.com/yoshokatana","followers_url":"https://api.github.com/users/yoshokatana/followers","following_url":"https://api.github.com/users/yoshokatana/following{/other_user}","gists_url":"https://api.github.com/users/yoshokatana/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshokatana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshokatana/subscriptions","organizations_url":"https://api.github.com/users/yoshokatana/orgs","repos_url":"https://api.github.com/users/yoshokatana/repos","events_url":"https://api.github.com/users/yoshokatana/events{/privacy}","received_events_url":"https://api.github.com/users/yoshokatana/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-04-07T18:36:16Z","updated_at":"2016-04-07T18:36:16Z","html_url":"https://github.com/nymag/clay-kiln/pull/412#discussion_r58922514","pull_request_url":"https://api.github.com/repos/nymag/clay-kiln/pulls/412","_links":{"self":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/comments/58922514"},"html":{"href":"https://github.com/nymag/clay-kiln/pull/412#discussion_r58922514"},"pull_request":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/412"}}},"pull_request":{"url":"https://api.github.com/repos/nymag/clay-kiln/pulls/412","id":65676264,"html_url":"https://github.com/nymag/clay-kiln/pull/412","diff_url":"https://github.com/nymag/clay-kiln/pull/412.diff","patch_url":"https://github.com/nymag/clay-kiln/pull/412.patch","issue_url":"https://api.github.com/repos/nymag/clay-kiln/issues/412","number":412,"state":"open","locked":false,"title":"eliminate extra api call when saving components","user":{"login":"yoshokatana","id":447522,"avatar_url":"https://avatars.githubusercontent.com/u/447522?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshokatana","html_url":"https://github.com/yoshokatana","followers_url":"https://api.github.com/users/yoshokatana/followers","following_url":"https://api.github.com/users/yoshokatana/following{/other_user}","gists_url":"https://api.github.com/users/yoshokatana/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshokatana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshokatana/subscriptions","organizations_url":"https://api.github.com/users/yoshokatana/orgs","repos_url":"https://api.github.com/users/yoshokatana/repos","events_url":"https://api.github.com/users/yoshokatana/events{/privacy}","received_events_url":"https://api.github.com/users/yoshokatana/received_events","type":"User","site_admin":false},"body":"This eliminates the extra api call (to get the new rendered template) when saving components. It makes these things faster and more fluid:\r\n\r\n* exiting out of component forms\r\n* merging (deleting) paragraphs\r\n\r\nIt also makes the component creation api calls run in parallel, so those will be marginally faster (we can eliminate the second call entirely when we can POST to `/components/name/instances.html`)\r\n\r\n☆.。.:*・°☆.。.:*・°☆.。.:*・°☆.。.:*・°☆\r\n——— **2x speed improvements** ———\r\n☆.。.:*・°☆.。.:*・°☆.。.:*・°☆.。.:*・°☆","created_at":"2016-04-07T18:24:19Z","updated_at":"2016-04-07T18:36:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edb29c8689556496a45463b98532c23d85a167b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nymag/clay-kiln/pulls/412/commits","review_comments_url":"https://api.github.com/repos/nymag/clay-kiln/pulls/412/comments","review_comment_url":"https://api.github.com/repos/nymag/clay-kiln/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nymag/clay-kiln/issues/412/comments","statuses_url":"https://api.github.com/repos/nymag/clay-kiln/statuses/b805582a2037532ffc68addede4451862435ddc4","head":{"label":"nymag:html","ref":"html","sha":"b805582a2037532ffc68addede4451862435ddc4","user":{"login":"nymag","id":1136688,"avatar_url":"https://avatars.githubusercontent.com/u/1136688?v=3","gravatar_id":"","url":"https://api.github.com/users/nymag","html_url":"https://github.com/nymag","followers_url":"https://api.github.com/users/nymag/followers","following_url":"https://api.github.com/users/nymag/following{/other_user}","gists_url":"https://api.github.com/users/nymag/gists{/gist_id}","starred_url":"https://api.github.com/users/nymag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nymag/subscriptions","organizations_url":"https://api.github.com/users/nymag/orgs","repos_url":"https://api.github.com/users/nymag/repos","events_url":"https://api.github.com/users/nymag/events{/privacy}","received_events_url":"https://api.github.com/users/nymag/received_events","type":"Organization","site_admin":false},"repo":{"id":35441695,"name":"clay-kiln","full_name":"nymag/clay-kiln","owner":{"login":"nymag","id":1136688,"avatar_url":"https://avatars.githubusercontent.com/u/1136688?v=3","gravatar_id":"","url":"https://api.github.com/users/nymag","html_url":"https://github.com/nymag","followers_url":"https://api.github.com/users/nymag/followers","following_url":"https://api.github.com/users/nymag/following{/other_user}","gists_url":"https://api.github.com/users/nymag/gists{/gist_id}","starred_url":"https://api.github.com/users/nymag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nymag/subscriptions","organizations_url":"https://api.github.com/users/nymag/orgs","repos_url":"https://api.github.com/users/nymag/repos","events_url":"https://api.github.com/users/nymag/events{/privacy}","received_events_url":"https://api.github.com/users/nymag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nymag/clay-kiln","description":"Editing tools for Clay","fork":false,"url":"https://api.github.com/repos/nymag/clay-kiln","forks_url":"https://api.github.com/repos/nymag/clay-kiln/forks","keys_url":"https://api.github.com/repos/nymag/clay-kiln/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nymag/clay-kiln/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nymag/clay-kiln/teams","hooks_url":"https://api.github.com/repos/nymag/clay-kiln/hooks","issue_events_url":"https://api.github.com/repos/nymag/clay-kiln/issues/events{/number}","events_url":"https://api.github.com/repos/nymag/clay-kiln/events","assignees_url":"https://api.github.com/repos/nymag/clay-kiln/assignees{/user}","branches_url":"https://api.github.com/repos/nymag/clay-kiln/branches{/branch}","tags_url":"https://api.github.com/repos/nymag/clay-kiln/tags","blobs_url":"https://api.github.com/repos/nymag/clay-kiln/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nymag/clay-kiln/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nymag/clay-kiln/git/refs{/sha}","trees_url":"https://api.github.com/repos/nymag/clay-kiln/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nymag/clay-kiln/statuses/{sha}","languages_url":"https://api.github.com/repos/nymag/clay-kiln/languages","stargazers_url":"https://api.github.com/repos/nymag/clay-kiln/stargazers","contributors_url":"https://api.github.com/repos/nymag/clay-kiln/contributors","subscribers_url":"https://api.github.com/repos/nymag/clay-kiln/subscribers","subscription_url":"https://api.github.com/repos/nymag/clay-kiln/subscription","commits_url":"https://api.github.com/repos/nymag/clay-kiln/commits{/sha}","git_commits_url":"https://api.github.com/repos/nymag/clay-kiln/git/commits{/sha}","comments_url":"https://api.github.com/repos/nymag/clay-kiln/comments{/number}","issue_comment_url":"https://api.github.com/repos/nymag/clay-kiln/issues/comments{/number}","contents_url":"https://api.github.com/repos/nymag/clay-kiln/contents/{+path}","compare_url":"https://api.github.com/repos/nymag/clay-kiln/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nymag/clay-kiln/merges","archive_url":"https://api.github.com/repos/nymag/clay-kiln/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nymag/clay-kiln/downloads","issues_url":"https://api.github.com/repos/nymag/clay-kiln/issues{/number}","pulls_url":"https://api.github.com/repos/nymag/clay-kiln/pulls{/number}","milestones_url":"https://api.github.com/repos/nymag/clay-kiln/milestones{/number}","notifications_url":"https://api.github.com/repos/nymag/clay-kiln/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nymag/clay-kiln/labels{/name}","releases_url":"https://api.github.com/repos/nymag/clay-kiln/releases{/id}","deployments_url":"https://api.github.com/repos/nymag/clay-kiln/deployments","created_at":"2015-05-11T18:21:37Z","updated_at":"2016-04-06T22:32:22Z","pushed_at":"2016-04-07T18:34:55Z","git_url":"git://github.com/nymag/clay-kiln.git","ssh_url":"git@github.com:nymag/clay-kiln.git","clone_url":"https://github.com/nymag/clay-kiln.git","svn_url":"https://github.com/nymag/clay-kiln","homepage":"","size":1057,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":45,"forks":0,"open_issues":45,"watchers":1,"default_branch":"master"}},"base":{"label":"nymag:master","ref":"master","sha":"3077bc2679171d1c46256fa0ba10d176cdae1e99","user":{"login":"nymag","id":1136688,"avatar_url":"https://avatars.githubusercontent.com/u/1136688?v=3","gravatar_id":"","url":"https://api.github.com/users/nymag","html_url":"https://github.com/nymag","followers_url":"https://api.github.com/users/nymag/followers","following_url":"https://api.github.com/users/nymag/following{/other_user}","gists_url":"https://api.github.com/users/nymag/gists{/gist_id}","starred_url":"https://api.github.com/users/nymag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nymag/subscriptions","organizations_url":"https://api.github.com/users/nymag/orgs","repos_url":"https://api.github.com/users/nymag/repos","events_url":"https://api.github.com/users/nymag/events{/privacy}","received_events_url":"https://api.github.com/users/nymag/received_events","type":"Organization","site_admin":false},"repo":{"id":35441695,"name":"clay-kiln","full_name":"nymag/clay-kiln","owner":{"login":"nymag","id":1136688,"avatar_url":"https://avatars.githubusercontent.com/u/1136688?v=3","gravatar_id":"","url":"https://api.github.com/users/nymag","html_url":"https://github.com/nymag","followers_url":"https://api.github.com/users/nymag/followers","following_url":"https://api.github.com/users/nymag/following{/other_user}","gists_url":"https://api.github.com/users/nymag/gists{/gist_id}","starred_url":"https://api.github.com/users/nymag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nymag/subscriptions","organizations_url":"https://api.github.com/users/nymag/orgs","repos_url":"https://api.github.com/users/nymag/repos","events_url":"https://api.github.com/users/nymag/events{/privacy}","received_events_url":"https://api.github.com/users/nymag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nymag/clay-kiln","description":"Editing tools for Clay","fork":false,"url":"https://api.github.com/repos/nymag/clay-kiln","forks_url":"https://api.github.com/repos/nymag/clay-kiln/forks","keys_url":"https://api.github.com/repos/nymag/clay-kiln/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nymag/clay-kiln/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nymag/clay-kiln/teams","hooks_url":"https://api.github.com/repos/nymag/clay-kiln/hooks","issue_events_url":"https://api.github.com/repos/nymag/clay-kiln/issues/events{/number}","events_url":"https://api.github.com/repos/nymag/clay-kiln/events","assignees_url":"https://api.github.com/repos/nymag/clay-kiln/assignees{/user}","branches_url":"https://api.github.com/repos/nymag/clay-kiln/branches{/branch}","tags_url":"https://api.github.com/repos/nymag/clay-kiln/tags","blobs_url":"https://api.github.com/repos/nymag/clay-kiln/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nymag/clay-kiln/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nymag/clay-kiln/git/refs{/sha}","trees_url":"https://api.github.com/repos/nymag/clay-kiln/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nymag/clay-kiln/statuses/{sha}","languages_url":"https://api.github.com/repos/nymag/clay-kiln/languages","stargazers_url":"https://api.github.com/repos/nymag/clay-kiln/stargazers","contributors_url":"https://api.github.com/repos/nymag/clay-kiln/contributors","subscribers_url":"https://api.github.com/repos/nymag/clay-kiln/subscribers","subscription_url":"https://api.github.com/repos/nymag/clay-kiln/subscription","commits_url":"https://api.github.com/repos/nymag/clay-kiln/commits{/sha}","git_commits_url":"https://api.github.com/repos/nymag/clay-kiln/git/commits{/sha}","comments_url":"https://api.github.com/repos/nymag/clay-kiln/comments{/number}","issue_comment_url":"https://api.github.com/repos/nymag/clay-kiln/issues/comments{/number}","contents_url":"https://api.github.com/repos/nymag/clay-kiln/contents/{+path}","compare_url":"https://api.github.com/repos/nymag/clay-kiln/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nymag/clay-kiln/merges","archive_url":"https://api.github.com/repos/nymag/clay-kiln/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nymag/clay-kiln/downloads","issues_url":"https://api.github.com/repos/nymag/clay-kiln/issues{/number}","pulls_url":"https://api.github.com/repos/nymag/clay-kiln/pulls{/number}","milestones_url":"https://api.github.com/repos/nymag/clay-kiln/milestones{/number}","notifications_url":"https://api.github.com/repos/nymag/clay-kiln/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nymag/clay-kiln/labels{/name}","releases_url":"https://api.github.com/repos/nymag/clay-kiln/releases{/id}","deployments_url":"https://api.github.com/repos/nymag/clay-kiln/deployments","created_at":"2015-05-11T18:21:37Z","updated_at":"2016-04-06T22:32:22Z","pushed_at":"2016-04-07T18:34:55Z","git_url":"git://github.com/nymag/clay-kiln.git","ssh_url":"git@github.com:nymag/clay-kiln.git","clone_url":"https://github.com/nymag/clay-kiln.git","svn_url":"https://github.com/nymag/clay-kiln","homepage":"","size":1057,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":45,"forks":0,"open_issues":45,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/412"},"html":{"href":"https://github.com/nymag/clay-kiln/pull/412"},"issue":{"href":"https://api.github.com/repos/nymag/clay-kiln/issues/412"},"comments":{"href":"https://api.github.com/repos/nymag/clay-kiln/issues/412/comments"},"review_comments":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/412/comments"},"review_comment":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nymag/clay-kiln/pulls/412/commits"},"statuses":{"href":"https://api.github.com/repos/nymag/clay-kiln/statuses/b805582a2037532ffc68addede4451862435ddc4"}}}}