Remove unused wordpress-rs dependency from the stats widget - #25966
Open
jkmassel wants to merge 1 commit into
Open
Remove unused wordpress-rs dependency from the stats widget#25966jkmassel wants to merge 1 commit into
jkmassel wants to merge 1 commit into
Conversation
`XcodeTarget_StatsWidget` linked `WordPressAPI` (and its static `wordpress-rs` xcframework), but neither the widget target nor `JetpackStatsWidgetsCore` references any of its symbols — the static library was duplicated into `JetpackStatsWidgets.appex` as dead weight. Removing the dependency drops ~26.6 MB of loaded code (`__TEXT` 33.0 -> 8.0 MB) from the widget binary (arm64/Release) with no functional change; the widget still builds and links cleanly.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 34119 | |
| Version | PR #25966 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | a75aee3 | |
| Installation URL | 7tp6tspav35fo |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 34119 | |
| Version | PR #25966 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | a75aee3 | |
| Installation URL | 7c9ak3frbvts8 |
crazytonyli
approved these changes
Sep 2, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Removes a stray dependency that linked the entire
wordpress-rsstatic library into the stats widget, which never used it.Summary
XcodeTarget_StatsWidget(the SPM product backingJetpackStatsWidgets.appex) declared.product(name: "WordPressAPI", package: "wordpress-rs"), but nothing in the widget references it.wordpress-rsships as a static library (libwp_mobile.a), so it was copied into the widget binary as dead code — duplicating what the main app already carries.Root Cause
The widget target imports only
JetpackStatsWidgetsCore,WidgetKit, andFoundation.JetpackStatsWidgetsCoredepends solely onBuildSettingsKit, and none of the widget's other declared dependencies (WordPressKit,WordPressShared,WordPressUI,TracksMini) pull inwordpress-rs. TheWordPressAPIproduct was the sole path linking it in, and it was unreferenced — grepping the widget target and its core module for anyWordPressAPI/uniffi/wp_apisymbol returns nothing.Dead code stripping doesn't cover this:
DEAD_CODE_STRIPPINGis already on for Release, but linking theWordPressAPISwift module pins its metadata → the uniffi FFI thunks → the Rust archive, so the linker retains the whole thing even though the widget's own code never calls it. The fix is to not link it. The main app iswordpress-rs's only genuine consumer and is unchanged.Impact
Measured on the arm64 device slice, Release configuration,
JetpackStatsWidgets.appex:__TEXT(code)__DATA_CONST+__DATAwordpress-rs/ uniffi /WordPressAPIsymbolsFigures are uncompressed — the App Store download delta will be smaller after compression, but the on-device install footprint drops by the full amount.
Test Plan
JetpackStatsWidgetsbuilds and links in Release (arm64) with the dependency removedwordpress-rs/uniffi/WordPressAPIsymbols remain in the widget binary