Repository navigation
Conversation
…azyImage ImageLoader had the first two, and the only way to retry from SwiftUI was `.id(UUID())`, which throws away the view and its state. `LazyImageState/reload()` does it from inside of the content, and `reload(id:)` from outside. `failureView(_:)` and `imageTransition(_:animation:onMemoryCacheHit:)` wrap the content and return `LazyImage<some View>` instead of adding a branch to `body`, so a view that doesn't use them pays nothing for them. For the same reason, what `LazyImage` has to remember goes in `ImageLoader`, not in `FetchImage`.
SwiftUI doesn't interpolate a custom transition then, which is the state of the macOS CI runner, so the tests counting its modifier never saw it run. Also removes the temporary diagnostic that found this.
kean
force-pushed
the
feat/lazy-image-modifiers
branch
from
November 3, 2026 00:51
8e0bbc9 to
56d6805
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
reload(id:),keepsPreviousImage(_:),failureView(_:), andimageTransition(_:animation:onMemoryCacheHit:)toLazyImage,reload()toLazyImageState, andreload()andkeepsPreviousImagetoFetchImage. A retry no longer takes.id(UUID()), which throws away the view and its state.Proof
LazyImageModifiersTests: 29 tests rendered through SwiftUI, including fail →state.reload()fromfailureView→ image. With the modifiers stubbed as no-ops on main, 18 fail. All pass hereNukeUIpasses on macOS (666), iOS 27 (676), and tvOS 27 (676),NukeExtensionson macOS (59). watchOS and visionOS build, snippets compileImagecontrol +0.04%), iOS 27 simulator, Release, 8 interleaved rounds.LazyImage<Image>goes from 136 to 144 bytesstate.reload()), and Xcode 26.x, which only CI has. Conflicts with Show memory cache hits in the first body of LazyImage #1093 inLazyImage.swift, and after both landonMemoryCacheHit: truehas to skip the first-body lookup