Skip to content

Remove the breaking changes so the next release can be 2.1.0 - #454

Merged
iziz merged 1 commit into
masterfrom
revert-breaking-changes
Sep 12, 2026
Merged

iziz merged 1 commit into
masterfrom
revert-breaking-changes

Conversation

@iziz

@iziz iziz commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Removes the two breaking changes that landed in #452, so the next release can be 2.1.0 instead of a major published days after 2.0.0.

Neither was required for Swift 6 adoption. All six statics that were errors in the Swift 6 language mode — the five facade shared instances and PhoneNumberFieldStyle.automatic — are fixed by purely additive Sendable conformances, which stay. The package still builds clean in the Swift 6 language mode with zero warnings.

Why not just number it 2.1.0 as-is

The podspecs depend on each other with ~> 2.0.1 and the README documents ~> 2.0. Shipping breaking changes as 2.1.0 means every consumer on ~> 2.0 picks them up on a routine update and finds out at compile time. The version number has to match the compatibility, so the fix is to remove the incompatibility.

What is reverted

PhoneNumberFieldState.error goes back to Error?. Narrowing it to PhoneNumberValueError made the state Sendable and its Equatable conformance synthesized, but it discarded information: callers previously received the NSError raised by the Objective-C core and could read its domain, code, and userInfo, where the enum preserves only a description string. The custom equality that compares error descriptions comes back with it.

PhoneNumberEnriching loses its Sendable requirement, along with the PhoneNumberFieldFormatter conformance it enabled. A protocol requirement added to a published protocol invalidates any conformance capturing non-Sendable state.

PhoneNumberFieldState is therefore not Sendable. Callers who need field state across a concurrency domain should derive a PhoneNumberValue, which is; the updated test demonstrates it and the changelog says so.

What is kept

Everything else from #452: the Swift 6 language mode, the tools-version bump, visionOS, all five facade Sendable conformances, PhoneNumberFieldStyle: Sendable, the PhoneNumberValueError improvements, the deprecation of PhoneNumberError, the test suites, the CI matrix, and the docs.

Remaining compatibility note

swift-tools-version:6.0 raises the minimum toolchain for Swift Package Manager consumers to Xcode 16. Deployment targets are unchanged and the CocoaPods specs accept Swift 5.9 or 6.0, so CocoaPods users are unaffected. This is documented at the top of the changelog's unreleased section rather than buried in a bullet.

Tests

  • swift build — Swift 6 language mode, 0 warnings
  • swift test — 231 XCTest + 43 Swift Testing, 0 failures
  • git diff --check

Notes

  • CHANGELOG.md is rewritten from "must be published as a major version" to a minor release, and the Sendable bullet now states which type is deliberately not Sendable and what to use instead.
  • If you would rather keep the typed error and the Sendable protocol requirement, close this and release 3.0.0 instead. The trade is a stricter API against a major version bump one release after 2.0.0.

🤖 Generated with Claude Code

The Swift 6 work changed two things in the SwiftUI module that Swift 6
adoption did not require. Both were breaking, and together they forced a
major release days after 2.0.0 shipped.

PhoneNumberFieldState.error was narrowed from an existential Error to a
PhoneNumberValueError. That made the state Sendable and its Equatable
conformance synthesized, but it also discarded information: callers
previously received the NSError raised by the Objective-C core and could
read its domain, code, and userInfo, where the enum preserves only a
description string. Restore the existential, and with it the custom
equality that compares error descriptions.

PhoneNumberEnriching gained a Sendable requirement, which invalidates any
conformance capturing non-Sendable state. Drop it, along with the
conformance it enabled on PhoneNumberFieldFormatter.

None of this was load-bearing. The six statics that were errors in the
Swift 6 language mode -- the five facade shared instances and
PhoneNumberFieldStyle.automatic -- are all fixed by purely additive
Sendable conformances, which stay. The package still builds clean in the
Swift 6 language mode.

Callers that need field state across a concurrency domain should derive a
PhoneNumberValue, which is Sendable; the test and the changelog say so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@iziz
iziz merged commit c502979 into master Sep 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant