{"action":"created","comment":{"url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/comments/241745632","pull_request_review_id":185093949,"id":241745632,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTc0NTYzMg==","diff_hunk":"@@ -0,0 +1,30 @@\n+# Idea\n+\n+Refactor the app, use newer dependencies, improve code quality\n+\n+# Motivation\n+\n+Currently there are some things in the project which make working with it a bit too hard. The project structure could be better, the routing could be better, we could use the latest react-router and react and that could help a lot.\n+\n+\n+# Proposal\n+\n+- update dependencies: react-router 4 instead of 3, React 16 instead of 15\n+\n+Basically the routing in react-router 4 is more handy and allows to work with it with less effort. As for React 16, there are some useful things - for example, `<Fragment />` component, it can be used to avoid wrapping multiple JSX elements in the unnecessary `<div />`. Also there are new lifecycle methods in React 16, and the React team works on the optimisation, so this can be useful.\n+\n+- update routing\n+\n+Currently the routing breaks DRY principle. There are just a lot of repeated things in each route. This appearance makes code hard to read and understand. Also if we need to add a new route, we have to repeat all these previously repeated things for a new route too.\n+\n+- use Mobx Provider in a proper way\n+\n+We don't have a possibility to access store or actions from any component without it's own route. That's because there are no Provider wrapping the routes, only the IntlProvider, so we can see the current locale etc, but nothing more. Unfortunately, we can have some cases when we want to see store from the deeply nested component. As for now, this primitive thing requires a lot of repeated code, and more unnecessary code can accidentally bring more bugs. Also it's harder to maintain the project, to fix bugs or implement more features, and it would be so much heavier to new team members (if some) to understand the code.\n+\n+- fix the structure\n+\n+For now, the MainLayout component is used in most containers - they return the content wrapped in the MainLayout, and it happens in most cases. We could just wrap the routing in the MainLayout so we will achieve the same result but without breaking DRY principle. Again, for now it's a lot of really unnecessary code, with all it's cons. There can be some more issues with the structure, but this one is probably the main one.\n+\n+- additional: switch from Mobx to Redux\n+\n+Need to check if Redux has something to work with Intl, and if it does, we can use it - probably with Redux-sagas, which have a very neat syntax, very easy to test and which simplify a lot working with async actions and other side effects.","path":"docs/specs/code/REFACTOR_PROPOSAL.md","position":30,"original_position":30,"commit_id":"004f15a7e4fdd52ca9bb47f970536f4958059a0f","original_commit_id":"004f15a7e4fdd52ca9bb47f970536f4958059a0f","user":{"login":"SebastienGllmt","id":2608559,"node_id":"MDQ6VXNlcjI2MDg1NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/2608559?v=4","gravatar_id":"","url":"https://api.github.com/users/SebastienGllmt","html_url":"https://github.com/SebastienGllmt","followers_url":"https://api.github.com/users/SebastienGllmt/followers","following_url":"https://api.github.com/users/SebastienGllmt/following{/other_user}","gists_url":"https://api.github.com/users/SebastienGllmt/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastienGllmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastienGllmt/subscriptions","organizations_url":"https://api.github.com/users/SebastienGllmt/orgs","repos_url":"https://api.github.com/users/SebastienGllmt/repos","events_url":"https://api.github.com/users/SebastienGllmt/events{/privacy}","received_events_url":"https://api.github.com/users/SebastienGllmt/received_events","type":"User","site_admin":false},"body":"This one would be a lot more work than the others so probably requires more thought and analysis if we really want to go for it. If we really want to look into this I think we should get least @sarveshwar-singh or somebody else to look into it together and then make the case during one of our Tuesday meetings.","created_at":"2018-12-14T12:55:26Z","updated_at":"2018-12-14T12:57:29Z","html_url":"https://github.com/Emurgo/yoroi-frontend/pull/168#discussion_r241745632","pull_request_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/comments/241745632"},"html":{"href":"https://github.com/Emurgo/yoroi-frontend/pull/168#discussion_r241745632"},"pull_request":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168","id":238082026,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MDgyMDI2","html_url":"https://github.com/Emurgo/yoroi-frontend/pull/168","diff_url":"https://github.com/Emurgo/yoroi-frontend/pull/168.diff","patch_url":"https://github.com/Emurgo/yoroi-frontend/pull/168.patch","issue_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/168","number":168,"state":"open","locked":false,"title":"Spec/refactor","user":{"login":"JizKadasha","id":28668974,"node_id":"MDQ6VXNlcjI4NjY4OTc0","avatar_url":"https://avatars1.githubusercontent.com/u/28668974?v=4","gravatar_id":"","url":"https://api.github.com/users/JizKadasha","html_url":"https://github.com/JizKadasha","followers_url":"https://api.github.com/users/JizKadasha/followers","following_url":"https://api.github.com/users/JizKadasha/following{/other_user}","gists_url":"https://api.github.com/users/JizKadasha/gists{/gist_id}","starred_url":"https://api.github.com/users/JizKadasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JizKadasha/subscriptions","organizations_url":"https://api.github.com/users/JizKadasha/orgs","repos_url":"https://api.github.com/users/JizKadasha/repos","events_url":"https://api.github.com/users/JizKadasha/events{/privacy}","received_events_url":"https://api.github.com/users/JizKadasha/received_events","type":"User","site_admin":false},"body":"A refactor proposal which describes the basic ideas.","created_at":"2018-12-12T15:39:15Z","updated_at":"2018-12-14T12:57:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a54be2cb125d369fdaa8033d18a9c9602d3af91e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168/commits","review_comments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168/comments","review_comment_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/168/comments","statuses_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/statuses/004f15a7e4fdd52ca9bb47f970536f4958059a0f","head":{"label":"Emurgo:spec/refactor","ref":"spec/refactor","sha":"004f15a7e4fdd52ca9bb47f970536f4958059a0f","user":{"login":"Emurgo","id":36142236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTQyMjM2","avatar_url":"https://avatars3.githubusercontent.com/u/36142236?v=4","gravatar_id":"","url":"https://api.github.com/users/Emurgo","html_url":"https://github.com/Emurgo","followers_url":"https://api.github.com/users/Emurgo/followers","following_url":"https://api.github.com/users/Emurgo/following{/other_user}","gists_url":"https://api.github.com/users/Emurgo/gists{/gist_id}","starred_url":"https://api.github.com/users/Emurgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emurgo/subscriptions","organizations_url":"https://api.github.com/users/Emurgo/orgs","repos_url":"https://api.github.com/users/Emurgo/repos","events_url":"https://api.github.com/users/Emurgo/events{/privacy}","received_events_url":"https://api.github.com/users/Emurgo/received_events","type":"Organization","site_admin":false},"repo":{"id":144911693,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ5MTE2OTM=","name":"yoroi-frontend","full_name":"Emurgo/yoroi-frontend","private":false,"owner":{"login":"Emurgo","id":36142236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTQyMjM2","avatar_url":"https://avatars3.githubusercontent.com/u/36142236?v=4","gravatar_id":"","url":"https://api.github.com/users/Emurgo","html_url":"https://github.com/Emurgo","followers_url":"https://api.github.com/users/Emurgo/followers","following_url":"https://api.github.com/users/Emurgo/following{/other_user}","gists_url":"https://api.github.com/users/Emurgo/gists{/gist_id}","starred_url":"https://api.github.com/users/Emurgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emurgo/subscriptions","organizations_url":"https://api.github.com/users/Emurgo/orgs","repos_url":"https://api.github.com/users/Emurgo/repos","events_url":"https://api.github.com/users/Emurgo/events{/privacy}","received_events_url":"https://api.github.com/users/Emurgo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Emurgo/yoroi-frontend","description":"React frontend for the Yoroi Chrome extension","fork":false,"url":"https://api.github.com/repos/Emurgo/yoroi-frontend","forks_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/forks","keys_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/teams","hooks_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/hooks","issue_events_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/events","assignees_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/tags","blobs_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/languages","stargazers_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/stargazers","contributors_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/contributors","subscribers_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/subscribers","subscription_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/subscription","commits_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/merges","archive_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/downloads","issues_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/labels{/name}","releases_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/deployments","created_at":"2018-08-15T23:05:15Z","updated_at":"2018-12-14T12:50:23Z","pushed_at":"2018-12-14T12:53:52Z","git_url":"git://github.com/Emurgo/yoroi-frontend.git","ssh_url":"git@github.com:Emurgo/yoroi-frontend.git","clone_url":"https://github.com/Emurgo/yoroi-frontend.git","svn_url":"https://github.com/Emurgo/yoroi-frontend","homepage":"https://yoroi-wallet.com/","size":24089,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":61,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":61,"watchers":16,"default_branch":"develop"}},"base":{"label":"Emurgo:develop","ref":"develop","sha":"4ad796b0ab11b430b7c351dadcebb44ed694b1a6","user":{"login":"Emurgo","id":36142236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTQyMjM2","avatar_url":"https://avatars3.githubusercontent.com/u/36142236?v=4","gravatar_id":"","url":"https://api.github.com/users/Emurgo","html_url":"https://github.com/Emurgo","followers_url":"https://api.github.com/users/Emurgo/followers","following_url":"https://api.github.com/users/Emurgo/following{/other_user}","gists_url":"https://api.github.com/users/Emurgo/gists{/gist_id}","starred_url":"https://api.github.com/users/Emurgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emurgo/subscriptions","organizations_url":"https://api.github.com/users/Emurgo/orgs","repos_url":"https://api.github.com/users/Emurgo/repos","events_url":"https://api.github.com/users/Emurgo/events{/privacy}","received_events_url":"https://api.github.com/users/Emurgo/received_events","type":"Organization","site_admin":false},"repo":{"id":144911693,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ5MTE2OTM=","name":"yoroi-frontend","full_name":"Emurgo/yoroi-frontend","private":false,"owner":{"login":"Emurgo","id":36142236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTQyMjM2","avatar_url":"https://avatars3.githubusercontent.com/u/36142236?v=4","gravatar_id":"","url":"https://api.github.com/users/Emurgo","html_url":"https://github.com/Emurgo","followers_url":"https://api.github.com/users/Emurgo/followers","following_url":"https://api.github.com/users/Emurgo/following{/other_user}","gists_url":"https://api.github.com/users/Emurgo/gists{/gist_id}","starred_url":"https://api.github.com/users/Emurgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emurgo/subscriptions","organizations_url":"https://api.github.com/users/Emurgo/orgs","repos_url":"https://api.github.com/users/Emurgo/repos","events_url":"https://api.github.com/users/Emurgo/events{/privacy}","received_events_url":"https://api.github.com/users/Emurgo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Emurgo/yoroi-frontend","description":"React frontend for the Yoroi Chrome extension","fork":false,"url":"https://api.github.com/repos/Emurgo/yoroi-frontend","forks_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/forks","keys_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/teams","hooks_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/hooks","issue_events_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/events","assignees_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/tags","blobs_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/languages","stargazers_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/stargazers","contributors_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/contributors","subscribers_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/subscribers","subscription_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/subscription","commits_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/merges","archive_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/downloads","issues_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/labels{/name}","releases_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/Emurgo/yoroi-frontend/deployments","created_at":"2018-08-15T23:05:15Z","updated_at":"2018-12-14T12:50:23Z","pushed_at":"2018-12-14T12:53:52Z","git_url":"git://github.com/Emurgo/yoroi-frontend.git","ssh_url":"git@github.com:Emurgo/yoroi-frontend.git","clone_url":"https://github.com/Emurgo/yoroi-frontend.git","svn_url":"https://github.com/Emurgo/yoroi-frontend","homepage":"https://yoroi-wallet.com/","size":24089,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":61,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":61,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168"},"html":{"href":"https://github.com/Emurgo/yoroi-frontend/pull/168"},"issue":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/168"},"comments":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/Emurgo/yoroi-frontend/statuses/004f15a7e4fdd52ca9bb47f970536f4958059a0f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"SebastienGllmt"}}