Remove unnecessary UIKit imports - #25812
Draft
jkmassel wants to merge 1 commit into
Draft
Conversation
Sweep files that import UIKit but reference no UIKit symbol. Where the import only provided Foundation via re-export, switch to `import Foundation`; CATransaction+Extension moves to `import QuartzCore` since CATransaction is Core Animation. Imports only, no behavior change. Follow-up to #25344.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33316 | |
| Version | PR #25812 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | df2edc9 | |
| Installation URL | 7m4sfd64mp210 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33316 | |
| Version | PR #25812 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | df2edc9 | |
| Installation URL | 7g5un0vrq5k80 |
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
import UIKitfrom files that reference no UIKit symbol — a follow-up to the cross-platform module split in #25344, where a stray UIKit import is what keeps a file (or an entire module) from compiling on platforms without UIKit.Summary
import UIKitcount drops from 933 → 877.WordPress/,Modules/,Sources/, andTests/. Every candidate was found by a heuristic pass (noUI*identifier, no UIKit-onlyNS*type, no UIKit extension-on-Foundation call) and then read individually to confirm.Changes
import UIKit→import FoundationURL,NSCoder,NSLocalizedString,SortDescriptor,HTTPCookieStorage, …) that UIKit was only re-exportingimport UIKitremovedimport UIKit→import QuartzCoreCATransaction+Extension.swift—CATransactionis Core Animation, not UIKit; a plain Foundation swap would not compileUIKit re-exports Foundation, so the Foundation swaps are load-bearing — deleting the import outright would break any file leaning on it for
URL/NSCoder/etc.SwiftUI,XCTest,CoreLocation, andWordPressDatado not reliably re-export Foundation.Test plan
xcodebuild build—WordPressscheme, iOS Simulator → BUILD SUCCEEDED, 0 errors (all 50 app/module source files)xcodebuild build-for-testing—WordPressUnitTestsplan → TEST BUILD SUCCEEDED, 0 errors (the 6 test files, across theWordPressTest,WordPressKitTests, andAsyncImageKitTeststargets)Related