{"action":"closed","number":2004,"pull_request":{"url":"https://api.github.com/repos/riot/riot/pulls/2004","id":87029677,"html_url":"https://github.com/riot/riot/pull/2004","diff_url":"https://github.com/riot/riot/pull/2004.diff","patch_url":"https://github.com/riot/riot/pull/2004.patch","issue_url":"https://api.github.com/repos/riot/riot/issues/2004","number":2004,"state":"closed","locked":false,"title":"Feature/deferred unmount","user":{"login":"senica","id":954952,"avatar_url":"https://avatars.githubusercontent.com/u/954952?v=3","gravatar_id":"","url":"https://api.github.com/users/senica","html_url":"https://github.com/senica","followers_url":"https://api.github.com/users/senica/followers","following_url":"https://api.github.com/users/senica/following{/other_user}","gists_url":"https://api.github.com/users/senica/gists{/gist_id}","starred_url":"https://api.github.com/users/senica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senica/subscriptions","organizations_url":"https://api.github.com/users/senica/orgs","repos_url":"https://api.github.com/users/senica/repos","events_url":"https://api.github.com/users/senica/events{/privacy}","received_events_url":"https://api.github.com/users/senica/received_events","type":"User","site_admin":false},"body":"## __IMPORTANT: for all the pull requests use the `dev` branch__\r\n\r\nThis was branched off the 'next' branch so it won't auto-merge into the dev branch.\r\n\r\n### Answer the following depending on the type of change you want to merge\r\n\r\n#### Code\r\n\r\n1. Have you added test(s) for your patch? If not, why not?\r\n\r\nYes. core-spec.js -> `defer unmounting of children` using `deferred-unmount` tag\r\n\r\n2. Can you provide an example of your patch in use?\r\n\r\nHere is a crude example\r\n  - [Demo](http://plnkr.co/edit/OKxtoc4fWqy0Xu4BtFhO?p=preview) on plnkr (preferred)\r\n\r\n\r\n3. Is this a breaking change?\r\n\r\n  No, ~~~but there is a performance hit. Specifically in /Users/senica/projects/riot/lib/browser/tag/each.js in the unmountRedundant function. If this change were to get merged in, it might be prudent to keep the original code and add this as an option by passing in toKeep and items into the unmountRedundant function and figure out how to handle the unmount from there.~~~ I added the original code back in and just made an exception for the beforeUnmount function\r\n\r\n#### Content\r\n\r\nProvide a short description about what you have changed:\r\n\r\nI'd love to get feedback on this. One of my qualms with front-end libraries (angular, react, riot, etc) is the flexibility it takes away from the user experience when it comes to user notifications of changing data. More specifically when data goes away. Riot has a wonderful feature called `each` that can take an array and magically display elements based on that data. When that data changes (an item is removed) the dom abruptly changes to reflect that change. It leaves the user having to process for a second what just happened.\r\n\r\nWhen items are mounted, we do not have this issue. We can start the element as some predefined state and use the `mount` event to animate and alter the dom to show the user that something is happening or has happened to the data.\r\n\r\nCurrently, we do not have a way to do this with unmounting items (unless great care is taken). If the data that is bound, or creates the dom element is removed, the item just disappears. There is a process that can be taken where the data handler over-reaches into the dom component and animates before actually removing the data that is bound to the dom element, but with large apps, this becomes quite cumbersome.\r\n\r\nThis patch, gives a new function to the tag instance called `beforeUnmount`. The reason I did a new function instead of modifying the event handler is because, as I understood it, with 3.0.x you can use any event handler you wish...? It made it much easier to add a new function to the tag. If this function is defined on a tag, when the tag is unmounted (either by calling unmount directly, or by modifying the underlying data), `beforeUnmount` is passed a callback and *MUST* call the callback when the tag is actually ready to be unmounted.\r\n\r\nThoughts?\r\n","created_at":"2016-09-27T23:17:24Z","updated_at":"2016-09-30T22:36:24Z","closed_at":"2016-09-30T22:36:24Z","merged_at":null,"merge_commit_sha":"b59a8228667340638314c8d206d3fcc1e9e67976","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/riot/riot/pulls/2004/commits","review_comments_url":"https://api.github.com/repos/riot/riot/pulls/2004/comments","review_comment_url":"https://api.github.com/repos/riot/riot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/riot/riot/issues/2004/comments","statuses_url":"https://api.github.com/repos/riot/riot/statuses/a46ed32b1c1103e60a48e42dc08f30a824f3011a","head":{"label":"senica:feature/deferred-unmount","ref":"feature/deferred-unmount","sha":"a46ed32b1c1103e60a48e42dc08f30a824f3011a","user":{"login":"senica","id":954952,"avatar_url":"https://avatars.githubusercontent.com/u/954952?v=3","gravatar_id":"","url":"https://api.github.com/users/senica","html_url":"https://github.com/senica","followers_url":"https://api.github.com/users/senica/followers","following_url":"https://api.github.com/users/senica/following{/other_user}","gists_url":"https://api.github.com/users/senica/gists{/gist_id}","starred_url":"https://api.github.com/users/senica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senica/subscriptions","organizations_url":"https://api.github.com/users/senica/orgs","repos_url":"https://api.github.com/users/senica/repos","events_url":"https://api.github.com/users/senica/events{/privacy}","received_events_url":"https://api.github.com/users/senica/received_events","type":"User","site_admin":false},"repo":{"id":69404365,"name":"riot","full_name":"senica/riot","owner":{"login":"senica","id":954952,"avatar_url":"https://avatars.githubusercontent.com/u/954952?v=3","gravatar_id":"","url":"https://api.github.com/users/senica","html_url":"https://github.com/senica","followers_url":"https://api.github.com/users/senica/followers","following_url":"https://api.github.com/users/senica/following{/other_user}","gists_url":"https://api.github.com/users/senica/gists{/gist_id}","starred_url":"https://api.github.com/users/senica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senica/subscriptions","organizations_url":"https://api.github.com/users/senica/orgs","repos_url":"https://api.github.com/users/senica/repos","events_url":"https://api.github.com/users/senica/events{/privacy}","received_events_url":"https://api.github.com/users/senica/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/senica/riot","description":"A React-like, user interface library","fork":true,"url":"https://api.github.com/repos/senica/riot","forks_url":"https://api.github.com/repos/senica/riot/forks","keys_url":"https://api.github.com/repos/senica/riot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/senica/riot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/senica/riot/teams","hooks_url":"https://api.github.com/repos/senica/riot/hooks","issue_events_url":"https://api.github.com/repos/senica/riot/issues/events{/number}","events_url":"https://api.github.com/repos/senica/riot/events","assignees_url":"https://api.github.com/repos/senica/riot/assignees{/user}","branches_url":"https://api.github.com/repos/senica/riot/branches{/branch}","tags_url":"https://api.github.com/repos/senica/riot/tags","blobs_url":"https://api.github.com/repos/senica/riot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/senica/riot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/senica/riot/git/refs{/sha}","trees_url":"https://api.github.com/repos/senica/riot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/senica/riot/statuses/{sha}","languages_url":"https://api.github.com/repos/senica/riot/languages","stargazers_url":"https://api.github.com/repos/senica/riot/stargazers","contributors_url":"https://api.github.com/repos/senica/riot/contributors","subscribers_url":"https://api.github.com/repos/senica/riot/subscribers","subscription_url":"https://api.github.com/repos/senica/riot/subscription","commits_url":"https://api.github.com/repos/senica/riot/commits{/sha}","git_commits_url":"https://api.github.com/repos/senica/riot/git/commits{/sha}","comments_url":"https://api.github.com/repos/senica/riot/comments{/number}","issue_comment_url":"https://api.github.com/repos/senica/riot/issues/comments{/number}","contents_url":"https://api.github.com/repos/senica/riot/contents/{+path}","compare_url":"https://api.github.com/repos/senica/riot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/senica/riot/merges","archive_url":"https://api.github.com/repos/senica/riot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/senica/riot/downloads","issues_url":"https://api.github.com/repos/senica/riot/issues{/number}","pulls_url":"https://api.github.com/repos/senica/riot/pulls{/number}","milestones_url":"https://api.github.com/repos/senica/riot/milestones{/number}","notifications_url":"https://api.github.com/repos/senica/riot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/senica/riot/labels{/name}","releases_url":"https://api.github.com/repos/senica/riot/releases{/id}","deployments_url":"https://api.github.com/repos/senica/riot/deployments","created_at":"2016-09-27T22:36:38Z","updated_at":"2016-09-27T22:36:39Z","pushed_at":"2016-09-29T17:46:27Z","git_url":"git://github.com/senica/riot.git","ssh_url":"git@github.com:senica/riot.git","clone_url":"https://github.com/senica/riot.git","svn_url":"https://github.com/senica/riot","homepage":"http://riotjs.com/","size":5358,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"riot:next","ref":"next","sha":"1113a888f442002c58ac268cef2e49b739458ed7","user":{"login":"riot","id":12729373,"avatar_url":"https://avatars.githubusercontent.com/u/12729373?v=3","gravatar_id":"","url":"https://api.github.com/users/riot","html_url":"https://github.com/riot","followers_url":"https://api.github.com/users/riot/followers","following_url":"https://api.github.com/users/riot/following{/other_user}","gists_url":"https://api.github.com/users/riot/gists{/gist_id}","starred_url":"https://api.github.com/users/riot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riot/subscriptions","organizations_url":"https://api.github.com/users/riot/orgs","repos_url":"https://api.github.com/users/riot/repos","events_url":"https://api.github.com/users/riot/events{/privacy}","received_events_url":"https://api.github.com/users/riot/received_events","type":"Organization","site_admin":false},"repo":{"id":13142126,"name":"riot","full_name":"riot/riot","owner":{"login":"riot","id":12729373,"avatar_url":"https://avatars.githubusercontent.com/u/12729373?v=3","gravatar_id":"","url":"https://api.github.com/users/riot","html_url":"https://github.com/riot","followers_url":"https://api.github.com/users/riot/followers","following_url":"https://api.github.com/users/riot/following{/other_user}","gists_url":"https://api.github.com/users/riot/gists{/gist_id}","starred_url":"https://api.github.com/users/riot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riot/subscriptions","organizations_url":"https://api.github.com/users/riot/orgs","repos_url":"https://api.github.com/users/riot/repos","events_url":"https://api.github.com/users/riot/events{/privacy}","received_events_url":"https://api.github.com/users/riot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/riot/riot","description":"A React-like, user interface library","fork":false,"url":"https://api.github.com/repos/riot/riot","forks_url":"https://api.github.com/repos/riot/riot/forks","keys_url":"https://api.github.com/repos/riot/riot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/riot/riot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/riot/riot/teams","hooks_url":"https://api.github.com/repos/riot/riot/hooks","issue_events_url":"https://api.github.com/repos/riot/riot/issues/events{/number}","events_url":"https://api.github.com/repos/riot/riot/events","assignees_url":"https://api.github.com/repos/riot/riot/assignees{/user}","branches_url":"https://api.github.com/repos/riot/riot/branches{/branch}","tags_url":"https://api.github.com/repos/riot/riot/tags","blobs_url":"https://api.github.com/repos/riot/riot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/riot/riot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/riot/riot/git/refs{/sha}","trees_url":"https://api.github.com/repos/riot/riot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/riot/riot/statuses/{sha}","languages_url":"https://api.github.com/repos/riot/riot/languages","stargazers_url":"https://api.github.com/repos/riot/riot/stargazers","contributors_url":"https://api.github.com/repos/riot/riot/contributors","subscribers_url":"https://api.github.com/repos/riot/riot/subscribers","subscription_url":"https://api.github.com/repos/riot/riot/subscription","commits_url":"https://api.github.com/repos/riot/riot/commits{/sha}","git_commits_url":"https://api.github.com/repos/riot/riot/git/commits{/sha}","comments_url":"https://api.github.com/repos/riot/riot/comments{/number}","issue_comment_url":"https://api.github.com/repos/riot/riot/issues/comments{/number}","contents_url":"https://api.github.com/repos/riot/riot/contents/{+path}","compare_url":"https://api.github.com/repos/riot/riot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/riot/riot/merges","archive_url":"https://api.github.com/repos/riot/riot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/riot/riot/downloads","issues_url":"https://api.github.com/repos/riot/riot/issues{/number}","pulls_url":"https://api.github.com/repos/riot/riot/pulls{/number}","milestones_url":"https://api.github.com/repos/riot/riot/milestones{/number}","notifications_url":"https://api.github.com/repos/riot/riot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/riot/riot/labels{/name}","releases_url":"https://api.github.com/repos/riot/riot/releases{/id}","deployments_url":"https://api.github.com/repos/riot/riot/deployments","created_at":"2013-09-27T05:21:01Z","updated_at":"2016-09-30T19:47:22Z","pushed_at":"2016-09-28T16:13:46Z","git_url":"git://github.com/riot/riot.git","ssh_url":"git@github.com:riot/riot.git","clone_url":"https://github.com/riot/riot.git","svn_url":"https://github.com/riot/riot","homepage":"http://riotjs.com/","size":8658,"stargazers_count":10578,"watchers_count":10578,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":869,"mirror_url":null,"open_issues_count":116,"forks":869,"open_issues":116,"watchers":10578,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/riot/riot/pulls/2004"},"html":{"href":"https://github.com/riot/riot/pull/2004"},"issue":{"href":"https://api.github.com/repos/riot/riot/issues/2004"},"comments":{"href":"https://api.github.com/repos/riot/riot/issues/2004/comments"},"review_comments":{"href":"https://api.github.com/repos/riot/riot/pulls/2004/comments"},"review_comment":{"href":"https://api.github.com/repos/riot/riot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/riot/riot/pulls/2004/commits"},"statuses":{"href":"https://api.github.com/repos/riot/riot/statuses/a46ed32b1c1103e60a48e42dc08f30a824f3011a"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":15,"review_comments":0,"commits":3,"additions":114,"deletions":49,"changed_files":4}}
{"actor":{"display_login":"senica"}}