+
+
+
+
+
diff --git a/docs/components/templates/Example.vue b/docs/components/templates/Example.vue
new file mode 100644
index 00000000000..a09688a513b
--- /dev/null
+++ b/docs/components/templates/Example.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/content/1.getting-started/5.commands.md b/docs/content/1.getting-started/3.commands.md
similarity index 100%
rename from docs/content/1.getting-started/5.commands.md
rename to docs/content/1.getting-started/3.commands.md
diff --git a/docs/content/1.getting-started/3.bridge.md b/docs/content/1.getting-started/4.bridge.md
similarity index 98%
rename from docs/content/1.getting-started/3.bridge.md
rename to docs/content/1.getting-started/4.bridge.md
index 852215a2ee8..671d718d7da 100644
--- a/docs/content/1.getting-started/3.bridge.md
+++ b/docs/content/1.getting-started/4.bridge.md
@@ -1,4 +1,4 @@
-# Bridge
+# Migrating to Bridge
Experience Nuxt 3 features on existing Nuxt 2 projects.
@@ -136,7 +136,7 @@ You may also need to add `@vue/runtime-dom` as a devDependency if you are strugg
::
::alert
Keep in mind that all options extended from `./.nuxt/tsconfig.json` will be overwritten by the options defined in your `tsconfig.json`.
-Overwriting options such as `"compilerOptions.paths"` with your own configuration will lead Typescript to not factor in the module resolutions from `./.nuxt/tsconfig.json`. This can lead to module resolutions such as `#imports` not being recognized.
+Overwriting options such as `"compilerOptions.paths"` with your own configuration will lead TypeScript to not factor in the module resolutions from `./.nuxt/tsconfig.json`. This can lead to module resolutions such as `#imports` not being recognized.
In case you need to extend options provided by `./.nuxt/tsconfig.json` further, you can use the `alias` property withing your `nuxt.config`. `nuxi` will pick them up and extend `./.nuxt/tsconfig.json` accordingly.
::
@@ -241,7 +241,7 @@ export default defineNuxtConfig({
// -- Opt-in features --
- // Use Vite as the bundler instead of Webpack 4
+ // Use Vite as the bundler instead of webpack 4
// vite: true,
// Enable Nuxt 3 compatible useMeta
diff --git a/docs/content/1.getting-started/4.bridge-composition-api.md b/docs/content/1.getting-started/5.bridge-composition-api.md
similarity index 100%
rename from docs/content/1.getting-started/4.bridge-composition-api.md
rename to docs/content/1.getting-started/5.bridge-composition-api.md
diff --git a/docs/content/1.getting-started/6.migration.md b/docs/content/1.getting-started/6.migration.md
deleted file mode 100644
index 53d86e888a7..00000000000
--- a/docs/content/1.getting-started/6.migration.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# Migration
-
-Nuxt 3 migration guide. Work in progress π§
-
-## Nuxt 2 to Nuxt 3
-
-At the moment, there is no Nuxt 2 to Nuxt 3 migration guide nor is it recommended due to potentially more changes coming.
-We are working to provide a stable migration guide and tooling to make it as smooth as possible. Please check [Bridge](/getting-started/bridge) for the alternative.
-
-Some features have been dropped from Nuxt 2, some are yet to be implemented for Nuxt 3 and some are new in Nuxt 3 (and Bridge).
-
-Noticeable and/or breaking changes for Nuxt 3 other than the requirements of Nuxt Bridge are:
-
-::list{type=warning}
-
-- Vue app templates are rewritten
-- Vue upgraded to `3.x`
-- Using `` for async data fetching
-- Webpack `5.x` (if not using `vite`)
-- Components discovery is rewritten
-- Introduced main [`app.vue` component](/docs/directory-structure/app)
-- Introduced new [`layouts` system](/docs/directory-structure/layouts)
-- The [`pages/` directory](/docs/directory-structure/pages) conventions changed
-::
-
-The below table highlights an overall feature comparison:
-
-Feature / Version | Nuxt 2 | Nuxt 3 | Changes required | More information
---------------------------|---------|----------|---------------------------------|------------------
-Vue Version | 2 | 3 | Yes |
-`app.vue` | β | β | - |
-Suspense | β | β | - |
-Assets | β | β | No |
-Components | β | β | No |
-Layouts | β | β | Yes |
-Middleware | β | β | Yes |
-Pages | β | β | Yes |
-Pages: Dynamic Params | β | β | Yes |
-Pages: _.vue | β | β | Yes (new naming system) |
-Plugins | β | β | Yes (compatible by default) |
-Transitions | β | β | ? |
-Options API: `asyncData` | β | β | Yes (use `defineNuxtComponent`) |
-Options API: `fetch` | β | β | Use `asyncData` instead |
-Error Pages | β | π§ | Yes | [Handling runtime errors](https://github.com/nuxt/framework/discussions/559)
-Store | β | π§ | Yes | [Global store support](https://github.com/nuxt/framework/discussions/571)
-Static builds | β | π§ | | [Route Caching rules (Hybrid)](https://github.com/nuxt/framework/discussions/560)
-
-### Module Compatibility
-
-All Nuxt 2 modules should be forward compatible with Nuxt 3 as long as they migrate to bridge or if they are already following guidelines.
-
-All (upcoming) modules made with `@nuxt/kit` should be backward compatible with Nuxt 2 projects (even without bridge) as long as they are not depending on a Nuxt 3 / Bridge-only feature.
-
-### Plugin Compatibility
-
-Most Nuxt 2 plugins should be forward compatible with Nuxt 3 with a magical compat layer we inject.
-
-Nuxt 3 plugins are **not** backward compatible with Nuxt 2.
-
-### Vue Compatibility
-
-For plugins using composition API or components, it needs exclusive Vue 2 or Vue 3 support.
-
-By using [vue-demi](https://github.com/vueuse/vue-demi) they should be compatible with both Nuxt 2 and 3.
-
-## Module Migration
-
-When Nuxt 3 users add your module, a compatible module container layer from `@nuxt/kit` is **automatically injected**, so as long as your code is following the guidelines below, it should continue working as-is.
-
-### Test with `@nuxt/bridge`
-
-Migrating to `@nuxt/bridge` is the first and most important step for supporting Nuxt 3.
-
-If you have a fixture or example in your module, add `@nuxt/bridge` package to its config (see [example](/getting-started/bridge#update-nuxtconfig))
-
-### Migrate from CommonJS to ESM
-
-Nuxt 3 natively supports TypeScript and ECMAScript Modules. Please check [Native ES Modules](/concepts/esm) for more info and upgrading.
-
-### Ensure plugins default export
-
-If you inject a Nuxt plugin that does not have `export default` (such as global Vue plugins), ensure you add `export default () => { }` to the end of it.
-
-::code-group
-
-```js [Before]
-// ~/plugins/vuelidate.js
-import Vue from 'vue'
-import Vuelidate from 'vuelidate'
-
-Vue.use(Vuelidate)
-```
-
-```js [After]
-// ~/plugins/vuelidate.js
-import Vue from 'vue'
-import Vuelidate from 'vuelidate'
-
-Vue.use(Vuelidate)
-
-export default () => { }
-```
-
-::
-
-### Avoid runtime modules
-
-With Nuxt 3, Nuxt is now a build-time-only dependency, which means that modules shouldn't attempt to hook into the Nuxt runtime.
-
-Your module should work even if it's only added to [`buildModules`](/docs/directory-structure/nuxt.config#buildmodules) (instead of `modules`). For example:
-
-- Avoid updating `process.env` within a Nuxt module and reading by a nuxt plugin; use [`runtimeConfig`](/docs/directory-structure/nuxt.config#publicruntimeconfig) instead.
-- (*) Avoid depending on runtime hooks like `vue-renderer:*` for production
-- (*) Avoid adding `serverMiddleware` by importing them inside the module. Instead, add them by referencing a file path so that they are independent of the module's context
-
-(*) Unless it is for `nuxt dev` purpose only and guarded with `if (nuxt.options.dev) { }`.
-
-::alert{type=info icon=π}
-Continue reading about Nuxt 3 modules in the [Modules guide](/docs/advanced/modules).
-::
-
-### Use TypeScript (optional)
-
-While it is not essential, most of the Nuxt ecosystem is shifting to use TypeScript, so it is highly recommended to consider migration.
-
-::alert{icon=π‘}
-You can start migration by renaming `.js` files, to `.ts`. TypeScript is designed to be progressive!
-::
-
-::alert{icon=π‘}
-You can use TypeScript syntax for Nuxt 2 and 3 modules and plugins without any extra dependencies.
-::
diff --git a/docs/content/2.concepts/1.introduction.md b/docs/content/2.concepts/1.introduction.md
index a22c8ba0b6d..fb47ee6761a 100644
--- a/docs/content/2.concepts/1.introduction.md
+++ b/docs/content/2.concepts/1.introduction.md
@@ -8,7 +8,7 @@ To understand what is Nuxt, we need to understand what we need to create a moder
::list{type=success}
- A JavaScript framework to bring reactivity and web components, we chose [Vue.js](https://v3.vuejs.org).
-- A bundler to support hot module replacement in development and bundle your code for production, we support both [Webpack 5](https://webpack.js.org/) and [Vite](https://vitejs.dev/).
+- A bundler to support hot module replacement in development and bundle your code for production, we support both [webpack 5](https://webpack.js.org/) and [Vite](https://vitejs.dev/).
- A transpiler in order to write the latest JavaScript syntax while supporting legacy browsers, we use [esbuild](https://esbuild.github.io) for that.
- A server for serving your application in development, but also to support [server-side rendering](https://vuejs.org/api/ssr.html#server-side-rendering-api) or API routes, Nuxt uses [h3](https://github.com/unjs/h3) for deployment versatility such as serverless, workers, Node.js and unmatched performance.
- A routing library to handle client-side navigation, we chose [vue-router](https://router.vuejs.org/).
@@ -47,4 +47,4 @@ Ready to try? Head over the [Installation section](/getting-started/installation
### Are you *courageously* Nuxt?
-Take a stab at an open [issue](https://github.com/nuxt/framework/issues). This is actually the best way to learn Nuxt, by actually diving into the code. You may even bring an approach or alternative solution that makes Nuxt even better! So, what are you waiting for? Let's go!
+Take a stab at an open [issue](https://github.com/nuxt/framework/issues). This is actually the best way to learn Nuxt, by actually diving into the code. You may even bring an approach or alternative solution that makes Nuxt even better! So, what are you waiting for? Let's go!
diff --git a/docs/content/2.concepts/2.vuejs-development.md b/docs/content/2.concepts/2.vuejs-development.md
index 0880aa879b5..9f5b0857581 100644
--- a/docs/content/2.concepts/2.vuejs-development.md
+++ b/docs/content/2.concepts/2.vuejs-development.md
@@ -52,7 +52,7 @@ Nuxt 3 is based on Vue 3. The new Vue major version introduces several changes t
- Better performances
- Composition API
-- Typescript support
+- TypeScript support
### Faster rendering
@@ -100,13 +100,13 @@ Used with the `setup` keyword in the `
```
+## Refreshing Data
+
+Sometimes throughout the course of your user's page visit, you may need to refresh the data loaded from the API. This can happen if the user chooses to paginate, filter results, search, etc.
+
+You can make use of the `refresh()` method returned from the `useAsyncData()` composable to refresh the data with different query parameters:
+
+```vue
+
+```
+
+The key to making this work is to call the `refresh()` method returned from the `useFetch()` composable when a query parameter has changed.
+
+### `refreshNuxtData`
+
+Invalidate the cache of `useAsyncData`, `useLazyAsyncData`, `useFetch` and `useLazyFetch` and trigger the refetch.
+
+This method is useful if you want to refresh all the data fetching for a current page.
+
+### Usage
+
+```ts
+refreshNuxtData(keys?: string | string[])
+```
+
+Available options:
+
+* `keys`: Provides an array of keys that used in `useAsyncData` to refetch. When it's not specified, all `useAsyncData` and `useFetch` will be refetched.
+
+### Example
+
+```vue
+
+
+ {{ pending ? 'Loading' : count }}
+
+
+
+
+
+```
+
## Isomorphic fetch
When we call `fetch` in the browser, user headers like `cookie` will be directly sent to the API. But during server-side-rendering, since the `fetch` request takes place 'internally' within the server, it doesn't include the user's browser cookies, nor does it pass on cookies from the fetch response.
@@ -295,3 +356,14 @@ export default defineComponent({
```
+
+## Directly calling an API Endpoint
+
+There are instances where you may need to directly call the API. Nuxt 3 provides a globally available `$fetch` method using [unjs/ohmyfetch](https://github.com/unjs/ohmyfetch) (in addition to `fetch`)
+with the same API as the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
+
+Using `$fetch` has a number of benefits, including:
+
+It will handle 'smartly' making direct API calls if it's running on the server, or making a client-side call to your API if it's running on the client. (It can also handle calling third-party APIs.)
+
+Plus, it comes with convenience features including automatically parsing responses and stringifying data.
diff --git a/docs/content/3.docs/1.usage/10.teleports.md b/docs/content/3.docs/1.usage/10.teleports.md
new file mode 100644
index 00000000000..7860b9a9855
--- /dev/null
+++ b/docs/content/3.docs/1.usage/10.teleports.md
@@ -0,0 +1,34 @@
+# Teleports
+
+Vue 3 provides the [`` component](https://vuejs.org/guide/built-ins/teleport.html) which allows content to be rendered elsewhere in the DOM, outside of the Vue application.
+
+The `to` target of `` expects a CSS selector string or an actual DOM node. Nuxt currently has SSR support for teleports to `body` only, with client-side support for other targets using a `` wrapper.
+
+## Example: body teleport
+
+```vue
+
+
+
+
+
Hello from the modal!
+
+
+
+
+```
+
+## Example: client-side teleport
+
+```vue
+
+
+
+
+
+
+```
diff --git a/docs/content/3.docs/1.usage/8.cli.md b/docs/content/3.docs/1.usage/8.cli.md
index 9db5ad83d30..809a0a29e47 100644
--- a/docs/content/3.docs/1.usage/8.cli.md
+++ b/docs/content/3.docs/1.usage/8.cli.md
@@ -35,6 +35,8 @@ Option | Default | Description
`--ssl-cert` |`null` | Specify a certificate for https.
`--ssl-key` |`null` | Specify the key for the https certificate.
+The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.
+
This command sets `process.env.NODE_ENV` to `development`. To override, define `NODE_ENV` in a `.env` file or as command-line argument.
## Build
@@ -65,6 +67,10 @@ Option | Default | Description
This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a `.env` file or as command-line argument.
+::alert{type=info}
+For convenience, in preview mode, your `.env` file will be loaded into `process.env`. (However, in production you will need to ensure your environment variables are set yourself.)
+::
+
## Info
```{bash}
@@ -114,7 +120,7 @@ Option | Default | Description
`TEMPLATE` | - | Specify a template of the file to be generated.
`NAME` | - | Specify a name of the file that will be created.
`--cwd` | `.` | The directory of the target application.
-`--force` | `false` | Force override file if already exsits.
+`--force` | `false` | Force override file if it already exists.
**Example:**
diff --git a/docs/content/3.docs/2.directory-structure/10.pages.md b/docs/content/3.docs/2.directory-structure/10.pages.md
index e5395764a96..7baa9738071 100644
--- a/docs/content/3.docs/2.directory-structure/10.pages.md
+++ b/docs/content/3.docs/2.directory-structure/10.pages.md
@@ -274,10 +274,10 @@ It is possible to set default [vue-router options](https://router.vuejs.org/api/
This is the recommaned way to specify router options.
```js [app/router.options.ts]
-import type { RouterOptions } from '@nuxt/schema'
+import type { RouterConfig } from '@nuxt/schema'
// https://router.vuejs.org/api/#routeroptions
-export default {
+export default {
}
```
diff --git a/docs/content/3.docs/2.directory-structure/3.assets.md b/docs/content/3.docs/2.directory-structure/3.assets.md
index c2f7fefa02a..6c8ebd95530 100644
--- a/docs/content/3.docs/2.directory-structure/3.assets.md
+++ b/docs/content/3.docs/2.directory-structure/3.assets.md
@@ -6,7 +6,7 @@ head.title: Assets directory
# Assets directory
-The `assets/` directory is used to add all the website assets that the build tool (Webpack or Vite) will process.
+The `assets/` directory is used to add all the website assets that the build tool (webpack or Vite) will process.
The directory usually contains the following types of files:
diff --git a/docs/content/3.docs/3.migration/1.overview.md b/docs/content/3.docs/3.migration/1.overview.md
new file mode 100644
index 00000000000..a84e971ea0a
--- /dev/null
+++ b/docs/content/3.docs/3.migration/1.overview.md
@@ -0,0 +1,21 @@
+# Overview
+
+
+
+::alert{type=info}
+This migration guide is under progress to align with the development of Nuxt 3.
+::
+
+Nuxt 3 is a complete rewrite of Nuxt 2, and also based on a new set of underlying technologies. That means there will be significant changes when migrating a Nuxt 2 app to Nuxt 3, although you can expect migration to become more straightforward as we move toward a stable release.
+
+Some of these significant changes include:
+
+1. Moving from Vue 2 to Vue 3, including defaulting to the composition API and script setup.
+1. Moving from webpack 4 and Babel to Vite or webpack 5 and esbuild.
+1. Moving from a runtime Nuxt dependency to a minimal, standalone server compiled with nitropack.
+
+::alert{type=info}
+If you need to remain on Nuxt 2, but want to benefit from Nuxt 3 features in Nuxt 2, you can alternatively check out [how to get started with Bridge](/getting-started/bridge).
+::
diff --git a/docs/content/3.docs/3.migration/10.bundling.md b/docs/content/3.docs/3.migration/10.bundling.md
new file mode 100644
index 00000000000..b5eca20693d
--- /dev/null
+++ b/docs/content/3.docs/3.migration/10.bundling.md
@@ -0,0 +1,23 @@
+# Build Tooling
+
+We use the following build tools by default:
+
+- [Vite](https://vitejs.dev/) or [webpack](https://webpack.js.org/)
+- [Rollup](https://rollupjs.org/)
+- [PostCSS](https://postcss.org/)
+- [esbuild](https://esbuild.github.io/)
+
+For this reason, most of your previous `build` configuration in `nuxt.config` will now be ignored, including any custom babel configuration.
+
+If you need to configure any of Nuxt's build tools, you can do so in your `nuxt.config`, using the new top-level `vite`, `webpack` and `postcss` keys.
+
+In addition, Nuxt ships with TypeScript support. [Find out more](/docs/concepts/typescript).
+
+## Steps
+
+1. Remove `@nuxt/typescript-build` and `@nuxt/typescript-runtime` from your dependencies and modules.
+1. Remove any unused babel dependencies from your project.
+1. Remove any explicit core-js dependencies.
+1. Migrate `require` to `import`.
+
+
diff --git a/docs/content/3.docs/3.migration/11.server.md b/docs/content/3.docs/3.migration/11.server.md
new file mode 100644
index 00000000000..107e630a214
--- /dev/null
+++ b/docs/content/3.docs/3.migration/11.server.md
@@ -0,0 +1,12 @@
+# Server
+
+In a built Nuxt 3 application, there is no runtime Nuxt dependency. That means your site will be highly performant, and ultra-slim. But it also means you can no longer hook into runtime Nuxt server hooks.
+
+[Read more about the Nitro server engine](/concepts/server-engine).
+
+## Steps
+
+1. Remove the `render` key in your `nuxt.config`.
+1. Any files in `~/server/api` and `~/server/middleware` will be automatically registered; you can remove them from your `serverMiddleware` array.
+1. Update any other items in your `serverMiddleware` array to point to files or npm packages directly, rather than using inline functions.
+1. If you are adding any server hooks, such as `server:` or `vue-renderer:` you will need to remove these and wait for [nitropack](https://github.com/unjs/nitropack) support for runtime hooks and plugins.
diff --git a/docs/content/3.docs/3.migration/2.configuration.md b/docs/content/3.docs/3.migration/2.configuration.md
new file mode 100644
index 00000000000..f534e8a72be
--- /dev/null
+++ b/docs/content/3.docs/3.migration/2.configuration.md
@@ -0,0 +1,127 @@
+---
+title: Configuration
+---
+# Project Configuration
+
+## `nuxt.config`
+
+The starting point for your Nuxt app remains your `nuxt.config` file.
+
+::alert{icon=π¦}
+Nuxt configuration will be loaded using [`unjs/jiti`](https://github.com/unjs/jiti) and [`unjs/c12`](https://github.com/unjs/c12).
+::
+
+### Migration
+
+1. You should migrate to the new `defineNuxtConfig` function that provides a typed configuration schema.
+
+ ::code-group
+
+ ```ts [Nuxt 2]
+ export default {
+ // ...
+ }
+ ```
+
+ ```ts [Nuxt 3]
+ import { defineNuxtConfig } from 'nuxt3'
+
+ export default defineNuxtConfig({
+ // ...
+ })
+ ```
+
+ ::
+
+1. If you were using `router.extendRoutes` you can migrate to the new `pages:extend` hook:
+
+ ::code-group
+
+ ```ts [Nuxt 2]
+ export default {
+ router: {
+ extendRoutes (routes) {
+ //
+ }
+ }
+ }
+ ```
+
+ ```ts [Nuxt 3]
+ import { defineNuxtConfig } from 'nuxt3'
+
+ export default defineNuxtConfig({
+ hooks: {
+ 'pages:extend' (routes) {
+ //
+ }
+ }
+ })
+ ```
+
+ ::
+
+#### ESM Syntax
+
+Nuxt 3 is an [ESM native framework](/concepts/esm). Although [`unjs/jiti`](https://github.com/unjs/jiti) provides semi compatibility when loading `nuxt.config` file, avoid any usage of `require` and `module.exports` in this file.
+
+1. Change `module.exports` to `export default`
+1. Change `const lib = require('lib')` to `import lib from 'lib'`
+
+#### Async Configuration
+
+In order to make Nuxt loading behavior more predictable, async config syntax is deprecated. Consider using Nuxt hooks for async operations.
+
+#### Dotenv
+
+Nuxt has built-in support for loading `.env` files. Avoid directly importing it from `nuxt.config`.
+
+## Modules
+
+Nuxt and Nuxt Modules are now build-time-only.
+
+### Migration
+
+1. Move all your `buildModules` into `modules`.
+2. Check for Nuxt 3 compatibility of modules.
+
+::alert
+If you are a module author, you can check out [more information about module compatibility](/docs/migration/module-authors) and [our module author guide](/docs/advanced/modules).
+::
+
+## TypeScript
+
+It will be much easier to migrate your application if you use Nuxt's TypeScript integration. This does not mean you need to write your application in TypeScript, just that Nuxt will provide automatic type hints for your editor.
+
+You can read more about Nuxt's TypeScript support [in the docs](/docs/concepts/typescript).
+
+::alert{icon=π¦}
+Nuxt can type-check your app using [`vue-tsc`](https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc) with `nuxi typecheck` command.
+::
+
+### Migration
+
+1. Create a `tsconfig.json` with the following content:
+
+ ```json
+ {
+ "extends": "./.nuxt/tsconfig.json"
+ }
+ ```
+
+1. Run `npx nuxi prepare` to generate `.nuxt/tsconfig.json`.
+1. Install Volar following the instructions in the [docs](/docs/getting-started/introduction).
+
+## Vue changes
+
+There are a number of changes to what is recommended Vue best practice, as well as a number of breaking changes between Vue 2 and 3.
+
+It is recommended to read the [Vue 3 migration guide](https://v3-migration.vuejs.org/) and in particular the [breaking changes list](https://v3-migration.vuejs.org/breaking-changes/).
+
+It is not currently possible to use the Vue 3 migration build with Nuxt 3 RC.
+
+## Vuex
+
+Nuxt no longer provides a Vuex integration. Instead, the official Vue recommendation is to use `pinia`, which has built-in Nuxt support via a Nuxt module. [Find out more about pinia here](https://pinia.vuejs.org/).
+
+If you want to keep using Vuex, you can manually migrate to Vuex 4 following [these steps](https://vuex.vuejs.org/guide/migrating-to-4-0-from-3-x.html).
diff --git a/docs/content/3.docs/3.migration/20.module-authors.md b/docs/content/3.docs/3.migration/20.module-authors.md
new file mode 100644
index 00000000000..1808620fc68
--- /dev/null
+++ b/docs/content/3.docs/3.migration/20.module-authors.md
@@ -0,0 +1,89 @@
+# Modules
+
+## Module Compatibility
+
+Nuxt 3 has a basic backward compatibility layer for Nuxt 2 modules using `@nuxt/kit` auto wrappers. But there are usually steps to follow to make modules compatible with Nuxt 3 and sometimes, using Nuxt Bridge is required for cross-version compatibility.
+
+We have prepared a [Dedicated Guide](/docs/advanced/modules) for authoring Nuxt 3 ready modules using `@nuxt/kit`. Currently best migration path is to follow it and rewrite your modules. Rest of this guide includes preparation steps if you prefer to avoid a full rewrite yet making modules compatibile with Nuxt 3.
+
+::alert
+You can check for a list of Nuxt 3 ready modules from [Nuxt Modules](https://modules.nuxtjs.org/?version=3.x).
+::
+
+### Plugin Compatibility
+
+Nuxt 3 plugins are **not** fully backward compatible with Nuxt 2.
+
+### Vue Compatibility
+
+Plugins or components using the composition API need exclusive Vue 2 or Vue 3 support.
+
+By using [vue-demi](https://github.com/vueuse/vue-demi) they should be compatible with both Nuxt 2 and 3.
+
+## Module Migration
+
+When Nuxt 3 users add your module, a compatible module container layer from `@nuxt/kit` is **automatically injected**, so as long as your code is following the guidelines below, it should continue working as-is.
+
+### Test with `@nuxt/bridge`
+
+Migrating to `@nuxt/bridge` is the first and most important step for supporting Nuxt 3.
+
+If you have a fixture or example in your module, add `@nuxt/bridge` package to its config (see [example](/getting-started/bridge#update-nuxtconfig))
+
+### Migrate from CommonJS to ESM
+
+Nuxt 3 natively supports TypeScript and ECMAScript Modules. Please check [Native ES Modules](/concepts/esm) for more info and upgrading.
+
+### Ensure plugins default export
+
+If you inject a Nuxt plugin that does not have `export default` (such as global Vue plugins), ensure you add `export default () => { }` to the end of it.
+
+::code-group
+
+```js [Before]
+// ~/plugins/vuelidate.js
+import Vue from 'vue'
+import Vuelidate from 'vuelidate'
+
+Vue.use(Vuelidate)
+```
+
+```js [After]
+// ~/plugins/vuelidate.js
+import Vue from 'vue'
+import Vuelidate from 'vuelidate'
+
+Vue.use(Vuelidate)
+
+export default () => { }
+```
+
+::
+
+### Avoid runtime modules
+
+With Nuxt 3, Nuxt is now a build-time-only dependency, which means that modules shouldn't attempt to hook into the Nuxt runtime.
+
+Your module should work even if it's only added to [`buildModules`](/docs/directory-structure/nuxt.config#buildmodules) (instead of `modules`). For example:
+
+- Avoid updating `process.env` within a Nuxt module and reading by a nuxt plugin; use [`runtimeConfig`](/docs/directory-structure/nuxt.config#publicruntimeconfig) instead.
+- (*) Avoid depending on runtime hooks like `vue-renderer:*` for production
+- (*) Avoid adding `serverMiddleware` by importing them inside the module. Instead, add them by referencing a file path so that they are independent of the module's context
+
+(*) Unless it is for `nuxt dev` purpose only and guarded with `if (nuxt.options.dev) { }`.
+
+::alert{type=info icon=π}
+Continue reading about Nuxt 3 modules in the [Modules guide](/docs/advanced/modules).
+::
+
+### Use TypeScript (optional)
+
+While it is not essential, most of the Nuxt ecosystem is shifting to use TypeScript, so it is highly recommended to consider migration.
+
+::alert{icon=π‘}
+You can start migration by renaming `.js` files, to `.ts`. TypeScript is designed to be progressive!
+::
+
+::alert{icon=π‘}
+You can use TypeScript syntax for Nuxt 2 and 3 modules and plugins without any extra dependencies.
+::
diff --git a/docs/content/3.docs/3.migration/3.auto-imports.md b/docs/content/3.docs/3.migration/3.auto-imports.md
new file mode 100644
index 00000000000..62714d208c3
--- /dev/null
+++ b/docs/content/3.docs/3.migration/3.auto-imports.md
@@ -0,0 +1,17 @@
+# Auto Imports
+
+Nuxt 3 adopts a minimal friction approach, meaning wherever possible components and composables are auto-imported.
+
+::alert{type=info}
+In the rest of the migration documentation, you will notice that key Nuxt and Vue utilities do not have explicit imports. This is not a typo; Nuxt will automatically import them for you, and you should get full type hinting if you have followed [the instructions](/docs/migration/configuration#typescript) to use Nuxt's TypeScript support.
+::
+
+[Read more about auto imports](/concepts/auto-imports)
+
+## Migration
+
+1. If you have been using `@nuxt/components` in Nuxt 2, you can remove `components: true` in your `nuxt.config`. If you had a more complex setup, then note that the component options have changed somewhat. See the [components documentation](/docs/directory-structure/components) for more information.
+
+::alert{type=info}
+You can look at `.nuxt/types/components.d.ts` and `.nuxt/types/auto-imports.d.ts` to see how Nuxt has resolved your components and composable auto-imports.
+::
diff --git a/docs/content/3.docs/3.migration/4.meta.md b/docs/content/3.docs/3.migration/4.meta.md
new file mode 100644
index 00000000000..5aeb4dcf929
--- /dev/null
+++ b/docs/content/3.docs/3.migration/4.meta.md
@@ -0,0 +1,106 @@
+# Meta Tags
+
+Nuxt 3 provides several different ways to manage your meta tags.
+
+1. Through your `nuxt.config`.
+1. Through the `useMeta` [composable](/docs/usage/meta-tags#usemeta-composable)
+1. Through [global meta components](/docs/usage/meta-tags#meta-components)
+
+You can customize `title`, `base`, `script`, `style`, `meta`, `link`, `htmlAttrs` and `bodyAttrs`.
+
+::alert{icon=π¦}
+Nuxt currently uses [`vueuse/head`](https://github.com/vueuse/head) to manage your meta tags, but implementation details may change.
+::
+
+[Read more about meta tags](/docs/usage/meta-tags).
+
+## Migration
+
+1. In your `nuxt.config`, rename `head` to `meta`. Consider moving this shared meta configuration into your `app.vue` instead. (Note that objects no longer have a `hid` key for deduplication.)
+1. In your components, rename your `head` option to `meta`. If you need to access the component state, you should migrate to using `useMeta`. You might also consider using the built-in meta-components.
+
+### Example: `useMeta`
+
+::code-group
+
+```vue [Nuxt 2]
+
+```
+
+```vue [Nuxt 3]
+
+```
+
+::
+
+### Example: built-in meta-components
+
+Nuxt 3 also provides meta components that you can use to accomplish the same task. While these components look similar to HTML tags, they are provided by Nuxt and have similar functionality.
+
+::code-group
+
+```vue [Nuxt 2]
+
+```
+
+```vue [Nuxt 3]
+
+
+
+ My App
+
+
+
+
+
+```
+
+::
+
+::alert{icon=π}
+
+1. Make sure you use capital letters for these component names to distinguish them from native HTML elements (`` rather than ``).
+1. You can place these components anywhere in your template for your page.
+::
diff --git a/docs/content/3.docs/3.migration/5.plugins-and-middleware.md b/docs/content/3.docs/3.migration/5.plugins-and-middleware.md
new file mode 100644
index 00000000000..e848a16af77
--- /dev/null
+++ b/docs/content/3.docs/3.migration/5.plugins-and-middleware.md
@@ -0,0 +1,73 @@
+# Plugins and Middleware
+
+## Plugins
+
+Plugins now have a different format, and take only one argument (`nuxtApp`). Read more in [the docs](/docs/directory-structure/plugins).
+
+::code-group
+
+```js [Nuxt 2]
+export default (ctx, inject) => {
+ inject('injected', () => 'my injected function')
+})
+```
+
+```ts [Nuxt 3]
+export default defineNuxtPlugin(nuxtApp => {
+ // now available on `nuxtApp.$injected`
+ nuxtApp.provide('injected', () => 'my injected function')
+
+ // You can alternatively use this format, which comes with automatic type support
+ return {
+ provide: {
+ injected: () => 'my injected function'
+ }
+ }
+})
+```
+
+::
+
+::alert{icon=π}
+You can read more about the format of `nuxtApp` in [the docs](/docs/usage/nuxt-app).
+::
+
+### Migration
+
+1. Migrate your plugins to use the `defineNuxtPlugin` helper function.
+1. Remove any entries in your `nuxt.config` plugins array that are located in your `plugins/` folder. All files in this directory at the top level (and any index files in any subdirectories) will be automatically registered. Instead of setting `mode` to `client` or `server`, you can indicate this in the file name. For example, `~/plugins/my-plugin.client.ts` will only be loaded on client-side.
+
+## Route middleware
+
+Route middleware has a different format.
+
+::code-group
+
+```js [Nuxt 2]
+export default function ({ store, redirect }) {
+ // If the user is not authenticated
+ if (!store.state.authenticated) {
+ return redirect('/login')
+ }
+}
+```
+
+```ts [Nuxt 3]
+export default defineNuxtRouteMiddleware((to, from) => {
+ const auth = useState('auth')
+ if (!auth.value.authenticated) {
+ return navigateTo('/login')
+ }
+})
+```
+
+::
+
+Much like Nuxt 2, route middleware placed in your `~/middleware` folder is automatically registered. You can then specify it by name in a component. However, this is done with `definePageMeta` rather than as a component option.
+
+`navigateTo` is one of a number of route helper functions, which you can read more about in [the documentation about route middleware](/docs/directory-structure/middleware).
+
+### Migration
+
+1. Migrate your route middleware to use the `defineNuxtRouteMiddleware` helper function.
+1. Any global middleware (such as in your `nuxt.config`) can be placed in your `~/middleware` folder with a `.global` extension, for example `~/middleware/auth.global.ts`.
diff --git a/docs/content/3.docs/3.migration/6.pages-and-layouts.md b/docs/content/3.docs/3.migration/6.pages-and-layouts.md
new file mode 100644
index 00000000000..aee31e2160c
--- /dev/null
+++ b/docs/content/3.docs/3.migration/6.pages-and-layouts.md
@@ -0,0 +1,174 @@
+# Pages and Layouts
+
+## `app.vue`
+
+Nuxt 3 provides a central entrypoint to your app via `~/app.vue`. If you don't have an `app.vue` file in your source directory, Nuxt will use its own default version.
+
+This file is a great place to put any custom code that needs to be run once when your app starts up, as well as any components that are present on every page of your app. For example, if you only have one layout, you can move this to `app.vue` instead.
+
+[Read more about `app.vue`](/docs/directory-structure/app).
+
+### Migration
+
+1. Consider creating an `app.vue` file and including any logic that needs to run once at the top-level of your app. You can check out [an example here](/docs/directory-structure/app).
+
+## Layouts
+
+If you are using layouts in your app for multiple pages, there is only a slight change required.
+
+In Nuxt 2, the `` component is used within a layout to render the current page. In Nuxt 3, layouts use slots instead, so you will have to replace that component with a ``. This also allows advanced use cases with named and scoped slots. [Read more about layouts](/docs/directory-structure/layouts).
+
+You will also need to change how you define the layout used by a page using the `definePageMeta` compiler macro. Layouts will be kebab-cased. So `layouts/customLayout.vue` becomes `custom-layout` when referenced in your page.
+
+### Migration
+
+1. Replace `` with ``
+1. Use `definePageMeta` to select the layout used by your page.
+1. Move `~/layouts/_error.vue` to `~/error.vue`. See [the error handling docs](/docs/usage/error-handling).
+
+### Example: `~/layouts/custom.vue`
+
+::code-group
+
+```diff [layouts/custom.vue]
+
+
+
+-
++
+
+
+
+```
+
+```diff [pages/index.vue]
+
+```
+
+::
+
+## Pages
+
+Nuxt 3 ships with an optional `vue-router` integration triggered by the existence of a `pages/` directory in your source directory. If you only have a single page, you may consider instead moving it to `app.vue` for a lighter build.
+
+### Dynamic routes
+
+The format for defining dynamic routes in Nuxt 3 is slightly different from Nuxt 2, so you may need to rename some of the files within `pages/`.
+
+1. Where you previously used `_id` to define a dynamic route parameter you now use `[id]`.
+1. Where you previously used `_.vue` to define a catch-all route, you now use `[...slug].vue`.
+
+### Nested routes
+
+In Nuxt 2, you will have defined any nested routes (with parent and child components) using `` and ``. In Nuxt 3, these have been replaced with a single `` component.
+
+### Page keys and keep-alive props
+
+If you were passing a custom page key or keep-alive props to ``, you will now use `definePageMeta` to set these options.
+
+See [more about migrating Nuxt component hooks](/docs/migration/nuxt-hooks).
+
+### Page and layout transitions
+
+If you have been defining transitions for your page or layout directly in your component options, you will now need to use `definePageMeta` to set the transition.
+
+[Read more about `pages/`](/docs/directory-structure/pages).
+
+### Migration
+
+1. Rename any pages with dynamic parameters to match the new format.
+1. Update `` and `` to be ``.
+1. If you're using the Composition API, you can also migrate `this.$route` and `this.$router` to use `useRoute` and `useRouter` composables.
+
+#### Example: Dynamic Routes
+
+::code-group
+
+``` [Nuxt 2]
+- URL: /users
+- Page: /pages/users/index.vue
+
+- URL: /users/some-user-name
+- Page: /pages/users/_user.vue
+- Usage: params.user
+
+- URL: /users/some-user-name/edit
+- Page: /pages/users/_user/edit.vue
+- Usage: params.user
+
+- URL: /users/anything-else
+- Page: /pages/users/_.vue
+- Usage: params.pathMatch
+```
+
+``` [Nuxt 3]
+- URL: /users
+- Page: /pages/users/index.vue
+
+- URL: /users/some-user-name
+- Page: /pages/users/[user].vue
+- Usage: params.user
+
+- URL: /users/some-user-name/edit
+- Page: /pages/users/[user]/edit.vue
+- Usage: params.user
+
+- URL: /users/anything-else
+- Page: /pages/users/[...slug].vue
+- Usage: params.slug
+```
+
+::
+
+#### Example: Nested routes and `definePageMeta`
+
+::code-group
+
+```vue [Nuxt 2]
+
+
+
+
+
+
+
+```
+
+```vue [Nuxt 3]
+
+
+
+
+
+
+
+```
+
+::
+
+## NuxtLink component
+
+Most of the syntax and functionality are the same for the global [NuxtLink](/docs/usage/nuxt-link#nuxtlink) component. If you have been using the shortcut `` format, you should update this to use ``.
+
+`` is now a drop-in replacement for _all_ links, even external ones. You can read more about it, and how to extend it to provide your own link component, [in the docs](/docs/usage/nuxt-link#nuxtlink).
diff --git a/docs/content/3.docs/3.migration/7.component-options.md b/docs/content/3.docs/3.migration/7.component-options.md
new file mode 100644
index 00000000000..698fe020654
--- /dev/null
+++ b/docs/content/3.docs/3.migration/7.component-options.md
@@ -0,0 +1,148 @@
+# Component Options
+
+## `asyncData` and `fetch` component options
+
+Nuxt 3 provides new options for [fetching data from an API](/docs/usage/data-fetching).
+
+
+
+
+### Isomorphic fetch
+
+In Nuxt 2 you might use `@nuxtjs/axios` or `@nuxt/http` to fetch your data - or just the polyfilled global `fetch`.
+
+In Nuxt 3 you can use a globally available `fetch` method that has the same API as [the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) or `$fetch` method which is using [unjs/ohmyfetch](https://github.com/unjs/ohmyfetch). It has a number of benefits, including:
+
+1. It will handle 'smartly' making [direct API calls](/concepts/server-engine#direct-api-calls) if it's running on the server, or making a client-side call to your API if it's running on the client. (It can also handle calling third-party APIs.)
+
+2. Plus, it comes with convenience features including automatically parsing responses and stringifying data.
+
+You can read more [about direct API calls](/concepts/server-engine#direct-api-calls) or [fetching data](/docs/usage/data-fetching).
+
+### Using composables
+
+Nuxt 3 provides new composables for fetching data: `useAsyncData` and `useFetch`. They each have 'lazy' variants (`useLazyAsyncData` and `useLazyFetch`), which do not block client-side navigation.
+
+In Nuxt 2, you'd fetch your data in your component using a syntax similar to:
+
+```ts
+export default {
+ async asyncData({ params, $http }) {
+ const post = await $http.$get(`https://api.nuxtjs.dev/posts/${params.id}`)
+ return { post }
+ },
+ // or alternatively
+ fetch () {
+ this.post = await $http.$get(`https://api.nuxtjs.dev/posts/${params.id}`)
+ }
+}
+```
+
+Within your methods and templates, you could use the `post` variable similar how you'd use any other piece of data provided by your component.
+
+With Nuxt 3, you can perform this data fetching using composables in your `setup()` method or `
+```
+
+You can now use `post` inside of your Nuxt 3 template, or call `refresh` to update the data.
+
+::alert{type=info}
+Despite the names, `useFetch` is not a direct replacement of the `fetch()` hook. Rather, `useAsyncData` replaces both hooks and is most customizable; it can do more than simply fetching data from an endpoint. `useFetch` is a convenience wrapper around `useAsyncData` for simply fetching data from an endpoint.
+::
+
+### Migration
+
+1. Replace the `asyncData` hook with `useAsyncData` or `useFetch` in your page/component.
+1. Replace the `fetch` hook with `useAsyncData` or `useFetch` in your component.
+
+## `head`
+
+See [meta tag migration](/docs/migration/meta).
+
+## `key`
+
+You can now define a key within the `definePageMeta` compiler macro.
+
+```diff [pages/index.vue]
+-
+```
+
+### Migration
+
+1. Migrate `key` from component options to `definePageMeta`.
+
+## `layout`
+
+See [layout migration](/docs/migration/pages-and-layouts).
+
+## `loading`
+
+This feature is not yet supported in Nuxt 3.
+
+## `middleware`
+
+See [middleware migration](/docs/migration/plugins-and-middleware).
+
+## `scrollToTop`
+
+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 `~/app/router.options.ts` (see [docs](/docs/directory-structure/pages/#router-options)) for more info.
+
+## `transition`
+
+See [layout migration](/docs/migration/pages-and-layouts).
+
+## `validate`
+
+There is no longer a validate hook in Nuxt 3. Instead, you can create a custom middleware function, or directly throw an error in the setup function of the page.
+
+```diff [pages/users/[id].vue]
+-
+```
+
+## `watchQuery`
+
+This is not supported in Nuxt 3. Instead, you can directly use a watcher to trigger refetching data.
+
+```vue [pages/users/[id].vue]
+
+```
diff --git a/docs/content/3.docs/3.migration/8.runtime-config.md b/docs/content/3.docs/3.migration/8.runtime-config.md
new file mode 100644
index 00000000000..17999ff85ec
--- /dev/null
+++ b/docs/content/3.docs/3.migration/8.runtime-config.md
@@ -0,0 +1,49 @@
+# Runtime Config
+
+If you wish to reference environment variables within your Nuxt 3 app, you will need to use runtime config.
+
+When referencing these variables within your components, you will have to use the `useRuntimeConfig` composable in your setup method (or Nuxt plugin). In the Nitro portion of your app, you can import directly from `#config`.
+
+[Read more about runtime config](/docs/usage/runtime-config).
+
+## Migration
+
+1. Add any environment variables you use in your app to your `publicRuntimeConfig` or `privateRuntimeConfig`.
+1. Migrate `process.env` to `useRuntimeConfig` throughout the Vue part of your app.
+
+## Example
+
+::code-group
+
+```ts [nuxt.config.ts]
+import { defineNuxtConfig } from 'nuxt3'
+
+export default defineNuxtConfig({
+ publicRuntimeConfig: {
+ BASE_URL: process.env.BASE_URL || 'https://nuxtjs.org'
+ },
+ privateRuntimeConfig: {
+ // variables that can only be accessed on server-side
+ },
+})
+```
+
+```vue [pages/index.vue]
+
+```
+
+```ts [server/api/hello.ts]
+import config from '#config';
+
+export default (req, res) => {
+ // you can now access config.BASE_URL
+ return {
+ baseURL: config.BASE_URL
+ }
+}
+```
+
+::
diff --git a/docs/content/3.docs/3.migration/index.md b/docs/content/3.docs/3.migration/index.md
new file mode 100644
index 00000000000..5fb80179f5a
--- /dev/null
+++ b/docs/content/3.docs/3.migration/index.md
@@ -0,0 +1,6 @@
+---
+navigation.collapse: true
+layout.aside: true
+layout.asideClass: ''
+navigation.redirect: /docs/migration/overview
+---
diff --git a/docs/content/3.docs/4.advanced/5.testing.md b/docs/content/3.docs/4.advanced/5.testing.md
new file mode 100644
index 00000000000..8f7dcbf2078
--- /dev/null
+++ b/docs/content/3.docs/4.advanced/5.testing.md
@@ -0,0 +1,190 @@
+# Testing
+
+::alert{icon=π}
+Test utils are still in development and the API and behavior may change. Currently it's for module authors to preview but not yet ready for testing production apps.
+::
+
+In Nuxt 3, we have a rewritten version of `@nuxt/test-utils` available as `@nuxt/test-utils-edge`. We support [Vitest](https://github.com/vitest-dev/vitest) and [Jest](https://jestjs.io/) as the test runner.
+
+## Installation
+
+```bash
+yarn add --dev @nuxt/test-utils-edge vitest
+```
+
+## Setup
+
+In each describe block where you are taking advantage of the `@nuxt/test-utils` helper methods, you will need to set up the test context before beginning.
+
+```ts
+import { describe, test } from 'vitest'
+import { setup, $fetch } from '@nuxt/test-utils-edge'
+
+describe('My test', () => {
+ await setup({
+ // test context options
+ })
+
+ test('my test', () => {
+ // ...
+ })
+})
+```
+
+Behind the scenes, `setup` performs a number of tasks in `beforeAll`, `beforeEach`, `afterEach` and `afterAll` to setup the Nuxt test environment correctly.
+
+## Options
+
+### Nuxt configuration
+
+#### rootDir
+
+Path to a directory with a Nuxt app to be put under test.
+
+* Type: `string`
+* Default: `'.'`
+
+#### configFile
+
+Name of the configuration file.
+
+* Type: `string`
+* Default: `'nuxt.config'
+
+
+
+### Setup timings
+
+#### setupTimeout
+
+The amount of time (in milliseconds) to allow for `setupTest` to complete its work (which could include building or generating files for a Nuxt application, depending on the options that are passed).
+
+* Type: `number`
+* Default: `60000`
+
+### Features to enable
+
+#### server
+
+Whether to launch a server to respond to requests in the test suite.
+
+* Type: `boolean`
+* Default: `true`
+
+#### build
+
+Whether to run a separate build step.
+
+* Type: `boolean`
+* Default: `true` (`false` if `browser` or `server` is disabled)
+
+#### browser
+
+Under the hood, Nuxt test utils uses [`playwright`](https://playwright.dev/) to carry out browser testing. If this option is set, a browser will be launched and can be controlled in the subsequent test suite. (More info can be found [here](/api-reference/browser-testing).)
+
+* Type: `boolean`
+* Default: `false`
+
+#### browserOptions
+
+* Type: `object` with the following properties
+ * **type**: The type of browser to launch - either `chromium`, `firefox` or `webkit`
+ * **launch**: `object` of options that will be passed to playwright when launching the browser. See [full API reference](https://playwright.dev/#version=master&path=docs%2Fapi.md&q=browsertypelaunchoptions).
+
+#### runner
+
+Specify the runner for the test suite. Currently [Vitest](https://vitest.dev/) is recommend.
+
+* Type: `'vitest' | 'jest'`
+* Default: `'vitest'`
+
+## APIs
+
+### APIs for rendering testing
+
+#### $fetch(url)
+
+Get the HTML of a server-rendered page.
+
+```ts
+import { $fetch } from '@nuxt/test-utils'
+
+const html = await $fetch('/')
+```
+
+#### fetch(url)
+
+Get the response of a server-rendered page.
+
+```ts
+import { fetch } from '@nuxt/test-utils'
+
+const res = await fetch('/')
+const { body, headers } = res
+```
+
+#### url(path)
+
+Get the full URL for a given page (including the port the test server is running on.)
+
+```ts
+import { url } from '@nuxt/test-utils'
+
+const pageUrl = url('/page')
+// 'http://localhost:6840/page'
+```
+
+## Testing Modules
+
+### Fixture Setup
+
+To test the modules we create, we could setup some Nuxt apps as fixtures and test their behaviors. For example, we can create a simple Nuxt app under `./test/fixture` with the configuration like:
+
+```ts
+// nuxt.config.js
+import { defineNuxtConfig } from 'nuxt3'
+import MyModule from '../../src'
+
+export default defineNuxtConfig({
+ modules: [
+ MyModule
+ ]
+})
+```
+
+### Tests Setup
+
+We can create a test file and use the `rootDir` to test the fixture.
+
+```ts
+// basic.test.js
+import { describe, it } from 'vitest'
+import { setup, $fetch } from '@nuxt/test-utils-edge'
+
+describe('ssr', async () => {
+ await setup({
+ rootDir: fileURLToPath(new URL('./fixture', import.meta.url)),
+ })
+
+ it('renders the index page', async () => {
+ // Get response to a server-rendered page with `$fetch`.
+ const html = await $fetch('/')
+
+ expect(html).toContain('A Link')
+ })
+})
+```
+
+For more usage, please reference to our [tests for Nuxt 3 framework](https://github.com/nuxt/framework/blob/main/test/basic.test.ts).
+
+## Testing in a browser
+
+::alert{icon=π§}
+We are working on it, stay tuned!
+::
diff --git a/docs/content/3.docs/3.deployment/1.azure.md b/docs/content/3.docs/8.deployment/1.azure.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/1.azure.md
rename to docs/content/3.docs/8.deployment/1.azure.md
diff --git a/docs/content/3.docs/3.deployment/2.cloudflare.md b/docs/content/3.docs/8.deployment/2.cloudflare.md
similarity index 98%
rename from docs/content/3.docs/3.deployment/2.cloudflare.md
rename to docs/content/3.docs/8.deployment/2.cloudflare.md
index 65f329f4d45..c2f36acdec1 100644
--- a/docs/content/3.docs/3.deployment/2.cloudflare.md
+++ b/docs/content/3.docs/8.deployment/2.cloudflare.md
@@ -72,7 +72,7 @@ Publish:
wrangler publish
```
-## Deploy within CI/CD using Github Actions
+## Deploy within CI/CD using GitHub Actions
Create a token according to [the wrangler action docs](https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler#authentication) and set `CF_API_TOKEN` in your repository config on GitHub.
diff --git a/docs/content/3.docs/3.deployment/3.firebase.md b/docs/content/3.docs/8.deployment/3.firebase.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/3.firebase.md
rename to docs/content/3.docs/8.deployment/3.firebase.md
diff --git a/docs/content/3.docs/3.deployment/4.netlify.md b/docs/content/3.docs/8.deployment/4.netlify.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/4.netlify.md
rename to docs/content/3.docs/8.deployment/4.netlify.md
diff --git a/docs/content/3.docs/3.deployment/5.pm2.md b/docs/content/3.docs/8.deployment/5.pm2.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/5.pm2.md
rename to docs/content/3.docs/8.deployment/5.pm2.md
diff --git a/docs/content/3.docs/3.deployment/6.vercel.md b/docs/content/3.docs/8.deployment/6.vercel.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/6.vercel.md
rename to docs/content/3.docs/8.deployment/6.vercel.md
diff --git a/docs/content/3.docs/3.deployment/99.presets.md b/docs/content/3.docs/8.deployment/99.presets.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets.md
rename to docs/content/3.docs/8.deployment/99.presets.md
diff --git a/docs/content/3.docs/3.deployment/99.presets/custom.md b/docs/content/3.docs/8.deployment/99.presets/custom.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets/custom.md
rename to docs/content/3.docs/8.deployment/99.presets/custom.md
diff --git a/docs/content/3.docs/3.deployment/99.presets/lambda.md b/docs/content/3.docs/8.deployment/99.presets/lambda.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets/lambda.md
rename to docs/content/3.docs/8.deployment/99.presets/lambda.md
diff --git a/docs/content/3.docs/3.deployment/99.presets/node.md b/docs/content/3.docs/8.deployment/99.presets/node.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets/node.md
rename to docs/content/3.docs/8.deployment/99.presets/node.md
diff --git a/docs/content/3.docs/3.deployment/99.presets/server.md b/docs/content/3.docs/8.deployment/99.presets/server.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets/server.md
rename to docs/content/3.docs/8.deployment/99.presets/server.md
diff --git a/docs/content/3.docs/3.deployment/99.presets/service-worker.md b/docs/content/3.docs/8.deployment/99.presets/service-worker.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/99.presets/service-worker.md
rename to docs/content/3.docs/8.deployment/99.presets/service-worker.md
diff --git a/docs/content/3.docs/3.deployment/index.md b/docs/content/3.docs/8.deployment/index.md
similarity index 100%
rename from docs/content/3.docs/3.deployment/index.md
rename to docs/content/3.docs/8.deployment/index.md
diff --git a/docs/content/3.docs/4.advanced/1.nuxt.md b/docs/content/3.docs/9.advanced/1.nuxt.md
similarity index 100%
rename from docs/content/3.docs/4.advanced/1.nuxt.md
rename to docs/content/3.docs/9.advanced/1.nuxt.md
diff --git a/docs/content/3.docs/4.advanced/2.modules.md b/docs/content/3.docs/9.advanced/2.modules.md
similarity index 97%
rename from docs/content/3.docs/4.advanced/2.modules.md
rename to docs/content/3.docs/9.advanced/2.modules.md
index 912bb2c0c57..1800bab0ae0 100644
--- a/docs/content/3.docs/4.advanced/2.modules.md
+++ b/docs/content/3.docs/9.advanced/2.modules.md
@@ -19,7 +19,7 @@ Starter template and module starter is a standard path of creating a Nuxt module
**Next steps:**
-- Open `my-module` in IDE of your choice (VSCode is recommended)
+- Open `my-module` in IDE of your choice (Visual Studio Code is recommended)
- Install dependencies using the package manager of your choice (Yarn is recommended)
- Ensure local files are generated using `npm run dev:prepare`
- Start playground using `npm run dev`
@@ -106,7 +106,7 @@ Result of `defineNuxtModule` is a wrapper function with `(inlineOptions, nuxt)`
- Automatically register Nuxt hooks
- Automatically check for compatibility issues based on module meta
- Expose `getOptions` and `getMeta` for internal usage of Nuxt
-- Ensuring backward and upward compatibility as long as the module is using `defineNuxtmodule` from the latest version of `@nuxt/kit`
+- Ensuring backward and upward compatibility as long as the module is using `defineNuxtModule` from the latest version of `@nuxt/kit`
- Integration with module builder tooling
## Best practices
@@ -125,7 +125,7 @@ Nuxt Modules should provide an explicit prefix for any exposed configuration, pl
Ideally you should prefix them with your module name (If your module is called `nuxt-foo`, expose `` and `useFooBar()` and **not** `` and `useBar()`)
-### Be Typescript Friendly
+### Be TypeScript Friendly
Nuxt 3, has first-class typescript integration for the best developer experience.
diff --git a/docs/content/3.docs/4.advanced/3.kit.md b/docs/content/3.docs/9.advanced/3.kit.md
similarity index 100%
rename from docs/content/3.docs/4.advanced/3.kit.md
rename to docs/content/3.docs/9.advanced/3.kit.md
diff --git a/docs/content/3.docs/4.advanced/4.hooks.md b/docs/content/3.docs/9.advanced/4.hooks.md
similarity index 100%
rename from docs/content/3.docs/4.advanced/4.hooks.md
rename to docs/content/3.docs/9.advanced/4.hooks.md
diff --git a/docs/content/4.examples/0.essentials/hello-world.md b/docs/content/4.examples/0.essentials/hello-world.md
new file mode 100644
index 00000000000..243c63daf23
--- /dev/null
+++ b/docs/content/4.examples/0.essentials/hello-world.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Hello world
+
+A minimal Nuxt 3 application only requires the `app.vue` and `nuxt.config.js` files.
+
+::alert{type=info icon=π}
+Read more about [installation](/getting-started/installation).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/essentials/hello-world" file="app.vue"}
diff --git a/docs/content/4.examples/1.app/error-handling.md b/docs/content/4.examples/1.app/error-handling.md
new file mode 100644
index 00000000000..83982209455
--- /dev/null
+++ b/docs/content/4.examples/1.app/error-handling.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Error Handling
+
+This example shows how to handle errors in different contexts: pages, plugins, components and middleware.
+
+::alert{type=info icon=π}
+Learn more about [error handling](/docs/usage/error-handling).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/app/errors" file="app.vue"}
diff --git a/docs/content/4.examples/1.app/plugins.md b/docs/content/4.examples/1.app/plugins.md
new file mode 100644
index 00000000000..93fa2e938f2
--- /dev/null
+++ b/docs/content/4.examples/1.app/plugins.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Plugins
+
+This example shows how to use the `plugins/` directory to auto-register plugins.
+
+::alert{type=info icon=π}
+Learn more about [plugins](/docs/directory-structure/plugins).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/app/plugins" file="app.vue"}
diff --git a/docs/content/4.examples/1.app/teleport.md b/docs/content/4.examples/1.app/teleport.md
new file mode 100644
index 00000000000..9efd5d149db
--- /dev/null
+++ b/docs/content/4.examples/1.app/teleport.md
@@ -0,0 +1,15 @@
+---
+template: Example
+---
+
+# Teleport
+
+Vue 3 provides the [`` component](https://vuejs.org/guide/built-ins/teleport.html) which allows content to be rendered elsewhere in the DOM, outside of the Vue application.
+
+This example shows how to use the `` with client-side and server-side rendering.
+
+::alert{type=info icon=π}
+Learn more about [teleports](/docs/usage/teleports).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/app/teleport" file="app.vue"}
diff --git a/docs/content/4.examples/2.auto-imports/components.md b/docs/content/4.examples/2.auto-imports/components.md
new file mode 100644
index 00000000000..43d7c9e8115
--- /dev/null
+++ b/docs/content/4.examples/2.auto-imports/components.md
@@ -0,0 +1,14 @@
+---
+template: Example
+---
+
+# Components
+
+Components in the `components/` directory are auto imported and can be directly used in your templates.
+You can configure other directories to support components auto-imports.
+
+::alert{type=info icon=π}
+Read more about [the components directory](/docs/directory-structure/components).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/auto-imports/components" file="app.vue"}
diff --git a/docs/content/4.examples/2.auto-imports/composables.md b/docs/content/4.examples/2.auto-imports/composables.md
new file mode 100644
index 00000000000..7dfa050ecf0
--- /dev/null
+++ b/docs/content/4.examples/2.auto-imports/composables.md
@@ -0,0 +1,14 @@
+---
+template: Example
+---
+
+# Composables
+
+This example shows how to use the `composables/` directory to auto import composables.
+If the component file provides a default export, the name of the composable will be mapped to the name of the file. Named exports can be used as-is.
+
+::alert{type=info icon=π}
+Read more about [the composables directory](/docs/directory-structure/composables).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/auto-imports/composables" file="app.vue"}
diff --git a/docs/content/4.examples/3.composables/use-async-data.md b/docs/content/4.examples/3.composables/use-async-data.md
new file mode 100644
index 00000000000..e5fe6becfa3
--- /dev/null
+++ b/docs/content/4.examples/3.composables/use-async-data.md
@@ -0,0 +1,17 @@
+---
+template: Example
+---
+
+# useAsyncData
+
+This example shows how to use `useAsyncData` to fetch data from an API endpoint.
+
+::alert{type=info icon=π‘}
+Nuxt will automatically read files in the ~/server/api directory to create API endpoints.
+::
+
+::alert{type=info icon=π}
+Learn more about [data fetching](/docs/usage/data-fetching).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-async-data" file="app.vue"}
diff --git a/docs/content/4.examples/3.composables/use-cookie.md b/docs/content/4.examples/3.composables/use-cookie.md
new file mode 100644
index 00000000000..bd71e424218
--- /dev/null
+++ b/docs/content/4.examples/3.composables/use-cookie.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# useCookie
+
+This example shows how to use the `useCookie` API to persist small amounts of data that both client-side and server-side can use.
+
+::alert{type=info icon=π}
+Learn more about [useCookie](/docs/usage/cookies).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-cookie" file="app.vue"}
diff --git a/docs/content/4.examples/3.composables/use-fetch.md b/docs/content/4.examples/3.composables/use-fetch.md
new file mode 100644
index 00000000000..05ab182db90
--- /dev/null
+++ b/docs/content/4.examples/3.composables/use-fetch.md
@@ -0,0 +1,17 @@
+---
+template: Example
+---
+
+# useFetch
+
+This example shows how to use `useFetch` to fetch data from an API endpoint.
+
+::alert{type=info icon=π‘}
+Nuxt will automatically read files in the ~/server/api directory to create API endpoints.
+::
+
+::alert{type=info icon=π}
+Learn more about [data fetching](/docs/usage/data-fetching).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-fetch" file="app.vue"}
diff --git a/docs/content/4.examples/3.composables/use-meta.md b/docs/content/4.examples/3.composables/use-meta.md
new file mode 100644
index 00000000000..b910efab732
--- /dev/null
+++ b/docs/content/4.examples/3.composables/use-meta.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# useMeta
+
+This example shows how to use `useMeta` and Nuxt built-in components to bind meta data to the head of the page.
+
+::alert{type=info icon=π}
+Learn more about [meta tags](/docs/usage/meta-tags).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-meta" file="app.vue"}
diff --git a/docs/content/4.examples/3.composables/use-state.md b/docs/content/4.examples/3.composables/use-state.md
new file mode 100644
index 00000000000..524a2fe73a1
--- /dev/null
+++ b/docs/content/4.examples/3.composables/use-state.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# useState
+
+`useState` is an SSR-friendly ref replacement. Its value will be preserved after server-side rendering and shared across all components using a unique key.
+
+::alert{type=info icon=π}
+Learn more about [useState](/docs/usage/state).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-state" file="app.vue"}
diff --git a/docs/content/4.examples/4.routing/layouts.md b/docs/content/4.examples/4.routing/layouts.md
new file mode 100644
index 00000000000..309aba9486d
--- /dev/null
+++ b/docs/content/4.examples/4.routing/layouts.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Layouts
+
+This example shows how to define default and custom layouts.
+
+::alert{type=info icon=π}
+Learn more about [layouts](/docs/directory-structure/layouts).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/routing/layouts" file="pages/index.vue"}
diff --git a/docs/content/4.examples/4.routing/middleware.md b/docs/content/4.examples/4.routing/middleware.md
new file mode 100644
index 00000000000..a867f19c671
--- /dev/null
+++ b/docs/content/4.examples/4.routing/middleware.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Middleware
+
+This example shows how to add route middleware with the middleware/ directory or with a plugin, and how to use them globally or per page.
+
+::alert{type=info icon=π}
+Learn more about [middleware](/docs/directory-structure/middleware).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/routing/middleware" file="app.vue"}
diff --git a/docs/content/4.examples/4.routing/nuxt-link.md b/docs/content/4.examples/4.routing/nuxt-link.md
new file mode 100644
index 00000000000..8be8cd7ae53
--- /dev/null
+++ b/docs/content/4.examples/4.routing/nuxt-link.md
@@ -0,0 +1,17 @@
+---
+template: Example
+---
+
+# NuxtLink
+
+This example shows different ways to use Nuxtlink.
+
+::alert{type=info icon=π‘}
+`components/myNuxtLink.js` defines a custom NuxtLink.
+::
+
+::alert{type=info icon=π}
+Learn more about [NuxtLink](/docs/usage/nuxt-link).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/routing/nuxt-link" file="app.vue"}
diff --git a/docs/content/4.examples/4.routing/pages.md b/docs/content/4.examples/4.routing/pages.md
new file mode 100644
index 00000000000..96d3f63d893
--- /dev/null
+++ b/docs/content/4.examples/4.routing/pages.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Pages
+
+This example shows how to use the `pages/` directory to create application routes.
+
+::alert{type=info icon=π}
+Learn more about [pages](/docs/directory-structure/pages).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/routing/pages" file="app.vue"}
diff --git a/docs/content/4.examples/4.routing/universal-router.md b/docs/content/4.examples/4.routing/universal-router.md
new file mode 100644
index 00000000000..f52df483701
--- /dev/null
+++ b/docs/content/4.examples/4.routing/universal-router.md
@@ -0,0 +1,9 @@
+---
+template: Example
+---
+
+# Universal Router
+
+This example demonstrates Nuxt universal routing utilities without depending on `pages/` and `vue-router`.
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/routing/universal-router" file="app.vue"}
diff --git a/docs/content/4.examples/5.advanced/config-extends.md b/docs/content/4.examples/5.advanced/config-extends.md
new file mode 100644
index 00000000000..44e12bdfb73
--- /dev/null
+++ b/docs/content/4.examples/5.advanced/config-extends.md
@@ -0,0 +1,9 @@
+---
+template: Example
+---
+
+# Config extends
+
+This example shows how to use the `extends` key in nuxt.config.ts to use the base/ directory as a base Nuxt application, and use its components, composables or config and override them if necessary.
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/advanced/config-extends" file="nuxt.config.ts"}
diff --git a/docs/content/4.examples/5.advanced/module-extend-pages.md b/docs/content/4.examples/5.advanced/module-extend-pages.md
new file mode 100644
index 00000000000..c34fd92af3c
--- /dev/null
+++ b/docs/content/4.examples/5.advanced/module-extend-pages.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Module Extend pages
+
+This example defines a new `test` page using `extendPages` within a module.
+
+::alert{type=info icon=π}
+Learn more about [modules creation](/docs/advanced/modules).
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/advanced/module-extend-pages" file="pages/index.vue"}
diff --git a/docs/content/4.examples/5.advanced/test.md b/docs/content/4.examples/5.advanced/test.md
new file mode 100644
index 00000000000..fdf30782073
--- /dev/null
+++ b/docs/content/4.examples/5.advanced/test.md
@@ -0,0 +1,7 @@
+---
+template: Example
+---
+
+# Test
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/advanced/test" file="app.vue"}
diff --git a/docs/content/4.examples/6.experimental/reactivity-transform.md b/docs/content/4.examples/6.experimental/reactivity-transform.md
new file mode 100644
index 00000000000..888b6c4f871
--- /dev/null
+++ b/docs/content/4.examples/6.experimental/reactivity-transform.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Reactivity Transform
+
+This example demonstrates the support of Reactivity transform in Nuxt 3.
+
+::alert{type=info icon=π}
+Learn more about [Reactivity transform](https://vuejs.org/guide/extras/reactivity-transform.html) on the Vue docs.
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/experimental/reactivity-transform" file="app.vue"}
diff --git a/docs/content/4.examples/6.experimental/wasm.md b/docs/content/4.examples/6.experimental/wasm.md
new file mode 100644
index 00000000000..6dd502905a5
--- /dev/null
+++ b/docs/content/4.examples/6.experimental/wasm.md
@@ -0,0 +1,9 @@
+---
+template: Example
+---
+
+# Wasm
+
+This example demonstrates the server-side support of WebAssembly in Nuxt 3.
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/experimental/wasm" file="app.vue"}
diff --git a/docs/content/4.examples/7.other/locale.md b/docs/content/4.examples/7.other/locale.md
new file mode 100644
index 00000000000..01c37c2dce6
--- /dev/null
+++ b/docs/content/4.examples/7.other/locale.md
@@ -0,0 +1,13 @@
+---
+template: Example
+---
+
+# Locale
+
+This example shows how to define a locale composable to handle the application's locale, both server and client-side.
+
+::alert{type=info icon=π‘}
+You can right click to "View Page Source" and see that Nuxt renders the correct date in SSR based on visitor's locale.
+::
+
+::sandbox{repo="nuxt/framework" branch="main" dir="examples/other/locale" file="app.vue"}
diff --git a/docs/content/4.examples/index.md b/docs/content/4.examples/index.md
new file mode 100644
index 00000000000..acf6d0c78ac
--- /dev/null
+++ b/docs/content/4.examples/index.md
@@ -0,0 +1,9 @@
+---
+title: Examples
+layout.aside: true
+layout.fluid: true
+navigation:
+ exclusive: true
+ collapse: true
+ redirect: /examples/essentials/hello-world
+---
diff --git a/docs/content/4.community/1.getting-help.md b/docs/content/5.community/1.getting-help.md
similarity index 100%
rename from docs/content/4.community/1.getting-help.md
rename to docs/content/5.community/1.getting-help.md
diff --git a/docs/content/4.community/2.reporting-bugs.md b/docs/content/5.community/2.reporting-bugs.md
similarity index 100%
rename from docs/content/4.community/2.reporting-bugs.md
rename to docs/content/5.community/2.reporting-bugs.md
diff --git a/docs/content/4.community/3.contribution.md b/docs/content/5.community/3.contribution.md
similarity index 100%
rename from docs/content/4.community/3.contribution.md
rename to docs/content/5.community/3.contribution.md
diff --git a/docs/content/4.community/4.roadmap.md b/docs/content/5.community/4.roadmap.md
similarity index 91%
rename from docs/content/4.community/4.roadmap.md
rename to docs/content/5.community/4.roadmap.md
index 45b5fe8acbf..f818fb53524 100644
--- a/docs/content/4.community/4.roadmap.md
+++ b/docs/content/5.community/4.roadmap.md
@@ -6,14 +6,15 @@ Nuxt is constantly evolving, with new features and modules being added all the t
- [Nuxt 3 Beta](https://nuxtjs.org/announcements/nuxt3-beta/)
- [Nuxt 3 Release Candidate](https://github.com/nuxt/framework/discussions/3447)
+- [Nuxt 3 Migration Guide](https://github.com/nuxt/framework/discussions/3989)
## π Release schedule
-Release | Expected date | Description
---------------------|---------------|---------------------------------------------------
-`nuxt@3.0.0-rc.1` | March 2022 | Nuxt v3 first release candidate
-`nuxt@2.16` | March 2022 | Nuxt v2 cumulative updates for future compatibility
-`nuxt@3.0.0` | June 2022 | Nuxt v3 stable release
+Release | Expected date | Description
+--------------------|-----------------|---------------------------------------------------
+`nuxt@3.0.0-rc.1` | April 7, 2022 | Nuxt v3 first release candidate
+`nuxt@2.16` | April, 2022 | Nuxt v2 cumulative updates for future compatibility
+`nuxt@3.0.0` | June 2022 | Nuxt v3 stable release
### Current Releases
diff --git a/docs/content/4.community/index.md b/docs/content/5.community/index.md
similarity index 100%
rename from docs/content/4.community/index.md
rename to docs/content/5.community/index.md
diff --git a/docs/content/_collections/header.md b/docs/content/_collections/header.md
index ce34c8f6b10..69ad9598b0f 100644
--- a/docs/content/_collections/header.md
+++ b/docs/content/_collections/header.md
@@ -9,6 +9,9 @@ links:
-
title: 'Docs'
to: '/docs/usage/data-fetching'
+ -
+ title: 'Examples'
+ to: '/examples/essentials/hello-world'
-
title: 'Community'
to: '/community/getting-help'
diff --git a/docs/content/index.md b/docs/content/index.md
index 88db430571e..1cd57373a93 100644
--- a/docs/content/index.md
+++ b/docs/content/index.md
@@ -96,7 +96,7 @@ Nuxt 3 has been re-architected with a smaller core and optimized for faster perf
::section-content-item
---
title: Nuxt Kit
- description: 'Brand new module development with Typescript and cross-version compatibility.'
+ description: 'Brand new module development with TypeScript and cross-version compatibility.'
image: IconKit
imageClass: w-10 h-10
---
diff --git a/docs/package.json b/docs/package.json
index 1a4aa02d38c..b2e27906879 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -18,11 +18,11 @@
"pathe": "^0.2.0",
"rimraf": "^3.0.2",
"scule": "^0.2.1",
- "untyped": "^0.4.3",
+ "untyped": "^0.4.4",
"vue-mq": "^1.0.1",
"vue-plausible": "^1.3.1"
},
"dependencies": {
- "three": "^0.139.0"
+ "three": "^0.139.2"
}
}
diff --git a/docs/yarn.lock b/docs/yarn.lock
index c8729683a8c..9e7f1a7ba20 100644
--- a/docs/yarn.lock
+++ b/docs/yarn.lock
@@ -10837,10 +10837,10 @@ thread-loader@^3.0.4:
neo-async "^2.6.2"
schema-utils "^3.0.0"
-three@^0.139.0:
- version "0.139.0"
- resolved "https://registry.yarnpkg.com/three/-/three-0.139.0.tgz#4805eeb4cde85d8a82b6048088230f8ce5b75375"
- integrity sha512-hZ4LkCjgoEM82WLaOVptDKGpB3SkEyuJP2OHe36AFO8hS2I6CrEiNanXj7wwR3wIPT7V5wi5Y5pFnncS5SVHgQ==
+three@^0.139.2:
+ version "0.139.2"
+ resolved "https://registry.yarnpkg.com/three/-/three-0.139.2.tgz#b110799a15736df673b9293e31653a4ac73648dd"
+ integrity sha512-gV7q7QY8rogu7HLFZR9cWnOQAUedUhu2WXAnpr2kdXZP9YDKsG/0ychwQvWkZN5PlNw9mv5MoCTin6zNTXoONg==
through2@^2.0.0:
version "2.0.5"
@@ -11389,10 +11389,10 @@ untyped@^0.2.5, untyped@^0.2.8, untyped@^0.2.9:
resolved "https://registry.yarnpkg.com/untyped/-/untyped-0.2.9.tgz#3e3df96a303dec3e2eda55fcbdc02e2ab468683d"
integrity sha512-8d8V+q/y5CGzV+IYnoOCMjrK+NSNp1HKO8iPQ+bV4rBP8knPIme3+j/bpej8IuMnEMxOJZNptXNOXCx7w+VJxQ==
-untyped@^0.4.3:
- version "0.4.3"
- resolved "https://registry.yarnpkg.com/untyped/-/untyped-0.4.3.tgz#284011a22b79787e050b3692e17fdffcaa41860e"
- integrity sha512-IFlE2be3vW69rLjdkmj5pa/JK/rAzbvFyJZfs+63QX/RN+jgx2CQUZckhTxNsV2H/JSXfc7NEqpX8tLoI2+eOg==
+untyped@^0.4.4:
+ version "0.4.4"
+ resolved "https://registry.yarnpkg.com/untyped/-/untyped-0.4.4.tgz#a3043588892266c9176e7049799a65aaa9e4db4b"
+ integrity sha512-sY6u8RedwfLfBis0copfU/fzROieyAndqPs8Kn2PfyzTjtA88vCk81J1b5z+8/VJc+cwfGy23/AqOCpvAbkNVw==
dependencies:
"@babel/core" "^7.17.7"
"@babel/standalone" "^7.17.7"
diff --git a/examples/README.md b/examples/README.md
index cd0f41be6b6..025e64a94ea 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -10,10 +10,10 @@
| `use-fetch` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/use-fetch) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/use-fetch?file=app.vue&terminal=dev) |
| `use-meta` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/use-meta) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/use-meta?file=app.vue&terminal=dev) |
| `use-state` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/use-state) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/use-state?file=app.vue&terminal=dev) |
-| `with-components` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-components) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-components?file=app.vue&terminal=dev) |
-| `with-composables` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-composables) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-composables?file=app.vue&terminal=dev) |
-| `with-layouts` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-layouts) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-layouts?file=app.vue&terminal=dev) |
-| `with-pages` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-pages) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-pages?file=app.vue&terminal=dev) |
-| `with-plugins` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-plugins) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-plugins?file=app.vue&terminal=dev) |
-| `with-universal-router` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-universal-router) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-universal-router?file=app.vue&terminal=dev) |
-| `with-wasm` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/with-wasm) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/with-wasm?file=app.vue&terminal=dev) |
+| `components` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/components) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/components?file=app.vue&terminal=dev) |
+| `composables` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/composables) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/composables?file=app.vue&terminal=dev) |
+| `layouts` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/layouts) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/layouts?file=app.vue&terminal=dev) |
+| `pages` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/pages) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/pages?file=app.vue&terminal=dev) |
+| `plugins` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/plugins) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/plugins?file=app.vue&terminal=dev) |
+| `universal-router` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/universal-router) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/universal-router?file=app.vue&terminal=dev) |
+| `wasm` | [GitHub](https://github.com/nuxt/framework/tree/main/examples/wasm) | [Play Online](https://stackblitz.com/github/nuxt/framework/tree/main/examples/wasm?file=app.vue&terminal=dev) |
diff --git a/examples/config-extends/base/components/BaseButton.vue b/examples/advanced/config-extends/base/components/BaseButton.vue
similarity index 100%
rename from examples/config-extends/base/components/BaseButton.vue
rename to examples/advanced/config-extends/base/components/BaseButton.vue
diff --git a/examples/config-extends/base/components/FancyButton.vue b/examples/advanced/config-extends/base/components/FancyButton.vue
similarity index 100%
rename from examples/config-extends/base/components/FancyButton.vue
rename to examples/advanced/config-extends/base/components/FancyButton.vue
diff --git a/examples/config-extends/base/composables/foo.ts b/examples/advanced/config-extends/base/composables/foo.ts
similarity index 100%
rename from examples/config-extends/base/composables/foo.ts
rename to examples/advanced/config-extends/base/composables/foo.ts
diff --git a/examples/config-extends/base/middleware/foo.ts b/examples/advanced/config-extends/base/middleware/foo.ts
similarity index 100%
rename from examples/config-extends/base/middleware/foo.ts
rename to examples/advanced/config-extends/base/middleware/foo.ts
diff --git a/examples/config-extends/base/nuxt.config.ts b/examples/advanced/config-extends/base/nuxt.config.ts
similarity index 100%
rename from examples/config-extends/base/nuxt.config.ts
rename to examples/advanced/config-extends/base/nuxt.config.ts
diff --git a/examples/config-extends/base/pages/foo.vue b/examples/advanced/config-extends/base/pages/foo.vue
similarity index 100%
rename from examples/config-extends/base/pages/foo.vue
rename to examples/advanced/config-extends/base/pages/foo.vue
diff --git a/examples/config-extends/base/plugins/my-plugin.ts b/examples/advanced/config-extends/base/plugins/my-plugin.ts
similarity index 100%
rename from examples/config-extends/base/plugins/my-plugin.ts
rename to examples/advanced/config-extends/base/plugins/my-plugin.ts
diff --git a/examples/config-extends/base/server/api/base.ts b/examples/advanced/config-extends/base/server/api/base.ts
similarity index 100%
rename from examples/config-extends/base/server/api/base.ts
rename to examples/advanced/config-extends/base/server/api/base.ts
diff --git a/examples/config-extends/base/utils/bar.ts b/examples/advanced/config-extends/base/utils/bar.ts
similarity index 100%
rename from examples/config-extends/base/utils/bar.ts
rename to examples/advanced/config-extends/base/utils/bar.ts
diff --git a/examples/config-extends/components/FancyButton.vue b/examples/advanced/config-extends/components/FancyButton.vue
similarity index 100%
rename from examples/config-extends/components/FancyButton.vue
rename to examples/advanced/config-extends/components/FancyButton.vue
diff --git a/examples/config-extends/nuxt.config.ts b/examples/advanced/config-extends/nuxt.config.ts
similarity index 100%
rename from examples/config-extends/nuxt.config.ts
rename to examples/advanced/config-extends/nuxt.config.ts
diff --git a/examples/config-extends/package.json b/examples/advanced/config-extends/package.json
similarity index 100%
rename from examples/config-extends/package.json
rename to examples/advanced/config-extends/package.json
diff --git a/examples/config-extends/pages/index.vue b/examples/advanced/config-extends/pages/index.vue
similarity index 57%
rename from examples/config-extends/pages/index.vue
rename to examples/advanced/config-extends/pages/index.vue
index 75814a417ef..549b1d0dc59 100644
--- a/examples/config-extends/pages/index.vue
+++ b/examples/advanced/config-extends/pages/index.vue
@@ -5,7 +5,7 @@ const bar = getBar()
-
+
theme runtimeConfig
{{ JSON.stringify(themeConfig, null, 2) }}
Base Button
@@ -15,11 +15,6 @@ const bar = getBar()
{{ foo }} {{ bar }}
{{ $myPlugin() }}
-
-
- This example shows how to use the extends key in nuxt.config.ts to use the base/ directory as a base Nuxt application, and use its components, composable or config and override them if necessary.
-
-
diff --git a/examples/config-extends/server/api/hello.ts b/examples/advanced/config-extends/server/api/hello.ts
similarity index 100%
rename from examples/config-extends/server/api/hello.ts
rename to examples/advanced/config-extends/server/api/hello.ts
diff --git a/examples/config-extends/tsconfig.json b/examples/advanced/config-extends/tsconfig.json
similarity index 100%
rename from examples/config-extends/tsconfig.json
rename to examples/advanced/config-extends/tsconfig.json
diff --git a/examples/config-extends/ui/components/Button.vue b/examples/advanced/config-extends/ui/components/Button.vue
similarity index 100%
rename from examples/config-extends/ui/components/Button.vue
rename to examples/advanced/config-extends/ui/components/Button.vue
diff --git a/examples/config-extends/ui/nuxt.config.ts b/examples/advanced/config-extends/ui/nuxt.config.ts
similarity index 100%
rename from examples/config-extends/ui/nuxt.config.ts
rename to examples/advanced/config-extends/ui/nuxt.config.ts
diff --git a/examples/advanced/module-extend-pages/layouts/default.vue b/examples/advanced/module-extend-pages/layouts/default.vue
new file mode 100644
index 00000000000..b1a49db13c6
--- /dev/null
+++ b/examples/advanced/module-extend-pages/layouts/default.vue
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/examples/module-extend-pages/modules/pages/index.ts b/examples/advanced/module-extend-pages/modules/pages/index.ts
similarity index 100%
rename from examples/module-extend-pages/modules/pages/index.ts
rename to examples/advanced/module-extend-pages/modules/pages/index.ts
diff --git a/examples/module-extend-pages/modules/pages/pages/test.vue b/examples/advanced/module-extend-pages/modules/pages/pages/test.vue
similarity index 100%
rename from examples/module-extend-pages/modules/pages/pages/test.vue
rename to examples/advanced/module-extend-pages/modules/pages/pages/test.vue
diff --git a/examples/module-extend-pages/nuxt.config.ts b/examples/advanced/module-extend-pages/nuxt.config.ts
similarity index 100%
rename from examples/module-extend-pages/nuxt.config.ts
rename to examples/advanced/module-extend-pages/nuxt.config.ts
diff --git a/examples/module-extend-pages/package.json b/examples/advanced/module-extend-pages/package.json
similarity index 100%
rename from examples/module-extend-pages/package.json
rename to examples/advanced/module-extend-pages/package.json
diff --git a/examples/module-extend-pages/pages/index.vue b/examples/advanced/module-extend-pages/pages/index.vue
similarity index 100%
rename from examples/module-extend-pages/pages/index.vue
rename to examples/advanced/module-extend-pages/pages/index.vue
diff --git a/examples/hello-world/tsconfig.json b/examples/advanced/module-extend-pages/tsconfig.json
similarity index 100%
rename from examples/hello-world/tsconfig.json
rename to examples/advanced/module-extend-pages/tsconfig.json
diff --git a/examples/with-test/app.vue b/examples/advanced/test/app.vue
similarity index 100%
rename from examples/with-test/app.vue
rename to examples/advanced/test/app.vue
diff --git a/examples/hello-world/nuxt.config.ts b/examples/advanced/test/nuxt.config.ts
similarity index 100%
rename from examples/hello-world/nuxt.config.ts
rename to examples/advanced/test/nuxt.config.ts
diff --git a/examples/with-test/package.json b/examples/advanced/test/package.json
similarity index 84%
rename from examples/with-test/package.json
rename to examples/advanced/test/package.json
index cb24fd93641..50a91c5b67f 100644
--- a/examples/with-test/package.json
+++ b/examples/advanced/test/package.json
@@ -1,5 +1,5 @@
{
- "name": "example-with-test",
+ "name": "example-test",
"private": true,
"scripts": {
"build": "nuxi build",
diff --git a/examples/with-test/tests/basic.test.ts b/examples/advanced/test/tests/basic.test.ts
similarity index 100%
rename from examples/with-test/tests/basic.test.ts
rename to examples/advanced/test/tests/basic.test.ts
diff --git a/examples/locale/tsconfig.json b/examples/advanced/test/tsconfig.json
similarity index 100%
rename from examples/locale/tsconfig.json
rename to examples/advanced/test/tsconfig.json
diff --git a/examples/with-errors/app.vue b/examples/app/error-handling/app.vue
similarity index 76%
rename from examples/with-errors/app.vue
rename to examples/app/error-handling/app.vue
index c1b3b30102e..66f9ee9c715 100644
--- a/examples/with-errors/app.vue
+++ b/examples/app/error-handling/app.vue
@@ -15,7 +15,7 @@ function triggerError () {
-
+
-
-
-
This example shows how to handle errors in different contexts: pages, plugins, components and middleware.
- This demo showcases using the
-
- useCookie
-
- API to persist small amounts of data that can be used both client-side and server-side.
-
-
diff --git a/examples/use-meta/nuxt.config.ts b/examples/composables/use-cookie/nuxt.config.ts
similarity index 100%
rename from examples/use-meta/nuxt.config.ts
rename to examples/composables/use-cookie/nuxt.config.ts
diff --git a/examples/use-cookie/package.json b/examples/composables/use-cookie/package.json
similarity index 100%
rename from examples/use-cookie/package.json
rename to examples/composables/use-cookie/package.json
diff --git a/examples/use-meta/tsconfig.json b/examples/composables/use-cookie/tsconfig.json
similarity index 100%
rename from examples/use-meta/tsconfig.json
rename to examples/composables/use-cookie/tsconfig.json
diff --git a/examples/composables/use-fetch/app.vue b/examples/composables/use-fetch/app.vue
new file mode 100644
index 00000000000..9054d508f8a
--- /dev/null
+++ b/examples/composables/use-fetch/app.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Fetch result:
+
{{ data }}
+
+ +
+
+
+
+
diff --git a/examples/use-state/nuxt.config.ts b/examples/composables/use-fetch/nuxt.config.ts
similarity index 100%
rename from examples/use-state/nuxt.config.ts
rename to examples/composables/use-fetch/nuxt.config.ts
diff --git a/examples/use-fetch/package.json b/examples/composables/use-fetch/package.json
similarity index 100%
rename from examples/use-fetch/package.json
rename to examples/composables/use-fetch/package.json
diff --git a/examples/use-fetch/server/api/hello.ts b/examples/composables/use-fetch/server/api/hello.ts
similarity index 100%
rename from examples/use-fetch/server/api/hello.ts
rename to examples/composables/use-fetch/server/api/hello.ts
diff --git a/examples/with-components/tsconfig.json b/examples/composables/use-fetch/tsconfig.json
similarity index 100%
rename from examples/with-components/tsconfig.json
rename to examples/composables/use-fetch/tsconfig.json
diff --git a/examples/use-meta/app.vue b/examples/composables/use-meta/app.vue
similarity index 64%
rename from examples/use-meta/app.vue
rename to examples/composables/use-meta/app.vue
index 7590d28092c..a7297f7956a 100644
--- a/examples/use-meta/app.vue
+++ b/examples/composables/use-meta/app.vue
@@ -1,5 +1,5 @@
-
+
@@ -20,21 +20,6 @@
Click me and see the dynamic title
-
-
-
-
- This example shows how to use useMeta and Nuxt built-in components to bind meta data to the head of the page.
-
-
- Learn more about
-
- Meta tags
- .
- Open in editor to see the source code π
-
-
-
diff --git a/examples/with-composables/nuxt.config.ts b/examples/composables/use-meta/nuxt.config.ts
similarity index 100%
rename from examples/with-composables/nuxt.config.ts
rename to examples/composables/use-meta/nuxt.config.ts
diff --git a/examples/use-meta/package.json b/examples/composables/use-meta/package.json
similarity index 100%
rename from examples/use-meta/package.json
rename to examples/composables/use-meta/package.json
diff --git a/examples/with-errors/tsconfig.json b/examples/composables/use-meta/tsconfig.json
similarity index 100%
rename from examples/with-errors/tsconfig.json
rename to examples/composables/use-meta/tsconfig.json
diff --git a/examples/composables/use-state/app.vue b/examples/composables/use-state/app.vue
new file mode 100644
index 00000000000..479ecfc8938
--- /dev/null
+++ b/examples/composables/use-state/app.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
Counter: {{ counter }}
+
+
+ +
+
+
+ -
+
+
+
+
diff --git a/examples/with-errors/nuxt.config.ts b/examples/composables/use-state/nuxt.config.ts
similarity index 100%
rename from examples/with-errors/nuxt.config.ts
rename to examples/composables/use-state/nuxt.config.ts
diff --git a/examples/use-state/package.json b/examples/composables/use-state/package.json
similarity index 100%
rename from examples/use-state/package.json
rename to examples/composables/use-state/package.json
diff --git a/examples/use-state/tsconfig.json b/examples/composables/use-state/tsconfig.json
similarity index 100%
rename from examples/use-state/tsconfig.json
rename to examples/composables/use-state/tsconfig.json
diff --git a/examples/hello-world/app.vue b/examples/essentials/hello-world/app.vue
similarity index 100%
rename from examples/hello-world/app.vue
rename to examples/essentials/hello-world/app.vue
diff --git a/examples/with-test/nuxt.config.ts b/examples/essentials/hello-world/nuxt.config.ts
similarity index 100%
rename from examples/with-test/nuxt.config.ts
rename to examples/essentials/hello-world/nuxt.config.ts
diff --git a/examples/hello-world/package.json b/examples/essentials/hello-world/package.json
similarity index 100%
rename from examples/hello-world/package.json
rename to examples/essentials/hello-world/package.json
diff --git a/examples/with-layouts/tsconfig.json b/examples/essentials/hello-world/tsconfig.json
similarity index 100%
rename from examples/with-layouts/tsconfig.json
rename to examples/essentials/hello-world/tsconfig.json
diff --git a/examples/experimental/reactivity-transform/app.vue b/examples/experimental/reactivity-transform/app.vue
new file mode 100644
index 00000000000..b89750f8721
--- /dev/null
+++ b/examples/experimental/reactivity-transform/app.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+ Inc
+
+
+ Dec
+
+
+
+
+
diff --git a/examples/with-reactivity-transform/label.vue b/examples/experimental/reactivity-transform/components/label.vue
similarity index 100%
rename from examples/with-reactivity-transform/label.vue
rename to examples/experimental/reactivity-transform/components/label.vue
diff --git a/examples/with-reactivity-transform/nuxt.config.ts b/examples/experimental/reactivity-transform/nuxt.config.ts
similarity index 100%
rename from examples/with-reactivity-transform/nuxt.config.ts
rename to examples/experimental/reactivity-transform/nuxt.config.ts
diff --git a/examples/with-composables/package.json b/examples/experimental/reactivity-transform/package.json
similarity index 83%
rename from examples/with-composables/package.json
rename to examples/experimental/reactivity-transform/package.json
index 666b5ab0e05..ea8e4cb6afc 100644
--- a/examples/with-composables/package.json
+++ b/examples/experimental/reactivity-transform/package.json
@@ -1,5 +1,5 @@
{
- "name": "example-with-composables",
+ "name": "example-reactivity-transform",
"private": true,
"scripts": {
"build": "nuxi build",
diff --git a/examples/with-middleware/tsconfig.json b/examples/experimental/reactivity-transform/tsconfig.json
similarity index 100%
rename from examples/with-middleware/tsconfig.json
rename to examples/experimental/reactivity-transform/tsconfig.json
diff --git a/examples/with-wasm/app.vue b/examples/experimental/wasm/app.vue
similarity index 69%
rename from examples/with-wasm/app.vue
rename to examples/experimental/wasm/app.vue
index 7320d8c66e6..193b6581c47 100644
--- a/examples/with-wasm/app.vue
+++ b/examples/experimental/wasm/app.vue
@@ -8,7 +8,7 @@ const { data } = await useAsyncData('sum',
-
+
a = 100
@@ -20,11 +20,5 @@ const { data } = await useAsyncData('sum',
{{ a }} + {{ b }} = {{ data.sum }}
-
-
-
- This example demonstrates the server-side support of WebAssembly in Nuxt 3.
-
-
diff --git a/examples/with-wasm/nuxt.config.ts b/examples/experimental/wasm/nuxt.config.ts
similarity index 100%
rename from examples/with-wasm/nuxt.config.ts
rename to examples/experimental/wasm/nuxt.config.ts
diff --git a/examples/experimental/wasm/package.json b/examples/experimental/wasm/package.json
new file mode 100644
index 00000000000..c398eb875b7
--- /dev/null
+++ b/examples/experimental/wasm/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "example-wasm",
+ "private": true,
+ "devDependencies": {
+ "@nuxt/ui": "npm:@nuxt/ui-edge@latest",
+ "nuxt3": "latest"
+ },
+ "scripts": {
+ "dev": "nuxi dev",
+ "build": "nuxi build",
+ "start": "nuxi preview"
+ }
+}
diff --git a/examples/with-wasm/server/api/sum.ts b/examples/experimental/wasm/server/api/sum.ts
similarity index 100%
rename from examples/with-wasm/server/api/sum.ts
rename to examples/experimental/wasm/server/api/sum.ts
diff --git a/examples/with-wasm/server/wasm/sum.wasm b/examples/experimental/wasm/server/wasm/sum.wasm
similarity index 100%
rename from examples/with-wasm/server/wasm/sum.wasm
rename to examples/experimental/wasm/server/wasm/sum.wasm
diff --git a/examples/with-wasm/server/wasm/sum.wat b/examples/experimental/wasm/server/wasm/sum.wat
similarity index 100%
rename from examples/with-wasm/server/wasm/sum.wat
rename to examples/experimental/wasm/server/wasm/sum.wat
diff --git a/examples/with-pages/tsconfig.json b/examples/experimental/wasm/tsconfig.json
similarity index 100%
rename from examples/with-pages/tsconfig.json
rename to examples/experimental/wasm/tsconfig.json
diff --git a/examples/module-extend-pages/layouts/default.vue b/examples/module-extend-pages/layouts/default.vue
deleted file mode 100644
index fc8a25bd568..00000000000
--- a/examples/module-extend-pages/layouts/default.vue
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
- This example defines a new test page using extendPages within a module.
-
-
- useState
-
- is an SSR-friendly ref replacement.
- Its value will be preserved after server-side rendering
- and shared across all components using a unique key.
-