{"action":"created","issue":{"url":"https://api.github.com/repos/aFarkas/lazysizes/issues/263","repository_url":"https://api.github.com/repos/aFarkas/lazysizes","labels_url":"https://api.github.com/repos/aFarkas/lazysizes/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/aFarkas/lazysizes/issues/263/comments","events_url":"https://api.github.com/repos/aFarkas/lazysizes/issues/263/events","html_url":"https://github.com/aFarkas/lazysizes/issues/263","id":152190533,"number":263,"title":"Use IntersectionObserver","user":{"login":"triblondon","id":1735391,"avatar_url":"https://avatars.githubusercontent.com/u/1735391?v=3","gravatar_id":"","url":"https://api.github.com/users/triblondon","html_url":"https://github.com/triblondon","followers_url":"https://api.github.com/users/triblondon/followers","following_url":"https://api.github.com/users/triblondon/following{/other_user}","gists_url":"https://api.github.com/users/triblondon/gists{/gist_id}","starred_url":"https://api.github.com/users/triblondon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triblondon/subscriptions","organizations_url":"https://api.github.com/users/triblondon/orgs","repos_url":"https://api.github.com/users/triblondon/repos","events_url":"https://api.github.com/users/triblondon/events{/privacy}","received_events_url":"https://api.github.com/users/triblondon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-05-01T09:26:45Z","updated_at":"2016-08-04T05:19:05Z","closed_at":null,"body":"This is a fantastic tool and really positive for the performance of the web.  I'd love to see this using [IntersectionObserver](https://github.com/WICG/IntersectionObserver/blob/gh-pages/explainer.md) to compute the intersection of the viewport and the lazyload elements, which will avoid the need to use a scroll handler in browsers that offer support for IntersectionObserver.\r\n\r\nI'm currently working on adding an [IntersectionObserver polyfill](https://github.com/WICG/IntersectionObserver/pull/121) to the [polyfill service](https://cdn.polyfill.io), which will provide IO support on all the browsers you support for lazySizes, so a nice-to-have would be a version of lazysizes that *relies* on IO with no onscroll fallback, on the basis that it can be polyfilled where needed."},"comment":{"url":"https://api.github.com/repos/aFarkas/lazysizes/issues/comments/237455179","html_url":"https://github.com/aFarkas/lazysizes/issues/263#issuecomment-237455179","issue_url":"https://api.github.com/repos/aFarkas/lazysizes/issues/263","id":237455179,"user":{"login":"aFarkas","id":188254,"avatar_url":"https://avatars.githubusercontent.com/u/188254?v=3","gravatar_id":"","url":"https://api.github.com/users/aFarkas","html_url":"https://github.com/aFarkas","followers_url":"https://api.github.com/users/aFarkas/followers","following_url":"https://api.github.com/users/aFarkas/following{/other_user}","gists_url":"https://api.github.com/users/aFarkas/gists{/gist_id}","starred_url":"https://api.github.com/users/aFarkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aFarkas/subscriptions","organizations_url":"https://api.github.com/users/aFarkas/orgs","repos_url":"https://api.github.com/users/aFarkas/repos","events_url":"https://api.github.com/users/aFarkas/events{/privacy}","received_events_url":"https://api.github.com/users/aFarkas/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T05:19:05Z","updated_at":"2016-08-04T05:19:05Z","body":"I already have a began to write a version based on IntersectionObserver. In most cases it will make sense to use it, if you are already using a IntersectionObserver polyfill or if you target only browser, which do support IntersectionObserver.\r\n\r\nSome notes:\r\n\r\n> The big performance win with using the native IntersectionObserver here would be avoiding both polling, MutationObservers and listening to all these events. \r\n\r\nIntersectionObserver won't help to ditch a MutationObserver because you will need to add new elements to the IntersectionObserver.\r\n\r\n> I expect that on the vast majority of pages it will be considerably more performant.\r\n\r\nLazysizes without IntersectionObserver already works with 60fps on the vast majority of pages. This can't be beaten by an even more performant implementation."}}
{"actor":{"display_login":"aFarkas"}}