{"action":"created","issue":{"url":"https://api.github.com/repos/bitovi/canjs/issues/2020","labels_url":"https://api.github.com/repos/bitovi/canjs/issues/2020/labels{/name}","comments_url":"https://api.github.com/repos/bitovi/canjs/issues/2020/comments","events_url":"https://api.github.com/repos/bitovi/canjs/issues/2020/events","html_url":"https://github.com/bitovi/canjs/issues/2020","id":113098987,"number":2020,"title":"New bindings updating the scope when created","user":{"login":"dylanrtt","id":11302736,"avatar_url":"https://avatars.githubusercontent.com/u/11302736?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanrtt","html_url":"https://github.com/dylanrtt","followers_url":"https://api.github.com/users/dylanrtt/followers","following_url":"https://api.github.com/users/dylanrtt/following{/other_user}","gists_url":"https://api.github.com/users/dylanrtt/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanrtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanrtt/subscriptions","organizations_url":"https://api.github.com/users/dylanrtt/orgs","repos_url":"https://api.github.com/users/dylanrtt/repos","events_url":"https://api.github.com/users/dylanrtt/events{/privacy}","received_events_url":"https://api.github.com/users/dylanrtt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-23T20:56:42Z","updated_at":"2015-10-24T17:12:54Z","closed_at":null,"body":"With the recent changes to how bindings work, there has been a new addition which allows an element (e.g., form control, component) to update the scope if the element has a value and the scope does not (with 2-way bindings). This happens on [bindings.js#L539](https://github.com/bitovi/canjs/blob/4451caf880f7fbd183f5f86c354217baa5abb459/view/bindings/bindings.js#L539) when the binding is created.\r\n\r\nPerhaps someone can explain to me why this feature needs to exist because I ran into some issues with it today. For a while now, it has seemed like the scope (or parent scope) is the absolute source of truth. However, with these new rules, it is less clear. Now whoever has a value first wins.\r\n\r\nIn #1834, I explained a bit about why I think this is a bad idea. It totally violates top->down data flow and opens up a whole new can of potential debugging nightmares. In the case of select elements, I explained how the form control can be changed to accurately reflect the scope. For other form elements, I don't see how this feature would be seen as necessary.\r\n\r\nEspecially in the case of components, I question whether a child should be updating the parent scope with `two-way=\"{bindings}\"` if the parent doesn't have a value. Framework users could run into upgrade issues with this behavior changing in `2.3.0`. Perhaps they didn't even want 2-way binding in the first place but there was no other way to pass down an object or something. What if the parent is setting a value async and the child has a default... that could have unexpected consequences.\r\n\r\nI'm not sure how much thought and discussion was put into making this change but I think this feature should still be on the table."},"comment":{"url":"https://api.github.com/repos/bitovi/canjs/issues/comments/150834777","html_url":"https://github.com/bitovi/canjs/issues/2020#issuecomment-150834777","issue_url":"https://api.github.com/repos/bitovi/canjs/issues/2020","id":150834777,"user":{"login":"justinbmeyer","id":78602,"avatar_url":"https://avatars.githubusercontent.com/u/78602?v=3","gravatar_id":"","url":"https://api.github.com/users/justinbmeyer","html_url":"https://github.com/justinbmeyer","followers_url":"https://api.github.com/users/justinbmeyer/followers","following_url":"https://api.github.com/users/justinbmeyer/following{/other_user}","gists_url":"https://api.github.com/users/justinbmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/justinbmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinbmeyer/subscriptions","organizations_url":"https://api.github.com/users/justinbmeyer/orgs","repos_url":"https://api.github.com/users/justinbmeyer/repos","events_url":"https://api.github.com/users/justinbmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/justinbmeyer/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T17:12:54Z","updated_at":"2015-10-24T17:12:54Z","body":"One more thing ... hopefully final ...\r\n\r\nI think what could help a lot is breaking up CanJS into individual projects.  If you could have different versions of `can.Component` and `can.stache`, it's probable you could upgrade one for bug fixes without the other.  \r\n\r\nThis way bug fixes wouldn't have to be bundled with feature or breaking changes.  \r\n\r\nI think it's possible to still have a core \"can\" that includes certain versions of things ... similar to what we are going to do with DoneJS.  But for advanced people ... this means we could probably get new releases and fixes out much much faster."}}