Skip to content

Commit 139ecc5

Browse files
Merge branch 'main' into sc/whole-leech
2 parents 567805c + c738352 commit 139ecc5

File tree

181 files changed

+2885
-2371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+2885
-2371
lines changed

.all-contributorsrc

-238
This file was deleted.

docs/config.json

+4
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@
929929
{
930930
"label": "Shadow DOM",
931931
"to": "framework/react/examples/shadow-dom"
932+
},
933+
{
934+
"label": "Devtools Embedded Panel",
935+
"to": "framework/react/examples/devtools-panel"
932936
}
933937
]
934938
},

docs/framework/angular/overview.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Most core web frameworks **do not** come with an opinionated way of fetching or
2323

2424
While most traditional state management libraries are great for working with client state, they are **not so great at working with async or server state**. This is because **server state is totally different**. For starters, server state:
2525

26-
- Is persisted remotely in a location you do not control or own
26+
- Is persisted remotely in a location you may not control or own
2727
- Requires asynchronous APIs for fetching and updating
2828
- Implies shared ownership and can be changed by other people without your knowledge
2929
- Can potentially become "out of date" in your applications if you're not careful
@@ -58,7 +58,7 @@ On a more technical note, Angular Query will likely:
5858

5959
In the example below, you can see Angular Query in its most basic and simple form being used to fetch the GitHub stats for the TanStack Query GitHub project itself:
6060

61-
[Open in CodeSandbox](https://codesandbox.io/s/github/tanstack/query/tree/main/examples/angular/simple)
61+
[Open in StackBlitz](https://stackblitz.com/github/TanStack/query/tree/main/examples/angular/simple)
6262

6363
```angular-ts
6464
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'
@@ -114,4 +114,4 @@ type Response = {
114114

115115
## You talked me into it, so what now?
116116

117-
- Learn Angular Query at your own pace with our amazingly thorough [Walkthrough Guide](../installation) and [API Reference](../reference/injectQuery)
117+
- Learn Angular Query at your own pace with our amazingly thorough [Walkthrough Guide](../installation) and [API Reference](../reference/functions/injectquery)

docs/framework/react/devtools.md

+44-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,50 @@ function App() {
8383
- The position of the React Query devtools panel
8484
- `client?: QueryClient`,
8585
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
86-
- `errorTypes?: { name: string; initializer: (query: Query) => TError}`
86+
- `errorTypes?: { name: string; initializer: (query: Query) => TError}[]`
87+
- Use this to predefine some errors that can be triggered on your queries. Initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
88+
- `styleNonce?: string`
89+
- Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
90+
- `shadowDOMTarget?: ShadowRoot`
91+
- Default behavior will apply the devtool's styles to the head tag within the DOM.
92+
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.
93+
94+
## Embedded Mode
95+
96+
Embedded mode will show the development tools as a fixed element in your application, so you can use our panel in your own development tools.
97+
98+
Place the following code as high in your React app as you can. The closer it is to the root of the page, the better it will work!
99+
100+
```tsx
101+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
102+
103+
function App() {
104+
const [isOpen, setIsOpen] = React.useState(false)
105+
106+
return (
107+
<QueryClientProvider client={queryClient}>
108+
{/* The rest of your application */}
109+
<button
110+
onClick={() => setIsOpen(!isOpen)}
111+
>{`${isOpen ? 'Close' : 'Open'} the devtools panel`}</button>
112+
{isOpen && <ReactQueryDevtoolsPanel onClose={() => setIsOpen(false)} />}
113+
</QueryClientProvider>
114+
)
115+
}
116+
```
117+
118+
### Options
119+
120+
- `style?: React.CSSProperties`
121+
- Custom styles for the devtools panel
122+
- Default: `{ height: '500px' }`
123+
- Example: `{ height: '100%' }`
124+
- Example: `{ height: '100%', width: '100%' }`
125+
- `onClose?: () => unknown`
126+
- Callback function that is called when the devtools panel is closed
127+
- `client?: QueryClient`,
128+
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
129+
- `errorTypes?: { name: string; initializer: (query: Query) => TError}[]`
87130
- Use this to predefine some errors that can be triggered on your queries. Initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
88131
- `styleNonce?: string`
89132
- Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.

docs/framework/react/guides/query-cancellation.md

+4
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,7 @@ return (
187187
```
188188

189189
[//]: # 'Example7'
190+
191+
## Limitations
192+
193+
Cancelation does not work when working with `Suspense` hooks: `useSuspenseQuery`, `useSuspenseQueries` and `useSuspenseInfiniteQuery`.

docs/framework/react/reference/useSuspenseInfiniteQuery.md

+4
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ Same object as [useInfiniteQuery](../useInfiniteQuery), except that:
2424
- `isPlaceholderData` is missing
2525
- `status` is always `success`
2626
- the derived flags are set accordingly.
27+
28+
**Caveat**
29+
30+
[Cancelation](../guides/query-cancellation.md) does not work.

docs/framework/react/reference/useSuspenseQueries.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Same structure as [useQueries](../useQueries), except that for each `query`:
2525
- `status` is always `success`
2626
- the derived flags are set accordingly.
2727

28-
**Caveat**
28+
**Caveats**
2929

3030
Keep in mind that the component will only re-mount after **all queries** have finished loading. Hence, if a query has gone stale in the time it took for all the queries to complete, it will be fetched again at re-mount. To avoid this, make sure to set a high enough `staleTime`.
31+
32+
[Cancelation](../guides/query-cancellation.md) does not work.

docs/framework/react/reference/useSuspenseQuery.md

+4
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ Same object as [useQuery](../useQuery), except that:
2323
- `isPlaceholderData` is missing
2424
- `status` is always `success`
2525
- the derived flags are set accordingly.
26+
27+
**Caveat**
28+
29+
[Cancelation](../guides/query-cancellation.md) does not work.

0 commit comments

Comments
 (0)