{"action":"created","issue":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/197","labels_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/197/comments","events_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/197/events","html_url":"https://github.com/Matt-Esch/virtual-dom/pull/197","id":58555081,"number":197,"title":"Rewrite reorder","user":{"login":"Matt-Esch","id":1058839,"avatar_url":"https://avatars.githubusercontent.com/u/1058839?v=3","gravatar_id":"","url":"https://api.github.com/users/Matt-Esch","html_url":"https://github.com/Matt-Esch","followers_url":"https://api.github.com/users/Matt-Esch/followers","following_url":"https://api.github.com/users/Matt-Esch/following{/other_user}","gists_url":"https://api.github.com/users/Matt-Esch/gists{/gist_id}","starred_url":"https://api.github.com/users/Matt-Esch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matt-Esch/subscriptions","organizations_url":"https://api.github.com/users/Matt-Esch/orgs","repos_url":"https://api.github.com/users/Matt-Esch/repos","events_url":"https://api.github.com/users/Matt-Esch/events{/privacy}","received_events_url":"https://api.github.com/users/Matt-Esch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-02-23T08:07:19Z","updated_at":"2015-03-01T04:51:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/pulls/197","html_url":"https://github.com/Matt-Esch/virtual-dom/pull/197","diff_url":"https://github.com/Matt-Esch/virtual-dom/pull/197.diff","patch_url":"https://github.com/Matt-Esch/virtual-dom/pull/197.patch"},"body":"I have decided the reordering logic needs to be rewritten. I effectively take a bubble sort style approach to get the nodes in the correct shape. The offset counting is very error prone and difficult to debug so I've avoided that where possible.\r\n\r\nAs an extension to this, I would like to extend the capability of virtual-dom to insert at an index. Currently we use the `diff(null, newVnode)` feature to create the inserts. I would like to avoid inserting the items at the end and insert all new items at the correct index at creation time.\r\n\r\nHaving better insert semantics will remove all re-order overhead for inserts. We really need some benchmarks for this. I am interested to see how more or less efficient this becomes."},"comment":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/comments/76574246","html_url":"https://github.com/Matt-Esch/virtual-dom/pull/197#issuecomment-76574246","issue_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/197","id":76574246,"user":{"login":"neonstalwart","id":84763,"avatar_url":"https://avatars.githubusercontent.com/u/84763?v=3","gravatar_id":"","url":"https://api.github.com/users/neonstalwart","html_url":"https://github.com/neonstalwart","followers_url":"https://api.github.com/users/neonstalwart/followers","following_url":"https://api.github.com/users/neonstalwart/following{/other_user}","gists_url":"https://api.github.com/users/neonstalwart/gists{/gist_id}","starred_url":"https://api.github.com/users/neonstalwart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neonstalwart/subscriptions","organizations_url":"https://api.github.com/users/neonstalwart/orgs","repos_url":"https://api.github.com/users/neonstalwart/repos","events_url":"https://api.github.com/users/neonstalwart/events{/privacy}","received_events_url":"https://api.github.com/users/neonstalwart/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T04:51:07Z","updated_at":"2015-03-01T04:51:07Z","body":"I changed my mind. the first phase of the diff has to be left to right in order to determine if a node is out of position. "}}