Skip to content

Nuke 12.0 (Beta 1)

Pre-release
Pre-release
Compare
Choose a tag to compare
@kean kean released this 10 Feb 00:00
· 462 commits to main since this release

Warning: This is an early preview. The documentation hasn't been updated yet.

NukeUI 2.0

NukeUI started as a separate repo, but the initial production version was released as part of Nuke 11. Let's call it NukeUI 1.0. The framework was designed before the AsyncImage announcement and had a few discrepancies that made it harder to migrate from AsyncImage. This release addresses the shortcomings of the original design.

NukeUI 2.0 was developed closely with the open-source Ice Cubes app for Mastodon, and every single line in LazyImage was optimized to achieve the best performance possible.

Starting with NukeUI 2.0, LazyImage uses SwiftUI.Image to display images and eliminates any discrepancies between LazyImage and AsyncImage layout and self-sizing behavior. And the previously used NukeUI.Image was removed so it no longer conflicts with SwiftUI.Image.

NukeUI 1.0 tried to do too much in terms of rendering images which is not its primary responsibility – loading images is. The original design resulted in a convoluted and poorly composable API where LazyImage would know too much about how the images are rendered. This is no longer the case.

  • LazyImage now uses SwiftUI.Image for rendering images and the layout/sizing behavior matches AsyncImage exactly
  • Remove Image, ImageView, ImageResizingMode
  • Add LazyImage initializer that accepts content and placeholder closures (the same as AsyncImage)
  • Add scale parameter to LazyImage initializer
  • Fix #669: redacted not working for LazyImage
  • GIF rendering is no longer included in the framework. To enable it, use one of the frameworks that support GIF directly, such as Gifu
  • Video support is also disabled by default (this is subject to change)

Warning: GIF and video rendering are now disabled by default

Deprecations

This release also removes the APIs deprecated in the previous versions of the framework