-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Sort edit commands during batch updating of table and collection views #753
Sort edit commands during batch updating of table and collection views #753
Conversation
Gonna check this out tonight, @nguyenhuy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asdk_inverseCompare
, or switch asdk_isFlowLayout
to match.
Clean addition on top of data controller. Would love it if the reasoning behind the design was well documented at the |
@levi Thanks for taking a look. I agree with you that That's said, it's really helpful if you could point out what are the things you would love to see in the documentation, from a new user (of that class) point of view. |
@nguyenhuy can you look at the test failures with the build? I did try re-running it, in case it was a flaky test, but it seems like it probably isn't. |
BTW - this is an extremely awesome patch and another huge contribution to the community. I can't believe how fast you did this following @levi's diff landing, lol!! Thank you! |
Sure, I will look at the failed test. Looks like its the same one reported in #758. Although I believe this diff should work nicely with @levi's supplementary-view feature, I admit that I haven't looked at the underlying diff closely and there might be some integration problems that I overlooked. I will recheck everything. |
Awesome! @nguyenhuy once the test is fixed, do you consider this diff ready to land, or believe that any iteration is needed? |
Probably one iteration needed. I will add short documentation and some tests, as well as fixing small implementation details in |
@nguyenhuy just a quick glance at the conversations in the other issues, I'd love to see the documentation talk about the native ordering in UITableView/UICollectionView and that the |
@levi: yes, I will write that down. Thanks! |
Awesome PR! Pursuant to @levi's point, maybe include this link: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/ManageInsertDeleteRow/ManageInsertDeleteRow.html#//apple_ref/doc/uid/TP40007451-CH10-SW17 The |
ec1b33f
to
7e3df3b
Compare
@levi I removed duplicate steps in _ASHierarchyChangeSet in @levi, @Adlai-Holler: I also added documentation to ASChangeSetDataController. Let me know what you think. Thanks. @appleguy This PR is more or less ready to land. I will write some tests for these new classes in the next few days (and push to a new PR if this one landed by then). |
7e3df3b
to
2b0829c
Compare
@nguyenhuy Thanks! Do you think this is safe to include the 1.9 release if I were to push it today? I would like to do the release today, and having this improvement would definitely be a milestone. |
Yeah it would be nice to have this diff tested by other users. I will act quickly on any problems reported. |
@nguyenhuy could you take a quick look at the test failures now occurring on master? I'm downloading Xcode 6.4 so I can try to reproduce locally, but it's definitely blocked my work for the weekend (wanted to get a lot of PRs merged today, but lots else to do, like writing release notes / preparing release / working on documentation / ASPagerNode etc) |
Btw, the failed test looks familiar and should be resolved by #770. |
Yeah, looking at the failures on master.
|
@nguyenhuy it looks like master is green, but even re-running the tests here is failing. It's possible the test is still flaky but I think this diff may have actually regressed something. Check out the build... Failures: |
@nguyenhuy "fortunately", it looks like the test failures are real. I re-confirmed master is passing tests on Xcode 6.4 locally, and checked out this PR to run them again and got the same failure as the builedbot (2 total tests in my case though, both testRelayoutAllRowsWithZeroSizeInitially and testRelayoutAllRowsWithNonZeroSizeInitially). |
I think it's because Travis run the tests without virtually/temporary merging this branch into master, i.e the new fix on master isn't included. Let me rebase this branch. |
2b0829c
to
ecc5e1a
Compare
Oh, weird that it didn't rebase when re-running the build. I'm pretty sure it normally does that, but maybe some other automatic action usually triggers the rebase builds. Thanks, I'm excited to have almost all the open PRs merged. Now we need master to be hit with a day of testing to pave out the recent table changes. I'd like to reset the 1.9 release tag point to include the recent improvements, if at all possible. Could folks bump the ASDK version you're testing against and let us know if you hit anything? @rcancro, @eanagel, @levi, @Adlai-Holler |
@nguyenhuy hmm, still failed in the number of layouts on main thing... https://travis-ci.org/facebook/AsyncDisplayKit/jobs/87395262 /Users/travis/build/facebook/AsyncDisplayKit/AsyncDisplayKitTests/ASTableViewTests.m:426: ((node.numberOfLayoutsOnMainThread) equal to (1)) failed: ("0") is not equal to ("1"): |
Ok, I will recheck everything here. Thanks for the heads up :) |
If it’s late wherever you are, don’t rush! I need to write the release notes anyway, which I won’t have done for approximately 24hrs anyway.
|
It's early morning over here. But yeah, shouldn't rush this thing. Thanks. |
- After node constrained sizes were changed (because the table view width was changed, for example) and before relayoutAllNodes is executed (on main), if there is any layout tasks being executed on background, the new sizes will be used immediately. Therefore, by the time relayoutAllNodes is performed, some nodes already have an up-to-date layout and don't need to remeasure. - As a result, after relayoutAllNodes is completed, the number of layout passes performed on main thread for each node increased between 0 and 1 (i.e some nodes were remeasured, others weren't). ASTableViewTests is updated to assert this behaviour.
- Injection can be done via a new internal initializer. The class will be used by ASTableView to create (and configure) a new data controller. - ASTableViewTests now injects its own type of ASDataController. This facilitates new ways for testing ASTableView-specific behaviours. The first application is counting the number of times relayoutAllNodes is called on the data controller.
fd732cd
to
72fca53
Compare
@appleguy You are right, Travis does merge the branch with master and run the tests on top of the merge commit. I just had a hard time believing the tests were still failing and desperately looked for someone to blame. How silly I am! But I think I found out the root cause and fixed it. All checks have passed 👏 |
This reverts commit 7533118.
Sort edit commands during batch updating of table and collection views
This may be one of the most satisfying-to-click Merge buttons I've done for ASDK :). ASDataController has really gone from the Achilles heel of the framework to one of its most capable and unique components. |
#684, #693.
@levi, @Adlai-Holler: Please also let me know your thoughts on this PR. Thanks.