-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
From @nguyenhuy on March 24, 2017 20:45
I'd like to share my vision of ASCollectionNode, now that we have facebookarchive/AsyncDisplayKit#3017 and facebookarchive/AsyncDisplayKit#3130 in pretty good shape to form a foundation of the following projects:
- Give back control to collection layout objects and eliminate layout inspector, layout facilitator, etc.
- Have
ASDataController,ASRangeControllerandASCollectionLayouts to be decoupled fromASCollectionViewand instead rely onASCollectionNode. With this, we'll be able to do the initialreloadData, prepare collection layout and preload cells before the view is even allocated. - Introduce measure range (and even allocate range in the far future):
ASDataControllerwon't allocate and measure all cell nodes in one go, but instead refer to its layout delegate, such asASCollection(Gallery|Pager)LayoutDelegate(Improve collection datasource performance #186). - Interface-state-aware
ASCollectionNode:- When a collection node enters preload state, it triggers the initial
reloadDataand then preloads "visible" cells. Those cells should be in preload state and start fetching images, etc. A collection node that is in preload state should have its own visible range of 0, display range of 0 and preload range of 1. - When it enters display state, it allocates its collection view and renders. Its visible range at this stage is 0, render range is 1 and preload range is bigger than that.
- When it finally enters visible range, its visible cells should all be ready and it uses the normal ranges.
- With this system, nest collection nodes (e.g closeup) will be much better supported. Currently we can't perform initial
reloadData, prepare the collection layouts and preload visible cells (e.g pin image) of sub-collection-cell-nodes (e.g close gallery cell) until they enter display range of the containing collection (e.g closeup gallery pager) and have their view allocated.
- When a collection node enters preload state, it triggers the initial
All of these projects won't be realized without the help and feedbacks of core team members, especially @Adlai-Holler, as well as other community members. So please leave comments!
Copied from original issue: facebookarchive/AsyncDisplayKit#3219