{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/8569","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/8569/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/8569/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/8569/events","html_url":"https://github.com/facebook/react-native/pull/8569","id":163756349,"number":8569,"title":"Initial implementation of requestIdleCallback on Android","user":{"login":"janicduplessis","id":2677334,"avatar_url":"https://avatars.githubusercontent.com/u/2677334?v=3","gravatar_id":"","url":"https://api.github.com/users/janicduplessis","html_url":"https://github.com/janicduplessis","followers_url":"https://api.github.com/users/janicduplessis/followers","following_url":"https://api.github.com/users/janicduplessis/following{/other_user}","gists_url":"https://api.github.com/users/janicduplessis/gists{/gist_id}","starred_url":"https://api.github.com/users/janicduplessis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janicduplessis/subscriptions","organizations_url":"https://api.github.com/users/janicduplessis/orgs","repos_url":"https://api.github.com/users/janicduplessis/repos","events_url":"https://api.github.com/users/janicduplessis/events{/privacy}","received_events_url":"https://api.github.com/users/janicduplessis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-05T01:15:01Z","updated_at":"2016-07-05T18:51:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/8569","html_url":"https://github.com/facebook/react-native/pull/8569","diff_url":"https://github.com/facebook/react-native/pull/8569.diff","patch_url":"https://github.com/facebook/react-native/pull/8569.patch"},"body":"This is a follow up of the work by @brentvatne in #5052. This addresses the feedback by @astreet.\r\n\r\n- Uses ReactChoreographer with a new callback type\r\n- Callback dispatch logic moved to JS\r\n- Only calls into JS when needed, when there are pending callbacks, it even removes the Choreographer listener when no JS context listen for idle events.\r\n\r\n** Test plan **\r\nTested by running a background task that burns all remaining idle time (see new UIExplorer example) and made sure that UI and JS fps stayed near 60 on a real device (Nexus 6) with dev mode disabled. Also tried adding a JS driven animation and it stayed smooth.\r\n\r\nTested that native only calls into JS when there are pending idle callbacks.\r\n\r\nAlso tested that timers are executed before idle callback.\r\n```\r\nrequestIdleCallback(() => console.log(1));\r\nsetTimeout(() => console.log(2), 100);\r\nburnCPU(1000);\r\n// 2\r\n// 1\r\n```\r\n\r\nI did *not* test with webworkers but it should work as I'm using executor tokens."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/230568357","html_url":"https://github.com/facebook/react-native/pull/8569#issuecomment-230568357","issue_url":"https://api.github.com/repos/facebook/react-native/issues/8569","id":230568357,"user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T18:51:25Z","updated_at":"2016-07-05T18:51:25Z","body":"> This assumes that frames are 17ms long, maybe we could get this value from the display refresh rate.\r\n\r\nThis would be nice to have in the future, where I can see us dropping the frame rate from 60fps to 30fps intentionally when we discover that the device cannot handle the current workload. This is what Chrome does for example."}}
{"actor":{"display_login":"ide"}}