consider lowering deployment target back to iOS 15
- Dominant language
- Swift
- Stars
- 209
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
release [0.9.2](https://github.com/apple/FHIRModels/releases/tag/0.9.2) introduced `FHIRDecodingDepthTracker` as a type, which internally uses an `OSAllocatedUnfairLock`, which in turn resulted the package's deployment target (in the Package.swift manifest) being raised to iOS 16.
this is not ideal, as it prevents SPM packages targeting iOS versions lower than 16 from depending on the package (which happens to be an issue we are now running into, sadly).
since this one `OSAllocatedUnfairLock` is the only place in the public API that uses iOS 16-gated APIs, and this is an optional new feature of the package, i'd like to propose that either:
- the deployment target be lowered to iOS 15 again, and the new API (including the `JSONDecoder.fhirModelsReadyDecoder()` extension) be marked as `@available(macOS 13.0, iOS 16.0, watchOS 9.0, *)` (this would require a small additional workaround as the instances are used in `defer` blocks throughout the package, so there would need to be an intermediate base class or a protocol (without any availability limitations) in order to keep the code in the `init(from:)`s compiling); or
- the deployment target be lowered to iOS 15 again, and the new API be implemented in a way that uses the `OSAllocatedUnfairLock` if available, and falls back to another custom, functionally equivalent mechanism otherwise (in fact, this mechanism already exists, as there is a small custom `OSAllocatedUnfairLock` implementation in the same file, for use on non-apple platforms).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with Package.swift and the file defining FHIRDecodingDepthTracker, including the JSONDecoder.fhirModelsReadyDecoder() extension. Compare the proposed availability and fallback approaches, then verify the package supports iOS 15 while the new API remains available on iOS 16 and later.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100