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

Extract models into a separate Core module #437

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaishin
Copy link

@kaishin kaishin commented Jan 27, 2024

This PR is the first step of addressing #434 .

),
.testTarget(
name: "MeiliSearchUnitTests",
dependencies: ["MeiliSearch"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: where we reference target names, let's be consistent and use the static variable

Suggested change
dependencies: ["MeiliSearch"]
dependencies: [.target(MeiliSearch)]

dependencies.append(.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"))
targets.append(
.target(
name: MeiliSearchNIO,
Copy link
Collaborator

Choose a reason for hiding this comment

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

major: this PR will currently fail to build as-is due to this target path not existing. shall we delete this entire Linux section until you contribute the NIO integration in your next PR?

)
]

#if os(Linux) || USE_NIO
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment: I like the use of USE_NIO here as it'll allow macOS clients (for working on Vapor projects locally) to build the NIO integration. When we add the NIO integration (presumably the next PR), let's document how to use this.

Comment on lines -8 to +5
private static let current = "0.15.0"
public static let current = "0.15.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: why has the access level of this variable changed? where else is it used?

Comment on lines -8 to +5
private static let current = "0.15.0"
public static let current = "0.15.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: let's make sure we update the documentation where this line of code is referenced (the path to this file)

Comment on lines -8 to +5
private static let current = "0.15.0"
public static let current = "0.15.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: let's make sure we update the Podspec where this line of code is referenced (the path to this file)

@@ -1,4 +1,5 @@
@testable import MeiliSearch
@testable import MeiliSearchCore
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: do we require @testable for the core target? 99% of models within are public (applicable to all tests)

]
),
.target(
name: MeiliSearchCore,
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment: this new target should not break the Podspec as it does a global search for all Swift files within the Sources directory, however when we do add the NIO target it will fail to compile due to the lack of the dependency.

AHC (or NIO) is not available officially on CocoaPods, so this will be a SPM-only feature. I'm okay with that but we must document it and ensure that CocoaPods does continue to work (even if only using Foundation).

@kaishin
Copy link
Author

kaishin commented Jan 27, 2024

@Sherlouk Thanks for the review! I wasn't expecting it yet as this is still a draft but happy to address the comments I hadn't planned to address.

@Sherlouk
Copy link
Collaborator

happy to address the comments I hadn't planned to address

No worries, thought I may as well share some guiding thoughts. Looks like great progress towards the shared goal 👍

@Sherlouk
Copy link
Collaborator

Sherlouk commented Jul 1, 2024

Hey @kaishin - just wondering how you're feeling about this?

@kaishin
Copy link
Author

kaishin commented Aug 1, 2024

@Sherlouk The project where I used MeiliSearch got deprioritized during spring so I couldn't get myself to dedicate time to finish this, but that's gonna be changing this month so perhaps let's timebox this to August? If I don't get it done this month I am unlikely to finish it afterwards.

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.

2 participants