{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5995","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5995/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5995/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5995/events","html_url":"https://github.com/Automattic/wp-calypso/pull/5995","id":160019627,"number":5995,"title":"CPT: Infinitely render CPTs using ReactVirtualized","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Custom%20Post%20Types%20(CPT)","name":"Custom Post Types (CPT)","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Posts","name":"Posts","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-13T18:53:17Z","updated_at":"2016-06-17T15:37:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/5995","html_url":"https://github.com/Automattic/wp-calypso/pull/5995","diff_url":"https://github.com/Automattic/wp-calypso/pull/5995.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/5995.patch"},"body":"Supersedes #5007\r\n\r\nThis pull request seeks to implement infinite scroll for the custom post types listing screen.\r\n\r\n__Implementation notes:__\r\n\r\nThis takes a unique approach to loading more items. Rather than triggering a request based on the scroll approaching the next page, it leverages [ReactVirtualized's `onRowsRendered` callback](https://github.com/bvaughn/react-virtualized/blob/master/docs/VirtualScroll.md) to determine which pages should be requested for the query dependent on which rows are currently rendered. The reason for this change is to accommodate persistence of posts queries state, which is not currently persisted. Once persisted, we need a mechanism to responsibly refresh all of the persisted data. In the context of having persisted post entries, traditional \"needs more items so fetch\" logic does not work well, and naively re-requesting all persisted posts could incur huge network costs if tens of pages had been loaded during the last session.\r\n\r\nThis pull request also upgrades ReactVirtualized to 7.5.0 to make use of the `WindowScroller` HOC ([see release notes](https://github.com/bvaughn/react-virtualized/blob/master/CHANGELOG.md#750)).\r\n\r\n__Testing instructions:__\r\n\r\nVerify that all posts are revealed on the custom post types list screen, requested 20 at a time infinitely until the last known page. When changing filters, note that the same behavior applies to the new filter.\r\n\r\n1. Navigate to [My Sites](http://calypso.localhost:3000/stats/insights)\r\n2. Select a site where at least one custom post type is enabled\r\n3. Choose the custom post type navigation link in the sidebar\r\n4. Note that a loading placeholder or, if persisted state exists, the past results are immediately shown\r\n5. Note that posts are revealed ten at a time\r\n6. Note that as you scroll, more posts are loaded until all pages have been exhausted\r\n\r\n/cc @timmyc \n\nTest live: https://calypso.live/?branch=update/cpt-infinite-list-2"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/226803145","html_url":"https://github.com/Automattic/wp-calypso/pull/5995#issuecomment-226803145","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/5995","id":226803145,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T15:37:27Z","updated_at":"2016-06-17T15:37:27Z","body":"Not sure if you experienced this yourself @timmyc, but I felt the scrolling was not very smooth here. I dug a bit deeper and it may be at least partly attributable to `react-virtualized`. I opened an issue at bvaughn/react-virtualized#281 ."}}
{"actor":{"display_login":"aduth"}}