New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove addProgressCallback, add createDownloaderOperationWithUrl #2336
Conversation
I don't think the original code is good design. The first thing I saw was createCallback code, while the main logic is in addProgressCallback method, which not conducive to reading. |
Codecov Report
@@ Coverage Diff @@
## master #2336 +/- ##
==========================================
- Coverage 75.44% 75.32% -0.13%
==========================================
Files 36 36
Lines 3837 3826 -11
==========================================
- Hits 2895 2882 -13
- Misses 942 944 +2
Continue to review full report at Codecov.
|
I see your point @gukemanbu, but this change is breaking compatibility. We can talk about it, for a major release. |
This does not cause API breaking...Since the changes only happend on the implementation files. But...Actually seems this change will not provide any benefit except for contributor readability, and at that time I have more things to do. So I just forget this because I guess maybe it's in a relative low priority.... 😅 |
@gukemanbu I didn't properly look at your PR the last time, sorry for that. Regarding this PR here, I agree with you. The code design was not that great, I think your's is much cleaner. I will look at this one more time and try to merge it. |
remove addProgressCallback, add createDownloaderOperationWithUrl
I did merge it - so thanks @gukemanbu
|
@gukemanbu This refactory, will not be available for 5.x branch. Now |
@dreampiggy I think this change is not a big one. We will need to merge |
@bpoplauschi The diff is hard..I try to merge one, but however, this are many conflicts, nearlly 20+ files. 😅 I suggest to view the diff result, but using git diff and copy the code instead...Especially any changes into |
Hmm, I see only 6 files with conflict. I see d5b60c6 commit was a merge from |
I will look into this merge. |
@bpoplauschi You can try simulate to merge #2399 #2409 together...Because these PR change the Anyway, I don't mean impossible, but it's just need more time, maybe I can try provide a merge. |
completedBlock:(SDWebImageDownloaderCompletedBlock)completedBlock | ||
forURL:(nullable NSURL *)url | ||
createCallback:(SDWebImageDownloaderOperation *(^)(void))createCallback; | ||
- (SDWebImageDownloaderOperation *)createDownloaderOperationWithUrl:(nullable NSURL *)url options:(SDWebImageDownloaderOptions)options; |
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.
This return value, in 4.x, should be NSOpration<SDWebImageDownloadOperationInterface>
.
Maybe we can create another commit to fix it, leave it is OK as well.
Anyway, I fix this during 5.x merge.
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.
It's fixed in the merge commit. Here we still see the diff with the original branch, without the conflicts fixed.
} forURL:nil createCallback:nil]; | ||
[self waitForExpectationsWithTimeout:0.5 handler:nil]; | ||
- (void)test07ThatCreateDownloaderOperationWithNilUrl { | ||
[[SDWebImageDownloader sharedDownloader] createDownloaderOperationWithUrl:nil options:0]; |
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.
I think, if we change the method to just createDownloaderOperationWithUrl
. The url
arg should be nonnull, because when the url is nil, the caller method downloadImageWithURL:
already handle this case and earily return the response. So actually this should be removed.
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.
I've also fixed this in the merge commit. Check that. 676a4b5
@bpoplauschi I merge the lastest master to 5.x in 8b7e88d. Actually the changes is only about this PR (Another changes which apply to FLAnimatedImage, is already fixed in SDWebImageFLPlugin). Actually, just some code movement, this PR :) |
Yeap. Thanks @dreampiggy for doing the merge. I was doing it myself, but that's ok. |
Thank you all! |
@gukemanbu Thanks a lot for showing interest and contributing to SDWebImage!
Pitch in with what seems comfortable: comment on open issues/PRs, triage, improve documentation, write your own PRs. Quote from Moya Contributing guide. |
@gukemanbu did you see my invitation addressed to you above? |
@bpoplauschi I'm too busy these days to see it in time, Sorry for the late reply, I'd love to become a maintainer. |
Awesome @gukemanbu. I sent you an invitation to the organization. |
@bpoplauschi Thank you very much,I have accepted the invitation。 |
New Pull Request Checklist
I have read and understood the CONTRIBUTING guide
I have read the Documentation
I have searched for a similar pull request in the project and found none
I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)
I have added the required tests to prove the fix/feature I am adding
I have updated the documentation (if necessary)
I have run the tests and they pass
I have run the lint and it passes (
pod lib lint
)This merge request fixes / reffers to the following issues: ...
Pull Request Description
...