{"action":"created","issue":{"url":"https://api.github.com/repos/levand/quiescent/issues/35","labels_url":"https://api.github.com/repos/levand/quiescent/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/levand/quiescent/issues/35/comments","events_url":"https://api.github.com/repos/levand/quiescent/issues/35/events","html_url":"https://github.com/levand/quiescent/issues/35","id":44568678,"number":35,"title":"Idea: Implement shouldComponentUpdate using a protocol (DataScript compatibility)","user":{"login":"Peeja","id":2407,"avatar_url":"https://avatars.githubusercontent.com/u/2407?v=3","gravatar_id":"","url":"https://api.github.com/users/Peeja","html_url":"https://github.com/Peeja","followers_url":"https://api.github.com/users/Peeja/followers","following_url":"https://api.github.com/users/Peeja/following{/other_user}","gists_url":"https://api.github.com/users/Peeja/gists{/gist_id}","starred_url":"https://api.github.com/users/Peeja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Peeja/subscriptions","organizations_url":"https://api.github.com/users/Peeja/orgs","repos_url":"https://api.github.com/users/Peeja/repos","events_url":"https://api.github.com/users/Peeja/events{/privacy}","received_events_url":"https://api.github.com/users/Peeja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-01T14:20:36Z","updated_at":"2015-01-04T12:09:40Z","closed_at":null,"body":"Quiescent has trouble handling DataScript databases as values, because checking their equality is non-trivial, and forces a bunch of normally-lazy evaluation. But Quiescent doesn't need to know for *certain* that the value has changed, it just needs to know if the value *might* have changed.\r\n\r\nI'd like to have `shouldComponentUpdate` use, instead of `not=`, a protocol function which tells us whether the value is definitely the same or possibly different, in some efficient way. The default implementation would use `not=`; DataScript DBs could override that to check, say, whether the new DB has seen any new transactions since the old one. If it has, the values inside *might* still be the same if we check them, but it's faster to say they might be different and let the component re-render.\r\n\r\nI'm happy to do the work and PR it, but I wanted to get your thoughts on the idea first.\r\n\r\n([This conversation that gave me the idea.](https://github.com/tonsky/datascript-chat/commit/4e8438120a9d44b64de64d919ef105983b7cb8fb#commitcomment-7996303))"},"comment":{"url":"https://api.github.com/repos/levand/quiescent/issues/comments/68630697","html_url":"https://github.com/levand/quiescent/issues/35#issuecomment-68630697","issue_url":"https://api.github.com/repos/levand/quiescent/issues/35","id":68630697,"user":{"login":"ticking","id":260449,"avatar_url":"https://avatars.githubusercontent.com/u/260449?v=3","gravatar_id":"","url":"https://api.github.com/users/ticking","html_url":"https://github.com/ticking","followers_url":"https://api.github.com/users/ticking/followers","following_url":"https://api.github.com/users/ticking/following{/other_user}","gists_url":"https://api.github.com/users/ticking/gists{/gist_id}","starred_url":"https://api.github.com/users/ticking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticking/subscriptions","organizations_url":"https://api.github.com/users/ticking/orgs","repos_url":"https://api.github.com/users/ticking/repos","events_url":"https://api.github.com/users/ticking/events{/privacy}","received_events_url":"https://api.github.com/users/ticking/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T12:09:40Z","updated_at":"2015-01-04T12:09:40Z","body":"Most paper call the diff generation \"incremental view maintainance\", the Idea is that you take the queries that define a view and rewrite them in such a way that they are of the form ((old-qresult U (q' old-db delta-added)) / (q' old-db delta-removed))\r\nWhich means that if you have, say, a join operation it will be bounded by |tx| * |db| instead of |db|^2, which will be significantly smaller with a high probability.\r\n\r\nIf you make rendering dependent on the change of these views. You neither crawl the entire database, nor do you have to update when something changes that does not change the query."}}