Skip to content

5.0.0

Latest

Choose a tag to compare

@davdroman davdroman released this 23 Nov 13:22
fd94da2

What's Changed

  • Toolchain: Require Swift 6.4 (Xcode 27) and swift-syntax 604 in 6d7e50e
  • Changed: Raise the minimum deployment targets to iOS 15, Mac Catalyst 15, macOS 12, tvOS 15 and watchOS 8 (visionOS stays at 1) in 5febb34
  • Changed: String literals in text builders are localized like Text("…"), so Markdown in them is rendered. String values stay verbatim. Use Text(verbatim:) to keep a literal as written, in d9862b3
    // Before: rendered as written
    "**Hello**"
    // After: localized, with Markdown rendered. To keep it as written:
    Text(verbatim: "**Hello**")
  • Changed: Localized literals are looked up in the caller's bundle (#bundle), in 5febb34. In a Swift package target without resources this fails to compile with "No resource bundle is available for this module". Pass the bundle that holds your strings, or nil for the main bundle:
    @TextBuilder(separator: " ", bundle: nil)
    var greeting: Text {
        "Hello"
    }
  • Changed: Text(separator:default:bundle:content:) takes a @TextSegmentBuilder closure instead of @ArrayBuilder<Text>, and swift-builders is no longer a dependency, in 5febb34
    // Before
    @ArrayBuilder<Text>
    func parts() -> [Text] { … }
    // After
    @TextSegmentBuilder
    func parts() -> [TextSegment] { … }
  • Removed: StringProtocol.text. Use Text(verbatim:) instead, in e3e63a1
  • Added: bundle: parameter on @TextBuilder and Text(separator:default:bundle:content:) in 5febb34
  • Added: AttributedString, LocalizedStringResource (iOS 16+) and Image values in text builders in 36c32e7
  • Added: @TextSegmentBuilder helpers can be nested in other builders in c59721a
  • Fixed: Text(separator: "…", default:) now uses default in 5febb34
  • Fixed: Text or SwiftUI declarations in the caller's scope no longer break the macro expansion in fd94da2
  • Infra: CI runs on Swift 6.4 only, and the swift-syntax compatibility job is removed, in 6d7e50e

Full Changelog: 4.3.0...5.0.0