@nuxt/docs 4.0.0-alpha.1 → 4.0.0-alpha.2
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/1.getting-started/18.upgrade.md +45 -3
- package/2.guide/1.concepts/3.rendering.md +1 -1
- package/2.guide/2.directory-structure/1.app/.navigation.yml +5 -0
- package/2.guide/2.directory-structure/{1.pages.md → 1.app/1.pages.md} +1 -1
- package/2.guide/3.going-further/1.experimental-features.md +1 -1
- package/2.guide/4.recipes/1.custom-routing.md +5 -5
- package/3.api/2.composables/use-cookie.md +5 -4
- package/3.api/3.utils/define-page-meta.md +1 -1
- package/3.api/5.kit/11.nitro.md +47 -0
- package/3.api/5.kit/4.autoimports.md +8 -8
- package/3.api/6.nuxt-config.md +20 -44
- package/5.community/6.roadmap.md +17 -12
- package/7.migration/7.component-options.md +1 -1
- package/package.json +1 -1
- /package/2.guide/2.directory-structure/{1.assets.md → 1.app/1.assets.md} +0 -0
- /package/2.guide/2.directory-structure/{1.components.md → 1.app/1.components.md} +0 -0
- /package/2.guide/2.directory-structure/{1.composables.md → 1.app/1.composables.md} +0 -0
- /package/2.guide/2.directory-structure/{1.layouts.md → 1.app/1.layouts.md} +0 -0
- /package/2.guide/2.directory-structure/{1.middleware.md → 1.app/1.middleware.md} +0 -0
- /package/2.guide/2.directory-structure/{1.plugins.md → 1.app/1.plugins.md} +0 -0
- /package/2.guide/2.directory-structure/{1.utils.md → 1.app/1.utils.md} +0 -0
- /package/2.guide/2.directory-structure/{3.app-config.md → 1.app/3.app-config.md} +0 -0
- /package/2.guide/2.directory-structure/{3.app.md → 1.app/3.app.md} +0 -0
- /package/2.guide/2.directory-structure/{3.error.md → 1.app/3.error.md} +0 -0
|
@@ -40,7 +40,7 @@ The nightly release channel `latest` tag is currently tracking the Nuxt v4 branc
|
|
|
40
40
|
|
|
41
41
|
## Testing Nuxt 4
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Nuxt 4 is **scheduled for release in Q2 2025**. It will include all the features currently available through `compatibilityVersion: 4`.
|
|
44
44
|
|
|
45
45
|
Until the release, it is possible to test many of Nuxt 4's breaking changes from Nuxt version 3.12+.
|
|
46
46
|
|
|
@@ -188,6 +188,10 @@ server/
|
|
|
188
188
|
nuxt.config.ts
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
+
::note
|
|
192
|
+
With this new structure, the `~` alias now points to the `app/` directory by default (your `srcDir`). This means `~/components` resolves to `app/components/`, `~/pages` to `app/pages/`, etc.
|
|
193
|
+
::
|
|
194
|
+
|
|
191
195
|
</details>
|
|
192
196
|
|
|
193
197
|
👉 For more details, see the [PR implementing this change](https://github.com/nuxt/nuxt/pull/27029).
|
|
@@ -218,7 +222,7 @@ You can also force a v3 folder structure with the following configuration:
|
|
|
218
222
|
export default defineNuxtConfig({
|
|
219
223
|
// This reverts the new srcDir default from `app` back to your root directory
|
|
220
224
|
srcDir: '.',
|
|
221
|
-
// This specifies the directory prefix for `
|
|
225
|
+
// This specifies the directory prefix for `router.options.ts` and `spa-loading-template.html`
|
|
222
226
|
dir: {
|
|
223
227
|
app: 'app'
|
|
224
228
|
}
|
|
@@ -430,7 +434,7 @@ export default defineNuxtConfig({
|
|
|
430
434
|
|
|
431
435
|
#### What Changed
|
|
432
436
|
|
|
433
|
-
When rendering a client-only page (with `ssr: false`), we optionally render a loading screen (from
|
|
437
|
+
When rendering a client-only page (with `ssr: false`), we optionally render a loading screen (from `~/app/spa-loading-template.html` - note that this has also changed to `~/spa-loading-template.html` in Nuxt 4), within the Nuxt app root:
|
|
434
438
|
|
|
435
439
|
```html
|
|
436
440
|
<div id="__nuxt">
|
|
@@ -1000,6 +1004,44 @@ These options have been set to their current values for some time and we do not
|
|
|
1000
1004
|
|
|
1001
1005
|
* `respectNoSSRHeader`is implementable in user-land with [server middleware](https://github.com/nuxt/nuxt/blob/c660b39447f0d5b8790c0826092638d321cd6821/packages/nuxt/src/core/runtime/nitro/no-ssr.ts#L8-L9)
|
|
1002
1006
|
|
|
1007
|
+
### Removal of Top-Level `generate` Configuration
|
|
1008
|
+
|
|
1009
|
+
🚦 **Impact Level**: Minimal
|
|
1010
|
+
|
|
1011
|
+
#### What Changed
|
|
1012
|
+
|
|
1013
|
+
The top-level `generate` configuration option is no longer available in Nuxt 4. This includes all of its properties:
|
|
1014
|
+
|
|
1015
|
+
* `generate.exclude` - for excluding routes from prerendering
|
|
1016
|
+
* `generate.routes` - for specifying routes to prerender
|
|
1017
|
+
|
|
1018
|
+
#### Reasons for Change
|
|
1019
|
+
|
|
1020
|
+
The top level `generate` configuration was a holdover from Nuxt 2. We've supported `nitro.prerender` for a while now, and it is the preferred way to configure prerendering in Nuxt 3+.
|
|
1021
|
+
|
|
1022
|
+
#### Migration Steps
|
|
1023
|
+
|
|
1024
|
+
Replace `generate` configuration with the corresponding `nitro.prerender` options:
|
|
1025
|
+
|
|
1026
|
+
```diff
|
|
1027
|
+
export default defineNuxtConfig({
|
|
1028
|
+
- generate: {
|
|
1029
|
+
- exclude: ['/admin', '/private'],
|
|
1030
|
+
- routes: ['/sitemap.xml', '/robots.txt']
|
|
1031
|
+
- }
|
|
1032
|
+
+ nitro: {
|
|
1033
|
+
+ prerender: {
|
|
1034
|
+
+ ignore: ['/admin', '/private'],
|
|
1035
|
+
+ routes: ['/sitemap.xml', '/robots.txt']
|
|
1036
|
+
+ }
|
|
1037
|
+
+ }
|
|
1038
|
+
})
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
::read-more{to="https://nitro.build/config/#prerender"}
|
|
1042
|
+
Read more about Nitro's prerender configuration options.
|
|
1043
|
+
::
|
|
1044
|
+
|
|
1003
1045
|
## Nuxt 2 vs. Nuxt 3+
|
|
1004
1046
|
|
|
1005
1047
|
In the table below, there is a quick comparison between 3 versions of Nuxt:
|
|
@@ -88,7 +88,7 @@ export default defineNuxtConfig({
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
::note
|
|
91
|
-
If you do use `ssr: false`, you should also place an HTML file in `~/
|
|
91
|
+
If you do use `ssr: false`, you should also place an HTML file in `~/spa-loading-template.html` with some HTML you would like to use to render a loading screen that will be rendered until your app is hydrated.
|
|
92
92
|
:read-more{title="SPA Loading Template" to="/docs/api/configuration/nuxt-config#spaloadingtemplate"}
|
|
93
93
|
::
|
|
94
94
|
|
|
@@ -6,7 +6,7 @@ navigation.icon: i-lucide-folder
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
::note
|
|
9
|
-
To reduce your application's bundle size, this directory is **optional**, meaning that [`vue-router`](https://router.vuejs.org) won't be included if you only use [`app.vue`](/docs/guide/directory-structure/app). To force the pages system, set `pages: true` in `nuxt.config` or have a [`
|
|
9
|
+
To reduce your application's bundle size, this directory is **optional**, meaning that [`vue-router`](https://router.vuejs.org) won't be included if you only use [`app.vue`](/docs/guide/directory-structure/app). To force the pages system, set `pages: true` in `nuxt.config` or have a [`router.options.ts`](/docs/guide/recipes/custom-routing#using-approuteroptions).
|
|
10
10
|
::
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
@@ -454,7 +454,7 @@ By setting `experimental.normalizeComponentNames`, these two values match, and V
|
|
|
454
454
|
|
|
455
455
|
## spaLoadingTemplateLocation
|
|
456
456
|
|
|
457
|
-
When rendering a client-only page (with `ssr: false`), we optionally render a loading screen (from
|
|
457
|
+
When rendering a client-only page (with `ssr: false`), we optionally render a loading screen (from `~/spa-loading-template.html`).
|
|
458
458
|
|
|
459
459
|
It can be set to `within`, which will render it like this:
|
|
460
460
|
|
|
@@ -13,7 +13,7 @@ Using [router options](/docs/guide/recipes/custom-routing#router-options), you c
|
|
|
13
13
|
|
|
14
14
|
If it returns `null` or `undefined`, Nuxt will fall back to the default routes (useful to modify input array).
|
|
15
15
|
|
|
16
|
-
```ts [
|
|
16
|
+
```ts [router.options.ts]
|
|
17
17
|
import type { RouterConfig } from '@nuxt/schema'
|
|
18
18
|
|
|
19
19
|
export default {
|
|
@@ -83,11 +83,11 @@ The [Nuxt kit](/docs/guide/going-further/kit) provides a few ways [to add routes
|
|
|
83
83
|
|
|
84
84
|
On top of customizing options for [`vue-router`](https://router.vuejs.org/api/interfaces/routeroptions.html), Nuxt offers [additional options](/docs/api/nuxt-config#router) to customize the router.
|
|
85
85
|
|
|
86
|
-
### Using `
|
|
86
|
+
### Using `router.options`
|
|
87
87
|
|
|
88
88
|
This is the recommended way to specify [router options](/docs/api/nuxt-config#router).
|
|
89
89
|
|
|
90
|
-
```ts [
|
|
90
|
+
```ts [router.options.ts]
|
|
91
91
|
import type { RouterConfig } from '@nuxt/schema'
|
|
92
92
|
|
|
93
93
|
export default {
|
|
@@ -109,7 +109,7 @@ export default defineNuxtConfig({
|
|
|
109
109
|
const resolver = createResolver(import.meta.url)
|
|
110
110
|
// add a route
|
|
111
111
|
files.push({
|
|
112
|
-
path: resolver.resolve('./runtime/
|
|
112
|
+
path: resolver.resolve('./runtime/router-options'),
|
|
113
113
|
optional: true
|
|
114
114
|
})
|
|
115
115
|
}
|
|
@@ -170,7 +170,7 @@ export default defineNuxtConfig({
|
|
|
170
170
|
|
|
171
171
|
You can optionally override history mode using a function that accepts the base URL and returns the history mode. If it returns `null` or `undefined`, Nuxt will fallback to the default history.
|
|
172
172
|
|
|
173
|
-
```ts [
|
|
173
|
+
```ts [router.options.ts]
|
|
174
174
|
import type { RouterConfig } from '@nuxt/schema'
|
|
175
175
|
import { createMemoryHistory } from 'vue-router'
|
|
176
176
|
|
|
@@ -168,8 +168,9 @@ const user = useCookie(
|
|
|
168
168
|
}
|
|
169
169
|
)
|
|
170
170
|
|
|
171
|
-
if (user.value
|
|
172
|
-
|
|
171
|
+
if (user.value) {
|
|
172
|
+
// the actual `userInfo` cookie will not be updated
|
|
173
|
+
user.value.score++
|
|
173
174
|
}
|
|
174
175
|
</script>
|
|
175
176
|
|
|
@@ -196,9 +197,9 @@ function add() {
|
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
function save() {
|
|
199
|
-
if (list.value
|
|
200
|
+
if (list.value) {
|
|
201
|
+
// the actual `list` cookie will be updated
|
|
200
202
|
list.value = [...list.value]
|
|
201
|
-
// list cookie update with this change
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
205
|
</script>
|
|
@@ -136,7 +136,7 @@ interface PageMeta {
|
|
|
136
136
|
|
|
137
137
|
- **Type**: `boolean | (to: RouteLocationNormalized, from: RouteLocationNormalized) => boolean`
|
|
138
138
|
|
|
139
|
-
Tell Nuxt to scroll to the top before rendering the page or not. If you want to overwrite the default scroll behavior of Nuxt, you can do so in `~/
|
|
139
|
+
Tell Nuxt to scroll to the top before rendering the page or not. If you want to overwrite the default scroll behavior of Nuxt, you can do so in `~/router.options.ts` (see [custom routing](/docs/guide/recipes/custom-routing#using-approuteroptions)) for more info.
|
|
140
140
|
|
|
141
141
|
**`[key: string]`**
|
|
142
142
|
|
package/3.api/5.kit/11.nitro.md
CHANGED
|
@@ -293,6 +293,53 @@ function addPrerenderRoutes (routes: string | string[]): void
|
|
|
293
293
|
| ----------- | ------------------------------- | -------- | ---------------------------------------------- |
|
|
294
294
|
| `routes` | `string \| string[]`{lang="ts"} | `true` | A route or an array of routes to prerender. |
|
|
295
295
|
|
|
296
|
+
## `addServerImports`
|
|
297
|
+
|
|
298
|
+
Add imports to the server. It makes your imports available in Nitro without the need to import them manually.
|
|
299
|
+
|
|
300
|
+
### Usage
|
|
301
|
+
|
|
302
|
+
```ts twoslash
|
|
303
|
+
import { defineNuxtModule, createResolver, addServerImports } from '@nuxt/kit'
|
|
304
|
+
|
|
305
|
+
export default defineNuxtModule({
|
|
306
|
+
setup(options) {
|
|
307
|
+
const names = [
|
|
308
|
+
'useStoryblok',
|
|
309
|
+
'useStoryblokApi',
|
|
310
|
+
'useStoryblokBridge',
|
|
311
|
+
'renderRichText',
|
|
312
|
+
'RichTextSchema'
|
|
313
|
+
]
|
|
314
|
+
|
|
315
|
+
names.forEach((name) =>
|
|
316
|
+
addServerImports({ name, as: name, from: '@storyblok/vue' })
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
})
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Type
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
function addServerImports (dirs: Import | Import[]): void
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Parameters
|
|
329
|
+
|
|
330
|
+
`imports`: An object or an array of objects with the following properties:
|
|
331
|
+
|
|
332
|
+
| Property | Type | Required | Description |
|
|
333
|
+
| ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
|
|
334
|
+
| `name` | `string` | `true` | Import name to be detected. |
|
|
335
|
+
| `from` | `string` | `true` | Module specifier to import from. |
|
|
336
|
+
| `priority` | `number` | `false` | Priority of the import; if multiple imports have the same name, the one with the highest priority will be used. |
|
|
337
|
+
| `disabled` | `boolean` | `false` | If this import is disabled. |
|
|
338
|
+
| `meta` | `Record<string, any>` | `false` | Metadata of the import. |
|
|
339
|
+
| `type` | `boolean` | `false` | If this import is a pure type import. |
|
|
340
|
+
| `typeFrom` | `string` | `false` | Use this as the `from` value when generating type declarations. |
|
|
341
|
+
| `as` | `string` | `false` | Import as this name. |
|
|
342
|
+
|
|
296
343
|
## `addServerImportsDir`
|
|
297
344
|
|
|
298
345
|
Add a directory to be scanned for auto-imports by Nitro.
|
|
@@ -34,16 +34,16 @@ import { defineNuxtModule, addImports } from "@nuxt/kit";
|
|
|
34
34
|
export default defineNuxtModule({
|
|
35
35
|
setup(options, nuxt) {
|
|
36
36
|
const names = [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
37
|
+
'useStoryblok',
|
|
38
|
+
'useStoryblokApi',
|
|
39
|
+
'useStoryblokBridge',
|
|
40
|
+
'renderRichText',
|
|
41
|
+
'RichTextSchema'
|
|
42
|
+
]
|
|
43
43
|
|
|
44
44
|
names.forEach((name) =>
|
|
45
|
-
addImports({ name, as: name, from:
|
|
46
|
-
)
|
|
45
|
+
addImports({ name, as: name, from: '@storyblok/vue' })
|
|
46
|
+
)
|
|
47
47
|
}
|
|
48
48
|
})
|
|
49
49
|
```
|
package/3.api/6.nuxt-config.md
CHANGED
|
@@ -1340,28 +1340,6 @@ You can set it to false to use the legacy 'Node' mode, which is the default for
|
|
|
1340
1340
|
|
|
1341
1341
|
**See**: [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669)
|
|
1342
1342
|
|
|
1343
|
-
## generate
|
|
1344
|
-
|
|
1345
|
-
### `exclude`
|
|
1346
|
-
|
|
1347
|
-
This option is no longer used. Instead, use `nitro.prerender.ignore`.
|
|
1348
|
-
|
|
1349
|
-
- **Type**: `array`
|
|
1350
|
-
|
|
1351
|
-
### `routes`
|
|
1352
|
-
|
|
1353
|
-
The routes to generate.
|
|
1354
|
-
|
|
1355
|
-
If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes.
|
|
1356
|
-
It is preferred to use `nitro.prerender.routes`.
|
|
1357
|
-
|
|
1358
|
-
- **Type**: `array`
|
|
1359
|
-
|
|
1360
|
-
**Example**:
|
|
1361
|
-
```js
|
|
1362
|
-
routes: ['/users/1', '/users/2', '/users/3']
|
|
1363
|
-
```
|
|
1364
|
-
|
|
1365
1343
|
## hooks
|
|
1366
1344
|
|
|
1367
1345
|
Hooks are listeners to Nuxt events that are typically used in modules, but are also available in `nuxt.config`.
|
|
@@ -1793,7 +1771,7 @@ Additional router options passed to `vue-router`. On top of the options for `vue
|
|
|
1793
1771
|
|
|
1794
1772
|
::callout
|
|
1795
1773
|
**Note**: Only JSON serializable options should be passed by Nuxt config.
|
|
1796
|
-
For more control, you can use `
|
|
1774
|
+
For more control, you can use an `router.options.ts` file.
|
|
1797
1775
|
::
|
|
1798
1776
|
|
|
1799
1777
|
**See**: [Vue Router documentation](https://router.vuejs.org/api/interfaces/routeroptions.html).
|
|
@@ -1902,13 +1880,13 @@ Available options for both client and server: - `true`: Generates sourcemaps and
|
|
|
1902
1880
|
|
|
1903
1881
|
Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page rendered with `ssr: false`.
|
|
1904
1882
|
|
|
1905
|
-
- If it is unset, it will use `~/
|
|
1883
|
+
- If it is unset, it will use `~/spa-loading-template.html` file in one of your layers, if it exists. - If it is false, no SPA loading indicator will be loaded. - If true, Nuxt will look for `~/spa-loading-template.html` file in one of your layers, or a
|
|
1906
1884
|
default Nuxt image will be used.
|
|
1907
1885
|
Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners).
|
|
1908
1886
|
|
|
1909
1887
|
- **Default:** `null`
|
|
1910
1888
|
|
|
1911
|
-
**Example**: ~/
|
|
1889
|
+
**Example**: ~/spa-loading-template.html
|
|
1912
1890
|
```html
|
|
1913
1891
|
<!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->
|
|
1914
1892
|
<div class="loader"></div>
|
|
@@ -1959,33 +1937,31 @@ Define the source directory of your Nuxt application.
|
|
|
1959
1937
|
If a relative path is specified, it will be relative to the `rootDir`.
|
|
1960
1938
|
|
|
1961
1939
|
- **Type**: `string`
|
|
1962
|
-
- **Default:** `"
|
|
1940
|
+
- **Default:** `"app"` (Nuxt 4), `"."` (Nuxt 3 with `compatibilityMode: 3`)
|
|
1963
1941
|
|
|
1964
1942
|
**Example**:
|
|
1965
1943
|
```js
|
|
1966
1944
|
export default {
|
|
1967
|
-
srcDir: '
|
|
1945
|
+
srcDir: 'app/'
|
|
1968
1946
|
}
|
|
1969
1947
|
```
|
|
1970
|
-
This
|
|
1948
|
+
This expects the following folder structure:
|
|
1971
1949
|
```bash
|
|
1972
1950
|
-| app/
|
|
1973
|
-
---|
|
|
1974
|
-
---|
|
|
1975
|
-
---|
|
|
1976
|
-
---|
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
------| app.vue
|
|
1988
|
-
------| error.vue
|
|
1951
|
+
---| assets/
|
|
1952
|
+
---| components/
|
|
1953
|
+
---| layouts/
|
|
1954
|
+
---| middleware/
|
|
1955
|
+
---| pages/
|
|
1956
|
+
---| plugins/
|
|
1957
|
+
---| app.config.ts
|
|
1958
|
+
---| app.vue
|
|
1959
|
+
---| error.vue
|
|
1960
|
+
-| server/
|
|
1961
|
+
-| public/
|
|
1962
|
+
-| modules/
|
|
1963
|
+
-| nuxt.config.js
|
|
1964
|
+
-| package.json
|
|
1989
1965
|
```
|
|
1990
1966
|
|
|
1991
1967
|
## ssr
|
package/5.community/6.roadmap.md
CHANGED
|
@@ -30,8 +30,8 @@ Check [Discussions](https://github.com/nuxt/nuxt/discussions) and [RFCs](https:/
|
|
|
30
30
|
|
|
31
31
|
Milestone | Expected date | Notes | Description
|
|
32
32
|
-------------|---------------|------------------------------------------------------------------------|-----------------------
|
|
33
|
-
SEO & PWA |
|
|
34
|
-
Assets |
|
|
33
|
+
SEO & PWA | 2025 | [nuxt/nuxt#18395](https://github.com/nuxt/nuxt/discussions/18395) | Migrating from [nuxt-community/pwa-module](https://github.com/nuxt-community/pwa-module) for built-in SEO utils and service worker support
|
|
34
|
+
Assets | 2025 | [nuxt/nuxt#22012](https://github.com/nuxt/nuxt/discussions/22012) | Allow developers and modules to handle loading third-party assets.
|
|
35
35
|
Translations | - | [nuxt/translations#4](https://github.com/nuxt/translations/discussions/4) ([request access](https://github.com/nuxt/nuxt/discussions/16054)) | A collaborative project for a stable translation process for Nuxt docs. Currently pending for ideas and documentation tooling support (content v2 with remote sources).
|
|
36
36
|
|
|
37
37
|
## Core Modules Roadmap
|
|
@@ -40,33 +40,38 @@ In addition to the Nuxt framework, there are modules that are vital for the ecos
|
|
|
40
40
|
|
|
41
41
|
Module | Status | Nuxt Support | Repository | Description
|
|
42
42
|
------------------------------------|---------------------|--------------|------------|-------------------
|
|
43
|
-
[Scripts](https://scripts.nuxt.com) | Public Beta | 3.x
|
|
44
|
-
Auth Utils | Planned |
|
|
45
|
-
A11y | Planned |
|
|
46
|
-
Hints | Planned |
|
|
43
|
+
[Scripts](https://scripts.nuxt.com) | Public Beta | 3.x, 4.x | [nuxt/scripts](https://github.com/nuxt/scripts) | Easy 3rd party script management.
|
|
44
|
+
Auth Utils | Planned | 4.x, 5.x | `nuxt/auth-utils` to be announced | The temporary repository [atinux/nuxt-auth-utils](https://github.com/atinux/nuxt-auth-utils) is available while awaiting its official integration into Nuxt via RFC.
|
|
45
|
+
A11y | Planned | 4.x, 5.x | `nuxt/a11y` to be announced | Accessibility hinting and utilities [nuxt/nuxt#23255](https://github.com/nuxt/nuxt/issues/23255)
|
|
46
|
+
Hints | Planned | 4.x, 5.x | `nuxt/hints` to be announced | Guidance and suggestions for enhancing development practices.
|
|
47
47
|
|
|
48
48
|
## Release Cycle
|
|
49
49
|
|
|
50
50
|
Since January 2023, we've adopted a consistent release cycle for Nuxt, following [semver](https://semver.org). We aim for major framework releases every year, with an expectation of patch releases every week or so and minor releases every month or so. They should never contain breaking changes except within options clearly marked as `experimental`.
|
|
51
51
|
|
|
52
|
+
We are planning a slight variation from this plan for Nuxt 4 and Nuxt 5. Nuxt 4 will be a stability-focused release containing all `compatibilityVersion: 4` features, and will be followed shortly by Nuxt 5 which will include an upgrade to Nitro v3 and additional changes.
|
|
53
|
+
|
|
54
|
+
This approach separates breaking changes into manageable phases, allowing for better ecosystem testing and smoother migrations.
|
|
55
|
+
|
|
52
56
|
### Ongoing Support for Nuxt
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
We commit to support each major version of Nuxt for a minimum of six months after the release of the next major version, and to providing an upgrade path for current users at that point.
|
|
55
59
|
|
|
56
60
|
### Current Packages
|
|
57
61
|
|
|
58
62
|
The current active version of [Nuxt](https://nuxt.com) is **v3** which is available as `nuxt` on npm with the `latest` tag.
|
|
59
63
|
|
|
60
|
-
Nuxt 2 is in maintenance mode and is available on npm with the `2x` tag. It
|
|
64
|
+
Nuxt 2 is in maintenance mode and is available on npm with the `2x` tag. It reached End of Life (EOL) on June 30, 2024.
|
|
61
65
|
|
|
62
66
|
Each active version has its own nightly releases which are generated automatically. For more about enabling the Nuxt nightly release channel, see [the nightly release channel docs](/docs/guide/going-further/nightly-release-channel).
|
|
63
67
|
|
|
64
68
|
Release | | Initial release | End Of Life | Docs
|
|
65
69
|
----------------------------------------|---------------------------------------------------------------------------------------------------|-----------------|--------------|-------
|
|
66
|
-
**
|
|
67
|
-
**
|
|
68
|
-
**
|
|
69
|
-
**
|
|
70
|
+
**5.x** (scheduled) | | Q4 2025 (estimated) | TBA |
|
|
71
|
+
**4.x** (scheduled) | | 2025-06-30 (planned) | 6 months after 5.x release |
|
|
72
|
+
**3.x** (stable) | <a href="https://npmjs.com/package/nuxt"><img alt="Nuxt latest 3.x version" src="https://flat.badgen.net/npm/v/nuxt?label=" class="not-prose"></a> | 2022-11-16 | 2025-12-31 (TBC) | [nuxt.com](/docs)
|
|
73
|
+
**2.x** (unsupported) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 2.x version" src="https://flat.badgen.net/npm/v/nuxt/2x?label=" class="not-prose"></a> | 2018-09-21 | 2024-06-30 | [v2.nuxt.com](https://v2.nuxt.com/docs)
|
|
74
|
+
**1.x** (unsupported) | <a href="https://www.npmjs.com/package/nuxt?activeTab=versions"><img alt="Nuxt 1.x version" src="https://flat.badgen.net/npm/v/nuxt/1x?label=" class="not-prose"></a> | 2018-01-08 | 2019-09-21 |
|
|
70
75
|
|
|
71
76
|
### Support Status
|
|
72
77
|
|
|
@@ -103,7 +103,7 @@ This feature is not yet supported in Nuxt 3.
|
|
|
103
103
|
|
|
104
104
|
## `scrollToTop`
|
|
105
105
|
|
|
106
|
-
This feature is not yet supported in Nuxt 3. If you want to overwrite the default scroll behavior of `vue-router`, you can do so in `~/
|
|
106
|
+
This feature is not yet supported in Nuxt 3. If you want to overwrite the default scroll behavior of `vue-router`, you can do so in an `~/router.options.ts` (see [docs](/docs/guide/recipes/custom-routing#router-options)) for more info.
|
|
107
107
|
Similar to `key`, specify it within the [`definePageMeta`](/docs/api/utils/define-page-meta) compiler macro.
|
|
108
108
|
|
|
109
109
|
```diff [pages/index.vue]
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|