@nuxt/docs-nightly 5.0.0-29681932.2ad16e09 → 5.0.0-29683228.2900c37b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.getting-started/10.data-fetching.md +1 -1
- package/3.guide/4.modules/5.recipes-advanced.md +1 -1
- package/4.api/2.composables/use-announcer.md +1 -1
- package/4.api/2.composables/use-async-data.md +1 -1
- package/4.api/2.composables/use-error.md +3 -2
- package/4.api/2.composables/use-fetch.md +1 -1
- package/4.api/2.composables/use-nuxt-data.md +1 -1
- package/4.api/4.commands/test.md +1 -1
- package/package.json +1 -1
|
@@ -241,7 +241,7 @@ Read more about `useAsyncData`.
|
|
|
241
241
|
By default, Nuxt waits until a `refresh` is finished before it can be executed again.
|
|
242
242
|
|
|
243
243
|
::note
|
|
244
|
-
If you have not fetched data on the server (for example, with `server: false`), then the data _will not_ be fetched until hydration completes. This means even if you await `useFetch` on client-side, `data` will remain
|
|
244
|
+
If you have not fetched data on the server (for example, with `server: false`), then the data _will not_ be fetched until hydration completes. This means even if you await `useFetch` on client-side, `data` will remain undefined within `<script setup>`.
|
|
245
245
|
::
|
|
246
246
|
|
|
247
247
|
## Options
|
|
@@ -239,5 +239,5 @@ Server routes are also type-checked using `tsconfig.app.json` in addition to `ts
|
|
|
239
239
|
This is required because Nuxt infers the return types of your server endpoints to provide response types in [`$fetch`](/docs/4.x/api/utils/dollarfetch) and [`useFetch`](/docs/4.x/api/composables/use-fetch).
|
|
240
240
|
|
|
241
241
|
::warning
|
|
242
|
-
This can cause issues when using **server-only types** in your route files. For example, if a module creates a server-only virtual file using [`addServerTemplate`](/docs/api/kit/templates#addservertemplate) and you declare types for it in `tsconfig.server.json`, those type declarations will only be available in the server context. When the app context type-checks your server routes, it won't recognize these server-only types and will report errors. To resolve this, you unfortunately need to declare such types in the app context as well.
|
|
242
|
+
This can cause issues when using **server-only types** in your route files. For example, if a module creates a server-only virtual file using [`addServerTemplate`](/docs/4.x/api/kit/templates#addservertemplate) and you declare types for it in `tsconfig.server.json`, those type declarations will only be available in the server context. When the app context type-checks your server routes, it won't recognize these server-only types and will report errors. To resolve this, you unfortunately need to declare such types in the app context as well.
|
|
243
243
|
::
|
|
@@ -14,7 +14,7 @@ This composable is available in Nuxt v4.4.2+.
|
|
|
14
14
|
|
|
15
15
|
## Description
|
|
16
16
|
|
|
17
|
-
A composable for announcing dynamic content changes to screen readers. Unlike [`useRouteAnnouncer`](/docs/api/composables/use-route-announcer) which automatically announces route changes, `useAnnouncer` gives you manual control over what and when to announce.
|
|
17
|
+
A composable for announcing dynamic content changes to screen readers. Unlike [`useRouteAnnouncer`](/docs/4.x/api/composables/use-route-announcer) which automatically announces route changes, `useAnnouncer` gives you manual control over what and when to announce.
|
|
18
18
|
|
|
19
19
|
Use this for in-page updates like form validation, async operations, toast notifications, and live content changes.
|
|
20
20
|
|
|
@@ -251,7 +251,7 @@ type AsyncDataOptions<DataT> = {
|
|
|
251
251
|
default?: () => DataT | Ref<DataT> | null
|
|
252
252
|
transform?: (input: DataT) => DataT | Promise<DataT>
|
|
253
253
|
pick?: string[]
|
|
254
|
-
watch?: MultiWatchSources
|
|
254
|
+
watch?: MultiWatchSources
|
|
255
255
|
getCachedData?: (key: string, nuxtApp: NuxtApp, ctx: AsyncDataRequestContext) => DataT | undefined
|
|
256
256
|
timeout?: number
|
|
257
257
|
}
|
|
@@ -23,10 +23,11 @@ You can use this composable in your components, pages, or plugins to access or r
|
|
|
23
23
|
```ts
|
|
24
24
|
interface NuxtError<DataT = unknown> {
|
|
25
25
|
status: number
|
|
26
|
-
statusText
|
|
26
|
+
statusText?: string
|
|
27
27
|
message: string
|
|
28
28
|
data?: DataT
|
|
29
|
-
|
|
29
|
+
cause?: unknown
|
|
30
|
+
fatal: boolean
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export const useError: () => Ref<NuxtError | undefined>
|
|
@@ -240,7 +240,7 @@ This only caches data when `experimental.payloadExtraction` in `nuxt.config` is
|
|
|
240
240
|
- `error`: Request failed
|
|
241
241
|
|
|
242
242
|
::note
|
|
243
|
-
If you have not fetched data on the server (for example, with `server: false`), then the data _will not_ be fetched until hydration completes. This means even if you await `useFetch` on client-side, `data` will remain
|
|
243
|
+
If you have not fetched data on the server (for example, with `server: false`), then the data _will not_ be fetched until hydration completes. This means even if you await `useFetch` on client-side, `data` will remain undefined within `<script setup>`.
|
|
244
244
|
::
|
|
245
245
|
|
|
246
246
|
### Examples
|
|
@@ -28,7 +28,7 @@ To use `useNuxtData`, ensure that the data-fetching composable (`useFetch`, `use
|
|
|
28
28
|
|
|
29
29
|
## Return Values
|
|
30
30
|
|
|
31
|
-
- `data`: A reactive reference to the cached data associated with the provided key. If no cached data exists, the value will be `
|
|
31
|
+
- `data`: A reactive reference to the cached data associated with the provided key. If no cached data exists, the value will be `undefined`. This `Ref` automatically updates if the cached data changes, allowing seamless reactivity in your components.
|
|
32
32
|
|
|
33
33
|
## Example
|
|
34
34
|
|
package/4.api/4.commands/test.md
CHANGED
|
@@ -14,7 +14,7 @@ npx nuxt test [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [
|
|
|
14
14
|
```
|
|
15
15
|
<!--/test-cmd-->
|
|
16
16
|
|
|
17
|
-
The `test` command runs tests using [`@nuxt/test-utils`](/docs/getting-started/testing). This command sets `process.env.NODE_ENV` to `test` if not already set.
|
|
17
|
+
The `test` command runs tests using [`@nuxt/test-utils`](/docs/4.x/getting-started/testing). This command sets `process.env.NODE_ENV` to `test` if not already set.
|
|
18
18
|
|
|
19
19
|
## Arguments
|
|
20
20
|
|