{"action":"created","issue":{"url":"https://api.github.com/repos/hypothesis/h/issues/2809","labels_url":"https://api.github.com/repos/hypothesis/h/issues/2809/labels{/name}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/2809/comments","events_url":"https://api.github.com/repos/hypothesis/h/issues/2809/events","html_url":"https://github.com/hypothesis/h/pull/2809","id":122721314,"number":2809,"title":"Use Angular 1.3.x+ one-time bindings","user":{"login":"robertknight","id":2458,"avatar_url":"https://avatars.githubusercontent.com/u/2458?v=3","gravatar_id":"","url":"https://api.github.com/users/robertknight","html_url":"https://github.com/robertknight","followers_url":"https://api.github.com/users/robertknight/followers","following_url":"https://api.github.com/users/robertknight/following{/other_user}","gists_url":"https://api.github.com/users/robertknight/gists{/gist_id}","starred_url":"https://api.github.com/users/robertknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertknight/subscriptions","organizations_url":"https://api.github.com/users/robertknight/orgs","repos_url":"https://api.github.com/users/robertknight/repos","events_url":"https://api.github.com/users/robertknight/events{/privacy}","received_events_url":"https://api.github.com/users/robertknight/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T11:56:18Z","updated_at":"2015-12-18T12:40:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/2809","html_url":"https://github.com/hypothesis/h/pull/2809","diff_url":"https://github.com/hypothesis/h/pull/2809.diff","patch_url":"https://github.com/hypothesis/h/pull/2809.patch"},"body":"Since the upgrade to Angular 1.4.x, we have a new facility available to us to reduce the number of watches created by expressions in templates. Prefixing an expression with `::` causes it to be evaluated only once and the watch is removed thereafter.\r\n\r\nThis PR uses '::' for a bunch of expressions which do not change during the lifetime of the app (eg. `isSidebar`) or an annotation card (eg. the annotation quote).\r\n\r\nIn combination with https://github.com/hypothesis/h/pull/2808 this reduces the length of a typical `$digest` cycle in the default view of the `/stream` from ~30ms to ~20ms and the number of watches from ~1690 to ~1530.\r\n\r\nLonger term we could do much better by taking advantage of the fact that the majority of expressions in an annotation card can only change when the annotation data itself is modified, which never happens for the majority of annotations. This PR is a quick and easy win though."},"comment":{"url":"https://api.github.com/repos/hypothesis/h/issues/comments/165769126","html_url":"https://github.com/hypothesis/h/pull/2809#issuecomment-165769126","issue_url":"https://api.github.com/repos/hypothesis/h/issues/2809","id":165769126,"user":{"login":"seanh","id":22498,"avatar_url":"https://avatars.githubusercontent.com/u/22498?v=3","gravatar_id":"","url":"https://api.github.com/users/seanh","html_url":"https://github.com/seanh","followers_url":"https://api.github.com/users/seanh/followers","following_url":"https://api.github.com/users/seanh/following{/other_user}","gists_url":"https://api.github.com/users/seanh/gists{/gist_id}","starred_url":"https://api.github.com/users/seanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanh/subscriptions","organizations_url":"https://api.github.com/users/seanh/orgs","repos_url":"https://api.github.com/users/seanh/repos","events_url":"https://api.github.com/users/seanh/events{/privacy}","received_events_url":"https://api.github.com/users/seanh/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T12:40:57Z","updated_at":"2015-12-18T12:40:57Z","body":"On a quick look, I think `vm.form` and `vm.group()` are not safe to do this to.\r\n\r\nWhat are all the things that a user (either the current user, or someone simultaneously using a different client) can edit?\r\n\r\nI think it's group, permissions/isPrivate, text and tags.\r\n\r\nSo none of those are ever safe to do this to, I think.\r\n\r\nFor example you might think that group can only ever change for new annotations not saved to the server yet, which I think is true so far, but I wouldn't be surprised if we end up enabling moving saved annotations between groups at some point.\r\n\r\nText, tags and perms can always change because of live update unfortunately."}}