@nuxt/docs-nightly 4.1.3-29313364.98ecc620 → 4.1.3-29314777.50febbbb

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.
Files changed (108) hide show
  1. package/1.getting-started/01.introduction.md +4 -4
  2. package/1.getting-started/02.installation.md +1 -1
  3. package/1.getting-started/03.configuration.md +6 -6
  4. package/1.getting-started/04.views.md +2 -2
  5. package/1.getting-started/05.assets.md +1 -1
  6. package/1.getting-started/06.styling.md +3 -3
  7. package/1.getting-started/07.routing.md +5 -5
  8. package/1.getting-started/08.seo-meta.md +4 -4
  9. package/1.getting-started/10.data-fetching.md +14 -14
  10. package/1.getting-started/11.state-management.md +4 -4
  11. package/1.getting-started/12.error-handling.md +11 -11
  12. package/1.getting-started/13.server.md +5 -5
  13. package/1.getting-started/14.layers.md +1 -1
  14. package/1.getting-started/15.prerendering.md +4 -4
  15. package/1.getting-started/16.deployment.md +1 -1
  16. package/1.getting-started/17.testing.md +1 -1
  17. package/1.getting-started/18.upgrade.md +2 -2
  18. package/2.guide/0.index.md +5 -5
  19. package/2.guide/1.directory-structure/0.output.md +1 -1
  20. package/2.guide/1.directory-structure/1.app/1.assets.md +1 -1
  21. package/2.guide/1.directory-structure/1.app/1.components.md +4 -4
  22. package/2.guide/1.directory-structure/1.app/1.composables.md +2 -2
  23. package/2.guide/1.directory-structure/1.app/1.layouts.md +3 -3
  24. package/2.guide/1.directory-structure/1.app/1.middleware.md +3 -3
  25. package/2.guide/1.directory-structure/1.app/1.pages.md +6 -6
  26. package/2.guide/1.directory-structure/1.app/1.utils.md +2 -2
  27. package/2.guide/1.directory-structure/1.app/3.app-config.md +1 -1
  28. package/2.guide/1.directory-structure/1.app/3.app.md +3 -3
  29. package/2.guide/1.directory-structure/1.modules.md +1 -1
  30. package/2.guide/1.directory-structure/1.server.md +2 -2
  31. package/2.guide/1.directory-structure/1.shared.md +2 -2
  32. package/2.guide/1.directory-structure/2.env.md +3 -3
  33. package/2.guide/1.directory-structure/2.nuxtrc.md +1 -1
  34. package/2.guide/1.directory-structure/3.nuxt-config.md +1 -1
  35. package/2.guide/2.concepts/1.auto-imports.md +4 -4
  36. package/2.guide/2.concepts/10.nuxt-lifecycle.md +7 -7
  37. package/2.guide/2.concepts/2.vuejs-development.md +4 -4
  38. package/2.guide/2.concepts/3.rendering.md +3 -3
  39. package/2.guide/2.concepts/4.server-engine.md +1 -1
  40. package/2.guide/2.concepts/5.modules.md +1 -1
  41. package/2.guide/2.concepts/7.esm.md +2 -2
  42. package/2.guide/3.going-further/1.events.md +1 -1
  43. package/2.guide/3.going-further/1.experimental-features.md +4 -4
  44. package/2.guide/3.going-further/10.runtime-config.md +1 -1
  45. package/2.guide/3.going-further/11.nightly-release-channel.md +1 -1
  46. package/2.guide/3.going-further/2.hooks.md +3 -3
  47. package/2.guide/3.going-further/3.modules.md +7 -7
  48. package/2.guide/3.going-further/4.kit.md +2 -2
  49. package/2.guide/3.going-further/6.nuxt-app.md +3 -3
  50. package/2.guide/3.going-further/7.layers.md +1 -1
  51. package/2.guide/4.recipes/3.custom-usefetch.md +1 -1
  52. package/2.guide/4.recipes/4.sessions-and-authentication.md +1 -1
  53. package/2.guide/5.best-practices/performance.md +5 -5
  54. package/3.api/1.components/1.nuxt-client-fallback.md +1 -1
  55. package/3.api/1.components/11.teleports.md +1 -1
  56. package/3.api/1.components/2.nuxt-page.md +2 -2
  57. package/3.api/1.components/3.nuxt-layout.md +4 -4
  58. package/3.api/1.components/4.nuxt-link.md +2 -2
  59. package/3.api/1.components/5.nuxt-loading-indicator.md +1 -1
  60. package/3.api/1.components/6.nuxt-error-boundary.md +1 -1
  61. package/3.api/2.composables/use-app-config.md +1 -1
  62. package/3.api/2.composables/use-async-data.md +3 -3
  63. package/3.api/2.composables/use-cookie.md +1 -1
  64. package/3.api/2.composables/use-error.md +1 -1
  65. package/3.api/2.composables/use-fetch.md +4 -4
  66. package/3.api/2.composables/use-head.md +1 -1
  67. package/3.api/2.composables/use-lazy-async-data.md +2 -2
  68. package/3.api/2.composables/use-lazy-fetch.md +2 -2
  69. package/3.api/2.composables/use-nuxt-app.md +1 -1
  70. package/3.api/2.composables/use-router.md +1 -1
  71. package/3.api/2.composables/use-runtime-config.md +5 -5
  72. package/3.api/2.composables/use-seo-meta.md +2 -2
  73. package/3.api/2.composables/use-server-seo-meta.md +2 -2
  74. package/3.api/2.composables/use-state.md +1 -1
  75. package/3.api/3.utils/$fetch.md +1 -1
  76. package/3.api/3.utils/call-once.md +2 -2
  77. package/3.api/3.utils/clear-error.md +1 -1
  78. package/3.api/3.utils/create-error.md +1 -1
  79. package/3.api/3.utils/define-nuxt-plugin.md +1 -1
  80. package/3.api/3.utils/define-page-meta.md +2 -2
  81. package/3.api/3.utils/define-route-rules.md +2 -2
  82. package/3.api/3.utils/navigate-to.md +1 -1
  83. package/3.api/3.utils/preload-route-components.md +2 -2
  84. package/3.api/3.utils/refresh-cookie.md +1 -1
  85. package/3.api/3.utils/refresh-nuxt-data.md +1 -1
  86. package/3.api/3.utils/reload-nuxt-app.md +1 -1
  87. package/3.api/3.utils/set-response-status.md +1 -1
  88. package/3.api/3.utils/show-error.md +1 -1
  89. package/3.api/3.utils/update-app-config.md +1 -1
  90. package/3.api/4.commands/generate.md +1 -1
  91. package/3.api/4.commands/typecheck.md +1 -1
  92. package/3.api/6.advanced/1.hooks.md +1 -1
  93. package/3.api/6.nuxt-config.md +6 -6
  94. package/3.api/index.md +7 -7
  95. package/5.community/4.contribution.md +5 -5
  96. package/5.community/5.framework-contribution.md +1 -1
  97. package/6.bridge/3.bridge-composition-api.md +2 -2
  98. package/6.bridge/5.nuxt3-compatible-api.md +1 -1
  99. package/7.migration/10.bundling.md +1 -1
  100. package/7.migration/11.server.md +3 -3
  101. package/7.migration/2.configuration.md +1 -1
  102. package/7.migration/20.module-authors.md +1 -1
  103. package/7.migration/4.meta.md +1 -1
  104. package/7.migration/5.plugins-and-middleware.md +3 -3
  105. package/7.migration/6.pages-and-layouts.md +5 -5
  106. package/7.migration/7.component-options.md +4 -4
  107. package/7.migration/8.runtime-config.md +1 -1
  108. package/package.json +1 -1
@@ -42,9 +42,9 @@ const foo = useFoo()
42
42
  The `app/composables/` directory in Nuxt does not provide any additional reactivity capabilities to your code. Instead, any reactivity within composables is achieved using Vue's Composition API mechanisms, such as ref and reactive. Note that reactive code is also not limited to the boundaries of the `app/composables/` directory. You are free to employ reactivity features wherever they're needed in your application.
43
43
  ::
44
44
 
45
- :read-more{to="/docs/guide/concepts/auto-imports"}
45
+ :read-more{to="/docs/4.x/guide/concepts/auto-imports"}
46
46
 
47
- :link-example{to="/docs/examples/features/auto-imports"}
47
+ :link-example{to="/docs/4.x/examples/features/auto-imports"}
48
48
 
49
49
  ## Types
50
50
 
@@ -74,7 +74,7 @@ definePageMeta({
74
74
  </script>
75
75
  ```
76
76
 
77
- ::read-more{to="/docs/guide/directory-structure/app/pages#page-metadata"}
77
+ ::read-more{to="/docs/4.x/guide/directory-structure/app/pages#page-metadata"}
78
78
  Learn more about `definePageMeta`.
79
79
  ::
80
80
 
@@ -109,7 +109,7 @@ File | Layout Name
109
109
  `~/layouts/desktop-base/DesktopBase.vue` | `desktop-base`
110
110
  `~/layouts/desktop/Desktop.vue` | `desktop`
111
111
 
112
- :link-example{to="/docs/examples/features/layouts"}
112
+ :link-example{to="/docs/4.x/examples/features/layouts"}
113
113
 
114
114
  ## Changing the Layout Dynamically
115
115
 
@@ -132,7 +132,7 @@ definePageMeta({
132
132
  </template>
133
133
  ```
134
134
 
135
- :link-example{to="/docs/examples/features/layouts"}
135
+ :link-example{to="/docs/4.x/examples/features/layouts"}
136
136
 
137
137
  ## Overriding a Layout on a Per-page Basis
138
138
 
@@ -58,8 +58,8 @@ Possible return values are:
58
58
  * `return abortNavigation()` - stops the current navigation
59
59
  * `return abortNavigation(error)` - rejects the current navigation with an error
60
60
 
61
- :read-more{to="/docs/api/utils/navigate-to"}
62
- :read-more{to="/docs/api/utils/abort-navigation"}
61
+ :read-more{to="/docs/4.x/api/utils/navigate-to"}
62
+ :read-more{to="/docs/4.x/api/utils/abort-navigation"}
63
63
 
64
64
  ::important
65
65
  We recommend using the helper functions above for performing redirects or stopping navigation. Other possible return values described in [the vue-router docs](https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards) may work but there may be breaking changes in future.
@@ -216,7 +216,7 @@ definePageMeta({
216
216
 
217
217
  Now, before navigation to that page can complete, the `auth` route middleware will be run.
218
218
 
219
- :link-example{to="/docs/examples/routing/middleware"}
219
+ :link-example{to="/docs/4.x/examples/routing/middleware"}
220
220
 
221
221
  ## Setting Middleware at Build Time
222
222
 
@@ -33,7 +33,7 @@ export default defineComponent({
33
33
  ```
34
34
 
35
35
  ```tsx twoslash [pages/index.tsx]
36
- // https://nuxt.com/docs/examples/advanced/jsx
36
+ // https://nuxt.com/docs/4.x/examples/advanced/jsx
37
37
  // https://vuejs.org/guide/extras/render-function.html#jsx-tsx
38
38
  export default defineComponent({
39
39
  render () {
@@ -226,7 +226,7 @@ definePageMeta({
226
226
  </script>
227
227
  ```
228
228
 
229
- :link-example{to="/docs/examples/routing/pages"}
229
+ :link-example{to="/docs/4.x/examples/routing/pages"}
230
230
 
231
231
  ## Route Groups
232
232
 
@@ -311,7 +311,7 @@ You can set a default value for this property [in your `nuxt.config`](/docs/4.x/
311
311
 
312
312
  #### `key`
313
313
 
314
- [See above](/docs/guide/directory-structure/app/pages#child-route-keys).
314
+ [See above](/docs/4.x/guide/directory-structure/app/pages#child-route-keys).
315
315
 
316
316
  #### `layout`
317
317
 
@@ -368,7 +368,7 @@ A simple link to the `index.vue` page in your `app/pages` folder:
368
368
  </template>
369
369
  ```
370
370
 
371
- ::read-more{to="/docs/api/components/nuxt-link"}
371
+ ::read-more{to="/docs/4.x/api/components/nuxt-link"}
372
372
  Learn more about `<NuxtLink>` usage.
373
373
  ::
374
374
 
@@ -413,7 +413,7 @@ Server-only pages must have a single root element. (HTML comments are considered
413
413
 
414
414
  As your app gets bigger and more complex, your routing might require more flexibility. For this reason, Nuxt directly exposes the router, routes and router options for customization in different ways.
415
415
 
416
- :read-more{to="/docs/guide/recipes/custom-routing"}
416
+ :read-more{to="/docs/4.x/guide/recipes/custom-routing"}
417
417
 
418
418
  ## Multiple Pages Directories
419
419
 
@@ -441,4 +441,4 @@ export default defineNuxtConfig({
441
441
  })
442
442
  ```
443
443
 
444
- :read-more{to="/docs/guide/going-further/layers"}
444
+ :read-more{to="/docs/4.x/guide/going-further/layers"}
@@ -35,9 +35,9 @@ You can now use auto imported utility functions in `.js`, `.ts` and `.vue` files
35
35
  </template>
36
36
  ```
37
37
 
38
- :read-more{to="/docs/guide/concepts/auto-imports"}
38
+ :read-more{to="/docs/4.x/guide/concepts/auto-imports"}
39
39
 
40
- :link-example{to="/docs/examples/features/auto-imports"}
40
+ :link-example{to="/docs/4.x/examples/features/auto-imports"}
41
41
 
42
42
  ::tip
43
43
  The way `app/utils/` auto-imports work and are scanned is identical to the [`app/composables/`](/docs/4.x/guide/directory-structure/app/composables) directory.
@@ -59,7 +59,7 @@ console.log(appConfig) // { foo: 'baz' }
59
59
  </script>
60
60
  ```
61
61
 
62
- ::read-more{to="/docs/api/utils/update-app-config"}
62
+ ::read-more{to="/docs/4.x/api/utils/update-app-config"}
63
63
  Read more about the `updateAppConfig` utility.
64
64
  ::
65
65
 
@@ -21,7 +21,7 @@ With Nuxt, the [`app/pages/`](/docs/4.x/guide/directory-structure/app/pages) dir
21
21
  </template>
22
22
  ```
23
23
 
24
- :link-example{to="/docs/examples/hello-world"}
24
+ :link-example{to="/docs/4.x/examples/hello-world"}
25
25
 
26
26
  ### Usage with Pages
27
27
 
@@ -51,7 +51,7 @@ You can also define the common structure of your application directly in `app.vu
51
51
  Remember that `app.vue` acts as the main component of your Nuxt application. Anything you add to it (JS and CSS) will be global and included in every page.
52
52
  ::
53
53
 
54
- ::read-more{to="/docs/guide/directory-structure/app/pages"}
54
+ ::read-more{to="/docs/4.x/guide/directory-structure/app/pages"}
55
55
  Learn more about how to structure your pages using the `app/pages/` directory.
56
56
  ::
57
57
 
@@ -67,6 +67,6 @@ When your application requires different layouts for different pages, you can us
67
67
  </template>
68
68
  ```
69
69
 
70
- ::read-more{to="/docs/guide/directory-structure/app/layouts"}
70
+ ::read-more{to="/docs/4.x/guide/directory-structure/app/layouts"}
71
71
  Learn more about how to structure your layouts using the `app/layouts/` directory.
72
72
  ::
@@ -59,7 +59,7 @@ modules/
59
59
  2.second-module.ts
60
60
  ```
61
61
 
62
- :read-more{to="/docs/guide/going-further/modules"}
62
+ :read-more{to="/docs/4.x/guide/going-further/modules"}
63
63
 
64
64
  ::tip{icon="i-lucide-video" to="https://vueschool.io/lessons/creating-your-first-module-from-scratch?friend=nuxt" target="_blank"}
65
65
  Watch Vue School video about Nuxt private modules.
@@ -392,7 +392,7 @@ export default defineNuxtConfig({
392
392
  })
393
393
  ```
394
394
 
395
- :read-more{to="/docs/guide/concepts/server-engine"}
395
+ :read-more{to="/docs/4.x/guide/concepts/server-engine"}
396
396
 
397
397
  ### Nested Router
398
398
 
@@ -454,7 +454,7 @@ Never combine `next()` callback with a legacy middleware that is `async` or retu
454
454
 
455
455
  ### Server Storage
456
456
 
457
- Nitro provides a cross-platform [storage layer](https://nitro.build/guide/storage). In order to configure additional storage mount points, you can use `nitro.storage`, or [server plugins](/docs/guide/directory-structure/server#server-plugins).
457
+ Nitro provides a cross-platform [storage layer](https://nitro.build/guide/storage). In order to configure additional storage mount points, you can use `nitro.storage`, or [server plugins](/docs/4.x/guide/directory-structure/server#server-plugins).
458
458
 
459
459
  **Example of adding a Redis storage:**
460
460
 
@@ -65,7 +65,7 @@ Only files in the `shared/utils/` and `shared/types/` directories will be auto-i
65
65
  The way `shared/utils` and `shared/types` auto-imports work and are scanned is identical to the [`app/composables/`](/docs/4.x/guide/directory-structure/app/composables) and [`app/utils/`](/docs/4.x/guide/directory-structure/app/utils) directories.
66
66
  ::
67
67
 
68
- :read-more{to="/docs/guide/directory-structure/app/composables#how-files-are-scanned"}
68
+ :read-more{to="/docs/4.x/guide/directory-structure/app/composables#how-files-are-scanned"}
69
69
 
70
70
  ```bash [Directory Structure]
71
71
  -| shared/
@@ -95,4 +95,4 @@ import upper from '#shared/utils/formatters/upper'
95
95
 
96
96
  This alias ensures consistent imports across your application, regardless of the importing file's location.
97
97
 
98
- :read-more{to="/docs/guide/concepts/auto-imports"}
98
+ :read-more{to="/docs/4.x/guide/concepts/auto-imports"}
@@ -56,7 +56,7 @@ Since `.env` files are not used in production, you must explicitly set environme
56
56
  * Many cloud service providers, such as Vercel, Netlify, and AWS, provide interfaces for setting environment variables via their dashboards, CLI tools or configuration files.
57
57
 
58
58
  ::important
59
- `runtimeConfig` [won't pick up environment variables that don't start with `NUXT_` in production] (https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables).
59
+ `runtimeConfig` [won't pick up environment variables that don't start with `NUXT_` in production] (https://nuxt.com/docs/4.x/guide/going-further/runtime-config#environment-variables).
60
60
  ::
61
61
 
62
62
  ## Production Preview
@@ -71,9 +71,9 @@ DATABASE_HOST=mydatabaseconnectionstring node .output/server/index.mjs
71
71
 
72
72
  Note that for a purely static site, it is not possible to set runtime configuration config after your project is prerendered.
73
73
 
74
- :read-more{to="/docs/guide/going-further/runtime-config"}
74
+ :read-more{to="/docs/4.x/guide/going-further/runtime-config"}
75
75
 
76
76
  ::note
77
77
  If you want to use environment variables set at build time but do not care about updating these down the line (or only need to update them reactively _within_ your app) then `appConfig` may be a better choice. You can define `appConfig` both within your `nuxt.config` (using environment variables) and also within an `~/app.config.ts` file in your project.
78
- :read-more{to="/docs/guide/directory-structure/app-config"}
78
+ :read-more{to="/docs/4.x/guide/directory-structure/app-config"}
79
79
  ::
@@ -31,7 +31,7 @@ If present, the properties in the `nuxt.config` file will overwrite the properti
31
31
  Nuxt automatically adds a `setups` section to track module installation and upgrade state. This is used internally for [module lifecycle hooks](/docs/4.x/api/kit/modules#using-lifecycle-hooks-for-module-installation-and-upgrade) and should not be modified manually.
32
32
  ::
33
33
 
34
- ::read-more{to="/docs/api/configuration/nuxt-config"}
34
+ ::read-more{to="/docs/4.x/api/configuration/nuxt-config"}
35
35
  Discover all the available options in the **Nuxt configuration** documentation.
36
36
  ::
37
37
 
@@ -27,7 +27,7 @@ export default defineNuxtConfig({
27
27
  })
28
28
  ```
29
29
 
30
- ::read-more{to="/docs/api/configuration/nuxt-config"}
30
+ ::read-more{to="/docs/4.x/api/configuration/nuxt-config"}
31
31
  Discover all the available options in the **Nuxt configuration** documentation.
32
32
  ::
33
33
 
@@ -66,7 +66,7 @@ If you get an error message like `Nuxt instance is unavailable` then it probably
66
66
  When using a composable that requires the Nuxt context inside a non-SFC component, you need to wrap your component with `defineNuxtComponent` instead of `defineComponent`
67
67
  ::
68
68
 
69
- ::read-more{to="/docs/guide/going-further/experimental-features#asynccontext" icon="i-lucide-star"}
69
+ ::read-more{to="/docs/4.x/guide/going-further/experimental-features#asynccontext" icon="i-lucide-star"}
70
70
  Checkout the `asyncContext` experimental feature to use Nuxt composables in async functions.
71
71
  ::
72
72
 
@@ -105,7 +105,7 @@ Nuxt directly auto-imports files created in defined directories:
105
105
  - `app/composables/` for [Vue composables](/docs/4.x/guide/directory-structure/app/composables).
106
106
  - `app/utils/` for helper functions and other utilities.
107
107
 
108
- :link-example{to="/docs/examples/features/auto-imports"}
108
+ :link-example{to="/docs/4.x/examples/features/auto-imports"}
109
109
 
110
110
  ::warning
111
111
  **Auto-imported `ref` and `computed` won't be unwrapped in a component `<template>`.** :br
@@ -139,7 +139,7 @@ export default defineNuxtConfig({
139
139
  })
140
140
  ```
141
141
 
142
- This will disable auto-imports completely but it's still possible to use [explicit imports](/docs/guide/concepts/auto-imports#explicit-imports) from `#imports`.
142
+ This will disable auto-imports completely but it's still possible to use [explicit imports](/docs/4.x/guide/concepts/auto-imports#explicit-imports) from `#imports`.
143
143
 
144
144
  ### Partially Disabling Auto-imports
145
145
 
@@ -167,7 +167,7 @@ With this configuration:
167
167
 
168
168
  Nuxt also automatically imports components from your `~/components` directory, although this is configured separately from auto-importing composables and utility functions.
169
169
 
170
- :read-more{to="/docs/guide/directory-structure/app/components"}
170
+ :read-more{to="/docs/4.x/guide/directory-structure/app/components"}
171
171
 
172
172
  To disable auto-importing components from your own `~/components` directory, you can set `components.dirs` to an empty array (though note that this will not affect components added by modules).
173
173
 
@@ -22,7 +22,7 @@ When Nitro starts, it initializes and executes the plugins under the `/server/pl
22
22
  Nitro plugins are executed only once when the server starts. In a serverless environment, the server boots on each incoming request, and so do the Nitro plugins. However, they are not awaited.
23
23
  ::
24
24
 
25
- :read-more{to="/docs/guide/directory-structure/server#server-plugins"}
25
+ :read-more{to="/docs/4.x/guide/directory-structure/server#server-plugins"}
26
26
 
27
27
  ### Step 2: Nitro Server Middleware
28
28
 
@@ -32,7 +32,7 @@ After initializing the Nitro server, middleware under `server/middleware/` is ex
32
32
  Returning a value from middleware will terminate the request and send the returned value as the response. This behavior should generally be avoided to ensure proper request handling!
33
33
  ::
34
34
 
35
- :read-more{to="/docs/guide/directory-structure/server#server-middleware"}
35
+ :read-more{to="/docs/4.x/guide/directory-structure/server#server-middleware"}
36
36
 
37
37
  ### Step 3: Initialize Nuxt and Execute Nuxt App Plugins
38
38
 
@@ -46,7 +46,7 @@ Plugins execute in a specific order and may have dependencies on one another. Fo
46
46
  After this step, Nuxt calls the [`app:created`](/docs/4.x/api/advanced/hooks#app-hooks-runtime) hook, which can be used to execute additional logic.
47
47
  ::
48
48
 
49
- :read-more{to="/docs/guide/directory-structure/plugins"}
49
+ :read-more{to="/docs/4.x/guide/directory-structure/plugins"}
50
50
 
51
51
  ### Step 4: Route Validation
52
52
 
@@ -57,7 +57,7 @@ After initializing plugins and before executing middleware, Nuxt calls the `vali
57
57
 
58
58
  For more information, see the [Route Validation documentation](/docs/4.x/getting-started/routing#route-validation).
59
59
 
60
- :read-more{to="/docs/getting-started/routing#route-validation"}
60
+ :read-more{to="/docs/4.x/getting-started/routing#route-validation"}
61
61
 
62
62
  ### Step 5: Execute Nuxt App Middleware
63
63
 
@@ -74,7 +74,7 @@ For details about each type and examples, see the [Middleware documentation](/do
74
74
 
75
75
  Any redirection on the server will result in a `Location:` header being sent to the browser; the browser then makes a fresh request to this new location. All application state will be reset when this happens, unless persisted in a cookie.
76
76
 
77
- :read-more{to="/docs/guide/directory-structure/app/middleware"}
77
+ :read-more{to="/docs/4.x/guide/directory-structure/app/middleware"}
78
78
 
79
79
  ### Step 6: Render Page and Components
80
80
 
@@ -120,7 +120,7 @@ Custom plugins in the `app/plugins/` directory, such as those without a suffix (
120
120
  After this step, Nuxt calls the [`app:created`](/docs/4.x/api/advanced/hooks#app-hooks-runtime) hook, which can be used to execute additional logic.
121
121
  ::
122
122
 
123
- :read-more{to="/docs/guide/directory-structure/plugins"}
123
+ :read-more{to="/docs/4.x/guide/directory-structure/plugins"}
124
124
 
125
125
  ### Step 2: Route Validation
126
126
 
@@ -130,7 +130,7 @@ This step is the same as the server-side execution and includes the `validate` m
130
130
 
131
131
  Nuxt middleware runs on both the server and the client. If you want certain code to run in specific environments, consider splitting it by using `import.meta.client` for the client and `import.meta.server` for the server.
132
132
 
133
- :read-more{to="/docs/guide/directory-structure/app/middleware#when-middleware-runs"}
133
+ :read-more{to="/docs/4.x/guide/directory-structure/app/middleware#when-middleware-runs"}
134
134
 
135
135
  ### Step 4: Mount Vue Application and Hydration
136
136
 
@@ -27,15 +27,15 @@ We chose to build Nuxt on top of Vue for these reasons:
27
27
 
28
28
  Every Vue component created in the [`app/components/`](/docs/4.x/guide/directory-structure/app/components) directory of a Nuxt project will be available in your project without having to import it. If a component is not used anywhere, your production’s code will not include it.
29
29
 
30
- :read-more{to="/docs/guide/concepts/auto-imports"}
30
+ :read-more{to="/docs/4.x/guide/concepts/auto-imports"}
31
31
 
32
32
  ### Vue Router
33
33
 
34
34
  Most applications need multiple pages and a way to navigate between them. This is called **routing**. Nuxt uses an [`app/pages/`](/docs/4.x/guide/directory-structure/app/pages) directory and naming conventions to directly create routes mapped to your files using the official [Vue Router library](https://router.vuejs.org).
35
35
 
36
- :read-more{to="/docs/getting-started/routing"}
36
+ :read-more{to="/docs/4.x/getting-started/routing"}
37
37
 
38
- :link-example{to="/docs/examples/features/auto-imports"}
38
+ :link-example{to="/docs/4.x/examples/features/auto-imports"}
39
39
 
40
40
  ## Differences with Nuxt 2 / Vue 2
41
41
 
@@ -98,6 +98,6 @@ The goal of Nuxt is to provide a great developer experience around the Compositi
98
98
 
99
99
  Both Vue 3 and Nuxt 3+ are written in TypeScript. A fully typed codebase prevents mistakes and documents APIs usage. This doesn’t mean that you have to write your application in TypeScript to take advantage of it. With Nuxt 3, you can opt-in by renaming your file from `.js` to `.ts` , or add `<script setup lang="ts">` in a component.
100
100
 
101
- ::read-more{to="/docs/guide/concepts/typescript"}
101
+ ::read-more{to="/docs/4.x/guide/concepts/typescript"}
102
102
  Read the details about TypeScript in Nuxt
103
103
  ::
@@ -3,7 +3,7 @@ title: 'Rendering Modes'
3
3
  description: 'Learn about the different rendering modes available in Nuxt.'
4
4
  ---
5
5
 
6
- Nuxt supports different rendering modes, [universal rendering](/docs/guide/concepts/rendering#universal-rendering), [client-side rendering](/docs/guide/concepts/rendering#client-side-rendering) but also offers [hybrid-rendering](/docs/guide/concepts/rendering#hybrid-rendering) and the possibility to render your application on [CDN Edge Servers](/docs/guide/concepts/rendering#edge-side-rendering).
6
+ Nuxt supports different rendering modes, [universal rendering](/docs/4.x/guide/concepts/rendering#universal-rendering), [client-side rendering](/docs/4.x/guide/concepts/rendering#client-side-rendering) but also offers [hybrid-rendering](/docs/4.x/guide/concepts/rendering#hybrid-rendering) and the possibility to render your application on [CDN Edge Servers](/docs/4.x/guide/concepts/rendering#edge-side-rendering).
7
7
 
8
8
  Both the browser and server can interpret JavaScript code to turn Vue.js components into HTML elements. This step is called **rendering**. Nuxt supports both **universal** and **client-side** rendering. The two approaches have benefits and downsides that we will cover.
9
9
 
@@ -50,7 +50,7 @@ On the initial request, the `counter` ref is initialized in the server since it
50
50
 
51
51
  **Downsides of server-side rendering:**
52
52
  - **Development constraints:** Server and browser environments don't provide the same APIs, and it can be tricky to write code that can run on both sides seamlessly. Fortunately, Nuxt provides guidelines and specific variables to help you determine where a piece of code is executed.
53
- - **Cost:** A server needs to be running in order to render pages on the fly. This adds a monthly cost like any traditional server. However, the server calls are highly reduced thanks to universal rendering with the browser taking over on client-side navigation. A cost reduction is possible by leveraging [edge-side-rendering](/docs/guide/concepts/rendering#edge-side-rendering).
53
+ - **Cost:** A server needs to be running in order to render pages on the fly. This adds a monthly cost like any traditional server. However, the server calls are highly reduced thanks to universal rendering with the browser taking over on client-side navigation. A cost reduction is possible by leveraging [edge-side-rendering](/docs/4.x/guide/concepts/rendering#edge-side-rendering).
54
54
 
55
55
  Universal rendering is very versatile and can fit almost any use case, and is especially appropriate for any content-oriented websites: **blogs, marketing websites, portfolios, e-commerce sites, and marketplaces.**
56
56
 
@@ -89,7 +89,7 @@ export default defineNuxtConfig({
89
89
 
90
90
  ::note
91
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
- :read-more{title="SPA Loading Template" to="/docs/api/configuration/nuxt-config#spaloadingtemplate"}
92
+ :read-more{title="SPA Loading Template" to="/docs/4.x/api/configuration/nuxt-config#spaloadingtemplate"}
93
93
  ::
94
94
 
95
95
  :video-accordion{title="Watch a video from Alexander Lichter about Building a plain SPA with Nuxt" videoId="7Lr0QTP1Ro8"}
@@ -26,7 +26,7 @@ Key features include:
26
26
 
27
27
  Check out [the h3 docs](https://github.com/h3js/h3) for more information.
28
28
 
29
- ::read-more{to="/docs/guide/directory-structure/server#server-routes"}
29
+ ::read-more{to="/docs/4.x/guide/directory-structure/server#server-routes"}
30
30
  Learn more about the API layer in the `server/` directory.
31
31
  ::
32
32
 
@@ -45,4 +45,4 @@ Nuxt modules are now build-time-only, and the `buildModules` property used in Nu
45
45
 
46
46
  Everyone has the opportunity to develop modules and we cannot wait to see what you will build.
47
47
 
48
- :read-more{to="/docs/guide/going-further/modules" title="Module Author Guide"}
48
+ :read-more{to="/docs/4.x/guide/going-further/modules" title="Module Author Guide"}
@@ -111,7 +111,7 @@ const { named } = pkg;
111
111
 
112
112
  ## Troubleshooting ESM Issues
113
113
 
114
- If you encounter these errors, the issue is almost certainly with the upstream library. They need to [fix their library](/docs/guide/concepts/esm#library-author-guide) to support being imported by Node.
114
+ If you encounter these errors, the issue is almost certainly with the upstream library. They need to [fix their library](/docs/4.x/guide/concepts/esm#library-author-guide) to support being imported by Node.
115
115
 
116
116
  ### Transpiling Libraries
117
117
 
@@ -282,7 +282,7 @@ const someFile = await resolvePath('my-lib', { url: import.meta.url })
282
282
 
283
283
  ### Best Practices
284
284
 
285
- - Prefer named exports rather than default export. This helps reduce CJS conflicts. (see [Default exports](/docs/guide/concepts/esm#default-exports) section)
285
+ - Prefer named exports rather than default export. This helps reduce CJS conflicts. (see [Default exports](/docs/4.x/guide/concepts/esm#default-exports) section)
286
286
 
287
287
  - Avoid depending on Node.js built-ins and CommonJS or Node.js-only dependencies as much as possible to make your library usable in Browsers and Edge Workers without needing Nitro polyfills.
288
288
 
@@ -58,6 +58,6 @@ await nuxtApp.callHook('app:user:registered', {
58
58
  You can inspect all events using the **Nuxt DevTools** Hooks panel.
59
59
  ::
60
60
 
61
- ::read-more{to="/docs/guide/going-further/hooks"}
61
+ ::read-more{to="/docs/4.x/guide/going-further/hooks"}
62
62
  Learn more about Nuxt's built-in hooks and how to extend them
63
63
  ::
@@ -106,11 +106,11 @@ export default defineNuxtConfig({
106
106
 
107
107
  Matching route rules will be created, based on the page's `path`.
108
108
 
109
- ::read-more{to="/docs/api/utils/define-route-rules" icon="i-lucide-square-function"}
109
+ ::read-more{to="/docs/4.x/api/utils/define-route-rules" icon="i-lucide-square-function"}
110
110
  Read more in `defineRouteRules` utility.
111
111
  ::
112
112
 
113
- :read-more{to="/docs/guide/concepts/rendering#hybrid-rendering" icon="i-lucide-medal"}
113
+ :read-more{to="/docs/4.x/guide/concepts/rendering#hybrid-rendering" icon="i-lucide-medal"}
114
114
 
115
115
  ## renderJsonPayloads
116
116
 
@@ -220,7 +220,7 @@ export default defineNuxtConfig({
220
220
  })
221
221
  ```
222
222
 
223
- :read-more{to="/docs/guide/directory-structure/app/components#server-components"}
223
+ :read-more{to="/docs/4.x/guide/directory-structure/app/components#server-components"}
224
224
 
225
225
  ::read-more{icon="i-simple-icons-github" to="https://github.com/nuxt/nuxt/issues/19772" target="_blank"}
226
226
  You can follow the server components roadmap on GitHub.
@@ -531,7 +531,7 @@ export default defineNuxtConfig({
531
531
  })
532
532
  ```
533
533
 
534
- ::read-more{icon="i-simple-icons-github" color="gray" to="/docs/guide/directory-structure/app/components#delayed-or-lazy-hydration"}
534
+ ::read-more{icon="i-simple-icons-github" color="gray" to="/docs/4.x/guide/directory-structure/app/components#delayed-or-lazy-hydration"}
535
535
  Read more about lazy hydration.
536
536
  ::
537
537
 
@@ -45,7 +45,7 @@ The most common way to provide configuration is by using [Environment Variables]
45
45
 
46
46
  ::note
47
47
  The Nuxt CLI has built-in support for reading your `.env` file in development, build and generate. But when you run your built server, **your `.env` file will not be read**.
48
- :read-more{to="/docs/guide/directory-structure/env"}
48
+ :read-more{to="/docs/4.x/guide/directory-structure/env"}
49
49
  ::
50
50
 
51
51
  Runtime config values are **automatically replaced by matching environment variables at runtime**.
@@ -57,6 +57,6 @@ To try the latest version of [nuxt/cli](https://github.com/nuxt/cli):
57
57
  npx @nuxt/cli-nightly@latest [command]
58
58
  ```
59
59
 
60
- ::read-more{to="/docs/api/commands"}
60
+ ::read-more{to="/docs/4.x/api/commands"}
61
61
  Read more about the available commands.
62
62
  ::
@@ -33,7 +33,7 @@ export default defineNuxtModule({
33
33
  })
34
34
  ```
35
35
 
36
- ::read-more{to="/docs/api/advanced/hooks#nuxt-hooks-build-time"}
36
+ ::read-more{to="/docs/4.x/api/advanced/hooks#nuxt-hooks-build-time"}
37
37
  Explore all available Nuxt hooks.
38
38
  ::
39
39
 
@@ -49,7 +49,7 @@ export default defineNuxtPlugin((nuxtApp) => {
49
49
  })
50
50
  ```
51
51
 
52
- ::read-more{to="/docs/api/advanced/hooks#app-hooks-runtime"}
52
+ ::read-more{to="/docs/4.x/api/advanced/hooks#app-hooks-runtime"}
53
53
  Explore all available App hooks.
54
54
  ::
55
55
 
@@ -70,7 +70,7 @@ export default defineNitroPlugin((nitroApp) => {
70
70
  })
71
71
  ```
72
72
 
73
- ::read-more{to="/docs/api/advanced/hooks#nitro-app-hooks-runtime-server-side"}
73
+ ::read-more{to="/docs/4.x/api/advanced/hooks#nitro-app-hooks-runtime-server-side"}
74
74
  Learn more about available Nitro lifecycle hooks.
75
75
  ::
76
76
 
@@ -237,10 +237,10 @@ Or any other kind of asset you want to inject in users' Nuxt applications:
237
237
  - Images
238
238
  - etc.
239
239
 
240
- You'll then be able to inject all those assets inside the application from your [module definition](/docs/guide/going-further/modules#module-definition).
240
+ You'll then be able to inject all those assets inside the application from your [module definition](/docs/4.x/guide/going-further/modules#module-definition).
241
241
 
242
242
  ::tip
243
- Learn more about asset injection in [the recipes section](/docs/guide/going-further/modules#recipes).
243
+ Learn more about asset injection in [the recipes section](/docs/4.x/guide/going-further/modules#recipes).
244
244
  ::
245
245
 
246
246
  ::warning
@@ -261,7 +261,7 @@ Modules come with a set of first-party tools to help you with their development.
261
261
 
262
262
  [Nuxt Kit](/docs/4.x/guide/going-further/kit) provides composable utilities to help your module interact with Nuxt applications. It's recommended to use Nuxt Kit utilities over manual alternatives whenever possible to ensure better compatibility and code readability of your module.
263
263
 
264
- :read-more{to="/docs/guide/going-further/kit"}
264
+ :read-more{to="/docs/4.x/guide/going-further/kit"}
265
265
 
266
266
  #### `@nuxt/test-utils`
267
267
 
@@ -324,7 +324,7 @@ const options = useRuntimeConfig().public.myModule
324
324
  Be careful not to expose any sensitive module configuration on the public runtime config, such as private API keys, as they will end up in the public bundle.
325
325
  ::
326
326
 
327
- :read-more{to="/docs/guide/going-further/runtime-config"}
327
+ :read-more{to="/docs/4.x/guide/going-further/runtime-config"}
328
328
 
329
329
  ::tip{icon="i-lucide-video" to="https://vueschool.io/lessons/passing-and-exposing-module-options?friend=nuxt" target="_blank"}
330
330
  Watch Vue School video about passing and exposing Nuxt module options.
@@ -347,7 +347,7 @@ export default defineNuxtModule({
347
347
  })
348
348
  ```
349
349
 
350
- :read-more{to="/docs/guide/going-further/kit"}
350
+ :read-more{to="/docs/4.x/guide/going-further/kit"}
351
351
 
352
352
  #### Injecting Vue Components With `addComponent`
353
353
 
@@ -551,7 +551,7 @@ export default defineNuxtModule({
551
551
  })
552
552
  ```
553
553
 
554
- :read-more{to="/docs/api/advanced/hooks"}
554
+ :read-more{to="/docs/4.x/api/advanced/hooks"}
555
555
 
556
556
  ::tip{icon="i-lucide-video" to="https://vueschool.io/lessons/nuxt-lifecycle-hooks?friend=nuxt" target="_blank"}
557
557
  Watch Vue School video about using Nuxt lifecycle hooks in modules.
@@ -754,7 +754,7 @@ An example of such a workflow is available on [the module starter](https://githu
754
754
 
755
755
  #### Manual QA With Playground and Externally
756
756
 
757
- Having a playground Nuxt application to test your module when developing it is really useful. [The module starter integrates one for that purpose](/docs/guide/going-further/modules#how-to-develop).
757
+ Having a playground Nuxt application to test your module when developing it is really useful. [The module starter integrates one for that purpose](/docs/4.x/guide/going-further/modules#how-to-develop).
758
758
 
759
759
  You can test your module with other Nuxt applications (applications that are not part of your module repository) locally. To do so, you can use [`npm pack`](https://docs.npmjs.com/cli/commands/npm-pack) command, or your package manager equivalent, to create a tarball from your module. Then in your test project, you can add your module to `package.json` packages as: `"my-module": "file:/path/to/tarball.tgz"`.
760
760
 
@@ -5,7 +5,7 @@ description: "@nuxt/kit provides features for module authors."
5
5
 
6
6
  Nuxt Kit provides composable utilities to make interacting with [Nuxt Hooks](/docs/4.x/api/advanced/hooks), the [Nuxt Interface](/docs/4.x/guide/going-further/internals#the-nuxt-interface) and developing [Nuxt Modules](/docs/4.x/guide/going-further/modules) super easy.
7
7
 
8
- ::read-more{to="/docs/api/kit"}
8
+ ::read-more{to="/docs/4.x/api/kit"}
9
9
  Discover all Nuxt Kit utilities.
10
10
  ::
11
11
 
@@ -33,7 +33,7 @@ You can install the latest Nuxt Kit by adding it to the `dependencies` section o
33
33
  import { useNuxt } from '@nuxt/kit'
34
34
  ```
35
35
 
36
- :read-more{to="/docs/api/kit"}
36
+ :read-more{to="/docs/4.x/api/kit"}
37
37
 
38
38
  ::note
39
39
  Nuxt Kit utilities are only available for modules and not meant to be imported in runtime (components, Vue composables, pages, plugins, or server routes).
@@ -15,7 +15,7 @@ In Nuxt 2, this was referred to as **Nuxt context**.
15
15
 
16
16
  ## Nuxt App Interface
17
17
 
18
- ::read-more{to="/docs/guide/going-further/internals#the-nuxtapp-interface"}
18
+ ::read-more{to="/docs/4.x/guide/going-further/internals#the-nuxtapp-interface"}
19
19
  Jump over the `NuxtApp` interface documentation.
20
20
  ::
21
21
 
@@ -42,7 +42,7 @@ If your composable does not always need `nuxtApp` or you simply want to check if
42
42
 
43
43
  Plugins also receive `nuxtApp` as the first argument for convenience.
44
44
 
45
- :read-more{to="/docs/guide/directory-structure/plugins"}
45
+ :read-more{to="/docs/4.x/guide/directory-structure/plugins"}
46
46
 
47
47
  ## Providing Helpers
48
48
 
@@ -55,7 +55,7 @@ nuxtApp.provide('hello', (name) => `Hello ${name}!`)
55
55
  console.log(nuxtApp.$hello('name')) // Prints "Hello name!"
56
56
  ```
57
57
 
58
- ::read-more{to="/docs/guide/directory-structure/plugins#providing-helpers"}
58
+ ::read-more{to="/docs/4.x/guide/directory-structure/plugins#providing-helpers"}
59
59
  It is possible to inject helpers by returning an object with a `provide` key in plugins.
60
60
  ::
61
61