28 Commits

Author SHA1 Message Date
Adlai Holler
69ed9562df
Remove ASRectMap, which is not worth its own weight (#1127) 2018-09-18 11:58:24 -07:00
appleguy
465abb1ded [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077)
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)

With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.

After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.

* [License] Update all Texture source files to be pure Apache 2.

* Changelog entry for Apache 2 license update.

* Revert "[License] Update all Texture source files to be pure Apache 2."

This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.

* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.

* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
2018-08-28 07:39:18 -07:00
Adlai Holler
db0f515812
Revert unreleased layout debug method name change from #1030 #trivial (#1039)
* Revert unreleased layout debugging method name change from #1030 #trivial

* Eh make less changes
2018-07-17 21:08:29 -07:00
Adlai Holler
cf810acaa3
Fix the bug I introduced in #1030 (#1035) 2018-07-16 20:43:58 -07:00
Adlai Holler
0b9f12716e
Remove NSMutableArray for retaining sublayout elements (#1030)
* Remove NSMutableArray for retaining sublayout elements

* Kick the CI

* Kick the CI again

* Smash that CI button

* Murder the CI
2018-07-15 18:41:23 -07:00
Kevin
8986838b48 Add move detection and support to ASLayoutTransition (#1006)
* Add move detection and support to ASLayoutTransition

...and NSArray+Diffing.
Add some tests.

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update ASLayout+IGListKit.h

* Update ASLayout+IGListKit.mm

* Use std collections to avoid NSNumber boxing

* Update ASLayoutTransition.mm

* Code review updates.

* Use `unordered_multimap` on stack instead of unordered_map<id,queue> on heap
* Remove notFound BOOL (use NSNotFound sentinel value) and put some vars inside the if (insertions/moves) loop
* Don't copy defaultCompare block (redundant under ARC)
* Whitespace
* Remove unneeded mutableCopy-s in ArrayDiffingTests

* Code review updates.

* Type _subnodeMoves pair.first to ASDisplayNode * instead of id
* C++ enumeration
* unowned refs for adding previousLayout nodes to _subnodeMoves
* Remove unreleated ASDynamicCast that is probably right though

* Add commentary to NSArray+Diffing.h; make multimap elements unowned

* Use std::make_pair, optimize ASLayout+IGListKit

* Oops I thought I had added these headers but nope

* Simplify simplify

* Diff subnodes instead of sublayouts

* Another randomized test with actual ASLayouts
2018-07-13 10:19:03 -07:00
Michael Schneider
55abeed743
Introduce let / var macros and some further cleanup (#1012)
* Introduce let / var and some further cleanup

* Address first comments

* Update changelog

* Move the const before auto
2018-07-10 09:37:53 -07:00
Adlai Holler
77e2d28919
Create transfer-array method and use it (#987)
* Create transfer-array method and use it

* License headers

* Update ASArrayByFlatMapping
2018-06-29 18:21:55 -07:00
Adlai Holler
0fe991f818
Optimize layout flattening (#982)
* Optimize layout flattening

* Changelog

* Remove whitespace

* Update ASLayout.mm

Add comment
2018-06-22 14:20:33 -07:00
Adlai Holler
dbe469a94a
Standardize "extern" decls on AS_EXTERN (#972)
* Standardize "extern" decls on AS_EXTERN

* Rebase & remove from implementation files
2018-06-18 15:53:34 -07:00
Adlai Holler
a11506564a
Reduce usage of autorelease pools (#968)
* Reduce reliance on the autorelease pool

* changelog

* A few more places

* Use it in another place
2018-06-15 10:15:25 -07:00
Adlai Holler
cac14e0bce
Standardize Property Declaration Style in Core Classes (#870)
* Audit property attributes for core classes

* Update style guide

* Go crazy

* Update changelog
2018-05-24 14:42:43 -07:00
Adlai Holler
2b12654810
Use NS_RETURNS_RETAINED macro to save time (#843)
* Use NS_RETURNS_RETAINED macro to save time

* Update changelog and do the thing with the license headers
2018-03-21 08:13:09 -07:00
Adlai Holler
9b8a919a93
Revert "Faster collection operations (#748)" (#759)
This reverts commit 5c13403ef75c030adc7a4d51a7792a9c6c1c348b.
2018-01-22 11:38:09 -08:00
Adlai Holler
5c13403ef7 Faster collection operations (#748)
* Faster collection operations

* Fix a few things

* Put the stupid semicolon

* Address warning

* Cut down retain/releases during collection operations

* Update CHANGELOG.md
2018-01-22 13:22:03 +00:00
appleguy
131619de96
Reimplement ASRectTable using unordered_map to avoid obscure NSMapTable exception. (#719)
* Reimplement ASRectTable using unordered_map to avoid obscure NSMapTable exception.

The new class is called ASRectMap, which patterns alongside ASIntegerMap in both name and implementation.

After some pretty detailed investigation, including study of open-source reimplementations
of Foundation, the best lead I've found on the NSMapTable exception is that
some NSPointerFunction types are not fully supported. Strangely, the ones being used
do seem to work fine almost all of the time.

The main concern is the Struct memory type, which is not officially re-declared in
NSMapTable, and as such the documentation claims that there may exist some
combinations of NSPointerFunction that are not supported.

Because the exception is occurring frequently enough to be a concern (in the hundreds
to low thousands, though only 50 a day) - I decided to replace NSMapTable entirely
in order to ensure full correctness.

"*** -[NSMapTable initWithKeyPointerFunctions:valuePointerFunctions:capacity:] Requested configuration not supported."

* Fix Xcode project
2017-12-21 16:17:25 -08:00
Adlai Holler
0dc7002f0b Add unit tests for the layout engine (#424)
* Build testing platform & tests for the layout engine

* Add our license header to debugbreak.

* Remove thing

* Address review comments

* Beef up the logging

* Update -[ASLayout isEqual:]

* testLayoutTransitionWithAsyncMeasurement passes now

* Disable testASetNeedsLayoutInterferingWithTheCurrentTransition

* Fix build errors
2017-12-01 17:05:47 +00:00
appleguy
cfc48679ba [Yoga] Add insertYogaNode:atIndex: method. Improve handling of relayouts. (#469)
* [Yoga] Add insertYogaNode:atIndex: method. Improve handling of relayouts.

* Add new "version" parameter to Yoga initialization of ASDisplayNodeLayout C++ struct.
2017-09-17 22:45:39 -07:00
Huy Nguyen
4ba6f451f6 [Cleanup] Remove deprecated APIs (#529)
* Remove preferredFrameSize

* Remove -measure:

* Remove -measureWithSizeRange:

* Remove ASLayoutable

* Remove .name

* Remove deprecated style forwardings

That includes following properties that are declared on ASDisplayNode and ASLayoutSpec: spacingBefore, spacingAfter, flexGrow, flexShrink, flexBasis, alignSelf, ascender, descender, sizeRange and layoutPosition.

* Remove usesImplicitHierarchyManagement

* Remove deprecated range update callbacks:
-visibilityDidChange:
-visibleStateDidChange:
-displayStateDidChange:
-loadStateDidChange:

* Remove -clearFetchedData

* Remove -cancelLayoutTransitionsInProgress

* Remve ASDisplayNode+Deprecated.h

* Remove ASLayoutRangeTypeRender and ASLayoutRangeTypeFetchData

* Remove -[ASTableView clearContents]

* Remove reloadDataImmediately

* Remove ASStaticLayoutSpec

* Remove ASDimensionDeprecated

* Remove optional -pagerNode:constrainedSizeForNodeAtIndex: delegate method in ASPagerDelegate

* Remove suppressesInvalidCollectionUpdateExceptions

* Remove -[ASCollectionViewLayoutInspector initWithCollectionView]

* Remove ASVideoPlayerNode.loadAssetWhenNodeBecomesVisible

* Update CHANGELOG

* Update license of ASLayoutSpecTests.m

* Update examples/PagerNode

* Remove ASEnvironmentTraitCollection

* Remove -ASViewController.nodeConstrainedSize

* More on removing ASLayoutable
2017-09-07 19:25:42 +01:00
Huy Nguyen
fdc1f0468c Improvements in ASCollectionGalleryLayoutDelegate (#496)
* Improvements in ASCollectionGalleryLayoutDelegate
- It now can handle section inset, as well as interitem and line spacings
- Other small changes

* Fix build failure and update file licenses

* Update CHANGELOG

* Minor change

* Another assertion on scrollable directions of gallery layout delegate
2017-08-08 19:11:40 +01:00
Adlai Holler
8ec4b312cf Overhaul our logging, add activity tracing support. (#399)
* Improve the os_log and os_activity integration

* Address feedback from Scott and Huy
2017-07-03 19:03:26 -07:00
Huy Nguyen
c603ef0ef2 [ASLayout] Revisit the flattening algorithm (#395)
* Implement tests for the layout flattening process

* Refactor the flattening algorithm
- Remove flattened flag
- No more self check
- Stop traversing a layout tree branch when hits a displaynode node.
- Reuse as many existing ASLayout objects as possible

* Update changelog

* Ceil position values before comparing

* Explain why sublayout elements must be retained
2017-06-29 18:39:04 +01:00
Huy Nguyen
23ee9de615 If a layout has no sublayouts, don't bother initializing its rect table (#394) 2017-06-29 15:09:49 +01:00
Huy Nguyen
f7a6b7ae84 Fix documentation of ASLayout retainSublayoutLayoutElements (#393) 2017-06-28 16:14:05 +01:00
Huy Nguyen
05e9bdd092 Small changes required by the coming layout debugger (#337)
* Small changes required by the layout debugger
- `ASDisplayNode` can be told to not flatten its layout immediately but later on. The unflattened layout is also stored in a separate property. It's needed for inspecting not only display nodes but also layout specs used to compute a layout tree.
- `ASLayout` can be told to always retain its sublayout elements. This is needed especially for layout specs since they are usually not retained after an ASLayout was computed.

* Update CHANGELOG

* Address comments
2017-06-08 10:47:50 -07:00
appleguy
32c036f440 [CGPointNull] Rename globally exported C function to avoid collisions #trivial (#62)
* [CGPointNull] Rename globally exported C function to avoid collisions.

Some other frameworks also declare this. Let's try to minimize collisions
without making the name too ugly.

* Fix build errors
2017-04-26 17:21:01 -07:00
Garrett Moon
8013e25524 Update license v2 (#67)
* Fixed license

* Update all licenses

* Update Dangerfile for new license

* Update already updated licenses

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…
2017-04-24 16:59:57 -07:00
Adlai Holler
73ca6ab514 Shuffle & Cleanup Stuff (#3080) 2017-02-26 18:14:13 -08:00