{"action":"created","comment":{"url":"https://api.github.com/repos/atom/etch/pulls/comments/77764241","id":77764241,"diff_hunk":"@@ -72,6 +72,8 @@ export default class ComponentWidget {\n         }\n       }\n \n+      // Clean up the old component\n+      oldWidget.destroy()","path":"src/component-widget.js","position":5,"original_position":5,"commit_id":"5e88cef864cdb1591a05fb7b378c024d246ff715","original_commit_id":"5e88cef864cdb1591a05fb7b378c024d246ff715","user":{"login":"BinaryMuse","id":189606,"avatar_url":"https://avatars.githubusercontent.com/u/189606?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryMuse","html_url":"https://github.com/BinaryMuse","followers_url":"https://api.github.com/users/BinaryMuse/followers","following_url":"https://api.github.com/users/BinaryMuse/following{/other_user}","gists_url":"https://api.github.com/users/BinaryMuse/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryMuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryMuse/subscriptions","organizations_url":"https://api.github.com/users/BinaryMuse/orgs","repos_url":"https://api.github.com/users/BinaryMuse/repos","events_url":"https://api.github.com/users/BinaryMuse/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryMuse/received_events","type":"User","site_admin":true},"body":"Not sure if this should go before or after `this.init()`. 💤 now, 💭 later.","created_at":"2016-09-07T06:07:52Z","updated_at":"2016-09-07T06:07:52Z","html_url":"https://github.com/atom/etch/pull/35#discussion_r77764241","pull_request_url":"https://api.github.com/repos/atom/etch/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/atom/etch/pulls/comments/77764241"},"html":{"href":"https://github.com/atom/etch/pull/35#discussion_r77764241"},"pull_request":{"href":"https://api.github.com/repos/atom/etch/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/atom/etch/pulls/35","id":84241601,"html_url":"https://github.com/atom/etch/pull/35","diff_url":"https://github.com/atom/etch/pull/35.diff","patch_url":"https://github.com/atom/etch/pull/35.patch","issue_url":"https://api.github.com/repos/atom/etch/issues/35","number":35,"state":"open","locked":false,"title":"Destroy old components when changing types in ComponentWidget","user":{"login":"BinaryMuse","id":189606,"avatar_url":"https://avatars.githubusercontent.com/u/189606?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryMuse","html_url":"https://github.com/BinaryMuse","followers_url":"https://api.github.com/users/BinaryMuse/followers","following_url":"https://api.github.com/users/BinaryMuse/following{/other_user}","gists_url":"https://api.github.com/users/BinaryMuse/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryMuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryMuse/subscriptions","organizations_url":"https://api.github.com/users/BinaryMuse/orgs","repos_url":"https://api.github.com/users/BinaryMuse/repos","events_url":"https://api.github.com/users/BinaryMuse/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryMuse/received_events","type":"User","site_admin":true},"body":"@kuychaco and I were going over the code and discovered an edge case where `<TypeA />` would change to `<TypeB />` in the virtual DOM tree and the containing `ComponentWidget` would switch out the components, but wouldn't clean up the old one, potentially leaking resources.\r\n\r\n/cc @nathansobo ","created_at":"2016-09-07T06:07:05Z","updated_at":"2016-09-07T06:07:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fccd06d4883c969dfb5e74ae5a49ad64622ca2a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/atom/etch/pulls/35/commits","review_comments_url":"https://api.github.com/repos/atom/etch/pulls/35/comments","review_comment_url":"https://api.github.com/repos/atom/etch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/etch/issues/35/comments","statuses_url":"https://api.github.com/repos/atom/etch/statuses/5e88cef864cdb1591a05fb7b378c024d246ff715","head":{"label":"atom:fix-destroy-when-changing-component-type","ref":"fix-destroy-when-changing-component-type","sha":"5e88cef864cdb1591a05fb7b378c024d246ff715","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":39105425,"name":"etch","full_name":"atom/etch","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/etch","description":"Builds components using a simple and explicit API around virtual-dom","fork":false,"url":"https://api.github.com/repos/atom/etch","forks_url":"https://api.github.com/repos/atom/etch/forks","keys_url":"https://api.github.com/repos/atom/etch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/etch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/etch/teams","hooks_url":"https://api.github.com/repos/atom/etch/hooks","issue_events_url":"https://api.github.com/repos/atom/etch/issues/events{/number}","events_url":"https://api.github.com/repos/atom/etch/events","assignees_url":"https://api.github.com/repos/atom/etch/assignees{/user}","branches_url":"https://api.github.com/repos/atom/etch/branches{/branch}","tags_url":"https://api.github.com/repos/atom/etch/tags","blobs_url":"https://api.github.com/repos/atom/etch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/etch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/etch/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/etch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/etch/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/etch/languages","stargazers_url":"https://api.github.com/repos/atom/etch/stargazers","contributors_url":"https://api.github.com/repos/atom/etch/contributors","subscribers_url":"https://api.github.com/repos/atom/etch/subscribers","subscription_url":"https://api.github.com/repos/atom/etch/subscription","commits_url":"https://api.github.com/repos/atom/etch/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/etch/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/etch/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/etch/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/etch/contents/{+path}","compare_url":"https://api.github.com/repos/atom/etch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/etch/merges","archive_url":"https://api.github.com/repos/atom/etch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/etch/downloads","issues_url":"https://api.github.com/repos/atom/etch/issues{/number}","pulls_url":"https://api.github.com/repos/atom/etch/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/etch/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/etch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/etch/labels{/name}","releases_url":"https://api.github.com/repos/atom/etch/releases{/id}","deployments_url":"https://api.github.com/repos/atom/etch/deployments","created_at":"2015-07-14T23:22:29Z","updated_at":"2016-09-06T21:07:41Z","pushed_at":"2016-09-07T06:07:05Z","git_url":"git://github.com/atom/etch.git","ssh_url":"git@github.com:atom/etch.git","clone_url":"https://github.com/atom/etch.git","svn_url":"https://github.com/atom/etch","homepage":"","size":180,"stargazers_count":72,"watchers_count":72,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":72,"default_branch":"master"}},"base":{"label":"atom:master","ref":"master","sha":"83468ea86869ca84c5e70fee7f4c1e54fd002bf2","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":39105425,"name":"etch","full_name":"atom/etch","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/etch","description":"Builds components using a simple and explicit API around virtual-dom","fork":false,"url":"https://api.github.com/repos/atom/etch","forks_url":"https://api.github.com/repos/atom/etch/forks","keys_url":"https://api.github.com/repos/atom/etch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/etch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/etch/teams","hooks_url":"https://api.github.com/repos/atom/etch/hooks","issue_events_url":"https://api.github.com/repos/atom/etch/issues/events{/number}","events_url":"https://api.github.com/repos/atom/etch/events","assignees_url":"https://api.github.com/repos/atom/etch/assignees{/user}","branches_url":"https://api.github.com/repos/atom/etch/branches{/branch}","tags_url":"https://api.github.com/repos/atom/etch/tags","blobs_url":"https://api.github.com/repos/atom/etch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/etch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/etch/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/etch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/etch/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/etch/languages","stargazers_url":"https://api.github.com/repos/atom/etch/stargazers","contributors_url":"https://api.github.com/repos/atom/etch/contributors","subscribers_url":"https://api.github.com/repos/atom/etch/subscribers","subscription_url":"https://api.github.com/repos/atom/etch/subscription","commits_url":"https://api.github.com/repos/atom/etch/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/etch/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/etch/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/etch/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/etch/contents/{+path}","compare_url":"https://api.github.com/repos/atom/etch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/etch/merges","archive_url":"https://api.github.com/repos/atom/etch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/etch/downloads","issues_url":"https://api.github.com/repos/atom/etch/issues{/number}","pulls_url":"https://api.github.com/repos/atom/etch/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/etch/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/etch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/etch/labels{/name}","releases_url":"https://api.github.com/repos/atom/etch/releases{/id}","deployments_url":"https://api.github.com/repos/atom/etch/deployments","created_at":"2015-07-14T23:22:29Z","updated_at":"2016-09-06T21:07:41Z","pushed_at":"2016-09-07T06:07:05Z","git_url":"git://github.com/atom/etch.git","ssh_url":"git@github.com:atom/etch.git","clone_url":"https://github.com/atom/etch.git","svn_url":"https://github.com/atom/etch","homepage":"","size":180,"stargazers_count":72,"watchers_count":72,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/etch/pulls/35"},"html":{"href":"https://github.com/atom/etch/pull/35"},"issue":{"href":"https://api.github.com/repos/atom/etch/issues/35"},"comments":{"href":"https://api.github.com/repos/atom/etch/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/etch/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/etch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/etch/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/atom/etch/statuses/5e88cef864cdb1591a05fb7b378c024d246ff715"}}}}
{"actor":{"display_login":"BinaryMuse"}}