@nuxt/docs 3.17.3 → 3.17.4

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.
@@ -21,7 +21,7 @@ Or follow the steps below to set up a new Nuxt project on your computer.
21
21
  <!-- markdownlint-disable-next-line MD001 -->
22
22
  #### Prerequisites
23
23
 
24
- - **Node.js** - [`18.x`](https://nodejs.org/en) or newer (but we recommend the [active LTS release](https://github.com/nodejs/release#release-schedule))
24
+ - **Node.js** - [`20.x`](https://nodejs.org/en) or newer (but we recommend the [active LTS release](https://github.com/nodejs/release#release-schedule))
25
25
  - **Text editor** - There is no IDE requirement, but we recommend [Visual Studio Code](https://code.visualstudio.com/) with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously known as Volar) or [WebStorm](https://www.jetbrains.com/webstorm/), which, along with [other JetBrains IDEs](https://www.jetbrains.com/ides/), offers great Nuxt support right out-of-the-box.
26
26
  - **Terminal** - In order to run Nuxt commands
27
27
 
@@ -171,8 +171,8 @@ Name | Config File | How To
171
171
 
172
172
  If you need to pass options to `@vitejs/plugin-vue` or `@vitejs/plugin-vue-jsx`, you can do this in your `nuxt.config` file.
173
173
 
174
- - `vite.vue` for `@vitejs/plugin-vue`. Check available options [here](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
175
- - `vite.vueJsx` for `@vitejs/plugin-vue-jsx`. Check available options [here](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx).
174
+ - `vite.vue` for `@vitejs/plugin-vue`. Check [available options](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
175
+ - `vite.vueJsx` for `@vitejs/plugin-vue-jsx`. Check [available options](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx).
176
176
 
177
177
  ```ts twoslash [nuxt.config.ts]
178
178
  export default defineNuxtConfig({
@@ -145,7 +145,7 @@ useHead({
145
145
  })
146
146
  ```
147
147
 
148
- Nuxt uses `unhead` under the hood, and you can refer to its full documentation [here](https://unhead.unjs.io).
148
+ Nuxt uses `unhead` under the hood, and you can refer to [its full documentation](https://unhead.unjs.io).
149
149
 
150
150
  ### Modifying The Rendered Head With A Nitro Plugin
151
151
 
@@ -610,7 +610,7 @@ onMounted(() => console.log(document.cookie))
610
610
  </script>
611
611
  ```
612
612
 
613
- ## Options API support
613
+ ## Options API Support
614
614
 
615
615
  Nuxt provides a way to perform `asyncData` fetching within the Options API. You must wrap your component definition within `defineNuxtComponent` for this to work.
616
616
 
@@ -744,7 +744,7 @@ const { data } = await useFetch('/api/superjson', {
744
744
 
745
745
  ## Recipes
746
746
 
747
- ### Consuming SSE (Server Sent Events) via POST request
747
+ ### Consuming SSE (Server-Sent Events) via POST request
748
748
 
749
749
  ::tip
750
750
  If you're consuming SSE via GET request, you can use [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) or VueUse composable [`useEventSource`](https://vueuse.org/core/useEventSource/).
@@ -280,7 +280,7 @@ mockNuxtImport('useStorage', () => {
280
280
  ```
281
281
 
282
282
  ::note
283
- `mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [here](https://vitest.dev/api/vi.html#vi-mock).
283
+ `mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [in the Vitest docs](https://vitest.dev/api/vi.html#vi-mock).
284
284
  ::
285
285
 
286
286
  If you need to mock a Nuxt import and provide different implementations between tests, you can do it by creating and exposing your mocks using [`vi.hoisted`](https://vitest.dev/api/vi.html#vi-hoisted), and then use those mocks in `mockNuxtImport`. You then have access to the mocked imports, and can change the implementation between tests. Be careful to [restore mocks](https://vitest.dev/api/mock.html#mockrestore) before or after each test to undo mock state changes between runs.
@@ -657,7 +657,7 @@ These aliases were removed, for greater clarity.
657
657
 
658
658
  The issue came up when adding `dedupe` as an option to `useAsyncData`, and we removed the boolean values as they ended up being _opposites_.
659
659
 
660
- `refresh({ dedupe: false })` meant 'do not _cancel_ existing requests in favour of this new one'. But passing `dedupe: true` within the options of `useAsyncData` means 'do not make any new requests if there is an existing pending request.' (See [PR](https://github.com/nuxt/nuxt/pull/24564#pullrequestreview-1764584361).)
660
+ `refresh({ dedupe: false })` meant **do not _cancel_ existing requests in favour of this new one**. But passing `dedupe: true` within the options of `useAsyncData` means **do not make any new requests if there is an existing pending request.** (See [PR](https://github.com/nuxt/nuxt/pull/24564#pullrequestreview-1764584361).)
661
661
 
662
662
  #### Migration Steps
663
663
 
@@ -109,12 +109,12 @@ export { utils } from './nested/utils.ts'
109
109
  export default defineNuxtConfig({
110
110
  imports: {
111
111
  dirs: [
112
- // Scan top-level modules
113
- 'composables',
114
- // ... or scan modules nested one level deep with a specific name and file extension
115
- 'composables/*/index.{ts,js,mjs,mts}',
116
- // ... or scan all modules within given directory
117
- 'composables/**'
112
+ // Scan top-level composables
113
+ '~/composables',
114
+ // ... or scan composables nested one level deep with a specific name and file extension
115
+ '~/composables/*/index.{ts,js,mjs,mts}',
116
+ // ... or scan all composables within given directory
117
+ '~/composables/**'
118
118
  ]
119
119
  }
120
120
  })
@@ -299,13 +299,13 @@ Of course, you are welcome to define metadata for your own use throughout your a
299
299
 
300
300
  #### `alias`
301
301
 
302
- You can define page aliases. They allow you to access the same page from different paths. It can be either a string or an array of strings as defined [here](https://router.vuejs.org/guide/essentials/redirect-and-alias.html#Alias) on vue-router documentation.
302
+ You can define page aliases. They allow you to access the same page from different paths. It can be either a string or an array of strings as defined [in the vue-router documentation](https://router.vuejs.org/guide/essentials/redirect-and-alias.html#Alias).
303
303
 
304
304
  #### `keepalive`
305
305
 
306
306
  Nuxt will automatically wrap your page in [the Vue `<KeepAlive>` component](https://vuejs.org/guide/built-ins/keep-alive.html#keepalive) if you set `keepalive: true` in your `definePageMeta`. This might be useful to do, for example, in a parent route that has dynamic child routes, if you want to preserve page state across route changes.
307
307
 
308
- When your goal is to preserve state for parent routes use this syntax: `<NuxtPage keepalive />`. You can also set props to be passed to `<KeepAlive>` (see a full list [here](https://vuejs.org/api/built-in-components.html#keepalive)).
308
+ When your goal is to preserve state for parent routes use this syntax: `<NuxtPage keepalive />`. You can also set props to be passed to `<KeepAlive>` (see [a full list](https://vuejs.org/api/built-in-components.html#keepalive)).
309
309
 
310
310
  You can set a default value for this property [in your `nuxt.config`](/docs/api/nuxt-config#keepalive).
311
311
 
@@ -319,7 +319,7 @@ You can define the layout used to render the route. This can be either false (to
319
319
 
320
320
  #### `layoutTransition` and `pageTransition`
321
321
 
322
- You can define transition properties for the `<transition>` component that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see a list of options that can be passed [here](https://vuejs.org/api/built-in-components.html#transition) or read [more about how transitions work](https://vuejs.org/guide/built-ins/transition.html#transition).
322
+ You can define transition properties for the `<transition>` component that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see [a list of options that can be passed](https://vuejs.org/api/built-in-components.html#transition) or read [more about how transitions work](https://vuejs.org/guide/built-ins/transition.html#transition).
323
323
 
324
324
  You can set default values for these properties [in your `nuxt.config`](/docs/api/nuxt-config#layouttransition).
325
325
 
@@ -108,5 +108,5 @@ async function addTodo () {
108
108
  ## Type
109
109
 
110
110
  ```ts
111
- useNuxtData<DataT = any> (key: string): { data: Ref<DataT | null> }
111
+ useNuxtData<DataT = any> (key: string): { data: Ref<DataT | undefined> }
112
112
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/docs",
3
- "version": "3.17.3",
3
+ "version": "3.17.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",