Skip to content

(feat): Tanstack Query Sync Streams#866

Merged
Chriztiaan merged 10 commits intomainfrom
feat/tanstack-query-sync-streams
Feb 26, 2026
Merged

(feat): Tanstack Query Sync Streams#866
Chriztiaan merged 10 commits intomainfrom
feat/tanstack-query-sync-streams

Conversation

@Chriztiaan
Copy link
Copy Markdown
Contributor

@Chriztiaan Chriztiaan commented Feb 24, 2026

This PR adds sync stream support to the tanstack react query package, you can now define sync streams when calling useQuery and useQueries.

Examples:

useQuery({ queryKey: ['test'], query: 'SELECT 1', streams: [db.syncStream('a')] });

useQueries({
    queries: [
        { queryKey: ['test1'], query: 'SELECT 1', streams: [{ name: 'a' }] },
        { queryKey: ['test2'], query: 'SELECT 2', streams: [{ name: 'b' }] }
    ]
});

Verification:

  • Added unit tests
  • Manually tested these hook changes in the Supabase Todolist Sync Stream demo.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: 7233d81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@powersync/react Minor
@powersync/tanstack-react-query Minor
@powersync/react-native Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Chriztiaan Chriztiaan force-pushed the feat/tanstack-query-sync-streams branch from 1a357a7 to 8313330 Compare February 25, 2026 07:27
@Chriztiaan Chriztiaan changed the title [WIP](feat): Tanstack Query Sync Streams (feat): Tanstack Query Sync Streams Feb 25, 2026
@Chriztiaan Chriztiaan marked this pull request as ready for review February 25, 2026 07:58
stevensJourney
stevensJourney previously approved these changes Feb 25, 2026
Copy link
Copy Markdown
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

The changes here look good to me

simolus3
simolus3 previously approved these changes Feb 25, 2026
Comment thread packages/tanstack-react-query/tests/utils.ts Outdated
Comment thread packages/react/src/hooks/streams.ts
@Chriztiaan Chriztiaan merged commit a5d6964 into main Feb 26, 2026
9 checks passed
@Chriztiaan Chriztiaan deleted the feat/tanstack-query-sync-streams branch February 26, 2026 08:40
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