From a2ea754e5449c465eef14182b41109e33fa93a4e Mon Sep 17 00:00:00 2001 From: Qiushi Yan Date: Sun, 20 Oct 2024 12:10:59 -0500 Subject: [PATCH 1/9] docs(react-query): fix prefetch with suspense example (#8193) * docs: react prefetch with suspense example * remove notifyOnChangeProps from usePrefetchQuery --- docs/framework/react/guides/prefetching.md | 29 ++++++++-------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/docs/framework/react/guides/prefetching.md b/docs/framework/react/guides/prefetching.md index 53b2e4e8a8..f5965c1bde 100644 --- a/docs/framework/react/guides/prefetching.md +++ b/docs/framework/react/guides/prefetching.md @@ -201,35 +201,26 @@ If you want to prefetch together with Suspense, you will have to do things a bit You can now use `useSuspenseQuery` in the component that actually needs the data. You _might_ want to wrap this later component in its own `` boundary so the "secondary" query we are prefetching does not block rendering of the "primary" data. ```tsx -function App() { +function ArticleLayout({ id }) { usePrefetchQuery({ - queryKey: ['articles'], - queryFn: (...args) => { - return getArticles(...args) - }, + queryKey: ['article-comments', id], + queryFn: getArticleCommentsById, }) return ( - - + +
) } -function Articles() { - const { data: articles } = useSuspenseQuery({ - queryKey: ['articles'], - queryFn: (...args) => { - return getArticles(...args) - }, +function Article({ id }) { + const { data: articleData, isPending } = useSuspenseQuery({ + queryKey: ['article', id], + queryFn: getArticleById, }) - return articles.map((article) => ( -
- - -
- )) + ... } ``` From 9d99fcb950e04beb14f306942d3c0e198837e21b Mon Sep 17 00:00:00 2001 From: Ollie Chick Date: Mon, 21 Oct 2024 21:28:33 +1300 Subject: [PATCH 2/9] docs: Update disabling-queries.md (#8201) --- docs/framework/react/guides/disabling-queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/framework/react/guides/disabling-queries.md b/docs/framework/react/guides/disabling-queries.md index da173f688b..caedfde609 100644 --- a/docs/framework/react/guides/disabling-queries.md +++ b/docs/framework/react/guides/disabling-queries.md @@ -14,7 +14,7 @@ When `enabled` is `false`: - The query will ignore query client `invalidateQueries` and `refetchQueries` calls that would normally result in the query refetching. - `refetch` returned from `useQuery` can be used to manually trigger the query to fetch. However, it will not work with `skipToken`. -> Typescript users may prefer to use [skipToken](#typesafe-disabling-of-queries-using-skiptoken) as an alternative to `enabled = false`. +> TypeScript users may prefer to use [skipToken](#typesafe-disabling-of-queries-using-skiptoken) as an alternative to `enabled = false`. [//]: # 'Example' From d3e2a8ad7af5dbff02197481c40666625a01d2d4 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Wed, 23 Oct 2024 18:44:17 +0900 Subject: [PATCH 3/9] chore(react-query): remove unnecessary test file (__test__/suspense.tsx, suspense.test-d.tsx) (#8208) * refactor(react-query): remove unnecessary test file * chore: update --- ...sx => useSuspenseInfiniteQuery.test-d.tsx} | 69 --- .../src/__tests__/useSuspenseQueries.test.tsx | 480 ++++++++++++++++- .../src/__tests__/useSuspenseQuery.test-d.tsx | 71 +++ ...nse.test.tsx => useSuspenseQuery.test.tsx} | 481 +----------------- 4 files changed, 551 insertions(+), 550 deletions(-) rename packages/react-query/src/__tests__/{suspense.test-d.tsx => useSuspenseInfiniteQuery.test-d.tsx} (57%) create mode 100644 packages/react-query/src/__tests__/useSuspenseQuery.test-d.tsx rename packages/react-query/src/__tests__/{suspense.test.tsx => useSuspenseQuery.test.tsx} (65%) diff --git a/packages/react-query/src/__tests__/suspense.test-d.tsx b/packages/react-query/src/__tests__/useSuspenseInfiniteQuery.test-d.tsx similarity index 57% rename from packages/react-query/src/__tests__/suspense.test-d.tsx rename to packages/react-query/src/__tests__/useSuspenseInfiniteQuery.test-d.tsx index 7d14401887..d59672fec7 100644 --- a/packages/react-query/src/__tests__/suspense.test-d.tsx +++ b/packages/react-query/src/__tests__/useSuspenseInfiniteQuery.test-d.tsx @@ -1,77 +1,8 @@ import { describe, expectTypeOf, it } from 'vitest' import { skipToken } from '@tanstack/query-core' -import { useSuspenseQuery } from '../useSuspenseQuery' import { useSuspenseInfiniteQuery } from '../useSuspenseInfiniteQuery' import type { InfiniteData } from '@tanstack/query-core' -describe('useSuspenseQuery', () => { - it('should always have data defined', () => { - const { data } = useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - }) - - expectTypeOf(data).toEqualTypeOf() - }) - - it('should not have pending status', () => { - const { status } = useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - }) - - expectTypeOf(status).toEqualTypeOf<'error' | 'success'>() - }) - - it('should not allow skipToken in queryFn', () => { - useSuspenseQuery({ - queryKey: ['key'], - // @ts-expect-error - queryFn: skipToken, - }) - - useSuspenseQuery({ - queryKey: ['key'], - // @ts-expect-error - queryFn: Math.random() > 0.5 ? skipToken : () => Promise.resolve(5), - }) - }) - - it('should not allow placeholderData, enabled or throwOnError props', () => { - useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - // @ts-expect-error TS2345 - placeholderData: 5, - enabled: true, - }) - - useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - // @ts-expect-error TS2345 - enabled: true, - }) - - useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - // @ts-expect-error TS2345 - throwOnError: true, - }) - }) - - it('should not return isPlaceholderData', () => { - const query = useSuspenseQuery({ - queryKey: ['key'], - queryFn: () => Promise.resolve(5), - }) - - // @ts-expect-error TS2339 - query.isPlaceholderData - }) -}) - describe('useSuspenseInfiniteQuery', () => { it('should always have data defined', () => { const { data } = useSuspenseInfiniteQuery({ diff --git a/packages/react-query/src/__tests__/useSuspenseQueries.test.tsx b/packages/react-query/src/__tests__/useSuspenseQueries.test.tsx index 8792e72cef..ba15741ade 100644 --- a/packages/react-query/src/__tests__/useSuspenseQueries.test.tsx +++ b/packages/react-query/src/__tests__/useSuspenseQueries.test.tsx @@ -7,9 +7,10 @@ import { it, vi, } from 'vitest' -import { act, render } from '@testing-library/react' +import { act, fireEvent, render, waitFor } from '@testing-library/react' import * as React from 'react' -import { useSuspenseQueries } from '..' +import { ErrorBoundary } from 'react-error-boundary' +import { useSuspenseQueries, useSuspenseQuery } from '..' import { createQueryClient, queryKey, renderWithClient, sleep } from './utils' import type { UseSuspenseQueryOptions } from '..' @@ -183,3 +184,478 @@ describe('useSuspenseQueries', () => { expect(spy).toHaveBeenCalled() }) }) + +describe('useSuspenseQueries 2', () => { + it('should suspend all queries in parallel', async () => { + const key1 = queryKey() + const key2 = queryKey() + const results: Array = [] + + function Fallback() { + results.push('loading') + return
loading
+ } + + function Page() { + const result = useSuspenseQueries({ + queries: [ + { + queryKey: key1, + queryFn: async () => { + results.push('1') + await sleep(10) + return '1' + }, + }, + { + queryKey: key2, + queryFn: async () => { + results.push('2') + await sleep(20) + return '2' + }, + }, + ], + }) + return ( +
+

data: {result.map((item) => item.data ?? 'null').join(',')}

+
+ ) + } + + const rendered = renderWithClient( + queryClient, + }> + + , + ) + + await waitFor(() => rendered.getByText('loading')) + await waitFor(() => rendered.getByText('data: 1,2')) + + expect(results).toEqual(['1', '2', 'loading']) + }) + + it("shouldn't unmount before all promises fetched", async () => { + const key1 = queryKey() + const key2 = queryKey() + const results: Array = [] + const refs: Array = [] + + function Fallback() { + results.push('loading') + return
loading
+ } + + function Page() { + const ref = React.useRef(Math.random()) + const result = useSuspenseQueries({ + queries: [ + { + queryKey: key1, + queryFn: async () => { + refs.push(ref.current) + results.push('1') + await sleep(10) + return '1' + }, + }, + { + queryKey: key2, + queryFn: async () => { + refs.push(ref.current) + results.push('2') + await sleep(20) + return '2' + }, + }, + ], + }) + return ( +
+

data: {result.map((item) => item.data ?? 'null').join(',')}

+
+ ) + } + + const rendered = renderWithClient( + queryClient, + }> + + , + ) + await waitFor(() => rendered.getByText('loading')) + expect(refs.length).toBe(2) + await waitFor(() => rendered.getByText('data: 1,2')) + expect(refs[0]).toBe(refs[1]) + }) + + // this addresses the following issue: + // https://github.com/TanStack/query/issues/6344 + it('should suspend on offline when query changes, and data should not be undefined', async () => { + function Page() { + const [id, setId] = React.useState(0) + + const { data } = useSuspenseQuery({ + queryKey: [id], + queryFn: () => Promise.resolve(`Data ${id}`), + }) + + // defensive guard here + if (data === undefined) { + throw new Error('data cannot be undefined') + } + + return ( + <> +
{data}
+ + + ) + } + + const rendered = renderWithClient( + queryClient, + loading}> + + , + ) + + await waitFor(() => rendered.getByText('loading')) + await waitFor(() => rendered.getByText('Data 0')) + + // go offline + document.dispatchEvent(new CustomEvent('offline')) + + fireEvent.click(rendered.getByText('fetch')) + await waitFor(() => rendered.getByText('Data 0')) + + // go back online + document.dispatchEvent(new CustomEvent('online')) + fireEvent.click(rendered.getByText('fetch')) + + // query should resume + await waitFor(() => rendered.getByText('Data 1')) + }) + + it('should throw error when queryKey changes and new query fails', async () => { + const consoleMock = vi + .spyOn(console, 'error') + .mockImplementation(() => undefined) + const key = queryKey() + + function Page() { + const [fail, setFail] = React.useState(false) + const { data } = useSuspenseQuery({ + queryKey: [key, fail], + queryFn: async () => { + await sleep(10) + + if (fail) { + throw new Error('Suspense Error Bingo') + } else { + return 'data' + } + }, + retry: 0, + }) + + return ( +
+ + +
rendered: {String(data)}
+
+ ) + } + + const rendered = renderWithClient( + queryClient, +
error boundary
}> + + + +
, + ) + + await waitFor(() => rendered.getByText('Loading...')) + + await waitFor(() => rendered.getByText('rendered: data')) + + fireEvent.click(rendered.getByText('trigger fail')) + + await waitFor(() => rendered.getByText('error boundary')) + + expect(consoleMock.mock.calls[0]?.[1]).toStrictEqual( + new Error('Suspense Error Bingo'), + ) + + consoleMock.mockRestore() + }) + + it('should keep previous data when wrapped in a transition', async () => { + const key = queryKey() + + function Page() { + const [count, setCount] = React.useState(0) + const [isPending, startTransition] = React.useTransition() + const { data } = useSuspenseQuery({ + queryKey: [key, count], + queryFn: async () => { + await sleep(10) + return 'data' + count + }, + }) + + return ( +
+ + +
{isPending ? 'Pending...' : String(data)}
+
+ ) + } + + const rendered = renderWithClient( + queryClient, + + + , + ) + + await waitFor(() => rendered.getByText('Loading...')) + + await waitFor(() => rendered.getByText('data0')) + + fireEvent.click(rendered.getByText('inc')) + + await waitFor(() => rendered.getByText('Pending...')) + + await waitFor(() => rendered.getByText('data1')) + }) + + it('should not request old data inside transitions (issue #6486)', async () => { + const key = queryKey() + let queryFnCount = 0 + + function App() { + const [count, setCount] = React.useState(0) + + return ( +
+ + + + +
+ ) + } + + function Page({ count }: { count: number }) { + const { data } = useSuspenseQuery({ + queryKey: [key, count], + queryFn: async () => { + queryFnCount++ + await sleep(10) + return 'data' + count + }, + }) + + return ( +
+
{String(data)}
+
+ ) + } + + const rendered = renderWithClient( + queryClient, + + , + ) + + await waitFor(() => rendered.getByText('Loading...')) + + await waitFor(() => rendered.getByText('data0')) + + fireEvent.click(rendered.getByText('inc')) + + await waitFor(() => rendered.getByText('data1')) + + await sleep(20) + + expect(queryFnCount).toBe(2) + }) + + it('should still suspense if queryClient has placeholderData config', async () => { + const key = queryKey() + const queryClientWithPlaceholder = createQueryClient({ + defaultOptions: { + queries: { + placeholderData: (previousData: any) => previousData, + }, + }, + }) + + function Page() { + const [count, setCount] = React.useState(0) + const [isPending, startTransition] = React.useTransition() + const { data } = useSuspenseQuery({ + queryKey: [key, count], + queryFn: async () => { + await sleep(10) + return 'data' + count + }, + }) + + return ( +
+ + +
{isPending ? 'Pending...' : String(data)}
+
+ ) + } + + const rendered = renderWithClient( + queryClientWithPlaceholder, + + + , + ) + + await waitFor(() => rendered.getByText('Loading...')) + + await waitFor(() => rendered.getByText('data0')) + + fireEvent.click(rendered.getByText('inc')) + + await waitFor(() => rendered.getByText('Pending...')) + + await waitFor(() => rendered.getByText('data1')) + }) + + it('should show error boundary even with gcTime:0 (#7853)', async () => { + const consoleMock = vi + .spyOn(console, 'error') + .mockImplementation(() => undefined) + const key = queryKey() + let count = 0 + + function Page() { + useSuspenseQuery({ + queryKey: key, + queryFn: async () => { + count++ + console.log('queryFn') + throw new Error('Query failed') + }, + gcTime: 0, + retry: false, + }) + + return null + } + + function App() { + return ( + + { + return
There was an error!
+ }} + > + +
+
+ ) + } + + const rendered = renderWithClient(queryClient, ) + + await waitFor(() => rendered.getByText('There was an error!')) + expect(count).toBe(1) + consoleMock.mockRestore() + }) + + describe('gc (with fake timers)', () => { + beforeAll(() => { + vi.useFakeTimers() + }) + + afterAll(() => { + vi.useRealTimers() + }) + + it('should gc when unmounted while fetching with low gcTime (#8159)', async () => { + const key = queryKey() + + function Page() { + return ( + + + + ) + } + + function Component() { + const { data } = useSuspenseQuery({ + queryKey: key, + queryFn: async () => { + await sleep(3000) + return 'data' + }, + gcTime: 1000, + }) + + return
{data}
+ } + + function Page2() { + return
page2
+ } + + function App() { + const [show, setShow] = React.useState(true) + return ( +
+ {show ? : } + +
+ ) + } + + const rendered = renderWithClient(queryClient, ) + + await act(() => vi.advanceTimersByTimeAsync(200)) + + rendered.getByText('loading') + + // unmount while still fetching + fireEvent.click(rendered.getByText('hide')) + + await act(() => vi.advanceTimersByTimeAsync(800)) + + rendered.getByText('page2') + + // wait for query to be resolved + await act(() => vi.advanceTimersByTimeAsync(2000)) + + expect(queryClient.getQueryData(key)).toBe('data') + + // wait for gc + await act(() => vi.advanceTimersByTimeAsync(1000)) + + expect(queryClient.getQueryData(key)).toBe(undefined) + }) + }) +}) diff --git a/packages/react-query/src/__tests__/useSuspenseQuery.test-d.tsx b/packages/react-query/src/__tests__/useSuspenseQuery.test-d.tsx new file mode 100644 index 0000000000..847a0f8c38 --- /dev/null +++ b/packages/react-query/src/__tests__/useSuspenseQuery.test-d.tsx @@ -0,0 +1,71 @@ +import { describe, expectTypeOf, it } from 'vitest' +import { skipToken } from '@tanstack/query-core' +import { useSuspenseQuery } from '../useSuspenseQuery' + +describe('useSuspenseQuery', () => { + it('should always have data defined', () => { + const { data } = useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + }) + + expectTypeOf(data).toEqualTypeOf() + }) + + it('should not have pending status', () => { + const { status } = useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + }) + + expectTypeOf(status).toEqualTypeOf<'error' | 'success'>() + }) + + it('should not allow skipToken in queryFn', () => { + useSuspenseQuery({ + queryKey: ['key'], + // @ts-expect-error + queryFn: skipToken, + }) + + useSuspenseQuery({ + queryKey: ['key'], + // @ts-expect-error + queryFn: Math.random() > 0.5 ? skipToken : () => Promise.resolve(5), + }) + }) + + it('should not allow placeholderData, enabled or throwOnError props', () => { + useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + // @ts-expect-error TS2345 + placeholderData: 5, + enabled: true, + }) + + useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + // @ts-expect-error TS2345 + enabled: true, + }) + + useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + // @ts-expect-error TS2345 + throwOnError: true, + }) + }) + + it('should not return isPlaceholderData', () => { + const query = useSuspenseQuery({ + queryKey: ['key'], + queryFn: () => Promise.resolve(5), + }) + + // @ts-expect-error TS2339 + query.isPlaceholderData + }) +}) diff --git a/packages/react-query/src/__tests__/suspense.test.tsx b/packages/react-query/src/__tests__/useSuspenseQuery.test.tsx similarity index 65% rename from packages/react-query/src/__tests__/suspense.test.tsx rename to packages/react-query/src/__tests__/useSuspenseQuery.test.tsx index 2b55386fde..af2f376ee8 100644 --- a/packages/react-query/src/__tests__/suspense.test.tsx +++ b/packages/react-query/src/__tests__/useSuspenseQuery.test.tsx @@ -1,5 +1,5 @@ -import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' -import { act, fireEvent, waitFor } from '@testing-library/react' +import { describe, expect, it, vi } from 'vitest' +import { fireEvent, waitFor } from '@testing-library/react' import * as React from 'react' import { ErrorBoundary } from 'react-error-boundary' import { @@ -7,7 +7,6 @@ import { QueryErrorResetBoundary, useQueryErrorResetBoundary, useSuspenseInfiniteQuery, - useSuspenseQueries, useSuspenseQuery, } from '..' import { createQueryClient, queryKey, renderWithClient, sleep } from './utils' @@ -872,479 +871,3 @@ describe('useSuspenseQuery', () => { await waitFor(() => rendered.getByText('data: 2')) }) }) - -describe('useSuspenseQueries', () => { - const queryClient = createQueryClient() - it('should suspend all queries in parallel', async () => { - const key1 = queryKey() - const key2 = queryKey() - const results: Array = [] - - function Fallback() { - results.push('loading') - return
loading
- } - - function Page() { - const result = useSuspenseQueries({ - queries: [ - { - queryKey: key1, - queryFn: async () => { - results.push('1') - await sleep(10) - return '1' - }, - }, - { - queryKey: key2, - queryFn: async () => { - results.push('2') - await sleep(20) - return '2' - }, - }, - ], - }) - return ( -
-

data: {result.map((item) => item.data ?? 'null').join(',')}

-
- ) - } - - const rendered = renderWithClient( - queryClient, - }> - - , - ) - - await waitFor(() => rendered.getByText('loading')) - await waitFor(() => rendered.getByText('data: 1,2')) - - expect(results).toEqual(['1', '2', 'loading']) - }) - - it("shouldn't unmount before all promises fetched", async () => { - const key1 = queryKey() - const key2 = queryKey() - const results: Array = [] - const refs: Array = [] - - function Fallback() { - results.push('loading') - return
loading
- } - - function Page() { - const ref = React.useRef(Math.random()) - const result = useSuspenseQueries({ - queries: [ - { - queryKey: key1, - queryFn: async () => { - refs.push(ref.current) - results.push('1') - await sleep(10) - return '1' - }, - }, - { - queryKey: key2, - queryFn: async () => { - refs.push(ref.current) - results.push('2') - await sleep(20) - return '2' - }, - }, - ], - }) - return ( -
-

data: {result.map((item) => item.data ?? 'null').join(',')}

-
- ) - } - - const rendered = renderWithClient( - queryClient, - }> - - , - ) - await waitFor(() => rendered.getByText('loading')) - expect(refs.length).toBe(2) - await waitFor(() => rendered.getByText('data: 1,2')) - expect(refs[0]).toBe(refs[1]) - }) - - // this addresses the following issue: - // https://github.com/TanStack/query/issues/6344 - it('should suspend on offline when query changes, and data should not be undefined', async () => { - function Page() { - const [id, setId] = React.useState(0) - - const { data } = useSuspenseQuery({ - queryKey: [id], - queryFn: () => Promise.resolve(`Data ${id}`), - }) - - // defensive guard here - if (data === undefined) { - throw new Error('data cannot be undefined') - } - - return ( - <> -
{data}
- - - ) - } - - const rendered = renderWithClient( - queryClient, - loading}> - - , - ) - - await waitFor(() => rendered.getByText('loading')) - await waitFor(() => rendered.getByText('Data 0')) - - // go offline - document.dispatchEvent(new CustomEvent('offline')) - - fireEvent.click(rendered.getByText('fetch')) - await waitFor(() => rendered.getByText('Data 0')) - - // go back online - document.dispatchEvent(new CustomEvent('online')) - fireEvent.click(rendered.getByText('fetch')) - - // query should resume - await waitFor(() => rendered.getByText('Data 1')) - }) - - it('should throw error when queryKey changes and new query fails', async () => { - const consoleMock = vi - .spyOn(console, 'error') - .mockImplementation(() => undefined) - const key = queryKey() - - function Page() { - const [fail, setFail] = React.useState(false) - const { data } = useSuspenseQuery({ - queryKey: [key, fail], - queryFn: async () => { - await sleep(10) - - if (fail) { - throw new Error('Suspense Error Bingo') - } else { - return 'data' - } - }, - retry: 0, - }) - - return ( -
- - -
rendered: {String(data)}
-
- ) - } - - const rendered = renderWithClient( - queryClient, -
error boundary
}> - - - -
, - ) - - await waitFor(() => rendered.getByText('Loading...')) - - await waitFor(() => rendered.getByText('rendered: data')) - - fireEvent.click(rendered.getByText('trigger fail')) - - await waitFor(() => rendered.getByText('error boundary')) - - expect(consoleMock.mock.calls[0]?.[1]).toStrictEqual( - new Error('Suspense Error Bingo'), - ) - - consoleMock.mockRestore() - }) - - it('should keep previous data when wrapped in a transition', async () => { - const key = queryKey() - - function Page() { - const [count, setCount] = React.useState(0) - const [isPending, startTransition] = React.useTransition() - const { data } = useSuspenseQuery({ - queryKey: [key, count], - queryFn: async () => { - await sleep(10) - return 'data' + count - }, - }) - - return ( -
- - -
{isPending ? 'Pending...' : String(data)}
-
- ) - } - - const rendered = renderWithClient( - queryClient, - - - , - ) - - await waitFor(() => rendered.getByText('Loading...')) - - await waitFor(() => rendered.getByText('data0')) - - fireEvent.click(rendered.getByText('inc')) - - await waitFor(() => rendered.getByText('Pending...')) - - await waitFor(() => rendered.getByText('data1')) - }) - - it('should not request old data inside transitions (issue #6486)', async () => { - const key = queryKey() - let queryFnCount = 0 - - function App() { - const [count, setCount] = React.useState(0) - - return ( -
- - - - -
- ) - } - - function Page({ count }: { count: number }) { - const { data } = useSuspenseQuery({ - queryKey: [key, count], - queryFn: async () => { - queryFnCount++ - await sleep(10) - return 'data' + count - }, - }) - - return ( -
-
{String(data)}
-
- ) - } - - const rendered = renderWithClient( - queryClient, - - , - ) - - await waitFor(() => rendered.getByText('Loading...')) - - await waitFor(() => rendered.getByText('data0')) - - fireEvent.click(rendered.getByText('inc')) - - await waitFor(() => rendered.getByText('data1')) - - await sleep(20) - - expect(queryFnCount).toBe(2) - }) - - it('should still suspense if queryClient has placeholderData config', async () => { - const key = queryKey() - const queryClientWithPlaceholder = createQueryClient({ - defaultOptions: { - queries: { - placeholderData: (previousData: any) => previousData, - }, - }, - }) - - function Page() { - const [count, setCount] = React.useState(0) - const [isPending, startTransition] = React.useTransition() - const { data } = useSuspenseQuery({ - queryKey: [key, count], - queryFn: async () => { - await sleep(10) - return 'data' + count - }, - }) - - return ( -
- - -
{isPending ? 'Pending...' : String(data)}
-
- ) - } - - const rendered = renderWithClient( - queryClientWithPlaceholder, - - - , - ) - - await waitFor(() => rendered.getByText('Loading...')) - - await waitFor(() => rendered.getByText('data0')) - - fireEvent.click(rendered.getByText('inc')) - - await waitFor(() => rendered.getByText('Pending...')) - - await waitFor(() => rendered.getByText('data1')) - }) - - it('should show error boundary even with gcTime:0 (#7853)', async () => { - const consoleMock = vi - .spyOn(console, 'error') - .mockImplementation(() => undefined) - const key = queryKey() - let count = 0 - - function Page() { - useSuspenseQuery({ - queryKey: key, - queryFn: async () => { - count++ - console.log('queryFn') - throw new Error('Query failed') - }, - gcTime: 0, - retry: false, - }) - - return null - } - - function App() { - return ( - - { - return
There was an error!
- }} - > - -
-
- ) - } - - const rendered = renderWithClient(queryClient, ) - - await waitFor(() => rendered.getByText('There was an error!')) - expect(count).toBe(1) - consoleMock.mockRestore() - }) - - describe('gc (with fake timers)', () => { - beforeAll(() => { - vi.useFakeTimers() - }) - - afterAll(() => { - vi.useRealTimers() - }) - - it('should gc when unmounted while fetching with low gcTime (#8159)', async () => { - const key = queryKey() - - function Page() { - return ( - - - - ) - } - - function Component() { - const { data } = useSuspenseQuery({ - queryKey: key, - queryFn: async () => { - await sleep(3000) - return 'data' - }, - gcTime: 1000, - }) - - return
{data}
- } - - function Page2() { - return
page2
- } - - function App() { - const [show, setShow] = React.useState(true) - return ( -
- {show ? : } - -
- ) - } - - const rendered = renderWithClient(queryClient, ) - - await act(() => vi.advanceTimersByTimeAsync(200)) - - rendered.getByText('loading') - - // unmount while still fetching - fireEvent.click(rendered.getByText('hide')) - - await act(() => vi.advanceTimersByTimeAsync(800)) - - rendered.getByText('page2') - - // wait for query to be resolved - await act(() => vi.advanceTimersByTimeAsync(2000)) - - expect(queryClient.getQueryData(key)).toBe('data') - - // wait for gc - await act(() => vi.advanceTimersByTimeAsync(1000)) - - expect(queryClient.getQueryData(key)).toBe(undefined) - }) - }) -}) From 4fceb260d50cb111a938b467dd8e02927057c790 Mon Sep 17 00:00:00 2001 From: Haeun Nam <60870862+haeunnam@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:52:04 +0900 Subject: [PATCH 4/9] chore(query-core): define queryCache notify method's return type (#8191) Co-authored-by: Dominik Dorfmeister --- packages/query-core/src/queryCache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/query-core/src/queryCache.ts b/packages/query-core/src/queryCache.ts index 5222b2793b..8f637e0a39 100644 --- a/packages/query-core/src/queryCache.ts +++ b/packages/query-core/src/queryCache.ts @@ -197,7 +197,7 @@ export class QueryCache extends Subscribable { : queries } - notify(event: QueryCacheNotifyEvent) { + notify(event: QueryCacheNotifyEvent): void { notifyManager.batch(() => { this.listeners.forEach((listener) => { listener(event) From df49fbdd631d23d700b8dd07275479463f5d5226 Mon Sep 17 00:00:00 2001 From: Dominik Dorfmeister Date: Wed, 23 Oct 2024 14:51:27 +0200 Subject: [PATCH 5/9] fix(react-query): make sure promises are always finalized (#8211) otherwise, there can be cases with multiple observers where we have listeners already, but still need to finalize --- .../src/__tests__/useQuery.promise.test.tsx | 60 +++++++++++++++++++ packages/react-query/src/useBaseQuery.ts | 6 +- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/packages/react-query/src/__tests__/useQuery.promise.test.tsx b/packages/react-query/src/__tests__/useQuery.promise.test.tsx index 7f3e88673b..1540ae0ce7 100644 --- a/packages/react-query/src/__tests__/useQuery.promise.test.tsx +++ b/packages/react-query/src/__tests__/useQuery.promise.test.tsx @@ -964,4 +964,64 @@ describe('useQuery().promise', () => { 'test0new', // fresh data, background refetch, only for latest ]) }) + + it('should not suspend indefinitely with multiple, nested observers)', async () => { + const key = queryKey() + + function MyComponent({ input }: { input: string }) { + const query = useTheQuery(input) + const data = React.use(query.promise) + + return <>{data} + } + + function useTheQuery(input: string) { + return useQuery({ + staleTime: Infinity, + queryKey: [key, input], + queryFn: async () => { + await sleep(1) + return input + ' response' + }, + }) + } + + function Page() { + const [input, setInput] = React.useState('defaultInput') + useTheQuery(input) + + return ( +
+ + + + +
+ ) + } + + const rendered = renderWithClient(queryClient, ) + await waitFor(() => rendered.getByText('loading..')) + await waitFor(() => rendered.getByText('defaultInput response')) + + expect( + queryClient.getQueryCache().find({ queryKey: [key, 'defaultInput'] })! + .observers.length, + ).toBe(2) + + fireEvent.click(rendered.getByText('setInput')) + + await waitFor(() => rendered.getByText('loading..')) + await waitFor(() => rendered.getByText('someInput response')) + + expect( + queryClient.getQueryCache().find({ queryKey: [key, 'defaultInput'] })! + .observers.length, + ).toBe(0) + + expect( + queryClient.getQueryCache().find({ queryKey: [key, 'someInput'] })! + .observers.length, + ).toBe(2) + }) }) diff --git a/packages/react-query/src/useBaseQuery.ts b/packages/react-query/src/useBaseQuery.ts index 9ae2aefda6..458494972f 100644 --- a/packages/react-query/src/useBaseQuery.ts +++ b/packages/react-query/src/useBaseQuery.ts @@ -150,10 +150,8 @@ export function useBaseQuery< client.getQueryCache().get(defaultedOptions.queryHash)?.promise promise?.catch(noop).finally(() => { - if (!observer.hasListeners()) { - // `.updateResult()` will trigger `.#currentThenable` to finalize - observer.updateResult() - } + // `.updateResult()` will trigger `.#currentThenable` to finalize + observer.updateResult() }) } From 820bb81ba89059350476e755437c74ae2a353afa Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Wed, 23 Oct 2024 12:53:17 +0000 Subject: [PATCH 6/9] release: v5.59.16 --- examples/angular/basic/package.json | 4 +- .../package.json | 4 +- examples/angular/pagination/package.json | 4 +- examples/angular/router/package.json | 4 +- examples/angular/rxjs/package.json | 4 +- examples/angular/simple/package.json | 4 +- examples/react/algolia/package.json | 4 +- examples/react/auto-refetching/package.json | 4 +- .../react/basic-graphql-request/package.json | 4 +- examples/react/basic/package.json | 8 +- .../react/default-query-function/package.json | 4 +- examples/react/devtools-panel/package.json | 4 +- .../package.json | 4 +- .../load-more-infinite-scroll/package.json | 4 +- .../react/nextjs-app-prefetching/package.json | 4 +- .../nextjs-suspense-streaming/package.json | 6 +- examples/react/nextjs/package.json | 4 +- examples/react/offline/package.json | 8 +- .../optimistic-updates-cache/package.json | 4 +- .../react/optimistic-updates-ui/package.json | 4 +- examples/react/pagination/package.json | 4 +- examples/react/playground/package.json | 4 +- examples/react/prefetching/package.json | 4 +- examples/react/react-native/package.json | 4 +- examples/react/react-router/package.json | 4 +- examples/react/rick-morty/package.json | 4 +- examples/react/shadow-dom/package.json | 4 +- examples/react/simple/package.json | 4 +- examples/react/star-wars/package.json | 4 +- examples/react/suspense/package.json | 4 +- examples/solid/astro/package.json | 4 +- .../solid/basic-graphql-request/package.json | 4 +- examples/solid/basic/package.json | 4 +- .../solid/default-query-function/package.json | 4 +- examples/solid/simple/package.json | 4 +- .../solid/solid-start-streaming/package.json | 4 +- examples/svelte/auto-refetching/package.json | 4 +- examples/svelte/basic/package.json | 8 +- .../load-more-infinite-scroll/package.json | 4 +- .../svelte/optimistic-updates/package.json | 4 +- examples/svelte/playground/package.json | 4 +- examples/svelte/simple/package.json | 4 +- examples/svelte/ssr/package.json | 4 +- examples/svelte/star-wars/package.json | 4 +- examples/vue/2.6-basic/package.json | 2 +- examples/vue/2.7-basic/package.json | 2 +- examples/vue/basic/package.json | 4 +- examples/vue/dependent-queries/package.json | 2 +- examples/vue/nuxt3/package.json | 2 +- examples/vue/persister/package.json | 8 +- examples/vue/simple/package.json | 4 +- .../package.json | 2 +- .../angular-query-experimental/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/query-core/package.json | 2 +- .../query-persist-client-core/package.json | 2 +- .../query-sync-storage-persister/package.json | 2 +- packages/react-query-devtools/package.json | 2 +- .../package.json | 2 +- .../react-query-persist-client/package.json | 2 +- packages/react-query/package.json | 2 +- packages/solid-query-devtools/package.json | 2 +- .../solid-query-persist-client/package.json | 2 +- packages/solid-query/package.json | 2 +- packages/svelte-query-devtools/package.json | 2 +- .../svelte-query-persist-client/package.json | 2 +- packages/svelte-query/package.json | 2 +- packages/vue-query-devtools/package.json | 2 +- packages/vue-query/package.json | 2 +- pnpm-lock.yaml | 208 +++++++++--------- 71 files changed, 230 insertions(+), 230 deletions(-) diff --git a/examples/angular/basic/package.json b/examples/angular/basic/package.json index 2443b4a5f8..1a8ea9a179 100644 --- a/examples/angular/basic/package.json +++ b/examples/angular/basic/package.json @@ -14,7 +14,7 @@ "@angular/core": "^17.3.12", "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -23,7 +23,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/angular/infinite-query-with-max-pages/package.json b/examples/angular/infinite-query-with-max-pages/package.json index b4a8b1ba5b..7de533af5c 100644 --- a/examples/angular/infinite-query-with-max-pages/package.json +++ b/examples/angular/infinite-query-with-max-pages/package.json @@ -14,7 +14,7 @@ "@angular/core": "^17.3.12", "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -23,7 +23,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/angular/pagination/package.json b/examples/angular/pagination/package.json index a436a1a798..792883bd84 100644 --- a/examples/angular/pagination/package.json +++ b/examples/angular/pagination/package.json @@ -14,7 +14,7 @@ "@angular/core": "^17.3.12", "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -23,7 +23,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/angular/router/package.json b/examples/angular/router/package.json index 654e537555..f55f25f400 100644 --- a/examples/angular/router/package.json +++ b/examples/angular/router/package.json @@ -15,7 +15,7 @@ "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", "@angular/router": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -24,7 +24,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/angular/rxjs/package.json b/examples/angular/rxjs/package.json index 42e0d4ccf0..53ec74220d 100644 --- a/examples/angular/rxjs/package.json +++ b/examples/angular/rxjs/package.json @@ -16,7 +16,7 @@ "@angular/forms": "17.3.12", "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -25,7 +25,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/angular/simple/package.json b/examples/angular/simple/package.json index 7b37c36dec..6645d18903 100644 --- a/examples/angular/simple/package.json +++ b/examples/angular/simple/package.json @@ -15,7 +15,7 @@ "@angular/platform-browser": "^17.3.12", "@angular/platform-browser-dynamic": "^17.3.12", "@angular/router": "^17.3.12", - "@tanstack/angular-query-experimental": "^5.59.13", + "@tanstack/angular-query-experimental": "^5.59.16", "rxjs": "^7.8.1", "tslib": "^2.6.3", "zone.js": "^0.14.8" @@ -24,7 +24,7 @@ "@angular-devkit/build-angular": "^17.3.8", "@angular/cli": "^17.3.8", "@angular/compiler-cli": "^17.3.12", - "@tanstack/angular-query-devtools-experimental": "^5.59.13", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", "typescript": "5.3.3" } } diff --git a/examples/react/algolia/package.json b/examples/react/algolia/package.json index 87b9c025d8..964a74086e 100644 --- a/examples/react/algolia/package.json +++ b/examples/react/algolia/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@algolia/client-search": "5.2.1", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/auto-refetching/package.json b/examples/react/auto-refetching/package.json index 0e26f99171..2a24d79a09 100644 --- a/examples/react/auto-refetching/package.json +++ b/examples/react/auto-refetching/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/basic-graphql-request/package.json b/examples/react/basic-graphql-request/package.json index 359cbfff57..dd6b858ea7 100644 --- a/examples/react/basic-graphql-request/package.json +++ b/examples/react/basic-graphql-request/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "graphql": "^16.9.0", "graphql-request": "^7.1.0", "react": "19.0.0-rc-4c2e457c7c-20240522", diff --git a/examples/react/basic/package.json b/examples/react/basic/package.json index afe704f535..698f967a15 100644 --- a/examples/react/basic/package.json +++ b/examples/react/basic/package.json @@ -9,10 +9,10 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/query-sync-storage-persister": "^5.59.13", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", - "@tanstack/react-query-persist-client": "^5.59.15", + "@tanstack/query-sync-storage-persister": "^5.59.16", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", + "@tanstack/react-query-persist-client": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/default-query-function/package.json b/examples/react/default-query-function/package.json index df792bc46d..004d6dd5d3 100644 --- a/examples/react/default-query-function/package.json +++ b/examples/react/default-query-function/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/devtools-panel/package.json b/examples/react/devtools-panel/package.json index aa46526b9a..4637f097bf 100644 --- a/examples/react/devtools-panel/package.json +++ b/examples/react/devtools-panel/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/infinite-query-with-max-pages/package.json b/examples/react/infinite-query-with-max-pages/package.json index b51e03e9d6..5606d7b34b 100644 --- a/examples/react/infinite-query-with-max-pages/package.json +++ b/examples/react/infinite-query-with-max-pages/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/load-more-infinite-scroll/package.json b/examples/react/load-more-infinite-scroll/package.json index 4f9062d6ee..745c44c65a 100644 --- a/examples/react/load-more-infinite-scroll/package.json +++ b/examples/react/load-more-infinite-scroll/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/react/nextjs-app-prefetching/package.json b/examples/react/nextjs-app-prefetching/package.json index 7ccd4fffc0..ba50526d11 100644 --- a/examples/react/nextjs-app-prefetching/package.json +++ b/examples/react/nextjs-app-prefetching/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^15.0.0-rc.0", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" diff --git a/examples/react/nextjs-suspense-streaming/package.json b/examples/react/nextjs-suspense-streaming/package.json index 5bce0f8a31..fc2b656c8a 100644 --- a/examples/react/nextjs-suspense-streaming/package.json +++ b/examples/react/nextjs-suspense-streaming/package.json @@ -9,9 +9,9 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", - "@tanstack/react-query-next-experimental": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", + "@tanstack/react-query-next-experimental": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/nextjs/package.json b/examples/react/nextjs/package.json index 9966bf2e3d..4895b6fff4 100644 --- a/examples/react/nextjs/package.json +++ b/examples/react/nextjs/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/offline/package.json b/examples/react/offline/package.json index a2eb04afee..6e0fb7de99 100644 --- a/examples/react/offline/package.json +++ b/examples/react/offline/package.json @@ -8,11 +8,11 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/query-sync-storage-persister": "^5.59.13", + "@tanstack/query-sync-storage-persister": "^5.59.16", "@tanstack/react-location": "^3.7.4", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", - "@tanstack/react-query-persist-client": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", + "@tanstack/react-query-persist-client": "^5.59.16", "msw": "^2.3.4", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522", diff --git a/examples/react/optimistic-updates-cache/package.json b/examples/react/optimistic-updates-cache/package.json index d9c4176282..4ee007d5a8 100755 --- a/examples/react/optimistic-updates-cache/package.json +++ b/examples/react/optimistic-updates-cache/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/optimistic-updates-ui/package.json b/examples/react/optimistic-updates-ui/package.json index 136dcab2f9..8e1219e522 100755 --- a/examples/react/optimistic-updates-ui/package.json +++ b/examples/react/optimistic-updates-ui/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/pagination/package.json b/examples/react/pagination/package.json index e01317387b..329e3fc19a 100644 --- a/examples/react/pagination/package.json +++ b/examples/react/pagination/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/playground/package.json b/examples/react/playground/package.json index 6d825391ea..feff98b800 100644 --- a/examples/react/playground/package.json +++ b/examples/react/playground/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/prefetching/package.json b/examples/react/prefetching/package.json index 10104733d8..94e332a207 100644 --- a/examples/react/prefetching/package.json +++ b/examples/react/prefetching/package.json @@ -8,8 +8,8 @@ "start": "next start" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "next": "^14.2.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/react/react-native/package.json b/examples/react/react-native/package.json index cbc2597e2b..a227298701 100644 --- a/examples/react/react-native/package.json +++ b/examples/react/react-native/package.json @@ -14,8 +14,8 @@ "@react-native-community/netinfo": "^11.3.2", "@react-navigation/native": "^6.1.18", "@react-navigation/stack": "^6.4.1", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "expo": "^51.0.22", "expo-constants": "^16.0.2", "expo-status-bar": "^1.12.1", diff --git a/examples/react/react-router/package.json b/examples/react/react-router/package.json index 3c388ad44b..5fc9c6008a 100644 --- a/examples/react/react-router/package.json +++ b/examples/react/react-router/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "localforage": "^1.10.0", "match-sorter": "^6.3.4", "react": "19.0.0-rc-4c2e457c7c-20240522", diff --git a/examples/react/rick-morty/package.json b/examples/react/rick-morty/package.json index 9e097e4c55..8f2d22baa3 100644 --- a/examples/react/rick-morty/package.json +++ b/examples/react/rick-morty/package.json @@ -12,8 +12,8 @@ "@emotion/styled": "^11.13.0", "@mui/material": "^6.0.0", "@mui/styles": "^6.0.0", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522", "react-router": "^6.25.1", diff --git a/examples/react/shadow-dom/package.json b/examples/react/shadow-dom/package.json index 0b66d9907b..9716ab3614 100644 --- a/examples/react/shadow-dom/package.json +++ b/examples/react/shadow-dom/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/simple/package.json b/examples/react/simple/package.json index 5de8639a1a..ee335ac8a8 100644 --- a/examples/react/simple/package.json +++ b/examples/react/simple/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522" }, diff --git a/examples/react/star-wars/package.json b/examples/react/star-wars/package.json index 9df0bac53c..8e3e20e830 100644 --- a/examples/react/star-wars/package.json +++ b/examples/react/star-wars/package.json @@ -12,8 +12,8 @@ "@emotion/styled": "^11.13.0", "@mui/material": "^6.0.0", "@mui/styles": "^6.0.0", - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522", "react-router": "^6.25.1", diff --git a/examples/react/suspense/package.json b/examples/react/suspense/package.json index be66334387..38e7c48ae1 100644 --- a/examples/react/suspense/package.json +++ b/examples/react/suspense/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/react-query": "^5.59.15", - "@tanstack/react-query-devtools": "^5.59.15", + "@tanstack/react-query": "^5.59.16", + "@tanstack/react-query-devtools": "^5.59.16", "font-awesome": "^4.7.0", "react": "19.0.0-rc-4c2e457c7c-20240522", "react-dom": "19.0.0-rc-4c2e457c7c-20240522", diff --git a/examples/solid/astro/package.json b/examples/solid/astro/package.json index c30fc501bb..6f7b57f2fb 100644 --- a/examples/solid/astro/package.json +++ b/examples/solid/astro/package.json @@ -15,8 +15,8 @@ "@astrojs/solid-js": "^4.4.0", "@astrojs/tailwind": "^5.1.0", "@astrojs/vercel": "^7.7.2", - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "astro": "^4.12.2", "solid-js": "^1.8.19", "tailwindcss": "^3.4.7", diff --git a/examples/solid/basic-graphql-request/package.json b/examples/solid/basic-graphql-request/package.json index 18361a745c..f777be7e86 100644 --- a/examples/solid/basic-graphql-request/package.json +++ b/examples/solid/basic-graphql-request/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "graphql": "^16.9.0", "graphql-request": "^7.1.0", "solid-js": "^1.8.19" diff --git a/examples/solid/basic/package.json b/examples/solid/basic/package.json index a5453c3581..18a42c8ac0 100644 --- a/examples/solid/basic/package.json +++ b/examples/solid/basic/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "solid-js": "^1.8.19" }, "devDependencies": { diff --git a/examples/solid/default-query-function/package.json b/examples/solid/default-query-function/package.json index 2c2ff26e81..756889348e 100644 --- a/examples/solid/default-query-function/package.json +++ b/examples/solid/default-query-function/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "solid-js": "^1.8.19" }, "devDependencies": { diff --git a/examples/solid/simple/package.json b/examples/solid/simple/package.json index 1e9d793e9f..503e17ccbe 100644 --- a/examples/solid/simple/package.json +++ b/examples/solid/simple/package.json @@ -9,8 +9,8 @@ "test:types": "tsc" }, "dependencies": { - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "solid-js": "^1.8.19" }, "devDependencies": { diff --git a/examples/solid/solid-start-streaming/package.json b/examples/solid/solid-start-streaming/package.json index 957fae3cc8..59d2e0ea15 100644 --- a/examples/solid/solid-start-streaming/package.json +++ b/examples/solid/solid-start-streaming/package.json @@ -12,8 +12,8 @@ "@solidjs/meta": "^0.29.4", "@solidjs/router": "^0.14.1", "@solidjs/start": "^1.0.6", - "@tanstack/solid-query": "^5.59.13", - "@tanstack/solid-query-devtools": "^5.59.13", + "@tanstack/solid-query": "^5.59.16", + "@tanstack/solid-query-devtools": "^5.59.16", "solid-js": "^1.8.19", "vinxi": "^0.4.1" }, diff --git a/examples/svelte/auto-refetching/package.json b/examples/svelte/auto-refetching/package.json index 985495bb8c..e4944e46f3 100644 --- a/examples/svelte/auto-refetching/package.json +++ b/examples/svelte/auto-refetching/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/basic/package.json b/examples/svelte/basic/package.json index cbd1debf04..bd3e2d3520 100644 --- a/examples/svelte/basic/package.json +++ b/examples/svelte/basic/package.json @@ -9,10 +9,10 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/query-sync-storage-persister": "^5.59.13", - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13", - "@tanstack/svelte-query-persist-client": "^5.59.13" + "@tanstack/query-sync-storage-persister": "^5.59.16", + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16", + "@tanstack/svelte-query-persist-client": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/load-more-infinite-scroll/package.json b/examples/svelte/load-more-infinite-scroll/package.json index 5fd220d5b9..9e99935bd8 100644 --- a/examples/svelte/load-more-infinite-scroll/package.json +++ b/examples/svelte/load-more-infinite-scroll/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/optimistic-updates/package.json b/examples/svelte/optimistic-updates/package.json index 463b19d9de..7dbefd279f 100644 --- a/examples/svelte/optimistic-updates/package.json +++ b/examples/svelte/optimistic-updates/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/playground/package.json b/examples/svelte/playground/package.json index 9526b06db8..d5cc87dcf8 100644 --- a/examples/svelte/playground/package.json +++ b/examples/svelte/playground/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/simple/package.json b/examples/svelte/simple/package.json index 65716959e5..177cd277c5 100644 --- a/examples/svelte/simple/package.json +++ b/examples/svelte/simple/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1", diff --git a/examples/svelte/ssr/package.json b/examples/svelte/ssr/package.json index b0c43d86b2..2e5020a420 100644 --- a/examples/svelte/ssr/package.json +++ b/examples/svelte/ssr/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/svelte/star-wars/package.json b/examples/svelte/star-wars/package.json index 9a0c4caafa..bb4f972648 100644 --- a/examples/svelte/star-wars/package.json +++ b/examples/svelte/star-wars/package.json @@ -9,8 +9,8 @@ "test:types": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-query-devtools": "^5.59.13" + "@tanstack/svelte-query": "^5.59.16", + "@tanstack/svelte-query-devtools": "^5.59.16" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.2.2", diff --git a/examples/vue/2.6-basic/package.json b/examples/vue/2.6-basic/package.json index 0da8b94889..a649ba3102 100644 --- a/examples/vue/2.6-basic/package.json +++ b/examples/vue/2.6-basic/package.json @@ -8,7 +8,7 @@ "_preview": "vite preview" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13", + "@tanstack/vue-query": "^5.59.16", "@vue/composition-api": "1.7.2", "vue": "2.6.14", "vue-template-compiler": "2.6.14" diff --git a/examples/vue/2.7-basic/package.json b/examples/vue/2.7-basic/package.json index c994e3e509..2e2ca6d3f1 100644 --- a/examples/vue/2.7-basic/package.json +++ b/examples/vue/2.7-basic/package.json @@ -8,7 +8,7 @@ "_serve": "vite preview" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13", + "@tanstack/vue-query": "^5.59.16", "vue": "2.7.16", "vue-template-compiler": "2.7.16" }, diff --git a/examples/vue/basic/package.json b/examples/vue/basic/package.json index 16997a39a1..5801024f1b 100644 --- a/examples/vue/basic/package.json +++ b/examples/vue/basic/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13", - "@tanstack/vue-query-devtools": "^5.59.13", + "@tanstack/vue-query": "^5.59.16", + "@tanstack/vue-query-devtools": "^5.59.16", "vue": "^3.4.27" }, "devDependencies": { diff --git a/examples/vue/dependent-queries/package.json b/examples/vue/dependent-queries/package.json index 724df7094e..8bb1d0a86b 100644 --- a/examples/vue/dependent-queries/package.json +++ b/examples/vue/dependent-queries/package.json @@ -8,7 +8,7 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13", + "@tanstack/vue-query": "^5.59.16", "vue": "^3.4.27" }, "devDependencies": { diff --git a/examples/vue/nuxt3/package.json b/examples/vue/nuxt3/package.json index 327c42af99..f081a76405 100644 --- a/examples/vue/nuxt3/package.json +++ b/examples/vue/nuxt3/package.json @@ -7,7 +7,7 @@ "_start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13" + "@tanstack/vue-query": "^5.59.16" }, "devDependencies": { "nuxt": "^3.12.4" diff --git a/examples/vue/persister/package.json b/examples/vue/persister/package.json index 6b03514445..4c48e8da40 100644 --- a/examples/vue/persister/package.json +++ b/examples/vue/persister/package.json @@ -8,10 +8,10 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/query-core": "^5.59.13", - "@tanstack/query-persist-client-core": "^5.59.13", - "@tanstack/query-sync-storage-persister": "^5.59.13", - "@tanstack/vue-query": "^5.59.13", + "@tanstack/query-core": "^5.59.16", + "@tanstack/query-persist-client-core": "^5.59.16", + "@tanstack/query-sync-storage-persister": "^5.59.16", + "@tanstack/vue-query": "^5.59.16", "idb-keyval": "^6.2.1", "vue": "^3.4.27" }, diff --git a/examples/vue/simple/package.json b/examples/vue/simple/package.json index bab657d6fc..a8d758a8dc 100644 --- a/examples/vue/simple/package.json +++ b/examples/vue/simple/package.json @@ -8,8 +8,8 @@ "preview": "vite preview" }, "dependencies": { - "@tanstack/vue-query": "^5.59.13", - "@tanstack/vue-query-devtools": "^5.59.13", + "@tanstack/vue-query": "^5.59.16", + "@tanstack/vue-query-devtools": "^5.59.16", "vue": "^3.4.27" }, "devDependencies": { diff --git a/packages/angular-query-devtools-experimental/package.json b/packages/angular-query-devtools-experimental/package.json index 76e74f15f4..adc2a8f4bd 100644 --- a/packages/angular-query-devtools-experimental/package.json +++ b/packages/angular-query-devtools-experimental/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/angular-query-devtools-experimental", - "version": "5.59.13", + "version": "5.59.16", "description": "Developer tools to interact with and visualize the TanStack/angular-query cache", "author": "Arnoud de Vries", "license": "MIT", diff --git a/packages/angular-query-experimental/package.json b/packages/angular-query-experimental/package.json index 32d70d3d01..d661feb8a9 100644 --- a/packages/angular-query-experimental/package.json +++ b/packages/angular-query-experimental/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/angular-query-experimental", - "version": "5.59.13", + "version": "5.59.16", "description": "Signals for managing, caching and syncing asynchronous and remote data in Angular", "author": "Arnoud de Vries", "license": "MIT", diff --git a/packages/query-async-storage-persister/package.json b/packages/query-async-storage-persister/package.json index eea6cb2de0..502ec663c7 100644 --- a/packages/query-async-storage-persister/package.json +++ b/packages/query-async-storage-persister/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/query-async-storage-persister", - "version": "5.59.13", + "version": "5.59.16", "description": "A persister for asynchronous storages, to be used with TanStack/Query", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/query-broadcast-client-experimental/package.json b/packages/query-broadcast-client-experimental/package.json index 3a75826bb7..e837a1bc3a 100644 --- a/packages/query-broadcast-client-experimental/package.json +++ b/packages/query-broadcast-client-experimental/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/query-broadcast-client-experimental", - "version": "5.59.13", + "version": "5.59.16", "description": "An experimental plugin to for broadcasting the state of your queryClient between browser tabs/windows", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/query-core/package.json b/packages/query-core/package.json index fd24b80733..6235489862 100644 --- a/packages/query-core/package.json +++ b/packages/query-core/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/query-core", - "version": "5.59.13", + "version": "5.59.16", "description": "The framework agnostic core that powers TanStack Query", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/query-persist-client-core/package.json b/packages/query-persist-client-core/package.json index 60bc916b2c..e2bba4d306 100644 --- a/packages/query-persist-client-core/package.json +++ b/packages/query-persist-client-core/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/query-persist-client-core", - "version": "5.59.13", + "version": "5.59.16", "description": "Set of utilities for interacting with persisters, which can save your queryClient for later use", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/query-sync-storage-persister/package.json b/packages/query-sync-storage-persister/package.json index 689ea0e452..6a503d9be7 100644 --- a/packages/query-sync-storage-persister/package.json +++ b/packages/query-sync-storage-persister/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/query-sync-storage-persister", - "version": "5.59.13", + "version": "5.59.16", "description": "A persister for synchronous storages, to be used with TanStack/Query", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/react-query-devtools/package.json b/packages/react-query-devtools/package.json index 8ede1b8cfb..1eae0d41d5 100644 --- a/packages/react-query-devtools/package.json +++ b/packages/react-query-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-query-devtools", - "version": "5.59.15", + "version": "5.59.16", "description": "Developer tools to interact with and visualize the TanStack/react-query cache", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/react-query-next-experimental/package.json b/packages/react-query-next-experimental/package.json index a64965c226..c8200711c7 100644 --- a/packages/react-query-next-experimental/package.json +++ b/packages/react-query-next-experimental/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-query-next-experimental", - "version": "5.59.15", + "version": "5.59.16", "description": "Hydration utils for React Query in the NextJs app directory", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/react-query-persist-client/package.json b/packages/react-query-persist-client/package.json index 660c91b6ca..e946234998 100644 --- a/packages/react-query-persist-client/package.json +++ b/packages/react-query-persist-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-query-persist-client", - "version": "5.59.15", + "version": "5.59.16", "description": "React bindings to work with persisters in TanStack/react-query", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 2b8afc9bd8..6833c6eb66 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-query", - "version": "5.59.15", + "version": "5.59.16", "description": "Hooks for managing, caching and syncing asynchronous and remote data in React", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/solid-query-devtools/package.json b/packages/solid-query-devtools/package.json index bf286056f8..271c8f53ef 100644 --- a/packages/solid-query-devtools/package.json +++ b/packages/solid-query-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/solid-query-devtools", - "version": "5.59.13", + "version": "5.59.16", "description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/solid-query-persist-client/package.json b/packages/solid-query-persist-client/package.json index f02613c7e7..45a1518623 100644 --- a/packages/solid-query-persist-client/package.json +++ b/packages/solid-query-persist-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/solid-query-persist-client", - "version": "5.59.13", + "version": "5.59.16", "description": "Solid.js bindings to work with persisters in TanStack/solid-query", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/solid-query/package.json b/packages/solid-query/package.json index 2b77f6557d..bac9351685 100644 --- a/packages/solid-query/package.json +++ b/packages/solid-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/solid-query", - "version": "5.59.13", + "version": "5.59.16", "description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/svelte-query-devtools/package.json b/packages/svelte-query-devtools/package.json index c1dcbd76b9..407458151e 100644 --- a/packages/svelte-query-devtools/package.json +++ b/packages/svelte-query-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/svelte-query-devtools", - "version": "5.59.13", + "version": "5.59.16", "description": "Developer tools to interact with and visualize the TanStack/svelte-query cache", "author": "Lachlan Collins", "license": "MIT", diff --git a/packages/svelte-query-persist-client/package.json b/packages/svelte-query-persist-client/package.json index 2da98d800a..538d29dcc0 100644 --- a/packages/svelte-query-persist-client/package.json +++ b/packages/svelte-query-persist-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/svelte-query-persist-client", - "version": "5.59.13", + "version": "5.59.16", "description": "Svelte bindings to work with persisters in TanStack/svelte-query", "author": "Lachlan Collins", "license": "MIT", diff --git a/packages/svelte-query/package.json b/packages/svelte-query/package.json index 931745beed..dc3c075b88 100644 --- a/packages/svelte-query/package.json +++ b/packages/svelte-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/svelte-query", - "version": "5.59.13", + "version": "5.59.16", "description": "Primitives for managing, caching and syncing asynchronous and remote data in Svelte", "author": "Lachlan Collins", "license": "MIT", diff --git a/packages/vue-query-devtools/package.json b/packages/vue-query-devtools/package.json index 4cf4c4978f..883cd25129 100644 --- a/packages/vue-query-devtools/package.json +++ b/packages/vue-query-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-query-devtools", - "version": "5.59.13", + "version": "5.59.16", "description": "Developer tools to interact with and visualize the TanStack/vue-query cache", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/vue-query/package.json b/packages/vue-query/package.json index 5d89a4a9b3..079bd8ed6a 100644 --- a/packages/vue-query/package.json +++ b/packages/vue-query/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/vue-query", - "version": "5.59.13", + "version": "5.59.16", "description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue", "author": "Damian Osipiuk", "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d2b45030a..85fc768321 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -148,7 +148,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -170,7 +170,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -194,7 +194,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -216,7 +216,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -240,7 +240,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -262,7 +262,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -289,7 +289,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(rxjs@7.8.1) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -311,7 +311,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -341,7 +341,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -363,7 +363,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -390,7 +390,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(rxjs@7.8.1) '@tanstack/angular-query-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-experimental rxjs: specifier: ^7.8.1 @@ -412,7 +412,7 @@ importers: specifier: ^17.3.12 version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) '@tanstack/angular-query-devtools-experimental': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/angular-query-devtools-experimental typescript: specifier: 5.3.3 @@ -424,10 +424,10 @@ importers: specifier: 5.2.1 version: 5.2.1 '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -458,10 +458,10 @@ importers: examples/react/auto-refetching: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -486,16 +486,16 @@ importers: examples/react/basic: dependencies: '@tanstack/query-sync-storage-persister': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-sync-storage-persister '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools '@tanstack/react-query-persist-client': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-persist-client react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -526,10 +526,10 @@ importers: examples/react/basic-graphql-request: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools graphql: specifier: ^16.9.0 @@ -554,10 +554,10 @@ importers: examples/react/default-query-function: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -579,10 +579,10 @@ importers: examples/react/devtools-panel: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -604,10 +604,10 @@ importers: examples/react/infinite-query-with-max-pages: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -632,10 +632,10 @@ importers: examples/react/load-more-infinite-scroll: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -663,10 +663,10 @@ importers: examples/react/nextjs: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -691,10 +691,10 @@ importers: examples/react/nextjs-app-prefetching: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^15.0.0-rc.0 @@ -719,13 +719,13 @@ importers: examples/react/nextjs-suspense-streaming: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools '@tanstack/react-query-next-experimental': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-next-experimental next: specifier: ^14.2.5 @@ -747,19 +747,19 @@ importers: examples/react/offline: dependencies: '@tanstack/query-sync-storage-persister': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-sync-storage-persister '@tanstack/react-location': specifier: ^3.7.4 version: 3.7.4(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@19.0.0-rc-4c2e457c7c-20240522) '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools '@tanstack/react-query-persist-client': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-persist-client msw: specifier: ^2.3.4 @@ -787,10 +787,10 @@ importers: examples/react/optimistic-updates-cache: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -815,10 +815,10 @@ importers: examples/react/optimistic-updates-ui: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -843,10 +843,10 @@ importers: examples/react/pagination: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -871,10 +871,10 @@ importers: examples/react/playground: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -896,10 +896,10 @@ importers: examples/react/prefetching: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools next: specifier: ^14.2.5 @@ -933,10 +933,10 @@ importers: specifier: ^6.4.1 version: 6.4.1(hz73ogopnnbu7tdkoevhdncb4q) '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools expo: specifier: ^51.0.22 @@ -985,10 +985,10 @@ importers: examples/react/react-router: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools localforage: specifier: ^1.10.0 @@ -1049,10 +1049,10 @@ importers: specifier: ^6.0.0 version: 6.0.0(react@19.0.0-rc-4c2e457c7c-20240522)(types-react@19.0.0-rc.1) '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -1080,10 +1080,10 @@ importers: examples/react/shadow-dom: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -1111,10 +1111,10 @@ importers: examples/react/simple: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -1148,10 +1148,10 @@ importers: specifier: ^6.0.0 version: 6.0.0(react@19.0.0-rc-4c2e457c7c-20240522)(types-react@19.0.0-rc.1) '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools react: specifier: 19.0.0-rc-4c2e457c7c-20240522 @@ -1179,10 +1179,10 @@ importers: examples/react/suspense: dependencies: '@tanstack/react-query': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query '@tanstack/react-query-devtools': - specifier: ^5.59.15 + specifier: ^5.59.16 version: link:../../../packages/react-query-devtools font-awesome: specifier: ^4.7.0 @@ -1225,10 +1225,10 @@ importers: specifier: ^7.7.2 version: 7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools astro: specifier: ^4.12.2 @@ -1246,10 +1246,10 @@ importers: examples/solid/basic: dependencies: '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools solid-js: specifier: ^1.8.19 @@ -1268,10 +1268,10 @@ importers: examples/solid/basic-graphql-request: dependencies: '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools graphql: specifier: ^16.9.0 @@ -1296,10 +1296,10 @@ importers: examples/solid/default-query-function: dependencies: '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools solid-js: specifier: ^1.8.19 @@ -1318,10 +1318,10 @@ importers: examples/solid/simple: dependencies: '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools solid-js: specifier: ^1.8.19 @@ -1352,10 +1352,10 @@ importers: specifier: ^1.0.6 version: 1.0.6(@testing-library/jest-dom@6.4.8)(rollup@4.24.0)(solid-js@1.8.19)(vinxi@0.4.1(@types/node@22.7.4)(idb-keyval@6.2.1)(ioredis@5.4.1)(less@4.2.0)(magicast@0.3.4)(sass@1.77.8)(terser@5.31.3))(vite@5.4.8(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)) '@tanstack/solid-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query '@tanstack/solid-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/solid-query-devtools solid-js: specifier: ^1.8.19 @@ -1367,10 +1367,10 @@ importers: examples/svelte/auto-refetching: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1398,16 +1398,16 @@ importers: examples/svelte/basic: dependencies: '@tanstack/query-sync-storage-persister': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-sync-storage-persister '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools '@tanstack/svelte-query-persist-client': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-persist-client devDependencies: '@sveltejs/adapter-auto': @@ -1435,10 +1435,10 @@ importers: examples/svelte/load-more-infinite-scroll: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1466,10 +1466,10 @@ importers: examples/svelte/optimistic-updates: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1497,10 +1497,10 @@ importers: examples/svelte/playground: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1528,10 +1528,10 @@ importers: examples/svelte/simple: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/vite-plugin-svelte': @@ -1556,10 +1556,10 @@ importers: examples/svelte/ssr: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1587,10 +1587,10 @@ importers: examples/svelte/star-wars: dependencies: '@tanstack/svelte-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query '@tanstack/svelte-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/svelte-query-devtools devDependencies: '@sveltejs/adapter-auto': @@ -1627,10 +1627,10 @@ importers: examples/vue/basic: dependencies: '@tanstack/vue-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query '@tanstack/vue-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query-devtools vue: specifier: ^3.4.27 @@ -1649,7 +1649,7 @@ importers: examples/vue/dependent-queries: dependencies: '@tanstack/vue-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query vue: specifier: ^3.4.27 @@ -1668,16 +1668,16 @@ importers: examples/vue/persister: dependencies: '@tanstack/query-core': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-core '@tanstack/query-persist-client-core': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-persist-client-core '@tanstack/query-sync-storage-persister': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/query-sync-storage-persister '@tanstack/vue-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query idb-keyval: specifier: ^6.2.1 @@ -1699,10 +1699,10 @@ importers: examples/vue/simple: dependencies: '@tanstack/vue-query': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query '@tanstack/vue-query-devtools': - specifier: ^5.59.13 + specifier: ^5.59.16 version: link:../../../packages/vue-query-devtools vue: specifier: ^3.4.27 From caf6556fceabead2a8d6c8a68dd04d9a47088713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Furcan=20Emre=20Ata=C5=9F?= Date: Wed, 23 Oct 2024 15:29:30 +0200 Subject: [PATCH 7/9] chore(docs): update useQueryFocusAware docs (#8205) * chore(docs): update react native useQueryFocusAware docs * ci: apply automated fixes --------- Co-authored-by: Dominik Dorfmeister Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- docs/framework/react/react-native.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/framework/react/react-native.md b/docs/framework/react/react-native.md index 2c2d6fc0e2..a7ca5d18ca 100644 --- a/docs/framework/react/react-native.md +++ b/docs/framework/react/react-native.md @@ -166,11 +166,21 @@ export function useQueryFocusAware(notifyOnChangeProps?: NotifyOnChangeProps) { ) return () => focusedRef.current +} +``` + +Example usage: + +```tsx +function MyComponent() { + const isFocused = useQueryFocusAware() - useQuery({ + const { dataUpdatedAt } = useQuery({ queryKey: ['key'], queryFn: () => fetch(...), - enabled: () => focusedRef.current, + enabled: isFocused, }) + + return DataUpdatedAt: {dataUpdatedAt} } ``` From 1865f0db1bb33b0d58d1f499334e926faedb77d2 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:21:58 +1100 Subject: [PATCH 8/9] test(react-query): better `query-persist-client-core` import (#8212) --- packages/react-query/package.json | 1 + .../__tests__/fine-grained-persister.test.tsx | 4 ++-- pnpm-lock.yaml | 23 +++++++++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 6833c6eb66..82f024b2c4 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -62,6 +62,7 @@ "@tanstack/query-core": "workspace:*" }, "devDependencies": { + "@tanstack/query-persist-client-core": "workspace:*", "@types/react": "npm:types-react@rc", "@types/react-dom": "npm:types-react-dom@rc", "@vitejs/plugin-react": "^4.3.1", diff --git a/packages/react-query/src/__tests__/fine-grained-persister.test.tsx b/packages/react-query/src/__tests__/fine-grained-persister.test.tsx index bd28a91d9d..af376cff87 100644 --- a/packages/react-query/src/__tests__/fine-grained-persister.test.tsx +++ b/packages/react-query/src/__tests__/fine-grained-persister.test.tsx @@ -2,11 +2,11 @@ import { describe, expect, it, vi } from 'vitest' import { waitFor } from '@testing-library/react' import * as React from 'react' import { QueryCache, hashKey } from '@tanstack/query-core' -import { useQuery } from '..' import { PERSISTER_KEY_PREFIX, experimental_createPersister, -} from '../../../query-persist-client-core/src' +} from '@tanstack/query-persist-client-core' +import { useQuery } from '..' import { createQueryClient, queryKey, renderWithClient, sleep } from './utils' describe('fine grained persister', () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85fc768321..3921e48767 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1223,7 +1223,7 @@ importers: version: 5.1.0(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(tailwindcss@3.4.7) '@astrojs/vercel': specifier: ^7.7.2 - version: 7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + version: 7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@tanstack/solid-query': specifier: ^5.59.16 version: link:../../../packages/solid-query @@ -2119,6 +2119,9 @@ importers: specifier: workspace:* version: link:../query-core devDependencies: + '@tanstack/query-persist-client-core': + specifier: workspace:* + version: link:../query-persist-client-core '@types/react': specifier: npm:types-react@rc version: types-react@19.0.0-rc.1 @@ -17624,10 +17627,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/vercel@7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': + '@astrojs/vercel@7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': dependencies: '@astrojs/internal-helpers': 0.4.1 - '@vercel/analytics': 1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + '@vercel/analytics': 1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@vercel/edge': 1.1.2 '@vercel/nft': 0.27.3(encoding@0.1.13) astro: 4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3) @@ -22887,11 +22890,11 @@ snapshots: graphql: 15.8.0 wonka: 4.0.15 - '@vercel/analytics@1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': + '@vercel/analytics@1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': dependencies: server-only: 0.0.1 optionalDependencies: - next: 14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8) + next: 14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8) react: 18.3.1 '@vercel/edge@1.1.2': {} @@ -30006,7 +30009,7 @@ snapshots: next-tick@1.1.0: {} - next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8): + next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8): dependencies: '@next/env': 14.2.5 '@swc/helpers': 0.5.5 @@ -30015,7 +30018,7 @@ snapshots: graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.3.1 - react-dom: 19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522) + react-dom: 19.0.0-rc-4c2e457c7c-20240522(react@18.3.1) styled-jsx: 5.1.1(@babel/core@7.25.2)(react@18.3.1) optionalDependencies: '@next/swc-darwin-arm64': 14.2.5 @@ -32313,6 +32316,12 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 + react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1): + dependencies: + react: 18.3.1 + scheduler: 0.25.0-rc-4c2e457c7c-20240522 + optional: true + react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522): dependencies: react: 19.0.0-rc-4c2e457c7c-20240522 From c61ff1e2f8036afa3f60ed434866e95175a3421c Mon Sep 17 00:00:00 2001 From: Arnoud <6420061+arnoud-dv@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:36:45 +0200 Subject: [PATCH 9/9] docs(angular-query): add query options from a service example (#8220) --- docs/config.json | 4 + .../.devcontainer/devcontainer.json | 4 + .../.eslintrc.cjs | 6 + .../query-options-from-a-service/README.md | 6 + .../query-options-from-a-service/angular.json | 104 ++++++++++++++++++ .../query-options-from-a-service/package.json | 30 +++++ .../src/app/app.component.html | 12 ++ .../src/app/app.component.ts | 12 ++ .../src/app/app.config.ts | 17 +++ .../src/app/app.routes.ts | 15 +++ .../src/app/components/post.component.html | 19 ++++ .../src/app/components/post.component.ts | 27 +++++ .../src/app/components/posts.component.html | 38 +++++++ .../src/app/components/posts.component.ts | 21 ++++ .../src/app/services/posts-service.ts | 21 ++++ .../src/app/services/queries-service.ts | 27 +++++ .../src/assets/.gitkeep | 0 .../src/favicon.ico | Bin 0 -> 15086 bytes .../src/index.html | 13 +++ .../query-options-from-a-service/src/main.ts | 5 + .../tsconfig.app.json | 9 ++ .../tsconfig.json | 29 +++++ examples/angular/router/angular.json | 2 +- examples/angular/router/src/styles.css | 1 - pnpm-lock.yaml | 71 +++++++++--- 25 files changed, 477 insertions(+), 16 deletions(-) create mode 100644 examples/angular/query-options-from-a-service/.devcontainer/devcontainer.json create mode 100644 examples/angular/query-options-from-a-service/.eslintrc.cjs create mode 100644 examples/angular/query-options-from-a-service/README.md create mode 100644 examples/angular/query-options-from-a-service/angular.json create mode 100644 examples/angular/query-options-from-a-service/package.json create mode 100644 examples/angular/query-options-from-a-service/src/app/app.component.html create mode 100644 examples/angular/query-options-from-a-service/src/app/app.component.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/app.config.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/app.routes.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/components/post.component.html create mode 100644 examples/angular/query-options-from-a-service/src/app/components/post.component.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/components/posts.component.html create mode 100644 examples/angular/query-options-from-a-service/src/app/components/posts.component.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/services/posts-service.ts create mode 100644 examples/angular/query-options-from-a-service/src/app/services/queries-service.ts create mode 100644 examples/angular/query-options-from-a-service/src/assets/.gitkeep create mode 100644 examples/angular/query-options-from-a-service/src/favicon.ico create mode 100644 examples/angular/query-options-from-a-service/src/index.html create mode 100644 examples/angular/query-options-from-a-service/src/main.ts create mode 100644 examples/angular/query-options-from-a-service/tsconfig.app.json create mode 100644 examples/angular/query-options-from-a-service/tsconfig.json delete mode 100644 examples/angular/router/src/styles.css diff --git a/docs/config.json b/docs/config.json index cd66f9889e..ad0177b53c 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1053,6 +1053,10 @@ { "label": "RxJS autocomplete", "to": "framework/angular/examples/rxjs" + }, + { + "label": "Query options from a service", + "to": "framework/angular/examples/query-options-from-a-service" } ] } diff --git a/examples/angular/query-options-from-a-service/.devcontainer/devcontainer.json b/examples/angular/query-options-from-a-service/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..36f47d8762 --- /dev/null +++ b/examples/angular/query-options-from-a-service/.devcontainer/devcontainer.json @@ -0,0 +1,4 @@ +{ + "name": "Node.js", + "image": "mcr.microsoft.com/devcontainers/javascript-node:18" +} diff --git a/examples/angular/query-options-from-a-service/.eslintrc.cjs b/examples/angular/query-options-from-a-service/.eslintrc.cjs new file mode 100644 index 0000000000..cca134ce16 --- /dev/null +++ b/examples/angular/query-options-from-a-service/.eslintrc.cjs @@ -0,0 +1,6 @@ +// @ts-check + +/** @type {import('eslint').Linter.Config} */ +const config = {} + +module.exports = config diff --git a/examples/angular/query-options-from-a-service/README.md b/examples/angular/query-options-from-a-service/README.md new file mode 100644 index 0000000000..f9e940480a --- /dev/null +++ b/examples/angular/query-options-from-a-service/README.md @@ -0,0 +1,6 @@ +# TanStack Query Angular query options from a service example + +To run this example: + +- `npm install` or `yarn` or `pnpm i` or `bun i` +- `npm run start` or `yarn start` or `pnpm start` or `bun start` diff --git a/examples/angular/query-options-from-a-service/angular.json b/examples/angular/query-options-from-a-service/angular.json new file mode 100644 index 0000000000..bde3a51e95 --- /dev/null +++ b/examples/angular/query-options-from-a-service/angular.json @@ -0,0 +1,104 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "cli": { + "packageManager": "pnpm", + "analytics": false, + "cache": { + "enabled": false + } + }, + "newProjectRoot": "projects", + "projects": { + "query-options-from-a-service": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "inlineTemplate": true, + "inlineStyle": true, + "skipTests": true + }, + "@schematics/angular:class": { + "skipTests": true + }, + "@schematics/angular:directive": { + "skipTests": true + }, + "@schematics/angular:guard": { + "skipTests": true + }, + "@schematics/angular:interceptor": { + "skipTests": true + }, + "@schematics/angular:pipe": { + "skipTests": true + }, + "@schematics/angular:resolver": { + "skipTests": true + }, + "@schematics/angular:service": { + "skipTests": true + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/query-options-from-a-service", + "index": "src/index.html", + "browser": "src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "tsconfig.app.json", + "assets": ["src/favicon.ico", "src/assets"], + "styles": [], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "query-options-from-a-service:build:production" + }, + "development": { + "buildTarget": "query-options-from-a-service:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "buildTarget": "query-options-from-a-service:build" + } + } + } + } + } +} diff --git a/examples/angular/query-options-from-a-service/package.json b/examples/angular/query-options-from-a-service/package.json new file mode 100644 index 0000000000..2982cd9361 --- /dev/null +++ b/examples/angular/query-options-from-a-service/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tanstack/query-example-angular-query-options-from-a-service", + "type": "module", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development" + }, + "private": true, + "dependencies": { + "@angular/common": "^17.3.12", + "@angular/compiler": "^17.3.12", + "@angular/core": "^17.3.12", + "@angular/platform-browser": "^17.3.12", + "@angular/platform-browser-dynamic": "^17.3.12", + "@angular/router": "^17.3.12", + "@tanstack/angular-query-experimental": "^5.59.16", + "rxjs": "^7.8.1", + "tslib": "^2.6.3", + "zone.js": "^0.14.8" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^17.3.8", + "@angular/cli": "^17.3.8", + "@angular/compiler-cli": "^17.3.12", + "@tanstack/angular-query-devtools-experimental": "^5.59.16", + "typescript": "5.3.3" + } +} diff --git a/examples/angular/query-options-from-a-service/src/app/app.component.html b/examples/angular/query-options-from-a-service/src/app/app.component.html new file mode 100644 index 0000000000..b0a0e52fe4 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/app.component.html @@ -0,0 +1,12 @@ +

+ As you visit the posts below, you will notice them in a loading state the + first time you load them. However, after you return to this list and click on + any posts you have already visited again, you will see them load instantly and + background refresh right before your eyes! + + (You may need to throttle your network speed to simulate longer loading + sequences) + +

+ + diff --git a/examples/angular/query-options-from-a-service/src/app/app.component.ts b/examples/angular/query-options-from-a-service/src/app/app.component.ts new file mode 100644 index 0000000000..4a934b9c7e --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/app.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core' +import { RouterOutlet } from '@angular/router' +import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental' + +@Component({ + selector: 'app-root', + standalone: true, + imports: [AngularQueryDevtools, RouterOutlet], + templateUrl: './app.component.html', + styles: [], +}) +export class AppComponent {} diff --git a/examples/angular/query-options-from-a-service/src/app/app.config.ts b/examples/angular/query-options-from-a-service/src/app/app.config.ts new file mode 100644 index 0000000000..f3c46fd657 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/app.config.ts @@ -0,0 +1,17 @@ +import { provideHttpClient, withFetch } from '@angular/common/http' +import { provideRouter, withComponentInputBinding } from '@angular/router' +import { + QueryClient, + provideAngularQuery, +} from '@tanstack/angular-query-experimental' + +import { routes } from './app.routes' +import type { ApplicationConfig } from '@angular/core' + +export const appConfig: ApplicationConfig = { + providers: [ + provideAngularQuery(new QueryClient()), + provideHttpClient(withFetch()), + provideRouter(routes, withComponentInputBinding()), + ], +} diff --git a/examples/angular/query-options-from-a-service/src/app/app.routes.ts b/examples/angular/query-options-from-a-service/src/app/app.routes.ts new file mode 100644 index 0000000000..8a8da66e69 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/app.routes.ts @@ -0,0 +1,15 @@ +import type { Route } from '@angular/router' + +// loadComponent lazily loads the component +// when the component is the default export, there is no need to handle the promise + +export const routes: Array = [ + { + path: '', + loadComponent: () => import('./components/posts.component'), + }, + { + path: 'post/:postId', + loadComponent: () => import('./components/post.component'), + }, +] diff --git a/examples/angular/query-options-from-a-service/src/app/components/post.component.html b/examples/angular/query-options-from-a-service/src/app/components/post.component.html new file mode 100644 index 0000000000..9ca755e387 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/components/post.component.html @@ -0,0 +1,19 @@ +
+
+ Back +
+ @if (postQuery.isPending()) { + Loading... + } @else if (postQuery.isError()) { + Error: {{ postQuery.error().message }} + } + @if (postQuery.data(); as post) { +

{{ post.title }}

+
+

{{ post.body }}

+
+ @if (postQuery.isFetching()) { + Background Updating... + } + } +
diff --git a/examples/angular/query-options-from-a-service/src/app/components/post.component.ts b/examples/angular/query-options-from-a-service/src/app/components/post.component.ts new file mode 100644 index 0000000000..ab9923e6ba --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/components/post.component.ts @@ -0,0 +1,27 @@ +import { + ChangeDetectionStrategy, + Component, + inject, + input, + numberAttribute, +} from '@angular/core' +import { RouterLink } from '@angular/router' +import { injectQuery } from '@tanstack/angular-query-experimental' +import { QueriesService } from '../services/queries-service' + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'post', + standalone: true, + templateUrl: './post.component.html', + imports: [RouterLink], +}) +export default class PostComponent { + private queries = inject(QueriesService) + + postId = input.required({ + transform: numberAttribute, + }) + + postQuery = injectQuery(() => this.queries.post(this.postId())) +} diff --git a/examples/angular/query-options-from-a-service/src/app/components/posts.component.html b/examples/angular/query-options-from-a-service/src/app/components/posts.component.html new file mode 100644 index 0000000000..06f7252914 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/components/posts.component.html @@ -0,0 +1,38 @@ +
+

Posts

+ @switch (postsQuery.status()) { + @case ('pending') { + Loading... + } + @case ('error') { + Error: {{ postsQuery.error()?.message }} + } + @default { +
+ @for (post of postsQuery.data(); track post.id) { +

+ + + {{ post.title }} +

+ } +
+ } + } +
+ @if (postsQuery.isFetching()) { + Background Updating... + } +
+
diff --git a/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts b/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts new file mode 100644 index 0000000000..1fe15616bf --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts @@ -0,0 +1,21 @@ +import { ChangeDetectionStrategy, Component, inject } from '@angular/core' +import { RouterLink } from '@angular/router' +import { + injectQuery, + injectQueryClient, +} from '@tanstack/angular-query-experimental' +import { QueriesService } from '../services/queries-service' + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'posts', + standalone: true, + templateUrl: './posts.component.html', + imports: [RouterLink], +}) +export default class PostsComponent { + private queries = inject(QueriesService) + + postsQuery = injectQuery(() => this.queries.posts()) + queryClient = injectQueryClient() +} diff --git a/examples/angular/query-options-from-a-service/src/app/services/posts-service.ts b/examples/angular/query-options-from-a-service/src/app/services/posts-service.ts new file mode 100644 index 0000000000..fed2a1b11c --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/services/posts-service.ts @@ -0,0 +1,21 @@ +import { HttpClient } from '@angular/common/http' +import { Injectable, inject } from '@angular/core' + +@Injectable({ + providedIn: 'root', +}) +export class PostsService { + #http = inject(HttpClient) + + postById$ = (postId: number) => + this.#http.get(`https://jsonplaceholder.typicode.com/posts/${postId}`) + + allPosts$ = () => + this.#http.get>('https://jsonplaceholder.typicode.com/posts') +} + +export interface Post { + id: number + title: string + body: string +} diff --git a/examples/angular/query-options-from-a-service/src/app/services/queries-service.ts b/examples/angular/query-options-from-a-service/src/app/services/queries-service.ts new file mode 100644 index 0000000000..dd2cca982d --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/app/services/queries-service.ts @@ -0,0 +1,27 @@ +import { Injectable, inject } from '@angular/core' +import { lastValueFrom } from 'rxjs' +import { queryOptions } from '@tanstack/angular-query-experimental' +import { PostsService } from './posts-service' + +@Injectable({ + providedIn: 'root', +}) +export class QueriesService { + private postsService = inject(PostsService) + + post(postId: number) { + return queryOptions({ + queryKey: ['post', postId], + queryFn: () => { + return lastValueFrom(this.postsService.postById$(postId)) + }, + }) + } + + posts() { + return queryOptions({ + queryKey: ['posts'], + queryFn: () => lastValueFrom(this.postsService.allPosts$()), + }) + } +} diff --git a/examples/angular/query-options-from-a-service/src/assets/.gitkeep b/examples/angular/query-options-from-a-service/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/angular/query-options-from-a-service/src/favicon.ico b/examples/angular/query-options-from-a-service/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..57614f9c967596fad0a3989bec2b1deff33034f6 GIT binary patch literal 15086 zcmd^G33O9Omi+`8$@{|M-I6TH3wzF-p5CV8o}7f~KxR60LK+ApEFB<$bcciv%@SmA zV{n>g85YMFFeU*Uvl=i4v)C*qgnb;$GQ=3XTe9{Y%c`mO%su)noNCCQ*@t1WXn|B(hQ7i~ zrUK8|pUkD6#lNo!bt$6)jR!&C?`P5G(`e((P($RaLeq+o0Vd~f11;qB05kdbAOm?r zXv~GYr_sibQO9NGTCdT;+G(!{4Xs@4fPak8#L8PjgJwcs-Mm#nR_Z0s&u?nDX5^~@ z+A6?}g0|=4e_LoE69pPFO`yCD@BCjgKpzMH0O4Xs{Ahc?K3HC5;l=f zg>}alhBXX&);z$E-wai+9TTRtBX-bWYY@cl$@YN#gMd~tM_5lj6W%8ah4;uZ;jP@Q zVbuel1rPA?2@x9Y+u?e`l{Z4ngfG5q5BLH5QsEu4GVpt{KIp1?U)=3+KQ;%7ec8l* zdV=zZgN5>O3G(3L2fqj3;oBbZZw$Ij@`Juz@?+yy#OPw)>#wsTewVgTK9BGt5AbZ&?K&B3GVF&yu?@(Xj3fR3n+ZP0%+wo)D9_xp>Z$`A4 zfV>}NWjO#3lqumR0`gvnffd9Ka}JJMuHS&|55-*mCD#8e^anA<+sFZVaJe7{=p*oX zE_Uv?1>e~ga=seYzh{9P+n5<+7&9}&(kwqSaz;1aD|YM3HBiy<))4~QJSIryyqp| z8nGc(8>3(_nEI4n)n7j(&d4idW1tVLjZ7QbNLXg;LB ziHsS5pXHEjGJZb59KcvS~wv;uZR-+4qEqow`;JCfB*+b^UL^3!?;-^F%yt=VjU|v z39SSqKcRu_NVvz!zJzL0CceJaS6%!(eMshPv_0U5G`~!a#I$qI5Ic(>IONej@aH=f z)($TAT#1I{iCS4f{D2+ApS=$3E7}5=+y(rA9mM#;Cky%b*Gi0KfFA`ofKTzu`AV-9 znW|y@19rrZ*!N2AvDi<_ZeR3O2R{#dh1#3-d%$k${Rx42h+i&GZo5!C^dSL34*AKp z27mTd>k>?V&X;Nl%GZ(>0s`1UN~Hfyj>KPjtnc|)xM@{H_B9rNr~LuH`Gr5_am&Ep zTjZA8hljNj5H1Ipm-uD9rC}U{-vR!eay5&6x6FkfupdpT*84MVwGpdd(}ib)zZ3Ky z7C$pnjc82(W_y_F{PhYj?o!@3__UUvpX)v69aBSzYj3 zdi}YQkKs^SyXyFG2LTRz9{(w}y~!`{EuAaUr6G1M{*%c+kP1olW9z23dSH!G4_HSK zzae-DF$OGR{ofP*!$a(r^5Go>I3SObVI6FLY)N@o<*gl0&kLo-OT{Tl*7nCz>Iq=? zcigIDHtj|H;6sR?or8Wd_a4996GI*CXGU}o;D9`^FM!AT1pBY~?|4h^61BY#_yIfO zKO?E0 zJ{Pc`9rVEI&$xxXu`<5E)&+m(7zX^v0rqofLs&bnQT(1baQkAr^kEsk)15vlzAZ-l z@OO9RF<+IiJ*O@HE256gCt!bF=NM*vh|WVWmjVawcNoksRTMvR03H{p@cjwKh(CL4 z7_PB(dM=kO)!s4fW!1p0f93YN@?ZSG` z$B!JaAJCtW$B97}HNO9(x-t30&E}Mo1UPi@Av%uHj~?T|!4JLwV;KCx8xO#b9IlUW zI6+{a@Wj|<2Y=U;a@vXbxqZNngH8^}LleE_4*0&O7#3iGxfJ%Id>+sb;7{L=aIic8 z|EW|{{S)J-wr@;3PmlxRXU8!e2gm_%s|ReH!reFcY8%$Hl4M5>;6^UDUUae?kOy#h zk~6Ee_@ZAn48Bab__^bNmQ~+k=02jz)e0d9Z3>G?RGG!65?d1>9}7iG17?P*=GUV-#SbLRw)Hu{zx*azHxWkGNTWl@HeWjA?39Ia|sCi{e;!^`1Oec zb>Z|b65OM*;eC=ZLSy?_fg$&^2xI>qSLA2G*$nA3GEnp3$N-)46`|36m*sc#4%C|h zBN<2U;7k>&G_wL4=Ve5z`ubVD&*Hxi)r@{4RCDw7U_D`lbC(9&pG5C*z#W>8>HU)h z!h3g?2UL&sS!oY5$3?VlA0Me9W5e~V;2jds*fz^updz#AJ%G8w2V}AEE?E^=MK%Xt z__Bx1cr7+DQmuHmzn*|hh%~eEc9@m05@clWfpEFcr+06%0&dZJH&@8^&@*$qR@}o3 z@Tuuh2FsLz^zH+dN&T&?0G3I?MpmYJ;GP$J!EzjeM#YLJ!W$}MVNb0^HfOA>5Fe~UNn%Zk(PT@~9}1dt)1UQ zU*B5K?Dl#G74qmg|2>^>0WtLX#Jz{lO4NT`NYB*(L#D|5IpXr9v&7a@YsGp3vLR7L zHYGHZg7{ie6n~2p$6Yz>=^cEg7tEgk-1YRl%-s7^cbqFb(U7&Dp78+&ut5!Tn(hER z|Gp4Ed@CnOPeAe|N>U(dB;SZ?NU^AzoD^UAH_vamp6Ws}{|mSq`^+VP1g~2B{%N-!mWz<`)G)>V-<`9`L4?3dM%Qh6<@kba+m`JS{Ya@9Fq*m6$$ zA1%Ogc~VRH33|S9l%CNb4zM%k^EIpqY}@h{w(aBcJ9c05oiZx#SK9t->5lSI`=&l~ z+-Ic)a{FbBhXV$Xt!WRd`R#Jk-$+_Z52rS>?Vpt2IK<84|E-SBEoIw>cs=a{BlQ7O z-?{Fy_M&84&9|KM5wt~)*!~i~E=(6m8(uCO)I=)M?)&sRbzH$9Rovzd?ZEY}GqX+~ zFbEbLz`BZ49=2Yh-|<`waK-_4!7`ro@zlC|r&I4fc4oyb+m=|c8)8%tZ-z5FwhzDt zL5kB@u53`d@%nHl0Sp)Dw`(QU&>vujEn?GPEXUW!Wi<+4e%BORl&BIH+SwRcbS}X@ z01Pk|vA%OdJKAs17zSXtO55k!;%m9>1eW9LnyAX4uj7@${O6cfii`49qTNItzny5J zH&Gj`e}o}?xjQ}r?LrI%FjUd@xflT3|7LA|ka%Q3i}a8gVm<`HIWoJGH=$EGClX^C0lysQJ>UO(q&;`T#8txuoQ_{l^kEV9CAdXuU1Ghg8 zN_6hHFuy&1x24q5-(Z7;!poYdt*`UTdrQOIQ!2O7_+AHV2hgXaEz7)>$LEdG z<8vE^Tw$|YwZHZDPM!SNOAWG$?J)MdmEk{U!!$M#fp7*Wo}jJ$Q(=8>R`Ats?e|VU?Zt7Cdh%AdnfyN3MBWw{ z$OnREvPf7%z6`#2##_7id|H%Y{vV^vWXb?5d5?a_y&t3@p9t$ncHj-NBdo&X{wrfJ zamN)VMYROYh_SvjJ=Xd!Ga?PY_$;*L=SxFte!4O6%0HEh%iZ4=gvns7IWIyJHa|hT z2;1+e)`TvbNb3-0z&DD_)Jomsg-7p_Uh`wjGnU1urmv1_oVqRg#=C?e?!7DgtqojU zWoAB($&53;TsXu^@2;8M`#z{=rPy?JqgYM0CDf4v@z=ZD|ItJ&8%_7A#K?S{wjxgd z?xA6JdJojrWpB7fr2p_MSsU4(R7=XGS0+Eg#xR=j>`H@R9{XjwBmqAiOxOL` zt?XK-iTEOWV}f>Pz3H-s*>W z4~8C&Xq25UQ^xH6H9kY_RM1$ch+%YLF72AA7^b{~VNTG}Tj#qZltz5Q=qxR`&oIlW Nr__JTFzvMr^FKp4S3v*( literal 0 HcmV?d00001 diff --git a/examples/angular/query-options-from-a-service/src/index.html b/examples/angular/query-options-from-a-service/src/index.html new file mode 100644 index 0000000000..0b672995bf --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/index.html @@ -0,0 +1,13 @@ + + + + + TanStack Query Angular query options from a service example + + + + + + + + diff --git a/examples/angular/query-options-from-a-service/src/main.ts b/examples/angular/query-options-from-a-service/src/main.ts new file mode 100644 index 0000000000..c3d8f9af99 --- /dev/null +++ b/examples/angular/query-options-from-a-service/src/main.ts @@ -0,0 +1,5 @@ +import { bootstrapApplication } from '@angular/platform-browser' +import { appConfig } from './app/app.config' +import { AppComponent } from './app/app.component' + +bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err)) diff --git a/examples/angular/query-options-from-a-service/tsconfig.app.json b/examples/angular/query-options-from-a-service/tsconfig.app.json new file mode 100644 index 0000000000..5b9d3c5ecb --- /dev/null +++ b/examples/angular/query-options-from-a-service/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": ["src/main.ts"], + "include": ["src/**/*.d.ts"] +} diff --git a/examples/angular/query-options-from-a-service/tsconfig.json b/examples/angular/query-options-from-a-service/tsconfig.json new file mode 100644 index 0000000000..82c63d482a --- /dev/null +++ b/examples/angular/query-options-from-a-service/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": false, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "ES2022", + "module": "ES2022", + "useDefineForClassFields": false, + "lib": ["ES2022", "dom"] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/examples/angular/router/angular.json b/examples/angular/router/angular.json index b85aefa62c..989d465ca0 100644 --- a/examples/angular/router/angular.json +++ b/examples/angular/router/angular.json @@ -53,7 +53,7 @@ "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "assets": ["src/favicon.ico", "src/assets"], - "styles": ["src/styles.css"], + "styles": [], "scripts": [] }, "configurations": { diff --git a/examples/angular/router/src/styles.css b/examples/angular/router/src/styles.css deleted file mode 100644 index 90d4ee0072..0000000000 --- a/examples/angular/router/src/styles.css +++ /dev/null @@ -1 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3921e48767..d3eb1c2ed2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -268,6 +268,55 @@ importers: specifier: 5.3.3 version: 5.3.3 + examples/angular/query-options-from-a-service: + dependencies: + '@angular/common': + specifier: ^17.3.12 + version: 17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1) + '@angular/compiler': + specifier: ^17.3.12 + version: 17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)) + '@angular/core': + specifier: ^17.3.12 + version: 17.3.12(rxjs@7.8.1)(zone.js@0.14.8) + '@angular/platform-browser': + specifier: ^17.3.12 + version: 17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)) + '@angular/platform-browser-dynamic': + specifier: ^17.3.12 + version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))) + '@angular/router': + specifier: ^17.3.12 + version: 17.3.12(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@17.3.12(@angular/animations@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(rxjs@7.8.1) + '@tanstack/angular-query-experimental': + specifier: ^5.59.16 + version: link:../../../packages/angular-query-experimental + rxjs: + specifier: ^7.8.1 + version: 7.8.1 + tslib: + specifier: ^2.6.3 + version: 2.7.0 + zone.js: + specifier: ^0.14.8 + version: 0.14.8 + devDependencies: + '@angular-devkit/build-angular': + specifier: ^17.3.8 + version: 17.3.8(@angular/compiler-cli@17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3))(@types/express@4.17.21)(@types/node@22.7.4)(chokidar@3.6.0)(html-webpack-plugin@5.6.0(webpack@5.93.0(esbuild@0.19.12)))(ng-packagr@17.3.0(@angular/compiler-cli@17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3))(tailwindcss@3.4.7)(tslib@2.7.0)(typescript@5.3.3))(tailwindcss@3.4.7)(typescript@5.3.3) + '@angular/cli': + specifier: ^17.3.8 + version: 17.3.8(chokidar@3.6.0) + '@angular/compiler-cli': + specifier: ^17.3.12 + version: 17.3.12(@angular/compiler@17.3.12(@angular/core@17.3.12(rxjs@7.8.1)(zone.js@0.14.8)))(typescript@5.3.3) + '@tanstack/angular-query-devtools-experimental': + specifier: ^5.59.16 + version: link:../../../packages/angular-query-devtools-experimental + typescript: + specifier: 5.3.3 + version: 5.3.3 + examples/angular/router: dependencies: '@angular/common': @@ -1223,7 +1272,7 @@ importers: version: 5.1.0(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(tailwindcss@3.4.7) '@astrojs/vercel': specifier: ^7.7.2 - version: 7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + version: 7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@tanstack/solid-query': specifier: ^5.59.16 version: link:../../../packages/solid-query @@ -9727,7 +9776,7 @@ packages: resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} engines: {node: '>= 4.0'} os: [darwin] - deprecated: Upgrade to fsevents v2 to mitigate potential security issues + deprecated: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2 fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -17627,10 +17676,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/vercel@7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': + '@astrojs/vercel@7.7.2(astro@4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3))(encoding@0.1.13)(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': dependencies: '@astrojs/internal-helpers': 0.4.1 - '@vercel/analytics': 1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + '@vercel/analytics': 1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@vercel/edge': 1.1.2 '@vercel/nft': 0.27.3(encoding@0.1.13) astro: 4.12.3(@types/node@22.7.4)(less@4.2.0)(sass@1.77.8)(terser@5.31.3)(typescript@5.3.3) @@ -22890,11 +22939,11 @@ snapshots: graphql: 15.8.0 wonka: 4.0.15 - '@vercel/analytics@1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': + '@vercel/analytics@1.3.1(next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': dependencies: server-only: 0.0.1 optionalDependencies: - next: 14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8) + next: 14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8) react: 18.3.1 '@vercel/edge@1.1.2': {} @@ -30009,7 +30058,7 @@ snapshots: next-tick@1.1.0: {} - next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1))(react@18.3.1)(sass@1.77.8): + next@14.2.5(@babel/core@7.25.2)(react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522))(react@18.3.1)(sass@1.77.8): dependencies: '@next/env': 14.2.5 '@swc/helpers': 0.5.5 @@ -30018,7 +30067,7 @@ snapshots: graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.3.1 - react-dom: 19.0.0-rc-4c2e457c7c-20240522(react@18.3.1) + react-dom: 19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522) styled-jsx: 5.1.1(@babel/core@7.25.2)(react@18.3.1) optionalDependencies: '@next/swc-darwin-arm64': 14.2.5 @@ -32316,12 +32365,6 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-dom@19.0.0-rc-4c2e457c7c-20240522(react@18.3.1): - dependencies: - react: 18.3.1 - scheduler: 0.25.0-rc-4c2e457c7c-20240522 - optional: true - react-dom@19.0.0-rc-4c2e457c7c-20240522(react@19.0.0-rc-4c2e457c7c-20240522): dependencies: react: 19.0.0-rc-4c2e457c7c-20240522