* Rename ASDN C++ namespace to "AS." Referring to the framework as ASDisplayNode is pretty out-dated and verbose. See CoreAnimation which usees CA for their internal namespace.
More using
* More cases
* Optimize ASCATransactionQueue. This queue is very busy, and it runs on the main thread so it's important for it to be fast.
Avoid waking up the run loop for every single node.
Avoid a ton of NSPointerArray overhead that we don't need.
Avoid retain/release traffic on the singleton by using an inline function. I confirmed that in release mode, the static __strong is correctly inlined and no ARC traffic is incurred.
* Comment
* Unlock right
* Remove magic number
* Lock up to yogaRoot during layout to avoid dead lock.
1) lock to root for tree
2) lock self to change parent (& consequently root)
3) Implement ASLocking (tryLock) on ASNodeController
4) add lockPair to try-lock node & controller together
5) lock controllers if they exist in lockToRoot...
Disable some asserts due to lock to root. :(
LL# No commands remaining.
* Add macro so non-Yoga still builds :)
* wut
* Improve separation of code for layout method types
* Address PR comments
- Delegate to layout spec engine if the node is a layout spec node but yoga engine was asked for calculate the layout
- Change ASLayoutType to ASLayoutEngineType
- Improve layout engine fall through code
https://github.com/TextureGroup/Texture/pull/886 enforces that some nodes are loaded before they are sent a visiblity event, but it was not propagating the trait collection before forcing the load.
We are propagating traits in `_setSupernode:` (which was happening after the forced load). I moved the possible forced load to `_setSupernode:`, after propagating traits but before any visibility states are changed.
We will revert #1023. The current solution introduces problems if we are unlocking before calling _completePendingLayoutTransition. _completePendingLayoutTransition needs to be happening in one transaction if called from _u_measureNodeWithBoundsIfNecessary.
* Remove whitespace at the end of the line
* Fix indentation
* Wrap if check for assertion in ASDISPLAYNODE_ASSERTIONS_ENABLED
* Add testTextNodeSwitchWorksInMultiThreadEnvironment tests
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* access layer to load node before enter visible
* revert space
* Simpler Huy fix for more efficient delayed flattening of the layout tree
* Nit
* Remove pbx changes
* Update CHANGELOG.md
* Add note about change in timing of _flattenedLayout capture
* Apply recommended warnings
* Squelch designated initializer warning in ASViewController
* Remove unused compiler flag
clang: warning: argument unused during compilation: '-fno-objc-arc-exceptions' [-Wunused-command-line-argument]
* Fix warning about overriding an instance variable within a category
Instance method 'methodOverrides' in category from _ASDisplayView.o overrides method from class in ASDisplayNode.o
* Remove use of NSHashTable for interface state delegates #trivial
* Stray line
* One more case
* Add code to let people have more delegates
* Do it more
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* remove uncessary assert
* Fix collection cell editing bug for iOS 9 & 10
* Revert "Fix collection cell editing bug for iOS 9 & 10"
This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.
* Fix interface state not update correctly during layer thrash
* add change log
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* remove uncessary assert
* Fix collection cell editing bug for iOS 9 & 10
* Do not cancel on exit, interface state update should handle it.
* Revert "Fix collection cell editing bug for iOS 9 & 10"
This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.
* add space to trigger ci
* add change log
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* remove uncessary assert
* Allow to add interface state delegate in background threads.
* Allow to add interface state delegate in background threads.
* lock around _interfaceStateDelegates
* lock _interfaceStateDelegates to local variable
* Fix comments
* remove extra spaces
* [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.
- Rename `ASDisplayNodeAssertLockUnownedByCurrentThread` to `ASAssertUnlocked`, and `ASDisplayNodeAssertLockOwnedByCurrentThread` to `ASAssertLocked` -> shorter and hopefully easier to distinguish between the two.
- Add assertions to `_locked_` and `_u_` (i.e "unlocked") methods.
- Turn `CHECK_LOCKING_SAFETY` flag on by default. After #1022 and #1023, we're in a good shape to actually enforce locked/unlocked requirements of internal methods. Our test suite passed, and we'll test more at Pinterest after the sync this week.
- Fix ASVideoNode to avoid calling `play` while holding the lock. That method inserts a subnode and must be called lock free.
- Simplify `_loaded(node)` to only nil-check `_layer` because regardless of whether the node is view or layer backed, the layer should always be set if loaded. Use it throughout.
- Other minor changes.
- Currently, there is a pair of mutex unlock and unlock that wraps around `-_u_measureNodeWithBoundsIfNecessary:` in `__layout`. That is because this method must be called without the lock.
- When an assertion occurs within that method, the runtime bails early without reacquire the lock (so the lock is free now). However, the runtime then hits the end of the outmost mutex locker scope and tries to release the lock that it no longer holds, causing another assertion in ASThread to be shown to user (#932). This makes it extremely hard to idenfity the root assertion.
- Fix by replacing the unlock/lock pair with a mutex unlocker.
* Adds support for having multiple interface state delegates.
Hopefully in a performant way.
* Switch to respondsToSelector for int del instead of separate object
* Add CHANGELOG
* Make ASDisplayNode+InterfaceState.h public
* Huy's comments
* Don't even bother removing since it's a weak hash table.
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* Fix pager node for interface coalescing
* Fix typo
* change log
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* disable interface coalescing and fix tests
* Revert to before coalescing for ease of reading
* refactor, make min change
* refactor
* add comments
* Add change log
* [ASDisplayNode] Add safeAreaInsets, layoutMargins and related properties to ASDisplayNode
* Add layoutMargins bridged to the underlying view
* Add safeAreaInsets bridged to the underlying view
* Add fallback calculation of safeAreaInsets for old iOS versions
* Add automaticallyRelayoutOnSafeAreaChanges and automaticallyRelayoutOnLayoutMarginsChanges properties
* Add additionalSafeAreaInsets property to ASViewController for compatibility with old iOS versions
* Provide safeAreaInsets for layer-backed nodes.
This also fixes tests.
* Fix crash when insetsLayoutMarginsFromSafeArea is set from a background thread
* Changes requested at code review:
* Update documentation for layoutMargins and safeAreaInsets properties. Suggest that users set the automaticallyRelayout* flags to ensure that their layout is synchronized to the margin's values.
* Fix accessing ASDisplayNode internal structures without a lock.
* Add shortcut in -[ASDisplayNode _fallbackUpdateSafeAreaOnChildren] to skip a child when possible.
* Add shortcut in ASViewController to avoid fallback safe area insets recalculation in iOS 11. Fix fallback safe area insets recalculation when the additionalSafeAreaInsets are set.
* Add debug check that a view controller's node is never reused without its view controller, so the viewControllerRoot flag value is always consistent.
* Use getters instead of reading ivars directly in -layoutMarginsDidChange and -safeAreaInsetsDidChange.
* Minor change in CHANGELOG
* Minor change in ASDisplayNodeTests.mm
* Update the dangerfile
* Make a trivial change to test new dangerfile
* Try out the new value with another trivial change
* Add a configuration API to make a unified place for pulling config from clients safely
* Specify properties for delegate
* Finish removing text experiment global enable
* Generate the config file
* Clean up configuration to fix tests
* Work on making it serializable
* Finish it up
* Fix example code
* Update sample project
* Clean up a few things
* Align with new project order
* Make it faster and update license header
* Add an option to specify your config at compile time
* Update another license header
* Add a version field, and bring interface state coalescing into configuration
* Update CA queue code
* Update CATransactionQueue tests
* Turn transaction queue on by default (for now, see comment)
* Update the tests
* Update the tests AGAIN
* Remove unused ordered set
* Make display node, layout spec, and style conform to NSLocking so that users/subclasses can access their locks
* Update the changelog
* Align slashes
* Put it back, when we're in ASDisplayNode
* Go a little further
* Put back the changes I didn't mean to commit
* Kick the CI
* Fix yoga build
* Put back non-locking change
* Address comments from Scott