{"action":"created","issue":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/75","labels_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/75/comments","events_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/75/events","html_url":"https://github.com/Matt-Esch/virtual-dom/issues/75","id":33812229,"number":75,"title":"Hook execution guarantees","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":4,"created_at":"2014-05-19T15:53:39Z","updated_at":"2015-10-08T19:49:29Z","closed_at":null,"body":"Some work is required to ensure that hooks execute on consistent assumptions for inserts. If a new subtree is created and inserted, ideally the hooks are executed after the node has been inserted in the DOM. This means that the render process is a DOM renderer followed by an hook patch operation.\r\n\r\nIdeally we would also be able to apply the same strategy to the root node, so it would appear that the vdom render function should return a root node and a set of patch ops for hook execution. Either this or we provide the render function with a mounting function so that we can internally apply the hooks post-mount.\r\n\r\nInterested to hear your thoughts on this."},"comment":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/comments/146667641","html_url":"https://github.com/Matt-Esch/virtual-dom/issues/75#issuecomment-146667641","issue_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/75","id":146667641,"user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T19:49:29Z","updated_at":"2015-10-08T19:49:29Z","body":"I think assumption that hooks should execute before or after node has being inserted into node is invalid. I think some hooks may run before node is in the tree while others after they are in the tree. I've being actually struggling with reacts `componentMounted / componentDidUpdate` hook a lot because in project I'm working on we depend on some non standard attributes / properties that need to be set before node is in tree or they ignored, while there are some other attributes / properties that throw if you try the set before node is in the tree.\r\n\r\nI would very much liked if virtual-dom allowed me to do things before and after node is the tree vs one or the other."}}