Skip to content

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Jun 17, 2025

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

image

image


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mokagio mokagio added this to the 22.7 milestone Jun 17, 2025
@mokagio mokagio self-assigned this Jun 17, 2025
@mokagio mokagio added the category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. label Jun 17, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 18, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30686
VersionPR #15771
Bundle IDcom.automattic.alpha.woocommerce
Commit26688b4
Installation URL784v157gk7g50
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@mokagio mokagio marked this pull request as ready for review June 18, 2025 00:50
@mokagio mokagio force-pushed the ainfra-606-try-the-wormholy-swiftpm-pr branch from f25a1d5 to 8a2d783 Compare June 18, 2025 01:07
@mokagio mokagio requested review from a team and jaclync June 18, 2025 01:14
Copy link
Contributor

@jaclync jaclync left a 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."
)
Copy link
Contributor

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"),
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor

@AliSoftware AliSoftware Jun 26, 2025

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.

@mokagio mokagio force-pushed the ainfra-606-try-the-wormholy-swiftpm-pr branch from 8a2d783 to b67de20 Compare June 19, 2025 05:12
@mokagio mokagio force-pushed the ainfra-606-try-the-wormholy-swiftpm-pr branch from b67de20 to 26688b4 Compare June 24, 2025 08:04
@mokagio
Copy link
Contributor Author

mokagio commented Jun 25, 2025

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.

@jaclync
Copy link
Contributor

jaclync commented Jun 25, 2025

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.

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.

@mokagio mokagio merged commit a15f596 into trunk Jun 26, 2025
13 checks passed
@mokagio mokagio deleted the ainfra-606-try-the-wormholy-swiftpm-pr branch June 26, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants