469 Commits

Author SHA1 Message Date
Adlai Holler
ea4d88e053 Skip ASTextNodePerformanceTests in Test Action (#2173) 2016-08-31 16:10:27 -07:00
Adlai Holler
578ac4c48d [Unit Tests] Add Text Layout Performance Tests (#2161)
* Add single-threaded text node performance testing

* Relax test a bit
2016-08-28 16:47:03 -07:00
Michael Schneider
d0c77d7965 Add ASDisplayNodeLayoutTests (#2157) 2016-08-27 17:36:08 -07:00
Adlai Holler
ff37535140 [Testing] Migrate Unit Tests to ARC (#2156)
* Migrate ASDisplayNodeTests to ARC

* Migrate ASDisplayNodeAppearanceTests to ARC

* Migrate ASDisplayLayerTests to ARC

* Migrate ASMultiplexImageNodeTests to ARC

* Address Garrett's feedback
2016-08-27 15:09:59 -07:00
Garrett Moon
645aa6f24b [ASDisplayNode] Renamed range update callbacks (#2130)
* Renamed range update callbacks

We finally settled on

didEnter/ExitDisplayState
didEnter/ExitPreloadState
didEnter/ExitVisibleState

This change is meant to unify the range update methods to relate to each
other and hopefully be a bit more self explanatory.

* Guarantee interface callbacks happen on main.

* move fetchData / clearFetchedData to default implementations

* Move deprecated methods to new deprecated category

* Don't bring in cocoapod change.

* Nits

* Capetalize
2016-08-26 20:18:38 -07:00
Adlai Holler
6a482dc153 [ASDataController] Use 2 Threads Per CPU When Measuring Nodes (#2145)
* [ASDataController] Use custom apply function to control thread count

* Relax the test for stupid Travis CI

* Remove unneeded import
2016-08-26 10:54:55 -07:00
Adlai Holler
480ba8c3fa [ASViewController] Remeasure node with new constrained size when propagating trait collection (#2143) 2016-08-25 21:21:44 -07:00
Michael Schneider
47d84aa7fe Add snapshot test for ASBackgroundLayoutSpec (#2131) 2016-08-25 21:18:52 -07:00
Adlai Holler
0bd664f9ed Remove numberOfSectionsForSupplementaryNodeOfKind: Method (#2102)
* Add unit test to confirm that supplementary items must be contained within actual sections

* [ASLayoutInspecting] Deprecate collectionView:numberOfSectionsForSupplementaryNodeOfKind:

* Add another test to dig deeper into UICollectionView
2016-08-19 11:18:31 -07:00
Hannah Trosi
971d43ad4d [Build settings] add missing newlines at end of file 2016-08-18 15:01:41 -07:00
Adlai Holler
85f2a2a128 Remove reference to gone file ASLayoutSpec+Private.h (#2101) 2016-08-18 13:08:30 -07:00
Adlai Holler
99574a728c Make our snapshot testing possible without framework-private access, simplify (#2083) 2016-08-17 17:42:37 -07:00
Adlai Holler
05dba2263c Make ASWeakSet and NSArray+Diffing public, add support for large arrays (#2078) 2016-08-16 16:47:26 -07:00
Nikita Lutsenko
2091df9607 [ASTextNode] Fix highlighting when textContainerInsets are set. (#2073)
* [ASTextNode] Fix highlighting when textContainerInsets are set.

* Add ASTextNodeSnapshotTests to xcodeproj.

* Add snapshot test for container inset and highlighting.
2016-08-16 10:18:51 -07:00
Chris Danford
c09db1cb17 ASImageNode backing store sharing for memory and CPU reduction (#1974) 2016-08-03 13:10:50 -07:00
Michael Schneider
d5cbe33686 Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK Part 2 (#2021)"
This reverts commit d5a7c195226925e483c74fb210120d15ff423378.
2016-08-02 10:10:36 -07:00
Michael Schneider
d5a7c19522 [ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK Part 2 (#2021)
* Revert "Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)""

This reverts commit 735b4ebd0872483044d98a5d05b43324e76fc8d4.

* Fix crash and add exception for mutating while using fast enumeration of ASLayoutSpec children

NSFastEnumeration is potentially quite dangerous in the wrong hands. In particular, it does not provide a safe mechanism for you to return temporary objects directly, and it does not provide any guarantee that you will be called when the enumeration has completed; therefore if we generate temporaries and store them in an instance variable, we will not necessarily be able to clean them up! This means fast enumeration methods should never be called within an autorelease pool or the autorelease pool be drained within the fast enumeration loop.

The reason is we store references to objects in the stackBuf struct by casting the child pointer to __autoreleasing id. If we pop the autorelease pool between calls to -countByEnumeratingWithState:objects:count:, it will die in a messy explosion of pointer dereferences and EXC_BAD_ACCESS.

* Add tests for ASDisplayNode and ASLayoutSpec fast enumeration
2016-08-01 18:08:48 -07:00
Scott Goodson
735b4ebd08 Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)"
Something interesting going on here with ARC / Objective-C++ that we are investigating and will re-land.

This reverts commit c90ed08d1073701e2c7f8a2677d460c140f05264.
2016-07-31 18:43:20 -07:00
Scott Goodson
26e23d541c [Build] Update copy headers build phase with recently added header, remove extraneous .mm files. 2016-07-30 18:51:47 -07:00
Michael Schneider
c90ed08d10 [ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)
* Use childrenMap directly to prevent creating an NSArray in ASDK for ASLayoutSpec children

* Add locking for parent property in ASLayoutSpec

* Remove unnecessary import

* Add newline

* Add NSFastEnumeration to ASEnvironment and ASDisplayNode / ASLayoutSpec

* Change NSMutableArray initializer to arrayWithCapacity:

* Move ASLayoutSpec+Private.h into Private folder

Fixes building with Swift

* Remove lock for ASLayoutSpec parent
2016-07-29 10:53:31 -07:00
Adlai Holler
6a21daa80f [ASInternalHelpers] Use type-generic math (#2006) 2016-07-28 20:44:14 -07:00
Adlai Holler
3bfa60c445 Move ASDataController+Subclasses.h to fix Swift build 2016-07-21 15:52:24 -07:00
Adlai Holler
8cde594de3 [ASDataController] Add validation logic to the change set to throw exceptions on invalid updates (#1894)
[_ASHierarchyChangeSet] Oopsy daisy

[ASDataController] Tweak our update validation

[ASHierarchyChangeSet] Fix bugs

Finish up some stuff

[ASDataController] Put some stuff back

[ASChangeSetDataController] Always use changeset

[ASDataController] Put other stuff back

[_ASHierarchyChangeSet] Use fast enumeration

[_ASHierarchyChangeSet] Fix assertion format strings, return on fail so we don't crash in production

[ASDataController] Store data source item counts as vector rather than NSArray

[ASDataController] Build some tests for the update validation

[ASDataController] Fix issues with update validation

Get rid of new file

[ASDataController] Suppress changeset validation before initial reload

[ASDataController] Make invalid update log vs. exception publicly toggleable
2016-07-21 14:37:51 -07:00
Adlai Holler
0a9b308f2c [_ASHierarchyChangeSet] Use std::unordered_map rather than dictionary 2016-07-12 15:28:30 -07:00
Scott Goodson
48311aee96 [Build] Fix build issue caused by an #import change. 2016-07-09 16:09:35 -07:00
Kiel Gillard
6a15ab6130 * Tidy the header imports, forward declaring classes and protocols where appropriate to avoid import cycles and using the framework/system header notation for imports occuring in .h files.
* Perhaps controversially, decomposing ASRangeControllerUpdateRangeProtocol+Beta.h such that the categories on various classes are defined in the classes themselves since that's where the implementation of those categories is provided.
* Updating unit tests and import other headers the tests took for granted. The tests could probably import the umbrella header and not have to worry about this.
* Updating the "Life without Cocoapods" sample to build and run dependent on ASDK as a static library.
* Added a "Life With Frameworks" sample app to build and run dependent on ASDK as a framework, proving the framework targets work.
2016-07-07 15:12:19 +10:00
Kiel Gillard
f7b7bcebeb * Make the "Life Without Cocoapods" sample build and run.
* Properly reference headers within implementation files to avoid import cycles and redeclaration warnings.
2016-07-06 16:58:13 +10:00
Kiel Gillard
9eed54491e Copy header files using the Copy Files phase rather than the Headers phase since this is how static libraries are expected to expose their headers to clients. 2016-07-06 16:26:01 +10:00
Hannah Troisi
682ddcfe51 [AsyncDisplayKit+Utilities.h] Convenience methods for creating resizable circles & rounded rects. (#1811)
* [AsyncDisplayKit+Utilities.h] UIImage category for performant (optionally rounded) flat color stretchable images

* treat clear background color as no background color (D99117)

* add borderWidth

* add several shorter methods per Scott's comment

* rename files and add to AsyncDisplayKit.h

* fix xcode project file

* update commentse
2016-07-04 16:34:16 -07:00
Adlai Holler
5d7f3b4293 Merge pull request #1819 from kielgillard/master
[ASDisplayNodeExtras] Collect subnodes passing the test
2016-07-02 08:55:51 -07:00
Adlai Holler
5dcc7e9430 Merge pull request #1823 from facebook/AHExposePINDownloader
[Project] Publicize ASPINRemoteImageDownloader.h
2016-07-01 14:21:16 -07:00
ricky
8c3025bb12 [ASDisplayNode] added asyncTraitCollectionDidChange method (#1831)
Subclasses can override this method to react to a trait collection change
2016-06-30 19:45:29 -07:00
Adlai Holler
27b99cf0b6 Make NSIndexSet helpers framework-visible 2016-06-30 08:46:11 -07:00
Adlai Holler
f7fa90aafd [Project] Publicize ASPINRemoteImageDownloader.h 2016-06-27 10:21:52 -07:00
Kiel Gillard
cc74fb0cdc Prove the change gets the correct nodes with a pair of tests. 2016-06-27 12:53:33 +10:00
Adlai Holler
71d9f64535 Carry over first-pass change set improvements 2016-06-24 11:12:37 -07:00
Adlai Holler
fcf2db79f8 [ASTableViewThrashTests] Initial commit 2016-06-21 18:46:08 -07:00
appleguy
2cf9e62df6 Merge pull request #1692 from maicki/ASLayoutValidation
[ASLayout] Add basic infrastructure for layout validation
2016-06-08 19:32:20 -07:00
Levi McCallum
ca2fb0bc74 Update FBSnapshotTestCase and generate @3x images 2016-06-08 13:33:03 -07:00
Michael Schneider
197950f39b Add basic infrastructure for layout validation 2016-06-08 10:35:28 -07:00
appleguy
e5eed560e1 Merge pull request #1693 from rcancro/traitUpdate
[ASTraitCollection] Bug fixing/LayoutSpec propagation
2016-06-03 22:01:13 -07:00
ricky
01dbc86778 First pass of comments
* make variable naming reflect ASEnvironmentTraitCollection vs ASTraitCollection
* move trait propagation to cell allocation instead of via a nested block
* move trait propagation when setting a displaynode's supernode instead of when adding a subnode
* fixed misspelling of "colection"
2016-06-03 09:59:24 -07:00
Michael Schneider
e84f9f27c2 Fix measurement of ASEditableTextNode
- Add ability to measure the ASEditableTextNode based on the content now by calling measure:
- ASEditableTextNode considers preferredFrameSize now
- Fix crash if ASEditableTextNode is included in a horizontal stack
- Add tests for ASEditableTextNode
2016-05-31 16:29:40 -07:00
Erekle
4f40f3c12f Merge remote-tracking branch 'facebook/master' into ASVideoPlayerNode
# Conflicts:
#	AsyncDisplayKit.xcodeproj/project.pbxproj
2016-05-26 12:15:23 +04:00
Levi McCallum
95f1ab4902 [ASDisplayNode] Rename ASDisplayNodeTransitionContext to ASLayoutTransition (#1680)
* [ASDisplayNode] Rename ASDisplayNodeTransitionContext to ASLayoutTransition

* Rename internal ivar to fit new naming

* Fix tabbing
2016-05-25 10:10:27 +07:00
Erekle
39e287f0d6 fixes suggested by levi 2016-05-18 00:45:40 +04:00
Erekle
8c8fc3dba0 Adding ASVideoPlayerNode 2016-05-17 11:08:53 -07:00
Erekle
b3360a5daf Merge remote-tracking branch 'facebook/master' into ASVideoPlayerNode 2016-05-14 12:26:01 +04:00
Garrett Moon
5a9ef8a6f7 Fix build 2016-05-12 13:42:05 -07:00
Garrett Moon
af7a2f09d7 Add support for visibility depth
This adds support for the concept of visibility depth.

Visibility essentially defines the number of user actions it would
take a user to have a view controller visible. Knowing a view controllers
visibility depth allows view controllers to take action such as clearing
out memory that can be restored at a later date.

This patch also add two new view controller subclasses which adopt
the ASManagesChildVisibilityDepth protocol. Any view controller
that has child view controllers can adopt this protocol to indicate
to the child what they're visibility is. For example, ASNavigationController
will return a visibility depth of it's own visibilityDepth + 1 for
a view controller that would be revealed by tapping the back button.
2016-05-12 13:42:05 -07:00