{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/91991445","pull_request_review_id":12500311,"id":91991445,"diff_hunk":"@@ -0,0 +1,69 @@\n+//\n+//  ASScrollNode.m\n+//  AsyncDisplayKit\n+//\n+//  Copyright (c) 2014-present, Facebook, Inc.  All rights reserved.\n+//  This source code is licensed under the BSD-style license found in the\n+//  LICENSE file in the root directory of this source tree. An additional grant\n+//  of patent rights can be found in the PATENTS file in the same directory.\n+//\n+\n+#import \"ASScrollNode.h\"\n+#import \"ASDisplayNodeInternal.h\" // TODO: This can be removed after __instanceLock__ cleanup lands\n+#import \"ASDisplayNode+FrameworkPrivate.h\"\n+#import \"ASDisplayNode+Subclasses.h\"\n+#import \"ASLayout.h\"\n+#import \"_ASDisplayLayer.h\"\n+\n+@interface ASScrollView : UIScrollView\n+@end\n+\n+@implementation ASScrollView\n+\n+// This special +layerClass allows ASScrollNode to get -layout calls from -layoutSublayers.\n++ (Class)layerClass\n+{\n+  return [_ASDisplayLayer class];\n+}\n+\n+@end\n+\n+@implementation ASScrollNode\n+{\n+  CGSize _contentCalculatedSizeFromLayout;\n+}\n+@dynamic view;\n+\n+- (instancetype)init\n+{\n+  return [super initWithViewBlock:^UIView *{ return [[ASScrollView alloc] init]; }];\n+}\n+\n+- (void)layout\n+{\n+  [super layout];\n+  ASDN::MutexLocker l(__instanceLock__);\n+  if (_automaticallyManagesContentSize) {\n+    CGSize contentSize = _contentCalculatedSizeFromLayout;\n+    if (ASIsCGSizeValidForLayout(contentSize) == NO) {\n+      NSLog(@\"%@ calculated a size in its layout spec that can't be applied to .contentSize: %@. Applying CGSizeZero instead.\", self, NSStringFromCGSize(contentSize));\n+      contentSize = CGSizeZero;\n+    }\n+    self.view.contentSize = _contentCalculatedSizeFromLayout;\n+  }\n+}\n+\n+- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize\n+{\n+  ASLayout *layout = [super calculateLayoutThatFits:constrainedSize];\n+  ASDN::MutexLocker l(__instanceLock__);","path":"AsyncDisplayKit/ASScrollNode.mm","position":59,"original_position":59,"commit_id":"efa2064a37aa12bbe800c6ef5f0231c36237adc7","original_commit_id":"efa2064a37aa12bbe800c6ef5f0231c36237adc7","user":{"login":"maicki","id":25288,"avatar_url":"https://avatars.githubusercontent.com/u/25288?v=3","gravatar_id":"","url":"https://api.github.com/users/maicki","html_url":"https://github.com/maicki","followers_url":"https://api.github.com/users/maicki/followers","following_url":"https://api.github.com/users/maicki/following{/other_user}","gists_url":"https://api.github.com/users/maicki/gists{/gist_id}","starred_url":"https://api.github.com/users/maicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maicki/subscriptions","organizations_url":"https://api.github.com/users/maicki/orgs","repos_url":"https://api.github.com/users/maicki/repos","events_url":"https://api.github.com/users/maicki/events{/privacy}","received_events_url":"https://api.github.com/users/maicki/received_events","type":"User","site_admin":false},"body":"Can this introduce some deadlock situation?","created_at":"2016-12-12T17:05:54Z","updated_at":"2016-12-12T17:20:17Z","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/2753#discussion_r91991445","pull_request_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753","_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/91991445"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/2753#discussion_r91991445"},"pull_request":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753","id":97452777,"html_url":"https://github.com/facebook/AsyncDisplayKit/pull/2753","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/2753.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/2753.patch","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2753","number":2753,"state":"open","locked":false,"title":"[ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.","user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"body":"[ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.\r\n\r\nThis feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.\r\n\r\nIt works well either for a blank ASScrollNode with .layoutSpecBlock set on it, or a subclass of ASScrollNode with a more traditional layoutSpecThatFits: implementation.  With this approach there is no need to capture the layout size, use an Absolute layout spec as a wrapper, or set contentSize anywhere in the code and it will update as the layout changes!\r\n\r\nThere is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.\r\n\r\nI'm including in 2.0.1 for now because this is already working, a small addition, and should be easy to land.  It's a pretty material improvement for some key use cases with Stacks, and will help us answer questions related to scroll nodes with confidence.","created_at":"2016-12-11T08:59:48Z","updated_at":"2016-12-12T17:20:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06a91ea006ef713f4a9ba042206ba87993416864","assignee":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"assignees":[{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/22","html_url":"https://github.com/facebook/AsyncDisplayKit/milestone/22","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/22/labels","id":2132538,"number":22,"title":"2.0.1","description":"","creator":{"login":"hannahmbanana","id":3419380,"avatar_url":"https://avatars.githubusercontent.com/u/3419380?v=3","gravatar_id":"","url":"https://api.github.com/users/hannahmbanana","html_url":"https://github.com/hannahmbanana","followers_url":"https://api.github.com/users/hannahmbanana/followers","following_url":"https://api.github.com/users/hannahmbanana/following{/other_user}","gists_url":"https://api.github.com/users/hannahmbanana/gists{/gist_id}","starred_url":"https://api.github.com/users/hannahmbanana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannahmbanana/subscriptions","organizations_url":"https://api.github.com/users/hannahmbanana/orgs","repos_url":"https://api.github.com/users/hannahmbanana/repos","events_url":"https://api.github.com/users/hannahmbanana/events{/privacy}","received_events_url":"https://api.github.com/users/hannahmbanana/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":9,"state":"open","created_at":"2016-11-14T04:32:37Z","updated_at":"2016-12-11T09:38:24Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753/commits","review_comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753/comments","review_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2753/comments","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/efa2064a37aa12bbe800c6ef5f0231c36237adc7","head":{"label":"facebook:ASScrollNodeAutomaticContentSize","ref":"ASScrollNodeAutomaticContentSize","sha":"efa2064a37aa12bbe800c6ef5f0231c36237adc7","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":21265042,"name":"AsyncDisplayKit","full_name":"facebook/AsyncDisplayKit","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/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":false,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit","forks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/deployments","created_at":"2014-06-27T05:29:02Z","updated_at":"2016-12-12T16:42:16Z","pushed_at":"2016-12-12T06:50:42Z","git_url":"git://github.com/facebook/AsyncDisplayKit.git","ssh_url":"git@github.com:facebook/AsyncDisplayKit.git","clone_url":"https://github.com/facebook/AsyncDisplayKit.git","svn_url":"https://github.com/facebook/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":92057,"stargazers_count":10098,"watchers_count":10098,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1763,"mirror_url":null,"open_issues_count":182,"forks":1763,"open_issues":182,"watchers":10098,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"b8be6076a8cc639c7671a7ffa472c9e98dd09853","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":21265042,"name":"AsyncDisplayKit","full_name":"facebook/AsyncDisplayKit","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/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":false,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit","forks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/deployments","created_at":"2014-06-27T05:29:02Z","updated_at":"2016-12-12T16:42:16Z","pushed_at":"2016-12-12T06:50:42Z","git_url":"git://github.com/facebook/AsyncDisplayKit.git","ssh_url":"git@github.com:facebook/AsyncDisplayKit.git","clone_url":"https://github.com/facebook/AsyncDisplayKit.git","svn_url":"https://github.com/facebook/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":92057,"stargazers_count":10098,"watchers_count":10098,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1763,"mirror_url":null,"open_issues_count":182,"forks":1763,"open_issues":182,"watchers":10098,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/2753"},"issue":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2753"},"comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2753/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2753/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/efa2064a37aa12bbe800c6ef5f0231c36237adc7"}}}}
{"actor":{"display_login":"maicki"}}