Skip to content

Commit

Permalink
Version 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Mar 4, 2023
1 parent 0606ade commit 3a5096e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# Nuke 12

## Nuke 12.0.0

*Mar 4, 2023*

Nuke 12 enhances the two main APIs introduced in the previous release: `LazyImage` and the async `ImagePipeline` methods. They are faster, more robust, and easier to use.

> The [migration guide](https://github.com/kean/Nuke/blob/nuke-12/Documentation/Migrations/Nuke%2012%20Migration%20Guide.md) is available to help with the update. The minimum requirements are unchanged from Nuke 11.
## Concurrency

Redesign the concurrency APIs making them more ergonomic and fully `Sendable` compliant.

- Add `ImagePipeline/imageTask(with:)` method that returns a new type `AsyncImageTask`

```swift
let task = ImagePipeline.shared.imageTask(with: URL(string: "example.com"))
task.priority = .high
for await progress in task.progress {
print("Updated progress: ", progress)
}
let image = try await task.image
```

- The existing convenience `ImagePipeline/image(for:)` method now returns an image instead of `ImageResponse`
- Remove the `delegate` parameter from `ImagePipeline/image(for:)` method to address the upcoming concurrency warnings in Xcode 14.3
- Remove `ImageTaskDelegate` and move its methods to `ImagePipelineDelegate` and add the `pipeline` parameter

## NukeUI 2.0

NukeUI started as a separate [repo](https://github.com/kean/NukeUI), but the initial production version was released as part of [Nuke 11](https://github.com/kean/Nuke/releases/tag/11.0.0). Let's call it NukeUI 1.0. The framework was designed before the [`AsyncImage`](https://developer.apple.com/documentation/swiftui/asyncimage) announcement and had a few discrepancies that made it harder to migrate from `AsyncImage`. This release addresses the shortcomings of the original design and features a couple of performance improvements.

- `LazyImage` now uses `SwiftUI.Image` instead of `NukeUI.Image` backed by `UIImageView` and `NSImageView`. It eliminates any [discrepancies](https://github.com/kean/Nuke/issues/578) between `LazyImage` and `AsyncImage` layout and self-sizing behavior and fixes issues with `.redacted(reason:)`, `ImageRenderer`, and other SwiftUI APIs that don't work with UIKIt and AppKit based views.
- Remove `NukeUI.Image` so the name no longer [clashes](https://github.com/kean/Nuke/discussions/658) with `SwiftUI.Image`
- Fix [#669](https://github.com/kean/Nuke/issues/669): `redacted` not working for `LazyImage`
- GIF rendering is no longer included in the framework. Please consider using one of the frameworks that specialize in playing GIFs, such as [Gifu](https://github.com/kaishin/Gifu). It's easy to integrate, especially with `LazyImage`.
- Extract progress updates from `FetchImage` to a separate observable object, reducing the number of body reloads
- `LazyImage` now requires a single body calculation to render the response from the memory cache (instead of three before)
- Disable animations by default
- Fix an issue where the image won't reload if you change only `LazyImage` `processors` or `priority` without also changing the image source
- `FetchImage/image` now returns `Image` instead of `UIImage`
- Make `_PlatformImageView` internal (was public) and remove more typealiases

## Nuke

- Add a new initializer to `ImageRequest.ThumbnailOptions` that accepts the target size, unit, and content mode - [#677](https://github.com/kean/Nuke/pull/677)
- ImageCache uses 20% of available RAM which is quite aggressive. It's an OK default on iOS because it clears 90% of the used RAM when entering the background to be a good citizen. But it's not a good default on a Mac. Starting with Nuke 12, the default size is now strictly limited to 512 MB.
- `ImageDecoder` now defaults to scale `1` for images (configurable using [`UserInfoKey/scaleKey`](https://kean-docs.github.io/nuke/documentation/nuke/imagerequest/userinfokey/scalekey))
- Removes APIs deprecated in the previous versions
- Update the [Performance Guide](https://kean-docs.github.io/nuke/documentation/nuke/performance-guide)

## NukeVideo

Video playback can be significantly [more efficient](https://web.dev/replace-gifs-with-videos/) than playing animated GIFs. This is why the initial version of NukeUI provided support for basic video playback. But it is not something that the majority of the users need, so this feature was extracted to a separate module called `NukeVideo`.

There is now less code that you need to include in your project, which means faster compile time and smaller code size. With this and some other changes in Nuke 12, the two main frameworks – Nuke and NukeUI – now have 25% less code compared to Nuke 11. In addition to this change, there are a couple of improvements in how the precompiled binary frameworks are generated, significantly reducing their size.

- Move all video-related code to `NukeVideo`
- Remove `ImageContainer.asset`. The asset is now added to `ImageContainer/userInfo` under the new `.videoAssetKey`.
- Reduce the size of binary frameworks by up to 50%

# Nuke 11

## Nuke 11.6.4
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Nuke.docc/Nuke.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The image pipeline is easy to customize and extend. Check out the following firs

| Nuke | Date | Swift | Xcode | Platforms |
|------|--------------|-------|-------|-----------------------------------------------|
| 12.0 | TBD | 5.6 | 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| 12.0 | Mar 4, 2023 | 5.6 | 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| 11.0 | Jul 20, 2022 | 5.6 | 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| 10.0 | June 1, 2021 | 5.3 | 12.0 | iOS 11.0, watchOS 4.0, macOS 10.13, tvOS 11.0 |
| 9.0 | May 20, 2020 | 5.1 | 11.0 | iOS 11.0, watchOS 4.0, macOS 10.13, tvOS 11.0 |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The image pipeline is easy to customize and extend. Check out the following firs

| Nuke | Date | Swift | Xcode | Platforms |
|------------|--------------|-------------|------------|-----------------------------------------------|
| Nuke 12.0 | TBD | Swift 5.6 | Xcode 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| Nuke 12.0 | Mar 4, 2023 | Swift 5.6 | Xcode 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| Nuke 11.0 | Jul 20, 2022 | Swift 5.6 | Xcode 13.3 | iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0 |
| Nuke 10.0 | Jun 1, 2021 | Swift 5.3 | Xcode 12.0 | iOS 11.0, watchOS 4.0, macOS 10.13, tvOS 11.0 |

Expand Down

0 comments on commit 3a5096e

Please sign in to comment.