{"action":"created","issue":{"url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/445","repository_url":"https://api.github.com/repos/onfido/onfido-sdk-ui","labels_url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/445/labels{/name}","comments_url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/445/comments","events_url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/445/events","html_url":"https://github.com/onfido/onfido-sdk-ui/pull/445","id":356879416,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMDI5NDU3","number":445,"title":"Remove capture ancestor cx 2392","user":{"login":"elhesuu","id":1504258,"node_id":"MDQ6VXNlcjE1MDQyNTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1504258?v=4","gravatar_id":"","url":"https://api.github.com/users/elhesuu","html_url":"https://github.com/elhesuu","followers_url":"https://api.github.com/users/elhesuu/followers","following_url":"https://api.github.com/users/elhesuu/following{/other_user}","gists_url":"https://api.github.com/users/elhesuu/gists{/gist_id}","starred_url":"https://api.github.com/users/elhesuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elhesuu/subscriptions","organizations_url":"https://api.github.com/users/elhesuu/orgs","repos_url":"https://api.github.com/users/elhesuu/repos","events_url":"https://api.github.com/users/elhesuu/events{/privacy}","received_events_url":"https://api.github.com/users/elhesuu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":33,"created_at":"2018-09-04T16:07:19Z","updated_at":"2018-09-13T16:01:49Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/onfido/onfido-sdk-ui/pulls/445","html_url":"https://github.com/onfido/onfido-sdk-ui/pull/445","diff_url":"https://github.com/onfido/onfido-sdk-ui/pull/445.diff","patch_url":"https://github.com/onfido/onfido-sdk-ui/pull/445.patch"},"body":"# Problem\r\nUpdating `capture` has become increasingly complex as the application has evolved with additional functionality. \r\n\r\nImplementation details are defined in a much higher abstraction layer than needed, making it really hard to reason about the application flow.\r\n\r\n# Solution\r\nOriginally I was set to remove `Capture` from the `Photo` and `Liveness` ancestor chain only, and refactor their implementations into simpler components.\r\n\r\nBut seeing how closely related `AutoCapture` (and the `Capture` component was) I ended up looking for a simpler approach for all three components, as leaving `AutoCapture` untouched would surely have been more a problem than a solution.\r\n\r\nThe general idea was making components as simple as possible, trying to avoid controlling distantly nested children via prop drilling, or with the `<Child {...this.props} />` pattern, breaking encapsulation between components.\r\n\r\nAs a result, some components are more concrete than before, and by removing that abstraction we can get rid the accidental complexity described above.\r\n\r\nEven though I tried to make as few changes as possible, I always had in mind that the goal was making components as simple to understand as possible, and because of this changes ended up being quite substantial, perhaps much more than I originally expected.\r\n\r\nHaving said that, I am happy with the result, and I would really like to hear your thoughts.\r\n\r\n## Checklist\r\n_put `n/a` if item is not relevant to PR changes_\r\n\r\n- [n/a] Have the CHANGELOG, README, MIGRATION, RELEASE_GUIDELINES docs been updated?\r\n- [n/a] Have new automated tests been implemented?\r\n- [n/a] Have new manual tests been written down?\r\n- [x] Have tests passed locally?\r\n- [n/a] Have any new strings been translated?\r\n"},"comment":{"url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/comments/421060327","html_url":"https://github.com/onfido/onfido-sdk-ui/pull/445#issuecomment-421060327","issue_url":"https://api.github.com/repos/onfido/onfido-sdk-ui/issues/445","id":421060327,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTA2MDMyNw==","user":{"login":"rfreitas","id":651348,"node_id":"MDQ6VXNlcjY1MTM0OA==","avatar_url":"https://avatars3.githubusercontent.com/u/651348?v=4","gravatar_id":"","url":"https://api.github.com/users/rfreitas","html_url":"https://github.com/rfreitas","followers_url":"https://api.github.com/users/rfreitas/followers","following_url":"https://api.github.com/users/rfreitas/following{/other_user}","gists_url":"https://api.github.com/users/rfreitas/gists{/gist_id}","starred_url":"https://api.github.com/users/rfreitas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfreitas/subscriptions","organizations_url":"https://api.github.com/users/rfreitas/orgs","repos_url":"https://api.github.com/users/rfreitas/repos","events_url":"https://api.github.com/users/rfreitas/events{/privacy}","received_events_url":"https://api.github.com/users/rfreitas/received_events","type":"User","site_admin":false},"created_at":"2018-09-13T16:01:49Z","updated_at":"2018-09-13T16:01:49Z","author_association":"CONTRIBUTOR","body":"Travis automatic deployment: https://staging-445-pr-onfido-sdk-ui-onfido.surge.sh"}}
{"actor":{"display_login":"rfreitas"}}