Coil v2.0.0-rc01 Release Notes

Release Date: 2022-03-02 // about 2 years ago
  • Significant changes since 1.4.0:

    • ๐Ÿ‘ The minimum supported API is now 21.
    • Rework the Jetpack Compose integration.
      • rememberImagePainter has been renamed to rememberAsyncImagePainter.
      • Add support for AsyncImage and SubcomposeAsyncImage. Check out the documentation for more info.
      • Deprecate LocalImageLoader. Check out the deprecation message for more info.
    • Coil 2.0 has its own disk cache implementation and no longer relies on OkHttp for disk caching.
      • Use ImageLoader.Builder.diskCache and DiskCache.Builder to configure the disk cache.
      • You should not use OkHttp's Cache with Coil 2.0 as the cache can be corrupted if a thread is interrupted while writing to it.
      • Cache-Control and other cache headers are still supported - except Vary headers, as the cache only checks that the URLs match. Additionally, only responses with a response code in the range [200..300) are cached.
      • Existing disk caches will be cleared when upgrading to 2.0.
    • 0๏ธโƒฃ ImageRequest's default Scale is now Scale.FIT.
      • This was changed to make ImageRequest.scale consistent with other classes that have a default Scale.
      • Requests with an ImageViewTarget still have their Scale auto-detected.
    • 0๏ธโƒฃ ImageRequest's default size is now Size.ORIGINAL.
    • Rework the image pipeline classes:
      • Mapper, Fetcher, and Decoder have been refactored to be more flexible.
      • Fetcher.key has been replaced with a new Keyer interface. Keyer creates the cache key from the input data.
      • Adds ImageSource, which allows Decoders to read Files directly using Okio's file system API.
    • Disable generating runtime not-null assertions.
      • If you use Java, passing null as a not-null annotated parameter to a function will no longer throw a NullPointerException immediately. Kotlin's compile-time null safety guards against this happening.
      • This change allows the library's size to be smaller.
    • Size is now composed of two Dimension values for its width and height. Dimension can either be a positive pixel value or Dimension.Original.
    • ๐Ÿšš BitmapPool and PoolableViewTarget have been removed from the library.
    • ๐Ÿšš VideoFrameFileFetcher and VideoFrameUriFetcher are removed from the library. Use VideoFrameDecoder instead, which supports all data sources.
    • ๐Ÿšš BlurTransformation and GrayscaleTransformation are removed from the library. If you use them, you can copy their code into your project.
    • ๐Ÿ”„ Change Transition.transition to be a non-suspending function as it's no longer needed to suspend the transition until it completes.
    • โž• Add support for bitmapFactoryMaxParallelism, which restricts the maximum number of in-progress BitmapFactory operations. This value is 4 by default, which improves UI performance.
    • โž• Add support for interceptorDispatcher, fetcherDispatcher, decoderDispatcher, and transformationDispatcher.
    • โž• Add GenericViewTarget, which handles common ViewTarget logic.
    • โž• Add ByteBuffer to the default supported data types.
    • ๐Ÿ”จ Disposable has been refactored and exposes the underlying ImageRequest's job.
    • Rework the MemoryCache API.
    • ImageRequest.error is now set on the Target if ImageRequest.fallback is null.
    • Transformation.key is replaced with Transformation.cacheKey.
    • โšก๏ธ Update Kotlin to 1.6.10.
    • โšก๏ธ Update Compose to 1.1.1.
    • โšก๏ธ Update OkHttp to 4.9.3.
    • โšก๏ธ Update Okio to 3.0.0.

    ๐Ÿ”„ Changes since 2.0.0-alpha09:

    • โœ‚ Remove the -Xjvm-default=all compiler flag.
    • ๐Ÿ›  Fix failing to load image if multiple requests with must-revalidate/e-tag are executed concurrently.
    • ๐Ÿ›  Fix DecodeUtils.isSvg returning false if there is a new line character after the <svg tag.
    • ๐Ÿ—„ Make LocalImageLoader.provides deprecation message clearer.
    • โšก๏ธ Update Compose to 1.1.1.
    • โšก๏ธ Update accompanist-drawablepainter to 0.23.1.