{"action":"created","comment":{"url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/comments/206996963","pull_request_review_id":142519845,"id":206996963,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjk5Njk2Mw==","diff_hunk":"@@ -135,8 +135,27 @@ module Converters =\n \n     let identical (x: 'T) (y:'T) = System.Object.ReferenceEquals(x, y)\n \n-    let canReuseChild (prevChild:ViewElement) (newChild:ViewElement) = \n-        (prevChild.TargetType = newChild.TargetType)\n+    // NavigationPage can be reused only if the already existing pages don't change type (added/removed pages don't prevent reuse)\n+    // E.g. If the first page switch from ContentPage to TabbedPage, the NavigationPage can't be reused; otherwise it can.\n+    let canReuseNavigationPage (prevChild:ViewElement) (newChild:ViewElement) =\n+        let prevPages = prevChild.TryGetAttribute<ViewElement[]>(\"Pages\")\n+        let newPages = newChild.TryGetAttribute<ViewElement[]>(\"Pages\")\n+\n+        match prevPages, newPages with\n+        | ValueSome prevPages, ValueSome newPages ->\n+            let prevSeq = Seq.ofArray prevPages\n+            let newSeq = Seq.ofArray newPages\n+            Seq.forall2 (fun (prev: ViewElement) (curr: ViewElement) -> prev.TargetType = curr.TargetType) prevSeq newSeq\n+        | _, _ -> true\n+\n+    let canReuseChild (prevChild:ViewElement) (newChild:ViewElement) =\n+        if prevChild.TargetType = newChild.TargetType then\n+            if newChild.TargetType = typeof<NavigationPage> then","path":"Elmish.XamarinForms/ViewConverters.fs","position":21,"original_position":21,"commit_id":"0951adba7c68d9a728bd20b40882307fc7a3befc","original_commit_id":"0951adba7c68d9a728bd20b40882307fc7a3befc","user":{"login":"TimLariviere","id":6429007,"node_id":"MDQ6VXNlcjY0MjkwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/6429007?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLariviere","html_url":"https://github.com/TimLariviere","followers_url":"https://api.github.com/users/TimLariviere/followers","following_url":"https://api.github.com/users/TimLariviere/following{/other_user}","gists_url":"https://api.github.com/users/TimLariviere/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLariviere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLariviere/subscriptions","organizations_url":"https://api.github.com/users/TimLariviere/orgs","repos_url":"https://api.github.com/users/TimLariviere/repos","events_url":"https://api.github.com/users/TimLariviere/events{/privacy}","received_events_url":"https://api.github.com/users/TimLariviere/received_events","type":"User","site_admin":false},"body":"Ok","created_at":"2018-08-01T19:03:37Z","updated_at":"2018-08-01T19:03:37Z","html_url":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150#discussion_r206996963","pull_request_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/comments/206996963"},"html":{"href":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150#discussion_r206996963"},"pull_request":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150"}},"in_reply_to_id":206987448},"pull_request":{"url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150","id":205316756,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MzE2NzU2","html_url":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150","diff_url":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150.diff","patch_url":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150.patch","issue_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/150","number":150,"state":"open","locked":false,"title":"Fixed NavigationPage Reuse","user":{"login":"TimLariviere","id":6429007,"node_id":"MDQ6VXNlcjY0MjkwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/6429007?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLariviere","html_url":"https://github.com/TimLariviere","followers_url":"https://api.github.com/users/TimLariviere/followers","following_url":"https://api.github.com/users/TimLariviere/following{/other_user}","gists_url":"https://api.github.com/users/TimLariviere/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLariviere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLariviere/subscriptions","organizations_url":"https://api.github.com/users/TimLariviere/orgs","repos_url":"https://api.github.com/users/TimLariviere/repos","events_url":"https://api.github.com/users/TimLariviere/events{/privacy}","received_events_url":"https://api.github.com/users/TimLariviere/received_events","type":"User","site_admin":false},"body":"Fixes #148\r\n\r\nI've opted to add a special case in the function `canReuseChild` by checking if at least one page has changed type.\r\n\r\nNot sure if the code is great though. (conversion to Seq to avoid exception with Zip when the 2 arrays have a different length)","created_at":"2018-08-01T06:00:38Z","updated_at":"2018-08-01T19:03:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"059a81af728c12ea349b428184845f2ccbf40418","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150/commits","review_comments_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150/comments","review_comment_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/150/comments","statuses_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/statuses/0951adba7c68d9a728bd20b40882307fc7a3befc","head":{"label":"TimLariviere:fix-navigationpage-reuse","ref":"fix-navigationpage-reuse","sha":"0951adba7c68d9a728bd20b40882307fc7a3befc","user":{"login":"TimLariviere","id":6429007,"node_id":"MDQ6VXNlcjY0MjkwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/6429007?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLariviere","html_url":"https://github.com/TimLariviere","followers_url":"https://api.github.com/users/TimLariviere/followers","following_url":"https://api.github.com/users/TimLariviere/following{/other_user}","gists_url":"https://api.github.com/users/TimLariviere/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLariviere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLariviere/subscriptions","organizations_url":"https://api.github.com/users/TimLariviere/orgs","repos_url":"https://api.github.com/users/TimLariviere/repos","events_url":"https://api.github.com/users/TimLariviere/events{/privacy}","received_events_url":"https://api.github.com/users/TimLariviere/received_events","type":"User","site_admin":false},"repo":{"id":141603883,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE2MDM4ODM=","name":"Elmish.XamarinForms","full_name":"TimLariviere/Elmish.XamarinForms","owner":{"login":"TimLariviere","id":6429007,"node_id":"MDQ6VXNlcjY0MjkwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/6429007?v=4","gravatar_id":"","url":"https://api.github.com/users/TimLariviere","html_url":"https://github.com/TimLariviere","followers_url":"https://api.github.com/users/TimLariviere/followers","following_url":"https://api.github.com/users/TimLariviere/following{/other_user}","gists_url":"https://api.github.com/users/TimLariviere/gists{/gist_id}","starred_url":"https://api.github.com/users/TimLariviere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimLariviere/subscriptions","organizations_url":"https://api.github.com/users/TimLariviere/orgs","repos_url":"https://api.github.com/users/TimLariviere/repos","events_url":"https://api.github.com/users/TimLariviere/events{/privacy}","received_events_url":"https://api.github.com/users/TimLariviere/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TimLariviere/Elmish.XamarinForms","description":"F# Functional App Development for Xamarin.Forms","fork":true,"url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms","forks_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/forks","keys_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/teams","hooks_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/hooks","issue_events_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/issues/events{/number}","events_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/events","assignees_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/assignees{/user}","branches_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/branches{/branch}","tags_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/tags","blobs_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/git/refs{/sha}","trees_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/statuses/{sha}","languages_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/languages","stargazers_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/stargazers","contributors_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/contributors","subscribers_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/subscribers","subscription_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/subscription","commits_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/commits{/sha}","git_commits_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/git/commits{/sha}","comments_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/comments{/number}","issue_comment_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/issues/comments{/number}","contents_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/contents/{+path}","compare_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/merges","archive_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/downloads","issues_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/issues{/number}","pulls_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/pulls{/number}","milestones_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/milestones{/number}","notifications_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/labels{/name}","releases_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/releases{/id}","deployments_url":"https://api.github.com/repos/TimLariviere/Elmish.XamarinForms/deployments","created_at":"2018-07-19T16:14:51Z","updated_at":"2018-07-31T16:59:13Z","pushed_at":"2018-08-01T16:33:23Z","git_url":"git://github.com/TimLariviere/Elmish.XamarinForms.git","ssh_url":"git@github.com:TimLariviere/Elmish.XamarinForms.git","clone_url":"https://github.com/TimLariviere/Elmish.XamarinForms.git","svn_url":"https://github.com/TimLariviere/Elmish.XamarinForms","homepage":"https://fsprojects.github.io/Elmish.XamarinForms/","size":5391,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fsprojects:master","ref":"master","sha":"d0e01dbb393eae080c2bebba5b5e48cdf63a0caf","user":{"login":"fsprojects","id":6001315,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDEzMTU=","avatar_url":"https://avatars2.githubusercontent.com/u/6001315?v=4","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"repo":{"id":120334619,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzMzQ2MTk=","name":"Elmish.XamarinForms","full_name":"fsprojects/Elmish.XamarinForms","owner":{"login":"fsprojects","id":6001315,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDEzMTU=","avatar_url":"https://avatars2.githubusercontent.com/u/6001315?v=4","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsprojects/Elmish.XamarinForms","description":"F# Functional App Development for Xamarin.Forms","fork":false,"url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms","forks_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/forks","keys_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/teams","hooks_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/hooks","issue_events_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/events{/number}","events_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/events","assignees_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/assignees{/user}","branches_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/branches{/branch}","tags_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/tags","blobs_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/statuses/{sha}","languages_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/languages","stargazers_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/stargazers","contributors_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/contributors","subscribers_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/subscribers","subscription_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/subscription","commits_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/contents/{+path}","compare_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/merges","archive_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/downloads","issues_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues{/number}","pulls_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls{/number}","milestones_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/milestones{/number}","notifications_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/labels{/name}","releases_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/releases{/id}","deployments_url":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/deployments","created_at":"2018-02-05T17:00:17Z","updated_at":"2018-08-01T17:06:40Z","pushed_at":"2018-08-01T16:33:24Z","git_url":"git://github.com/fsprojects/Elmish.XamarinForms.git","ssh_url":"git@github.com:fsprojects/Elmish.XamarinForms.git","clone_url":"https://github.com/fsprojects/Elmish.XamarinForms.git","svn_url":"https://github.com/fsprojects/Elmish.XamarinForms","homepage":"https://fsprojects.github.io/Elmish.XamarinForms/","size":5355,"stargazers_count":128,"watchers_count":128,"language":"F#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":24,"open_issues":26,"watchers":128,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150"},"html":{"href":"https://github.com/fsprojects/Elmish.XamarinForms/pull/150"},"issue":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/150"},"comments":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/fsprojects/Elmish.XamarinForms/statuses/0951adba7c68d9a728bd20b40882307fc7a3befc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"TimLariviere"}}