* Fix pager node and deprecate zeroContentInsets flag
* Do it with the visible state callback
* There we are
* Put viewController in node debug description
* [Yoga + AsyncDisplayKit] Initial commit for supporting Yoga-powered layout calculation.
Because this results in ASLayout objects, it preserve support for automaticallyManagesSubnodes
as well as the animated transition system. More work remains to vet performance of the new mode,
and it will remain in +Beta for the forseeable future.
I'm not sure that this should ever be used as the primary ASDK layout system, but it should remain an
option for some apps to experiment with if they require an implementation that more strictly mirrors
W3C standard Flexbox.
* [Yoga] Improve usage of ASHierarchyState to ensure simultaneous yoga layouts can't happen.
* [Yoga] Strictly minimize the impact of the Yoga integration on existing code.
Created new file ASDisplayNode+Yoga.mm, reduced size and number of integration points in core code.
* [Yoga] Figured out how to further reduce ASDisplayNode.mm impact by allocating _yogaNode in property accessor, and changing all accesses to use the property.
* Add support for setting non-fatal error block
* Better documentation and fix typos
* Added ASDisplayNodeAssertNonFatal macro that asserts in dev and call block in prod
* Make non fatal error code equals to 1
* Add support for condition in ASDisplayNodeAssertNonFatal
* Only call non fatal block if condition isn’t satisfied
* Remove taking a snapshot in the default default layout transition code
* Set groupOpacity for root node of animation to true before and restore after animation finished
* [ASNodeController] initial commit for node controller class
* create <ASInterfaceState> protocol, -[ASDisplayNode interfaceDelegate], and use these to forward to ASNodeController
* rename ASInterfaceStateDelegate, fix setting in it ASNodeController.mm
* Reimplement IGListKit support in a cleaner way
* Rename and fix some stuff
* Fix supplementaries more
* Update docs
* Update test
* Cleanup minor things
* Tweak it
* Indentation
* Remove irrelevant changes
* Break out cell into its own file
* Fix indentation
* Address feedback
* Implement mutex ownership and use it to check potential upward lock gathering
* Don't hold instance lock and call willEnterHierarchy/didExitHierarchy of ASDisplayNode
- This can cause deadlocks (e.g #2605) if subsequent methods, that are implemented by developers, walk up the node tree.
- This is a way to keep the optimizations introduced in 9e87813 while making sure the locking situation is a bit safer.
* More lock ownership assertions in ASDisplayNode
* Document main thread contract of -clearContents
* ASNetworkImageNode shoud not call setNeedsPreload while holding instance lock
- This helps to avoid potentially deadlocks caused if the node (esp in case it's a subclass of ASNetworkImageNode) walks up the tree in didEnterPreloadState, for example to build logging context.
* ASVideoNode should not call setNeedsPreload while holding instance lock
- This helps to avoid potentially deadlocks caused if the node (esp. if it's a subclass of ASVideoNode) walks up the tree in didEnterPreloadState, for example to build logging context.
* Don't hold instance lock for the entire insert subnode operation
- The recursive lock should not be held throughout `_insertSubnode:atSubnodeIndex:sublayerIndex:andRemoveSubnode:`. The method instead should manage the lock itself and acquire it as shortly as possible. The reason is that this method calls many methods outside the scope of `self`. `[subnode __setSupernode:self]` is especially troublesome because it causes the subnode to migrate to new hierarchy and interface states, which triggers `didEnter/Exit(.*)State` methods. These methods are meant to be overriden by subclasses. Thus they might walk up the node tree and potentially cause deadlocks, or they perform expensive tasks and cause the lock to be held for too long.
- Other methods that call this method should release the lock before doing so.
* Lock getter and setter of `synchronous` flag
* Address comment in ASVideoNode
* Add main thread assertions to methods that change asset and assetURL of ASVideoNode
* Explain CHECK_LOCKING_SAFETY flag
* More thread and locking assertions in ASVideNode
- It's not safe to call `-[subnode __setSupernode:self]` while holding instance lock of soon-to-be supernode (e.g `self`).
- It's also not safe to call `[subnode __setSupernode:nil]` while holding the instance lock of the old supernode (e.g `self`).
- did(Enter|Exit)(.*)State methods are always called on main. Add main thread assertions to indicate that.
* Minor change in explanation of CHECK_LOCKING_SAFETY flag
* [ASDisplayNode] Remove node from supernode before adding it as a subview
If a node is being added as a subview to a UIVIew, we must make sure to remove it as a subnode of its supernode.
* remove from supernode if adding to a layer.
* Reset the alpha value for removed subnodes in layout transition to 1 after removal
* Some improvements
* Restore alpha value of inserted and removed subnodes to original alpha value in animated layout transition
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own.
This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h,
because Internal.h should ideally not be used outside of the ASDisplayNode file setup. This has greatly reduced
the number of imports of Internal.h.
* [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
* [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.
This feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.
It 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!
There is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.
* [ASScrollNode] Add locking to new properties, adjust how calculateLayout override is done.
* Improve handling of rasterize node interface states and testing
* Fix harder
* Finish fixes and move rasterization flag into beta header
* Re-enable rasterization in ASDKgram
* Re-enable working test
* Only do it in debug
* Fix flickering for range managed nodes
* Go back to old behavior to check for range managed before calling didExitPreloadState in interface state change
* Replace fetch data with preload terminology
- Deprecate `-fetchData` and `-clearFetchedData` in favor of `-preload` and `-clearPreloadedData`
- Move `-setNeedsPreload`, `-recursivelyPreload` and `-recursivelyClearPreloadedData` to ASDisplayNode+FrameworkPrivate.h
- Update internal implementation, comments and tests
* Folllow up on #2642:
- Remove -preload and -clearPreloadedData in favor of -didEnterPreloadState and -didExitPreloadState.
- -didEnterPreloadState and -didExitPreloadState call the deprecated -fetchData and -clearFetchedData methods if they are overriden.
* Missed one in a test
* Get rid of behavior change for now.
* Revert more behavior changes, fix tests.
* Don't need these anymore.
Be more aggressive with main thread punting
Trampoline setting the dataSource/delegate onto the main thread
Short-circuit the supplementary nodes method if no data source
Don't rely on assertions
Mark variable unused to fix release builds
Handle ASCollectionNode/ASTableNode deallocation better
Add some comments about new macro