Skip to content

v0.12.0

Latest

Choose a tag to compare

@lynnswap lynnswap released this 13 Jun 08:26
4f046ab

ObservationBridge v0.12.0

Breaking Changes

  • Replaced the public owner-bound ObservationScope.observe(...) API with top-level withPortableContinuousObservation(options:apply:).
  • Removed the ObservationBridge / makeObservationBridgeStream async sequence APIs and stream rate-limit options.
  • Renamed portable observation types under PortableObservationTracking: ObservationOptions is now PortableObservationTracking.Options, ObservationEvent is now PortableObservationTracking.Event, and test sampling is attached through PortableObservationTracking.Token.
  • Raised the Swift tools requirement to Swift 6.3.

New Features

  • Added a portable withContinuousObservation-style callback API with lifecycle-scoped tokens.
  • Added .willSet, .didSet, and exact matches(_:) support for portable continuous observation callbacks.
  • Added support for Mac Catalyst 18+, tvOS 18+, and visionOS 2+.

Improvements

  • Aligns mutation delivery cadence with native withContinuousObservation: [.willSet, .didSet] exposes a single .didSet pass, synchronous consecutive mutations coalesce, and mutation event.cancel() stops later deliveries.
  • Preserves ObservationBridge's synchronous .initial pass for the normal runtime path.
  • Improves iOS 27+ compatibility by using exact runtime SPI when available and falling back to native continuous observation for liveness when required symbols are unavailable.

Migration Notes

  • Keep the returned PortableObservationTracking.Token alive for as long as the owner should observe, and cancel it during teardown or rebinding.
  • Read observable values directly inside the callback body. Those reads define the dependencies for later deliveries.
  • Use event.matches(_:) as a current-pass work filter, not as the only dependency declaration.
  • If you used stream debounce/throttle APIs, move ordering, backpressure, and rate limiting into the owner that starts the async work.

Documentation

  • Added README migration notes for v0.12.0.
  • Added continuous observation compatibility notes describing native cadence, matches(_:), cancellation, and fallback behavior.

Full Changelog: v0.11.1...v0.12.0