Audit project for latest Swift toolchain (6.3.x) - #149
Draft
zmian wants to merge 14 commits into
Draft
Conversation
Update the hidden Resources package manifest to Swift tools 6.3, align Xcode project deployment metadata with the package's iOS 26 baseline, and avoid hard-coded version churn in README requirements. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Make intentional re-exports explicit with public import access and enable MemberImportVisibility for the package and tests. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files to import the module that defines member APIs they use; Meta.swift uses Foundation string replacement options. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using Publisher.values to import Combine directly instead of relying on transitive imports. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using SDWebImage UIImageView extensions to import SDWebImage directly. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using CNPostalAddress members to import Contacts directly. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires tests using Locale.Region static members to import Foundation directly. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires tests to import UIKit/Foundation for UIColor and Foundation-backed literal/member APIs they use. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires validation tests using Foundation-backed rule members to import Foundation directly. Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
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.
Summary
Audits the project for the latest Swift toolchain (6.3.x) with an iOS 26 deployment baseline, prioritizing correctness over diff size. Covers manifests, access-level imports, dead backward-compat scaffolding, and source-level adoption of current standard library / SwiftUI APIs. Verified end-to-end on CI (
macos-26, latest stable Xcode): Build, Test, Lint all green.Toolchain / manifests
Package.swift:swift-tools-version:6.3,swiftLanguageModes: [.v6], enabledMemberImportVisibilityon both targets.Resources/Package.swift:swift-tools-version:6.3.Xcore.xcodeproj/project.pbxproj: alignedLastSwiftUpdateCheckandIPHONEOS_DEPLOYMENT_TARGET(26.0).README.md: generic "latest SDK/Xcode/Swift" wording.Access-level imports (SE-0409)
public importalongside@_exportedinXcore.swiftand the ExampleExports.swift.MemberImportVisibility(Foundation,Combine,private import SDWebImage,internal import Contacts, plusFoundation/UIKitin several tests).Dead availability scaffolding (iOS 26 baseline)
@available(iOS <26)annotations:Mutex+Extensions,AsyncSequence+Extensions,NotificationCenter+Extensions,Clock+DispatchSourceTimer,Divided.if #available(iOS 18, *)runtime branches (removing unreachableelsefallbacks):UIHostingWindow,Date+Extensions,Date+Formatted,DynamicTextFieldPreviews.Modern stdlib / SwiftUI adoption
Collection.count(where:)— now provided by the stdlibSequence.count(where:)(Swift 6.0+) with O(1) space vs the oldfilter().count.DeviceSafeAreaInsetsProviderModifier: replacedGeometryReaderwithonGeometryChange, avoidingGeometryReader's layout side effects..cornerRadius(_:)(deprecated iOS 17) with the repo'scornerRadius(_:style:)wrapper (PopupPreviews,BoundedView).Intentionally left alone (with rationale)
Publisher+Extensions.swiftkeepsNSRecursiveLock— it is reentrant by design; a non-reentrantMutexwould deadlock.DynamicTextFieldStylekeeps its manual@preconcurrency EnvironmentKey— its default is@MainActor-isolated, which the@Entrymacro cannot express.Screen/Devicestay onObservableObject— they carry no stored observable state and signal viaobjectWillChangeon orientation change, which@Observable's access-tracking model would break.Collection+Sortkeypath helpers keep their hand-rolled bodies — the optional-keypath variant has bespoke nil-ordering thatKeyPathComparatorwould not preserve.AnyCodableretained; no built-in Foundation equivalent is currently superior.SystemAssetIdentifier+Symbols+NN.swiftkeep their@availablemarkers documenting each SF Symbol's introduction version.Follow-ups that need maintainer intent (not included)
These are correctness-relevant but change behavior/API and can't be validated without a device/design decision:
UIScreen.main(Screen), delegatewindow+barTintColor/appearance (Theme+Configure),statusBarFrame(Constants).@MainActortypes (InactivityMonitor,ImageView).