-
Notifications
You must be signed in to change notification settings - Fork 117
Simplify Yosemite into a Swift package - Sources only #15755
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
Conversation
Generated by 🚫 Danger |
|
db60645
to
2e4a5f7
Compare
0aec18c
to
9660145
Compare
2e4a5f7
to
75bd727
Compare
product: CopiableProp<Yosemite.Product> = .copy | ||
note: CopiableProp<Note> = .copy, | ||
review: CopiableProp<ProductReview> = .copy, | ||
product: CopiableProp<Networking.Product> = .copy |
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 change from Yosemite.Product
to Networking.Product
can be explained by noticing that the former is but a typealias for the latter:
public typealias Product = Networking.Product |
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 probably fine, but pedantry could creep in here.
The WooCommerce
target isn't supposed to import from Networking
or Storage
, but to use Yosemite
instead... that's the reason for all the typealiases.
So my only concern is that something using this copy
function from the WooCommerce target might not be able to without first importing Networking, which it shouldn't do...
It's often better to make a specific model in Yosemite for use by WooCommerce, instead of proxying the Networking model, and you see that more with newer code... presumably if we did that for these examples, rake generate
would sort that out.
Do you know why the output changed here?
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.
Do you know why the output changed here?
I can't say for certain, but my guess is that it has to do with referencing a list of files as opposed to accessing them through the Xcode project. We obviously cannot use the project now because it's no longer there, and for some reason accessing via the package does not work either, I left some more details in #15702
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.
So my only concern is that something using this copy function from the WooCommerce target might not be able to without first importing Networking, which it shouldn't do...
I tried this quickly locally and it worked without Networking.
diff --git a/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift b/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift
index d5df7f6d9f..3846b3416b 100644
--- a/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift
+++ b/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift
@@ -2,10 +2,7 @@ import Combine
import Foundation
import UIKit
-import enum Yosemite.ProductReviewAction
-import enum Yosemite.NotificationAction
-import struct Yosemite.ProductReviewFromNoteParcel
-import protocol Yosemite.StoresManager
+import Yosemite
/// Coordinator for the HubMenu tab.
///
@@ -120,6 +117,7 @@ final class HubMenuCoordinator {
}
private func pushReviewDetailsViewController(using parcel: ProductReviewFromNoteParcel) {
+ _ = parcel.copy()
hubMenuController?.pushReviewDetailsViewController(using: parcel)
}
}
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.
75bd727
to
2c04a26
Compare
9660145
to
7bdc4dd
Compare
2c04a26
to
5a1e7e9
Compare
7bdc4dd
to
8c82f5e
Compare
5a1e7e9
to
284c9fc
Compare
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 one looks good as well. Tested on simulators, but I'll check on a device when I get a chance too.
product: CopiableProp<Yosemite.Product> = .copy | ||
note: CopiableProp<Note> = .copy, | ||
review: CopiableProp<ProductReview> = .copy, | ||
product: CopiableProp<Networking.Product> = .copy |
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 probably fine, but pedantry could creep in here.
The WooCommerce
target isn't supposed to import from Networking
or Storage
, but to use Yosemite
instead... that's the reason for all the typealiases.
So my only concern is that something using this copy
function from the WooCommerce target might not be able to without first importing Networking, which it shouldn't do...
It's often better to make a specific model in Yosemite for use by WooCommerce, instead of proxying the Networking model, and you see that more with newer code... presumably if we did that for these examples, rake generate
would sort that out.
Do you know why the output changed here?
@@ -1,4 +1,5 @@ | |||
import Photos | |||
import UIKit |
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 surprising to see this one imported in Yosemite... but I see it's needed for UIImage. I guess we got this import for free before...
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.
Yes. It came from the umbrella header:
#import <UIKit/UIKit.h> |
284c9fc
to
045d091
Compare
Description
See https://linear.app/a8c/issue/AINFRA-468.
Based on top of #15744 and based off the original work from #15678 .
This first PR moves the Yosemite sources from being a framework to being a Swift package.
Steps to reproduce & Testing information
See green CI. Also check out the prototype build.
Screenshots
RELEASE-NOTES.txt
if necessary. — N.A.