Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASCollectionView] Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate #1740

Closed
wants to merge 2 commits into from

Conversation

tberman
Copy link

@tberman tberman commented Jun 10, 2016

Small change w/ some associated cleanup, this feels like a delegate method, not a datasource method.

@levi
Copy link
Contributor

levi commented Jun 10, 2016

Thanks for this, @tberman! Definitely a needed improvement for an API that hasn't seen much light.

@ghost
Copy link

ghost commented Jun 10, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@ghost
Copy link

ghost commented Jun 10, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost ghost added the CLA Signed label Jun 10, 2016
@appleguy
Copy link
Contributor

@tberman @levi interesting idea. Technically, this is a breaking API change, Although it might be rare to find an application which sets these variables differently. Did you have a chance to look at the table API to make sure there is not an equivalent modification?

Welcome, @tberman !

@maicki
Copy link
Contributor

maicki commented Jun 11, 2016

We have to be careful with this change as @appleguy points out these are breaking API changes e.g. in Pinterest we would have to rewrite a couple of places to integrate this change.

@tberman
Copy link
Author

tberman commented Jun 11, 2016

@tberman @levi interesting idea. Technically, this is a breaking API change, Although it might be rare to find an application which sets these variables differently. Did you have a chance to look at the table API to make sure there is not an equivalent modification?

Nothing that looked similar to me.

I came across this and felt it was strangely placed when I was implementing a common data source that did some more intelligent animated insertion and diffing and realized that this was implemented on the data source and the delegate, and it felt very out of place, which is what drove the change.

Curious on breaking changes what the policy is?

@maicki
Copy link
Contributor

maicki commented Jun 11, 2016

Agree that it's kind of out of place if you look up a similar method int UITableView / UICollectionView data source and delegate protocols.

If we want to integrate the change we would deprecate it in versions < 2.0 and planning to remove all deprecations / breaking API changes with 2.0.

Look into the ASTextNode (Deprecated) category for an example.

@tberman
Copy link
Author

tberman commented Jun 12, 2016

Alright, @maicki and @appleguy, updated to include a deprecated notice, and call the delegate first.

@maicki maicki changed the title Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate [ASCollectionView] Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate Jun 24, 2016
@maicki
Copy link
Contributor

maicki commented Aug 4, 2016

Hey @tberman can you please rebase the master branch of your fork on top of the latest upstream master and rebase this PR branch on top. We will likely merge that pretty soon. Thanks!

@ghost ghost added the CLA Signed label Aug 4, 2016
@hannahmbanana
Copy link
Contributor

@tberman: We'd love to merge this into master today. Would it be possible to rebase this? Thanks!

@maicki
Copy link
Contributor

maicki commented Aug 12, 2016

@tberman Thank you very much for all of the work you put into that, we really appreciate it!

I pulled in your changes into a new PR as there where some merge conflicts: #2065 therefore I also will close this PR.

@maicki maicki closed this Aug 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants