-
Notifications
You must be signed in to change notification settings - Fork 120
Restore Wormholy, now installed via a fork supporting latest SPM #15771
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
|
|
f25a1d5 to
8a2d783
Compare
jaclync
left a comment
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 for adding it back, I can access the tool again! Tested in iPad simulator and device, the popover behavior is a bit off but still usable. I just had a question about if it's possible to exclude it in the release builds, but if it doesn't affect the build size / performance it's fine to include it.
| static let launchWormHolyDebug = NSLocalizedString( | ||
| "Launch Wormholy Debug", | ||
| comment: "Opens an internal library called Wormholy. Not visible to users." | ||
| ) |
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.
nit: we don't have to localize this string as this is developer-facing.
| .package(url: "https://github.com/markiv/SwiftUI-Shimmer", from: "1.0.0"), | ||
| .package(url: "https://github.com/nalexn/ViewInspector", from: "0.10.0"), | ||
| .package(url: "https://github.com/onevcat/Kingfisher", from: "7.6.2"), | ||
| .package(url: "https://github.com/pmusolino/Wormholy", from: "2.0.0"), |
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.
Just wondering, can the package not get included in production builds in SPM? I tried building the app with the release build configuration and I still saw the related files being built. Not sure if the final build is optimized so that unused packages are removed, or this is just not supported in SPM.
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.
Unfortunately, Swift package manager does not support conditional compilation.
I know Apple does post processing of the IPA we send them, but I don't know if it removes unused frameworks.
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.
Unfortunately, Swift package manager does not support conditional compilation.
Actually, maybe I'm wrong, see https://developer.apple.com/documentation/packagedescription/buildsettingcondition
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.
Turns out I was right... Unfortunately.
SwiftPM allows conditional platform dependencies, but not conditional configurations.
See https://github.com/swiftlang/swift-evolution/blob/main/proposals/0273-swiftpm-conditional-target-dependencies.md which proposed both but is marked as implemented only for platform conditions.
It was possible at some point, but the capability was removed swiftlang/swift-package-manager#2598
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 a lot for looking into the feasibility. Is there a quick way to know how a library contributes to the app size? Would be great not to add to the app size as we've already got a warning about the > 200MB download size p91TBi-dnB-p2.
I know Apple does post processing of the IPA we send them, but I don't know if it removes unused frameworks.
I hope so.
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.
I doubt a debugging library would take up a lot of space though, […]
I know Apple does post processing of the IPA we send them, but I don't know if it removes unused frameworks.
For the record, I asked xcodebuild to generate the App Thinning Report with and without Wormholy and here is the thinned size comparison for the iPhone17.5, iOS 18.0 variant:
For iPhone17,5 & iOS 18 |
Download Size | Install Size |
|---|---|---|
| With Wormholy | 97.22 MB | 191.50 MB |
| Without Wormholy | 97.09 MB | 191.20 MB |
This is not a perfect comparison, as App Store might do additional optimizations, but should still be a pretty good indicator.
8a2d783 to
b67de20
Compare
b67de20 to
26688b4
Compare
|
I was hoping to sort out how to strip Wormholy from the Release build before merging this but I run into some issues. For the record, I also tried the suggestion here pmusolino/Wormholy#144 (comment) but was not able to get it to work. @jaclync you approved the PR already, which I take as you being okay with adding the package to the Release build, too. But I just wanted to confirm explicitly. I think it's okay. The library doesn't have private APIs as far as I can see, so it should be fine to include in Release even if we don't use it. |
Thanks a bunch for looking into ways to remove it from the release build, it (excluding a dependency in certain build configurations) sounds like a feature that is best supported in SPM even though it does not currently. I doubt a debugging library would take up a lot of space though, I downloaded the zip and the whole folder including the demo folder took up 673 KB (852 KB on disk) with the Sources folder being 133 KB (233 KB on disk). I'd say let's go for it, and if app size proves to be an issue with the library contributing to it by a significant amount, we can remove it. |

Description
See removal PR #15668 and Wormholy PR pmusolino/Wormholy#154
https://linear.app/a8c/issue/AINFRA-606
Steps to reproduce & Testing information
Run on a device to verify it works
RELEASE-NOTES.txtif necessary.