{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/10077","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/10077/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/10077/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/10077/events","html_url":"https://github.com/facebook/react-native/pull/10077","id":178997713,"number":10077,"title":"Speeds up Android by avoiding event loop cycling with TextInput usage.","user":{"login":"mikelambert","id":7953259,"avatar_url":"https://avatars.githubusercontent.com/u/7953259?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelambert","html_url":"https://github.com/mikelambert","followers_url":"https://api.github.com/users/mikelambert/followers","following_url":"https://api.github.com/users/mikelambert/following{/other_user}","gists_url":"https://api.github.com/users/mikelambert/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelambert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelambert/subscriptions","organizations_url":"https://api.github.com/users/mikelambert/orgs","repos_url":"https://api.github.com/users/mikelambert/repos","events_url":"https://api.github.com/users/mikelambert/events{/privacy}","received_events_url":"https://api.github.com/users/mikelambert/received_events","type":"User","site_admin":false},"labels":[{"id":196858975,"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7","default":false},{"id":468774151,"url":"https://api.github.com/repos/facebook/react-native/labels/Core%20Team","name":"Core Team","color":"0052cc","default":false},{"id":172176599,"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"lacker","id":106475,"avatar_url":"https://avatars.githubusercontent.com/u/106475?v=3","gravatar_id":"","url":"https://api.github.com/users/lacker","html_url":"https://github.com/lacker","followers_url":"https://api.github.com/users/lacker/followers","following_url":"https://api.github.com/users/lacker/following{/other_user}","gists_url":"https://api.github.com/users/lacker/gists{/gist_id}","starred_url":"https://api.github.com/users/lacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacker/subscriptions","organizations_url":"https://api.github.com/users/lacker/orgs","repos_url":"https://api.github.com/users/lacker/repos","events_url":"https://api.github.com/users/lacker/events{/privacy}","received_events_url":"https://api.github.com/users/lacker/received_events","type":"User","site_admin":false},"assignees":[{"login":"lacker","id":106475,"avatar_url":"https://avatars.githubusercontent.com/u/106475?v=3","gravatar_id":"","url":"https://api.github.com/users/lacker","html_url":"https://github.com/lacker","followers_url":"https://api.github.com/users/lacker/followers","following_url":"https://api.github.com/users/lacker/following{/other_user}","gists_url":"https://api.github.com/users/lacker/gists{/gist_id}","starred_url":"https://api.github.com/users/lacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacker/subscriptions","organizations_url":"https://api.github.com/users/lacker/orgs","repos_url":"https://api.github.com/users/lacker/repos","events_url":"https://api.github.com/users/lacker/events{/privacy}","received_events_url":"https://api.github.com/users/lacker/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-09-24T00:10:52Z","updated_at":"2016-11-30T22:39:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/10077","html_url":"https://github.com/facebook/react-native/pull/10077","diff_url":"https://github.com/facebook/react-native/pull/10077.diff","patch_url":"https://github.com/facebook/react-native/pull/10077.patch"},"body":"This is obviously a bit of a strawman to start a discussion.\r\n\r\nWith this change, `TextInput._onChange` can be called and update `_lastNativeText` properly.\r\n\r\nWithout this change, it doesn't get updated. Which leaves the next `componentDidUpdate` to call `setNativeProps({text:...})` again unnecessarily, which (I believe) is triggering a re-layout, and triggering `componentDidUpdate`, leading to this cycling in the event loop that makes the Android app slower for me.\r\n\r\nThe question is, why don't we want the callbacks called when we update the text from JS? Because that's exactly what `TextInput._onChange` is expecting.\r\n\r\nI'm a bit unclear why calling `setNativeProps({text:...})` triggers another call to `componentDidUpdate`. I did a bunch of tracing and debugging and have a skeleton of who-calls-what I can share, if you're interested. But I'm pretty clueless on the layout logic stuff and suspect it's related to that somehow.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/264019582","html_url":"https://github.com/facebook/react-native/pull/10077#issuecomment-264019582","issue_url":"https://api.github.com/repos/facebook/react-native/issues/10077","id":264019582,"user":{"login":"lacker","id":106475,"avatar_url":"https://avatars.githubusercontent.com/u/106475?v=3","gravatar_id":"","url":"https://api.github.com/users/lacker","html_url":"https://github.com/lacker","followers_url":"https://api.github.com/users/lacker/followers","following_url":"https://api.github.com/users/lacker/following{/other_user}","gists_url":"https://api.github.com/users/lacker/gists{/gist_id}","starred_url":"https://api.github.com/users/lacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacker/subscriptions","organizations_url":"https://api.github.com/users/lacker/orgs","repos_url":"https://api.github.com/users/lacker/repos","events_url":"https://api.github.com/users/lacker/events{/privacy}","received_events_url":"https://api.github.com/users/lacker/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T22:39:51Z","updated_at":"2016-11-30T22:39:51Z","body":"So this pull request is basically just turning off the `mIsSettingTextFromJS` flag entirely, right? You are commenting it out in one place but that seems like it will just stop having its effect.\r\n\r\nFrom higher in the file:\r\n\r\n      // This flag is set to true when we set the text of the EditText explicitly. In that case, no\r\n      // *TextChanged events should be triggered. This is less expensive than removing the text\r\n      // listeners and adding them back again after the text change is completed.\r\n\r\nSo to me it sounds like, the goal is to *not* trigger these events when we are explicitly setting text, and the current behavior is working as intended."}}
{"actor":{"display_login":"lacker"}}