GitHub PullRequestReviewCommentEvent at 2014-10-30 10:26:52
Repository: strong-remoting
Actor: bajtos
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/19596477","id":19596477,"diff_hunk":"@@ -254,6 +254,31 @@ HttpContext.prototype.invoke = function (scope, method, fn, isCtor) {\n   }\n }\n \n+function toXML(input) {\n+  var xml;\n+  if (input && typeof input.toXML === 'function') {\n+    xml = input.toXML();\n+  } else {\n+    if (input) {\n+      // Trigger toJSON() conversions\n+      input = JSON.parse(JSON.stringify(input));","path":"lib/http-context.js","position":11,"original_position":11,"commit_id":"9fd4f0dd115735b0cd9ff0c420fc8cb4fa186b81","original_commit_id":"9fd4f0dd115735b0cd9ff0c420fc8cb4fa186b81","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=2","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"body":"I am concerned about peformance implications of building and parsing a JSON string. Can use `toJSON` when available, handle arrays recursively, and don't do any transformation otherwise?\r\n\r\n```js\r\nfunction toJSON(input) {\r\n  if (typeof input.toJSON === 'function')\r\n    return input.toJSON();\r\n  else if (Array.isArray(input))\r\n    return input.map(toJSON);  \r\n  else\r\n    return input;\r\n}\r\n```\r\n\r\nI'd rather refine this algorithm if (when) there is a use case where the proposed implementation does not work, instead of imposing a performance penalty on all requests.","created_at":"2014-10-30T10:26:52Z","updated_at":"2014-10-30T10:26:52Z","html_url":"https://github.com/strongloop/strong-remoting/pull/120#discussion_r19596477","pull_request_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/19596477"},"html":{"href":"https://github.com/strongloop/strong-remoting/pull/120#discussion_r19596477"},"pull_request":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120","id":23481944,"html_url":"https://github.com/strongloop/strong-remoting/pull/120","diff_url":"https://github.com/strongloop/strong-remoting/pull/120.diff","patch_url":"https://github.com/strongloop/strong-remoting/pull/120.patch","issue_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/120","number":120,"state":"open","locked":false,"title":"Honor toJSON/toXML() for XML support","user":{"login":"raymondfeng","id":540892,"avatar_url":"https://avatars.githubusercontent.com/u/540892?v=2","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},"body":"/to @ritch @bajtos \r\n\r\nThe PR allows customization of JSON to XML conversion using toJSON()/toXML(). It also adds some test cases for XML media types.","created_at":"2014-10-28T19:05:01Z","updated_at":"2014-10-30T10:26:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9c14610f6f62bde1b541dee31f1bc9959ba27b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120/commits","review_comments_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120/comments","review_comment_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/{number}","comments_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/120/comments","statuses_url":"https://api.github.com/repos/strongloop/strong-remoting/statuses/9fd4f0dd115735b0cd9ff0c420fc8cb4fa186b81","head":{"label":"strongloop:feature/enhance-xml","ref":"feature/enhance-xml","sha":"9fd4f0dd115735b0cd9ff0c420fc8cb4fa186b81","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=2","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":10045175,"name":"strong-remoting","full_name":"strongloop/strong-remoting","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=2","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-remoting","description":"Communicate between objects in servers, mobile apps, and other servers.","fork":false,"url":"https://api.github.com/repos/strongloop/strong-remoting","forks_url":"https://api.github.com/repos/strongloop/strong-remoting/forks","keys_url":"https://api.github.com/repos/strongloop/strong-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-remoting/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-remoting/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-remoting/events","assignees_url":"https://api.github.com/repos/strongloop/strong-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-remoting/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-remoting/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-remoting/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-remoting/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-remoting/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-remoting/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/comments/{number}","contents_url":"https://api.github.com/repos/strongloop/strong-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-remoting/merges","archive_url":"https://api.github.com/repos/strongloop/strong-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-remoting/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-remoting/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-remoting/releases{/id}","created_at":"2013-05-14T01:53:04Z","updated_at":"2014-10-23T13:31:09Z","pushed_at":"2014-10-29T16:34:42Z","git_url":"git://github.com/strongloop/strong-remoting.git","ssh_url":"git@github.com:strongloop/strong-remoting.git","clone_url":"https://github.com/strongloop/strong-remoting.git","svn_url":"https://github.com/strongloop/strong-remoting","homepage":"www.strongloop.com","size":2595,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":11,"forks":17,"open_issues":11,"watchers":22,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"d7b52b0276ae00513f42d2d2c5edb0fdf088339a","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=2","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":10045175,"name":"strong-remoting","full_name":"strongloop/strong-remoting","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=2","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-remoting","description":"Communicate between objects in servers, mobile apps, and other servers.","fork":false,"url":"https://api.github.com/repos/strongloop/strong-remoting","forks_url":"https://api.github.com/repos/strongloop/strong-remoting/forks","keys_url":"https://api.github.com/repos/strongloop/strong-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-remoting/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-remoting/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-remoting/events","assignees_url":"https://api.github.com/repos/strongloop/strong-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-remoting/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-remoting/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-remoting/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-remoting/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-remoting/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-remoting/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/comments/{number}","contents_url":"https://api.github.com/repos/strongloop/strong-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-remoting/merges","archive_url":"https://api.github.com/repos/strongloop/strong-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-remoting/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-remoting/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-remoting/releases{/id}","created_at":"2013-05-14T01:53:04Z","updated_at":"2014-10-23T13:31:09Z","pushed_at":"2014-10-29T16:34:42Z","git_url":"git://github.com/strongloop/strong-remoting.git","ssh_url":"git@github.com:strongloop/strong-remoting.git","clone_url":"https://github.com/strongloop/strong-remoting.git","svn_url":"https://github.com/strongloop/strong-remoting","homepage":"www.strongloop.com","size":2595,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":11,"forks":17,"open_issues":11,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120"},"html":{"href":"https://github.com/strongloop/strong-remoting/pull/120"},"issue":{"href":"https://api.github.com/repos/strongloop/strong-remoting/issues/120"},"comments":{"href":"https://api.github.com/repos/strongloop/strong-remoting/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/strong-remoting/statuses/9fd4f0dd115735b0cd9ff0c420fc8cb4fa186b81"}}}}