-
Notifications
You must be signed in to change notification settings - Fork 109
[V5] Replace StreamCollection and LazyCachedMapCollection with Array #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v5
Are you sure you want to change the base?
[V5] Replace StreamCollection and LazyCachedMapCollection with Array #993
Conversation
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; | ||
requirement = { | ||
branch = v5; | ||
branch = "v5-remove-stream-collection-lazy-cached-map-collection"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert before merge
SDK Size
|
Generated by 🚫 Danger |
Public Interface public struct ChannelList: View
- public init(factory: Factory,channels: LazyCachedMapCollection<ChatChannel>,selectedChannel: Binding<ChannelSelectionInfo?>,swipedChannelId: Binding<String?>,scrolledChannelId: Binding<String?> = .constant(nil),scrollable: Bool = true,onlineIndicatorShown: (@MainActor (ChatChannel) -> Bool)? = nil,imageLoader: (@MainActor (ChatChannel) -> UIImage)? = nil,onItemTap: @escaping @MainActor (ChatChannel) -> Void,onItemAppear: @escaping @MainActor (Int) -> Void,channelNaming: (@MainActor (ChatChannel) -> String)? = nil,channelDestination: @escaping @MainActor (ChannelSelectionInfo) -> Factory.ChannelDestination,trailingSwipeRightButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in },trailingSwipeLeftButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in },leadingSwipeButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in })
+ public init(factory: Factory,channels: [ChatChannel],selectedChannel: Binding<ChannelSelectionInfo?>,swipedChannelId: Binding<String?>,scrolledChannelId: Binding<String?> = .constant(nil),scrollable: Bool = true,onlineIndicatorShown: (@MainActor (ChatChannel) -> Bool)? = nil,imageLoader: (@MainActor (ChatChannel) -> UIImage)? = nil,onItemTap: @escaping @MainActor (ChatChannel) -> Void,onItemAppear: @escaping @MainActor (Int) -> Void,channelNaming: (@MainActor (ChatChannel) -> String)? = nil,channelDestination: @escaping @MainActor (ChannelSelectionInfo) -> Factory.ChannelDestination,trailingSwipeRightButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in },trailingSwipeLeftButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in },leadingSwipeButtonTapped: @escaping @MainActor (ChatChannel) -> Void = { _ in })
public struct ChannelsLazyVStack: View
- public init(factory: Factory,channels: LazyCachedMapCollection<ChatChannel>,selectedChannel: Binding<ChannelSelectionInfo?>,swipedChannelId: Binding<String?>,onlineIndicatorShown: @escaping @MainActor (ChatChannel) -> Bool,imageLoader: @escaping @MainActor (ChatChannel) -> UIImage,onItemTap: @escaping @MainActor (ChatChannel) -> Void,onItemAppear: @escaping @MainActor (Int) -> Void,channelNaming: @escaping @MainActor (ChatChannel) -> String,channelDestination: @escaping @MainActor (ChannelSelectionInfo) -> Factory.ChannelDestination,trailingSwipeRightButtonTapped: @escaping @MainActor (ChatChannel) -> Void,trailingSwipeLeftButtonTapped: @escaping @MainActor (ChatChannel) -> Void,leadingSwipeButtonTapped: @escaping @MainActor (ChatChannel) -> Void)
+ public init(factory: Factory,channels: [ChatChannel],selectedChannel: Binding<ChannelSelectionInfo?>,swipedChannelId: Binding<String?>,onlineIndicatorShown: @escaping @MainActor (ChatChannel) -> Bool,imageLoader: @escaping @MainActor (ChatChannel) -> UIImage,onItemTap: @escaping @MainActor (ChatChannel) -> Void,onItemAppear: @escaping @MainActor (Int) -> Void,channelNaming: @escaping @MainActor (ChatChannel) -> String,channelDestination: @escaping @MainActor (ChannelSelectionInfo) -> Factory.ChannelDestination,trailingSwipeRightButtonTapped: @escaping @MainActor (ChatChannel) -> Void,trailingSwipeLeftButtonTapped: @escaping @MainActor (ChatChannel) -> Void,leadingSwipeButtonTapped: @escaping @MainActor (ChatChannel) -> Void)
public struct ThreadList: View
- public init(factory: Factory,threads: LazyCachedMapCollection<ChatThread>,threadDestination: @escaping @MainActor (ChatThread) -> Factory.ThreadDestination,selectedThread: Binding<ThreadSelectionInfo?>,onItemTap: @escaping (ChatThread) -> Void,onItemAppear: @escaping (Int) -> Void,headerView: @escaping () -> HeaderView,footerView: @escaping () -> FooterView)
+ public init(factory: Factory,threads: [ChatThread],threadDestination: @escaping @MainActor (ChatThread) -> Factory.ThreadDestination,selectedThread: Binding<ThreadSelectionInfo?>,onItemTap: @escaping (ChatThread) -> Void,onItemAppear: @escaping (Int) -> Void,headerView: @escaping () -> HeaderView,footerView: @escaping () -> FooterView)
public struct MessageListView: View, KeyboardReadable
- public init(factory: Factory,channel: ChatChannel,messages: LazyCachedMapCollection<ChatMessage>,messagesGroupingInfo: [String: [String]],scrolledId: Binding<String?>,showScrollToLatestButton: Binding<Bool>,quotedMessage: Binding<ChatMessage?>,currentDateString: String? = nil,listId: String,isMessageThread: Bool = false,shouldShowTypingIndicator: Bool = false,scrollPosition: Binding<String?> = .constant(nil),loadingNextMessages: Bool = false,firstUnreadMessageId: Binding<MessageId?> = .constant(nil),onMessageAppear: @escaping @MainActor (Int, ScrollDirection) -> Void,onScrollToBottom: @escaping @MainActor () -> Void,onLongPress: @escaping @MainActor (MessageDisplayInfo) -> Void,onJumpToMessage: ((String) -> Bool)? = nil)
+ public init(factory: Factory,channel: ChatChannel,messages: [ChatMessage],messagesGroupingInfo: [String: [String]],scrolledId: Binding<String?>,showScrollToLatestButton: Binding<Bool>,quotedMessage: Binding<ChatMessage?>,currentDateString: String? = nil,listId: String,isMessageThread: Bool = false,shouldShowTypingIndicator: Bool = false,scrollPosition: Binding<String?> = .constant(nil),loadingNextMessages: Bool = false,firstUnreadMessageId: Binding<MessageId?> = .constant(nil),onMessageAppear: @escaping @MainActor (Int, ScrollDirection) -> Void,onScrollToBottom: @escaping @MainActor () -> Void,onLongPress: @escaping @MainActor (MessageDisplayInfo) -> Void,onJumpToMessage: ((String) -> Bool)? = nil)
public struct ThreadsLazyVStack: View
- public init(factory: Factory,threads: LazyCachedMapCollection<ChatThread>,threadDestination: @escaping @MainActor (ChatThread) -> Factory.ThreadDestination,selectedThread: Binding<ThreadSelectionInfo?>,onItemTap: @escaping (ChatThread) -> Void,onItemAppear: @escaping (Int) -> Void)
+ public init(factory: Factory,threads: [ChatThread],threadDestination: @escaping @MainActor (ChatThread) -> Factory.ThreadDestination,selectedThread: Binding<ThreadSelectionInfo?>,onItemTap: @escaping (ChatThread) -> Void,onItemAppear: @escaping (Int) -> Void) |
…llection # Conflicts: # StreamChatSwiftUITestsApp/CustomChannelHeader.swift
…llection # Conflicts: # Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift
5e741e6
to
f7ab132
Compare
|
var messages: LazyCachedMapCollection<ChatMessage> { | ||
controller.messages | ||
var messages: [ChatMessage] { | ||
Array(controller.messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why's an array needed here?
var messages: LazyCachedMapCollection<ChatMessage> { | ||
var replies = messageController.replies | ||
var messages: [ChatMessage] { | ||
var replies = Array(messageController.replies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
primaryButton: .destructive(Text("Sign out")) { | ||
withAnimation { | ||
Task { await chatClient.disconnect() } | ||
chatClient.disconnect {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this being changed between these 2 methods. Any specific reason?
🔗 Issue Links
Related: IOS-1003
🎯 Goal
StreamCollection
andLazyCachedMapCollection
do not add any value anymore☑️ Contributor Checklist
docs-content
repo