Skip to content

Replace Nuke with StreamImageDownloader#1531

Open
laevandus wants to merge 5 commits into
developfrom
stream-image-loader
Open

Replace Nuke with StreamImageDownloader#1531
laevandus wants to merge 5 commits into
developfrom
stream-image-loader

Conversation

@laevandus

@laevandus laevandus commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

πŸ”— Issue Links

Related:

🎯 Goal

Remove the vendored Nuke stack and load images through StreamImageDownloader from StreamChatCommonUI.

πŸ“ Summary

  • Deletes the vendored StreamNuke sources (~9.5k lines), including the unused NukeUI/NukeVideo/NukeExtensions trees
  • Deletes the local Nuke-backed StreamImageDownloader; the same-named StreamChatCommonUI implementation takes over through the existing re-export
  • ChatChannelViewModel no longer clears Nuke's cache on memory warnings (the new memory cache clears itself) and trims the default downloader's memory cache on chat dismiss, keeping MessageListConfig.cacheSizeOnChatDismiss working
  • Removes Nuke from vendoring scripts, lint/format/coverage configs, and docs

πŸ›  Implementation

🎨 Showcase

No intended visual changes.

Before After
img img

πŸ§ͺ Manual Testing Notes

Browse channels with avatars, image and GIF attachments; verify images fill in while scrolling, cached images appear instantly on revisit, and previously viewed images load offline after a relaunch.

β˜‘οΈ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

Summary by CodeRabbit

  • Bug Fixes
    • Improved image/cache cleanup when chat views are dismissed or when memory is constrained.
    • Reduced thumbnail/loading flashes by relying on the image loader’s in-memory cache.
  • Documentation
    • Updated dependency and changelog notes to reflect the streamlined image-loading approach, replacing the previous vendored image loader with StreamImageDownloader from StreamChatCommonUI.

@laevandus
laevandus requested a review from a team as a code owner July 15, 2026 09:23
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc9a9fe3-b3e3-4228-9d3d-8f47ebe157cb

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between e4761ea and 986f0c8.

πŸ“’ Files selected for processing (6)
  • StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerViewModel_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestion_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestionsView_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionsCommandHandler_Tests.swift
  • fastlane/Fastfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • fastlane/Fastfile

πŸ“ Walkthrough

Walkthrough

The PR removes the embedded StreamNuke implementation and downloader, updates image-cache handling to use the current loader, retains SwiftyGif support, changes dependency tooling and package configuration, removes StreamNuke references from analysis configuration and documentation, and updates chat test fixtures.

Changes

Nuke removal and replacement wiring

Layer / File(s) Summary
Dependency and cache wiring
Makefile, Scripts/updateDependency.sh, StreamChatSwiftUI.xcodeproj/project.pbxproj, Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift
Dependency updates now target SwiftyGif and the stream-image-loader branch; chat cache operations use the media loader.
Embedded Nuke removal
AGENTS.md, Sources/StreamChatSwiftUI/StreamNuke/...
Embedded Nuke processing support and its vendored-directory guidance are removed.
Analysis configuration
.slather.yml, .swiftformat, .swiftlint.yml, Scripts/removePublicDeclarations.sh, fastlane/Fastfile, sonar-project.properties
Tooling no longer excludes StreamNuke, and dependency-specific script handling is reduced to SwiftyGif support.
Image-loading documentation
CHANGELOG.md, Sources/StreamChatSwiftUI/README.md, Sources/StreamChatSwiftUI/ChatMessageList/..., Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift
Documentation and comments now describe the current image loader and SwiftyGif behavior.
Test fixture updates
StreamChatSwiftUITests/Tests/ChatChannel/...
UserGroup and UserGroupMember test fixtures now provide creation timestamps and updated initializer argument ordering.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: martinmitrevski, nuno-vieira

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title accurately summarizes the main change: replacing the vendored Nuke image-loading stack with StreamImageDownloader.
Docstring Coverage βœ… Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stream-image-loader

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift`:
- Around line 167-169: Replace the private implementation-detail documentation
comments with regular `//` comments or remove them: update the comment above
`AnimatedGifView` in
Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift (lines
167-169) and the surrounding `normalizedResize` documentation block in
Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift (line 181). No code
behavior changes are needed.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6224768-3ff8-410c-9c8a-759df807eba7

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3ca1ae4 and 64ce457.

πŸ“’ Files selected for processing (83)
  • .slather.yml
  • .swiftformat
  • .swiftlint.yml
  • AGENTS.md
  • CHANGELOG.md
  • Makefile
  • Scripts/removePublicDeclarations.sh
  • Scripts/updateDependency.sh
  • Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift
  • Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift
  • Sources/StreamChatSwiftUI/ChatMessageList/MessageMediaAttachmentContentView.swift
  • Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift
  • Sources/StreamChatSwiftUI/README.md
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/DataCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/DataCaching.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/ImageCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/ImageCaching.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/NukeCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/AssetType.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoderRegistry.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoders+Default.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoders+Empty.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoding.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders+Default.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders+ImageIO.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoding.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageContainer.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageRequest.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageResponse.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageTask.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Atomic.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/DataPublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Extensions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Graphics.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ImagePublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ImageRequestKeys.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/LinkedList.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Log.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Operation.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/RateLimiter.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ResumableData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Loading/DataLoader.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Loading/DataLoading.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Cache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Configuration.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Delegate.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Error.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Prefetching/ImagePrefetcher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageDecompression.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessing.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessingOptions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Anonymous.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Circle.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Composition.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+CoreImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+GaussianBlur.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Resize.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+RoundedCorners.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/AsyncPipelineTask.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/AsyncTask.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchOriginalData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchOriginalImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchWithPublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskLoadData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskLoadImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeExtensions/ImageLoadingOptions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeExtensions/ImageViewExtensions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/FetchImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/Internal.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImageState.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImageView.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/AVDataAsset.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/ImageDecoders+Video.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/NukeVideoPlayerView.swift
  • Sources/StreamChatSwiftUI/Utils/StreamImageDownloader.swift
  • StreamChatSwiftUI.xcodeproj/project.pbxproj
  • StreamChatSwiftUITests/Tests/Utils/StreamImageDownloader_Tests.swift
  • fastlane/Fastfile
  • sonar-project.properties
πŸ’€ Files with no reviewable changes (71)
  • Sources/StreamChatSwiftUI/README.md
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoders+Default.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageContainer.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageRequest.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeExtensions/ImageLoadingOptions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoding.swift
  • .slather.yml
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Circle.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/RateLimiter.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/AssetType.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/DataCaching.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoders+Empty.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/NukeVideoPlayerView.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Log.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Composition.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ResumableData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageTask.swift
  • StreamChatSwiftUITests/Tests/Utils/StreamImageDownloader_Tests.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskLoadData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchOriginalImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Operation.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageDecompression.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Prefetching/ImagePrefetcher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders+Default.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Encoding/ImageEncoders+ImageIO.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ImagePublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+GaussianBlur.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/ImageCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/ImageCaching.swift
  • .swiftlint.yml
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImageState.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/NukeCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Loading/DataLoader.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoderRegistry.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchWithPublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessing.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Delegate.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Configuration.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Extensions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/AsyncTask.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/Internal.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Atomic.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/ImageRequestKeys.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Resize.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/AVDataAsset.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/LazyImageView.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+Anonymous.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Loading/DataLoading.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeExtensions/ImageViewExtensions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+RoundedCorners.swift
  • Sources/StreamChatSwiftUI/Utils/StreamImageDownloader.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Decoding/ImageDecoding.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/LinkedList.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Caching/DataCache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Cache.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskFetchOriginalData.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Pipeline/ImagePipeline+Error.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/DataPublisher.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Internal/Graphics.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/TaskLoadImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Tasks/AsyncPipelineTask.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessingOptions.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/ImageResponse.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors.swift
  • Sources/StreamChatSwiftUI/StreamNuke/NukeVideo/ImageDecoders+Video.swift
  • Makefile
  • Sources/StreamChatSwiftUI/StreamNuke/NukeUI/FetchImage.swift
  • Sources/StreamChatSwiftUI/StreamNuke/Nuke/Processing/ImageProcessors+CoreImage.swift

Comment on lines +167 to +169
/// Recommended implementation by SwiftyGif for rendering gifs in SwiftUI.
/// The image pipeline delivers raw GIF data without animating it, so
/// rendering is implemented separately.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ Maintainability & Code Quality | 🟠 Major | ⚑ Quick win

Use regular comments for private implementation details.

Both changed segments use /// documentation for private declarations, contrary to the Swift documentation guideline.

  • Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift#L167-L169: convert the AnimatedGifView comment to // or remove it.
  • Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift#L181-L181: convert the surrounding normalizedResize documentation block to // or remove it.
πŸ“ Affects 2 files
  • Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift#L167-L169 (this comment)
  • Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift#L181-L181
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift` around
lines 167 - 169, Replace the private implementation-detail documentation
comments with regular `//` comments or remove them: update the comment above
`AnimatedGifView` in
Sources/StreamChatSwiftUI/ChatMessageList/GiphyAttachmentView.swift (lines
167-169) and the surrounding `normalizedResize` documentation block in
Sources/StreamChatSwiftUI/CommonViews/StreamAsyncImage.swift (line 181). No code
behavior changes are needed.

Source: Coding guidelines

@github-actions

Copy link
Copy Markdown
1 Warning
⚠️ Big PR

Generated by 🚫 Danger


@objc
private func didReceiveMemoryWarning() {
ImageCache.shared.removeAll()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is automatic now, StreamImageLoader observes it internally

cleanupAudioPlayer()
ImageCache.shared.trim(toCost: utils.messageListConfig.cacheSizeOnChatDismiss)
let downloader = (utils.mediaLoader as? StreamMediaLoader)?.downloader as? StreamImageDownloader
downloader?.trimMemoryCache(toCost: utils.messageListConfig.cacheSizeOnChatDismiss)

@laevandus laevandus Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks slightly ugly. I think I need to update image loading protocol for skipping the casting.

@laevandus
laevandus marked this pull request as draft July 15, 2026 09:45
@laevandus laevandus changed the title Replace Nuke with own image downloader Replace Nuke with StreamImageDownloader Jul 15, 2026
@laevandus
laevandus marked this pull request as ready for review July 15, 2026 13:15
@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

SDK Size

title develop branch diff status
StreamChatSwiftUI 6.15 MB 5.73 MB -430 KB πŸš€

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

StreamChatSwiftUI XCSize

Object Diff (bytes)
ChatChannelViewModel.o -32230
DataCache.o -30192
ImagePipeline.o -21058
ImageRequest.o -20363
TaskLoadImage.o -20007
Show 77 more objects
Object Diff (bytes)
TaskFetchOriginalData.o -16339
DataLoader.o -15055
AsyncTask.o -14122
ChatChannelHeaderViewModifier.o -11043
ImageTask.o -10675
ResumableData.o -9341
ImageRequestKeys.o -7828
NukeCache.o -7637
LazyImageView.o -7624
TaskFetchWithPublisher.o -7308
ImageDecoders+Default.o -6959
ImageCache.o -6246
MessageComposerViewModel.o -5576
ImagePipeline+Configuration.o -5219
FetchImage.o -4947
AVDataAsset.o -4939
ImagePublisher.o -4882
ImagePipeline+Cache.o -4877
ImagePrefetcher.o -4877
ImagePipeline+Error.o -4823
TaskFetchOriginalImage.o -4786
ChatChannelInfoViewModel.o -4736
ImageLoadingOptions.o -4651
StreamImageDownloader.o -4408
ImageProcessors+Resize.o -4268
NukeVideoPlayerView.o -4106
Graphics.o -3979
RateLimiter.o -3683
AssetType.o -3480
ImageContainer.o -3083
Operation.o -3010
ImageDecoderRegistry.o -2805
ImageProcessing.o -2798
TaskLoadData.o -2776
ImageCaching.o -2680
AsyncPipelineTask.o -2565
ImageDecoders+Video.o -2492
Extensions.o -2486
ImageDecoding.o -2133
LinkedList.o -1974
ImageViewExtensions.o -1659
DataPublisher.o -1477
ImageEncoders+ImageIO.o -1471
Log.o -1459
ImageResponse.o -1427
Internal.o -1179
ImageProcessingOptions.o -1152
ImageEncoding.o -946
ImagePipeline+Delegate.o -934
EditGroupView.o +896
Foundation.tbd -828
Atomic.o -823
ImageEncoders+Default.o -781
MentionSuggestionsView.o -364
UIImage+SwiftyGif.o +363
ImageProcessors+Composition.o -332
ChatMessage+Extensions.o +332
ImageDecompression.o -272
MentionsCommandHandler.o -236
DataLoading.o -228
CoreGraphics.tbd -200
LazyImageState.o -193
ImageIO.tbd -160
Combine.tbd -156
DataCaching.o -140
CryptoKit.tbd -136
SwiftyGifManager.o -108
ChatChannelListItemPreviewView.o +84
MessageComposerViewModel+Recording.o -80
ObjcAssociatedWeakObject.o +72
ImageProcessors.o -66
AttachmentMediaPickerItemView.o +64
ChatChannelExtensions.o -64
ImageEncoders.o -64
CoreFoundation.tbd -56
InputTextView.o +45
ChannelPlaceholderAvatarUsersCache.o +42

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Public Interface

- public final class StreamImageDownloader: ImageDownloading, Sendable  
- 
-   public init()
-   
- 
-   public func downloadImage(url: URL,options: ImageDownloadingOptions,completion: @escaping @MainActor (Result<DownloadedImage, Error>) -> Void)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants