8000 docs: sync with main branch · nuxt/nuxt@e8c04aa · GitHub
[go: up one dir, main page]

Skip to content

Commit e8c04aa

Browse files
committed
docs: sync with main branch
1 parent 22708c0 commit e8c04aa

Some content is hidden

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

75 files changed

+1593
-1557
lines changed

docs/1.getting-started/02.installation.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ Or follow the steps below to set up a new Nuxt project on your computer.
1717

1818
## New Project
1919

20-
<!-- TODO: need to fix upstream in nuxt/nuxt.com -->
21-
<!-- markdownlint-disable-next-line MD001 -->
22-
#### Prerequisites
20+
### Prerequisites
2321

2422
- **Node.js** - [`20.x`](https://nodejs.org/en) or newer (but we recommend the [active LTS release](https://github.com/nodejs/release#release-schedule))
2523
- **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.

docs/1.getting-started/12.error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ You cannot currently define a server-side handler for these errors, but can rend
5959

6060
You might encounter chunk loading errors due to a network connectivity failure or a new deployment (which invalidates your old, hashed JS chunk URLs). Nuxt provides built-in support for handling chunk loading errors by performing a hard reload when a chunk fails to load during route navigation.
6161

62-
You can change this behavior by setting `experimental.emitRouteChunkError` to `false` (to disable hooking into these errors at all) or to `manual` if you want to handle them yourself. If you want to handle chunk loading errors manually, you can check out the [the automatic implementation](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/plugins/chunk-reload.client.ts) for ideas.
62+
You can change this behavior by setting `experimental.emitRouteChunkError` to `false` (to disable hooking into these errors at all) or to `manual` if you want to handle them yourself. If you want to handle chunk loading errors manually, you can check out the [the automatic implementation](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/plugins/chunk-reload.client.ts) for ideas.
6363

6464
## Error Page
6565

docs/1.getting-started/14.layers.md F440 ‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ Consider multiple layers defining the same component:
101101
```bash [Directory structure]
102102
layers/
103103
1.base/
104-
app/components/Button.vue # Base button style
104+
components/Button.vue # Base button style
105105
2.theme/
106-
app/components/Button.vue # Themed button (overrides base)
106+
components/Button.vue # Themed button (overrides base)
107107
app/
108108
components/Button.vue # Project button (overrides all layers)
109109
```
110110

111111
In this case:
112112
- If only layers exist, `2.theme/Button.vue` is used (higher alphabetically)
113-
- If `app/components/Button.vue` exists in your project, it overrides all layers
113+
- If `components/Button.vue` exists in your project, it overrides all layers
114114

115115
### Controlling Priority
116116

@@ -151,7 +151,7 @@ If you also have `~~/layers/custom`, the priority order is:
151151
- `@my-themes/awesome`
152152
- `github:my-themes/awesome#v1` (lowest)
153153

154-
::read-more{to="/docs/4.x/directory-structure/layers"}
154+
::read-more{to="/docs/3.x/directory-structure/layers"}
155155
Learn about the **layers/ directory** to organize and share reusable code, components, composables, and configurations across your Nuxt application.
156156
::
157157

docs/1.getting-started/17.testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ navigation.icon: i-lucide-circle-check
55
---
66

77
::tip
8-
If you are a module author, you can find more specific information in the [Module Author's guide](/docs/3.x/guide/modules#testing).
8+
If you are a module author, you can find more specific information in the [Module Author's guide](/docs/3.x/guide/modules/testing).
99
::
1010

1111
Nuxt offers first-class support for end-to-end and unit testing of your Nuxt application via `@nuxt/test-utils`, a library of test utilities and configuration that currently powers the [tests we use on Nuxt itself](https://github.com/nuxt/nuxt/tree/main/test) and tests throughout the module ecosystem.
@@ -274,7 +274,7 @@ it('can also mount an app', async () => {
274274

275275
This should be used together with utilities from Testing Library, e.g. `screen` and `fireEvent`. Install [@testing-library/vue](https://testing-library.com/docs/vue-testing-library/intro/) in your project to use these.
276276

277-
Additionally, Testing Library also relies on testing globals for cleanup. You should turn these on in your [Vitest config](https://vitest.dev/config/#globals).
277+
Additionally, Testing Library also relies on testing globals for cleanup. You should turn these on in your [Vitest config](https://vitest.dev/config/globals).
278278

279279
The passed in component will be rendered inside a `<div id="test-wrapper"></div>`.
280280

docs/2.directory-structure/1.app/3.app.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

docs/2.directory-structure/1.layers.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ Named layer aliases were introduced in Nuxt v3.16.0.
6464

6565
Each layer can include:
6666

67-
- [`nuxt.config.ts`](/docs/4.x/directory-structure/nuxt-config) - Layer-specific configuration that will be merged with the main config
68-
- [`app.config.ts`](/docs/4.x/directory-structure/app/app-config) - Reactive application configuration
69-
- [`app/components/`](/docs/4.x/directory-structure/app/components) - Vue components (auto-imported)
70-
- [`app/composables/`](/docs/4.x/directory-structure/app/composables) - Vue composables (auto-imported)
71-
- [`app/utils/`](/docs/4.x/directory-structure/app/utils) - Utility functions (auto-imported)
72-
- [`app/pages/`](/docs/4.x/directory-structure/app/pages) - Application pages
73-
- [`app/layouts/`](/docs/4.x/directory-structure/app/layouts) - Application layouts
74-
- [`app/middleware/`](/docs/4.x/directory-structure/app/middleware) - Route middleware
75-
- [`app/plugins/`](/docs/4.x/directory-structure/app/plugins) - Nuxt plugins
76-
- [`server/`](/docs/4.x/directory-structure/server) - Server routes, middleware, and utilities
77-
- [`shared/`](/docs/4.x/directory-structure/shared) - Shared code between app and server
67+
- [`nuxt.config.ts`](/docs/3.x/directory-structure/nuxt-config) - Layer-specific configuration that will be merged with the main config
68+
- [`app.config.ts`](/docs/3.x/directory-structure/app-config) - Reactive application configuration
69+
- [`components/`](/docs/3.x/directory-structure/components) - Vue components (auto-imported)
70+
- [`composables/`](/docs/3.x/directory-structure/composables) - Vue composables (auto-imported)
71+
- [`utils/`](/docs/3.x/directory-structure/utils) - Utility functions (auto-imported)
72+
- [`pages/`](/docs/3.x/directory-structure/pages) - Application pages
73+
- [`layouts/`](/docs/3.x/directory-structure/layouts) - Application layouts
74+
- [`middleware/`](/docs/3.x/directory-structure/middleware) - Route middleware
75+
- [`plugins/`](/docs/3.x/directory-structure/plugins) - Nuxt plugins
76+
- [`server/`](/docs/3.x/directory-structure/server) - Server routes, middleware, and utilities
77+
- [`shared/`](/docs/3.x/directory-structure/shared) - Shared code between app and server
7878

7979
## Priority Order
8080

8181
When multiple layers define the same resource (component, composable, page, etc.), the layer with **higher priority wins**. Layers are sorted alphabetically, with later letters having higher priority (Z > A).
8282

8383
To control the order, prefix directories with numbers: `1.base/`, `2.features/`, `3.admin/`.
8484

85-
:read-more{to="/docs/4.x/getting-started/layers#layer-priority"}
85+
:read-more{to="/docs/3.x/getting-started/layers#layer-priority"}
8686

8787
:video-accordion{title="Watch a video from Learn Vue about Nuxt Layers" videoId="lnFCM7c9f7I"}

docs/2.directory-structure/3.error.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ During the lifespan of your application, some errors may appear unexpectedly at
1111
<script setup lang="ts">
1212
import type { NuxtError } from '#app'
1313
14-
const props = defineProps({
15-
error: Object as () => NuxtError,
16-
})
14+
const props = defineProps<{ error: NuxtError }>()
1715
</script>
1816
1917
<template>

docs/2.directory-structure/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The [`modules/`](/docs/3.x/directory-structure/modules) directory is the directo
5656

5757
## Layers Directory
5858

59-
The [`layers/`](/docs/4.x/directory-structure/layers) directory allows you to organize and share reusable code, components, composables, and configurations. Layers within this directory are automatically registered in your project.
59+
The [`layers/`](/docs/3.x/directory-structure/layers) directory allows you to organize and share reusable code, components, composables, and configurations. Layers within this directory are automatically registered in your project.
6060

6161
## Nuxt Files
6262

docs/3.guide/0.index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ surround: false
2323
Find solutions to common problems and learn how to implement them in your Nuxt project.
2424
::
2525
::card{icon="i-lucide-star" title="Going Further" to="/docs/3.x/guide/going-further"}
26-
Master Nuxt with advanced concepts like experimental features, hooks, modules, and more.
26+
Master Nuxt with advanced concepts like experimental features, hooks, and more.
2727
::
2828
::

docs/3.guide/1.concepts/5.modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default defineNuxtConfig({
5252
})
5353
```
5454

55-
:read-more{to="/docs/4.x/guide/going-further/layers#disabling-modules-from-layers"}
55+
:read-more{to="/docs/3.x/guide/going-further/layers#disabling-modules-from-layers"}
5656

5757
## Create a Nuxt Module
5858

0 commit comments

Comments
 (0)
0