480 Commits

Author SHA1 Message Date
Adlai Holler
7c4ee350b0 Use Native convertRect:, convertPoint: Methods to Handle Nil Cases (#2889)
* When converting rects, points on loaded nodes, call into UIKit/CoreAnimation

* Always use view-ish behavior

* Improve nil window handling, add documentation
2017-01-11 13:44:35 -08:00
Adlai Holler
42f0288fda Account for table view cell separator when reporting height (#2883) 2017-01-11 12:48:16 -08:00
Adlai Holler
92bbfc112f Generate an iOS 9 reference image for testTextContainerInsetIsIncludedWithSmallerConstrainedSize (#2880) 2017-01-09 12:55:31 -08:00
Huy Nguyen
be6faa107a Support Buck build (#2849)
* Support Buck build

* Simplify pod_install hook and buck-file dir's structure

* Update PINRemoteImage's BUCK

* Frameworks linking:
- Weak linking Photos and MapKit.
- Revisit //:Tests' list.
2017-01-04 14:11:28 -08:00
Adlai Holler
23c81b150d Disable testThatRootPagerNodeDoesGetTheRightInsetWhilePoppingBack (#2857) 2017-01-03 14:55:11 -08:00
Huy Nguyen
99c5021be7 Remove duplicated _delegate ivar in ASVideoNode (#2844) 2017-01-01 18:42:41 -08:00
Adlai Holler
2f7925544b Add a failing unit test for the automatic subnode management range issue (#2826) 2016-12-28 11:22:43 -06:00
Adlai Holler
a426d99c74 Remove irritating layout attributes assertions (#2828) 2016-12-25 11:43:34 -05:00
Adlai Holler
57913b8578 Range Controller Uses Last Scroll Direction, Defaults to Down/Right (#2808)
* Test that the initial range bounds are what we expect

* Use the user's previous scroll direction in the range controller

* Remove flow layout assertion
2016-12-22 15:48:57 -05:00
Adlai Holler
3e53d26686 Ensure that all nodes are deallocated inside the thrash testing method to avoid polluting other tests (#2800) 2016-12-19 18:45:57 -05:00
Adlai Holler
eea5ddac3e Range Controller Explicitly Marks Disappeared Nodes as Invisible (#2805)
* Improve visibility handling for range-managed nodes

* Tweak ASWeakSet & the test

* Put back a few things that are pending a different diff

* Add a test

* Ensure we update visible nodes, even if there are no new ones
2016-12-19 17:38:27 -05:00
Michael Schneider
57cd6a3ba8 [ASPagerNode] Fix content insets are wrong in pager node if root node of ASViewController and transition back (#2736)
* Fix content insets are wrong in pager node if root node of ASViewController and transition back

* Add unit test

* Improve test

* Fix test

* Move tests to ASPagerNodeTests
2016-12-12 16:05:09 -08:00
Adlai Holler
5b80a641af Improve Handling of Rasterized Node Interface & Hierarchy States (#2731)
* 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
2016-12-08 09:52:21 -08:00
Michael Schneider
4355f4d2ee [Layout] Don't crash if layout elements are created in layoutSpecThatFits: (#2694)
* Fix crash if layout elements are created with no owner and referenced in layoutSpecThatFits:

* Add failing test for nodes deallocated while creating in layoutSpecThatFits:

* Some more

* Some cleanup

* Added more complexity to tests

* Only cache sublayouts if the layout get’s flattened

* Address comments

* Address comments
2016-12-07 14:58:34 -08:00
Michael Schneider
beb98b448e [ASTextKit] Remove internal side effects related to constrainedSize. 2016-12-06 19:53:58 -08:00
Michael Schneider
ef84e99673 Tremendously make the implementation easier 2016-12-05 20:15:23 -08:00
Michael Schneider
70b647c2b9 Add support for setting a static image to ASNetworkImageNode 2016-12-05 16:43:46 -08:00
Michael Schneider
9adb6554fc Add assertion against externally setting .image in specific ASImageNode subclasses 2016-12-05 16:43:46 -08:00
Adlai Holler
20c66f1025 Beef up the tests 2016-12-05 15:37:49 -08:00
Adlai Holler
9bc58dc024 When not visible, only batch fetch to fill visible area 2016-12-05 15:00:39 -08:00
Adlai Holler
21cad90355 Ensure we always fill leading screens for batching 2016-12-05 14:51:07 -08:00
Michael Schneider
a2e75152f8 [ASDisplayNode] Fix flickering for nodes that support range managed interface state (#2710)
* Fix flickering for range managed nodes

* Go back to old behavior to check for range managed before calling didExitPreloadState in interface state change
2016-12-05 10:34:03 -08:00
Adlai Holler
40a8769217 Filter out extra items when querying collection view layout (#2693) 2016-12-02 08:48:46 -08:00
Adlai Holler
051b738236 Inject data source class name into update validation exceptions, deprecate suppression flag (#2692) 2016-12-01 17:30:36 -08:00
Garrett Moon
ba2268ac99 2611 rename fetch data (#2689)
* 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.
2016-12-01 13:41:22 -08:00
Adlai Holler
b075aa2851 Merge pull request #2682 from facebook/AHFixMoreDeallocVisibleCases
Fix Edge Cases of Table Cell Nodes Deallocated While Visible
2016-11-30 09:01:01 -08:00
Adlai Holler
81a04bc93b Remove magic number 2016-11-30 09:00:48 -08:00
Adlai Holler
3fe87ffb64 Add a test replicating Issue 2252 2016-11-29 16:19:48 -08:00
Adlai Holler
df497b82c2 Improve Batch Fetching Call Pattern to Reduce Fetch Calls (#2675)
* Test & tweak batch fetching implementation

* Tighten the test

* Stop batch fetching at the end of range controller pass

* Clean up the test

* Still check for batch fetching after each frame when scrolling

* Ensure batch fetching happens for empty collection/table
2016-11-29 13:40:03 -08:00
Adlai Holler
14765a55d2 Revert "Merge pull request #2649 from facebook/AHCollectionNodeInitializer"
This reverts commit 0f620f458d815b6f7a6b5d954ac29a6d056caf58, reversing
changes made to 0c65d21f8de3023c6d3a25572da18e3b82a35040.
2016-11-23 15:56:24 -08:00
Adlai Holler
94a0ba8635 Make the tests pass 2016-11-22 16:52:48 -08:00
Adlai Holler
04b93182cd Rejigger ASCollectionNode initializers 2016-11-22 16:49:52 -08:00
Adlai Holler
6d01bbeb19 Let nodes deallocate naturally, manually trampoline UIKit ivars
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
2016-11-21 00:46:57 +09:00
Michael Schneider
1b0b9e4830 Fix layout transition measurement completion on main test (#2639) 2016-11-20 07:05:54 -08:00
Michael Schneider
acc080ab9c Revert setting isMutable to true in ASLayoutSpecSnapshotTestHelper 2016-11-19 06:43:46 -08:00
Michael Schneider
f9c70470d8 Address another round of comments 2016-11-19 06:43:46 -08:00
Michael Schneider
2cd49642b9 Address comments from @appleguy 2016-11-19 06:43:46 -08:00
Michael Schneider
cc297a2dae Fix some tests and add a workaround to ceil the values from self.bounds.size before checking for equality 2016-11-19 06:43:46 -08:00
Michael Schneider
257d4c3a1f Further improvements and fixing tests 2016-11-19 06:43:46 -08:00
Michael Schneider
a71a1d8519 Address comments 2016-11-19 06:43:46 -08:00
Michael Schneider
c7765f6183 Add pending layout to ASDisplayNode 2016-11-19 06:43:46 -08:00
Michael Schneider
d21a512907 Some commit 2016-11-19 06:43:46 -08:00
Michael Schneider
8f079bd1ca Fix some tests 2016-11-19 06:43:46 -08:00
Michael Schneider
5226879291 Some commit 2016-11-19 06:43:45 -08:00
Michael Schneider
bc0443db02 Don’t floor space between items for ASStackLayoutJustifyContentSpaceBetween and ASStackLayoutJustifyContentSpaceAround 2016-11-17 18:05:22 -08:00
Adlai Holler
da465bf812 Merge pull request #2624 from facebook/HTDeprecateTableViewDelegates
[ASCollectionNode, ASTableNode] Deprecate asyncDelegate & asyncDataSource Properties
2016-11-17 18:41:41 +09:00
Hannah Trosi
6565b8348d collectionView 2016-11-17 16:46:07 +09:00
Adlai Holler
00f448d534 Merge pull request #2623 from facebook/AssertLog
[ASDisplayNode] Convert assertion to log so developer can see layout issues onscreen.
2016-11-17 14:55:44 +09:00
Scott Goodson
8c01fccfca [ASDisplayNode] Convert assertion to log so developer can see layout issues onscreen.
In this case, the user hasn't specified enough about the layout of a node.  We default to
0, 0 - but ideally the case should not occur at all.  So it's important to help developers
detect these cases and fix them quickly.

An assertion causes developers several problems:
- They can't see important information unless an exception breakpoint is manually added.
- They can't see their layout onscreen and so visually understanding the problem is impossible.
- They can't proceed with testing to trigger other faults in the layout and are blocked fixing one at a time.

A log fixes every one of those problems:
- They can set a breakpoint on the log line very easily if desired.
- They can see their layout display and recognize the 0,0 node even more quickly than the log text information.
- They can see if multiple logs print out, or if the log only occurs for one item in a feed, or certain types --
    This helps them debug faster by knowing if the layout is always broken or certain conditions break it.

Since developing with ASLayoutSpecs is an iterative process, it's crucial that we let developers have the
freedom to experiment and test without hitting too many assertions.  Fortunately it will be impossible to ignore
these huge logs (full recursive description) and their nodes will be 0, 0 size, so they will get fixed.
2016-11-16 21:14:15 -08:00
Adlai Holler
4a48ba8be2 Improve our event logging greatly 2016-11-17 12:04:30 +09:00