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

[ios][contacts] Migrate to Expo Modules #25696

Merged
merged 9 commits into from
Mar 6, 2024
Merged

Conversation

alanjhughes
Copy link
Collaborator

@alanjhughes alanjhughes commented Dec 1, 2023

Why

Closes ENG-10691
One of the last modules to be migrate

How

Usual migration steps.

Test Plan

bare-expo and NCL

@expo-bot expo-bot added the bot: needs changes ExpoBot found things that don't meet our guidelines label Dec 1, 2023
@fobos531
Copy link
Contributor

fobos531 commented Dec 1, 2023

Very excited for this one! It will definitely help building this: #2645 🔥

@alanjhughes alanjhughes marked this pull request as ready for review December 8, 2023 09:40
Copy link

linear bot commented Dec 14, 2023

@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

❌ Error: SwiftLint Violations


Found 4 violations, 3 serious. See the review comments below for more insights.


Generated by ExpoBot 🤖 against f683686

private let delegate = ContactControllerDelegate()
private var presentingViewController: UIViewController?

public func definition() -> ModuleDefinition {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔴 SwiftLint: Cyclomatic Complexity Violation

Function should have complexity 20 or less; currently complexity is 33

}
}.runOnQueue(.main)

AsyncFunction("presentFormAsync") { (identifier: String?, data: Contact, options: FormOptions, promise: Promise) in
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔴 SwiftLint: Closure Body Length Violation

Closure body should span 50 lines or less excluding comments and whitespace: currently spans 53 lines

}
}

private func mutateContact(_ contact: inout CNMutableContact, with data: Contact) throws {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟠 SwiftLint: Cyclomatic Complexity Violation

Function should have complexity 20 or less; currently complexity is 26

return descriptors
}

func serializeContact(person: CNContact, keys: [String]?, directory: URL?) throws -> [String: Any] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔴 SwiftLint: Cyclomatic Complexity Violation

Function should have complexity 20 or less; currently complexity is 37

@fobos531
Copy link
Contributor

fobos531 commented Mar 4, 2024

Hey @alanjhughes , is there anything blocking this from getting merged?

@alanjhughes
Copy link
Collaborator Author

Hey @fobos531, no, it just needs to be reviewed.

@fobos531
Copy link
Contributor

fobos531 commented Mar 4, 2024

Hey @fobos531, no, it just needs to be reviewed.

Okay, that is good to hear. If I want to contribute something to expo-contacts (both for iOS and Android) at this point, should I fork from your branch (@alanhughes/ios/contacts) or wait until this gets merged?

@@ -647,7 +647,7 @@ export async function getContactByIdAsync(
pageSize: 1,
pageOffset: 0,
fields,
id,
id: Array.isArray(id) ? id : [id],
Copy link
Member

Choose a reason for hiding this comment

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

This is probably not necessary, afaik if you have an array type on the native side, a single item will be automatically arrayized during conversion 😉

Copy link
Contributor

@lukmccall lukmccall Mar 4, 2024

Choose a reason for hiding this comment

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

It may not work on Android 😅 I don't remember if I implemented it.

@alanjhughes alanjhughes merged commit d451ab6 into main Mar 6, 2024
12 checks passed
@alanjhughes alanjhughes deleted the @alanhughes/ios/contacts branch March 6, 2024 08:20
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: needs changes ExpoBot found things that don't meet our guidelines published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants