Skip to content
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

Upgrade to Swift 3 #43

Merged
merged 28 commits into from
Nov 6, 2016
Merged

Upgrade to Swift 3 #43

merged 28 commits into from
Nov 6, 2016

Conversation

ikesyo
Copy link
Collaborator

@ikesyo ikesyo commented Nov 5, 2016

Although I don't fully audit API naming nor add @availables yet, this looks working well.

let f = curry(RepositoryInfo.init)

return f
let ff = f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand what's happening, you're splitting the mapping so it's less complicated for Swift?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Without the change, the files can't be compiled.

Copy link
Owner

@mdiep mdiep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks for working on this.

I noted the API changes I think we need for the Swift 3 style. I'm happy to make them here or elsewhere if you don't want to do it here.

}

/// Fetch the user with the given login.
public func userWithLogin(login: String) -> SignalProducer<(Response, UserInfo), Error> {
return fetchOne(.UserInfo(login: login))
public func userWithLogin(_ login: String) -> SignalProducer<(Response, UserInfo), Error> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become user(login:)

}

public func issuesInRepository(repository: Repository, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [Issue]), Error> {
public func issuesInRepository(_ repository: Repository, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [Issue]), Error> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become issues(in:page:perPage:)

}

/// Fetch the comments posted on an issue
public func commentsOnIssue(issue: Int, repository: Repository, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [Comment]), Error> {
public func commentsOnIssue(_ issue: Int, repository: Repository, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [Comment]), Error> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become comments(on:repository:page:perPage:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the first parameter is Int, this should be considered: https://swift.org/documentation/api-design-guidelines/#weak-type-information.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consistently used in for the second parameter of Repository type. How do you think about it?

}

/// Fetch the repositories for a specific user
public func repositoriesForUser(user: String, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [RepositoryInfo]), Error> {
return fetchMany(.RepositoriesForUser(user: user), page: page, pageSize: perPage)
public func repositoriesForUser(_ user: String, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [RepositoryInfo]), Error> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become repositories(for:page:perPage:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the first parameter is String, this should be considered: https://swift.org/documentation/api-design-guidelines/#weak-type-information.

}

/// Fetch the repositories for a specific organisation
public func repositoriesForOrganization(organization: String, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [RepositoryInfo]), Error> {
return fetchMany(.RepositoriesForOrganization(organization: organization), page: page, pageSize: perPage)
public func repositoriesForOrganization(_ organization: String, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [RepositoryInfo]), Error> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should become repositories(for:page:perPage:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the first parameter is String, this should be considered: https://swift.org/documentation/api-design-guidelines/#weak-type-information.

@mdiep
Copy link
Owner

mdiep commented Nov 6, 2016

Thanks @ikesyo!

We'll want to wait for a stable version of ReactiveSwift before we release this, but this is great!

@mdiep mdiep merged commit ae68d95 into master Nov 6, 2016
@mdiep mdiep deleted the swift3 branch November 6, 2016 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants