{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2643","repository_url":"https://api.github.com/repos/facebook/AsyncDisplayKit","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2643/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2643/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2643/events","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/2643","id":190750226,"number":2643,"title":"[ASTextNode] Remove caching of constrained size within ASTextNode in layout pass","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},"labels":[{"id":337808363,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/ASTextNode","name":"ASTextNode","color":"d4c5f9","default":false},{"id":196858465,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/CLA%20Signed","name":"CLA Signed","color":"bfe5bf","default":false},{"id":284919975,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/Needs%20Review","name":"Needs Review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/7","html_url":"https://github.com/facebook/AsyncDisplayKit/milestones/2.0.0","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/7/labels","id":1164099,"number":7,"title":"2.0.0","description":"","creator":{"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},"open_issues":17,"closed_issues":143,"state":"open","created_at":"2015-06-15T00:41:47Z","updated_at":"2016-11-23T21:48:19Z","due_on":"2016-11-30T00:00:00Z","closed_at":null},"comments":5,"created_at":"2016-11-21T15:32:49Z","updated_at":"2016-11-24T00:13:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/2643","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/2643","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/2643.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/2643.patch"},"body":"`ASTextNode` relies on the `_constrainedSize` property within `ASTextNode` across layout and display pass. Furthermore we cache the `ASTextKitRenderer` based on the constrained size and invalidate it in certain cases. Managing the creation and invalidation of the renderer is a huge overhead within `ASTextNode` and also results in bugs like calling `calculateSizeThatFits:` is not without any side effects and can cause misbehavior if called multiple times before drawing with a different bounds size as returned from it.\r\n\r\nThis PR has multiple purposes. It should move the `ASTextKitRenderer` to a thread safe components that can be used across multiple `ASTextNode's` as well as cache a specific amount of renderer within `ASTextNode` to be able to reuse one that is used multiple times across layout and display pass without having to invalidate it.\r\n\r\nWe already had a similar PR merged a couple of month ago, but the problem with it was that we didn't move over the `ASTextKitRenderer` to be an immutable component that can be used across threads. This PR will add this.\r\n\r\n## Changes\r\n- [x] Remove `_constrainedSize` dependency within `ASTextNode`\r\n- [x] Make `ASTextKitRenderer` usable across multiple Threads / `ASTextNode`'s: This means instead of creating the internal components and size calculation lazily we create the components and compute the size immediately to have an immutable internal state.\r\n- [x] Cache `ASTextKitRenderer` across `ASTextNode`s\r\n- [x] Fix failing tests due to `containerInset` setting on `ASTextNode`"},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/262660617","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/2643#issuecomment-262660617","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2643","id":262660617,"user":{"login":"Adlai-Holler","id":2466893,"avatar_url":"https://avatars.githubusercontent.com/u/2466893?v=3","gravatar_id":"","url":"https://api.github.com/users/Adlai-Holler","html_url":"https://github.com/Adlai-Holler","followers_url":"https://api.github.com/users/Adlai-Holler/followers","following_url":"https://api.github.com/users/Adlai-Holler/following{/other_user}","gists_url":"https://api.github.com/users/Adlai-Holler/gists{/gist_id}","starred_url":"https://api.github.com/users/Adlai-Holler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adlai-Holler/subscriptions","organizations_url":"https://api.github.com/users/Adlai-Holler/orgs","repos_url":"https://api.github.com/users/Adlai-Holler/repos","events_url":"https://api.github.com/users/Adlai-Holler/events{/privacy}","received_events_url":"https://api.github.com/users/Adlai-Holler/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T00:13:20Z","updated_at":"2016-11-24T00:13:20Z","body":"@maicki \"Calculates its size now on the bounds\" what do you mean? It looks like the new image is larger than the old one, and the text is slightly off-center?"}}
{"actor":{"display_login":"Adlai-Holler"}}