ObservationBridge v0.12.0
Breaking Changes
- Replaced the public owner-bound
ObservationScope.observe(...)API with top-levelwithPortableContinuousObservation(options:apply:). - Removed the
ObservationBridge/makeObservationBridgeStreamasync sequence APIs and stream rate-limit options. - Renamed portable observation types under
PortableObservationTracking:ObservationOptionsis nowPortableObservationTracking.Options,ObservationEventis nowPortableObservationTracking.Event, and test sampling is attached throughPortableObservationTracking.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 exactmatches(_:)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.didSetpass, synchronous consecutive mutations coalesce, and mutationevent.cancel()stops later deliveries. - Preserves ObservationBridge's synchronous
.initialpass 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.Tokenalive 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