{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/componentkit/pulls/comments/37641515","id":37641515,"diff_hunk":"@@ -88,4 +88,40 @@ - (instancetype)initWithHandle:(CKComponentScopeHandle *)handle\n   return self;\n }\n \n+- (void)injectScopeHierarchy:(_CKChildScopeFrameRet)oldFrame\n+{\n+  Class componentClass = oldFrame.cls;\n+  id identifier = oldFrame.identifier;\n+  CKAssert([oldFrame.frame isKindOfClass:[CKComponentScopeFrame class]], @\"Can't inject with incorrect frame class.\");\n+\n+  auto result = _children.insert({{componentClass, identifier}, oldFrame.frame});\n+\n+  CKAssert(result.second, @\"Scope collision: attempting to create duplicate scope %@:%@\", componentClass, identifier);\n+}\n+\n+- (_CKChildScopeFrameRet)childScopeFrameForOldIdentifier:(CKComponentScopeHandleIdentifier)globalIdentifier\n+{\n+  for (auto &pr : _children) {\n+    if (pr.second->_handle.globalIdentifier == globalIdentifier) {\n+      return _CKChildScopeFrameRet{pr.first.componentClass, pr.first.identifier, pr.second};\n+    }\n+  }\n+  return {nil, nil, 0};\n+}\n+\n+- (BOOL)anyDescendentHasPendingUpdates:(const CKComponentStateUpdateMap &)stateUpdates\n+{\n+  auto it = stateUpdates.find(_handle.globalIdentifier);","path":"ComponentKit/Core/Scope/CKComponentScopeFrame.mm","position":44,"original_position":44,"commit_id":"ed677f9bbecf3fda33b39994172a34e2de5bba36","original_commit_id":"3d5fc1dae329faee0a184ca946b154bbc19f1456","user":{"login":"adamjernst","id":97944,"avatar_url":"https://avatars.githubusercontent.com/u/97944?v=3","gravatar_id":"","url":"https://api.github.com/users/adamjernst","html_url":"https://github.com/adamjernst","followers_url":"https://api.github.com/users/adamjernst/followers","following_url":"https://api.github.com/users/adamjernst/following{/other_user}","gists_url":"https://api.github.com/users/adamjernst/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjernst/subscriptions","organizations_url":"https://api.github.com/users/adamjernst/orgs","repos_url":"https://api.github.com/users/adamjernst/repos","events_url":"https://api.github.com/users/adamjernst/events{/privacy}","received_events_url":"https://api.github.com/users/adamjernst/received_events","type":"User","site_admin":false},"body":"Not as far as I can see because `stateUpdates` is just a flat map of ids -> updates.\r\n\r\nWe could annotate each node in the state tree with a hash-set of all the IDs below it, which would make this an O(1) operation here, but given the typical size of a state tree (10-15 elements) I don't think it's worth avoiding the recursion. For now let's do this, and come back to it if it's a hotspot (doubt it)","created_at":"2015-08-21T14:50:18Z","updated_at":"2015-08-21T14:50:18Z","html_url":"https://github.com/facebook/componentkit/pull/348#discussion_r37641515","pull_request_url":"https://api.github.com/repos/facebook/componentkit/pulls/348","_links":{"self":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/comments/37641515"},"html":{"href":"https://github.com/facebook/componentkit/pull/348#discussion_r37641515"},"pull_request":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/348"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/componentkit/pulls/348","id":42633798,"html_url":"https://github.com/facebook/componentkit/pull/348","diff_url":"https://github.com/facebook/componentkit/pull/348.diff","patch_url":"https://github.com/facebook/componentkit/pull/348.patch","issue_url":"https://api.github.com/repos/facebook/componentkit/issues/348","number":348,"state":"open","locked":false,"title":"Try to allow memoization of components with state","user":{"login":"darknoon","id":355540,"avatar_url":"https://avatars.githubusercontent.com/u/355540?v=3","gravatar_id":"","url":"https://api.github.com/users/darknoon","html_url":"https://github.com/darknoon","followers_url":"https://api.github.com/users/darknoon/followers","following_url":"https://api.github.com/users/darknoon/following{/other_user}","gists_url":"https://api.github.com/users/darknoon/gists{/gist_id}","starred_url":"https://api.github.com/users/darknoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darknoon/subscriptions","organizations_url":"https://api.github.com/users/darknoon/orgs","repos_url":"https://api.github.com/users/darknoon/repos","events_url":"https://api.github.com/users/darknoon/events{/privacy}","received_events_url":"https://api.github.com/users/darknoon/received_events","type":"User","site_admin":false},"body":"Work in progress, via discussions with @adamjernst. Need to clean up the `id scopeIdentifier` parameter, which shouldn't be necessary.","created_at":"2015-08-17T21:03:24Z","updated_at":"2015-08-21T14:50:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ece3e8070290f62d6933f2828647718e3ce5a15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/componentkit/pulls/348/commits","review_comments_url":"https://api.github.com/repos/facebook/componentkit/pulls/348/comments","review_comment_url":"https://api.github.com/repos/facebook/componentkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/componentkit/issues/348/comments","statuses_url":"https://api.github.com/repos/facebook/componentkit/statuses/ed677f9bbecf3fda33b39994172a34e2de5bba36","head":{"label":"darknoon:memoize-state","ref":"memoize-state","sha":"ed677f9bbecf3fda33b39994172a34e2de5bba36","user":{"login":"darknoon","id":355540,"avatar_url":"https://avatars.githubusercontent.com/u/355540?v=3","gravatar_id":"","url":"https://api.github.com/users/darknoon","html_url":"https://github.com/darknoon","followers_url":"https://api.github.com/users/darknoon/followers","following_url":"https://api.github.com/users/darknoon/following{/other_user}","gists_url":"https://api.github.com/users/darknoon/gists{/gist_id}","starred_url":"https://api.github.com/users/darknoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darknoon/subscriptions","organizations_url":"https://api.github.com/users/darknoon/orgs","repos_url":"https://api.github.com/users/darknoon/repos","events_url":"https://api.github.com/users/darknoon/events{/privacy}","received_events_url":"https://api.github.com/users/darknoon/received_events","type":"User","site_admin":false},"repo":{"id":35582854,"name":"componentkitx","full_name":"darknoon/componentkitx","owner":{"login":"darknoon","id":355540,"avatar_url":"https://avatars.githubusercontent.com/u/355540?v=3","gravatar_id":"","url":"https://api.github.com/users/darknoon","html_url":"https://github.com/darknoon","followers_url":"https://api.github.com/users/darknoon/followers","following_url":"https://api.github.com/users/darknoon/following{/other_user}","gists_url":"https://api.github.com/users/darknoon/gists{/gist_id}","starred_url":"https://api.github.com/users/darknoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darknoon/subscriptions","organizations_url":"https://api.github.com/users/darknoon/orgs","repos_url":"https://api.github.com/users/darknoon/repos","events_url":"https://api.github.com/users/darknoon/events{/privacy}","received_events_url":"https://api.github.com/users/darknoon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darknoon/componentkitx","description":"A fork of ComponentKit that supports iOS and OS X","fork":true,"url":"https://api.github.com/repos/darknoon/componentkitx","forks_url":"https://api.github.com/repos/darknoon/componentkitx/forks","keys_url":"https://api.github.com/repos/darknoon/componentkitx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darknoon/componentkitx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darknoon/componentkitx/teams","hooks_url":"https://api.github.com/repos/darknoon/componentkitx/hooks","issue_events_url":"https://api.github.com/repos/darknoon/componentkitx/issues/events{/number}","events_url":"https://api.github.com/repos/darknoon/componentkitx/events","assignees_url":"https://api.github.com/repos/darknoon/componentkitx/assignees{/user}","branches_url":"https://api.github.com/repos/darknoon/componentkitx/branches{/branch}","tags_url":"https://api.github.com/repos/darknoon/componentkitx/tags","blobs_url":"https://api.github.com/repos/darknoon/componentkitx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darknoon/componentkitx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darknoon/componentkitx/git/refs{/sha}","trees_url":"https://api.github.com/repos/darknoon/componentkitx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darknoon/componentkitx/statuses/{sha}","languages_url":"https://api.github.com/repos/darknoon/componentkitx/languages","stargazers_url":"https://api.github.com/repos/darknoon/componentkitx/stargazers","contributors_url":"https://api.github.com/repos/darknoon/componentkitx/contributors","subscribers_url":"https://api.github.com/repos/darknoon/componentkitx/subscribers","subscription_url":"https://api.github.com/repos/darknoon/componentkitx/subscription","commits_url":"https://api.github.com/repos/darknoon/componentkitx/commits{/sha}","git_commits_url":"https://api.github.com/repos/darknoon/componentkitx/git/commits{/sha}","comments_url":"https://api.github.com/repos/darknoon/componentkitx/comments{/number}","issue_comment_url":"https://api.github.com/repos/darknoon/componentkitx/issues/comments{/number}","contents_url":"https://api.github.com/repos/darknoon/componentkitx/contents/{+path}","compare_url":"https://api.github.com/repos/darknoon/componentkitx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darknoon/componentkitx/merges","archive_url":"https://api.github.com/repos/darknoon/componentkitx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darknoon/componentkitx/downloads","issues_url":"https://api.github.com/repos/darknoon/componentkitx/issues{/number}","pulls_url":"https://api.github.com/repos/darknoon/componentkitx/pulls{/number}","milestones_url":"https://api.github.com/repos/darknoon/componentkitx/milestones{/number}","notifications_url":"https://api.github.com/repos/darknoon/componentkitx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darknoon/componentkitx/labels{/name}","releases_url":"https://api.github.com/repos/darknoon/componentkitx/releases{/id}","created_at":"2015-05-14T01:07:03Z","updated_at":"2015-07-30T14:31:58Z","pushed_at":"2015-08-20T01:48:15Z","git_url":"git://github.com/darknoon/componentkitx.git","ssh_url":"git@github.com:darknoon/componentkitx.git","clone_url":"https://github.com/darknoon/componentkitx.git","svn_url":"https://github.com/darknoon/componentkitx","homepage":"http://www.componentkit.org/","size":8208,"stargazers_count":5,"watchers_count":5,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":5,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"cc3cfac0b420fc8a635825a9c39022a10e4af818","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":32600951,"name":"componentkit","full_name":"facebook/componentkit","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/componentkit","description":"A React-inspired view framework for iOS.","fork":false,"url":"https://api.github.com/repos/facebook/componentkit","forks_url":"https://api.github.com/repos/facebook/componentkit/forks","keys_url":"https://api.github.com/repos/facebook/componentkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/componentkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/componentkit/teams","hooks_url":"https://api.github.com/repos/facebook/componentkit/hooks","issue_events_url":"https://api.github.com/repos/facebook/componentkit/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/componentkit/events","assignees_url":"https://api.github.com/repos/facebook/componentkit/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/componentkit/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/componentkit/tags","blobs_url":"https://api.github.com/repos/facebook/componentkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/componentkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/componentkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/componentkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/componentkit/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/componentkit/languages","stargazers_url":"https://api.github.com/repos/facebook/componentkit/stargazers","contributors_url":"https://api.github.com/repos/facebook/componentkit/contributors","subscribers_url":"https://api.github.com/repos/facebook/componentkit/subscribers","subscription_url":"https://api.github.com/repos/facebook/componentkit/subscription","commits_url":"https://api.github.com/repos/facebook/componentkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/componentkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/componentkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/componentkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/componentkit/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/componentkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/componentkit/merges","archive_url":"https://api.github.com/repos/facebook/componentkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/componentkit/downloads","issues_url":"https://api.github.com/repos/facebook/componentkit/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/componentkit/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/componentkit/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/componentkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/componentkit/labels{/name}","releases_url":"https://api.github.com/repos/facebook/componentkit/releases{/id}","created_at":"2015-03-20T18:42:47Z","updated_at":"2015-08-21T11:04:11Z","pushed_at":"2015-08-21T14:17:48Z","git_url":"git://github.com/facebook/componentkit.git","ssh_url":"git@github.com:facebook/componentkit.git","clone_url":"https://github.com/facebook/componentkit.git","svn_url":"https://github.com/facebook/componentkit","homepage":"http://www.componentkit.org/","size":10574,"stargazers_count":2291,"watchers_count":2291,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":192,"mirror_url":null,"open_issues_count":41,"forks":192,"open_issues":41,"watchers":2291,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/348"},"html":{"href":"https://github.com/facebook/componentkit/pull/348"},"issue":{"href":"https://api.github.com/repos/facebook/componentkit/issues/348"},"comments":{"href":"https://api.github.com/repos/facebook/componentkit/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/componentkit/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/componentkit/statuses/ed677f9bbecf3fda33b39994172a34e2de5bba36"}}}}