Image loading system
🐛 Call for Testing. This release contains some major internal changes to the core APIs. Please help with testing the newly introduced and the existing ImagePipeline
APIs, and report any issues before it gets shipped.
This release contains some major improvements to the Structured Concurrency support and introduced a re-engineered ImagePipeline
.
previews: AsyncStream<ImageResponse>
, progress: AsyncStream<Progress>
, image: PlatformImage async
and reponse: ImageResponse async
directly to ImageTask
and deprecate AsyncImageTask
. These APIs have zero cost unless you use them.ImageTask.Event
and add events: AsyncStream<Event>
to ImageTask
for observing all events associated with the image loading.AsyncStream
: a new stream is created every time you access the respective property to make it easier to have multiple consumers.ImagePipelineDelegate/imageTask(:didReceiveEvent:pipeline:)
and deprecate the previous methods it replaced (context: these methods were introduced in Nuke 11.0 as the initial and misguided attempt at Structured Concurrency support that tried to borrow from the URLSession
API design)ImagePipeline
that accumulated a lot of cruft after the introduction of data tasks, Combine, Async/Await, and AsyncStream support in the previous releases.ImagePipeline/loadData(with:)
and ImagePipeline/data(with:)
methods that accept URL
as parameters – use the ImageRequest
variants instead (these are rarely used and low-level APIs that don't require convenience variants)@discardableResult
from ImagePipeline/data(with:) async throws
– it was never meant to be thereImageTask/progress
to ImageTask/currentProgress
(warning: this is a small breaking change in the API)AsyncImageTask/previews
that was previously specifying that it was delivering the previews and the final image – it's only the previews.[Decompressor] Error -17102 decompressing image -- possibly corrupt
console error message when using ImagePipeline.Configuration.isUsingPrepareForDisplay
(disabled by default). The pipeline will now skip decompression for .png
..storeAll
and .automatic
cache policies would not store the thumbnail dataImageRequest.UserInfoKey.scaleKey
not interacting correctly with coalescingonStart
ImageProcessors.CoreImageFilter
with CIFilter
instances (fixes https://github.com/kean/Nuke/issues/758 )file
and data
schemes quickly without using DataLoader
and URLSession
. If you rely on the existing behavior, this optimization can be turned off using the isLocalResourcesSupportEnabled
configuration option. https://github.com/kean/Nuke/pull/779
ImagePipeline.Configuration.dataCachingQueue
and perform data cache lookups on the pipeline's queue, reducing the amount of context switchingScreen.scale
by @jszumski in https://github.com/kean/Nuke/pull/766
showPlaceholderOnFailure
parameter to show placeholder in case of image loading failure by @mlight3 in https://github.com/kean/Nuke/pull/764
ImageRequest
by @woxtu in https://github.com/kean/Nuke/pull/769
if let
shorthand syntax by @mlight3 in https://github.com/kean/Nuke/pull/762
Full Changelog: https://github.com/kean/Nuke/compare/12.4.0...12.5.0
Full Changelog: https://github.com/kean/Nuke/compare/12.2.0...12.3.0
.m4v
files by @leonid-shevtsov in https://github.com/kean/Nuke/pull/735
onStart
callback to LazyImage
by @urbaneewe in https://github.com/kean/Nuke/pull/736
Full Changelog: https://github.com/kean/Nuke/compare/12.1.6...12.2.0
ImageCache
(memory cache) performance by 20%NukeExtensions
performance by 5%canImport
where possible[!WARNING]
Swift Package Manager is not supported yet. There seem to be compilation errors when adding.visionOS(.v1)
to the list of the supported versions. More updates coming soon.
DataCache
metadata to a hidden file - https://github.com/kean/Nuke/pull/718
CommonCrypto
to CryptoKit
and slightly optimize how cryptographic hashes are converted to strings (used as filenames for DataCache
)DataCache/isCompressionEnabled
. It was initially added as a general-purpose feature used in Pulse, but it's not recommended to be used with most image formats.DataCache
now performs sweeps less frequently