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
Release 2.0 #11
Release 2.0 #11
Conversation
tkohout
commented
Jan 29, 2017
- Updated Swinject to 2.0
- Migrated to new swinject
- Resolved Mistaking too many initialiser arguments for a tuple #2 Added warnings when
- fails to resolve service with optional dependencies
- fails to resolve service with implicitly unwrapped dependencies
- fails to resolve service with more than maximum supported number of dependencies
- trying to register service with same type of dynamic arguments
- Added assert tests Testing asserts #6
- Added swift package manager Swift PM support? #9
…into separated files
# Conflicts: # Cartfile.resolved # Carthage/Checkouts/Nimble/Nimble.podspec # Carthage/Checkouts/Nimble/Nimble.xcodeproj/project.pbxproj # Carthage/Checkouts/Nimble/Sources/Nimble/Nimble.h # Sources/AutoRegistration.swift # bin/generate
…gistration into JiLiZART-swift-pm
.travis.yml
Outdated
- env: JOB="POD_LINT" | ||
script: | ||
- pod lib lint | ||
- env: JOB="XCODE" DEST="OS=8.4,name=iPhone 5" SCHEME="SwinjectAutoregistration-iOS" SDK="iphonesimulator" ACTION="test" |
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.
Changing the device to iPhone 5s looks ok to fix the error on Travis with Nimble.
https://travis-ci.org/Swinject/SwinjectAutoregistration/jobs/196326139
DEST="OS=8.4,name=iPhone 5s"
It looks good to run Carthage command with @tkohout, using the option is ok for you? |
👍 Good job guys on 2.0 release! @yoichitgy Is there a benefit of having carthage dependencies included as submodules and subprojects as opposed to just linked frameworks (not pushed in repo)? I suspect that when you have both |
Thanks @jakubvano for pointing out the issue👍👍👍 It looks good not to commit submodules. Or maybe users should add only SwinjectAutoregistration to Cartfile to install both SwinjectAutoregistration and Swinject??? For example, installation guide of ReactiveCocoa tells to add only ReactiveCocoa to Cartfile to install with ReactiveSwift. Are you familiar with this idea? I'm going to try some experiments. |
I get what you mean, but this approach would not cover the case when you use more than one Swinject extension (e.g. SwinjectAutoregistration and SwinjectStoryboard). |
I agree. My approach doesn't fit in the case using more than a Swinject extension. I'm going to have some experiment as @jakubvano said. |
I started adding depending projects to a project because of this issue: For example, Quick and Nimble were added as projects, not prebuilt frameworks. In the same way, I added Swinject project to SwinjectStoryboard and SwinjectPropertyLoader. The original issue looked already resolved, so we have no reasons to add depending projects. As @jakubvano told, we can just add frameworks built by Carthage, and depending projects can be removed from the repository. |
I made the migration to prebuilt frameworks in the following branch. I think it should be in another pull request, so that I'm going to just review this current pull request. |
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.
As my review, I added a comment about warnings to CheckResolved.swift
.
Also I found unit test it("throws assertion when same type arguments are passed")
failed only in case of tvOS target.
Sources/CheckResolved.swift
Outdated
let unresolved = ( [a] as [Any?] ).filter { $0 == nil } | ||
if unresolved.count > 0 { | ||
let warningsMessage = warnings(forInitializer: initializer).map { "\($0.message)\n" }.joined() | ||
fatalError("SwinjectAutoregistration: Resolution failed.\n\(warningsMessage)Unresolved service: \(unresolvedService(a)!)\nInitializer: (\(A.self)) -> \(Service.self)") |
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.
If this is just a warning message, shouldn't this be print
or NSLog
? The other warnings in this file are the same.
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.
Well the warnings describe what caused that the service was unresolved: Something like:
⚠ Autoregistration of implicitly unwrapped optional dependency (DependencyA)! is not supported. Use regular `register` method.
And if i would just print them before the fatalError they might have been overlooked
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.
The tvOS throw assertion fail is fixed
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.
Thank you for fixing the tvOS issue!
[nits] This is just a tiny thing, but if warningMessage
is used for fatalError
naming the parameter errorMessage
sounds less misunderstandable. Maybe related parameter names also sound good with "error"😉
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.
Thanks, I refactored the code to address your notes.
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.
Thank you for accepting my feedback😃🐶☀️
I think we can release v2.0.0 now. My changes to migrate to prebuilt frameworks can be released as v2.1 or v2.0.1 because the changes are not considered as breaking changes. |