Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3daff38
initial setup -- duplicated + package.json edited
theVedanta Dec 1, 2025
0e40281
simple preact updations
theVedanta Dec 15, 2025
722e05b
missed a React.ReactNode
theVedanta Dec 15, 2025
78cf64a
testing grunt work (preact library + other small issues + ErrorBounda…
theVedanta Dec 17, 2025
a9c5c75
missed a few
theVedanta Dec 17, 2025
8cc6ed5
Adds ErrorBoundary (from react-error-boundary, but scaled down for pr…
theVedanta Dec 26, 2025
088795b
useSuspenseQueries left -- removed the useQuery.promise tests
theVedanta Dec 27, 2025
0f5bdbc
forgot the console logs
theVedanta Dec 27, 2025
6d23454
useSuspenseQueries 2 resolved; tests done
theVedanta Dec 27, 2025
60502ad
Merge branch 'main' into pr/9935
TkDodo Dec 28, 2025
f2f73f9
Merge branch 'main' into preact-adapter
TkDodo Dec 28, 2025
460919e
ci: apply automated fixes
autofix-ci[bot] Dec 28, 2025
1a3afe6
Merge branch 'main' into preact-adapter
TkDodo Dec 28, 2025
05af042
fix: example
TkDodo Dec 28, 2025
4d5a0f0
fix: configs should be symlinks
TkDodo Dec 28, 2025
f451435
fix: sync versions for npm-run-all2
TkDodo Dec 28, 2025
b2e95fd
ref: re-sync runall2
TkDodo Dec 28, 2025
34f0262
ref: go back to 5.0.0
TkDodo Dec 28, 2025
4e366c4
ref: remove changelog
TkDodo Dec 28, 2025
3c6b541
react-query -> preact-query
TkDodo Dec 28, 2025
66605b1
remove use client directive + added the useSyncExternalStore (decoupl…
theVedanta Dec 28, 2025
c069be8
Merge branch 'preact-adapter' of https://github.com/theVedanta/query …
theVedanta Dec 28, 2025
445e37b
remove the react remnants
theVedanta Jan 1, 2026
bdc5d11
generate docs
theVedanta Jan 1, 2026
3e43af5
typescript eslint
theVedanta Jan 1, 2026
f1b1b78
docs
theVedanta Jan 1, 2026
9c72beb
vite config fix
theVedanta Jan 2, 2026
893b99c
docs now reference react docs (most of them atleast)
theVedanta Jan 11, 2026
9fd3064
code-rabbit issues addressed
theVedanta Jan 18, 2026
6422fec
<div/> lol
theVedanta Jan 18, 2026
b1e5ce3
Merge branch 'main' into pr/9935
TkDodo Jan 19, 2026
aa88156
fix: docs
TkDodo Jan 19, 2026
ce91aff
ci: apply automated fixes
autofix-ci[bot] Jan 19, 2026
360f677
fix: lockfile
TkDodo Jan 19, 2026
2da4498
fix: duplicated versions
TkDodo Jan 19, 2026
47b2a66
lockfile merge issue
theVedanta Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 235 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,31 @@
"to": "framework/angular/zoneless"
}
]
},
{
"label": "preact",
"children": [
{
"label": "Overview",
"to": "framework/preact/overview"
},
{
"label": "Installation",
"to": "framework/preact/installation"
},
{
"label": "Quick Start",
"to": "framework/preact/quick-start"
},
{
"label": "TypeScript",
"to": "framework/preact/typescript"
},
{
"label": "GraphQL",
"to": "framework/preact/graphql"
}
]
}
]
},
Expand Down Expand Up @@ -717,6 +742,131 @@
"to": "framework/angular/guides/does-this-replace-client-state"
}
]
},
{
"label": "preact",
"children": [
{
"label": "Important Defaults",
"to": "framework/preact/guides/important-defaults"
},
{
"label": "Queries",
"to": "framework/preact/guides/queries"
},
{
"label": "Query Keys",
"to": "framework/preact/guides/query-keys"
},
{
"label": "Query Functions",
"to": "framework/preact/guides/query-functions"
},
{
"label": "Query Options",
"to": "framework/preact/guides/query-options"
},
{
"label": "Network Mode",
"to": "framework/preact/guides/network-mode"
},
{
"label": "Parallel Queries",
"to": "framework/preact/guides/parallel-queries"
},
{
"label": "Dependent Queries",
"to": "framework/preact/guides/dependent-queries"
},
{
"label": "Background Fetching Indicators",
"to": "framework/preact/guides/background-fetching-indicators"
},
{
"label": "Window Focus Refetching",
"to": "framework/preact/guides/window-focus-refetching"
},
{
"label": "Disabling/Pausing Queries",
"to": "framework/preact/guides/disabling-queries"
},
{
"label": "Query Retries",
"to": "framework/preact/guides/query-retries"
},
{
"label": "Paginated Queries",
"to": "framework/preact/guides/paginated-queries"
},
{
"label": "Infinite Queries",
"to": "framework/preact/guides/infinite-queries"
},
{
"label": "Initial Query Data",
"to": "framework/preact/guides/initial-query-data"
},
{
"label": "Placeholder Query Data",
"to": "framework/preact/guides/placeholder-query-data"
},
{
"label": "Mutations",
"to": "framework/preact/guides/mutations"
},
{
"label": "Query Invalidation",
"to": "framework/preact/guides/query-invalidation"
},
{
"label": "Invalidation from Mutations",
"to": "framework/preact/guides/invalidations-from-mutations"
},
{
"label": "Updates from Mutation Responses",
"to": "framework/preact/guides/updates-from-mutation-responses"
},
{
"label": "Optimistic Updates",
"to": "framework/preact/guides/optimistic-updates"
},
{
"label": "Query Cancellation",
"to": "framework/preact/guides/query-cancellation"
},
{
"label": "Scroll Restoration",
"to": "framework/preact/guides/scroll-restoration"
},
{
"label": "Filters",
"to": "framework/preact/guides/filters"
},
{
"label": "Performance & Request Waterfalls",
"to": "framework/preact/guides/request-waterfalls"
},
{
"label": "Prefetching & Router Integration",
"to": "framework/preact/guides/prefetching"
},
{
"label": "Caching",
"to": "framework/preact/guides/caching"
},
{
"label": "Render Optimizations",
"to": "framework/preact/guides/render-optimizations"
},
{
"label": "Default Query Fn",
"to": "framework/preact/guides/default-query-function"
},
{
"label": "Does this replace [Redux, MobX, etc]?",
"to": "framework/preact/guides/does-this-replace-client-state"
}
]
}
]
},
Expand Down Expand Up @@ -1009,6 +1159,91 @@
"to": "framework/angular/reference/functions/injectMutation"
}
]
},
{
"label": "preact",
"children": [
{
"label": "useQuery",
"to": "framework/preact/reference/functions/useQuery"
},
{
"label": "useQueries",
"to": "framework/preact/reference/functions/useQueries"
},
{
"label": "useInfiniteQuery",
"to": "framework/preact/reference/functions/useInfiniteQuery"
},
{
"label": "useMutation",
"to": "framework/preact/reference/functions/useMutation"
},
{
"label": "useIsFetching",
"to": "framework/preact/reference/functions/useIsFetching"
},
{
"label": "useIsMutating",
"to": "framework/preact/reference/functions/useIsMutating"
},
{
"label": "useMutationState",
"to": "framework/preact/reference/functions/useMutationState"
},
{
"label": "useSuspenseQuery",
"to": "framework/preact/reference/functions/useSuspenseQuery"
},
{
"label": "useSuspenseInfiniteQuery",
"to": "framework/preact/reference/functions/useSuspenseInfiniteQuery"
},
{
"label": "useSuspenseQueries",
"to": "framework/preact/reference/functions/useSuspenseQueries"
},
{
"label": "QueryClientProvider",
"to": "framework/preact/reference/functions/QueryClientProvider"
},
{
"label": "useQueryClient",
"to": "framework/preact/reference/functions/useQueryClient"
},
{
"label": "queryOptions",
"to": "framework/preact/reference/functions/queryOptions"
},
{
"label": "infiniteQueryOptions",
"to": "framework/preact/reference/functions/infiniteQueryOptions"
},
{
"label": "mutationOptions",
"to": "framework/preact/reference/functions/mutationOptions"
},
{
"label": "usePrefetchQuery",
"to": "framework/preact/reference/functions/usePrefetchQuery"
},
{
"label": "usePrefetchInfiniteQuery",
"to": "framework/preact/reference/functions/usePrefetchInfiniteQuery"
},
{
"label": "QueryErrorResetBoundary",
"to": "framework/preact/reference/functions/QueryErrorResetBoundary"
},
{
"label": "useQueryErrorResetBoundary",
"to": "framework/preact/reference/functions/useQueryErrorResetBoundary"
},
{
"label": "hydration",
"to": "framework/react/reference/functions/HydrationBoundary"
}
]
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions docs/framework/preact/graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: graphql
title: GraphQL
ref: docs/framework/react/graphql.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: background-fetching-indicators
title: Background Fetching Indicators
ref: docs/framework/react/guides/background-fetching-indicators.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/caching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: caching
title: Caching Examples
ref: docs/framework/react/guides/caching.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/default-query-function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: default-query-function
title: Default Query Function
ref: docs/framework/react/guides/default-query-function.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/dependent-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: dependent-queries
title: Dependent Queries
ref: docs/framework/react/guides/dependent-queries.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
56 changes: 56 additions & 0 deletions docs/framework/preact/guides/disabling-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
id: disabling-queries
title: Disabling/Pausing Queries
ref: docs/framework/react/guides/disabling-queries.md
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---

[//]: # 'Example2'

```tsx
function Todos() {
const [filter, setFilter] = useState('')

const { data } = useQuery({
queryKey: ['todos', filter],
queryFn: () => fetchTodos(filter),
// ⬇️ disabled as long as the filter is empty
enabled: !!filter,
})

return (
<div>
// 🚀 applying the filter will enable and execute the query
<FiltersForm onApply={setFilter} />
{data && <TodosTable data={data} />}
</div>
)
}
```
Comment on lines +10 to +29
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add missing useState import in Example 2.

The code uses useState but doesn't import it. This will cause a runtime error when users copy and run this example. Example 3 below demonstrates the correct import pattern.

📝 Proposed fix to add the missing import
+import { useQuery } from '@tanstack/preact-query'
+import { useState } from 'preact/hooks'
+
 function Todos() {
   const [filter, setFilter] = useState('')
🤖 Prompt for AI Agents
In @docs/framework/preact/guides/disabling-queries.md around lines 63 - 82, The
Todos example is missing the useState import used in function Todos; add an
import for useState from 'preact/hooks' at the top of the example (same place
other hooks/imports are declared) so the useState call in Todos works correctly
when copied and run.


[//]: # 'Example2'
[//]: # 'Example3'

```tsx
import { skipToken, useQuery } from '@tanstack/preact-query'

function Todos() {
const [filter, setFilter] = useState<string | undefined>()

const { data } = useQuery({
queryKey: ['todos', filter],
// ⬇️ disabled as long as the filter is undefined or empty
queryFn: filter ? () => fetchTodos(filter) : skipToken,
})

return (
<div>
// 🚀 applying the filter will enable and execute the query
<FiltersForm onApply={setFilter} />
{data && <TodosTable data={data} />}
</div>
)
}
```

[//]: # 'Example3'
Comment on lines +34 to +56
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add missing useState import in Example 3.

The code uses useState on line 38 but doesn't import it from 'preact/hooks'. This will cause a runtime error when users copy and run this example.

📝 Proposed fix to add the missing import
 import { skipToken, useQuery } from '@tanstack/preact-query'
+import { useState } from 'preact/hooks'

 function Todos() {
   const [filter, setFilter] = useState<string | undefined>()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```tsx
import { skipToken, useQuery } from '@tanstack/preact-query'
function Todos() {
const [filter, setFilter] = useState<string | undefined>()
const { data } = useQuery({
queryKey: ['todos', filter],
// ⬇️ disabled as long as the filter is undefined or empty
queryFn: filter ? () => fetchTodos(filter) : skipToken,
})
return (
<div>
// 🚀 applying the filter will enable and execute the query
<FiltersForm onApply={setFilter} />
{data && <TodosTable data={data} />}
</div>
)
}
```
[//]: # 'Example3'
🤖 Prompt for AI Agents
In `@docs/framework/preact/guides/disabling-queries.md` around lines 34 - 56, The
example is missing the useState import used in the Todos component; update the
top of the snippet to import useState from 'preact/hooks' (alongside the
existing imports from '@tanstack/preact-query') so the Todos function (and its
use of useState) compiles and runs correctly.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: does-this-replace-client-state
title: Does TanStack Query replace Redux, MobX or other global state managers?
ref: docs/framework/react/guides/does-this-replace-client-state
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/filters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: filters
title: Filters
ref: docs/framework/react/guides/filters
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/important-defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: important-defaults
title: Important Defaults
ref: docs/framework/react/guides/important-defaults
replace: { 'React': 'Preact', 'react-query': 'preact-query' }
---
Loading