New
- Add opt-in
additionalCapitalizationRulesto codegen (#1037): Adds a new opt-inadditionalCapitalizationRulescodegen option and publicCapitalizationRuleAPI (aTermof.string/.regexand aCaseStrategyof.upper/.lower) so acronyms can be fully capitalized (e.g.userId→userID). Following SwiftFormat semantics, an acronym is only capitalized when its first character is already uppercase, so identifiers likeapiKeyare preserved. The rules apply to field accessors, initializer parameters, enum cases, input fields, and test mocks. The option defaults to empty, so existing generated output is unchanged. Closes #3419. Thank you to @3redrubies for the contribution.
Fixed
- Resolve deferred response paths against the initial cache records (#1052): When a
@deferquery streamed incremental chunks, the deferredpathwas turned into a cache key by naively joining the root key with the raw path components (e.g.QUERY_ROOT.animal.friend) instead of following the real normalized-record chain (QUERY_ROOT → Animal:<id> → …). The deferred fields landed on phantom records that nothing referenced, so a cache-first read came back missing those fields. Deferred paths are now resolved by walking the initial response's already-normalized records at parse time, so deferred fields merge onto the correct records. Fixes #3380. Thank you to @joseph-francis-ih for the contribution. - Close the old connection in
WebSocketTransport.disconnectAndReconnect()(#1055):disconnectAndReconnect()replaced the active connection without closing the old one first. Because the oldWebSocketConnectionwas strongly held by its receive loop's parkedTask, it never deallocated — leaking the connection and its underlyingURLSessionWebSocketTask, and delivering duplicatenextmessages routed through the stale connection. The old connection is now closed before being replaced. Fixes #3649. - Remove unnecessary
throwsfromWebSocketTransport.init(#1039):WebSocketTransport.initwas markedthrowsbut made no throwing calls; the vestigial annotation has been removed. This is a source-breaking change for callers who usedtrywhen constructing aWebSocketTransport. Closes #3638.
Improved
- Prune the
findInXcodedirectory walk (#1015):VersionChecker.findInXcoderecursively enumerated every descendant of the project root to locatePackage.resolved, walking build artifacts,.git, vendored dependencies, and git worktrees on everygenerate/fetch-schemainvocation. The walk now skips hidden files and package descendants, reducing a ~30s walk to ~0.2s on a repo with ~150k nested files. Note: a project located inside a hidden directory is no longer discovered; this is intentional. Thank you to @dfed for the contribution.