Skip to content

refactor: stop creating sdk paginator - #3869

Open
isekovanic wants to merge 6 commits into
refactor/clean-channel-lifecyclefrom
refactor/stop-creating-sdk-paginator
Open

isekovanic wants to merge 6 commits into
refactor/clean-channel-lifecyclefrom
refactor/stop-creating-sdk-paginator

Conversation

@isekovanic

Copy link
Copy Markdown
Contributor

🎯 Goal

Make <ChannelList> render an app-owned ChannelPaginator instead of creating one. The SDK used to build a paginator from the list's props and dispose it on unmount, so a list that mounted again (for example after search results replaced it) queried again from scratch. The integration can then decide when (and if) they want to dispose it.

Stacked on the <Channel> lifecycle PR.

πŸ›  Implementation details

- <ChannelList filters={filters} sort={sort} options={options} />
+ // next to connectUser
+ const paginator = new ChannelPaginator({ client, filters, id: 'channel-list', requestOptions: options, sort });
+ client.channelManager.insertPaginator({ paginator });
+
+ <ChannelList paginator={paginator} />
+
+ // on logout
+ client.channelManager.removePaginator(paginator);
+ paginator.dispose();
  • usePaginatedChannels no longer creates, registers, disposes or re-queries on prop changes. It loads the first page only when the paginator has none: on first mount, after disconnectUser resets it, or when a different paginator is passed.
  • The list never removes or disposes the paginator, so a list that mounts again shows its channels without a query.
  • The sample apps create the paginator with the user (SampleApp in useChatClient, the Expo apps in AppProvider) and remove it on logout, since disconnectUser empties registered lists but keeps them registered.
  • The gauntlet transformer patches the channel list query wherever it is defined.

Breaking changes

  • paginator is a required prop.
  • filters, sort, options, lockChannelOrder and queryChannelsOverride are removed, along with the ChannelListQueryChannelsOverride type. They are now set on the ChannelPaginator: in its constructor or requestOptions, through paginatorOptions.lockItemOrder and paginatorOptions.doRequest.
  • Changing the query is a paginator change: set its staticFilters / sort / options and call reload(), or pass a new paginator.

🎨 UI Changes

/

πŸ§ͺ Testing

/

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 2036 KB 2018 KB -18614 B πŸš€
ai_components_size 130 KB 130 KB 0 B 🟒

@isekovanic
isekovanic added this pull request to stack #3873 October 19, 2026 07:56
oliverlaz added a commit that referenced this pull request Oct 19, 2026
The inventory was taken against V10; the stack underneath this PR adds more
public API changes. Re-ran the surface diff and the v9 sample-app compile
against the stack tip (refactor/stop-creating-sdk-paginator) and covered them:

- v10-breaking-changes.md: standalone <Thread> next to <Channel> (removed
  Channel thread/threadList/allowThreadMessagesInChannel/shouldSyncChannel,
  Thread props, threadList everywhere, ThreadMessageComposer slot,
  ThreadContext shape, onAlsoSentToChannelHeaderPress move), message actions
  built on demand (argument-less useMessageActions/useMessageActionHandlers,
  removed Message handleX/messageActions/supportedReactions), and the
  app-owned <ChannelList paginator> (removed filters/sort/options/
  lockChannelOrder/queryChannelsOverride).
- ai-migration-v9-to-v10.md: correct the removed Thread prop names
  (additionalMessageComposerProps, additionalMessageFlashListProps), add
  shouldSyncChannel, and move R.6 and its quick-reference rows onto the
  ChannelPaginator.
- v10-docs-impact.md: re-scan the docs for the stack's changes (109 pages
  affected, was 99).

This branch has not been deployed

No deployments
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.

2 participants